feat(mes): 优化质检模块功能并新增出货检验检测结果枚举
- 新增 MES 出货检验检测结果枚举(仅 OQC 使用,按产品等级判定)
- 更新字典类型,添加 MES_OQC_CHECK_RESULT 类型
- 修改 IPQC、OQC、BatchTrace 等质检页面的数据字段配置
- 将 IPQC 页面的生产订单、工位、生产任务字段替换为产品物料和批号
- 调整表格列宽度以适应新的操作按钮布局
- 在质检报告打印组件中优化检测结果文案显示逻辑
- 添加导出产品检验单 Word 功能及相应按钮
- 更新待检列表创建 IPQC 时的数据传递逻辑
| | |
| | | samplingTime?: Date; |
| | | batchQuantity?: number; |
| | | checkResult?: number; |
| | | checkResultText?: string; // 检测结果文案(后端按质检类型字典解析,用于判定结论) |
| | | inspectorUserId?: number; |
| | | inspectorName?: string; |
| | | auditUserId?: number; |
| | |
| | | params: { qcId, qcType, resultId }, |
| | | }); |
| | | } |
| | | |
| | | /** 导出产品检验单 Word(纸质检验单版式,返回 Blob) */ |
| | | export function exportProductWord(qcId: number, qcType: number, resultId?: number) { |
| | | return requestClient.download('/mes/qc/indicator-result/export-product-word', { |
| | | params: { qcId, qcType, resultId }, |
| | | }); |
| | | } |
| | |
| | | sourceDocId?: number; // 来源单据 ID |
| | | sourceLineId?: number; // 来源单据行 ID |
| | | sourceDocCode?: string; // 来源单据编号(关联查询) |
| | | workOrderId?: number; // 生产订单 ID |
| | | workOrderCode?: string; // 订单编号(关联查询) |
| | | workOrderName?: string; // 订单名称(关联查询) |
| | | taskId?: number; // 生产任务 ID |
| | | workstationId?: number; // 工位 ID |
| | | workstationName?: string; // 工位名称(关联查询) |
| | | processId?: number; // 工序 ID |
| | | processName?: string; // 工序名称(关联查询) |
| | | itemId?: number; // 产品物料 ID |
| | | batchCode?: string; // 批号 |
| | | itemId?: number; // 产品物料 ID(MDM 物料 ID) |
| | | itemCode?: string; // 产品物料编码(关联查询) |
| | | itemName?: string; // 产品物料名称(关联查询) |
| | | itemSpecification?: string; // 规格型号(关联查询) |
| | |
| | | itemName?: string; // 物料名称 |
| | | specification?: string; // 规格型号 |
| | | unitName?: string; // 单位名称 |
| | | batchCode?: string; // 批号(仅 IPQC 来源提供) |
| | | quantity?: number; // 待检数量 |
| | | // 供应商(IQC 场景) |
| | | vendorId?: number; // 供应商 ID |
| | |
| | | FAIL: 2, // 校验不通过 |
| | | } as const; |
| | | |
| | | /** MES 出货检验检测结果枚举(仅 OQC 使用,按产品等级判定) */ |
| | | export const MesQcOqcCheckResultEnum = { |
| | | TYPE_1: 1, // 1型 |
| | | TYPE_2: 2, // 2型 |
| | | SCRAP: 3, // 废品 |
| | | } as const; |
| | | |
| | | /** MES 质检单状态枚举 */ |
| | | export const MesQcStatusEnum = { |
| | | DRAFT: MesOrderStatusConstants.DRAFT, |
| | |
| | | MES_QC_RESULT_TYPE: 'mes_qc_result_type', // MES 质检结果值类型 |
| | | MES_QC_TYPE: 'mes_qc_type', // MES 质检方案类型 |
| | | MES_QC_CHECK_RESULT: 'mes_qc_check_result', // MES 检测结果 |
| | | MES_OQC_CHECK_RESULT: 'mes_oqc_check_result', // MES 出货检验检测结果 |
| | | MES_QC_SOURCE_DOC_TYPE: 'mes_qc_source_doc_type', // MES 来源单据类型 |
| | | MES_IPQC_TYPE: 'mes_ipqc_type', // MES IPQC 检验类型 |
| | | MES_RQC_TYPE: 'mes_rqc_type', // MES 退货检验类型 |
| | |
| | | width: 110, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.MES_QC_CHECK_RESULT }, |
| | | props: { type: DICT_TYPE.MES_OQC_CHECK_RESULT }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | |
| | | import { computed, nextTick, ref } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { DICT_TYPE, MesQcTypeEnum } from '@vben/constants'; |
| | | import { getDictLabel } from '@vben/hooks'; |
| | | import { useUserStore } from '@vben/stores'; |
| | | import { formatDateTime } from '@vben/utils'; |
| | |
| | | import { getQcReport } from '#/api/mes/qc/indicatorresult'; |
| | | |
| | | /** |
| | | * MES 检验报告单打印组件(化工检验记录版式:表头 + 检验项矩阵 + 平行测量列 + 签字区) |
| | | * MES 检验报告单打印组件(化工检验记录版式:表头 + 检验项矩阵 + 平行测量列 + |
| | | * 判定结论/质检专用章 + 备注 + 签字区) |
| | | * |
| | | * 打印样式参考 erp/sale/order/modules/print.vue(Teleport + body class + @media print)。 |
| | | */ |
| | |
| | | return rows; |
| | | }); |
| | | |
| | | /** 检测结果文案(字典 mes_qc_check_result) */ |
| | | /** 检测结果文案:优先用后端按质检类型解析的文案,缺失时按质检类型选字典兜底 */ |
| | | const checkResultText = computed(() => { |
| | | if (report.value.checkResultText) { |
| | | return report.value.checkResultText; |
| | | } |
| | | if (report.value.checkResult == null) { |
| | | return '-'; |
| | | } |
| | | return ( |
| | | getDictLabel(DICT_TYPE.MES_QC_CHECK_RESULT, report.value.checkResult) || '-' |
| | | ); |
| | | const dictType = |
| | | report.value.qcType === MesQcTypeEnum.OQC |
| | | ? DICT_TYPE.MES_OQC_CHECK_RESULT |
| | | : DICT_TYPE.MES_QC_CHECK_RESULT; |
| | | return getDictLabel(dictType, report.value.checkResult) || '-'; |
| | | }); |
| | | |
| | | /** 测量列头:无平行测量时叫「测量值」,多批次时按「测量1」「测量2」区分 */ |
| | | function measureHeader(no: number) { |
| | | return measureNos.value.length > 1 ? `测量${no}` : '测量值'; |
| | | } |
| | | |
| | | function waitForPaint() { |
| | | return new Promise<void>((resolve) => { |
| | |
| | | <div> |
| | | 采样/检验时间:{{ formatDateTime(report.samplingTime) || '-' }} |
| | | </div> |
| | | <div>检测结论:{{ checkResultText }}</div> |
| | | <div>打印时间:{{ printTime || '-' }}</div> |
| | | </div> |
| | | |
| | |
| | | <th class="cell bg">方法/公式</th> |
| | | <th class="cell w-24 bg">标准值</th> |
| | | <th v-for="no in measureNos" :key="`h-${no}`" class="cell w-20 bg"> |
| | | 测量{{ no }} |
| | | {{ measureHeader(no) }} |
| | | </th> |
| | | <th class="cell bg">备注</th> |
| | | </tr> |
| | |
| | | </tbody> |
| | | </table> |
| | | |
| | | <!-- 判定结论 + 质检专用章(判定结论带出检验结果,盖章区留空打印后人工盖章) --> |
| | | <div class="mt-3 grid grid-cols-2 text-sm leading-[1.6]"> |
| | | <div class="cell min-h-[90px]">判定结论:{{ checkResultText }}</div> |
| | | <div class="cell min-h-[90px]">质检专用章:</div> |
| | | </div> |
| | | |
| | | <!-- 备注 + 签字区 --> |
| | | <div class="mt-3 border border-solid border-[#dcdfe6] p-3 text-sm leading-[1.6]"> |
| | | 备注:{{ report.remark || '-' }} |
| | |
| | | |
| | | import { h, markRaw } from 'vue'; |
| | | |
| | | import { |
| | | DICT_TYPE, |
| | | MesAutoCodeRuleCode, |
| | | MesProTaskStatusEnum, |
| | | MesProWorkOrderStatusEnum, |
| | | } from '@vben/constants'; |
| | | import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | |
| | | import { getTemplateItemOptionList } from '#/api/mes/qc/template/item'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { MdWorkstationSelect } from '#/views/mes/md/workstation/components'; |
| | | import { ProTaskSelect } from '#/views/mes/pro/task/components'; |
| | | import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components'; |
| | | import { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'update'; |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'workOrderId', |
| | | label: '生产订单', |
| | | component: markRaw(ProWorkOrderSelect), |
| | | fieldName: 'itemId', |
| | | label: '产品物料', |
| | | component: markRaw(MdmItemSelect), |
| | | componentProps: { |
| | | placeholder: '请选择生产订单', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | // 订单变更时清空生产任务 |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | placeholder: '请选择产品物料', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !!values.sourceDocId, |
| | | placeholder: '请选择生产订单', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | placeholder: '请选择产品物料', |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'workstationId', |
| | | label: '工位', |
| | | component: markRaw(MdWorkstationSelect), |
| | | fieldName: 'batchCode', |
| | | label: '批号', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请选择工位', |
| | | allowClear: true, |
| | | maxlength: 100, |
| | | placeholder: '请输入批号', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !!values.sourceDocId, |
| | | placeholder: '请选择工位', |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'taskId', |
| | | label: '生产任务', |
| | | component: markRaw(ProTaskSelect), |
| | | componentProps: { |
| | | placeholder: '请选择生产任务', |
| | | statuses: [MesProTaskStatusEnum.PREPARE], |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId', 'workOrderId', 'workstationId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !!values.sourceDocId || !values.workOrderId, |
| | | placeholder: '请选择生产任务', |
| | | statuses: [MesProTaskStatusEnum.PREPARE], |
| | | workOrderId: values.workOrderId, |
| | | workstationId: values.workstationId, |
| | | }), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'templateId', |
| | |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['workOrderId', 'taskId'], |
| | | triggerFields: ['itemId'], |
| | | componentProps: (values) => ({ |
| | | api: getTemplateItemOptionList, |
| | | autoSelect: 'first', |
| | | labelField: 'templateName', |
| | | valueField: 'templateId', |
| | | disabled: formType !== 'create' || !values.workOrderId, |
| | | params: values.workOrderId |
| | | disabled: formType !== 'create' || !values.itemId, |
| | | params: values.itemId |
| | | ? { |
| | | qcType: 2, |
| | | workOrderId: values.workOrderId, |
| | | taskId: values.taskId, |
| | | itemId: values.itemId, |
| | | } |
| | | : {}, |
| | | placeholder: values.workOrderId |
| | | placeholder: values.itemId |
| | | ? '请选择质检方案' |
| | | : '请先选择生产订单', |
| | | : '请先选择产品物料', |
| | | }), |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'workOrderId', |
| | | label: '生产订单', |
| | | component: markRaw(ProWorkOrderSelect), |
| | | fieldName: 'batchCode', |
| | | label: '批号', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请选择生产订单', |
| | | allowClear: true, |
| | | placeholder: '请输入批号', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'itemId', |
| | | label: '产品物料', |
| | | component: markRaw(MdItemSelect), |
| | | component: markRaw(MdmItemSelect), |
| | | componentProps: { |
| | | placeholder: '请选择产品物料', |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | field: 'workOrderCode', |
| | | title: '生产订单编号', |
| | | width: 140, |
| | | }, |
| | | { |
| | | field: 'itemCode', |
| | | title: '产品物料编码', |
| | | width: 130, |
| | |
| | | field: 'itemSpecification', |
| | | title: '规格型号', |
| | | width: 130, |
| | | }, |
| | | { |
| | | field: 'batchCode', |
| | | title: '批号', |
| | | width: 140, |
| | | }, |
| | | { |
| | | field: 'unitName', |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 180, |
| | | width: 420, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { exportProductWord } from '#/api/mes/qc/indicatorresult'; |
| | | import { deleteIpqc, exportIpqc, getIpqcPage } from '#/api/mes/qc/ipqc'; |
| | | import { $t } from '#/locales'; |
| | | import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue'; |
| | |
| | | /** 打印检验报告 */ |
| | | async function handlePrint(row: MesQcIpqcApi.Ipqc) { |
| | | await printRef.value?.print(row.id!, MesQcTypeEnum.IPQC); |
| | | } |
| | | |
| | | /** 导出产品检验单 Word(纸质检验单版式,判定结论带出检验结果) */ |
| | | async function handleExportProductWord(row: MesQcIpqcApi.Ipqc) { |
| | | const blob = await exportProductWord(row.id!, MesQcTypeEnum.IPQC); |
| | | downloadFileFromBlobPart({ |
| | | fileName: `产品检验单-${row.code ?? row.id}.docx`, |
| | | source: blob, |
| | | }); |
| | | } |
| | | |
| | | /** 创建过程检验单 */ |
| | |
| | | onClick: handlePrint.bind(null, row), |
| | | }, |
| | | { |
| | | label: '导出产品检验单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-word-outlined', |
| | | auth: ['mes:qc-ipqc:query'], |
| | | onClick: handleExportProductWord.bind(null, row), |
| | | }, |
| | | { |
| | | label: $t('common.detail'), |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 180, |
| | | width: 420, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { exportProductWord } from '#/api/mes/qc/indicatorresult'; |
| | | import { deleteIqc, exportIqc, getIqcPage } from '#/api/mes/qc/iqc'; |
| | | import { $t } from '#/locales'; |
| | | import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue'; |
| | |
| | | /** 打印检验报告 */ |
| | | async function handlePrint(row: MesQcIqcApi.Iqc) { |
| | | await printRef.value?.print(row.id!, MesQcTypeEnum.IQC); |
| | | } |
| | | |
| | | /** 导出产品检验单 Word(纸质检验单版式,判定结论带出检验结果) */ |
| | | async function handleExportProductWord(row: MesQcIqcApi.Iqc) { |
| | | const blob = await exportProductWord(row.id!, MesQcTypeEnum.IQC); |
| | | downloadFileFromBlobPart({ |
| | | fileName: `产品检验单-${row.code ?? row.id}.docx`, |
| | | source: blob, |
| | | }); |
| | | } |
| | | |
| | | /** 导出表格(弹窗选检验时间范围) */ |
| | |
| | | onClick: handlePrint.bind(null, row), |
| | | }, |
| | | { |
| | | label: '导出产品检验单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-word-outlined', |
| | | auth: ['mes:qc-iqc:query'], |
| | | onClick: handleExportProductWord.bind(null, row), |
| | | }, |
| | | { |
| | | label: $t('common.detail'), |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | |
| | | } |
| | | }, |
| | | }, |
| | | rules: 'required', |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | |
| | | placeholder: '请选择出货日期', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'inspectDate', |
| | |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'), |
| | | options: getDictOptions(DICT_TYPE.MES_OQC_CHECK_RESULT, 'number'), |
| | | placeholder: '请选择检测结果', |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'remark', |
| | |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'), |
| | | options: getDictOptions(DICT_TYPE.MES_OQC_CHECK_RESULT, 'number'), |
| | | placeholder: '请选择检测结果', |
| | | }, |
| | | }, |
| | |
| | | width: 110, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.MES_QC_CHECK_RESULT }, |
| | | props: { type: DICT_TYPE.MES_OQC_CHECK_RESULT }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 220, |
| | | width: 420, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { exportProductWord } from '#/api/mes/qc/indicatorresult'; |
| | | import { deleteOqc, exportOqc, getOqcPage } from '#/api/mes/qc/oqc'; |
| | | import { $t } from '#/locales'; |
| | | import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue'; |
| | |
| | | /** 打印检验报告 */ |
| | | async function handlePrint(row: MesQcOqcApi.Oqc) { |
| | | await printRef.value?.print(row.id!, MesQcTypeEnum.OQC); |
| | | } |
| | | |
| | | /** 导出产品检验单 Word(纸质检验单版式,判定结论带出检验结果) */ |
| | | async function handleExportProductWord(row: MesQcOqcApi.Oqc) { |
| | | const blob = await exportProductWord(row.id!, MesQcTypeEnum.OQC); |
| | | downloadFileFromBlobPart({ |
| | | fileName: `产品检验单-${row.code ?? row.id}.docx`, |
| | | source: blob, |
| | | }); |
| | | } |
| | | |
| | | /** 创建出货检验单 */ |
| | |
| | | onClick: handlePrint.bind(null, row), |
| | | }, |
| | | { |
| | | label: '导出产品检验单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-word-outlined', |
| | | auth: ['mes:qc-oqc:query'], |
| | | onClick: handleExportProductWord.bind(null, row), |
| | | }, |
| | | { |
| | | label: $t('common.detail'), |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { confirm, useVbenModal } from '@vben/common-ui'; |
| | | import { MesQcCheckResultEnum, MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants'; |
| | | import { |
| | | MesQcOqcCheckResultEnum, |
| | | MesQcStatusEnum, |
| | | MesQcTypeEnum, |
| | | } from '@vben/constants'; |
| | | |
| | | import { Button, Descriptions, message, Tabs } from 'ant-design-vue'; |
| | | |
| | |
| | | const data = (await formApi.getValues()) as MesQcOqcApi.Oqc; |
| | | if ( |
| | | (data.unqualifiedQuantity == null || data.unqualifiedQuantity === 0) && |
| | | data.checkResult === MesQcCheckResultEnum.FAIL |
| | | data.checkResult === MesQcOqcCheckResultEnum.SCRAP |
| | | ) { |
| | | message.warning('不合格品数量为0时,检测结果不能为"校验不通过"'); |
| | | message.warning('不合格品数量为0时,检测结果不能为"废品"'); |
| | | return false; |
| | | } |
| | | if (formData.value?.id) { |
| | |
| | | const data = (await formApi.getValues()) as MesQcOqcApi.Oqc; |
| | | if ( |
| | | (data.unqualifiedQuantity == null || data.unqualifiedQuantity === 0) && |
| | | data.checkResult === MesQcCheckResultEnum.FAIL |
| | | data.checkResult === MesQcOqcCheckResultEnum.SCRAP |
| | | ) { |
| | | message.warning('不合格品数量为0时,检测结果不能为"校验不通过"'); |
| | | message.warning('不合格品数量为0时,检测结果不能为"废品"'); |
| | | return; |
| | | } |
| | | await updateOqc({ ...data, id }); |
| | |
| | | /** 创建过程检验单(IPQC) */ |
| | | function handleCreateIpqc(row: MesQcPendingInspectApi.PendingInspect) { |
| | | const prefill: MesQcIpqcApi.Ipqc = { |
| | | batchCode: row.batchCode, |
| | | checkQuantity: row.quantity, |
| | | inspectDate: row.recordTime, |
| | | itemId: row.itemId, |
| | |
| | | sourceDocId: row.sourceDocId, |
| | | sourceDocType: row.sourceDocType, |
| | | sourceLineId: row.sourceLineId, |
| | | taskId: row.taskId, |
| | | workOrderId: row.workOrderId, |
| | | workstationId: row.workstationId, |
| | | }; |
| | | ipqcFormModalApi.setData({ formType: 'create', prefill }).open(); |
| | | } |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 180, |
| | | width: 420, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { MesQcStatusEnum, MesQcTypeEnum } from '@vben/constants'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { exportProductWord } from '#/api/mes/qc/indicatorresult'; |
| | | import { deleteRqc, exportRqc, getRqcPage } from '#/api/mes/qc/rqc'; |
| | | import { $t } from '#/locales'; |
| | | import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue'; |
| | |
| | | /** 打印检验报告 */ |
| | | async function handlePrint(row: MesQcRqcApi.Rqc) { |
| | | await printRef.value?.print(row.id!, MesQcTypeEnum.RQC); |
| | | } |
| | | |
| | | /** 导出产品检验单 Word(纸质检验单版式,判定结论带出检验结果) */ |
| | | async function handleExportProductWord(row: MesQcRqcApi.Rqc) { |
| | | const blob = await exportProductWord(row.id!, MesQcTypeEnum.RQC); |
| | | downloadFileFromBlobPart({ |
| | | fileName: `产品检验单-${row.code ?? row.id}.docx`, |
| | | source: blob, |
| | | }); |
| | | } |
| | | |
| | | /** 创建退货检验单 */ |
| | |
| | | onClick: handlePrint.bind(null, row), |
| | | }, |
| | | { |
| | | label: '导出产品检验单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-word-outlined', |
| | | auth: ['mes:qc-rqc:query'], |
| | | onClick: handleExportProductWord.bind(null, row), |
| | | }, |
| | | { |
| | | label: $t('common.detail'), |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |