优化消费返现表单验证转为数字判断

This commit is contained in:
gyq
2025-12-22 11:19:58 +08:00
parent 85f882bee4
commit 455c7cea28

View File

@@ -17,7 +17,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="选择门店" prop="shopIdList" v-if="form.useType == 'part'">
<selectBranchs v-model="form.shopIdList" />
<selectBranchs all v-model="form.shopIdList" />
</el-form-item>
<el-form-item label="适用用户">
<el-radio-group v-model="form.applicableUser">
@@ -134,13 +134,13 @@ const rules = ref({
let errStr = ''
form.value.cashbackStepList.map(item => {
if (form.value.cashbackType == 'percentage') {
if (item.cashbackAmount > 100) {
if (+item.cashbackAmount > 100) {
flag = false
errStr = '输入有误请检查返现比例是不是大于100'
}
}
if (form.value.cashbackType == 'fix') {
if (!item.amount || !item.cashbackAmount || item.cashbackAmount > item.amount) {
if (!+item.amount || !+item.cashbackAmount || +item.cashbackAmount > +item.amount) {
flag = false
errStr = '输入有误,请检查返现金额是不是大于返现门槛'
}