|
|
@ -66,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import {validatePercent } from '@/utils/validator' |
|
|
|
import {validatePercent, validateInteger, validateTwoNum } from '@/utils/validator' |
|
|
|
|
|
|
|
defineOptions({ name: 'SamplingProcess' }) |
|
|
|
|
|
|
@ -267,27 +267,21 @@ const updateFormFields = (sampleType, formRef) => { |
|
|
|
sampleQtyLabel = '样品份数'; |
|
|
|
sampleQtyDisabled = true; |
|
|
|
sampleQtyRequired = false; |
|
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
|
} |
|
|
|
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}] |
|
|
|
break; |
|
|
|
case '2': |
|
|
|
sampleQtyLabel = '样品份数(%)'; |
|
|
|
sampleQtyDisabled = false; |
|
|
|
sampleQtyRequired = true; |
|
|
|
if( SamplingProcessRules.sampleQty.length==2){ |
|
|
|
SamplingProcessRules.sampleQty.push({ |
|
|
|
validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur' |
|
|
|
}) |
|
|
|
} |
|
|
|
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur'},{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}] |
|
|
|
|
|
|
|
break; |
|
|
|
case '3': |
|
|
|
sampleQtyLabel = '样品份数'; |
|
|
|
sampleQtyDisabled = false; |
|
|
|
sampleQtyRequired = true; |
|
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
|
} |
|
|
|
SamplingProcessRules.sampleQty = [{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateInteger, message: '样品份数必须为正整数', trigger: 'blur'}] |
|
|
|
|
|
|
|
break; |
|
|
|
case '4': |
|
|
|
sampleQtyLabel = '样品份数'; |
|
|
@ -295,9 +289,7 @@ const updateFormFields = (sampleType, formRef) => { |
|
|
|
sampleQtyRequired = false; |
|
|
|
sampleProgCodeDisabled = false; |
|
|
|
sampleProgCodeRequired = true; |
|
|
|
if( SamplingProcessRules.sampleQty.length==3){ |
|
|
|
SamplingProcessRules.sampleQty.pop() |
|
|
|
} |
|
|
|
SamplingProcessRules.sampleQty = [{ required: false, message: '该项为必填项', trigger: 'blur'}] |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|