|
|
@@ -439,10 +439,13 @@
|
|
|
owner: null, // 货主
|
|
|
appointment_number: null, // 预约号
|
|
|
},
|
|
|
+ clodop:null,
|
|
|
clodopPrintDialogVisible: false,
|
|
|
printerList: [],
|
|
|
- printArg: {
|
|
|
- printer_name: null,
|
|
|
+ print_size_list:[],
|
|
|
+ print_setting: {
|
|
|
+ printer_index: 0,
|
|
|
+ print_size:'',
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -705,52 +708,145 @@
|
|
|
};
|
|
|
},
|
|
|
printLodop() {
|
|
|
- let LODOP = null;
|
|
|
+ this.clodop = null;
|
|
|
try {
|
|
|
- LODOP = getLodop();
|
|
|
- console.log(LODOP);
|
|
|
- if ((LODOP != null) && (typeof (LODOP.VERSION) != "undefined")) {
|
|
|
- this.printView(LODOP);
|
|
|
+ this.clodop = getLodop();
|
|
|
+ if ((this.clodop != null) && (typeof (this.clodop.VERSION) != "undefined")) {
|
|
|
+ this.showPrintDialog();
|
|
|
} else {
|
|
|
- this.downloadLodopConfirm();
|
|
|
+ this.downloadClodopConfirm();
|
|
|
}
|
|
|
} catch (err) {
|
|
|
this.errorTempTip('getLodop error');
|
|
|
}
|
|
|
},
|
|
|
- downloadLodopConfirm() {
|
|
|
+ downloadClodopConfirm() {
|
|
|
this.$confirm('打印组件确实,是否下在?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
+ // 下载
|
|
|
this.downloadLodop();
|
|
|
}).catch(() => {
|
|
|
- this.getPrinterList(LODOP);
|
|
|
- this.clodopPrintDialogVisible = true;
|
|
|
+ // 取消下载
|
|
|
});
|
|
|
},
|
|
|
downloadLodop() {
|
|
|
let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
|
|
|
window.open(url, '_target');
|
|
|
},
|
|
|
- printView(LODOP) {
|
|
|
- this.getPrinterList(LODOP);
|
|
|
- console.log(this.printerList);
|
|
|
- let strHTML = document.getElementById("print-receiving-task").innerHTML;
|
|
|
-
|
|
|
-
|
|
|
+ showPrintDialog() {
|
|
|
+ this.getPrinterList();
|
|
|
+ this.clodopPrintDialogVisible = true;
|
|
|
},
|
|
|
- getPrinterList(LODOP) {
|
|
|
+ getPrinterList() {
|
|
|
this.printerList = [];
|
|
|
- let count = LODOP.GET_PRINTER_COUNT();
|
|
|
+ let count = this.clodop.GET_PRINTER_COUNT();
|
|
|
for (let i = 0; i < count; i++) {
|
|
|
this.printerList.push({
|
|
|
- name: LODOP.GET_PRINTER_NAME(i),
|
|
|
+ name: this.clodop.GET_PRINTER_NAME(i),
|
|
|
value: i,
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ switchPrinter(){
|
|
|
+ let {printer_index} = this.print_setting;
|
|
|
+ let print_size_select = document.getElementById('print-size-select');
|
|
|
+ this.clodop.Create_PageSize_List(print_size_select,printer_index);
|
|
|
+ },
|
|
|
+ clodopPrint(){
|
|
|
+ this.clodop.PRINT_INITA(0,0,490,285,"");
|
|
|
+ this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39","123456789012");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(100,115,250,20,"SH210211228001");
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
|
|
|
+ this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,115,130,20,"新加文本15");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,115,100,20,"新加文本16");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,115,130,20,"新加文本17");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,115,100,20,"新加文本18");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,115,130,20,"新加文本19");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(130,345,100,20,"新加文本20");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(160,345,140,20,"新加文本21");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(190,345,140,20,"123456789012345678");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(220,345,100,20,"新加文本23");
|
|
|
+ this.clodop.ADD_PRINT_TEXT(250,345,140,20,"新加文本24");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // this.clodop.SET_PRINT_MODE("PRINT_NOCOLLATE",1);
|
|
|
+ // this.clodop.ADD_PRINT_BARCODE(15,70,350,55,"Code39","123456789012");
|
|
|
+ // this.clodop.SET_PRINT_STYLEA(0,"GroundColor","#ffffff");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(95,15,100,20,"收货任务号");
|
|
|
+ // this.clodop.SET_PRINT_STYLEA(0,"SpacePatch",1);
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(95,116,150,20,"-收货任务号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(125,15,100,20,"仓库");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(155,15,100,20,"司机姓名");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(225,15,100,20,"是否提供清单");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(260,15,100,20,"货主");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(125,260,100,20,"投单员");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(155,260,100,20,"司机电话");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(190,260,100,20,"驾驶证号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(225,260,100,20,"收货类型");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(260,260,100,20,"预约号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(125,115,130,20,"-仓库");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(155,115,130,20,"-司机姓名");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(190,115,130,20,"-车牌号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(225,115,130,20,"-是否提供清单");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(260,115,130,20,"-货主");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(125,360,130,20,"-投单员");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(155,360,130,20,"-司机电话");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(190,361,130,20,"-驾驶证号");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(225,360,130,20,"-收货类型");
|
|
|
+ // this.clodop.ADD_PRINT_TEXT(260,360,130,20,"-预约号");
|
|
|
+ // this.clodop.SET_PRINTER_INDEXA(document.getElementById("print-size-select").value);
|
|
|
+ // this.clodop.SET_PRINT(document.getElementById("print-size-select").value);
|
|
|
+ this.clodop.PREVIEW();
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
</script>
|