update 订单-导出

This commit is contained in:
lb 2023-09-08 14:18:35 +08:00
parent bd73613803
commit 13de0ce8ea
2 changed files with 69 additions and 5 deletions

View File

@ -211,7 +211,9 @@ export default {
type: "success", type: "success",
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)); this.getAList(
Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)
);
this.$emit("refresh-tables", ["ongoing"]); this.$emit("refresh-tables", ["ongoing"]);
}, },
}); });
@ -254,7 +256,9 @@ export default {
type: "success", type: "success",
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)); this.getAList(
Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)
);
this.$emit("refresh-tables", ["finished"]); this.$emit("refresh-tables", ["finished"]);
}, },
}); });
@ -384,6 +388,57 @@ export default {
this.showUploadDialog(payload); this.showUploadDialog(payload);
// alert('/pms/order/importExcelOrder'); // alert('/pms/order/importExcelOrder');
break; break;
case "导出订单":
this.$confirm(`确定要导出订单吗?`, "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
this.overlayVisible = true;
console.log("导出: ", payload);
return this.$http({
url: "/pms/order/export",
method: "post",
headers: {
"Content-Type": "application/json",
},
responseType: "blob",
});
})
.then(({ data: res }) => {
const blob = new Blob([res]);
/** 通知 */
this.$notify({
title: "成功",
message: "开始下载",
type: "success",
duration: 1200,
});
const fileName = "订单导出.xlsx";
if ("download" in document.createElement("a")) {
const alink = document.createElement("a");
alink.download = fileName;
alink.style.display = "none";
alink.target = "_blank";
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
document.body.removeChild(alink);
} else {
navigator.msSaveBlob(blob, fileName);
}
this.overlayVisible = false;
})
.catch((err) => {
this.$message.error("导出出错!");
this.overlayVisible = false;
});
break;
case "压制工艺": case "压制工艺":
// //
this.$router.push({ name: "pms-shapeStep" }); this.$router.push({ name: "pms-shapeStep" });

View File

@ -169,7 +169,6 @@ export default function () {
}, },
}, },
{ {
// 导入订单 - TODO: 需完善具体接口和功能
button: { button: {
type: "success", type: "success",
name: "导入订单", name: "导入订单",
@ -179,6 +178,16 @@ export default function () {
plain: true, plain: true,
}, },
}, },
{
button: {
type: "warning",
name: "导出订单",
permission :''
},
bind: {
plain: true,
},
},
{ {
button: { button: {
name: '压制工艺' name: '压制工艺'