Browse Source

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

master
zhang_li 10 months ago
parent
commit
704a278dca
  1. 7
      src/api/wms/itembasic/index.ts
  2. 8
      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. 11
      src/views/wms/basicDataManage/itemManage/itempackaging/index.vue

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

@ -61,7 +61,12 @@ export const deleteItembasic = async (id: number) => {
// 导出物品基本信息 Excel // 导出物品基本信息 Excel
export const exportItembasic = async (params) => { export const exportItembasic = async (params) => {
return await request.download({ url: `/wms/itembasic/export-excel`, 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 })
}
} }
// 下载用户导入模板 // 下载用户导入模板

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

@ -52,9 +52,13 @@ export const deleteItempackaging = async (id: number) => {
// 导出物品包装信息 Excel // 导出物品包装信息 Excel
export const exportItempackaging = async (params) => { export const exportItempackaging = async (params) => {
return await request.download({ url: `/wms/itempackaging/export-excel`, 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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/itempackaging/get-import-template' }) 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 }) const res = await request({ method: 'GET', responseType: 'blob', ...option })
return res as unknown as Promise<T> 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) => { upload: async <T = any>(option: any) => {
option.headersType = 'multipart/form-data' option.headersType = 'multipart/form-data'
const res = await request({ method: 'POST', ...option }) 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 type { TableProps } from '@/components/Table/src/types'
import { TableSetPropsType } from '@/types/table' import { TableSetPropsType } from '@/types/table'
import { emit } from 'process'
const { t } = useI18n() const { t } = useI18n()
interface ResponseType<T = any> { interface ResponseType<T = any> {

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

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

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

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

Loading…
Cancel
Save