diff --git a/src/views/user_manage/active_list.vue b/src/views/user_manage/active_list.vue index 8badef1..1141d7e 100644 --- a/src/views/user_manage/active_list.vue +++ b/src/views/user_manage/active_list.vue @@ -106,17 +106,27 @@ export default { methods: { // 切换状态 async statusChange(e, row) { - try { - this.tableData.loading = true - const data = { ...row } - data.isUseCoupon = e - console.log(data.isUseCoupon) - await storageupActivate(data) - this.getTableData() - } catch (error) { - console.log(error) - this.tableData.loading = false + if (row.couponName) { + try { + this.tableData.loading = true + const data = { ...row } + data.isUseCoupon = e + console.log(data.isUseCoupon) + await storageupActivate(data) + this.getTableData() + } catch (error) { + console.log(error) + this.tableData.loading = false + } + } else { + console.log(22) + this.$message({ + message: '请选择优惠劵', + type: 'warning' + }); + return false; } + }, // 重置查询 resetHandle() { diff --git a/src/views/user_manage/components/addActive.vue b/src/views/user_manage/components/addActive.vue index 0aee98e..efad826 100644 --- a/src/views/user_manage/components/addActive.vue +++ b/src/views/user_manage/components/addActive.vue @@ -64,8 +64,9 @@
{{ item.title }}
- 删除 + + 删除 @@ -210,7 +211,11 @@ export default { this.form = { ...obj } // let res = await activate(obj.id) // this.productIds = res - console.log(res, '调试1') + if (obj.couponName) { + this.productIds = [{ title: obj.couponName }] + + } + console.log(obj, '调试1') } }, close() {