✨ feat(mes): 添加检测工具字段,优化出货检验单数据结构
新增检测工具字段以支持更全面的检验信息,同时优化相关数据结构,提升系统的可用性和灵活性。pull/871/MERGE
parent
3c1d5eb01a
commit
addba55f2d
|
|
@ -8,6 +8,7 @@
|
|||
:rules="formRules"
|
||||
label-width="120px"
|
||||
v-loading="formLoading"
|
||||
:disabled="isDetail"
|
||||
>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
|
|
@ -136,8 +137,8 @@
|
|||
<el-form-item label="出货日期" prop="outDate">
|
||||
<el-date-picker
|
||||
v-model="formData.outDate"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择出货日期"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
|
|
@ -149,8 +150,8 @@
|
|||
<el-form-item label="检测日期" prop="inspectDate">
|
||||
<el-date-picker
|
||||
v-model="formData.inspectDate"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="请选择检测日期"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
|
|
@ -219,7 +220,7 @@
|
|||
</el-form>
|
||||
|
||||
<!-- 子表标签页(编辑模式下显示) -->
|
||||
<template v-if="formType === 'update' && formData.id">
|
||||
<template v-if="(formType === 'update' || isDetail) && formData.id">
|
||||
<el-divider />
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="检验项" name="line">
|
||||
|
|
@ -232,7 +233,7 @@
|
|||
</template>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading"> 保 存 </el-button>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading" v-if="!isDetail"> 保 存 </el-button>
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
|
@ -240,14 +241,14 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { QcOqcApi, QcOqcVO } from '@/api/mes/qc/oqc'
|
||||
import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record'
|
||||
import MdClientSelect from '@/views/mes/md/client/components/MdClientSelect.vue'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||
import OqcLineList from './OqcLineList.vue'
|
||||
import QcIndicatorResultList from '@/views/mes/qc/indicatorresult/components/QcIndicatorResultList.vue'
|
||||
import { MesQcTypeEnum } from '@/views/mes/utils/constants'
|
||||
import { MesQcTypeEnum, MesAutoCodeRuleCode } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'OqcForm' })
|
||||
|
||||
|
|
@ -312,10 +313,11 @@ const formRules = reactive({
|
|||
inspectDate: [{ required: true, message: '检测日期不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const isDetail = computed(() => formType.value === 'detail') // 表单是否为详情模式(只读)
|
||||
|
||||
/** 生成检验单编号 */
|
||||
const generateCode = () => {
|
||||
formData.value.code = 'OQC' + generateRandomStr(10)
|
||||
const generateCode = async () => {
|
||||
formData.value.code = await AutoCodeRecordApi.generateAutoCode(MesAutoCodeRuleCode.QC_OQC_CODE)
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
|
|
@ -396,4 +398,22 @@ const resetForm = () => {
|
|||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 数量互填:outQuantity 和 checkQuantity 互相填充 */
|
||||
watch(
|
||||
() => formData.value.outQuantity,
|
||||
(val) => {
|
||||
if (formType.value === 'create' && val != null && formData.value.checkQuantity == null) {
|
||||
formData.value.checkQuantity = val
|
||||
}
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => formData.value.checkQuantity,
|
||||
(val) => {
|
||||
if (formType.value === 'create' && val != null && formData.value.outQuantity == null) {
|
||||
formData.value.outQuantity = val
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<dict-tag :type="DICT_TYPE.MES_INDICATOR_TYPE" :value="scope.row.indicatorType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检测工具" align="center" prop="tool" width="120" />
|
||||
<el-table-column label="检测方法" align="center" prop="checkMethod" min-width="180" />
|
||||
<el-table-column label="标准值" align="center" prop="standardValue" width="100" />
|
||||
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
||||
|
|
|
|||
|
|
@ -58,14 +58,6 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测人员" prop="inspectorUserId">
|
||||
<UserSelect
|
||||
v-model="queryParams.inspectorUserId"
|
||||
placeholder="请选择检测人员"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
|
|
@ -93,18 +85,24 @@
|
|||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="检验单编号" align="center" prop="code" width="160" />
|
||||
<el-table-column label="检验单编号" align="center" prop="code" width="160">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="openForm('detail', scope.row.id)">
|
||||
{{ scope.row.code }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验单名称" align="center" prop="name" min-width="180" />
|
||||
<el-table-column label="客户名称" align="center" prop="clientNickname" width="120" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" width="130" />
|
||||
<el-table-column label="产品物料编码" align="center" prop="itemCode" width="130" />
|
||||
<el-table-column label="产品物料名称" align="center" prop="itemName" min-width="150" />
|
||||
<el-table-column label="规格型号" align="center" prop="itemName" min-width="150" />
|
||||
<el-table-column label="单位" align="center" prop="itemName" min-width="150" />
|
||||
<el-table-column label="规格型号" align="center" prop="itemSpecification" min-width="150" />
|
||||
<el-table-column label="单位" align="center" prop="unitName" width="80" />
|
||||
<el-table-column label="发货数量" align="center" prop="outQuantity" width="100" />
|
||||
<el-table-column label="检测数量" align="center" prop="checkQuantity" width="100" />
|
||||
<el-table-column label="不合格数" align="center" prop="unqualifiedQuantity" width="100" />
|
||||
<el-table-column label="检测结果" align="center" prop="checkResult" width="100">
|
||||
<el-table-column label="检测结果" align="center" prop="checkResult" width="110">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.MES_QC_CHECK_RESULT" :value="scope.row.checkResult" />
|
||||
</template>
|
||||
|
|
@ -129,7 +127,7 @@
|
|||
<dict-tag :type="DICT_TYPE.MES_ORDER_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="180" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="220" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
|
|
@ -182,7 +180,6 @@ import OqcForm from './OqcForm.vue'
|
|||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import MdClientSelect from '@/views/mes/md/client/components/MdClientSelect.vue'
|
||||
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||
import { MesQcStatusEnum } from '@/views/mes/utils/constants'
|
||||
|
||||
defineOptions({ name: 'MesQcOqc' })
|
||||
|
|
@ -200,8 +197,7 @@ const queryParams = reactive({
|
|||
clientId: undefined,
|
||||
batchCode: undefined,
|
||||
itemId: undefined,
|
||||
checkResult: undefined,
|
||||
inspectorUserId: undefined
|
||||
checkResult: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
|
|
|||
|
|
@ -418,6 +418,7 @@ export const MesAutoCodeRuleCode = {
|
|||
TASK_CODE: 'PRO_TASK_CODE', // 生产任务编码
|
||||
QC_IQC_CODE: 'QC_IQC_CODE', // 来料检验单编码
|
||||
QC_IPQC_CODE: 'QC_IPQC_CODE', // 过程检验单编码
|
||||
QC_OQC_CODE: 'QC_OQC_CODE', // 出货检验单编码
|
||||
QC_RQC_CODE: 'QC_RQC_CODE' // 退货检验单编码
|
||||
} as const
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue