From f64ea550fea8fc5603b2effd5839ece224fae1f8 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 10 Apr 2024 14:29:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=80=89=E5=AE=9A=E9=9B=86?= =?UTF-8?q?=E9=A1=B9=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qms/basicDataManage/selectedSet/index.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue index 9434e3220..5bee75673 100644 --- a/src/views/qms/basicDataManage/selectedSet/index.vue +++ b/src/views/qms/basicDataManage/selectedSet/index.vue @@ -328,7 +328,7 @@ const submitForm = async (formType, data) => { } } -const updateSelections = async (masterId) => { +const updateSelections = async (masterId,row) => { let param = { masterId: masterId }; SelectedProjectApi.getSelectedProjectNoPage(param).then(res => { DictTypeApi.getDictTypeAndData('inspection').then(originalResponse => { @@ -341,7 +341,14 @@ const updateSelections = async (masterId) => { }; }).filter(option => { // 过滤掉与res中任何dictionaryTypeAndCode相等的option - return !res.some(resItem => option.value === resItem.dictionaryTypeAndCode); + return !res.some(resItem => { + if(row != null){ + return option.value === resItem.dictionaryTypeAndCode && option.value != row.dictionaryTypeAndCode + }else{ + return option.value === resItem.dictionaryTypeAndCode + } + + }); }); return { ...element, options }; // 返回新的element,包含过滤后的options }).filter(element => element.options.length > 0); // 再次过滤,移除options为空的element @@ -377,7 +384,12 @@ const detailValidate = (data) => { } const detailOpenForm = (type, row, masterParmas) => { - updateSelections(masterParmas.masterId) + if(type == 'create'){ + updateSelections(masterParmas.masterId,row) + }else if('update'){ + updateSelections(masterParmas.masterId,row) + } + }