From 93d50ebdbc73fbd99549cb256425293385663dd6 Mon Sep 17 00:00:00 2001
From: mayf <m13160102112@163.com>
Date: 星期五, 20 九月 2024 09:19:24 +0800
Subject: [PATCH] format代码
---
utils/coupon-form.js | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/utils/coupon-form.js b/utils/coupon-form.js
index cf3e885..d3e1eea 100644
--- a/utils/coupon-form.js
+++ b/utils/coupon-form.js
@@ -55,6 +55,7 @@
type: 'input-number',
el: {
min: 0,
+ max: 99999999,
precision: 2,
controls: false,
},
@@ -73,6 +74,7 @@
type: 'input-number',
el: {
min: 0.01,
+ max: 99999999,
precision: 2,
controls: false,
},
@@ -144,18 +146,14 @@
}
// 优惠券领取/发放记录
-export const couponRecordColumn = () => {
+export const couponRecordColumn = (timeName) => {
return [
{ label: '序号', type: 'index' },
{ label: '店铺名称', prop: 'customerName' },
- { label: '优惠券类型', prop: 'couponDiscountTypeName' },
- {
- label: '使用条件',
- formatter: (row) => `满${row.minOrderAmount}`,
- },
- { label: '优惠券面值', prop: 'couponDiscountValue' },
+ { label: '联系方式', prop: 'tel' },
+ { label: timeName, prop: 'createTime' },
{ label: '状态', prop: 'statusName' },
- { label: '使用时间', prop: 'index' },
+ { label: '使用时间', prop: 'usedTime' },
{ label: '订单号', prop: 'orderNo' },
]
}
@@ -171,3 +169,21 @@
},
}
}
+
+export const getImageUrlRules = (row, form) => {
+ const id = 'imageUrl'
+ let required = false
+ let message = ''
+ if (row.getType === 'home') {
+ required = true
+ message = '图片为必填项目'
+ }
+ const curField = form.find((field) => field.id === id)
+ if (curField && curField.rules && required) {
+ curField.rules.required = true
+ curField.rules.message = message
+ } else if (curField && curField.rules) {
+ curField.rules.required = false
+ curField.rules.message = message
+ }
+}
--
Gitblit v1.9.3