From 3f1206863e83651afb65131d85239b932cc67523 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 24 Apr 2024 09:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=A1=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9A=90=E8=97=8Faql=E5=92=8C=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E6=B0=B4=E5=B9=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionTemplate/index.ts | 2 +- .../inspectionScheme/addForm.vue | 39 +++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/api/qms/inspectionTemplate/index.ts b/src/api/qms/inspectionTemplate/index.ts index 9fe18afcd..f3bf638d2 100644 --- a/src/api/qms/inspectionTemplate/index.ts +++ b/src/api/qms/inspectionTemplate/index.ts @@ -2,7 +2,7 @@ import request from '@/config/axios' -// 查询采样过程列表 +// 列表 export const getListByTempleteCode = async (code) => { return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code}) } diff --git a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue index 7d4e8c830..50c0c07a5 100644 --- a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue @@ -163,7 +163,7 @@ - + - + { @@ -771,6 +772,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any dialogTitle.value = t('action.' + type) } formType.value = type + isShowField.value=0//设置isShowField == 0隐藏aql和检验水平字段 if (row) { data.value = JSON.parse(JSON.stringify(row)) let list = [] @@ -779,7 +781,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any } else { list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode) } - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false @@ -797,7 +798,18 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true } + if(item.inspectionCharacteristicsBaseVO.sampleType == 4){ + isShowField.value+=1//设置isShowField > 0显示aql和检验水平字段 + } }) + // 显示aql和检验水平字段的时候添加必填规则 + if( isShowField.value>0){ + rules.value.aql[0].required = true + rules.value.aql[0].required = true + }else{ + rules.value.aql[0].required = false + rules.value.aql[0].required = false + } data.value.process = list } else { data.value = { @@ -1085,14 +1097,10 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { } else if (formField == 'inspectionType') { data.value.testTypeName = val[0].description } else if (formField == 'programmeTemplateCode') { + isShowField.value=0//设置isShowField == 0隐藏aql和检验水平字段 data.value.programmeTemplateName = val[0].description data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode data.value.dynamicUpdateName = val[0].dynamicUpdateName - console.log(val[0]) - - } - 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 @@ -1111,11 +1119,20 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true } + if(item.inspectionCharacteristicsBaseVO.sampleType == 4){ + isShowField.value+=1//设置isShowField > 0显示aql和检验水平字段 + } }) + // 显示aql和检验水平字段的时候添加必填规则 + if( isShowField.value>0){ + rules.value.aql[0].required = true + rules.value.aql[0].required = true + }else{ + rules.value.aql[0].required = false + rules.value.aql[0].required = false + } data.value.process = list - } - - if (formField == 'dynamicUpdateCode') { + }else if (formField == 'dynamicUpdateCode') { data.value[formField] = val[0].code data.value.dynamicUpdateName = val[0].description }