Browse Source

导出报错

hella_online_20241128
yufei_wang 5 days ago
parent
commit
6d8f5413f9
  1. 11
      src/api/wms/transaction/index.ts
  2. 4
      src/views/wms/inventoryManage/transaction/index.vue

11
src/api/wms/transaction/index.ts

@ -60,6 +60,17 @@ export const deleteTransaction = async (id: number) => {
return await request.delete({ url: `/wms/transaction/delete?id=` + id }) return await request.delete({ url: `/wms/transaction/delete?id=` + id })
} }
// 导出库存事务 Excel
export const checkExportTransaction = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/transaction/export-excel-senior-checkCnt', data })
} else {
return await request.get({ url: `/wms/transaction/export-excel-checkCnt`, params })
}
}
// 导出库存事务 Excel // 导出库存事务 Excel
export const exportTransaction = async (params) => { export const exportTransaction = async (params) => {
if (params.isSearch) { if (params.isSearch) {

4
src/views/wms/inventoryManage/transaction/index.vue

@ -182,6 +182,10 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
const checkData = await TransactionApi.checkExportTransaction(tableObject.params)
console.log('checkData',checkData)
const data = await TransactionApi.exportTransaction(tableObject.params) const data = await TransactionApi.exportTransaction(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {

Loading…
Cancel
Save