| | |
| | | |
| | | 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 { |
| | | deleteIpqc, |
| | | exportIpqc, |
| | | getIpqcPage, |
| | | importIpqc, |
| | | importIpqcTemplate, |
| | | } from '#/api/mes/qc/ipqc'; |
| | | import { $t } from '#/locales'; |
| | | import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue'; |
| | | import QcImportFormModal from '#/views/mes/qc/components/import-form-modal.vue'; |
| | | import QcReportPrint from '#/views/mes/qc/components/qc-report-print.vue'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | |
| | | }); |
| | | |
| | | const printRef = ref<InstanceType<typeof QcReportPrint> | null>(null); |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: QcImportFormModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | /** 刷新表格 */ |
| | | function handleRefresh() { |
| | |
| | | fileName: `产品检验单-${row.code ?? row.id}.docx`, |
| | | source: blob, |
| | | }); |
| | | } |
| | | |
| | | /** 批量导入过程检验单 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: '批量导入过程检验单', |
| | | templateApi: importIpqcTemplate, |
| | | importApi: importIpqc, |
| | | fileName: '过程检验单导入模板.xls', |
| | | hints: [ |
| | | '仅允许导入 xls、xlsx 格式文件;必填列:检验单名称、产品物料编码、批号、合格品数量、不合格品数量。', |
| | | '「产品物料编码」需与「物料管理」中的编码完全一致;「批号」为必填,不允许为空。', |
| | | '「检验类型」按字典名称填写(自制工序检验 / 首检 / 巡检 / 自检 / 成品检验);「检测结果」按字典名称填写(校验通过 / 校验不通过)。', |
| | | '合格品数量 + 不合格品数量 必须等于「检测数量」(留空时自动取两者之和);工废 + 料废 + 其他废品 之和不得超过不合格品数量。', |
| | | '「质检方案」填方案名称,留空则按物料自动匹配 IPQC 方案;「检测人员」留空取当前登录用户;「检测日期」可留空。', |
| | | '逐行导入,失败行不影响成功行;导入后的检验单为「待检验」状态,可在列表中继续编辑、录入检测结果。', |
| | | ], |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | /** 创建过程检验单 */ |
| | |
| | | <FormModal @success="handleRefresh" /> |
| | | <ExportRangeModal /> |
| | | <QcReportPrint ref="printRef" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="过程检验单列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | onClick: handleCreate, |
| | | }, |
| | | { |
| | | label: '批量导入', |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:qc-ipqc:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |