优惠劵清空
This commit is contained in:
parent
e9bd9cc2d8
commit
95713b5df1
|
|
@ -11,7 +11,8 @@
|
||||||
<template slot="append">元</template>
|
<template slot="append">元</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-input style="margin-left: 20px; width: 220px;" placeholder="请输入金额"
|
<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="prepend">赠</template>
|
||||||
<template slot="append">元</template>
|
<template slot="append">元</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
@ -39,7 +40,8 @@
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
|
|
||||||
<el-form-item label="是否使用优惠券">
|
<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>
|
||||||
<el-form-item label="数量">
|
<el-form-item label="数量">
|
||||||
<el-input-number v-model="form.num" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.num" controls-position="right" :min="1"></el-input-number>
|
||||||
|
|
@ -177,6 +179,10 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.form.couponId = this.productIds[0].id
|
this.form.couponId = this.productIds[0].id
|
||||||
|
} else {
|
||||||
|
this.form.couponId = ''
|
||||||
|
this.form.couponName = ''
|
||||||
|
this.productIds = []
|
||||||
}
|
}
|
||||||
// let arr = []
|
// let arr = []
|
||||||
// this.productIds.forEach(ele => {
|
// this.productIds.forEach(ele => {
|
||||||
|
|
@ -207,14 +213,15 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async show(obj) {
|
async show(obj) {
|
||||||
|
this.productIds = []
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
if (obj && obj.id) {
|
if (obj && obj.id) {
|
||||||
this.form = { ...obj }
|
this.form = { ...obj }
|
||||||
|
// 留着以后说不定多个优惠劵
|
||||||
// let res = await activate(obj.id)
|
// let res = await activate(obj.id)
|
||||||
// this.productIds = res
|
// this.productIds = res
|
||||||
if (obj.couponName) {
|
if (obj.couponId) {
|
||||||
this.productIds = [{ title: obj.couponName }]
|
this.productIds = [{ title: obj.couponName }]
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log(obj, '调试1')
|
console.log(obj, '调试1')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue