From 3bc87809e12367f17ebdc20675d4944b89ef779b Mon Sep 17 00:00:00 2001 From: dragon <3013557874@qq.com> Date: Wed, 12 Feb 2025 17:32:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/luckGift/luckGiftSet.vue | 41 ++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/views/luckGift/luckGiftSet.vue b/src/views/luckGift/luckGiftSet.vue index 3343071..a1b65ca 100644 --- a/src/views/luckGift/luckGiftSet.vue +++ b/src/views/luckGift/luckGiftSet.vue @@ -282,15 +282,7 @@ class="input" disabled > --> - + 查看详情 @@ -477,7 +469,7 @@ export default { type: null, // 详情 detailsTable: [], - whiteErbanNoProductionRatioMap:null, + whiteErbanNoProductionRatioMap: null, }; }, created() { @@ -501,11 +493,20 @@ export default { userId: key, val: obj[key], })); + var newArr = []; arr.forEach((res, i) => { - this.detailsTable[i] = res; + this.newArr[i] = res; }); + this.detailsTable = newArr; }); }, + // 查看详情按钮 + detailsClick() { + this.getData(); + this.detailsDialog = true; + this.type = 14; + // this.value = inquire.whiteErbanNoProductionRatioMap; + }, // 详情新增按钮 addDetail() { this.detailsTable.unshift([]); @@ -517,13 +518,24 @@ export default { // 详情确认保存按钮 sevaDetail() { var map = {}; + var lock = true; this.detailsTable.forEach((res) => { + if (res.userId == (undefined || "") || res.val == undefined || "") { + lock = false; + } map[res.userId] = res.val; }); console.log(map); - this.type = 14; this.whiteErbanNoProductionRatioMap = map; - this.editDialogClick(); + if (lock) { + this.editDialogClick(); + } else { + ElMessage({ + showClose: true, + message: "用户ID和值不能为空", + type: "error", + }); + } }, // 详情编辑监听 handleEdit(index, row) { @@ -581,7 +593,8 @@ export default { } else if (this.type == 11) { obj.followErbanNoList = this.value.split(","); } else if (this.type == 14) { - obj.whiteErbanNoProductionRatioMap = this.whiteErbanNoProductionRatioMap; + obj.whiteErbanNoProductionRatioMap = + this.whiteErbanNoProductionRatioMap; } else if (this.type == 13) { obj.blackErbanNoList = this.value.split(","); }