From e59ff3024dae8c8aabf7872fd91bd21dfdf66047 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 10 Apr 2024 11:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E6=9D=BF=E5=92=8C?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E6=A0=A1=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionScheme/addForm.vue | 156 +++++++++--------- .../inspectionTemplate/addForm.vue | 27 ++- 2 files changed, 94 insertions(+), 89 deletions(-) diff --git a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue index 7f94f4f3f..956c79747 100644 --- a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue @@ -450,111 +450,106 @@ - - + - - + - + - + - - + - + - - + + - + + - + + +
{ - editableTabsValue.value = index + 1 - item.name = index + 1 - // 编辑判断上限下限目标值是否必填 - if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false - } - if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { - rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false - } - if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { - rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false - } - }) + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false + list.forEach((item, index) => { + editableTabsValue.value = index+1 + item.name = index + 1 + // rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true + // 编辑判断上限下限目标值是否必填 + if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true + } + }) data.value.process = list } else { data.value = { @@ -1090,26 +1083,25 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { } if (formField == 'programmeTemplateCode') { + let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false list.forEach((item, index) => { - editableTabsValue.value = index + 1 + editableTabsValue.value = index+1 item.name = index + 1 + // rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true // 编辑判断上限下限目标值是否必填 - if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { + if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false - } + } if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false - } + } if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false - } + } }) data.value.process = list } @@ -1123,15 +1115,18 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) } // 选择是否设定上限值 -const changeIsCapping = (e) => { +const changeIsCapping = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyCapping = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true } else { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false } + } // 选择是否设定下限值 -const changeLowlimit = (e) => { +const changeLowlimit = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyLowlimit = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true } else { @@ -1139,7 +1134,8 @@ const changeLowlimit = (e) => { } } // 选择是否设定目标值 -const changeIsTarget = (e) => { +const changeIsTarget = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyTarget = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true } else { diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index d7479a3e0..9efcb93b5 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -293,7 +293,7 @@ label="是否设定上限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" > - + @@ -302,7 +302,7 @@ prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" label="是否设定下限" > - + @@ -313,7 +313,7 @@ label="是否设定目标值" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" > - + @@ -737,11 +737,16 @@ const submitForm = async () => { return } // 检验上限值,下限值,目标值小数位数不可以大于小数位 + console.log(data.value.process) const arr1 = data.value.process.filter( (item) => - ((item.inspectionCharacteristicsBaseVO.quantifyIsCapping && (String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| - (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| - (item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) && + // { + // console.log(String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length) + // console.log(Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)) + // } + ((item.inspectionCharacteristicsBaseVO.quantifyIsCapping && (String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| + (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| + (item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) && item.inspectionCharacteristicsBaseVO.featureType == 0 ) if (arr1 && arr1.length > 0) { @@ -894,15 +899,18 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { } // 选择是否设定上限值 -const changeIsCapping = (e) => { +const changeIsCapping = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyCapping = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true } else { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false } + } // 选择是否设定下限值 -const changeLowlimit = (e) => { +const changeLowlimit = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyLowlimit = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true } else { @@ -910,7 +918,8 @@ const changeLowlimit = (e) => { } } // 选择是否设定目标值 -const changeIsTarget = (e) => { +const changeIsTarget = (e,item) => { + item.inspectionCharacteristicsBaseVO.quantifyTarget = '' if (e) { rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true } else {