| | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | deleteTemplate, |
| | | exportTemplate, |
| | | getTemplatePage, |
| | | } from '#/api/mes/qc/template'; |
| | | import { deleteTemplate, exportTemplate, getTemplatePage, importTemplate, importTemplateTemplate } from '#/api/mes/qc/template'; |
| | | import { DictTag } from '#/components/dict-tag'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import ImportModalComponent from '#/components/import-modal'; |
| | | import Form from './modules/form.vue'; |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: ImportModalComponent, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | function handleRefresh() { |
| | | gridApi.query(); |
| | | } |
| | | |
| | | /** 导入质检方案 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: $t('ui.actionTitle.import', ['质检方案']), |
| | | fileName: '质检方案导入模板.xls', |
| | | importFn: importTemplate, |
| | | templateFn: importTemplateTemplate, |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | |
| | | /** 创建质检方案 */ |
| | | function handleCreate() { |
| | |
| | | |
| | | <template> |
| | | <Page auto-content-height><FormModal @success="handleRefresh" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | |
| | | <Grid table-title="质检方案列表"> |
| | | <template #toolbar-tools> |
| | |
| | | auth: ['mes:qc-template:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.import', ['质检方案']), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:qc-template:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |