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) + } + }