feat(mdm): 基础数据物料管理/物料分类/计量单位增加导出按钮
- 三个页面工具栏新增"导出"按钮(按当前列表筛选条件导出全部数据)
- 补充 mdm/unit、mes/md/item/type 的 export-excel API
Co-Authored-By: Claude <noreply@anthropic.com>
| | |
| | | return requestClient.delete(`/mdm/unit/delete?id=${id}`); |
| | | } |
| | | |
| | | /** 导出计量单位 */ |
| | | export function exportUnit(params: Record<string, any>) { |
| | | return requestClient.download('/mdm/unit/export-excel', { params }); |
| | | } |
| | | |
| | | /** 下载计量单位导入模板 */ |
| | | export function importUnitTemplate() { |
| | | return requestClient.download('/mdm/unit/get-import-template'); |
| | |
| | | return requestClient.delete(`/mes/md/item-type/delete?id=${id}`); |
| | | } |
| | | |
| | | /** 导出物料产品分类 */ |
| | | export function exportItemType(params: Record<string, any>) { |
| | | return requestClient.download('/mes/md/item-type/export-excel', { params }); |
| | | } |
| | | |
| | | /** 下载物料产品分类导入模板 */ |
| | | export function importItemTypeTemplate() { |
| | | return requestClient.download('/mes/md/item-type/get-import-template'); |
| | |
| | | import { |
| | | deleteItem, |
| | | deleteItemList, |
| | | // exportItem, |
| | | exportItem, |
| | | getItemPage, |
| | | updateItemStatus, |
| | | updateItemSync, |
| | |
| | | gridApi.query(); |
| | | } |
| | | |
| | | /** 导出表格 */ |
| | | // async function handleExport() { |
| | | // const data = await exportItem(await gridApi.formApi.getValues()); |
| | | // downloadFileFromBlobPart({ fileName: '物料.xls', source: data }); |
| | | // } |
| | | /** 导出表格(按当前列表查询条件导出全部命中数据) */ |
| | | async function handleExport() { |
| | | const data = await exportItem(await gridApi.formApi.getValues()); |
| | | downloadFileFromBlobPart({ fileName: '物料数据.xls', source: data }); |
| | | } |
| | | |
| | | /** 创建物料 */ |
| | | function handleCreate() { |
| | |
| | | auth: ['mdm:item:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | // { |
| | | // label: $t('ui.actionTitle.export'), |
| | | // type: 'primary', |
| | | // icon: ACTION_ICON.DOWNLOAD, |
| | | // auth: ['mdm:item:export'], |
| | | // onClick: handleExport, |
| | | // }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |
| | | auth: ['mdm:item:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.deleteBatch'), |
| | | type: 'primary', |
| | |
| | | import type { MdmUnitApi } from '#/api/mdm/unit'; |
| | | |
| | | import { Page, useVbenModal } from '#/packages/effects/common-ui/src'; |
| | | import { downloadFileFromBlobPart } from '#/packages/utils/src'; |
| | | |
| | | import { message, Tag } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | deleteUnit, |
| | | exportUnit, |
| | | getUnitPage, |
| | | } from '#/api/mdm/unit'; |
| | | import { $t } from '#/locales'; |
| | |
| | | /** 导入计量单位 */ |
| | | function handleImport() { |
| | | importModalApi.open(); |
| | | } |
| | | |
| | | /** 导出计量单位(按当前列表查询条件导出全部命中数据) */ |
| | | async function handleExport() { |
| | | const data = await exportUnit(await gridApi.formApi.getValues()); |
| | | downloadFileFromBlobPart({ fileName: '计量单位数据.xls', source: data }); |
| | | } |
| | | |
| | | /** 编辑计量单位 */ |
| | |
| | | auth: ['mdm:unit-measure:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |
| | | auth: ['mdm:unit-measure:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |
| | |
| | | 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, |