Browse Source

修改bug

master_hella_20240701
zhaoyiran 8 months ago
parent
commit
f2d049eeb3
  1. 12
      src/views/qms/samplingProcess/index.vue
  2. 2
      src/views/qms/samplingProcess/samplingProcess.data.ts

12
src/views/qms/samplingProcess/index.vue

@ -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);

2
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -8,6 +8,8 @@ export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
description: [required],
sampleSize:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
sampleProgCode:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
})
const samplingSchemeList = await getSamplingScheme()

Loading…
Cancel
Save