diff --git a/src/views/modules/marketing/level/index.vue b/src/views/modules/marketing/level/index.vue
index 9dfa607..eaaab28 100644
--- a/src/views/modules/marketing/level/index.vue
+++ b/src/views/modules/marketing/level/index.vue
@@ -39,7 +39,7 @@
- 全部等级({{list.length}})全部等级({{ list.length }})+新增套餐
@@ -74,10 +74,16 @@
>
- {{scope.row.enableMemberDiscount ? '会员折扣,' :''}}
- {{scope.row.enablePointsRedemption ? '积分兑换,' : ''}}
- {{scope.row.enableBirthdayCoupons ? '生日优惠卷,' : ''}}
- {{scope.row.enableBirthdayReward ? '生日双倍积分' : ''}}
+ {{ scope.row.enableMemberDiscount ? "会员折扣," : "" }}
+ {{
+ scope.row.enablePointsRedemption ? "积分兑换," : ""
+ }}
+ {{
+ scope.row.enableBirthdayCoupons ? "生日优惠卷," : ""
+ }}
+ {{
+ scope.row.enableBirthdayReward ? "生日双倍积分" : ""
+ }}
@@ -102,7 +108,7 @@
-
+
@@ -127,7 +133,7 @@ export default {
this.formInline = {
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
marketId: this.marketId,
- shopId: "",
+ shopId: this.shopId,
};
this.getList();
},
diff --git a/src/views/modules/marketing/level/popup/add-coupon.vue b/src/views/modules/marketing/level/popup/add-coupon.vue
index fceb4d2..4143f9f 100644
--- a/src/views/modules/marketing/level/popup/add-coupon.vue
+++ b/src/views/modules/marketing/level/popup/add-coupon.vue
@@ -26,10 +26,24 @@ export default {
show: false,
width: "60%",
},
- modalData: {},
- value1: [],
+ modalData: {
+ couponsName: "",
+ couponsThreshold: 0,
+ couponsMinus: 0,
+ couponsEffectiveTimeType: "1",
+ },
};
},
+ watch: {
+ "modalConfig.show"(newVal) {
+ if (newVal) {
+ //关闭弹窗清空校验
+ setTimeout(() => {
+ this.$refs.modal.resetFields();
+ });
+ }
+ },
+ },
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
@@ -37,43 +51,33 @@ export default {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
- this.$refs.modal.resetFields();
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
- this.modalConfig.title = "添加优惠卷";
- this.$nextTick(() => {
- this.$refs.modal?.resetFields();
- });
- this.isAdd = true;
- if (row) {
+ console.log(row);
+ if (row.length > 0) {
this.modalData = row[0];
+ } else {
console.log("111");
- return;
+ this.modalData = {
+ couponsName: "",
+ couponsThreshold: 0,
+ couponsMinus: 0,
+ couponsEffectiveTimeType: "1",
+ };
}
- this.modalData = {
- couponsName: "",
- couponsThreshold: 0,
- couponsMinus: 0,
- couponsEffectiveTimeType: "1",
- };
- console.log("qqw");
+ this.modalConfig.title = "添加优惠卷";
+ this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
- init(row) {
- if (row) {
- this.modalData = row;
- return;
- }
- console.log("123");
- },
+ init(row) {},
},
computed: {
modalCols() {
@@ -146,7 +150,7 @@ export default {
},
{
label: "当月",
- value: "2",
+ value: "3",
},
].map((item) => {
return (
@@ -176,8 +180,11 @@ export default {
loading: this.isLoading,
submit: true,
handle: () => {
- console.log(this.modalData);
- this.$emit("addCouponData", this.modalData);
+ console.log(JSON.parse(JSON.stringify(this.modalData)));
+ this.$emit(
+ "addCouponData",
+ JSON.parse(JSON.stringify(this.modalData))
+ );
this.toggle();
},
},
diff --git a/src/views/modules/marketing/level/popup/add-or-update.vue b/src/views/modules/marketing/level/popup/add-or-update.vue
index 12f267b..82484b1 100644
--- a/src/views/modules/marketing/level/popup/add-or-update.vue
+++ b/src/views/modules/marketing/level/popup/add-or-update.vue
@@ -13,7 +13,7 @@