优惠劵清空

This commit is contained in:
魏啾 2024-11-14 11:39:39 +08:00
parent e9bd9cc2d8
commit 95713b5df1
1 changed files with 11 additions and 4 deletions

View File

@ -11,7 +11,8 @@
<template slot="append"></template>
</el-input>
<el-input style="margin-left: 20px; width: 220px;" placeholder="请输入金额"
v-model="form.giftAmount" @input="(v) => (form.giftAmount = v.replace(/^(0+)|[^\d]+/g, ''))">
v-model="form.giftAmount"
@input="(v) => (form.giftAmount = v.replace(/^(0+)|[^\d]+/g, ''))">
<template slot="prepend"></template>
<template slot="append"></template>
</el-input>
@ -39,7 +40,8 @@
</el-form-item> -->
<el-form-item label="是否使用优惠券">
<el-switch v-model="form.isUseCoupon" :active-value="1" :inactive-value="0"></el-switch>
<el-switch v-model="form.isUseCoupon" @change="statusChange($event, form.isUseCoupon)"
:active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="数量">
<el-input-number v-model="form.num" controls-position="right" :min="1"></el-input-number>
@ -177,6 +179,10 @@ export default {
return false;
}
this.form.couponId = this.productIds[0].id
} else {
this.form.couponId = ''
this.form.couponName = ''
this.productIds = []
}
// let arr = []
// this.productIds.forEach(ele => {
@ -207,14 +213,15 @@ export default {
})
},
async show(obj) {
this.productIds = []
this.dialogVisible = true
if (obj && obj.id) {
this.form = { ...obj }
//
// let res = await activate(obj.id)
// this.productIds = res
if (obj.couponName) {
if (obj.couponId) {
this.productIds = [{ title: obj.couponName }]
}
console.log(obj, '调试1')
}