| | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | deleteCheckRecord, |
| | | exportCheckRecord, |
| | | getCheckRecordPage, |
| | | } from '#/api/mes/dv/checkrecord'; |
| | | import { deleteCheckRecord, exportCheckRecord, getCheckRecordPage, importCheckRecord, importCheckRecordTemplate } from '#/api/mes/dv/checkrecord'; |
| | | 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: importCheckRecord, |
| | | templateFn: importCheckRecordTemplate, |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | |
| | | /** 创建点检记录 */ |
| | | function handleCreate() { |
| | |
| | | </script> |
| | | <template> |
| | | <Page auto-content-height><FormModal @success="handleRefresh" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="点检记录列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | auth: ['mes:dv-check-record:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.import', ['设备点检记录']), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:dv-check-record:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |