Browse Source

新增提货扫描导出

dev-xx
qb 7 months ago
parent
commit
582accdc32
  1. 12
      src/api/distribution/arteryDistrilbutionBillLadingList.js
  2. 37
      src/views/distribution/inventory/arteryDistrilbutionBillLadingList.vue

12
src/api/distribution/arteryDistrilbutionBillLadingList.js

@ -177,6 +177,18 @@ export const postPageListExport = data => {
}); });
}; };
/**
* 干线提货扫描明细导出
*/
export const postBillladingPackageDetailExport = data => {
return request({
url: '/api/logpm-trunkline/billlading/billladingPackageDetailExport',
method: 'post',
data,
responseType: 'blob',
});
};
/** /**
* 干线提货详情导出 * 干线提货详情导出
*/ */

37
src/views/distribution/inventory/arteryDistrilbutionBillLadingList.vue

@ -105,7 +105,12 @@
> >
取消提货 取消提货
</el-button> </el-button>
<el-button type="danger" icon="el-icon-download" @click="handleExportInfo" plain> <el-button
type="danger"
icon="el-icon-download"
@click="() => handleExportInfo('page')"
plain
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -271,8 +276,17 @@
:before-close="beforeClose" :before-close="beforeClose"
append-to-body append-to-body
> >
<el-button
type="danger"
icon="el-icon-download"
@click="() => handleExportInfo('detail')"
plain
>
导出
</el-button>
<!-- 列表模块 --> <!-- 列表模块 -->
<tablecmt <tablecmt
class="mt20"
:columnList="columnDetailList" :columnList="columnDetailList"
:tableData="detailsData" :tableData="detailsData"
:loading="loadingObj.detailsLoding" :loading="loadingObj.detailsLoding"
@ -333,6 +347,7 @@ import {
postFindWaybillBillladingList, postFindWaybillBillladingList,
postAddWaybillToBillladingId, postAddWaybillToBillladingId,
postPageListExport, postPageListExport,
postBillladingPackageDetailExport,
} from '@/api/distribution/arteryDistrilbutionBillLadingList'; } from '@/api/distribution/arteryDistrilbutionBillLadingList';
// //
import { import {
@ -1006,21 +1021,31 @@ export default {
this.form.num = this.form.maxNum; this.form.num = this.form.maxNum;
}, },
/** 导出 */ /** 导出 */
async handleExportInfo() { async handleExportInfo(type, row = {}) {
try { try {
this.loadingObj.pageLoading = true; type === 'detail'
? (this.loadingObj.detailsLoding = true)
: (this.loadingObj.pageLoading = true);
const res = await postPageListExport(this.query); const res =
type === 'detail'
? await postBillladingPackageDetailExport(this.detailQuery)
: await postPageListExport(this.query);
const { status, data } = res; const { status, data } = res;
if (status !== 200) return; if (status !== 200) return;
console.log('data :>> ', data); console.log('data :>> ', data);
downloadXls(data, `干线提货数据-${dateNow()}.xlsx`); const name =
type === 'detail' ? `${this.title}-${dateNow()}.xlsx` : `干线提货数据-${dateNow()}.xlsx`;
downloadXls(data, name);
} catch (error) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);
} finally { } finally {
this.loadingObj.pageLoading = false; type === 'detail'
? (this.loadingObj.detailsLoding = false)
: (this.loadingObj.pageLoading = false);
} }
}, },
}, },

Loading…
Cancel
Save