| | |
| | | index: number |
| | | } |
| | | export const useWmsMaterial = (props: any, ctx?: any) => { |
| | | const wmsmaterial = injectModel<WmsMaterial>('wmsmaterial') |
| | | const wmsMaterial = injectModel<WmsMaterial>('wmsMaterial') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头部配置 |
| | |
| | | /** |
| | | * 动态列配置 |
| | | */ |
| | | const wmsmaterialColumns = ref<Record<string, any>>([]) |
| | | const wmsMaterialColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * 搜索值 |
| | | */ |
| | |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | { |
| | | label: '向上添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'up', |
| | | }, |
| | | { |
| | | label: '向下添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'down', |
| | | }, |
| | | { |
| | | label: '创建副本', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await wmsmaterial.cloneData([row.id]) |
| | | ElMessage.success('创建副本成功') |
| | | tableRef.value?.getList() |
| | | }, |
| | | divided: true, |
| | | icon: 'copy', |
| | | }, |
| | | // { |
| | | // label: '向上添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: '向下添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: '创建副本', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsMaterial.cloneData([row.id]) |
| | | // ElMessage.success('创建副本成功') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: '删除', |
| | | fn: async (c: CurrentType) => { |
| | |
| | | `是否删除${names.length ? names.join(',') : c.row.name}` |
| | | ).then(async () => { |
| | | const ids = selection.value.map((item: { id: string }) => item.id) |
| | | await wmsmaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | await wmsMaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id]) |
| | | ElMessage.success('删除成功') |
| | | tableRef.value.getList() |
| | | }) |
| | |
| | | */ |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile( |
| | | '/api/v1/hiawms/wmsmaterial/export', |
| | | params, |
| | | 'hiawms' |
| | | ) |
| | | exportFile('/api/v1/hIAWms/wmsMaterial/export', params, 'hIAWms') |
| | | } |
| | | |
| | | /** |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | wmsmaterialColumns, |
| | | wmsMaterialColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |