update 订单-导出

このコミットが含まれているのは:
lb 2023-09-08 14:18:35 +08:00
コミット 13de0ce8ea
2個のファイルの変更69行の追加5行の削除

ファイルの表示

@ -156,7 +156,7 @@ export default {
if ("list" in res.data) {
this.dataList = res.data.list;
this.totalPage = res.data.total;
}
}
} else {
this.dataList.splice(0);
this.totalPage = 0;
@ -211,7 +211,9 @@ export default {
type: "success",
duration: 2000,
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"]);
},
});
@ -254,7 +256,9 @@ export default {
type: "success",
duration: 2000,
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"]);
},
});
@ -384,6 +388,57 @@ export default {
this.showUploadDialog(payload);
// alert('/pms/order/importExcelOrder');
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 "压制工艺":
//
this.$router.push({ name: "pms-shapeStep" });

ファイルの表示

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