|
@@ -109,7 +109,12 @@ export default {
|
|
this.getCouponNum()
|
|
this.getCouponNum()
|
|
},
|
|
},
|
|
|
|
|
|
- changeCouponNum() {
|
|
|
|
|
|
+ changeCouponNum(e) {
|
|
|
|
+ let rule = /^([1-9]\d*)$/;
|
|
|
|
+ if(!rule.test(e)) {
|
|
|
|
+ this.$message.error('优惠券数量格式错误');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.getPrice()
|
|
this.getPrice()
|
|
this.getCouponNum()
|
|
this.getCouponNum()
|
|
},
|
|
},
|
|
@@ -138,6 +143,17 @@ export default {
|
|
this.$message.error('请添加优惠券');
|
|
this.$message.error('请添加优惠券');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ let couponIndex = this.couponPkgItemList.findIndex((item) => {
|
|
|
|
+ let rule = /^([1-9]\d*)$/;
|
|
|
|
+ return !rule.test(item.couponNum);
|
|
|
|
+ });
|
|
|
|
+ // 判断优惠券数量格式
|
|
|
|
+ if (couponIndex != -1) {
|
|
|
|
+ this.$message.error(
|
|
|
|
+ `券${this.couponPkgItemList[couponIndex].title}的数量格式错误!`
|
|
|
|
+ );
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.addIng = true
|
|
this.addIng = true
|
|
let data = {
|
|
let data = {
|
|
title: this.addData.title,
|
|
title: this.addData.title,
|