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