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 }