Commit fed29fb0 by wuwx

折扣券,优惠内容,使用限制添加验证

1 parent f33e4390
......@@ -162,6 +162,9 @@ export default {
editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
discountIntensity: [{ required: true, message: '请输入优惠内容', trigger: 'change' }],
useBarriers: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
full: [{ required: true, message: '请输入金额', trigger: 'blur' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
......@@ -373,6 +376,12 @@ export default {
} else {
this.editRule.effectiveDays[0].required = false
}
if (form.useBarriers == '2') {
//判断 使用限制-订单满多少可用是否验证
this.editRule.full[0].required = true
} else {
this.editRule.full[0].required = false
}
if (this.editForm.discountIntensity == 0) {
this.editForm.discountIntensity = ''
}
......@@ -413,7 +422,7 @@ export default {
//库存
obj.stock = form.stock
//折扣
obj.discountIntensity = form.discountIntensity * 100
obj.discountIntensity = (form.discountIntensity * 100).toFixed(0)
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
......@@ -424,7 +433,7 @@ export default {
//是否定制礼包专用
obj.directionalFlag = form.directionalFlag
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0)
return obj
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!