| | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { deleteIqc, exportIqc, getIqcPage } from '#/api/mes/qc/iqc'; |
| | | import { |
| | | deleteIqc, |
| | | exportIqc, |
| | | getIqcPage, |
| | | importIqc, |
| | | importIqcTemplate, |
| | | } from '#/api/mes/qc/iqc'; |
| | | 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 QcReportGenerateModal from '#/views/mes/qc/components/report-generate-modal.vue'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: QcImportFormModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | /** 刷新表格 */ |
| | | function handleRefresh() { |
| | | gridApi.query(); |
| | | } |
| | | |
| | | /** 批量导入来料检验单 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: '批量导入来料检验单', |
| | | templateApi: importIqcTemplate, |
| | | importApi: importIqc, |
| | | fileName: '来料检验单导入模板.xls', |
| | | hints: [ |
| | | '仅允许导入 xls、xlsx 格式文件;必填列:检验单名称、产品物料编码、合格品数量、不合格品数量、检测日期、来料日期。', |
| | | '「产品物料编码」需与「物料管理」中的编码完全一致;「供应商名称」需与「供应商管理」中的名称一致,留空则该单无供应商。', |
| | | '合格品数量 + 不合格品数量 必须等于「本次接收数量」(留空时自动取两者之和);「检测结果」按字典名称填写(校验通过 / 校验不通过)。', |
| | | '「质检方案」填方案名称,留空则按物料自动匹配 IQC 方案;「检测人员」留空取当前登录用户;日期支持 2026-01-01 10:00:00 或 2026-01-01。', |
| | | '逐行导入,失败行不影响成功行;导入后的检验单为「待检验」状态,可在列表中继续编辑、录入检测结果。', |
| | | ], |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | /** 创建来料检验单 */ |
| | |
| | | <FormModal @success="handleRefresh" /> |
| | | <ExportRangeModal /> |
| | | <ReportModal /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="来料检验单列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | onClick: handleCreate, |
| | | }, |
| | | { |
| | | label: '批量导入', |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:qc-iqc:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |