From 8a916b913e12e7d5cb4e51849ad35f8230545ceb Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Thu, 11 Apr 2024 17:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qms/basicDataManage/selectedSet/index.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue index b85a54bfe..f7b5d24c2 100644 --- a/src/views/qms/basicDataManage/selectedSet/index.vue +++ b/src/views/qms/basicDataManage/selectedSet/index.vue @@ -292,6 +292,12 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { + const emptyFlag = validateDetailEmpty(tableData.value); + if(!emptyFlag){ + message.alertWarning('明细不能为空') + basicFormRef.value.formLoading = false + return + } if(!validateNotRepetition(tableData.value)){ message.alertWarning('选定集字典及字典项不能重复') basicFormRef.value.formLoading = false @@ -327,7 +333,13 @@ const submitForm = async (formType, data) => { basicFormRef.value.formLoading = false } } - +const validateDetailEmpty = (data) => { + const codes = data.map(item => item.stage); + if(codes.length == 0){ + return false; + } + return true; +} const updateSelections = async (masterId,row) => { let param = { masterId: masterId }; SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {