|
@ -256,47 +256,47 @@ const importSuccess = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const updateFormFields = (sampleType, formRef) => { |
|
|
const updateFormFields = (sampleType, formRef) => { |
|
|
let sampleSizeLabel = ''; |
|
|
let sampleQtyLabel = ''; |
|
|
let sampleSizeDisabled = false; |
|
|
let sampleQtyDisabled = false; |
|
|
let sampleProgCodeDisabled = true; |
|
|
let sampleProgCodeDisabled = true; |
|
|
let sampleSizeRequired = false; |
|
|
let sampleQtyRequired = false; |
|
|
let sampleProgCodeRequired = false; |
|
|
let sampleProgCodeRequired = false; |
|
|
|
|
|
|
|
|
switch (sampleType) { |
|
|
switch (sampleType) { |
|
|
case '1': |
|
|
case '1': |
|
|
sampleSizeLabel = '样品份数'; |
|
|
sampleQtyLabel = '样品份数'; |
|
|
sampleSizeDisabled = true; |
|
|
sampleQtyDisabled = true; |
|
|
sampleSizeRequired = false; |
|
|
sampleQtyRequired = false; |
|
|
if( SamplingProcessRules.sampleSize.length==3){ |
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
SamplingProcessRules.sampleSize.pop() |
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case '2': |
|
|
case '2': |
|
|
sampleSizeLabel = '样品份数(%)'; |
|
|
sampleQtyLabel = '样品份数(%)'; |
|
|
sampleSizeDisabled = false; |
|
|
sampleQtyDisabled = false; |
|
|
sampleSizeRequired = false; |
|
|
sampleQtyRequired = true; |
|
|
if( SamplingProcessRules.sampleSize.length==2){ |
|
|
if( SamplingProcessRules.sampleQty.length==2){ |
|
|
SamplingProcessRules.sampleSize.push({ |
|
|
SamplingProcessRules.sampleQty.push({ |
|
|
validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur' |
|
|
validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case '3': |
|
|
case '3': |
|
|
sampleSizeLabel = '样品份数'; |
|
|
sampleQtyLabel = '样品份数'; |
|
|
sampleSizeDisabled = false; |
|
|
sampleQtyDisabled = false; |
|
|
sampleSizeRequired = true; |
|
|
sampleQtyRequired = true; |
|
|
if( SamplingProcessRules.sampleSize.length==3){ |
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
SamplingProcessRules.sampleSize.pop() |
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case '4': |
|
|
case '4': |
|
|
sampleSizeLabel = '样品份数'; |
|
|
sampleQtyLabel = '样品份数'; |
|
|
sampleSizeDisabled = true; |
|
|
sampleQtyDisabled = true; |
|
|
sampleSizeRequired = false; |
|
|
sampleQtyRequired = false; |
|
|
sampleProgCodeDisabled = false; |
|
|
sampleProgCodeDisabled = false; |
|
|
sampleProgCodeRequired = true; |
|
|
sampleProgCodeRequired = true; |
|
|
if( SamplingProcessRules.sampleSize.length==3){ |
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
SamplingProcessRules.sampleSize.pop() |
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
@ -304,20 +304,20 @@ const updateFormFields = (sampleType, formRef) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item => { |
|
|
SamplingProcess.allSchemas.formSchema.forEach(item => { |
|
|
if (item.field === 'sampleSize') { |
|
|
if (item.field === 'sampleQty') { |
|
|
item.label = sampleSizeLabel; |
|
|
item.label = sampleQtyLabel; |
|
|
item.componentProps.disabled = sampleSizeDisabled; |
|
|
item.componentProps.disabled = sampleQtyDisabled; |
|
|
} |
|
|
} |
|
|
if (item.field === 'sampleProgCode') { |
|
|
if (item.field === 'sampleProgCode') { |
|
|
item.componentProps.disabled = sampleProgCodeDisabled; |
|
|
item.componentProps.disabled = sampleProgCodeDisabled; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
SamplingProcessRules.sampleSize[0].required = sampleSizeRequired; |
|
|
SamplingProcessRules.sampleQty[0].required = sampleQtyRequired; |
|
|
SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired; |
|
|
SamplingProcessRules.sampleProgCode[0].required = sampleProgCodeRequired; |
|
|
|
|
|
|
|
|
formRef.value.setValues({ |
|
|
formRef.value.setValues({ |
|
|
sampleSize: '', |
|
|
sampleQty: '', |
|
|
sampleProgCode: '', |
|
|
sampleProgCode: '', |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|