mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-07 07:15:33 +08:00
9 lines
71 KiB
JavaScript
9 lines
71 KiB
JavaScript
/**
|
|
* Shopex OMS
|
|
*
|
|
* Copyright (c) 2025 Shopex (http://www.shopex.cn)
|
|
* Licensed under Apache-2.0 with additional terms (See LICENSE file)
|
|
*/
|
|
|
|
var tmsPrint=function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function e(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){i(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function i(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function a(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=o(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,P=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return P=t.done,t},e:function(t){s=!0,a=t},f:function(){try{P||null==i.return||i.return()}finally{if(s)throw a}}}}var P,s={};function d(t){return'"itemtype":"'+t.toString()+'"'}function c(t,e,i){if(i&&i.length>0){if(i.test(e))return',"'+t.toString()+'":"'+e.toString()+'"';throw new Error('Parameter "'+t+'" is invalid')}return',"'+t.toString()+'":"'+e.toString()+'"'}function u(t,e,i){if(null==e&&(e=""),i&&i.length>0){if(i.test(e))return',"'+t.toString()+'":"'+encodeURI(e.toString())+'"';throw new Error('Parameter "'+t+'" is invalid')}return',"'+t.toString()+'":"'+encodeURI(e.toString())+'"'}function l(t,e,i){if(i&&i.length>0){if(i.test(e))return',"'+t.toString()+'":'+e.toString();throw new Error('Parameter "'+t+'"is invalid')}return',"'+t.toString()+'":'+e.toString()}s.Printer=function(){var t=arguments.length;this.ip=t>0?arguments[0]:"127.0.0.1",this.model=t>1?arguments[1]:"iD4P",this.timeout=t>2?arguments[2]:3e3,this.port=t>3?arguments[3]:"9099",this.interfacePort=t>4?arguments[4]:"USB",this.tag=t>5?arguments[5]:"",this.tag_port=t>6?arguments[6]:"",this.E_TIMEOUT=-5,this.E_UNKNOWN=-1,this.onError=this.onComplete=null,this.sentSuccess=!1,this.inTransaction=!1,this.status="",this.Printdata=""},s.Printer.prototype.initWs=function(t){console.log("initWs",t),P=t},s.Printer.prototype.setPrintData=function(t){this.Printdata=t},s.Printer.prototype.setIp=function(t){this.ip=t},s.Printer.prototype.setPort=function(t){this.port=t},s.Printer.prototype.setModel=function(t){this.model=t},s.Printer.prototype.ZPL_GetPrinterStatus=function(){return m(this.ip,this.port,'{"model":"'+this.model+'","printerID":"ZPL","interface":"'+this.interfacePort+'","printers":[{"Items":[{"itemtype":"ZPL_GetPrinterStatus"}]}]}'),!1},s.Printer.prototype.print=function(t){!function(t,e,i,r,o,n,a){var P='{"model":"'+i+'","printerID":"ZPL","interface":"'+o;""!=n&&(P+=","+n),""!=a&&(P+=","+a),P+='",',P+='"printers":[{"Items":['+r+"]}]}",m(t,e,decodeURIComponent(P))}(this.ip,this.port,this.model,t,this.interfacePort,this.tag,this.tag_port)},s.Builder=function(){this.PrintData=""},s.Builder.prototype.getPrintData=function(){return this.PrintData},s.Builder.prototype.ZPL_StartFormat=function(){var t='{"itemtype":"ZPL_StartFormat"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_EndFormat=function(){var t='{"itemtype":"ZPL_EndFormat"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_ScalableFontText=function(t,e,i,r,o,n,a){var P="{";return P+=d("ZPL_ScalableFontText"),P+=l("xPos",t),P+=l("yPos",e),P+=c("fontName",i),P+=l("orientation",r),P+=l("fontWidth",o),P+=l("fontHeight",n),P+=u("text",a),P+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=P,P},s.Builder.prototype.ZPL_SetUserFontName=function(t){var e="{";return e+=d("ZPL_SetUserFontName"),e+=u("text",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_Text=function(t,e,i,r,o,n,a){var P="{";return P+=d("ZPL_Text"),P+=l("xPos",t),P+=l("yPos",e),P+=l("fontNum",i),P+=l("orientation",r),P+=l("fontWidth",o),P+=l("fontHeight",n),P+=u("text",a),P+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=P,P},s.Builder.prototype.ZPL_Text_Block=function(t,e,i,r,o,n,a,P,s){var c="{";return c+=d("ZPL_Text_Block"),c+=l("xPos",t),c+=l("yPos",e),c+=l("fontNum",i),c+=l("orientation",r),c+=l("fontWidth",o),c+=l("fontHeight",n),c+=l("textblockWidth",a),c+=l("textblockHeight",P),c+=u("text",s),c+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=c,c},s.Builder.prototype.ZPL_FieldHexadecimalIndicator=function(){var t='{"itemtype":"ZPL_FieldHexadecimalIndicator"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_AztecBarcode=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_AztecBarcode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("dpi",r),h+=c("extChannel",o),h+=l("eccLevel",n),h+=c("menuSymbol",a),h+=l("symbols",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_BarCode11=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_BarCode11"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=c("digit",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_BarCode25=function(t,e,i,r,o,n,a,P,s,h){var m="{";return m+=d("ZPL_BarCode25"),m+=c("type",t),m+=l("xPos",e),m+=l("yPos",i),m+=l("orientation",r),m+=l("moduleWidth",o),m+=l("codeHeight",n),m+=c("line",a),m+=c("lineAboveCode",P),m+=c("digit",s),m+=u("text",h),m+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=m,m},s.Builder.prototype.ZPL_BarCode39=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_BarCode39"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=c("digit",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_BarCode49=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_BarCode49"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("mode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_PlanetCode=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_PlanetCode"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("lineAboveCode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_Pdf417=function(t,e,i,r,o,n,a,P,s,h){var m="{";return m+=d("ZPL_Pdf417"),m+=l("xPos",t),m+=l("yPos",e),m+=l("orientation",i),m+=l("moduleWidth",r),m+=l("codeHeight",o),m+=l("securityLevel",n),m+=l("columns",a),m+=l("rows",P),m+=c("truncate",s),m+=u("text",h),m+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=m,m},s.Builder.prototype.ZPL_CodeEan8=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_CodeEan8"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("lineAboveCode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_UpceCode=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_UpceCode"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("lineAboveCode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_BarCode93=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_BarCode93"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=c("digit",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_BarCode128=function(t,e,i,r,o,n,a,P,s,h){var m="{";return m+=d("ZPL_BarCode128"),m+=l("xPos",t),m+=l("yPos",e),m+=l("orientation",i),m+=l("moduleWidth",r),m+=l("codeHeight",o),m+=c("line",n),m+=c("lineAboveCode",a),m+=c("checkDigit",P),m+=c("mode",s),m+=u("text",h),m+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=m,m},s.Builder.prototype.ZPL_CodeEan13=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_CodeEan13"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("lineAboveCode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_MicroPdf417=function(t,e,i,r,o,n,a){var P="{";return P+=d("ZPL_MicroPdf417"),P+=l("xPos",t),P+=l("yPos",e),P+=l("orientation",i),P+=l("moduleWidth",r),P+=l("codeHeight",o),P+=l("mode",n),P+=u("text",a),P+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=P,P},s.Builder.prototype.ZPL_AnsiCodebar=function(t,e,i,r,o,n,a,P,s,h){var m="{";return m+=d("ZPL_AnsiCodebar"),m+=l("xPos",t),m+=l("yPos",e),m+=l("orientation",i),m+=l("moduleWidth",r),m+=l("codeHeight",o),m+=c("line",n),m+=c("lineAboveCode",a),m+=c("startChar",P),m+=c("stopChar",s),m+=u("text",h),m+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=m,m},s.Builder.prototype.ZPL_LogMarsBarcode=function(t,e,i,r,o,n,a){var P="{";return P+=d("ZPL_LogMarsBarcode"),P+=l("xPos",t),P+=l("yPos",e),P+=l("orientation",i),P+=l("moduleWidth",r),P+=l("codeHeight",o),P+=c("lineAboveCode",n),P+=u("text",a),P+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=P,P},s.Builder.prototype.ZPL_MsiBarcode=function(t,e,i,r,o,n,a,P,s,h){var m="{";return m+=d("ZPL_MsiBarcode"),m+=l("xPos",t),m+=l("yPos",e),m+=l("orientation",i),m+=l("moduleWidth",r),m+=l("codeHeight",o),m+=c("line",n),m+=c("lineAbovecode",a),m+=c("checkDigit",P),m+=c("insertCheck",s),m+=u("text",h),m+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=m,m},s.Builder.prototype.ZPL_PlesseyBarcode=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_PlesseyBarcode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=c("checkDigit",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_QRCode=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_QRCode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("model",r),h+=l("dpi",o),h+=c("eccLevel",n),h+=c("input",a),h+=c("charMode",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_UpcExtensions=function(t,e,i,r,o,n,a,P){var s="{";return s+=d("ZPL_UpcExtensions"),s+=l("xPos",t),s+=l("yPos",e),s+=l("orientation",i),s+=l("moduleWidth",r),s+=l("codeHeight",o),s+=c("line",n),s+=c("lineAboveCode",a),s+=u("text",P),s+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=s,s},s.Builder.prototype.ZPL_UpcaBarcode=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_UpcaBarcode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=c("digit",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_DataMatrixBarcode=function(t,e,i,r,o,n,a,P,s,c){var h="{";return h+=d("ZPL_DataMatrixBarcode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("codeHeight",r),h+=l("level",o),h+=l("columns",n),h+=l("rows",a),h+=l("formatId",P),h+=l("aspectRatio",s),h+=u("text",c),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_SetChangeFontEncoding=function(t){var e="{";return e+=d("ZPL_SetChangeFontEncoding"),e+=l("encodeType",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetVietMode=function(t){var e="{";return e+=d("ZPL_SetVietMode"),e+=l("vietmode",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetVietFontEncoding=function(){var t='{"itemtype":"ZPL_SetVietFontEncoding"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_SetChangeCaret=function(t){var e="{";return e+=d("ZPL_SetChangeCaret"),e+=c("charactor",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_PostalBarcode=function(t,e,i,r,o,n,a,P,s){var h="{";return h+=d("ZPL_PostalBarcode"),h+=l("xPos",t),h+=l("yPos",e),h+=l("orientation",i),h+=l("moduleWidth",r),h+=l("codeHeight",o),h+=c("line",n),h+=c("lineAboveCode",a),h+=l("postalType",P),h+=u("text",s),h+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=h,h},s.Builder.prototype.ZPL_SetChangeDelimiter=function(t){var e="{";return e+=d("ZPL_SetChangeDelimiter"),e+=c("charactor",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetChangeDefaultFont=function(t,e,i){var r="{";return r+=d("ZPL_SetChangeDefaultFont"),r+=c("fontName",t),r+=l("width",e),r+=l("height",i),r+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=r,r},s.Builder.prototype.ZPL_SetChangeTilde=function(t){var e="{";return e+=d("ZPL_SetChangeTilde"),e+=c("charactor",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_GraphicBox=function(t,e,i,r,o,n){var a="{";return a+=d("ZPL_GraphicBox"),a+=l("xPos",t),a+=l("yPos",e),a+=l("width",i),a+=l("height",r),a+=l("thickness",o),a+=l("rounding",n),a+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=a,a},s.Builder.prototype.ZPL_GraphicCircle=function(t,e,i,r){var o="{";return o+=d("ZPL_GraphicCircle"),o+=l("xPos",t),o+=l("yPos",e),o+=l("diameter",i),o+=l("thickness",r),o+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=o,o},s.Builder.prototype.ZPL_GraphicDiagonalLine=function(t,e,i,r,o,n){var a="{";return a+=d("ZPL_GraphicDiagonalLine"),a+=l("xPos",t),a+=l("yPos",e),a+=l("orientation",i),a+=l("width",r),a+=l("height",o),a+=l("thickness",n),a+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=a,a},s.Builder.prototype.ZPL_GraphicEllipse=function(t,e,i,r,o){var n="{";return n+=d("ZPL_GraphicEllipse"),n+=l("xPos",t),n+=l("yPos",e),n+=l("width",i),n+=l("height",r),n+=l("thickness",o),n+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=n,n},s.Builder.prototype.ZPL_PrintImage=function(t,e,i){var r="{";return r+=d("ZPL_PrintImage"),r+=l("xPos",t),r+=l("yPos",e),r+=c("imgName",i),r+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=r,r},s.Builder.prototype.ZPL_GraphicSymbol=function(t,e,i,r,o,n){var a="{";return a+=d("ZPL_GraphicSymbol"),a+=l("xPos",t),a+=l("yPos",e),a+=l("orientation",i),a+=l("width",r),a+=l("height",o),a+=c("symbol",n),a+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=a,a},s.Builder.prototype.ZPL_HostStatusReturn=function(t){var e="{";return e+=d("ZPL_HostStatusReturn"),e+=c("statuString",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetMediaSensorCalibration=function(){var t='{"itemtype":"ZPL_SetMediaSensorCalibration"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_SetDiagnosticsMode=function(t){var e="{";return e+=d("ZPL_SetDiagnosticsMode"),e+=l("isEnable",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPowerOnReset=function(){var t='{"itemtype":"ZPL_SetPowerOnReset"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_SetLabelHome=function(t,e){var i="{";return i+=d("ZPL_SetLabelHome"),i+=l("xPos",t),i+=l("yPos",e),i+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=i,i},s.Builder.prototype.ZPL_SetLabelLength=function(t){var e="{";return e+=d("ZPL_SetLabelLength"),e+=l("length",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetLabelReversePrint=function(t){var e="{";return e+=d("ZPL_SetLabelReversePrint"),e+=c("enable",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetLabelShift=function(t){var e="{";return e+=d("ZPL_SetLabelShift"),e+=l("shift",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetLabelTop=function(t){var e="{";return e+=d("ZPL_SetLabelTop"),e+=l("top",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintMode=function(t,e){var i="{";return i+=d("ZPL_SetPrintMode"),i+=c("mode",t),i+=c("prePeelSelect",e),i+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=i,i},s.Builder.prototype.ZPL_SetMediaTracking=function(t,e){var i="{";return i+=d("ZPL_SetMediaTracking"),i+=c("mediaType",t),i+=l("offset",e),i+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=i,i},s.Builder.prototype.ZPL_SetMediaType=function(t){var e="{";return e+=d("ZPL_SetMediaType"),e+=c("type",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SlewToHomePosition=function(t){var e="{";return e+=d("ZPL_SlewToHomePosition"),e+=l("type",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintingMirrorImage=function(t){var e="{";return e+=d("ZPL_SetPrintingMirrorImage"),e+=c("enable",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintOrientation=function(t){var e="{";return e+=d("ZPL_SetPrintOrientation"),e+=l("orientation",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintQuantity=function(t,e,i,r){var o="{";return o+=d("ZPL_SetPrintQuantity"),o+=l("totalQuantity",t),o+=l("pauseAndCutValue",e),o+=l("replicatesOfEachSerialNumber",i),o+=c("overridePauseCount",r),o+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=o,o},s.Builder.prototype.ZPL_SetPrintRate=function(t,e,i){var r="{";return r+=d("ZPL_SetPrintRate"),r+=l("printSpeed",t),r+=l("slewSpeed",e),r+=l("backfeedSpeed",i),r+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=r,r},s.Builder.prototype.ZPL_SetPrintWidth=function(t){var e="{";return e+=d("ZPL_SetPrintWidth"),e+=l("width",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetSerialCommunications=function(t,e,i,r,o){var n="{";return n+=d("ZPL_SetSerialCommunications"),n+=l("baudRate",t),n+=l("wordLength",e),n+=c("parity",i),n+=l("stopBits",r),n+=c("protocolMode",o),n+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=n,n},s.Builder.prototype.ZPL_SetPrintDarkness=function(t){var e="{";return e+=d("ZPL_SetPrintDarkness"),e+=l("darkness",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetSerializationField=function(t,e,i,r,o){var n="{";return n+=d("ZPL_SetSerializationField"),n+=l("xPos",t),n+=l("yPos",e),n+=c("mask",i),n+=c("increment",r),n+=u("text",o),n+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=n,n},s.Builder.prototype.ZPL_SetTearOffAdjustPosition=function(t){var e="{";return e+=d("ZPL_SetTearOffAdjustPosition"),e+=l("position",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_PrintConfigurationLabel=function(){var t='{"itemtype":"ZPL_PrintConfigurationLabel"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterIpAddress=function(){var t='{"itemtype":"ZPL_GetPrinterIpAddress"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterStatus=function(){var t='{"itemtype":"ZPL_GetPrinterStatus"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterOdometer=function(){var t='{"itemtype":"ZPL_GetPrinterOdometer"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetLabelLength=function(){var t='{"itemtype":"ZPL_GetLabelLength"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetLabelWidth=function(){var t='{"itemtype":"ZPL_GetLabelWidth"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterSeriesNumber=function(){var t='{"itemtype":"ZPL_GetPrinterSeriesNumber"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterMacAddress=function(){var t='{"itemtype":"ZPL_GetPrinterMacAddress"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterName=function(){var t='{"itemtype":"ZPL_GetPrinterName"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_GetPrinterFirmwareVersion=function(t){var e='{"itemtype":"ZPL_GetPrinterFirmwareVersion"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_GetPrinterDpi=function(t){var e='{"itemtype":"ZPL_GetPrinterDpi"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_LearnLabel=function(){var t='{"itemtype":"ZPL_LearnLabel"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_SetReprintAfterError=function(t){var e="{";return e+=d("ZPL_SetReprintAfterError"),e+=c("pEnable",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintIpAddress=function(t){var e="{";return e+=d("ZPL_SetPrintIpAddress"),e+=c("ipaddress",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintSubnetMask=function(t){var e="{";return e+=d("ZPL_SetPrintSubnetMask"),e+=c("mask",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetPrintDefaultGateway=function(t){var e="{";return e+=d("ZPL_SetPrintDefaultGateway"),e+=c("gateway",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_SetNetworkSetting=function(t){var e="{";return e+=d("ZPL_SetNetworkSetting"),e+=c("network",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_PrintDirectoryLabel=function(t,e,i){var r="{";return r+=d("ZPL_PrintDirectoryLabel"),r+=c("device",t),r+=c("name",e),r+=c("type",i),r+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=r,r},s.Builder.prototype.ZPL_SetWriteQuery=function(t){var e="{";return e+=d("ZPL_SetWriteQuery"),e+=c("type",t),e+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=e,e},s.Builder.prototype.ZPL_RfidWrite=function(t,e,i,r,o){var n="{";return n+=d("ZPL_RfidWrite"),n+=c("format",t),n+=l("begin",e),n+=l("size",i),n+=l("memoryBlock",r),n+=c("text",o),n+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=n,n},s.Builder.prototype.ZPL_RfidRead=function(t,e,i,r,o,n){var a="{";return a+=d("ZPL_RfidRead"),a+=c("format",t),a+=l("begin",e),a+=l("size",i),a+=l("memoryBlock",r),a+=c("headText",o),a+=c("tailText",n),a+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=a,a},s.Builder.prototype.ZPL_RfidCalibration=function(){var t='{"itemtype":"ZPL_RfidCalibration"}';return""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_ReadData=function(){var t="{";return t+=d("ReadData"),t+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.ZPL_SetInverse=function(){var t="{";return t+=d("ZPL_SetInverse"),t+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=t,t},s.Builder.prototype.DirectIO=function(t,e){var i="{";return i+=d("DirectIO"),i+=c("writedata",t),i+=l("readNum",e),i+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=i,i},s.Builder.prototype.ZPL_Text_BlockEx=function(t,e,i,r,o,n,a,P,s,c,h,m){var L="{";return L+=d("ZPL_Text_BlockEx"),L+=l("xPos",t),L+=l("yPos",e),L+=l("fontNum",i),L+=l("orientation",r),L+=l("fontWidth",o),L+=l("fontHeight",n),L+=l("textblockWidth",a),L+=l("maxline",P),L+=l("align",s),L+=l("hline_spacing",c),L+=l("vline_spacing",h),L+=u("text",m),L+="}",""!=this.PrintData&&(this.PrintData+=", "),this.PrintData+=L,L};var h=0;function m(t,e,i){h+=1,console.log("pushDataCount",h),P.send(i)}var L={JD:"京东保价",SF:"顺丰保价",DB:"德邦保价",EMS:"EMS保价",ZT:"中通保价"},p={JDKY:"特快送",JDLY:"特惠送",JDTKZH:"特快重货",ZTBZ:"标准",ZTBK:"得物标快"},_=function(t){return Math.round(t)};function g(t,e,i,r,o){t.ZPL_GraphicBox(e,i,r,62,31,2),t.ZPL_SetInverse();var n=e+10,a=i+14;t.ZPL_Text(n,a,16,0,30,30,o)}function Z(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:120,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;t.ZPL_BarCode128(e,i,0,n,r,"N","N","N","A",o);var P=i+r+18,s=B(o,a);t.ZPL_Text(e,P,16,0,30,30,s)}function v(t,e,i,r,o){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=n.destAddress,P=void 0===a?{}:a,s=n.originAddress,d=void 0===s?{}:s;1===n.printMode?(t.ZPL_PrintImage(e,i+_(12*r),n.faImg),t.ZPL_Text(e+_(32*r),i+_(12*r),16,0,50,50,n.originName+" "+n.originMobile),t.ZPL_Text_BlockEx(e,i+_(44*r),16,0,36,36,o,3,0,14,0,x("".concat(d.province||"").concat(d.city||"").concat(d.region||"").concat(d.detailedAddress||"")))):(t.ZPL_PrintImage(e,i+_(12*r),n.shouImg),t.ZPL_Text(e+_(32*r),i+_(12*r),16,0,50,50,n.destName+" "+n.destMobile),t.ZPL_Text_BlockEx(e,i+_(44*r),16,0,36,36,o,3,0,14,0,x("".concat(P.province||"").concat(P.city||"").concat(P.region||"").concat(P.detailedAddress||"")))),t.ZPL_PrintImage(e,i+_(98*r),n.courierCompanyImg),t.ZPL_Text(e,i+_(147*r),16,0,30,30,"订单号:"),t.ZPL_Text(e,i+_(163*r),16,0,30,30,(n.maskOrderNo||"").slice(-20)),t.ZPL_Text(e,i+_(179*r),16,0,30,30,"托寄物: "+n.consignmentName||""),"DB"!==n.logisticsCode&&1!==n.printMode&&t.ZPL_Text(e,i+_(195*r),16,0,30,30,n.repositoryCode||""),t.ZPL_GraphicBox(e+_(128*r),i+_(98*r),2,_(113*r),2,0);var c="JD"!==n.logisticsCode&&2===n.sheetType?n.motherWaybillNo:n.waybillNo;"JD"===n.logisticsCode?c.length<16?Z(t,e+_(140*r),i+_(98*r),_(39*r),c,4,2):c.length<=20?Z(t,e+_(140*r),i+_(98*r),_(39*r),c,3,2):Z(t,e+_(140*r),i+_(98*r),_(39*r),c,2,1):Z(t,e+_(140*r),i+_(98*r),_(39*r),c,4,2),1===n.dangerous&&t.ZPL_PrintImage(_(223*r),i+_(196*r),n.dangerImg),"number"==typeof n.insureValue&&n.insureValue>0&&(t.ZPL_Text(_(160*r),i+_(196*r),16,0,30,30,L[n.logisticsCode]),t.ZPL_PrintImage(_(202*r),i+_(194*r),n.baoImg),"DB"===n.logisticsCode&&t.ZPL_Text(e,i+_(195*r),16,0,30,30,"保价金额:".concat(n.insureValue)));var u=_(249*r),l=i+_(194*r);if(["JD","ZT"].includes(n.logisticsCode)){var h=p[n.logisticsProductCode];if(h){var m="ZT"===n.logisticsCode?_(230*r):u,v=48;switch(h.length){case 2:v=28;break;case 3:v=38}g(t,m,l,_(v*r),h)}}if(["DB","EMS"].includes(n.logisticsCode)){var f=n.logisticsProductName||"";if(f){var y=_(12*f.length*r);g(t,u,l,y,f)}}}var f={JF:"寄付现结",DF:"到付现结",JFYJ:"寄付月结",DFYJ:"到付月结"};function x(t){return t.replace(/[\\,\/,\',\",\<,\>]/g," ")}function y(t){return new t.Printer("127.0.0.1","L42 PRO",3e3,"9099","USB","","")}function b(t,e,i,r,o){var n=o.destAddress,a=n.province,P=void 0===a?"":a,s=n.city,d=void 0===s?"":s,c=n.region,u=void 0===c?"":c,l=n.detailedAddress,h=void 0===l?"":l,m={name:o.destName,mobile:o.destMobile,address:P+d+u+h};t.ZPL_PrintImage(e,i,r);var L=m.name+" "+m.mobile,p=e+110,_=i+10;t.ZPL_Text(p,_,16,0,46,46,L);var g=i+76,Z=m.address.replace(/[\/,\',\",\“,\<,\>]/g," ");t.ZPL_Text_BlockEx(p,g,16,0,34,34,580,4,0,14,0,Z)}function D(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:140;t.ZPL_GraphicBox(e,i,720,2,2,0);var o=i+r;t.ZPL_GraphicBox(e,o,720,2,2,0)}function T(t,e,i,r){var o=r.maskOrderNo,n=void 0===o?"":o,a=r.consignmentName,P=void 0===a?"":a,s=r.brandFlag,d=!0;if(void 0!==s&&s&&!n&&(d=!1),d){t.ZPL_Text(e,i,16,0,30,30,"订单号:");var c=i+40;t.ZPL_Text_BlockEx(e,c,16,0,30,30,330,4,0,-10,0,n)}var u=i+100,l="托寄物: "+P;t.ZPL_Text(e,u,16,0,30,30,l)}function I(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:120,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;t.ZPL_BarCode128(e,i,0,n,r,"N","N","N","A",o);var P=i+r+18,s=B(o,a);t.ZPL_Text(e,P,16,0,30,30,s)}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i="";if(2===e){var r,o=a(t);try{for(o.s();!(r=o.n()).done;){var n=r.value;i=i+n+" "}}catch(t){o.e(t)}finally{o.f()}}else if(3===e){var P,s=a(t);try{for(s.s();!(P=s.n()).done;){var d=P.value;i=i+d+" "}}catch(t){s.e(t)}finally{s.f()}}else if(4===e){var c,u=a(t);try{for(u.s();!(c=u.n()).done;){var l=c.value;i=i+l+" "}}catch(t){u.e(t)}finally{u.f()}}else{var h,m=a(t);try{for(m.s();!(h=m.n()).done;){var L=h.value;i=i+L+" "}}catch(t){m.e(t)}finally{m.f()}}return i}function S(t,e,i,r,o){t.ZPL_GraphicBox(e,i,730,60,30,0),t.ZPL_SetInverse();var n=r.printingTime?r.printingTime:"",a=e+20,P=i+16;t.ZPL_Text(a,P,16,0,30,30,n),t.ZPL_SetInverse(),t.ZPL_Text_BlockEx(465,P,16,0,30,30,300,1,2,5,5,o)}function C(t,e,i,r,o){t.ZPL_GraphicBox(e,i,730,60,30,0),t.ZPL_SetInverse();var n=r.printingTime?r.printingTime:"",a=e+20,P=i+16;t.ZPL_Text(a,P,16,0,30,30,n),t.ZPL_SetInverse(),t.ZPL_Text(674,P,16,0,30,30,o)}function N(t,e,i,r,o){t.ZPL_GraphicBox(e,i,r,56,28,0),t.ZPL_SetInverse();var n=e+10,a=i+16;t.ZPL_Text(n,a,16,0,28,28,o)}function E(t,e,i,r){if(r[0]){var o=r[0];t.ZPL_PrintImage(e,i,o)}if(r[1]){var n=r[1];t.ZPL_PrintImage(e+216,i,n)}}function A(t,e,i,r){if(r[0]){var o=r[0];t.ZPL_PrintImage(e,i,o)}if(r[1]){var n=r[1];t.ZPL_PrintImage(e+140,i,n)}}function G(t,e,i,r){r&&r.length&&r.forEach((function(o,n){var a=r[n];t.ZPL_PrintImage(e-90*n,i,a)}))}function w(t){return t.map((function(t){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(i,r){var o=document.createElement("CANVAS"),n=o.getContext("2d"),a=new Image;a.crossOrigin="Anonymous",a.onload=function(){var t=a.height,r=a.width;o.height=t*e,o.width=r*e,n.drawImage(a,0,0,r,t,0,0,r*e,t*e);var P=o.toDataURL("image/jpeg");i(P),o=null},a.src=t}))}(t.url,t.ratio);return e}))}function R(t,e){var i={};return e.map((function(e,r){i[e.name]=t[r]})),i}function k(t){var e=!1;if(!(!t||!Array.isArray(t))&&t.length){var i=t[0];i.logisticsCode&&i.destMobile&&i.waybillNo&&(e=!0)}return e}function M(t){var e=!1;if(!(!t||!Array.isArray(t))&&t.length){var i=t[0];i.logistics_code&&i.dest_mobile&&i.waybill_no&&(e=!0)}return e}function F(t){var e=!1;!t||!Array.isArray(t)||!t.length||t[0].taskNo&&(e=!0);return e}function W(){var t=!1;return navigator.userAgent.toLowerCase().indexOf("win")>=0&&(t=!0),t}function z(t,e,i,r){var o=30,n="";r.itemNumber&&(n=r.itemNumber),r.articleNumber&&(n=r.articleNumber);var a=r.specification?x(r.specification):"";t.ZPL_GraphicBox(e,i,720,2,2,0);t.ZPL_Text(e,i+20,16,0,o,o,"货号: "),t.ZPL_Text_BlockEx(150,i+20,16,0,o,o,650,2,0,14,0,n);t.ZPL_Text(e,i+120,16,0,o,o,"规格: "),t.ZPL_Text_BlockEx(150,i+120,16,0,o,o,650,2,0,14,0,a),t.ZPL_GraphicBox(e,i+216,720,2,2,0)}function O(t,e,i,r){t.ZPL_GraphicBox(e,i,720,2,2,0);var o="该单为合并发货单,共".concat(r,"件");t.ZPL_Text(e,i+90,16,0,30,30,o),t.ZPL_GraphicBox(e,i+216,720,2,2,0)}function j(t){return t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}))}function H(t){var e={};for(var i in t)e[j(i)]=t[i];var r=e.siteInfo||{},o={};for(var n in r)o[j(n)]=r[n];return e.siteInfo=o,e}var U=1180/377.95;function V(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.logoImg,n=e.shouImg,a=e.baojiaImg,P=e.courierCompanyImg,s=i.waybillNo,d=void 0===s?"":s,c=i.logisticsProductCode,u=i.logisticsProductName,l=i.insureValue,h=i.siteInfo,m=void 0===h?{}:h,L=i.airEmbargo,p=i.repositoryCode,_=i.printingTime,g=void 0===_?"":_,Z=i.brandFlag,v=void 0!==Z&&Z,f=i.brandOrderNumber,y=void 0===f?"":f,B=i.itemNumber,S=void 0===B?"":B,C=i.articleNumber,N=void 0===C?"":C,E=i.specification,A=void 0===E?"":E,G=60,w=60;"new"!==r&&t.ZPL_PrintImage(G,w,o),D(t,G,w+=260,110),t.ZPL_Text(G,w+16,16,0,60,60,m.destRouteLabel||""),w+=110,t.ZPL_GraphicBox(G,w+90,720,2,2,0),t.ZPL_Text(G,w+16,16,0,48,48,m.siteName||""),w+=116,t.ZPL_GraphicBox(420,w,3,250,2,0),w+=40,t.ZPL_PrintImage(G,w,P),T(t,G+410,w+=74,i),w+=30,"ZTBZ"===c?J(t,G,w,u||""):"ZTBK"===c&&J(t,G,w,"得物标快"),l&&t.ZPL_PrintImage(G+250,w,a),w+=140;var R=26;t.ZPL_GraphicBox(G,w,720,2,2,0),w+=20,t.ZPL_Text(G,w,16,0,R,R,"货号: "),t.ZPL_Text_BlockEx(140,w,16,0,R,R,650,2,0,14,0,N||S||""),w+=90,t.ZPL_Text(G,w,16,0,R,R,"规格: "),t.ZPL_Text_BlockEx(140,w,16,0,R,R,650,2,0,14,0,A?x(A):""),w+=50,v&&(w+=40,t.ZPL_Text(G,w,16,0,R,R,"该单为合并发货单,共 ".concat(y||""," 件"))),w+=50,t.ZPL_GraphicBox(G,w,720,2,2,0),w+=40,d.length<=14?I(t,G,w,110,d,6,2):I(t,G,w,110,d,4,2),b(t,G,w=1410,n,i),w+=240,t.ZPL_GraphicBox(G,w,730,60,30,0);var k=24;p&&(t.ZPL_SetInverse(),t.ZPL_Text(380,w+16,16,0,k,k,p||"")),1===L&&(t.ZPL_SetInverse(),t.ZPL_Text(580,w+16,16,0,k,k,"航空禁运")),t.ZPL_SetInverse(),t.ZPL_Text(G+16,w+16,16,0,k,k,g||""),t.ZPL_SetInverse(),t.ZPL_Text(700,w+16,16,0,k,k,"已验视"),w+=110,d.length<=14?I(t,G,w,150,d,6,3):I(t,G,w,150,d,4,2)}function J(t,e,i,r){var o=_(55);t.ZPL_GraphicBox(e,i,190,110,o,1),t.ZPL_SetInverse();var n=e+40,a=i+20,P=56;r.length>2&&(n-=24,a+=10,P-=16),t.ZPL_Text(n,a,16,0,P,P,r)}function Q(t,e,i){var r=e.logoImg,o=i.driverName,n=void 0===o?"":o,a=i.driverPhone,P=void 0===a?"":a,s=i.presetStartingTime,d=void 0===s?"":s,c=i.taskName,u=void 0===c?"":c,l=i.taskNo,h=void 0===l?"":l,m=i.vehicleDoorCount,L=void 0===m?"":m,p=i.vehicleNumber,g=void 0===p?"":p,Z=i.vehicleTypeName,v=void 0===Z?"":Z,f=i.processList,x=void 0===f?[]:f,y=11.8,b=_(6*y),D=_(1038.4);t.ZPL_PrintImage(b,_(94.4),r),t.ZPL_Text(_(177),_(94.4),16,0,90,90,"短驳任务单"),t.ZPL_GraphicBox(_(708),_(6*y),_(34*y),_(12*y),75,0),t.ZPL_SetInverse(),t.ZPL_Text(830,_(94.4),16,0,34,34,"规定发车"),t.ZPL_SetInverse(),t.ZPL_Text(_(731.6),_(12*y),16,0,40,40,d),t.ZPL_GraphicBox(b,_(212.4),D,2,2,0);var T="任务单号 "+h;t.ZPL_Text(b,_(236),16,0,34,34,T),t.ZPL_BarCode128(b,_(306.8),0,5,_(129.8),"N","N","N","A",h),t.ZPL_Text(b,_(39*y),16,0,34,34,u),t.ZPL_GraphicBox(b,_(554.6),D,2,2,0),t.ZPL_Text(b,_(578.2),16,0,34,34,"车牌号"),t.ZPL_Text(b,_(53*y),16,0,34,34,g),t.ZPL_Text(_(46*y),_(578.2),16,0,34,34,"车型"),t.ZPL_Text(_(46*y),_(53*y),16,0,34,34,v),t.ZPL_Text(_(885),_(578.2),16,0,34,34,"车门数"),t.ZPL_Text(_(885),_(53*y),16,0,34,34,L),t.ZPL_GraphicBox(b,_(696.2),D,2,2,0),t.ZPL_Text(b,_(61*y),16,0,34,34,"驾驶员"),t.ZPL_Text(b,_(767),16,0,34,34,n),t.ZPL_Text(_(46*y),_(61*y),16,0,34,34,"随车电话"),t.ZPL_Text(_(46*y),_(767),16,0,34,34,P),t.ZPL_GraphicBox(_(483.8),_(578.2),3,90,2,0),t.ZPL_GraphicBox(_(826),_(578.2),3,90,2,0),t.ZPL_GraphicBox(_(483.8),_(61*y),3,90,2,0),t.ZPL_GraphicBox(b,_(71*y),D,2,2,0),x.forEach((function(e,i){!function(t,e,i,r){var o=_(74*e)+_(6.5*e*r),n=_(74.5*e)+_(6.5*e*r)-6,a=i[0]?i[0]:"",P=i[1]?i[1]:"",s=i[2]?i[2]:"",d=i[3]?i[3]:"";t.ZPL_Text(_(6*e),o,16,0,34,34,a),t.ZPL_Text(_(26*e),o,16,0,34,34,P),t.ZPL_Text(_(46*e),o,16,0,34,34,s),t.ZPL_Text(_(66*e),o,16,0,34,34,d),t.ZPL_GraphicBox(_(22*e),n,3,_(3*e),2,0),t.ZPL_GraphicBox(_(42*e),n,3,_(3*e),2,0),t.ZPL_GraphicBox(_(62*e),n,3,_(3*e),2,0)}(t,y,e,i)}))}Date.prototype.Format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var i in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t},Date.prototype.Format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var i in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t};var Y,q={JD:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.baojiaImg,a=e.jinfeiImg,P=e.courierCompanyImg,s=i.waybillNo,d=void 0===s?"":s,c=i.sheetType,u=void 0===c?1:c,l=i.logisticsTransport,h=void 0===l?"":l,m=i.motherWaybillNo,L=void 0===m?"":m,p=i.siteInfo,_=void 0===p?{}:p,g=i.brandFlag,Z=void 0!==g&&g,v=i.brandOrderNumber,f=void 0===v?"":v,x=_.sourcetSortCenterName,y=void 0===x?"":x,B=_.sourceSortCenterName,C=void 0===B?"":B,N=_.originalCrossCode,A=void 0===N?"":N,G=_.originalTabletrolleyCode,w=void 0===G?"":G,R=_.originalTableTrolleyCode,k=void 0===R?"":R,M=_.targetSortCenterName,F=void 0===M?"":M,W=_.destinationCrossCode,j=void 0===W?"":W,H=_.destinationTabletrolleyCode,U=void 0===H?"":H,V=_.destinationTableTrolleyCode,J=void 0===V?"":V,Q=_.siteName,Y=void 0===Q?"":Q,q=_.road,$=void 0===q?"":q,K=60;t.ZPL_PrintImage(K,40,r);var X=y||C,tt=[A,w||k].filter(Boolean).join("-");t.ZPL_Text(K,260,16,0,30,30,X),t.ZPL_Text(K,300,20,0,46,46,tt),t.ZPL_GraphicBox(460,260,3,80,2,0);var et=F,it=[j,U||J].filter(Boolean).join("-");t.ZPL_Text(490,260,16,0,30,30,et),t.ZPL_Text(490,300,16,0,46,46,it),D(t,K,370,80),t.ZPL_Text(K,396,16,0,32,32,Y);var rt=i.destAddress,ot=rt.province,nt=void 0===ot?"":ot,at=rt.city,Pt=void 0===at?"":at,st=rt.region,dt=void 0===st?"":st;b(t,50,480,o,{destName:i.destName,destMobile:i.destMobile,destAddress:{province:nt,city:Pt,region:dt}}),t.ZPL_GraphicBox(K,620,720,2,2,0),t.ZPL_GraphicBox(K,640,130,56,28,0),t.ZPL_SetInverse(),t.ZPL_Text(70,650,16,0,28,28,"得物专配"),t.ZPL_Text(K,696,16,0,90,90,$),t.ZPL_PrintImage(K,810,P),t.ZPL_GraphicBox(413,640,2,240,2,0),t.ZPL_Text(480,640,16,0,30,30,i.logisticsProductCode),"KY"===h&&t.ZPL_Text(610,648,16,0,46,46,"航"),T(t,480,740,i),Z?O(t,K,910,f):z(t,K,910,i);var ct=d;1===u&&(ct=i.subWaybillNoList&&i.subWaybillNoList[0]?i.subWaybillNoList[0]:""),ct.length<16?I(t,K,1150,110,ct,4,3):I(t,K,1150,110,ct,3,2),b(t,K,1400,o,i);var ut=[],lt="";i.insureValue&&(ut.push(n),lt="京东保价"),1===i.airEmbargo&&(ut.push(a),lt=lt?lt+" 航空禁运":"航空禁运"),S(t,K,1630,i,lt);var ht=d;1!==u&&(ht=L),ut.length?(E(t,K,1710,ut),ht.length<16?I(t,K,1780,110,ht,4,3):I(t,K,1780,110,ht,3,2)):ht.length<16?I(t,K,1730,170,ht,4,3):I(t,K,1730,170,ht,3,2),t.ZPL_Text(K,1960,20,0,38,38,"已验视")},SF:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.baojiaImg;e.jinfeiImg;var a=e.courierCompanyImg,P=e.muImg,s=e.ziImg,d=e.FRESHImg,c=e.LIQUORImg,u=e.BAN_AIRPLANE_RAILWAYSImg,l=e.FRAGILEImg,h=e.VIPImg,m=i.sheetType,L=void 0===m?1:m,p=i.totalNumber,g=void 0===p?"":p,Z=i.sequenceNumber,v=void 0===Z?"":Z,f=i.waybillNo,x=void 0===f?"":f,y=i.motherWaybillNo,B=void 0===y?"":y,S=i.brandFlag,N=void 0!==S&&S,E=i.brandOrderNumber,w=void 0===E?"":E,R=i.packageWarnings,k=void 0===R?[]:R,M=U,F=60;t.ZPL_PrintImage(F,40,r);var W=i.siteInfo.limitTypeCode?i.siteInfo.limitTypeCode:"";t.ZPL_Text(_(30*M),300,16,0,104,104,W),t.ZPL_Text(_(126*M),310,16,0,78,78,"得物专配"),D(t,F,420,120);var j=i.siteInfo.destRouteLabel?i.siteInfo.destRouteLabel:"";t.ZPL_Text(F,460,16,0,56,56,j);var H=i.siteInfo.codingMapping?i.siteInfo.codingMapping:"";if(2===L?(t.ZPL_PrintImage(F,590,P),t.ZPL_Text(160,590,16,0,80,80,H),t.ZPL_PrintImage(F,740,a)):3===L?(t.ZPL_PrintImage(F,590,s),t.ZPL_Text(160,590,16,0,80,80,H),t.ZPL_PrintImage(F,740,a)):(t.ZPL_Text(F,590,16,0,120,120,H),t.ZPL_PrintImage(F,760,a)),t.ZPL_GraphicBox(413,590,3,250,2,0),T(t,480,710,i),N?O(t,F,870,w):z(t,F,870,i),t.ZPL_QRCode(40,1130,0,2,7,"Q","M","A",x),x.length<16?I(t,210,1140,110,x,4,2):I(t,210,1140,110,x),3===L){var V=(1===(v+"").length?"0"+v:v)+"/"+g;t.ZPL_Text(80,1350,16,0,46,46,V);var J="母单号: "+B;t.ZPL_Text(250,1360,16,0,30,30,J)}b(t,F,1400,o,i),C(t,F,1610,i,"已验视");var Q=[];i.insureValue&&Q.push(n),i.airEmbargo,Q.length&&A(t,60,1680,Q);var Y=[];k&&k.includes("FRESH")&&Y.push(d),k&&k.includes("LIQUOR")&&Y.push(c),k&&k.includes("BAN_AIRPLANE_RAILWAYS")&&Y.push(u),k&&k.includes("FRAGILE")&&Y.push(l),k&&k.includes("VIP")&&Y.push(h),G(t,716,1684,Y),x.length<16?I(t,F,1770,150,x,5,3):I(t,F,1770,150,x,4,2)},DB:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.baojiaImg,a=e.jinfeiImg,P=e.courierCompanyImg,s=e.muImg,d=e.ziImg,c=i.sheetType,u=void 0===c?1:c,l=i.totalNumber,h=void 0===l?"":l,m=i.sequenceNumber,L=void 0===m?"":m,p=i.waybillNo,_=void 0===p?"":p,g=i.brandFlag,Z=void 0!==g&&g,v=i.brandOrderNumber,f=void 0===v?"":v,x=60;t.ZPL_PrintImage(x,40,r);var y=i.zoneCode?i.zoneCode:"";t.ZPL_Text(x,310,16,0,56,56,y),t.ZPL_GraphicBox(x,446,720,2,2,0);var D=i.destAddress,B=D.province,C=void 0===B?"":B,A=D.city,G=void 0===A?"":A,w=D.region,R=void 0===w?"":w;if(b(t,50,480,o,{destName:i.destName,destMobile:i.destMobile,destAddress:{province:C,city:G,region:R}}),t.ZPL_GraphicBox(x,620,720,2,2,0),2===u){t.ZPL_PrintImage(x,650,s);var k=L+"-"+h;t.ZPL_Text(160,654,16,0,86,86,k),t.ZPL_PrintImage(x,750,P)}else if(3===u){t.ZPL_PrintImage(x,650,d);var M=(1===(L+"").length?"0"+L:L)+"-"+h;t.ZPL_Text(160,654,16,0,86,86,M),t.ZPL_PrintImage(x,750,P)}else t.ZPL_PrintImage(x,690,P);t.ZPL_GraphicBox(413,640,2,240,2,0);var F=i.logisticsProductName?i.logisticsProductName:"";F&&N(t,480,640,30+25*F.length,F),T(t,480,740,i),Z?O(t,x,910,f):z(t,x,910,i);var W=_;1===u&&(W=i.subWaybillNoList&&i.subWaybillNoList[0]?i.subWaybillNoList[0]:""),W.length<16?I(t,40,1150,110,W,5,3):I(t,60,1150,110,W),b(t,x,1400,o,i);var j=[],H="";i.insureValue&&(j.push(n),H="德邦保价"),1===i.airEmbargo&&(j.push(a),H=H?H+" 航空禁运":"航空禁运"),S(t,x,1630,i,H),j.length?(E(t,x,1710,j),_.length<16?I(t,40,1780,110,_,5,3):I(t,60,1780,110,_)):_.length<16?I(t,40,1730,170,_,5,3):I(t,60,1730,170,_),t.ZPL_Text(x,1960,20,0,38,38,"已验视")},ZT:V,taskList:function(t,e,i){0===i.roundType?Q(t,e,i):function(t,e,i){var r=e.logoImg,o=i.driverName,n=void 0===o?"":o,a=i.driverPhone,P=void 0===a?"":a,s=i.vehicleDoorCount,d=void 0===s?"":s,c=i.vehicleNumber,u=void 0===c?"":c,l=i.vehicleTypeName,h=void 0===l?"":l,m=i.presetStartingTime,L=void 0===m?"":m,p=i.goSubTaskPrintInfo,g=void 0===p?{}:p,Z=i.backSubTaskPrintInfo,v=void 0===Z?{}:Z,f=11.8,x=_(6*f),y=_(1038.4);t.ZPL_PrintImage(x,_(94.4),r),t.ZPL_Text(_(177),_(94.4),16,0,90,90,"短驳任务单"),t.ZPL_GraphicBox(_(708),_(6*f),_(34*f),_(12*f),75,0),t.ZPL_SetInverse(),t.ZPL_Text(830,_(94.4),16,0,34,34,"规定发车"),t.ZPL_SetInverse(),t.ZPL_Text(_(731.6),_(12*f),16,0,40,40,L),t.ZPL_GraphicBox(x,_(212.4),y,2,2,0);var b="【 去程 】"+(g.transportLine?g.transportLine:"");t.ZPL_Text(x,_(236),16,0,56,56,b);var D=g.taskNo?g.taskNo:"",T="子任务单号 "+D;t.ZPL_Text(x,_(28*f),16,0,34,34,T),t.ZPL_BarCode128(x,_(34*f),0,5,_(129.8),"N","N","N","A",D),t.ZPL_GraphicBox(x,_(578.2),y,2,2,0);var I="【 回程 】"+(v.transportLine?v.transportLine:"");t.ZPL_Text(x,_(51*f),16,0,56,56,I);var B=v.taskNo?v.taskNo:"",S="子任务单号 "+B;t.ZPL_Text(x,_(696.2),16,0,34,34,S),t.ZPL_BarCode128(x,_(767),0,5,_(129.8),"N","N","N","A",B),t.ZPL_GraphicBox(x,_(944),y,2,2,0),t.ZPL_Text(x,_(967.6),16,0,34,34,"车牌号"),t.ZPL_Text(x,_(86*f),16,0,34,34,u),t.ZPL_Text(_(46*f),_(967.6),16,0,34,34,"车型"),t.ZPL_Text(_(46*f),_(86*f),16,0,34,34,h),t.ZPL_Text(_(885),_(967.6),16,0,34,34,"车门数"),t.ZPL_Text(_(885),_(86*f),16,0,34,34,d),t.ZPL_GraphicBox(x,_(92*f),y,2,2,0),t.ZPL_Text(x,_(1109.2),16,0,34,34,"驾驶员"),t.ZPL_Text(x,_(1156.4),16,0,34,34,n),t.ZPL_Text(_(46*f),_(1109.2),16,0,34,34,"随车电话"),t.ZPL_Text(_(46*f),_(1156.4),16,0,34,34,P),t.ZPL_GraphicBox(_(483.8),_(967.6),3,90,2,0),t.ZPL_GraphicBox(_(826),_(967.6),3,90,2,0),t.ZPL_GraphicBox(_(483.8),_(1109.2),3,90,2,0),t.ZPL_GraphicBox(x,_(1227.2),y,2,2,0)}(t,e,i)},wideSF:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.courierCompanyImg,a=e.muImg,P=e.ziImg,s=e.dangerImg,d=e.baoImg,c=e.faImg,u=i.destAddress,l=void 0===u?{}:u,h=i.destName,m=void 0===h?"":h,L=i.destMobile,p=void 0===L?"":L,g=i.sheetType,y=void 0===g?1:g,b=i.totalNumber,D=void 0===b?"":b,T=i.sequenceNumber,I=void 0===T?"":T,B=i.waybillNo,S=void 0===B?"":B,C=i.motherWaybillNo,N=void 0===C?"":C,E=i.payMethod,A=void 0===E?"":E,G=i.printingTime,w=void 0===G?"":G,R=i.siteInfo,k=(R=void 0===R?{}:R).destRouteLabel,M=void 0===k?"":k,F=R.limitTypeCode,W=void 0===F?"":F,z=R.destDeptCode,O=void 0===z?"":z,j=U,H=_(20*j),V=_(339*j);t.ZPL_PrintImage(H,H,r);var J=2===y?N:S;J.length<16?Z(t,_(82*j),H,_(50*j),J,6,4):Z(t,_(82*j),H,_(50*j),J,5,3);var Q=0;(2===y||3===y)&&(Q=_(31*j),t.ZPL_GraphicBox(H,_(92*j),V,2,2,0),t.ZPL_Text(H,_(96*j),16,0,50,50,N),t.ZPL_GraphicBox(_(280*j),_(96*j),2,_(24*j),2,0),t.ZPL_PrintImage(_(292*j),_(99*j),2===y?a:P),t.ZPL_Text(_(312*j),_(97*j),16,0,50,50,I+"-"+D)),t.ZPL_GraphicBox(H,_(92*j)+Q,V,2,2,0),t.ZPL_GraphicBox(H,_(154*j)+Q,V,2,2,0),t.ZPL_GraphicBox(_(192*j),_(92*j)+Q,2,_(62*j),2,0),t.ZPL_GraphicBox(H,_(187*j)+Q,V,2,2,0),t.ZPL_Text(H,_(159*j)+Q,16,0,60,60,M),t.ZPL_Text(H,_(94*j)+Q,16,0,150,150,O),t.ZPL_Text(_(211*j),_(94*j)+Q,16,0,150,150,W),t.ZPL_PrintImage(H,_(204*j)+Q,o),t.ZPL_Text(_(50*j),_(204*j)+Q,16,0,50,50,m+" "+p),t.ZPL_Text_BlockEx(H,_(238*j)+Q,16,0,36,36,V,3,0,14,0,x("".concat(l.province||"").concat(l.city||"").concat(l.region||"").concat(l.detailedAddress||"")));var Y="付款方式: "+(f[A]?f[A]:"");t.ZPL_Text(H,_((Q>0?310:290)*j),16,0,30,30,Y),t.ZPL_Text(_(151*j),_((Q>0?310:290)*j),16,0,30,30,"打印时间: "+w),t.ZPL_GraphicBox(0,_(338*j),1180,1,1,0),v(t,H,_(338*j),j,V,Object.assign({},i,{shouImg:o,faImg:c,courierCompanyImg:n,dangerImg:s,baoImg:d}))},wideJD:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.courierCompanyImg;e.muImg,e.ziImg;var a=e.dangerImg,P=e.baoImg,s=e.faImg,d=i.destAddress,c=void 0===d?{}:d,u=i.destName,l=void 0===u?"":u,h=i.destMobile,m=void 0===h?"":h,L=i.sheetType,p=void 0===L?1:L;i.totalNumber,i.sequenceNumber;var g=i.waybillNo,y=void 0===g?"":g;i.motherWaybillNo,i.printTime,i.itemNumber,i.specification,i.fullExpressCode,i.repositoryCode;var b=i.payMethod,D=void 0===b?"":b,T=i.printingTime,I=void 0===T?"":T,B=i.subWaybillNoList,S=void 0===B?[]:B,C=i.siteInfo;(C=void 0===C?{}:C).destRouteLabel,C.limitTypeCode,C.destDeptCode;var N=C.siteName,E=void 0===N?"":N,A=C.road,G=void 0===A?"":A,w=C.sourcetSortCenterName,R=void 0===w?"":w,k=C.originalCrossCode,M=void 0===k?"":k,F=C.originalTabletrolleyCode,W=void 0===F?"":F,z=C.targetSortCenterName,O=void 0===z?"":z,j=C.destinationCrossCode,H=void 0===j?"":j,V=C.destinationTabletrolleyCode,J=void 0===V?"":V,Q=U,Y=_(20*Q),q=_(339*Q);t.ZPL_PrintImage(Y,Y,r);var $=y;1===p&&($=S&&S[0]?S[0]:""),$.length<16?Z(t,_(78*Q),Y,_(50*Q),$,6,4):$.length<=20?Z(t,_(78*Q),Y,_(50*Q),$,4,3):Z(t,_(78*Q),Y,_(50*Q),$,3,2),t.ZPL_Text(Y,_(106*Q),16,0,36,36,"始发:"+R),t.ZPL_Text(Y,_(125*Q),16,0,62,62,M+"-"+W),t.ZPL_Text(_(198*Q),_(106*Q),16,0,36,36,"目的:"+O),t.ZPL_Text(_(198*Q),_(125*Q),16,0,62,62,H+"-"+J),t.ZPL_GraphicBox(Y,_(97*Q),q,2,2,0),t.ZPL_GraphicBox(Y,_(158*Q),q,2,2,0),t.ZPL_GraphicBox(_(185*Q),_(97*Q),2,_(61*Q),2,0),t.ZPL_GraphicBox(Y,_(198*Q),q,2,2,0),t.ZPL_Text(Y,_(169*Q),16,0,50,50,E),t.ZPL_GraphicBox(_(318*Q),_(158*Q),2,_(40*Q),2,0),t.ZPL_Text(_(330*Q),_(169*Q),16,0,50,50,G),t.ZPL_PrintImage(Y,_(211*Q),o),t.ZPL_Text(_(50*Q),_(211*Q),16,0,50,50,l+" "+m),t.ZPL_Text_BlockEx(Y,_(247*Q),16,0,36,36,q,3,0,14,0,x("".concat(c.province||"").concat(c.city||"").concat(c.region||"").concat(c.detailedAddress||"")));var K="付款方式: "+(f[D]?f[D]:"");t.ZPL_Text(Y,_(303*Q),16,0,30,30,K),t.ZPL_Text(_(151*Q),_(303*Q),16,0,30,30,"打印时间: "+I),t.ZPL_GraphicBox(0,_(338*Q),1180,1,1,0),v(t,Y,_(338*Q),Q,q,Object.assign({},i,{shouImg:o,faImg:s,courierCompanyImg:n,dangerImg:a,baoImg:P}))},wideDB:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.zhanImg,a=e.courierCompanyImg,P=e.muImg,s=e.ziImg,d=e.dangerImg,c=e.baoImg,u=e.faImg,l=i.destAddress,h=void 0===l?{}:l,m=i.destName,L=void 0===m?"":m,p=i.destMobile,g=void 0===p?"":p,y=i.sheetType,b=void 0===y?1:y,D=i.totalNumber,T=void 0===D?"":D,I=i.sequenceNumber,B=void 0===I?"":I,S=i.waybillNo,C=void 0===S?"":S,N=i.motherWaybillNo,E=void 0===N?"":N;i.printTime,i.itemNumber,i.specification,i.fullExpressCode,i.repositoryCode;var A=i.payMethod,G=void 0===A?"":A,w=i.printingTime,R=void 0===w?"":w,k=i.zoneCode,M=void 0===k?"":k,F=i.siteInfo;(F=void 0===F?{}:F).destRouteLabel,F.limitTypeCode,F.destDeptCode,F.siteName,F.road,F.sourcetSortCenterName,F.originalCrossCode,F.originalTabletrolleyCode,F.targetSortCenterName,F.destinationCrossCode,F.destinationTabletrolleyCode;var W=U,z=_(20*W),O=_(339*W);t.ZPL_PrintImage(z,z,r);var j=2===b?E:C;j.length<16?Z(t,_(78*W),z,_(50*W),j,6,4):Z(t,_(78*W),z,_(50*W),j,5,4),t.ZPL_GraphicBox(z,_(97*W),O,2,2,0),t.ZPL_Text_BlockEx(z,_(108*W),16,0,93,93,O,2,1,0,0,M),t.ZPL_GraphicBox(z,_(158*W),O,2,2,0),2===b||3===b?(t.ZPL_GraphicBox(z,_(198*W),O,2,2,0),t.ZPL_GraphicBox(_(280*W),_(158*W),2,_(40*W),2,0),t.ZPL_PrintImage(_(292*W),_(169*W),2===b?P:s),t.ZPL_Text(_(312*W),_(167*W),16,0,50,50,B+"-"+T),t.ZPL_Text(z,_(166*W),16,0,50,50,E),t.ZPL_PrintImage(z,_(211*W),o),t.ZPL_Text(_(50*W),_(211*W),16,0,50,50,L+" "+g),t.ZPL_Text_BlockEx(z,_(247*W),16,0,36,36,O,3,0,14,0,x("".concat(h.province||"").concat(h.city||"").concat(h.region||"").concat(h.detailedAddress||""))),t.ZPL_Text(z,_(303*W),16,0,30,30,"付款方式: "+(f[G]||"")),t.ZPL_Text(_(151*W),_(303*W),16,0,30,30,"打印时间: "+R)):(t.ZPL_PrintImage(z,_(182*W),o),t.ZPL_Text(_(50*W),_(182*W),16,0,50,50,L+" "+g),t.ZPL_Text_BlockEx(z,_(224*W),16,0,36,36,O,3,0,14,0,x("".concat(h.province||"").concat(h.city||"").concat(h.region||"").concat(h.detailedAddress||""))),t.ZPL_Text(z,_(290*W),16,0,30,30,"付款方式: "+(f[G]||"")),t.ZPL_Text(_(151*W),_(290*W),16,0,30,30,"打印时间: "+R)),t.ZPL_GraphicBox(0,_(338*W),1180,1,1,0),t.ZPL_PrintImage(_(325*W),_(280*W),n),v(t,z,_(338*W),W,O,Object.assign({},i,{shouImg:o,faImg:u,courierCompanyImg:a,dangerImg:d,baoImg:c}))},wideEMS:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.courierCompanyImg,a=e.muImg,P=e.ziImg,s=e.dangerImg,d=e.baoImg,c=e.faImg,u=i.destAddress,l=void 0===u?{}:u,h=i.destName,m=void 0===h?"":h,L=i.destMobile,p=void 0===L?"":L,g=i.sheetType,y=void 0===g?1:g,b=i.totalNumber,D=void 0===b?"":b,T=i.sequenceNumber,I=void 0===T?"":T,B=i.waybillNo,S=void 0===B?"":B,C=i.motherWaybillNo,N=void 0===C?"":C;i.printTime,i.itemNumber,i.specification,i.fullExpressCode,i.repositoryCode;var E=i.payMethod,A=void 0===E?"":E,G=i.printingTime,w=void 0===G?"":G,R=i.siteInfo;(R=void 0===R?{}:R).destRouteLabel,R.limitTypeCode,R.destDeptCode,R.siteName,R.road,R.sourcetSortCenterName,R.originalCrossCode,R.originalTabletrolleyCode,R.targetSortCenterName,R.destinationCrossCode,R.destinationTabletrolleyCode;var k=U,M=_(20*k),F=_(339*k);t.ZPL_PrintImage(M,M,r);var W=2===y?N:S;W.length<16?Z(t,_(78*k),M,_(50*k),W,6,4):Z(t,_(78*k),M,_(50*k),W,5,3),t.ZPL_GraphicBox(M,_(97*k),F,2,2,0),t.ZPL_Text_BlockEx(M,_(110*k),16,0,93,93,F,2,1,0,0,x("".concat(l.province||"","-").concat(l.city||"","-").concat(l.region||""))),t.ZPL_GraphicBox(M,_(158*k),F,2,2,0),t.ZPL_GraphicBox(M,_(198*k),F,2,2,0),2===y||3===y?(t.ZPL_GraphicBox(_(280*k),_(158*k),2,_(40*k),2,0),t.ZPL_PrintImage(_(292*k),_(169*k),2===y?a:P),t.ZPL_Text(_(312*k),_(169*k),16,0,50,50,I+"-"+D),t.ZPL_Text(M,_(166*k),16,0,50,50,N)):t.ZPL_Text_BlockEx(M,_(166*k),16,0,62,62,F,2,1,0,0,S),t.ZPL_PrintImage(M,_(211*k),o),t.ZPL_Text(_(50*k),_(211*k),16,0,50,50,m+" "+p),t.ZPL_Text_BlockEx(M,_(247*k),16,0,36,36,F,3,0,14,0,x("".concat(l.province||"").concat(l.city||"").concat(l.region||"").concat(l.detailedAddress||""))),t.ZPL_Text(M,_(303*k),16,0,30,30,"付款方式: "+(f[A]||"")),t.ZPL_Text(_(151*k),_(303*k),16,0,30,30,"打印时间: "+w),t.ZPL_GraphicBox(0,_(338*k),1180,1,1,0),v(t,M,_(338*k),k,F,Object.assign({},i,{shouImg:o,faImg:c,courierCompanyImg:n,dangerImg:s,baoImg:d}))},wideZT:function(t,e,i){var r=e.logoImg,o=e.shouImg,n=e.courierCompanyImg,a=e.dangerImg,P=e.baoImg,s=e.faImg,d=i.destAddress,c=void 0===d?{}:d,u=i.destName,l=void 0===u?"":u,h=i.destMobile,m=void 0===h?"":h,L=i.waybillNo,p=void 0===L?"":L,g=i.payMethod,y=void 0===g?"":g,b=i.printingTime,D=void 0===b?"":b,T=i.siteInfo,I=void 0===T?{}:T,B=U,S=_(20*B),C=_(339*B),N=78;t.ZPL_PrintImage(S,S,r),Z(t,_(N*B),S,_(50*B),p,p.length<16?6:5,4),N+=19,t.ZPL_GraphicBox(S,_(N*B),C,2,2,0),N+=11,t.ZPL_Text(S,_(N*B),16,0,100,100,I.destRouteLabel||""),N+=50,t.ZPL_GraphicBox(S,_(N*B),C,2,2,0),N+=5,t.ZPL_Text(S,_(N*B),16,0,72,72,I.siteName||""),N+=35,t.ZPL_GraphicBox(S,_(N*B),C,2,2,0),N+=20,t.ZPL_PrintImage(S,_(N*B),o),t.ZPL_Text(_(50*B),_(N*B),16,0,50,50,l+" "+m),N+=32,t.ZPL_Text_BlockEx(S,_(N*B),16,0,36,36,C,3,0,14,0,x("".concat(c.province||"").concat(c.city||"").concat(c.region||"").concat(c.detailedAddress||""))),N+=56,t.ZPL_Text(S,_(N*B),16,0,30,30,"付款方式: "+(f[y]||"")),t.ZPL_Text(_(151*B),_(N*B),16,0,30,30,"打印时间: "+D),t.ZPL_GraphicBox(0,_(338*B),1180,1,1,0),v(t,S,_(338*B),B,C,Object.assign({},i,{shouImg:o,faImg:s,courierCompanyImg:n,dangerImg:a,baoImg:P}))},wmsDeliverGoods:function(t,e){var i=e.sender,r=void 0===i?"":i,o=e.receiver,n=void 0===o?"":o,a=e.boxMarkNo,P=void 0===a?"":a,s=11.8,d=_(47.2);t.ZPL_BarCode128(d,_(7*s),0,5,_(236),"N","N","N","A",P),t.ZPL_Text(d,_(413),16,0,34,34,"箱唛编号"),t.ZPL_Text(_(28*s),_(413),16,0,34,34,P),t.ZPL_Text(d,_(48*s),16,0,34,34,"发件方"),t.ZPL_Text(_(28*s),_(48*s),16,0,34,34,r),t.ZPL_Text(d,_(61*s),16,0,34,34,"收件方"),t.ZPL_Text_BlockEx(_(28*s),_(61*s),16,0,34,34,760,2,0,14,0,n)},tmsBrandBox:function(t,e){var i=e.packNo,r=void 0===i?"":i,o=e.packRelation,n=void 0===o?"":o,a=e.warehouseName,P=void 0===a?"":a,s=e.warehouseCode,d=void 0===s?"":s,c=e.merchantApplyNo,u=void 0===c?"":c,l=e.deliveryDetail,h=void 0===l?"":l,m=e.merchantName,L=void 0===m?"":m,p=e.mobile,g=void 0===p?"":p,Z=11.8,v=_(47.2),f=(new Date).Format("yyyy-MM-dd HH:mm:ss");t.ZPL_Text(_(295),_(7*Z),16,0,80,80,"品牌直发物料箱唛"),t.ZPL_Text(v,_(236),16,0,34,34,"箱唛编码:"),t.ZPL_Text(_(318.6),_(236),16,0,40,40,r),t.ZPL_QRCode(860,340,0,2,10,"Q","M","A",r),t.ZPL_Text(v,_(354),16,0,34,34,"托盘关系:"),t.ZPL_Text(_(318.6),_(354),16,0,34,34,n),t.ZPL_Text(v,_(472),16,0,34,34,"始发仓名称:"),t.ZPL_Text_BlockEx(_(318.6),_(472),16,0,34,34,760,2,0,14,0,P),t.ZPL_Text(v,_(590),16,0,34,34,"始发仓代码:"),t.ZPL_Text_BlockEx(_(318.6),_(590),16,0,34,34,760,2,0,14,0,d),t.ZPL_Text(v,_(708),16,0,34,34,"打印时间:"),t.ZPL_Text_BlockEx(_(318.6),_(708),16,0,34,34,760,2,0,14,0,f),t.ZPL_Text(v,_(944),16,0,34,34,"商家申请单号:"),t.ZPL_Text_BlockEx(_(318.6),_(944),16,0,34,34,760,2,0,14,0,u),t.ZPL_Text(v,_(1062),16,0,34,34,"商家地址:"),t.ZPL_Text_BlockEx(_(318.6),_(1062),16,0,34,34,760,2,0,14,0,h),t.ZPL_Text(v,_(1239),16,0,34,34,"商家名称:"),t.ZPL_Text_BlockEx(_(318.6),_(1239),16,0,34,34,760,2,0,14,0,L),t.ZPL_Text(v,_(1357),16,0,34,34,"商家电话:"),t.ZPL_Text_BlockEx(_(318.6),_(1357),16,0,34,34,760,2,0,14,0,g)},pinkBrandBox:function(t,e){var i=e.bizTypeDesc,r=void 0===i?"":i,o=e.orderNo,n=void 0===o?"":o,a=e.goodsArticleNumber,P=void 0===a?"":a,s=e.goodsTitle,d=void 0===s?"":s,c=e.goodsSize,u=void 0===c?"":c,l=e.ownerName,h=void 0===l?"":l,m=e.printTimes,L=void 0===m?"":m,p=e.uniqueCode,g=void 0===p?"":p,Z=_(23.6),v=(new Date).Format("yyyy-MM-dd HH:mm:ss");t.ZPL_Text(Z,20,16,0,36,36,r),function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:120,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;t.ZPL_BarCode128(e,i,0,n,r,"N","N","N","A",o);var P=i+r+4,s=B(o,a);t.ZPL_Text(e,P,16,0,24,24,s)}(t,Z,60,90,g),t.ZPL_Text(Z,_(188.8),16,0,38,38,n),t.ZPL_Text_BlockEx(Z,_(236),16,0,24,24,580,3,0,6,0,d),t.ZPL_Text(Z,_(354),16,0,30,30,u),t.ZPL_Text_BlockEx(_(236),_(354),16,0,26,26,380,2,0,6,0,P),t.ZPL_Text(Z,_(483.8),16,0,34,34,h);var f=L?L+"次":"";t.ZPL_Text(Z,_(531),16,0,24,24,f),t.ZPL_Text(100,_(531),16,0,24,24,v)},newJD:function(t,e,i){var r=e.shouImg,o=e.baojiaImg,n=e.jinfeiImg,a=e.courierCompanyImg,P=i.waybillNo,s=void 0===P?"":P,d=i.sheetType,c=void 0===d?1:d,u=i.logisticsTransport,l=void 0===u?"":u,h=i.motherWaybillNo,m=void 0===h?"":h,L=i.siteInfo,p=void 0===L?{}:L,_=i.brandFlag,g=void 0!==_&&_,Z=i.brandOrderNumber,v=void 0===Z?"":Z,f=p.sourcetSortCenterName,x=void 0===f?"":f,y=p.sourceSortCenterName,B=void 0===y?"":y,C=p.originalCrossCode,N=void 0===C?"":C,A=p.originalTabletrolleyCode,G=void 0===A?"":A,w=p.originalTableTrolleyCode,R=void 0===w?"":w,k=p.targetSortCenterName,M=void 0===k?"":k,F=p.destinationCrossCode,W=void 0===F?"":F,j=p.destinationTabletrolleyCode,H=void 0===j?"":j,U=p.destinationTableTrolleyCode,V=void 0===U?"":U,J=p.siteName,Q=void 0===J?"":J,Y=p.road,q=void 0===Y?"":Y,$=60,K=x||B,X=[N,G||R].filter(Boolean).join("-");t.ZPL_Text($,360,16,0,30,30,K),t.ZPL_Text($,400,20,0,46,46,X),t.ZPL_GraphicBox(460,360,3,80,2,0);var tt=M,et=[W,H||V].filter(Boolean).join("-");t.ZPL_Text(490,360,16,0,30,30,tt),t.ZPL_Text(490,400,16,0,46,46,et),D(t,$,500,100),t.ZPL_Text($,530,16,0,40,40,Q),t.ZPL_GraphicBox($,630,130,56,28,0),t.ZPL_SetInverse(),t.ZPL_Text(70,640,16,0,28,28,"得物专配"),t.ZPL_Text($,690,16,0,90,90,q),t.ZPL_PrintImage($,810,a),t.ZPL_GraphicBox(413,630,2,240,2,0),t.ZPL_Text(480,640,16,0,30,30,i.logisticsProductCode),"KY"===l&&t.ZPL_Text(610,648,16,0,46,46,"航"),T(t,480,740,i),g?O(t,$,910,v):z(t,$,910,i);var it=s;1===c&&(it=i.subWaybillNoList&&i.subWaybillNoList[0]?i.subWaybillNoList[0]:""),it.length<16?I(t,$,1150,110,it,4,3):I(t,$,1150,110,it,3,2),b(t,$,1400,r,i);var rt=[],ot="";i.insureValue&&(rt.push(o),ot="京东保价"),1===i.airEmbargo&&(rt.push(n),ot=ot?ot+" 航空禁运":"航空禁运"),S(t,$,1630,i,ot);var nt=s;1!==c&&(nt=m),rt.length?(E(t,$,1710,rt),nt.length<16?I(t,$,1780,110,nt,4,3):I(t,$,1780,110,nt,3,2)):nt.length<16?I(t,$,1730,170,nt,4,3):I(t,$,1730,170,nt,3,2),t.ZPL_Text($,1960,20,0,38,38,"已验视")},newSF:function(t,e,i){var r=e.shouImg,o=e.baojiaImg,n=e.courierCompanyImg,a=e.muImg,P=e.ziImg,s=e.FRESHImg,d=e.LIQUORImg,c=e.BAN_AIRPLANE_RAILWAYSImg,u=e.FRAGILEImg,l=e.VIPImg,h=i.sheetType,m=void 0===h?1:h,L=i.totalNumber,p=void 0===L?"":L,g=i.sequenceNumber,Z=void 0===g?"":g,v=i.waybillNo,f=void 0===v?"":v,x=i.motherWaybillNo,y=void 0===x?"":x,B=i.brandFlag,S=void 0!==B&&B,N=i.brandOrderNumber,E=void 0===N?"":N,w=i.packageWarnings,R=void 0===w?[]:w,k=U,M=60,F=i.siteInfo.limitTypeCode?i.siteInfo.limitTypeCode:"";t.ZPL_Text(_(30*k),336,16,0,104,104,F),t.ZPL_Text(_(126*k),346,16,0,78,78,"得物专配"),D(t,M,450,120);var W=i.siteInfo.destRouteLabel?i.siteInfo.destRouteLabel:"";t.ZPL_Text(M,490,16,0,56,56,W);var j=i.siteInfo.codingMapping?i.siteInfo.codingMapping:"";if(2===m?(t.ZPL_PrintImage(M,610,a),t.ZPL_Text(160,610,16,0,80,80,j),t.ZPL_PrintImage(M,760,n)):3===m?(t.ZPL_PrintImage(M,610,P),t.ZPL_Text(160,610,16,0,80,80,j),t.ZPL_PrintImage(M,760,n)):(t.ZPL_Text(M,610,16,0,120,120,j),t.ZPL_PrintImage(M,780,n)),t.ZPL_GraphicBox(413,610,3,250,2,0),T(t,480,730,i),S?O(t,M,890,E):z(t,M,890,i),t.ZPL_QRCode(40,1150,0,2,7,"Q","M","A",f),f.length<16?I(t,210,1160,110,f,4,2):I(t,210,1160,110,f),3===m){var H=(1===(Z+"").length?"0"+Z:Z)+"/"+p;t.ZPL_Text(80,1350,16,0,46,46,H);var V="母单号: "+y;t.ZPL_Text(250,1360,16,0,30,30,V)}b(t,M,1400,r,i),C(t,M,1610,i,"已验视");var J=[];i.insureValue&&J.push(o),i.airEmbargo,J.length&&A(t,60,1680,J);var Q=[];R&&R.includes("FRESH")&&Q.push(s),R&&R.includes("LIQUOR")&&Q.push(d),R&&R.includes("BAN_AIRPLANE_RAILWAYS")&&Q.push(c),R&&R.includes("FRAGILE")&&Q.push(u),R&&R.includes("VIP")&&Q.push(l),G(t,716,1684,Q),f.length<16?I(t,M,1770,150,f,5,3):I(t,M,1770,150,f,4,2)},newDB:function(t,e,i){var r=e.shouImg,o=e.baojiaImg,n=e.jinfeiImg,a=e.courierCompanyImg,P=e.muImg,s=e.ziImg,d=i.sheetType,c=void 0===d?1:d,u=i.totalNumber,l=void 0===u?"":u,h=i.sequenceNumber,m=void 0===h?"":h,L=i.waybillNo,p=void 0===L?"":L,_=i.brandFlag,g=void 0!==_&&_,Z=i.brandOrderNumber,v=void 0===Z?"":Z,f=60,x=i.zoneCode?i.zoneCode:"";t.ZPL_Text(f,350,16,0,56,56,x),t.ZPL_GraphicBox(f,446,720,2,2,0);var y=i.destAddress,D=y.province,B=void 0===D?"":D,C=y.city,A=void 0===C?"":C,G=y.region,w=void 0===G?"":G;if(b(t,50,480,r,{destName:i.destName,destMobile:i.destMobile,destAddress:{province:B,city:A,region:w}}),t.ZPL_GraphicBox(f,620,720,2,2,0),2===c){t.ZPL_PrintImage(f,650,P);var R=m+"-"+l;t.ZPL_Text(160,654,16,0,86,86,R),t.ZPL_PrintImage(f,750,a)}else if(3===c){t.ZPL_PrintImage(f,650,s);var k=(1===(m+"").length?"0"+m:m)+"-"+l;t.ZPL_Text(160,654,16,0,86,86,k),t.ZPL_PrintImage(f,750,a)}else t.ZPL_PrintImage(f,690,a);t.ZPL_GraphicBox(413,640,2,240,2,0);var M=i.logisticsProductName?i.logisticsProductName:"";M&&N(t,480,640,30+25*M.length,M),T(t,480,740,i),g?O(t,f,910,v):z(t,f,910,i);var F=p;1===c&&(F=i.subWaybillNoList&&i.subWaybillNoList[0]?i.subWaybillNoList[0]:""),F.length<16?I(t,40,1150,110,F,5,3):I(t,60,1150,110,F),b(t,f,1400,r,i);var W=[],j="";i.insureValue&&(W.push(o),j="德邦保价"),1===i.airEmbargo&&(W.push(n),j=j?j+" 航空禁运":"航空禁运"),S(t,f,1630,i,j),W.length?(E(t,f,1710,W),p.length<16?I(t,40,1780,110,p,5,3):I(t,60,1780,110,p)):p.length<16?I(t,40,1730,170,p,5,3):I(t,60,1730,170,p),t.ZPL_Text(f,1960,20,0,38,38,"已验视")},newZT:function(t,e,i){V(t,e,i,"new")}},$=null,K=[],X=!1,tt=!1,et=null;function it(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e?200:2e3;setTimeout((function(){K.length>0&&(et=K[0],K.splice(0,1),t.print(et))}),i)}function rt(t,e,i){var o=!K.length;K=[].concat(r(K),r(t)),$&&1===$.readyState?(tt=!0,it(e,o)):tt=!1,function(t,e){if(X||tt)return!1;Y&&clearTimeout(Y),Y=setTimeout((function(){X=!1,e("连接超时")}),6e3);var i="MozWebSocket"in window?"MozWebSocket":"WebSocket"in window?"WebSocket":null;i||e("当前浏览器不支持websocket!"),console.log("* 服务器连接中 ......"),($=new window[i]("ws://127.0.0.1:9099")).onopen=function(){t.initWs($),console.log("* 服务器已连接"),X=!1,tt=!0,it(t,!0),Y&&clearTimeout(Y)},$.onmessage=function(i){var r;Y&&clearTimeout(Y);try{r=JSON.parse(i.data)}catch(t){return K=[],void console.log(t,i.data)}if(0==r.code)if(""!=r.fun&&"ZPL_GetPrinterStatus"==r.fun){for(var o="",n=0;n<r.data.length;n++)"ZPL_STATE_NORMAL"==r.data[n].name&&r.data[n].value,"ZPL_STATE_HIGHT_TEMP"==r.data[n].name&&1==r.data[n].value&&(o+="高温;"),"ZPL_STATE_STANDBY"==r.data[n].name&&1==r.data[n].value&&(o+="待机;"),"ZPL_STATE_PRINTING"==r.data[n].name&&1==r.data[n].value&&(o+="打印中;"),"ZPL_STATE_TOF_ERROR"==r.data[n].name&&1==r.data[n].value&&(o+="标签定位异常;"),"ZPL_STATE_LABEL_END"==r.data[n].name&&1==r.data[n].value&&(o+="纸用尽;"),"ZPL_STATE_RIBBON_END"==r.data[n].name&&1==r.data[n].value&&(o+="碳带用尽;"),"ZPL_STATE_LABEL_SEIZING"==r.data[n].name&&1==r.data[n].value&&(o+="卡纸;"),"STATE_LABEL_JUMPPING"==r.data[n].name&&1==r.data[n].value&&(o+="跳标;"),"ZPL_STATE_LABEL_CALIBRATING"==r.data[n].name&&1==r.data[n].value&&(o+="标签学习中;"),"ZPL_STATE_CUTTER_ERROR"==r.data[n].name&&1==r.data[n].value&&(o+="切刀异常;"),"ZPL_STATE_FORM_ERROR"==r.data[n].name&&1==r.data[n].value&&(o+="标签格式异常;"),"ZPL_STATE_MEMORY_WRITE_ERROR"==r.data[n].name&&1==r.data[n].value&&(o+="记忆体写入异常;"),"ZPL_STATE_ILLEGAL_COMMAND"==r.data[n].name&&1==r.data[n].value&&(o+="非法指令;"),"ZPL_STATE_COVER_OPEN"==r.data[n].name&&1==r.data[n].value&&(o+="盒盖未到位;"),"ZPL_STATE_RIBBON_NEAR_END"==r.data[n].name&&1==r.data[n].value&&(o+="碳带将尽;");e(o)}else""!=r.fun&&console.log(r.data);it(t)},X=!0}(e,i)}var ot=[{name:"logoImg",url:"https://cdn.poizon.com/node-common/c0a74cea59cdee1e73500424dc7ab9ed.png",ratio:1.5},{name:"shouImg",url:"https://cdn.poizon.com/node-common/872ca252c519940b1b62234f6fab7468.png",ratio:1},{name:"muImg",url:"https://cdn.poizon.com/node-common/9c8e7bb5128ad82ff09bf8f20c6c3033.png",ratio:1},{name:"ziImg",url:"https://cdn.poizon.com/node-common/65c4c2ce73b2977fbef3a7bcbfbcb97d.png",ratio:1}],nt={JD:[].concat(ot,[{name:"baojiaImg",url:"https://cdn.poizon.com/node-common/6cfffdb3784d327267a8823a07dea1f5.png",ratio:1},{name:"jinfeiImg",url:"https://cdn.poizon.com/node-common/072957a51ce75f1988c862d849873fc1.png",ratio:1},{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/d5cc79af948e9b025ff249c6398279ab.png",ratio:1}]),SF:[].concat(ot,[{name:"baojiaImg",url:"https://cdn.poizon.com/node-common/e402605d832ff1c34302a5c00e7b5da8.png",ratio:1},{name:"jinfeiImg",url:"https://cdn.poizon.com/node-common/421d259c151938a3d592f2930fe05a85.png",ratio:1},{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/3164302a458e3b287a70142a96277083.png",ratio:.9},{name:"FRESHImg",url:"https://cdn.poizon.com/node-common/319f6d1a-6e35-e6a6-1406-a3bd9a46663e-69-69.png",ratio:1},{name:"LIQUORImg",url:"https://cdn.poizon.com/node-common/e1285cdc-4468-3e8e-6865-94b97e2eabea-69-69.png",ratio:1},{name:"BAN_AIRPLANE_RAILWAYSImg",url:"https://cdn.poizon.com/node-common/6ae55af8-9ae1-24d2-1e71-6a434b6276f9-69-69.png",ratio:1},{name:"FRAGILEImg",url:"https://cdn.poizon.com/node-common/ccd4fc39-2243-0d75-3ae3-c4122209e394-69-69.png",ratio:1},{name:"VIPImg",url:"https://cdn.poizon.com/node-common/8f302c05-dd21-6e22-3929-e9fd8b184774-69-69.png",ratio:1}]),DB:[].concat(ot,[{name:"baojiaImg",url:"https://cdn.poizon.com/node-common/63234bfe94984efff4c541bcc730a361.png",ratio:1},{name:"jinfeiImg",url:"https://cdn.poizon.com/node-common/072957a51ce75f1988c862d849873fc1.png",ratio:1},{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/0dccbb4d3463f61d9f424d23e1c8a9ec.png",ratio:1}]),ZT:[].concat(ot,[{name:"baojiaImg",url:"https://cdn.poizon.com/node-common/b2ed80f5-c9f6-9e14-e671-c6873a96b45a-63-111.jpg",ratio:1},{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/fe5ef639-c56b-f5ab-d42f-b1b6120484cc-207-36.png",ratio:1}]),pdf:[{name:"pdfImg",url:"https://cdn.poizon.com/node-common/007630bb-b43d-4fb7-546e-6b7dbfe99e6c-497-1208.png",ratio:1}]},at=[{name:"logoImg",url:"https://cdn.poizon.com/node-common/10e8dbd5-b26c-307e-e218-c2675117f1a8-123-122.png",ratio:1.27},{name:"shouImg",url:"https://cdn.poizon.com/node-common/872ca252c519940b1b62234f6fab7468.png",ratio:.97},{name:"faImg",url:"https://cdn.poizon.com/node-common/0a61a107-3c1f-1e62-8b4e-89420829686a-71-71.png",ratio:.97},{name:"muImg",url:"https://cdn.poizon.com/node-common/9c8e7bb5128ad82ff09bf8f20c6c3033.png",ratio:.74},{name:"ziImg",url:"https://cdn.poizon.com/node-common/1d1b3c07-f33c-99c1-ff5a-7999b73d7958-34-34.jpg",ratio:1.53},{name:"dangerImg",url:"https://cdn.poizon.com/node-common/86eeeff6-c7b0-a44a-0b76-ecaeef4964a4-34-26.jpg",ratio:1.65},{name:"baoImg",url:"https://cdn.poizon.com/node-common/cb8307f9-eeed-bfbb-4178-6f633a3adad7-28-30.jpg",ratio:1.51}],Pt={JD:[].concat(at,[{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/d5cc79af948e9b025ff249c6398279ab.png",ratio:1.5}]),SF:[].concat(at,[{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/d60b01dc-12cf-4889-417b-c10e642a7d6c-234-82.png",ratio:1.5}]),DB:[].concat(at,[{name:"zhanImg",url:"https://cdn.poizon.com/node-common/0ef8b576-5a3e-7416-df9b-a247bcdf43b8-68-68.jpg",ratio:1.47},{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/f7fc90a5-4bbd-ee66-d983-a0489ccf4e86-234-86.jpg",ratio:1.6}]),EMS:[].concat(at,[{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/c0329af7-f5b4-7710-11e3-e643b6ad3810-228-44.jpg",ratio:1.56}]),ZT:[].concat(at,[{name:"courierCompanyImg",url:"https://cdn.poizon.com/node-common/fe5ef639-c56b-f5ab-d42f-b1b6120484cc-207-36.png",ratio:1.56}])};var st={1:function(t){return new Promise((function(i,r){var o=new s.Builder;o.ZPL_StartFormat(),o.ZPL_SetPrintDarkness(20);o.ZPL_SetPrintWidth(826);o.ZPL_SetLabelLength(2006.0000000000002),o.ZPL_SetChangeFontEncoding(14),o.ZPL_SetUserFontName("zhonghei.TTF");var n=e({},t);t.logistics_code&&(n=H(t));var a=n.logisticsCode,P=nt[a],d=q[a],c=w(P);Promise.all(c).then((function(t){var e=R(t,P);d(o,e,n),o.ZPL_EndFormat(),i(o.getPrintData())})).catch((function(){r()}))}))},2:function(t){return new Promise((function(e,i){var r=new s.Builder;r.ZPL_StartFormat(),r.ZPL_SetPrintDarkness(20);r.ZPL_SetPrintWidth(1180);r.ZPL_SetLabelLength(1770),r.ZPL_SetChangeFontEncoding(14),r.ZPL_SetUserFontName("zhonghei.TTF");var o=q.taskList,n=[{name:"logoImg",url:"https://cdn.poizon.com/node-common/a3b36b4cb2d0c21f7e21ac3e9a16c004.png",ratio:.7}],a=w(n);Promise.all(a).then((function(i){var a=R(i,n);o(r,a,t),r.ZPL_EndFormat(),e(r.getPrintData())})).catch((function(){i()}))}))},3:function(t){return new Promise((function(e,i){var r=new s.Builder;r.ZPL_StartFormat(),r.ZPL_SetPrintDarkness(20);r.ZPL_SetPrintWidth(1180);r.ZPL_SetLabelLength(1770),r.ZPL_SetChangeFontEncoding(14),r.ZPL_SetUserFontName("zhonghei.TTF");var o=t.logisticsCode,n=Pt[o],a=q["wide"+o],P=w(n);Promise.all(P).then((function(i){var o=R(i,n);a(r,o,t),r.ZPL_EndFormat(),e(r.getPrintData())})).catch((function(){i()}))}))},4:function(t){return new Promise((function(e){var i=new s.Builder;i.ZPL_StartFormat(),i.ZPL_SetPrintDarkness(20);i.ZPL_SetPrintWidth(1180);i.ZPL_SetLabelLength(1770),i.ZPL_SetChangeFontEncoding(14),i.ZPL_SetUserFontName("zhonghei.TTF"),(0,q.wmsDeliverGoods)(i,t),i.ZPL_EndFormat(),e(i.getPrintData())}))},5:function(t){return new Promise((function(i,r){var o=new s.Builder;o.ZPL_StartFormat(),o.ZPL_SetPrintDarkness(20);o.ZPL_SetPrintWidth(826);o.ZPL_SetLabelLength(2006.0000000000002),o.ZPL_SetChangeFontEncoding(14),o.ZPL_SetUserFontName("zhonghei.TTF");var n=e({},t);t.logistics_code&&(n=H(t));var a=n.logisticsCode,P=nt[a],d=q["new"+a],c=w(P);Promise.all(c).then((function(t){var e=R(t,P);d(o,e,n),o.ZPL_EndFormat(),i(o.getPrintData())})).catch((function(){r()}))}))},6:function(t){return new Promise((function(e){var i=new s.Builder;i.ZPL_StartFormat(),i.ZPL_SetPrintDarkness(20);i.ZPL_SetPrintWidth(1180);i.ZPL_SetLabelLength(1770),i.ZPL_SetChangeFontEncoding(14),i.ZPL_SetUserFontName("zhonghei.TTF"),(0,q.tmsBrandBox)(i,t),i.ZPL_EndFormat(),e(i.getPrintData())}))},7:function(t){return new Promise((function(e){var i=new s.Builder;i.ZPL_StartFormat(),i.ZPL_SetPrintDarkness(20);i.ZPL_SetPrintWidth(649);i.ZPL_SetLabelLength(590),i.ZPL_SetChangeFontEncoding(14),i.ZPL_SetUserFontName("zhonghei.TTF"),(0,q.pinkBrandBox)(i,t),i.ZPL_EndFormat(),e(i.getPrintData())}))}};return function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(1===i||3===i||5===i){var r=k(t),o=M(t);if(!r&&!o)return e&&e("数据格式不正确"),!1}else if(2===i){var n=F(t);if(!n)return e&&e("数据格式不正确"),!1}var a=W();if(!a)return e&&e("请使用windows系统打印面单"),!1;var P=y(s),d=st[i],c=[];t.map((function(t){var e=d(t);c.push(e)})),Promise.all(c).then((function(t){rt(t,P,e)})).catch((function(){e("打印数据转化失败")}))}}();
|