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