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

View File

@ -526,13 +526,49 @@ export default {
return row.id; return row.id;
}, },
handleBatchPrint(){ handleBatchPrint(){
this.$confirm("确定打印?", "提示", { // this.$confirm("确定打印?", "提示", {
cancelButtonText: "不打印", // 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(() => {});
this.$prompt('确定打印,输入打印份数', "提示", {
confirmButtonText: "确定打印", confirmButtonText: "确定打印",
type: "warning", cancelButtonText: "不打印",
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
closeOnClickModal: false closeOnClickModal: false,
}).then(() => { 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=[]; let orderList=[];
this.currentSelection.forEach(item=>{ this.currentSelection.forEach(item=>{
orderList.push(item.billCode); orderList.push(item.billCode);
@ -540,6 +576,9 @@ export default {
// 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(() => {});
}, },