|
@@ -85,6 +85,7 @@
|
|
|
import {autoConnect, disAutoConnect, hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
|
|
import {autoConnect, disAutoConnect, hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
|
|
|
import yundaTemplate from './yunda-template-data'
|
|
import yundaTemplate from './yunda-template-data'
|
|
|
import ztoTemplate from './zto-template-data'
|
|
import ztoTemplate from './zto-template-data'
|
|
|
|
|
+import ztoWoNiuTemplate from './zto-woniu-template-data'
|
|
|
import printData from './yunda-print-data'
|
|
import printData from './yunda-print-data'
|
|
|
autoConnect();
|
|
autoConnect();
|
|
|
hiprint.init();
|
|
hiprint.init();
|
|
@@ -92,6 +93,7 @@ export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
ztoHiprintTemplate : null,
|
|
ztoHiprintTemplate : null,
|
|
|
|
|
+ ztoWoNiuHiprintTemplate : null,
|
|
|
yundaHiprintTemplate : null,
|
|
yundaHiprintTemplate : null,
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
page: {
|
|
page: {
|
|
@@ -125,6 +127,7 @@ export default {
|
|
|
mounted () {
|
|
mounted () {
|
|
|
this.buildYundaDesigner();
|
|
this.buildYundaDesigner();
|
|
|
this.buildZtoDesigner();
|
|
this.buildZtoDesigner();
|
|
|
|
|
+ this.buildZtoWoNiuDesigner();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getLogisticsList(){
|
|
getLogisticsList(){
|
|
@@ -160,6 +163,16 @@ export default {
|
|
|
// 构建 并填充到 容器中
|
|
// 构建 并填充到 容器中
|
|
|
this.ztoHiprintTemplate.design("#zto-hiprint-printTemplate");
|
|
this.ztoHiprintTemplate.design("#zto-hiprint-printTemplate");
|
|
|
},
|
|
},
|
|
|
|
|
+ buildZtoWoNiuDesigner(){
|
|
|
|
|
+ $("#zto-hiprint-printTemplate").empty(); // 先清空, 避免重复构建
|
|
|
|
|
+ this.ztoWoNiuHiprintTemplate = new hiprint.PrintTemplate({
|
|
|
|
|
+ // 如果使用 vue ref 创建的模板json, 需要使用 .value 获取 (确保内部能够使用 object.key 拿到对应数据就行)
|
|
|
|
|
+ template: ztoWoNiuTemplate, // 模板json(object)
|
|
|
|
|
+ settingContainer: "#PrintElementOptionSetting", // 元素参数容器
|
|
|
|
|
+ });
|
|
|
|
|
+ // 构建 并填充到 容器中
|
|
|
|
|
+ this.ztoWoNiuHiprintTemplate.design("#zto-woniu-hiprint-printTemplate");
|
|
|
|
|
+ },
|
|
|
getDeviceList(){
|
|
getDeviceList(){
|
|
|
this.$http({
|
|
this.$http({
|
|
|
url: this.$http.adornUrl('/print/printDevice/getDeviceList'),
|
|
url: this.$http.adornUrl('/print/printDevice/getDeviceList'),
|
|
@@ -245,7 +258,11 @@ export default {
|
|
|
|
|
|
|
|
printWallbill(logistics){
|
|
printWallbill(logistics){
|
|
|
if(logistics.logistics === 'ZTO'){
|
|
if(logistics.logistics === 'ZTO'){
|
|
|
- this.ztoHiprintTemplate.print2(printData.value(logistics));
|
|
|
|
|
|
|
+ if(logistics.printChannel === 'WoNiu'){
|
|
|
|
|
+ this.ztoWoNiuHiprintTemplate.print2(printData.value(logistics));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.ztoHiprintTemplate.print2(printData.value(logistics));
|
|
|
|
|
+ }
|
|
|
}else if(logistics.logistics === 'YUNDA'){
|
|
}else if(logistics.logistics === 'YUNDA'){
|
|
|
this.yundaHiprintTemplate.print2(printData.value(logistics));
|
|
this.yundaHiprintTemplate.print2(printData.value(logistics));
|
|
|
}
|
|
}
|