This commit is contained in:
linfso 2024-10-14 09:09:54 +08:00
parent a69c0ebc97
commit 7bd0d221eb

View File

@ -526,21 +526,60 @@ export default {
return row.id;
},
handleBatchPrint(){
this.$confirm("确定打印?", "提示", {
cancelButtonText: "不打印",
confirmButtonText: "确定打印",
type: "warning",
distinguishCancelAndClose: true,
closeOnClickModal: false
}).then(() => {
let orderList=[];
this.currentSelection.forEach(item=>{
orderList.push(item.billCode);
});
// this.$confirm("确定打印?", "提示", {
// cancelButtonText: "不打印",
// confirmButtonText: "确定打印",
// type: "warning",
// distinguishCancelAndClose: true,
// closeOnClickModal: false
// }).then(() => {
// let orderList=[];
// this.currentSelection.forEach(item=>{
// orderList.push(item.billCode);
// });
// batchPrint(orderList,tplCode,orderDetailList)
this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection);
}).catch(() => {});
// // batchPrint(orderList,tplCode,orderDetailList)
// this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection);
// }).catch(() => {});
this.$prompt('确定打印,输入打印份数', "提示", {
confirmButtonText: "确定打印",
cancelButtonText: "不打印",
distinguishCancelAndClose: true,
closeOnClickModal: false,
inputValue: 1,
inputValidator (value) {
if (value) {
return true;
}else{
return false;
}
},
inputErrorMessage: "文件名不能为空"
}).then(async ({ value }) => {
let cnt=parseInt(value);
if(cnt){
let orderList=[];
this.currentSelection.forEach(item=>{
orderList.push(item.billCode);
});
for(let i=0; i<cnt; i++){
// batchPrint(orderList,tplCode,orderDetailList)
this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection);
}
}else{
let orderList=[];
this.currentSelection.forEach(item=>{
orderList.push(item.billCode);
});
// batchPrint(orderList,tplCode,orderDetailList)
this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection);
}
}).catch(() => {});
},
handlePrintPreview(){