Browse Source

检验方案显示隐藏aql和检验水平

master_hella_20240701
zhang_li 7 months ago
parent
commit
3f1206863e
  1. 2
      src/api/qms/inspectionTemplate/index.ts
  2. 39
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue

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

39
src/views/qms/basicDataManage/inspectionScheme/addForm.vue

@ -163,7 +163,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="isShowField !=0">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql">
<el-option
@ -175,7 +175,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="isShowField!=0">
<el-form-item label="检验水平" prop="inspectionLevel">
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平">
<el-option
@ -761,6 +761,7 @@ const rules = ref({
{ required: true, message: '请输入选定集', trigger: 'blur' }
]
})
const isShowField = ref(0)//aql 0 0
/** 打开弹窗 */
let tabIndex = 1
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
@ -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 == 0aql
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 > 0aql
}
})
// 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 == 0aql
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 > 0aql
}
})
// 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
}

Loading…
Cancel
Save