Browse Source

修改bug

master_hella_20240701
liuchen864 5 months ago
parent
commit
e147c5e308
  1. 2
      src/views/qms/inspectionJob/detail.vue
  2. 22
      src/views/qms/samplingProcess/index.vue
  3. 4
      src/views/qms/samplingProcess/samplingProcess.data.ts

2
src/views/qms/inspectionJob/detail.vue

@ -70,7 +70,7 @@
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入样品份数" />
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" />
</div>
</el-form-item>
</el-col>

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

@ -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;

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

@ -8,8 +8,8 @@ export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
description: [required],
sampleQty:ref([{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]),
sampleProgCode:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
sampleQty:[{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}],
sampleProgCode:[{ required: true, message: '该项为必填项', trigger: 'blur' }],
inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
})
const samplingSchemeList = await getSamplingScheme()

Loading…
Cancel
Save