|
|
@ -149,6 +149,9 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const rules = ref({ |
|
|
|
sampleSize: [{ required: true, message: '请填写描述', trigger: 'blur' }] |
|
|
|
}) |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
@ -290,6 +293,9 @@ const onChange =async (field,value, formRef)=>{ |
|
|
|
}) |
|
|
|
setV["sampleSize"] = '' |
|
|
|
setV["sampleProgCode"] = '' |
|
|
|
|
|
|
|
SamplingProcessRules.sampleSize[0].required = false; |
|
|
|
SamplingProcessRules.sampleProgCode[0].required = false; |
|
|
|
}else if(field == 'sampleType'&& value == '2'){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
@ -302,6 +308,8 @@ const onChange =async (field,value, formRef)=>{ |
|
|
|
} |
|
|
|
}) |
|
|
|
setV["sampleProgCode"] = '' |
|
|
|
SamplingProcessRules.sampleSize[0].required = true; |
|
|
|
SamplingProcessRules.sampleProgCode[0].required = false; |
|
|
|
}else if(field == 'sampleType'&& value == '3'){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
@ -314,6 +322,8 @@ const onChange =async (field,value, formRef)=>{ |
|
|
|
} |
|
|
|
}) |
|
|
|
setV["sampleProgCode"] = '' |
|
|
|
SamplingProcessRules.sampleSize[0].required = true; |
|
|
|
SamplingProcessRules.sampleProgCode[0].required = false; |
|
|
|
}else if(field == 'sampleType'&& value == '4'){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
@ -325,6 +335,8 @@ const onChange =async (field,value, formRef)=>{ |
|
|
|
} |
|
|
|
}) |
|
|
|
setV["sampleSize"] = '' |
|
|
|
SamplingProcessRules.sampleSize[0].required = false; |
|
|
|
SamplingProcessRules.sampleProgCode[0].required = true; |
|
|
|
} |
|
|
|
nextTick(() => { |
|
|
|
formRef.value.setValues(setV); |
|
|
|