Browse Source

更改字段名

master_hella_20240701
liuchen864 7 months ago
parent
commit
0eb89d88cd
  1. 56
      src/views/qms/samplingProcess/index.vue
  2. 4
      src/views/qms/samplingProcess/samplingProcess.data.ts

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

@ -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: '',
});
};

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

@ -8,7 +8,7 @@ export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
description: [required],
sampleSize:ref([{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]),
sampleQty:ref([{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]),
sampleProgCode:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
})
@ -63,7 +63,7 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '样品份数',
field: 'sampleSize',
field: 'sampleQty',
sort: 'custom',
table: {
width: 140

Loading…
Cancel
Save