From 0eb89d88cdab7984fea4a48f74e6d25027132cff Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Mon, 29 Apr 2024 08:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/samplingProcess/index.vue | 56 +++++++++---------- .../samplingProcess/samplingProcess.data.ts | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/views/qms/samplingProcess/index.vue b/src/views/qms/samplingProcess/index.vue index 82868b8e6..5d1dcbeb6 100644 --- a/src/views/qms/samplingProcess/index.vue +++ b/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: '', }); }; diff --git a/src/views/qms/samplingProcess/samplingProcess.data.ts b/src/views/qms/samplingProcess/samplingProcess.data.ts index 8eb99dbaf..24605dfa1 100644 --- a/src/views/qms/samplingProcess/samplingProcess.data.ts +++ b/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([ }, { label: '样品份数', - field: 'sampleSize', + field: 'sampleQty', sort: 'custom', table: { width: 140