2024-05-24 05:35:58 +00:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
<!-- 打印机状态 -->
|
|
|
|
|
<!-- style="padding:5px 0px;text-align: right;position: fixed;top: 150px;right: 10px; z-index: 9999;" -->
|
|
|
|
|
<div >
|
|
|
|
|
<div style="display: inline-flex;">
|
|
|
|
|
<div v-if="printerStatus==0" style="display: inline-flex;">
|
|
|
|
|
<el-tag type="danger" >{{ printerStatusMessage }}</el-tag>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="printerStatus==1" style="display: inline-flex;">
|
2024-05-30 12:39:28 +00:00
|
|
|
<div v-if="isShowPinters==1" style="font-size: 12px; line-height: 28px;font-weight: 600;">模板:</div>
|
|
|
|
|
<div v-if="isShowTpl==1" style="width: 150px;">
|
2024-05-29 08:18:45 +00:00
|
|
|
<el-select v-model="selTplCode" size="mini" placeholder="选择打印模板" clearable filterable>
|
2024-05-30 12:39:28 +00:00
|
|
|
<template slot="prefix">
|
|
|
|
|
<span style="padding: 5px;line-height: 28px;font-size: 16px;color: rgb(111 111 111);cursor: pointer;" @click="refreshPrintTpl()">
|
|
|
|
|
<i class="el-icon-refresh"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in printTplList"
|
|
|
|
|
:key="item.tplCode"
|
|
|
|
|
:label="item.tplName"
|
|
|
|
|
:value="item.tplCode"
|
|
|
|
|
/>
|
2024-05-24 05:35:58 +00:00
|
|
|
</el-select>
|
|
|
|
|
</div>
|
2024-05-30 12:39:28 +00:00
|
|
|
<div v-if="selTplCode=='TAN-GC-130' && isShowSubBillRange" class="subBillRange" style="display: inline-flex;font-size: 12px; line-height: 28px; font-weight: 600;">
|
|
|
|
|
<span >子单范围:
|
2024-05-29 08:18:45 +00:00
|
|
|
<el-input size="mini" style="width:40px" v-model="subBillStart" type="text" maxlength="4" ></el-input>
|
|
|
|
|
-
|
|
|
|
|
<el-input size="mini" style="width:40px" v-model="subBillEnd" type="text" maxlength="4" ></el-input>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
<div v-if="isShowPinters==1" style="font-size: 12px;line-height: 28px;font-weight: 600;">打印机:</div>
|
|
|
|
|
<div v-if="isShowPinters==1" style="width: 150px;">
|
|
|
|
|
<el-select v-model="selPrinterName" size="mini" placeholder="打印机" clearable filterable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in printerList"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="printerStatus==1" style="display: inline-flex;">
|
2024-05-31 00:36:52 +00:00
|
|
|
<!-- <span style="color: green;font-weight: 600;font-size:13px;">【Printer Online】</span> -->
|
|
|
|
|
<span style="color: #b12e29;font-size:23px;" class="icon iconfont icon-printer" title="Printer Online"></span>
|
2024-05-24 05:35:58 +00:00
|
|
|
</div>
|
|
|
|
|
<div v-if="printerStatus==0" style="display: inline-flex;">
|
2024-05-31 10:12:59 +00:00
|
|
|
<a :href="printerDownUrl" style="color: blue;font-weight: 600;font-size:13px;text-decoration: underline">下载打印组件</a>
|
2024-05-24 05:35:58 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-06-01 11:43:18 +00:00
|
|
|
<el-dialog class="printPreDialog" title="预览" :visible.sync="openPdfView" width="95%" height="100%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body @close="handleClose">
|
2024-05-31 10:12:59 +00:00
|
|
|
<div style="height:100%;width:100%;overflow: auto;">
|
2024-05-31 23:31:01 +00:00
|
|
|
<PdfViewer ref="pdfViewer" v-if="openPdfView" :pdfList="pdfList" @onPrint="onPdfViewPrint" ></PdfViewer>
|
2024-05-29 08:49:13 +00:00
|
|
|
</div>
|
2024-05-24 05:35:58 +00:00
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import emitter from 'element-ui/src/mixins/emitter';
|
2024-05-31 10:12:59 +00:00
|
|
|
import PdfViewer from '@/components/PdfViewer/viewer.vue';
|
2024-05-24 05:35:58 +00:00
|
|
|
import PdfUtils from '@/utils/pdfUtils'
|
2024-05-31 23:31:01 +00:00
|
|
|
import { deepClone } from '@/utils/index'
|
2024-05-24 05:35:58 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "TanexPrinterPanel",
|
|
|
|
|
components: {
|
|
|
|
|
PdfViewer,
|
|
|
|
|
},
|
|
|
|
|
mixins: [emitter],
|
|
|
|
|
props: {
|
|
|
|
|
value: {
|
2024-05-30 12:39:28 +00:00
|
|
|
type: [Number],
|
2024-05-24 05:35:58 +00:00
|
|
|
required: false
|
|
|
|
|
},
|
|
|
|
|
placeholder:{
|
|
|
|
|
type: [String],
|
|
|
|
|
required: false
|
2024-05-30 12:39:28 +00:00
|
|
|
},
|
|
|
|
|
isShowPinters:{
|
|
|
|
|
type: [Boolean],
|
|
|
|
|
required: false,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
isShowTpl:{
|
|
|
|
|
type: [Boolean],
|
|
|
|
|
required: false,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
isShowSubBillRange:{
|
|
|
|
|
type: [Boolean],
|
|
|
|
|
required: false,
|
|
|
|
|
default: false
|
2024-05-24 05:35:58 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
svalue: this.value,
|
2024-05-29 08:18:45 +00:00
|
|
|
subBillStart:1,
|
2024-06-01 11:43:18 +00:00
|
|
|
subBillEnd:null,
|
2024-05-24 05:35:58 +00:00
|
|
|
openPdfView:false,
|
2024-05-31 23:31:01 +00:00
|
|
|
|
|
|
|
|
// 计数器
|
|
|
|
|
showCounter:0,
|
|
|
|
|
|
2024-05-31 10:12:59 +00:00
|
|
|
pdfList:[],
|
2024-05-24 05:35:58 +00:00
|
|
|
|
|
|
|
|
tanexPrinter:null,
|
|
|
|
|
printerDownUrl:null,
|
|
|
|
|
|
|
|
|
|
printerStatus:0,
|
|
|
|
|
printerStatusMessage:'打印组件未连接',
|
|
|
|
|
|
|
|
|
|
orderList:[],
|
|
|
|
|
|
|
|
|
|
printerList:[],
|
|
|
|
|
printTplList:[],
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
selTplCode:null,
|
2024-05-24 05:35:58 +00:00
|
|
|
selPrinterName:null,
|
|
|
|
|
|
|
|
|
|
currentSelection:[],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
value(newVal) {
|
|
|
|
|
this.svalue = newVal;
|
|
|
|
|
if(this.svalue!=null) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.initTanexPrinterSdk();
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy(){
|
2024-05-30 12:39:28 +00:00
|
|
|
// this.tanexPrinter.close();
|
2024-05-24 05:35:58 +00:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
initTanexPrinterSdk(){
|
|
|
|
|
this.tanexPrinter = this.$tanexPrinter;
|
|
|
|
|
|
|
|
|
|
this.getConfigKey("sys.printer.downurl").then(response => {
|
|
|
|
|
this.printerDownUrl = response.msg;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.tanexPrinter.init();
|
|
|
|
|
|
|
|
|
|
this.tanexPrinter.setOnOpen(this.onPrinterOpen);
|
|
|
|
|
this.tanexPrinter.setOnClose(this.onPrinterClose);
|
|
|
|
|
this.tanexPrinter.setOnError(this.onPrinterError);
|
|
|
|
|
this.tanexPrinter.setOnGetPrinter(this.onGetPrinter);
|
|
|
|
|
this.tanexPrinter.setOnGetPrintTpl(this.onGetPrintTpl);
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onPrinterOpen(evt){
|
|
|
|
|
// console.log("onPrinterOpen")
|
|
|
|
|
this.printerStatus = 1;
|
2024-05-30 12:39:28 +00:00
|
|
|
this.$emit("input",this.printerStatus);
|
2024-05-24 05:35:58 +00:00
|
|
|
this.printerStatusMessage="打印组件已连接,可以打印.";
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onPrinterClose(evt){
|
|
|
|
|
// console.log("onPrinterClose")
|
|
|
|
|
this.printerStatus = 0;
|
2024-05-30 12:39:28 +00:00
|
|
|
this.$emit("input",this.printerStatus);
|
2024-05-24 05:35:58 +00:00
|
|
|
this.printerStatusMessage="打印组件已断开!";
|
|
|
|
|
},
|
|
|
|
|
onPrinterError(evt){
|
|
|
|
|
// console.log("onPrinterError")
|
|
|
|
|
this.printerStatus = 0;
|
2024-05-30 12:39:28 +00:00
|
|
|
this.$emit("input",this.printerStatus);
|
2024-05-24 05:35:58 +00:00
|
|
|
this.printerStatusMessage="打印组件已断开!";
|
|
|
|
|
},
|
|
|
|
|
onGetPrinter(msg){
|
|
|
|
|
// console.log("onGetPrinter")
|
|
|
|
|
this.printerList=this.tanexPrinter.getPrinterTplList();
|
|
|
|
|
this.selPrinterName=this.tanexPrinter.getDefaultPrinter();
|
|
|
|
|
},
|
|
|
|
|
onGetPrintTpl(msg){
|
|
|
|
|
// console.log("onGetPrintTpl")
|
2024-05-29 08:18:45 +00:00
|
|
|
|
|
|
|
|
this.printTplList=[];
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
this.printTplList=this.tanexPrinter.getPrintTplList();
|
2024-05-29 08:18:45 +00:00
|
|
|
// console.log(this.printTplList)
|
|
|
|
|
|
|
|
|
|
this.selTplCode=this.printTplList[0].tplCode;
|
|
|
|
|
},
|
2024-05-30 12:39:28 +00:00
|
|
|
getDefaultPrinter(){
|
|
|
|
|
return this.tanexPrinter.getDefaultPrinter();
|
|
|
|
|
},
|
2024-05-29 08:18:45 +00:00
|
|
|
refreshPrintTpl(){
|
|
|
|
|
this.printTplList=[];
|
|
|
|
|
this.selTplCode=null;
|
|
|
|
|
this.tanexPrinter.refreshPrintTpl()
|
|
|
|
|
},
|
|
|
|
|
lpadZero(val,len) {
|
|
|
|
|
return (new Array(len + 1).join('0') + val).slice(-len);
|
2024-05-24 05:35:58 +00:00
|
|
|
},
|
2024-05-30 12:39:28 +00:00
|
|
|
/*
|
|
|
|
|
高级批量打印
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
"tplCode":tplCode,
|
|
|
|
|
"printerName":printerName,
|
|
|
|
|
"orderList":orderList.toString()
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
batchPrintAdv(printDataList){
|
2024-05-31 10:12:59 +00:00
|
|
|
if(this.printerStatus !=1){
|
|
|
|
|
this.$modal.msgError("打印机未连接");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
this.tanexPrinter.batchPrintAdv(printDataList);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
batchPrint(orderList,tplCode){
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
if(this.printerStatus !=1){
|
|
|
|
|
this.$modal.msgError("打印机未连接");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
let that = this;
|
2024-05-29 08:18:45 +00:00
|
|
|
let newOrderList=[];
|
2024-05-24 05:35:58 +00:00
|
|
|
if(orderList){
|
|
|
|
|
this.orderList=[...orderList]
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
if(tplCode){
|
|
|
|
|
this.selTplCode=tplCode
|
2024-05-29 08:18:45 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
newOrderList=[...orderList];
|
2024-05-29 08:18:45 +00:00
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
that.tanexPrinter.batchPrint(that.selTplCode,that.selPrinterName,newOrderList)
|
|
|
|
|
},
|
2024-05-31 10:12:59 +00:00
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
printPreviewAdv(printDataList,billCount){
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
if(this.printerStatus !=1){
|
|
|
|
|
this.$modal.msgError("打印机未连接");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
let that = this;
|
|
|
|
|
const loadingInstance = this.$loading({
|
|
|
|
|
text: '正在生成预览...'
|
|
|
|
|
})
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
that.pdfList=[];
|
2024-05-31 23:31:01 +00:00
|
|
|
that.showCounter=0;
|
2024-05-31 10:12:59 +00:00
|
|
|
this.tanexPrinter.batchGetPDFAdv(printDataList,billCount,async function(code,msg,data){
|
|
|
|
|
console.log(msg);
|
|
|
|
|
console.log(code);
|
|
|
|
|
if(code == 500){
|
|
|
|
|
that.$modal.msgError("打印出错:"+msg);
|
|
|
|
|
}
|
|
|
|
|
else if(code == 200){
|
2024-05-31 23:31:01 +00:00
|
|
|
const pdfData=deepClone(data);
|
2024-05-31 10:12:59 +00:00
|
|
|
loadingInstance.close();
|
2024-05-30 12:39:28 +00:00
|
|
|
let pdfUtils=new PdfUtils({});
|
2024-05-31 10:12:59 +00:00
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
let blobUrl= await pdfUtils.getBlobUrl(pdfData.file);
|
2024-05-31 10:12:59 +00:00
|
|
|
let pdfInfo={
|
2024-05-31 23:31:01 +00:00
|
|
|
"billCode":pdfData.ydSn,
|
2024-05-31 10:12:59 +00:00
|
|
|
"pdfUrl":blobUrl
|
|
|
|
|
}
|
|
|
|
|
that.pdfList.push(pdfInfo);
|
2024-05-31 23:31:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!that.openPdfView && that.showCounter==0){
|
|
|
|
|
that.openPdfView = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.showCounter++;
|
2024-05-31 10:12:59 +00:00
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
}
|
2024-05-31 10:12:59 +00:00
|
|
|
else if(code == 800){
|
|
|
|
|
// 全部获取完成
|
2024-05-31 23:31:01 +00:00
|
|
|
// console.log("===预览全部获取完成====>");
|
2024-05-31 10:12:59 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
});
|
2024-05-24 05:35:58 +00:00
|
|
|
},
|
2024-05-31 23:31:01 +00:00
|
|
|
printPreview(orderList){
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
if(this.printerStatus !=1){
|
|
|
|
|
this.$modal.msgError("打印机未连接");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
let that = this;
|
|
|
|
|
let newOrderList=[];
|
2024-05-24 05:35:58 +00:00
|
|
|
if(orderList){
|
|
|
|
|
this.orderList=[...orderList]
|
|
|
|
|
}
|
2024-05-30 12:39:28 +00:00
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
// 打印子单
|
|
|
|
|
if(this.selTplCode=="TAN-GC-130"){
|
|
|
|
|
for(let i=0;i<this.orderList.length;i++){
|
|
|
|
|
let billCode=this.orderList[i];
|
2024-06-01 11:43:18 +00:00
|
|
|
let subBillStart=1;
|
|
|
|
|
if(this.subBillStart&&this.subBillStart>0){
|
|
|
|
|
subBillStart=this.subBillStart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let subBillEnd=50;
|
|
|
|
|
if(this.subBillEnd){
|
|
|
|
|
subBillEnd = this.subBillEnd;
|
|
|
|
|
}
|
2024-05-31 23:31:01 +00:00
|
|
|
// 循环子单范围
|
2024-06-01 11:43:18 +00:00
|
|
|
for(let i=subBillStart;i<=subBillEnd;i++){
|
2024-05-31 23:31:01 +00:00
|
|
|
let subBillCode = billCode+""+this.lpadZero(i,4);
|
|
|
|
|
newOrderList.push(subBillCode);
|
|
|
|
|
}
|
2024-06-01 11:43:18 +00:00
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
newOrderList=[...orderList];
|
2024-05-30 12:39:28 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
const loadingInstance = this.$loading({
|
|
|
|
|
text: '正在生成预览...'
|
|
|
|
|
})
|
2024-05-29 08:18:45 +00:00
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
that.pdfList=[];
|
|
|
|
|
that.showCounter=0;
|
|
|
|
|
this.tanexPrinter.batchGetPDF(this.selTplCode,this.selPrinterName,newOrderList,async function(code,msg,data){
|
2024-05-31 10:12:59 +00:00
|
|
|
if(code == 500){
|
|
|
|
|
that.$modal.msgError("打印出错:"+msg);
|
|
|
|
|
}
|
|
|
|
|
else if(code == 200){
|
|
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
const pdfData=deepClone(data);
|
2024-05-31 10:12:59 +00:00
|
|
|
loadingInstance.close();
|
2024-05-24 05:35:58 +00:00
|
|
|
let pdfUtils=new PdfUtils({});
|
2024-05-31 10:12:59 +00:00
|
|
|
let blobUrl= await pdfUtils.getBlobUrl(pdfData.file);
|
|
|
|
|
let pdfInfo={
|
|
|
|
|
"billCode":pdfData.ydSn,
|
|
|
|
|
"pdfUrl":blobUrl
|
|
|
|
|
}
|
|
|
|
|
that.pdfList.push(pdfInfo);
|
2024-05-31 23:31:01 +00:00
|
|
|
|
|
|
|
|
if(!that.openPdfView && that.showCounter==0){
|
|
|
|
|
that.openPdfView = true;
|
|
|
|
|
}
|
|
|
|
|
that.showCounter++;
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if(code == 800){
|
|
|
|
|
// 全部获取完成
|
2024-05-31 23:31:01 +00:00
|
|
|
// console.log("===全部获取完成====>");
|
2024-05-24 05:35:58 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
downPDF(orderList){
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
if(this.printerStatus !=1){
|
|
|
|
|
this.$modal.msgError("打印机未连接");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
let that = this;
|
|
|
|
|
let newOrderList=[];
|
2024-05-24 05:35:58 +00:00
|
|
|
if(orderList){
|
|
|
|
|
this.orderList=[...orderList]
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
// 打印子单
|
|
|
|
|
if(this.selTplCode=="TAN-GC-130"){
|
|
|
|
|
for(let i=0;i<this.orderList.length;i++){
|
|
|
|
|
let billCode=this.orderList[i];
|
|
|
|
|
// 循环子单范围
|
2024-06-01 11:43:18 +00:00
|
|
|
let subBillStart=1;
|
|
|
|
|
if(this.subBillStart&&this.subBillStart>0){
|
|
|
|
|
subBillStart=this.subBillStart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let subBillEnd=50;
|
|
|
|
|
if(this.subBillEnd){
|
|
|
|
|
subBillEnd = this.subBillEnd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(let i=subBillStart;i<=subBillEnd;i++){
|
2024-05-29 08:18:45 +00:00
|
|
|
let subBillCode = billCode+""+this.lpadZero(i,4);
|
|
|
|
|
newOrderList.push(subBillCode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
newOrderList=[...orderList];
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
const loadingInstance = this.$loading({
|
|
|
|
|
text: '正在下载...'
|
|
|
|
|
})
|
2024-05-31 23:31:01 +00:00
|
|
|
this.tanexPrinter.batchGetPDF(this.selTplCode,this.selPrinterName,newOrderList,function(code,msg,data){
|
2024-05-24 05:35:58 +00:00
|
|
|
loadingInstance.close();
|
2024-05-31 10:12:59 +00:00
|
|
|
|
|
|
|
|
if(code == 500){
|
|
|
|
|
that.$modal.msgError("下载出错:"+msg);
|
|
|
|
|
}
|
|
|
|
|
else if(code == 200){
|
|
|
|
|
|
2024-05-31 23:31:01 +00:00
|
|
|
const pdfData=deepClone(data);
|
2024-05-31 10:12:59 +00:00
|
|
|
loadingInstance.close();
|
2024-05-24 05:35:58 +00:00
|
|
|
let pdfUtils=new PdfUtils({});
|
2024-05-31 23:31:01 +00:00
|
|
|
pdfUtils.getBlobUrl(pdfData.file, pdfData.ydSn+".pdf",true )
|
2024-05-24 05:35:58 +00:00
|
|
|
}
|
2024-05-31 10:12:59 +00:00
|
|
|
else if(code == 800){
|
|
|
|
|
// 全部获取完成
|
2024-05-31 23:31:01 +00:00
|
|
|
// console.log("===全部获取完成====>");
|
2024-05-31 10:12:59 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
});
|
2024-05-24 05:35:58 +00:00
|
|
|
},
|
|
|
|
|
|
2024-05-30 12:39:28 +00:00
|
|
|
// 响应PDF预览
|
|
|
|
|
onPdfViewPrint(){
|
|
|
|
|
this.$emit("onPrint");
|
2024-06-01 11:43:18 +00:00
|
|
|
},
|
|
|
|
|
handleClose(){
|
|
|
|
|
this.$emit("onPrintComplete");
|
2024-05-30 12:39:28 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
.printPreDialog .el-dialog__body {
|
|
|
|
|
margin: 0px!important;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-29 08:18:45 +00:00
|
|
|
.subBillRange .el-input__inner {
|
|
|
|
|
padding:0px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-24 05:35:58 +00:00
|
|
|
|
|
|
|
|
</style>
|