Browse Source

物品包装信息导出,高级筛选导出

master
zhang_li 1 year ago
parent
commit
704a278dca
  1. 5
      src/api/wms/itembasic/index.ts
  2. 6
      src/api/wms/itempackaging/index.ts
  3. 4
      src/config/axios/index.ts
  4. 1
      src/hooks/web/useTable.ts
  5. 1
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue
  6. 9
      src/views/wms/basicDataManage/itemManage/itempackaging/index.vue

5
src/api/wms/itembasic/index.ts

@ -61,8 +61,13 @@ export const deleteItembasic = async (id: number) => {
// 导出物品基本信息 Excel
export const exportItembasic = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/itembasic/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/itembasic/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {

6
src/api/wms/itempackaging/index.ts

@ -52,9 +52,13 @@ export const deleteItempackaging = async (id: number) => {
// 导出物品包装信息 Excel
export const exportItempackaging = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/itempackaging/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/itempackaging/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/itempackaging/get-import-template' })

4
src/config/axios/index.ts

@ -47,6 +47,10 @@ export default {
const res = await request({ method: 'GET', responseType: 'blob', ...option })
return res as unknown as Promise<T>
},
downloadPost: async <T = any>(option: any) => {
const res = await request({ method: 'POST', responseType: 'blob', ...option })
return res as unknown as Promise<T>
},
upload: async <T = any>(option: any) => {
option.headersType = 'multipart/form-data'
const res = await request({ method: 'POST', ...option })

1
src/hooks/web/useTable.ts

@ -5,6 +5,7 @@ import { computed, nextTick, reactive, ref, unref, watch } from 'vue'
import type { TableProps } from '@/components/Table/src/types'
import { TableSetPropsType } from '@/types/table'
import { emit } from 'process'
const { t } = useI18n()
interface ResponseType<T = any> {

1
src/views/wms/basicDataManage/itemManage/itembasic/index.vue

@ -205,7 +205,6 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
console.log(tableObject.params)
const data = await ItembasicApi.exportItembasic(tableObject.params)
download.excel(data, '物品基本信息.xls')
} catch {

9
src/views/wms/basicDataManage/itemManage/itempackaging/index.vue

@ -220,15 +220,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
//
if (tableObject.params.isSearch) {
// tableObject.params 20231109
const data = await ItempackagingApi.exportItempackaging(setSearchParams)
const data = await ItempackagingApi.exportItempackaging(tableObject.params)
download.excel(data, '物品包装信息.xls')
} else {
const data = await ItempackagingApi.exportItempackaging(setSearchParams)
download.excel(data, '物品包装信息 .xls')
}
} catch {
} finally {
exportLoading.value = false

Loading…
Cancel
Save