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; return row.id;
}, },
handleBatchPrint(){ handleBatchPrint(){
this.$confirm("确定打印?", "提示", { // this.$confirm("确定打印?", "提示", {
cancelButtonText: "不打印", // cancelButtonText: "不打印",
confirmButtonText: "确定打印", // confirmButtonText: "确定打印",
type: "warning", // type: "warning",
distinguishCancelAndClose: true, // distinguishCancelAndClose: true,
closeOnClickModal: false // closeOnClickModal: false
}).then(() => { // }).then(() => {
let orderList=[]; // let orderList=[];
this.currentSelection.forEach(item=>{ // this.currentSelection.forEach(item=>{
orderList.push(item.billCode); // orderList.push(item.billCode);
}); // });
// batchPrint(orderList,tplCode,orderDetailList) // // batchPrint(orderList,tplCode,orderDetailList)
this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection); // this.$refs.tanexPrinter.batchPrint(orderList,null,this.currentSelection);
}).catch(() => {}); // }).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(){ handlePrintPreview(){