update 批量打印

This commit is contained in:
lb
2023-08-16 16:56:16 +08:00
parent cdaa2c1f6c
commit 725fa19bd1
3 changed files with 66 additions and 34 deletions

View File

@@ -622,12 +622,7 @@ export default {
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
this.printDOMmount = true;
this.$nextTick(() => {
this.$refs["print"].print(data);
});
})
.then(this.printOnce.bind(null, data))
.catch((err) => {
// console.log("cancel ", err);
});
@@ -719,9 +714,39 @@ export default {
});
});
break;
case "打印":
return this.$confirm("开始打印么", "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
console.log("打印如下这些 ids:", this.tableSelectedIds);
// this.tableSelectedIds.reduce(async (id, _) => {
// await this.printOnce(id);
// })
this.tableSelectedIds.forEach(async (id) => {
await this.printOnce(id);
})
})
.catch((err) => {
this.$message.error(`批量打印出错: ${err}`);
});
}
},
/** 打印一次 */
printOnce(id) {
return new Promise((resolve) => {
this.printDOMmount = true;
this.$nextTick(async () => {
console.log("[Print] 打印项:", id);
await this.$refs["print"].print(id);
resolve();
});
});
},
/** 导航器的操作 */
handleSizeChange(val) {
// val 是新值