Browse Source

检验任务重添加执行包装列表

master_hella_20240701
zhang_li 8 months ago
parent
commit
42249b7213
  1. 28
      src/views/qms/inspection/inspectionJob/addForm.vue
  2. 4
      src/views/qms/inspection/inspectionJob/detail.vue
  3. 10
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

28
src/views/qms/inspection/inspectionJob/addForm.vue

@ -18,6 +18,7 @@
:is-col="true" :is-col="true"
@opensearchTable="opensearchTable" @opensearchTable="opensearchTable"
/> />
<div class="small-title">包装列表</div>
<div style="border:1px solid #dedede;margin-bottom:20px;display: flex;"> <div style="border:1px solid #dedede;margin-bottom:20px;display: flex;">
<TableForm <TableForm
ref="tableFormRef" ref="tableFormRef"
@ -28,12 +29,7 @@
:tableData="data.packageVOList" :tableData="data.packageVOList"
:isShowButton="false" :isShowButton="false"
:isShowReduceButton="false" :isShowReduceButton="false"
> />
<template v-slot="{row}">
<slot :row="row"></slot>
</template>
</TableForm>
</div> </div>
<el-tabs <el-tabs
v-model="editableTabsValue" v-model="editableTabsValue"
@ -131,11 +127,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="采样过程编码" label="采样过程编码"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod" prop="inspectionJobCharacteristicsUpdateReqVO.samplingProcessCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName" v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName"
disabled disabled
placeholder="请选择采样过程编码" placeholder="请选择采样过程编码"
/> />
@ -715,17 +711,26 @@ const validateForm = (formRef) => {
return false return false
}) })
} }
const tableFormRef = ref()
const submitForm = async () => { const submitForm = async () => {
try { try {
console.log(data.value.subList) console.log(data.value.subList)
// const validateForm1 = await validateForm(formMainRef.value)
const elForm = unref(formMainRef)?.getElFormRef() const elForm = unref(formMainRef)?.getElFormRef()
// //
if (!elForm) return if (!elForm) return
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// const bol1 = await validateForm(formProcessRef.value) //
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
let number = 0
data.value.packageVOList.forEach(cur=>{
number += parseFloat(cur.sampleAmount)
})
if(number > data.value.sampleTotalAmount){
message.error(`采样数量之和不可以大于总数量`)
return
}
const bol2 = await validateForm(formFeaturesRef.value) const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) { if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
@ -785,7 +790,6 @@ const submitForm = async () => {
message.error('检验特性中有开始时间大于结束时间') message.error('检验特性中有开始时间大于结束时间')
return; return;
} }
return;
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data.value) emit('submitForm', formType.value, data.value)

4
src/views/qms/inspection/inspectionJob/detail.vue

@ -110,11 +110,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="采样过程编码" label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.inspectionMethod" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionName" v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName"
disabled disabled
placeholder="请选择采样过程编码" placeholder="请选择采样过程编码"
/> />

10
src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

@ -2,6 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime' import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY) const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
@ -484,11 +485,11 @@ export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
},{ },{
label: '检验方法', label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodName', field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode',
sort: 'custom', sort: 'custom',
},{ },{
label: '采样过程编码', label: '采样过程编码',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethod', field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode',
sort: 'custom', sort: 'custom',
},{ },{
label: '动态修改规则编码', label: '动态修改规则编码',
@ -587,3 +588,8 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
])) ]))
//表单校验
export const InspectionJobPackageRules = reactive({
sampleAmount: [required,
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]
})

Loading…
Cancel
Save