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(","); }