| | |
| | | import { ref } from 'vue'; |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { deleteItemType, getItemTypeList } from '#/api/mes/md/item/type'; |
| | | import { |
| | | deleteItemType, |
| | | exportItemType, |
| | | getItemTypeList, |
| | | } from '#/api/mes/md/item/type'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | |
| | | /** 导入分类 */ |
| | | function handleImport() { |
| | | importModalApi.open(); |
| | | } |
| | | |
| | | /** 导出分类(按当前列表查询条件导出全部命中数据) */ |
| | | async function handleExport() { |
| | | const data = await exportItemType(await gridApi.formApi.getValues()); |
| | | downloadFileFromBlobPart({ fileName: '物料分类数据.xls', source: data }); |
| | | } |
| | | |
| | | /** 添加下级分类 */ |
| | |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |
| | | auth: ['mes:md-item-type:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | { |
| | | label: isExpanded ? '收缩' : '展开', |
| | | type: 'primary', |
| | | onClick: handleExpand, |