Commit 13fecbad authored by zhoutong's avatar zhoutong

【生产反馈】性能优化:导出预装单时间很久,最快也要一分钟多

parent 1dae0c33
...@@ -506,12 +506,13 @@ export default { ...@@ -506,12 +506,13 @@ export default {
this.$router.push('/boxAir/batch_markup?shipmentId=' + row.id) this.$router.push('/boxAir/batch_markup?shipmentId=' + row.id)
break break
case "downloadPreloadGoodsList": case "downloadPreloadGoodsList":
downloadFile( // downloadFile(
command, // command,
{shipmentId: row.id}, // {shipmentId: row.id},
this.$t("预装单") + `(${row.selfNo}).xlsx`, // this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx" // "xlsx"
); // );
this.exportExcel(exportboxExcel, { shipmentId: row.id }, this.$t("预装单") + `(${row.selfNo}).xlsx`)
break; break;
case "downloadLoadGoodsList": case "downloadLoadGoodsList":
downloadFile( downloadFile(
...@@ -563,6 +564,20 @@ export default { ...@@ -563,6 +564,20 @@ export default {
this.$set(this.dialogCfg, "open", true); this.$set(this.dialogCfg, "open", true);
} }
}, },
// 通用导出函数
exportExcel(func, params, fileName = null){
this.exportLoading = true;
func(params).then(res => {
console.log({res})
if(!fileName){
fileName = this.$t('订单')
}
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
// this.$download.excel(res, fileName + '.xls');
}).finally(() => {
this.exportLoading = false
})
},
} }
} }
......
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
countryList: [], countryList: [],
// 通知列表 // 通知列表
noticeList: [], noticeList: [],
allUsers: [], allUsers: []
}; };
}, },
computed: { computed: {
...@@ -489,12 +489,13 @@ export default { ...@@ -489,12 +489,13 @@ export default {
break; break;
case "downloadPreloadGoodsList": case "downloadPreloadGoodsList":
downloadFile( // downloadFile(
command, // command,
{ shipmentId: row.id }, // { shipmentId: row.id },
this.$t("预装单") + `(${row.selfNo}).xlsx`, // this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx" // "xlsx"
); // );
this.exportExcel(exportboxExcel, { shipmentId: row.id }, this.$t("预装单") + `(${row.selfNo}).xlsx`)
break; break;
case "downloadLoadGoodsList": case "downloadLoadGoodsList":
downloadFile( downloadFile(
...@@ -547,6 +548,20 @@ export default { ...@@ -547,6 +548,20 @@ export default {
this.$set(this.dialogCfg, "open", true); this.$set(this.dialogCfg, "open", true);
} }
}, },
// 通用导出函数
exportExcel(func, params, fileName = null){
this.exportLoading = true;
func(params).then(res => {
console.log({res})
if(!fileName){
fileName = this.$t('订单')
}
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
// this.$download.excel(res, fileName + '.xls');
}).finally(() => {
this.exportLoading = false
})
},
/* 分页 */ /* 分页 */
pageChange(page) { pageChange(page) {
this.pageParam.page = page; this.pageParam.page = page;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment