Commit 13fecbad authored by zhoutong's avatar zhoutong

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

parent 1dae0c33
......@@ -506,12 +506,13 @@ export default {
this.$router.push('/boxAir/batch_markup?shipmentId=' + row.id)
break
case "downloadPreloadGoodsList":
downloadFile(
command,
{shipmentId: row.id},
this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
// downloadFile(
// command,
// {shipmentId: row.id},
// this.$t("预装单") + `(${row.selfNo}).xlsx`,
// "xlsx"
// );
this.exportExcel(exportboxExcel, { shipmentId: row.id }, this.$t("预装单") + `(${row.selfNo}).xlsx`)
break;
case "downloadLoadGoodsList":
downloadFile(
......@@ -563,6 +564,20 @@ export default {
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 {
countryList: [],
// 通知列表
noticeList: [],
allUsers: [],
allUsers: []
};
},
computed: {
......@@ -489,12 +489,13 @@ export default {
break;
case "downloadPreloadGoodsList":
downloadFile(
command,
{ shipmentId: row.id },
this.$t("预装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
// downloadFile(
// command,
// { shipmentId: row.id },
// this.$t("预装单") + `(${row.selfNo}).xlsx`,
// "xlsx"
// );
this.exportExcel(exportboxExcel, { shipmentId: row.id }, this.$t("预装单") + `(${row.selfNo}).xlsx`)
break;
case "downloadLoadGoodsList":
downloadFile(
......@@ -547,6 +548,20 @@ export default {
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) {
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