WIN-B904R0U0NNS\Administrator 2 år sedan
förälder
incheckning
3c25546476

+ 311 - 0
src/utils/lodop/LodopFuncs.js

@@ -0,0 +1,311 @@
+// //==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序==
+//
+// //用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占:
+// var MainJS ="CLodopfuncs.js",
+//     URL_WS1   = "ws://localhost:8000/"+MainJS,                //ws用8000/18000
+//     URL_WS2   = "ws://localhost:18000/"+MainJS,
+//     URL_HTTP1 = "http://localhost:8000/"+MainJS,              //http用8000/18000
+//     URL_HTTP2 = "http://localhost:18000/"+MainJS,
+//     URL_HTTP3 = "https://localhost.lodop.net:8443/"+MainJS;   //https用8000/8443
+//
+// var CreatedOKLodopObject, CLodopIsLocal, LoadJsState;
+//
+// //==判断是否需要CLodop(那些不支持插件的浏览器):==
+// function needCLodop() {
+//     try {
+//         var ua = navigator.userAgent;
+//         if (ua.match(/Windows\sPhone/i) ||
+//             ua.match(/iPhone|iPod|iPad/i) ||
+//             ua.match(/Android/i) ||
+//             ua.match(/Edge\D?\d+/i))
+//             return true;
+//         var verTrident = ua.match(/Trident\D?\d+/i);
+//         var verIE = ua.match(/MSIE\D?\d+/i);
+//         var verOPR = ua.match(/OPR\D?\d+/i);
+//         var verFF = ua.match(/Firefox\D?\d+/i);
+//         var x64 = ua.match(/x64/i);
+//         if ((!verTrident) && (!verIE) && (x64)) return true;
+//         else if (verFF) {
+//             verFF = verFF[0].match(/\d+/);
+//             if ((verFF[0] >= 41) || (x64)) return true;
+//         } else if (verOPR) {
+//             verOPR = verOPR[0].match(/\d+/);
+//             if (verOPR[0] >= 32) return true;
+//         } else if ((!verTrident) && (!verIE)) {
+//             var verChrome = ua.match(/Chrome\D?\d+/i);
+//             if (verChrome) {
+//                 verChrome = verChrome[0].match(/\d+/);
+//                 if (verChrome[0] >= 41) return true;
+//             }
+//         }
+//         return false;
+//     } catch (err) {
+//         return true;
+//     }
+// }
+//
+// //==检查加载成功与否,如没成功则用http(s)再试==
+// //==低版本CLODOP6.561/Lodop7.043及前)用本方法==
+// function checkOrTryHttp() {
+//   if (window.getCLodop) {
+//      LoadJsState = "complete";
+//      return true;
+//   }
+//   if (LoadJsState == "loadingB" || LoadJsState == "complete") return;
+//   LoadJsState = "loadingB";
+//   var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
+//   var JS1 = document.createElement("script")
+//      ,JS2 = document.createElement("script")
+//      ,JS3 = document.createElement("script");
+//   JS1.src = URL_HTTP1;
+//   JS2.src = URL_HTTP2;
+//   JS3.src = URL_HTTP3;
+//   JS1.onload = JS2.onload = JS3.onload = JS2.onerror = JS3.onerror=function(){LoadJsState = "complete";}
+//   JS1.onerror = function(e) {
+//       if (window.location.protocol !== 'https:')
+//           head.insertBefore(JS2, head.firstChild); else
+//           head.insertBefore(JS3, head.firstChild);
+//   }
+//   head.insertBefore(JS1,head.firstChild);
+// }
+//
+// //==加载Lodop对象的主过程:==
+// (function loadCLodop(){
+//   if (!needCLodop()) return;
+//   CLodopIsLocal = !!((URL_WS1 + URL_WS2).match(/\/\/localho|\/\/127.0.0./i));
+//   LoadJsState = "loadingA";
+//   if (!window.WebSocket && window.MozWebSocket) window.WebSocket=window.MozWebSocket;
+//   //ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新:
+//   try {
+//     var WSK1=new WebSocket(URL_WS1);
+//     WSK1.onopen = function(e) { setTimeout("checkOrTryHttp();",200); }
+//     WSK1.onmessage = function(e) {if (!window.getCLodop) eval(e.data);}
+//     WSK1.onerror = function(e) {
+//          var WSK2=new WebSocket(URL_WS2);
+//          WSK2.onopen = function(e) {setTimeout("checkOrTryHttp();",200);}
+//          WSK2.onmessage = function(e) {if (!window.getCLodop) eval(e.data);}
+//          WSK2.onerror= function(e) {checkOrTryHttp();}
+//     }
+//   } catch(e){
+//     checkOrTryHttp();
+//   }
+// })();
+//
+// //==获取LODOP对象主过程,判断是否安装、需否升级:==
+// function getLodop(oOBJECT, oEMBED) {
+//     var strFontTag = "<br><font color='#FF00FF'>打印控件";
+//     var strLodopInstall = strFontTag + "未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
+//     var strLodopUpdate = strFontTag + "需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
+//     var strLodop64Install = strFontTag + "未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
+//     var strLodop64Update = strFontTag + "需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
+//     var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
+//     var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
+//     var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
+//     var strLodop7FontTag = "<br><font color='#FF00FF'>Web打印服务Lodop7";
+//     var strLodop7HrefX86 = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
+//     var strLodop7HrefARM = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz'  target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
+//     var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86;
+//     var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM;
+//     var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86;
+//     var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM;
+//     var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
+//     var LODOP;
+//     try {
+//         var isWinIE = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent));
+//         var isWinIE64 = isWinIE && (/x64/i.test(navigator.userAgent));
+//         var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform));
+//         var isLinuxARM = (/Linux/i.test(navigator.platform)) && (/aarch/i.test(navigator.platform));
+//
+//         if (needCLodop() || isLinuxX86 || isLinuxARM) {
+//             try {
+//                 LODOP = window.getCLodop();
+//             } catch (err) {}
+//             if (!LODOP && LoadJsState !== "complete") {
+//                 if (!LoadJsState)
+//                     alert("未曾加载Lodop主JS文件,请先调用loadCLodop过程."); else
+//                     alert("网页还没下载完毕,请稍等一下再操作.");
+//                 return;
+//             }
+//             var strAlertMessage;
+//             if (!LODOP) {
+//                 if (isLinuxX86)
+//                     strAlertMessage = strLodop7Install_X86;
+//                 else if (isLinuxARM)
+//                     strAlertMessage = strLodop7Install_ARM;
+//                 else
+//                     strAlertMessage = strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : "");
+//                 document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
+//                 return;
+//             } else {
+//                 if (isLinuxX86 && LODOP.CVERSION < "7.0.4.3")
+//                     strAlertMessage = strLodop7Update_X86;
+//                 else if (isLinuxARM && LODOP.CVERSION < "7.0.4.3")
+//                     strAlertMessage = strLodop7Update_ARM;
+//                 else if (CLODOP.CVERSION < "6.5.7.1")
+//                     strAlertMessage = strCLodopUpdate;
+//
+//                 if (strAlertMessage)
+//                     document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
+//             }
+//         } else {
+//             //==如果页面有Lodop插件就直接使用,否则新建:==
+//             if (oOBJECT || oEMBED) {
+//                 if (isWinIE)
+//                     LODOP = oOBJECT;
+//                 else
+//                     LODOP = oEMBED;
+//             } else if (!CreatedOKLodopObject) {
+//                 LODOP = document.createElement("object");
+//                 LODOP.setAttribute("width", 0);
+//                 LODOP.setAttribute("height", 0);
+//                 LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
+//                 if (isWinIE)
+//                     LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
+//                 else
+//                     LODOP.setAttribute("type", "application/x-print-lodop");
+//                 document.documentElement.appendChild(LODOP);
+//                 CreatedOKLodopObject = LODOP;
+//             } else
+//                 LODOP = CreatedOKLodopObject;
+//             //==Lodop插件未安装时提示下载地址:==
+//             if ((!LODOP) || (!LODOP.VERSION)) {
+//                 document.body.innerHTML = (isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK + document.body.innerHTML;
+//                 return LODOP;
+//             }
+//             if (LODOP.VERSION < "6.2.2.6") {
+//                 document.body.innerHTML = (isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK + document.body.innerHTML;
+//             }
+//         }
+//         //===如下空白位置适合调用统一功能(如注册语句、语言选择等):=======================
+//
+//
+//         //===============================================================================
+//         return LODOP;
+//     } catch (err) {
+//         alert("getLodop出错:" + err);
+//     }
+// }
+//
+var CreatedOKLodop7766=null;
+
+//====判断是否需要安装CLodop云打印服务器:====
+export function needCLodop(){
+    try{
+        var ua=navigator.userAgent;
+        if (ua.match(/Windows\sPhone/i) !=null) return true;
+        if (ua.match(/iPhone|iPod/i) != null) return true;
+        if (ua.match(/Android/i) != null) return true;
+        if (ua.match(/Edge\D?\d+/i) != null) return true;
+
+        var verTrident=ua.match(/Trident\D?\d+/i);
+        var verIE=ua.match(/MSIE\D?\d+/i);
+        var verOPR=ua.match(/OPR\D?\d+/i);
+        var verFF=ua.match(/Firefox\D?\d+/i);
+        var x64=ua.match(/x64/i);
+        if ((verTrident==null)&&(verIE==null)&&(x64!==null))
+            return true; else
+        if ( verFF !== null) {
+            verFF = verFF[0].match(/\d+/);
+            if ((verFF[0]>= 42)||(x64!==null)) return true;
+        } else
+        if ( verOPR !== null) {
+            verOPR = verOPR[0].match(/\d+/);
+            if ( verOPR[0] >= 32 ) return true;
+        } else
+        if ((verTrident==null)&&(verIE==null)) {
+            var verChrome=ua.match(/Chrome\D?\d+/i);
+            if ( verChrome !== null ) {
+                verChrome = verChrome[0].match(/\d+/);
+                if (verChrome[0]>=42) return true;
+            };
+        };
+        return false;
+    } catch(err) {return true;};
+};
+
+//====页面引用CLodop云打印必须的JS文件:====
+if (needCLodop()) {
+    var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
+    var oscript = document.createElement("script");
+    oscript.src ="http://localhost:8000/CLodopfuncs.js?priority=1";
+    head.insertBefore( oscript,head.firstChild );
+
+    //引用双端口(8000和18000)避免其中某个被占用:
+    oscript = document.createElement("script");
+    oscript.src ="http://localhost:18000/CLodopfuncs.js?priority=0";
+    head.insertBefore( oscript,head.firstChild );
+};
+
+//====获取LODOP对象的主过程:====
+export function getLodop(oOBJECT,oEMBED){
+    var strHtmInstall="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtmUpdate="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtm64_Install="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtm64_Update="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtmFireFox="<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
+    var strHtmChrome="<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
+    var strCLodopInstall="<br><font color='#FF00FF'>CLodop云打印服务(localhost本地)未安装启动!点击这里<a href='http://www.c-lodop.com/download/CLodop_Setup_for_Win32NT_https_3.008Extend.zip' target='_self'>执行安装</a>,安装后请刷新页面。</font>";
+    var strCLodopUpdate="<br><font color='#FF00FF'>CLodop云打印服务需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。</font>";
+    var LODOP;
+    try{
+        var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
+        if (needCLodop()) {
+            try{ LODOP=getCLodop();} catch(err) {};
+            if (!LODOP && document.readyState!=="complete") {alert("C-Lodop没准备好,请稍后再试!"); return;};
+            if (!LODOP) {
+                // if (isIE) document.write(strCLodopInstall); else
+                // document.documentElement.innerHTML=strCLodopInstall+document.documentElement.innerHTML;
+                // return;
+            } else {
+
+                if (CLODOP.CVERSION<"3.0.0.2") {
+                    if (isIE) document.write(strCLodopUpdate); else
+                        document.documentElement.innerHTML=strCLodopUpdate+document.documentElement.innerHTML;
+                };
+                if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED);
+                if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT);
+            };
+        } else {
+            var is64IE  = isIE && (navigator.userAgent.indexOf('x64')>=0);
+            //=====如果页面有Lodop就直接使用,没有则新建:==========
+            if (oOBJECT!=undefined || oEMBED!=undefined) {
+                if (isIE) LODOP=oOBJECT; else  LODOP=oEMBED;
+            } else if (CreatedOKLodop7766==null){
+                LODOP=document.createElement("object");
+                LODOP.setAttribute("width",0);
+                LODOP.setAttribute("height",0);
+                LODOP.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;");
+                if (isIE) LODOP.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
+                else LODOP.setAttribute("type","application/x-print-lodop");
+                document.documentElement.appendChild(LODOP);
+                CreatedOKLodop7766=LODOP;
+            } else LODOP=CreatedOKLodop7766;
+            //=====Lodop插件未安装时提示下载地址:==========
+            if ((LODOP==null)||(typeof(LODOP.VERSION)=="undefined")) {
+                if (navigator.userAgent.indexOf('Chrome')>=0)
+                    document.documentElement.innerHTML=strHtmChrome+document.documentElement.innerHTML;
+                if (navigator.userAgent.indexOf('Firefox')>=0)
+                    document.documentElement.innerHTML=strHtmFireFox+document.documentElement.innerHTML;
+                if (is64IE) document.write(strHtm64_Install); else
+                if (isIE)   document.write(strHtmInstall);    else
+                    document.documentElement.innerHTML=strHtmInstall+document.documentElement.innerHTML;
+                return LODOP;
+            };
+        };
+        if (LODOP.VERSION<"6.0") {
+            if (!needCLodop()){
+                if (is64IE) document.write(strHtm64_Update); else
+                if (isIE) document.write(strHtmUpdate); else
+                    document.documentElement.innerHTML=strHtmUpdate+document.documentElement.innerHTML;
+            };
+            return LODOP;
+        };
+        //===如下空白位置适合调用统一功能(如注册语句、语言选择等):===
+        //LODOP.SET_LICENSES("北京XXXXX公司","8xxxxxxxxxxxxx5","","");
+
+        //===========================================================
+        return LODOP;
+    } catch(err) {alert("getLodop出错:"+err);};
+};
+
+

+ 97 - 0
src/utils/lodop/print.css

@@ -0,0 +1,97 @@
+/*
+|--------------------------------------------------------------------------
+| Modules
+|--------------------------------------------------------------------------
+*/
+/*
+|--------------------------------------------------------------------------
+| Aliases
+|--------------------------------------------------------------------------
+*/
+/*
+|--------------------------------------------------------------------------
+| Partials
+|--------------------------------------------------------------------------
+*/
+.printModal {
+  font-family: sans-serif;
+  display: flex;
+  text-align: center;
+  font-weight: 300;
+  font-size: 30px;
+  left: 0;
+  top: 0;
+  position: absolute;
+  color: #045fb4;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(255, 255, 255, 0.9); }
+
+/*
+|--------------------------------------------------------------------------
+| Close Button
+|--------------------------------------------------------------------------
+*/
+.printClose {
+  position: absolute;
+  right: 10px;
+  top: 10px; }
+
+.printClose:before {
+  content: "\00D7";
+  font-family: "Helvetica Neue", sans-serif;
+  font-weight: 100;
+  line-height: 1px;
+  padding-top: 0.5em;
+  display: block;
+  font-size: 2em;
+  text-indent: 1px;
+  overflow: hidden;
+  height: 1.25em;
+  width: 1.25em;
+  text-align: center;
+  cursor: pointer; }
+
+.printSpinner {
+  margin-top: 3px;
+  margin-left: -40px;
+  position: absolute;
+  display: inline-block;
+  width: 25px;
+  height: 25px;
+  border: 2px solid #045fb4;
+  border-radius: 50%;
+  animation: spin 0.75s infinite linear; }
+
+.printSpinner::before, .printSpinner::after {
+  left: -2px;
+  top: -2px;
+  display: none;
+  position: absolute;
+  content: '';
+  width: inherit;
+  height: inherit;
+  border: inherit;
+  border-radius: inherit; }
+
+.printSpinner, .printSpinner::before, .printSpinner::after {
+  display: inline-block;
+  border-color: transparent;
+  border-top-color: #045fb4;
+  animation-duration: 1.2s; }
+
+.printSpinner::before {
+  transform: rotate(120deg); }
+
+.printSpinner::after {
+  transform: rotate(240deg); }
+
+/* Keyframes for the animation */
+@keyframes spin {
+  from {
+    transform: rotate(0deg); }
+  to {
+    transform: rotate(360deg); } }
+
+
+/*# sourceMappingURL=print.map*/

+ 992 - 0
src/utils/lodop/print.js

@@ -0,0 +1,992 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory();
+	else if(typeof define === 'function' && define.amd)
+		define([], factory);
+	else if(typeof exports === 'object')
+		exports["printJS"] = factory();
+	else
+		root["printJS"] = factory();
+})(window, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ 	// The module cache
+/******/ 	var installedModules = {};
+/******/
+/******/ 	// The require function
+/******/ 	function __webpack_require__(moduleId) {
+/******/
+/******/ 		// Check if module is in cache
+/******/ 		if(installedModules[moduleId]) {
+/******/ 			return installedModules[moduleId].exports;
+/******/ 		}
+/******/ 		// Create a new module (and put it into the cache)
+/******/ 		var module = installedModules[moduleId] = {
+/******/ 			i: moduleId,
+/******/ 			l: false,
+/******/ 			exports: {}
+/******/ 		};
+/******/
+/******/ 		// Execute the module function
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ 		// Flag the module as loaded
+/******/ 		module.l = true;
+/******/
+/******/ 		// Return the exports of the module
+/******/ 		return module.exports;
+/******/ 	}
+/******/
+/******/
+/******/ 	// expose the modules object (__webpack_modules__)
+/******/ 	__webpack_require__.m = modules;
+/******/
+/******/ 	// expose the module cache
+/******/ 	__webpack_require__.c = installedModules;
+/******/
+/******/ 	// define getter function for harmony exports
+/******/ 	__webpack_require__.d = function(exports, name, getter) {
+/******/ 		if(!__webpack_require__.o(exports, name)) {
+/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ 		}
+/******/ 	};
+/******/
+/******/ 	// define __esModule on exports
+/******/ 	__webpack_require__.r = function(exports) {
+/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ 		}
+/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
+/******/ 	};
+/******/
+/******/ 	// create a fake namespace object
+/******/ 	// mode & 1: value is a module id, require it
+/******/ 	// mode & 2: merge all properties of value into the ns
+/******/ 	// mode & 4: return value when already ns object
+/******/ 	// mode & 8|1: behave like require
+/******/ 	__webpack_require__.t = function(value, mode) {
+/******/ 		if(mode & 1) value = __webpack_require__(value);
+/******/ 		if(mode & 8) return value;
+/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ 		var ns = Object.create(null);
+/******/ 		__webpack_require__.r(ns);
+/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ 		return ns;
+/******/ 	};
+/******/
+/******/ 	// getDefaultExport function for compatibility with non-harmony modules
+/******/ 	__webpack_require__.n = function(module) {
+/******/ 		var getter = module && module.__esModule ?
+/******/ 			function getDefault() { return module['default']; } :
+/******/ 			function getModuleExports() { return module; };
+/******/ 		__webpack_require__.d(getter, 'a', getter);
+/******/ 		return getter;
+/******/ 	};
+/******/
+/******/ 	// Object.prototype.hasOwnProperty.call
+/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ 	// __webpack_public_path__
+/******/ 	__webpack_require__.p = "";
+/******/
+/******/
+/******/ 	// Load entry module and return exports
+/******/ 	return __webpack_require__(__webpack_require__.s = 0);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ "./src/index.js":
+/*!**********************!*\
+  !*** ./src/index.js ***!
+  \**********************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _sass_index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sass/index.scss */ "./src/sass/index.scss");
+/* harmony import */ var _sass_index_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_sass_index_scss__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _js_init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./js/init */ "./src/js/init.js");
+
+
+var printJS = _js_init__WEBPACK_IMPORTED_MODULE_1__["default"].init;
+
+if (typeof window !== 'undefined') {
+  window.printJS = printJS;
+}
+
+/* harmony default export */ __webpack_exports__["default"] = (printJS);
+
+/***/ }),
+
+/***/ "./src/js/browser.js":
+/*!***************************!*\
+  !*** ./src/js/browser.js ***!
+  \***************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+var Browser = {
+  // Firefox 1.0+
+  isFirefox: function isFirefox() {
+    return typeof InstallTrigger !== 'undefined';
+  },
+  // Internet Explorer 6-11
+  isIE: function isIE() {
+    return navigator.userAgent.indexOf('MSIE') !== -1 || !!document.documentMode;
+  },
+  // Edge 20+
+  isEdge: function isEdge() {
+    return !Browser.isIE() && !!window.StyleMedia;
+  },
+  // Chrome 1+
+  isChrome: function isChrome() {
+    var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
+    return !!context.chrome;
+  },
+  // At least Safari 3+: "[object HTMLElementConstructor]"
+  isSafari: function isSafari() {
+    return Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 || navigator.userAgent.toLowerCase().indexOf('safari') !== -1;
+  },
+  // IOS Chrome
+  isIOSChrome: function isIOSChrome() {
+    return navigator.userAgent.toLowerCase().indexOf('crios') !== -1;
+  }
+};
+/* harmony default export */ __webpack_exports__["default"] = (Browser);
+
+/***/ }),
+
+/***/ "./src/js/functions.js":
+/*!*****************************!*\
+  !*** ./src/js/functions.js ***!
+  \*****************************/
+/*! exports provided: addWrapper, capitalizePrint, collectStyles, addHeader, cleanUp, isRawHTML */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addWrapper", function() { return addWrapper; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "capitalizePrint", function() { return capitalizePrint; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "collectStyles", function() { return collectStyles; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addHeader", function() { return addHeader; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanUp", function() { return cleanUp; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRawHTML", function() { return isRawHTML; });
+/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modal */ "./src/js/modal.js");
+/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser */ "./src/js/browser.js");
+function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+
+
+function addWrapper(htmlData, params) {
+  var bodyStyle = 'font-family:' + params.font + ' !important; font-size: ' + params.font_size + ' !important; width:100%;';
+  return '<div style="' + bodyStyle + '">' + htmlData + '</div>';
+}
+function capitalizePrint(obj) {
+  return obj.charAt(0).toUpperCase() + obj.slice(1);
+}
+function collectStyles(element, params) {
+  var win = document.defaultView || window; // String variable to hold styling for each element
+
+  var elementStyle = ''; // Loop over computed styles
+
+  var styles = win.getComputedStyle(element, '');
+
+  for (var key = 0; key < styles.length; key++) {
+    // Check if style should be processed
+    if (params.targetStyles.indexOf('*') !== -1 || params.targetStyle.indexOf(styles[key]) !== -1 || targetStylesMatch(params.targetStyles, styles[key])) {
+      if (styles.getPropertyValue(styles[key])) elementStyle += styles[key] + ':' + styles.getPropertyValue(styles[key]) + ';';
+    }
+  } // Print friendly defaults (deprecated)
+
+
+  // elementStyle += 'max-width: ' + params.maxWidth + 'px !important; font-size: ' + params.font_size + ' !important;';
+  elementStyle += 'max-width: ' + params.maxWidth + 'px !important;'; //解决print.js 不能修改font_size属性问题
+  return elementStyle;
+}
+
+function targetStylesMatch(styles, value) {
+  for (var i = 0; i < styles.length; i++) {
+    if (_typeof(value) === 'object' && value.indexOf(styles[i]) !== -1) return true;
+  }
+
+  return false;
+}
+
+function addHeader(printElement, params) {
+  // Create the header container div
+  var headerContainer = document.createElement('div'); // Check if the header is text or raw html
+
+  if (isRawHTML(params.header)) {
+    headerContainer.innerHTML = params.header;
+  } else {
+    // Create header element
+    var headerElement = document.createElement('h1'); // Create header text node
+
+    var headerNode = document.createTextNode(params.header); // Build and style
+
+    headerElement.appendChild(headerNode);
+    headerElement.setAttribute('style', params.headerStyle);
+    headerContainer.appendChild(headerElement);
+  }
+
+  printElement.insertBefore(headerContainer, printElement.childNodes[0]);
+}
+function cleanUp(params) {
+  // If we are showing a feedback message to user, remove it
+  if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_0__["default"].close(); // Check for a finished loading hook function
+
+  if (params.onLoadingEnd) params.onLoadingEnd(); // If preloading pdf files, clean blob url
+
+  if (params.showModal || params.onLoadingStart) window.URL.revokeObjectURL(params.printable); // Run onPrintDialogClose callback
+
+  var event = 'mouseover';
+
+  if (_browser__WEBPACK_IMPORTED_MODULE_1__["default"].isChrome() || _browser__WEBPACK_IMPORTED_MODULE_1__["default"].isFirefox()) {
+    // Ps.: Firefox will require an extra click in the document to fire the focus event.
+    event = 'focus';
+  }
+
+  var handler = function handler() {
+    // Make sure the event only happens once.
+    window.removeEventListener(event, handler);
+    params.onPrintDialogClose(); // Remove iframe from the DOM
+
+    var iframe = document.getElementById(params.frameId);
+
+    if (iframe) {
+      iframe.remove();
+    }
+  };
+
+  window.addEventListener(event, handler);
+}
+function isRawHTML(raw) {
+  var regexHtml = new RegExp('<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>');
+  return regexHtml.test(raw);
+}
+
+/***/ }),
+
+/***/ "./src/js/html.js":
+/*!************************!*\
+  !*** ./src/js/html.js ***!
+  \************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ "./src/js/functions.js");
+/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ "./src/js/print.js");
+function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+
+
+/* harmony default export */ __webpack_exports__["default"] = ({
+  print: function print(params, printFrame) {
+    // Get the DOM printable element
+    var printElement = isHtmlElement(params.printable) ? params.printable : document.getElementById(params.printable); // Check if the element exists
+
+    if (!printElement) {
+      window.console.error('Invalid HTML element id: ' + params.printable);
+      return;
+    } // Clone the target element including its children (if available)
+
+
+    params.printableElement = cloneElement(printElement, params); // Add header
+
+    if (params.header) {
+      Object(_functions__WEBPACK_IMPORTED_MODULE_0__["addHeader"])(params.printableElement, params);
+    } // Print html element contents
+
+
+    _print__WEBPACK_IMPORTED_MODULE_1__["default"].send(params, printFrame);
+  }
+});
+
+function cloneElement(element, params) {
+  // Clone the main node (if not already inside the recursion process)
+  var clone = element.cloneNode(); // Loop over and process the children elements / nodes (including text nodes)
+
+  var childNodesArray = Array.prototype.slice.call(element.childNodes);
+
+  for (var i = 0; i < childNodesArray.length; i++) {
+    // Check if we are skipping the current element
+    if (params.ignoreElements.indexOf(childNodesArray[i].id) !== -1) {
+      continue;
+    } // Clone the child element
+
+
+    var clonedChild = cloneElement(childNodesArray[i], params); // Attach the cloned child to the cloned parent node
+
+    clone.appendChild(clonedChild);
+  } // Get all styling for print element (for nodes of type element only)
+
+
+  if (params.scanStyles && element.nodeType === 1) {
+    clone.setAttribute('style', Object(_functions__WEBPACK_IMPORTED_MODULE_0__["collectStyles"])(element, params));
+  } // Check if the element needs any state processing (copy user input data)
+
+
+  switch (element.tagName) {
+    case 'SELECT':
+      // Copy the current selection value to its clone
+      clone.value = element.value;
+      break;
+
+    case 'CANVAS':
+      // Copy the canvas content to its clone
+      clone.getContext('2d').drawImage(element, 0, 0);
+      break;
+  }
+
+  return clone;
+}
+
+function isHtmlElement(printable) {
+  // Check if element is instance of HTMLElement or has nodeType === 1 (for elements in iframe)
+  return _typeof(printable) === 'object' && printable && (printable instanceof HTMLElement || printable.nodeType === 1);
+}
+
+/***/ }),
+
+/***/ "./src/js/image.js":
+/*!*************************!*\
+  !*** ./src/js/image.js ***!
+  \*************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ "./src/js/functions.js");
+/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ "./src/js/print.js");
+/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser */ "./src/js/browser.js");
+
+
+
+/* harmony default export */ __webpack_exports__["default"] = ({
+  print: function print(params, printFrame) {
+    // Check if we are printing one image or multiple images
+    if (params.printable.constructor !== Array) {
+      // Create array with one image
+      params.printable = [params.printable];
+    } // Create printable element (container)
+
+
+    params.printableElement = document.createElement('div'); // Create all image elements and append them to the printable container
+
+    params.printable.forEach(function (src) {
+      // Create the image element
+      var img = document.createElement('img');
+      img.setAttribute('style', params.imageStyle); // Set image src with the file url
+
+      img.src = src; // The following block is for Firefox, which for some reason requires the image's src to be fully qualified in
+      // order to print it
+
+      if (_browser__WEBPACK_IMPORTED_MODULE_2__["default"].isFirefox()) {
+        var fullyQualifiedSrc = img.src;
+        img.src = fullyQualifiedSrc;
+      } // Create the image wrapper
+
+
+      var imageWrapper = document.createElement('div'); // Append image to the wrapper element
+
+      imageWrapper.appendChild(img); // Append wrapper to the printable element
+
+      params.printableElement.appendChild(imageWrapper);
+    }); // Check if we are adding a print header
+
+    if (params.header) Object(_functions__WEBPACK_IMPORTED_MODULE_0__["addHeader"])(params.printableElement, params); // Print image
+
+    _print__WEBPACK_IMPORTED_MODULE_1__["default"].send(params, printFrame);
+  }
+});
+
+/***/ }),
+
+/***/ "./src/js/init.js":
+/*!************************!*\
+  !*** ./src/js/init.js ***!
+  \************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser */ "./src/js/browser.js");
+/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modal */ "./src/js/modal.js");
+/* harmony import */ var _pdf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pdf */ "./src/js/pdf.js");
+/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./html */ "./src/js/html.js");
+/* harmony import */ var _raw_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./raw-html */ "./src/js/raw-html.js");
+/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./image */ "./src/js/image.js");
+/* harmony import */ var _json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./json */ "./src/js/json.js");
+
+
+function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+
+
+
+
+
+
+
+var printTypes = ['pdf', 'html', 'image', 'json', 'raw-html'];
+/* harmony default export */ __webpack_exports__["default"] = ({
+  init: function init() {
+    var params = {
+      printable: null,
+      fallbackPrintable: null,
+      type: 'pdf',
+      header: null,
+      headerStyle: 'font-weight: 300;',
+      maxWidth: 800,
+      properties: null,
+      gridHeaderStyle: 'font-weight: bold; padding: 5px; border: 1px solid #dddddd;',
+      gridStyle: 'border: 1px solid lightgray; margin-bottom: -1px;',
+      showModal: false,
+      onError: function onError(error) {
+        throw error;
+      },
+      onLoadingStart: null,
+      onLoadingEnd: null,
+      onPrintDialogClose: function onPrintDialogClose() {},
+      onIncompatibleBrowser: function onIncompatibleBrowser() {},
+      modalMessage: 'Retrieving Document...',
+      frameId: 'printJS',
+      printableElement: null,
+      documentTitle: 'Document',
+      targetStyle: ['clear', 'display', 'width', 'min-width', 'height', 'min-height', 'max-height'],
+      targetStyles: ['border', 'box', 'break', 'text-decoration'],
+      ignoreElements: [],
+      repeatTableHeader: true,
+      css: null,
+      style: null,
+      scanStyles: true,
+      base64: false,
+      // Deprecated
+      onPdfOpen: null,
+      font: 'TimesNewRoman',
+      font_size: '12pt',
+      honorMarginPadding: true,
+      honorColor: false,
+      imageStyle: 'max-width: 100%;'
+    }; // Check if a printable document or object was supplied
+
+    var args = arguments[0];
+
+    if (args === undefined) {
+      throw new Error('printJS expects at least 1 attribute.');
+    } // Process parameters
+
+
+    switch (_typeof(args)) {
+      case 'string':
+        params.printable = encodeURI(args);
+        params.fallbackPrintable = params.printable;
+        params.type = arguments[1] || params.type;
+        break;
+
+      case 'object':
+        params.printable = args.printable;
+        params.fallbackPrintable = typeof args.fallbackPrintable !== 'undefined' ? args.fallbackPrintable : params.printable;
+        params.fallbackPrintable = params.base64 ? "data:application/pdf;base64,".concat(params.fallbackPrintable) : params.fallbackPrintable;
+
+        for (var k in params) {
+          if (k === 'printable' || k === 'fallbackPrintable') continue;
+          params[k] = typeof args[k] !== 'undefined' ? args[k] : params[k];
+        }
+
+        break;
+
+      default:
+        throw new Error('Unexpected argument type! Expected "string" or "object", got ' + _typeof(args));
+    } // Validate printable
+
+
+    if (!params.printable) throw new Error('Missing printable information.'); // Validate type
+
+    if (!params.type || typeof params.type !== 'string' || printTypes.indexOf(params.type.toLowerCase()) === -1) {
+      throw new Error('Invalid print type. Available types are: pdf, html, image and json.');
+    } // Check if we are showing a feedback message to the user (useful for large files)
+
+
+    if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_1__["default"].show(params); // Check for a print start hook function
+
+    if (params.onLoadingStart) params.onLoadingStart(); // To prevent duplication and issues, remove any used printFrame from the DOM
+
+    var usedFrame = document.getElementById(params.frameId);
+    if (usedFrame) usedFrame.parentNode.removeChild(usedFrame); // Create a new iframe for the print job
+
+    var printFrame = document.createElement('iframe');
+
+    if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isFirefox()) {
+      // Set the iframe to be is visible on the page (guaranteed by fixed position) but hidden using opacity 0, because
+      // this works in Firefox. The height needs to be sufficient for some part of the document other than the PDF
+      // viewer's toolbar to be visible in the page
+      printFrame.setAttribute('style', 'width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0');
+    } else {
+      // Hide the iframe in other browsers
+      printFrame.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute; border: 0');
+    } // Set iframe element id
+
+
+    printFrame.setAttribute('id', params.frameId); // For non pdf printing, pass an html document string to srcdoc (force onload callback)
+
+    if (params.type !== 'pdf') {
+      printFrame.srcdoc = '<html><head><title>' + params.documentTitle + '</title>'; // Attach css files
+
+      if (params.css) {
+        // Add support for single file
+        if (!Array.isArray(params.css)) params.css = [params.css]; // Create link tags for each css file
+
+        params.css.forEach(function (file) {
+          printFrame.srcdoc += '<link rel="stylesheet" href="' + file + '">';
+        });
+      }
+
+      printFrame.srcdoc += '</head><body></body></html>';
+    } // Check printable type
+
+
+    switch (params.type) {
+      case 'pdf':
+        // Check browser support for pdf and if not supported we will just open the pdf file instead
+        if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isIE()) {
+          try {
+            console.info('Print.js doesn\'t support PDF printing in Internet Explorer.');
+            var win = window.open(params.fallbackPrintable, '_blank');
+            win.focus();
+            params.onIncompatibleBrowser();
+          } catch (error) {
+            params.onError(error);
+          } finally {
+            // Make sure there is no loading modal opened
+            if (params.showModal) _modal__WEBPACK_IMPORTED_MODULE_1__["default"].close();
+            if (params.onLoadingEnd) params.onLoadingEnd();
+          }
+        } else {
+          _pdf__WEBPACK_IMPORTED_MODULE_2__["default"].print(params, printFrame);
+        }
+
+        break;
+
+      case 'image':
+        _image__WEBPACK_IMPORTED_MODULE_5__["default"].print(params, printFrame);
+        break;
+
+      case 'html':
+        _html__WEBPACK_IMPORTED_MODULE_3__["default"].print(params, printFrame);
+        break;
+
+      case 'raw-html':
+        _raw_html__WEBPACK_IMPORTED_MODULE_4__["default"].print(params, printFrame);
+        break;
+
+      case 'json':
+        _json__WEBPACK_IMPORTED_MODULE_6__["default"].print(params, printFrame);
+        break;
+    }
+  }
+});
+
+/***/ }),
+
+/***/ "./src/js/json.js":
+/*!************************!*\
+  !*** ./src/js/json.js ***!
+  \************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ "./src/js/functions.js");
+/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./print */ "./src/js/print.js");
+function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+
+
+/* harmony default export */ __webpack_exports__["default"] = ({
+  print: function print(params, printFrame) {
+    // Check if we received proper data
+    if (_typeof(params.printable) !== 'object') {
+      throw new Error('Invalid javascript data object (JSON).');
+    } // Validate repeatTableHeader
+
+
+    if (typeof params.repeatTableHeader !== 'boolean') {
+      throw new Error('Invalid value for repeatTableHeader attribute (JSON).');
+    } // Validate properties
+
+
+    if (!params.properties || !Array.isArray(params.properties)) {
+      throw new Error('Invalid properties array for your JSON data.');
+    } // We will format the property objects to keep the JSON api compatible with older releases
+
+
+    params.properties = params.properties.map(function (property) {
+      return {
+        field: _typeof(property) === 'object' ? property.field : property,
+        displayName: _typeof(property) === 'object' ? property.displayName : property,
+        columnSize: _typeof(property) === 'object' && property.columnSize ? property.columnSize + ';' : 100 / params.properties.length + '%;'
+      };
+    }); // Create a print container element
+
+    params.printableElement = document.createElement('div'); // Check if we are adding a print header
+
+    if (params.header) {
+      Object(_functions__WEBPACK_IMPORTED_MODULE_0__["addHeader"])(params.printableElement, params);
+    } // Build the printable html data
+
+
+    params.printableElement.innerHTML += jsonToHTML(params); // Print the json data
+
+    _print__WEBPACK_IMPORTED_MODULE_1__["default"].send(params, printFrame);
+  }
+});
+
+function jsonToHTML(params) {
+  // Get the row and column data
+  var data = params.printable;
+  var properties = params.properties; // Create a html table
+
+  var htmlData = '<table style="border-collapse: collapse; width: 100%;">'; // Check if the header should be repeated
+
+  if (params.repeatTableHeader) {
+    htmlData += '<thead>';
+  } // Add the table header row
+
+
+  htmlData += '<tr>'; // Add the table header columns
+
+  for (var a = 0; a < properties.length; a++) {
+    htmlData += '<th style="width:' + properties[a].columnSize + ';' + params.gridHeaderStyle + '">' + Object(_functions__WEBPACK_IMPORTED_MODULE_0__["capitalizePrint"])(properties[a].displayName) + '</th>';
+  } // Add the closing tag for the table header row
+
+
+  htmlData += '</tr>'; // If the table header is marked as repeated, add the closing tag
+
+  if (params.repeatTableHeader) {
+    htmlData += '</thead>';
+  } // Create the table body
+
+
+  htmlData += '<tbody>'; // Add the table data rows
+
+  for (var i = 0; i < data.length; i++) {
+    // Add the row starting tag
+    htmlData += '<tr>'; // Print selected properties only
+
+    for (var n = 0; n < properties.length; n++) {
+      var stringData = data[i]; // Support nested objects
+
+      var property = properties[n].field.split('.');
+
+      if (property.length > 1) {
+        for (var p = 0; p < property.length; p++) {
+          stringData = stringData[property[p]];
+        }
+      } else {
+        stringData = stringData[properties[n].field];
+      } // Add the row contents and styles
+
+
+      htmlData += '<td style="width:' + properties[n].columnSize + params.gridStyle + '">' + stringData + '</td>';
+    } // Add the row closing tag
+
+
+    htmlData += '</tr>';
+  } // Add the table and body closing tags
+
+
+  htmlData += '</tbody></table>';
+  return htmlData;
+}
+
+/***/ }),
+
+/***/ "./src/js/modal.js":
+/*!*************************!*\
+  !*** ./src/js/modal.js ***!
+  \*************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+var Modal = {
+  show: function show(params) {
+    // Build modal
+    var modalStyle = 'font-family:sans-serif; ' + 'display:table; ' + 'text-align:center; ' + 'font-weight:300; ' + 'font-size:30px; ' + 'left:0; top:0;' + 'position:fixed; ' + 'z-index: 9990;' + 'color: #0460B5; ' + 'width: 100%; ' + 'height: 100%; ' + 'background-color:rgba(255,255,255,.9);' + 'transition: opacity .3s ease;'; // Create wrapper
+
+    var printModal = document.createElement('div');
+    printModal.setAttribute('style', modalStyle);
+    printModal.setAttribute('id', 'printJS-Modal'); // Create content div
+
+    var contentDiv = document.createElement('div');
+    contentDiv.setAttribute('style', 'display:table-cell; vertical-align:middle; padding-bottom:100px;'); // Add close button (requires print.css)
+
+    var closeButton = document.createElement('div');
+    closeButton.setAttribute('class', 'printClose');
+    closeButton.setAttribute('id', 'printClose');
+    contentDiv.appendChild(closeButton); // Add spinner (requires print.css)
+
+    var spinner = document.createElement('span');
+    spinner.setAttribute('class', 'printSpinner');
+    contentDiv.appendChild(spinner); // Add message
+
+    var messageNode = document.createTextNode(params.modalMessage);
+    contentDiv.appendChild(messageNode); // Add contentDiv to printModal
+
+    printModal.appendChild(contentDiv); // Append print modal element to document body
+
+    document.getElementsByTagName('body')[0].appendChild(printModal); // Add event listener to close button
+
+    document.getElementById('printClose').addEventListener('click', function () {
+      Modal.close();
+    });
+  },
+  close: function close() {
+    var printModal = document.getElementById('printJS-Modal');
+
+    if (printModal) {
+      printModal.parentNode.removeChild(printModal);
+    }
+  }
+};
+/* harmony default export */ __webpack_exports__["default"] = (Modal);
+
+/***/ }),
+
+/***/ "./src/js/pdf.js":
+/*!***********************!*\
+  !*** ./src/js/pdf.js ***!
+  \***********************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./print */ "./src/js/print.js");
+/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./src/js/functions.js");
+
+
+/* harmony default export */ __webpack_exports__["default"] = ({
+  print: function print(params, printFrame) {
+    // Check if we have base64 data
+    if (params.base64) {
+      var bytesArray = Uint8Array.from(atob(params.printable), function (c) {
+        return c.charCodeAt(0);
+      });
+      createBlobAndPrint(params, printFrame, bytesArray);
+      return;
+    } // Format pdf url
+
+
+    params.printable = /^(blob|http|\/\/)/i.test(params.printable) ? params.printable : window.location.origin + (params.printable.charAt(0) !== '/' ? '/' + params.printable : params.printable); // Get the file through a http request (Preload)
+
+    var req = new window.XMLHttpRequest();
+    req.responseType = 'arraybuffer';
+    req.addEventListener('error', function () {
+      Object(_functions__WEBPACK_IMPORTED_MODULE_1__["cleanUp"])(params);
+      params.onError(req.statusText, req); // Since we don't have a pdf document available, we will stop the print job
+    });
+    req.addEventListener('load', function () {
+      // Check for errors
+      if ([200, 201].indexOf(req.status) === -1) {
+        Object(_functions__WEBPACK_IMPORTED_MODULE_1__["cleanUp"])(params);
+        params.onError(req.statusText, req); // Since we don't have a pdf document available, we will stop the print job
+
+        return;
+      } // Print requested document
+
+
+      createBlobAndPrint(params, printFrame, req.response);
+    });
+    req.open('GET', params.printable, true);
+    req.send();
+  }
+});
+
+function createBlobAndPrint(params, printFrame, data) {
+  // Pass response or base64 data to a blob and create a local object url
+  var localPdf = new window.Blob([data], {
+    type: 'application/pdf'
+  });
+  localPdf = window.URL.createObjectURL(localPdf); // Set iframe src with pdf document url
+
+  printFrame.setAttribute('src', localPdf);
+  _print__WEBPACK_IMPORTED_MODULE_0__["default"].send(params, printFrame);
+}
+
+/***/ }),
+
+/***/ "./src/js/print.js":
+/*!*************************!*\
+  !*** ./src/js/print.js ***!
+  \*************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser */ "./src/js/browser.js");
+/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./src/js/functions.js");
+
+
+var Print = {
+  send: function send(params, printFrame) {
+    // Append iframe element to document body
+    document.getElementsByTagName('body')[0].appendChild(printFrame); // Get iframe element
+
+    var iframeElement = document.getElementById(params.frameId); // Wait for iframe to load all content
+
+    iframeElement.onload = function () {
+      if (params.type === 'pdf') {
+        // Add a delay for Firefox. In my tests, 1000ms was sufficient but 100ms was not
+        if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isFirefox()) {
+          setTimeout(function () {
+            return performPrint(iframeElement, params);
+          }, 1000);
+        } else {
+          performPrint(iframeElement, params);
+        }
+
+        return;
+      } // Get iframe element document
+
+
+      var printDocument = iframeElement.contentWindow || iframeElement.contentDocument;
+      if (printDocument.document) printDocument = printDocument.document; // Append printable element to the iframe body
+
+      printDocument.body.appendChild(params.printableElement); // Add custom style
+
+      if (params.type !== 'pdf' && params.style) {
+        // Create style element
+        var style = document.createElement('style');
+        style.innerHTML = params.style; // Append style element to iframe's head
+
+        printDocument.head.appendChild(style);
+      } // If printing images, wait for them to load inside the iframe
+
+
+      var images = printDocument.getElementsByTagName('img');
+
+      if (images.length > 0) {
+        loadIframeImages(Array.from(images)).then(function () {
+          return performPrint(iframeElement, params);
+        });
+      } else {
+        performPrint(iframeElement, params);
+      }
+    };
+  }
+};
+
+function performPrint(iframeElement, params) {
+  try {
+    iframeElement.focus(); // If Edge or IE, try catch with execCommand
+
+    if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isEdge() || _browser__WEBPACK_IMPORTED_MODULE_0__["default"].isIE()) {
+      try {
+        iframeElement.contentWindow.document.execCommand('print', false, null);
+      } catch (e) {
+        iframeElement.contentWindow.print();
+      }
+    } else {
+      // Other browsers
+      iframeElement.contentWindow.print();
+    }
+  } catch (error) {
+    params.onError(error);
+  } finally {
+    if (_browser__WEBPACK_IMPORTED_MODULE_0__["default"].isFirefox()) {
+      // Move the iframe element off-screen and make it invisible
+      iframeElement.style.visibility = 'hidden';
+      iframeElement.style.left = '-1px';
+    }
+
+    Object(_functions__WEBPACK_IMPORTED_MODULE_1__["cleanUp"])(params);
+  }
+}
+
+function loadIframeImages(images) {
+  var promises = images.map(function (image) {
+    if (image.src && image.src !== window.location.href) {
+      return loadIframeImage(image);
+    }
+  });
+  return Promise.all(promises);
+}
+
+function loadIframeImage(image) {
+  return new Promise(function (resolve) {
+    var pollImage = function pollImage() {
+      !image || typeof image.naturalWidth === 'undefined' || image.naturalWidth === 0 || !image.complete ? setTimeout(pollImage, 500) : resolve();
+    };
+
+    pollImage();
+  });
+}
+
+/* harmony default export */ __webpack_exports__["default"] = (Print);
+
+/***/ }),
+
+/***/ "./src/js/raw-html.js":
+/*!****************************!*\
+  !*** ./src/js/raw-html.js ***!
+  \****************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./print */ "./src/js/print.js");
+
+/* harmony default export */ __webpack_exports__["default"] = ({
+  print: function print(params, printFrame) {
+    // Create printable element (container)
+    params.printableElement = document.createElement('div');
+    params.printableElement.setAttribute('style', 'width:100%'); // Set our raw html as the printable element inner html content
+
+    params.printableElement.innerHTML = params.printable; // Print html contents
+
+    _print__WEBPACK_IMPORTED_MODULE_0__["default"].send(params, printFrame);
+  }
+});
+
+/***/ }),
+
+/***/ "./src/sass/index.scss":
+/*!*****************************!*\
+  !*** ./src/sass/index.scss ***!
+  \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+// extracted by mini-css-extract-plugin
+
+/***/ }),
+
+/***/ 0:
+/*!****************************!*\
+  !*** multi ./src/index.js ***!
+  \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(/*! ./src/index.js */"./src/index.js");
+
+
+/***/ })
+
+/******/ })["default"];
+});
+//# sourceMappingURL=print.map

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
src/utils/lodop/print.min.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
src/utils/lodop/print.min.js


+ 1 - 1
src/views/settings/components/modules/printComponents/hotelEntryPrint.vue

@@ -1,7 +1,7 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="print-title">{{ storeInfo.name }}入库单</div>
-        <div v-if="sizeTypeClass == 'a5'">
+        <div v-if="sizeTypeClass == 'A5'">
             <div class="print-fee-info">
                 <div class="print-fee-item-wrapper">
                     <div class="print-fee-title">打印时间:</div>

+ 1 - 1
src/views/settings/components/modules/printComponents/hotelOutPrint.vue

@@ -1,7 +1,7 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="print-title">{{ storeInfo.name }}出库单</div>
-        <div v-if="sizeTypeClass == 'a5'">
+        <div v-if="sizeTypeClass == 'A5'">
             <div class="print-fee-info">
                 <div class="print-fee-item-wrapper">
                     <div class="print-fee-title">打印时间:</div>

+ 18 - 18
src/views/settings/components/modules/printComponents/incomePrint.vue

@@ -4,62 +4,62 @@
         <div class="print-no">NO.{{ feeInfo.no }}</div>
         <div class="print-fee-info">
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">姓名<span v-if="sizeTypeClass == 'a5'">/Name</span>:</div>
+                <div class="print-fee-title">姓名<span v-if="sizeTypeClass == 'A5'">/Name</span>:</div>
                 <div class="print-fee-value value-underline">{{ feeInfo.name }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">单号<span v-if="sizeTypeClass == 'a5'">/No</span>:</div>
+                <div class="print-fee-title">单号<span v-if="sizeTypeClass == 'A5'">/No</span>:</div>
                 <div class="print-fee-value value-underline">{{ feeInfo.no }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">房号<span v-if="sizeTypeClass == 'a5'">/RoomNo</span>:</div>
+                <div class="print-fee-title">房号<span v-if="sizeTypeClass == 'A5'">/RoomNo</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.roomName }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">证件<span v-if="sizeTypeClass == 'a5'">/CertNo</span>:</div>
+                <div class="print-fee-title">证件<span v-if="sizeTypeClass == 'A5'">/CertNo</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.certNo }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">来时<span v-if="sizeTypeClass == 'a5'">/CheckIn</span>:</div>
+                <div class="print-fee-title">来时<span v-if="sizeTypeClass == 'A5'">/CheckIn</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.arrivalTime }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'a5'">/Days</span>:</div>
+                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'A5'">/Days</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dayCount }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'a5'">/CheckOut</span>:</div>
+                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'A5'">/CheckOut</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dueOutTime }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'a5'">/Member</span>:</div>
+                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'A5'">/Member</span>:</div>
                 <div class="print-fee-value">{{ (feeInfo.isVip) }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">协议<span v-if="sizeTypeClass == 'a5'">/Company</span>:</div>
+                <div class="print-fee-title">协议<span v-if="sizeTypeClass == 'A5'">/Company</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contractInfo ? feeInfo.contractInfo.name : '无' }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">付款方式<span v-if="sizeTypeClass == 'a5'"></span>:</div>
+                <div class="print-fee-title">付款方式<span v-if="sizeTypeClass == 'A5'"></span>:</div>
                 <div class="print-fee-value">{{ feeInfo.payType }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">金额<span v-if="sizeTypeClass == 'a5'">/Money</span>:</div>
+                <div class="print-fee-title">金额<span v-if="sizeTypeClass == 'A5'">/Money</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.money }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">入住类型<span v-if="sizeTypeClass == 'a5'">/Pay Type</span>:</div>
+                <div class="print-fee-title">入住类型<span v-if="sizeTypeClass == 'A5'">/Pay Type</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.livingType }}</div>
             </div>
         </div>
 
         <div class="print-fees">
             <div class="print-fees-header fee-row">
-                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'a5'">/RoomNo</span></div>
-                <div class="fee-cell">科目<span v-if="sizeTypeClass == 'a5'">/Project</span></div>
-                <div class="fee-cell">收款<span v-if="sizeTypeClass == 'a5'">/Pay Amount</span></div>
-                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'a5'">/Cost</span></div>
-                <div class="fee-cell flex-3">支付方式<span v-if="sizeTypeClass == 'a5'">/Pay Type</span></div>
+                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'A5'">/RoomNo</span></div>
+                <div class="fee-cell">科目<span v-if="sizeTypeClass == 'A5'">/Project</span></div>
+                <div class="fee-cell">收款<span v-if="sizeTypeClass == 'A5'">/Pay Amount</span></div>
+                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'A5'">/Cost</span></div>
+                <div class="fee-cell flex-3">支付方式<span v-if="sizeTypeClass == 'A5'">/Pay Type</span></div>
             </div>
         </div>
 
@@ -79,7 +79,7 @@
 
         <pre style="white-space: pre-wrap;" class="print-def-content">{{ defContent }}</pre>
         <div class="print-fee-item-wrapper">
-            <div>贵宾签字<span v-if="sizeTypeClass == 'a5'">/Guest Signture</span>:</div>
+            <div>贵宾签字<span v-if="sizeTypeClass == 'A5'">/Guest Signture</span>:</div>
             <div class="print-fee-value value-underline"></div>
         </div>
         <div class="a5-partail">

+ 1 - 1
src/views/settings/components/modules/printComponents/memberChargePrint.vue

@@ -1,7 +1,7 @@
 <template>
     <div :class="sizeTypeClass">
         <div class="print-title">{{ storeInfo.name }}会员扣费单</div>
-        <div v-if="sizeTypeClass == 'a5'">
+        <div v-if="sizeTypeClass == 'A5'">
             <div class="print-fee-info">
                 <div class="print-fee-item-wrapper">
                     <div class="print-fee-title">姓名:</div>

+ 4 - 4
src/views/settings/components/modules/printComponents/refundPrint.vue

@@ -2,7 +2,7 @@
     <div :class="sizeTypeClass">
         <div class="print-title">{{ storeInfo.name }}退款单</div>
 <!--        <div class="print-no">NO.{{ feeInfo.no }}</div>-->
-        <div v-if="sizeTypeClass == 'a5'">
+        <div v-if="sizeTypeClass == 'A5'">
             <div class="print-fee-info">
                 <div class="print-fee-item-wrapper small-item">
                     <div class="print-fee-title">姓名:</div>
@@ -297,7 +297,7 @@
         }
     }
 </script>
-<style lang="less">
+<style lang="less" id="olstyle1">
     .mm58 {
         width: 58mm;
         border: 1px solid #00000055;
@@ -392,7 +392,7 @@
         display: flex;
         width: 100%;
         padding: 4px 0;
-        font-size: small;
+        font-size: 13px;
 
         .print-fee-title {
             width: 65px;
@@ -420,7 +420,7 @@
             color: black;
             flex: 1;
             margin: 0 3px;
-            font-size: smaller;
+            font-size: 13px;
             text-align: left;
         }
 

+ 2 - 2
src/views/settings/components/modules/printComponents/registrationPrint.vue

@@ -2,7 +2,7 @@
     <div :class="sizeTypeClass">
         <div class="content">
             <div class="print-title">{{ storeInfo.name }}登记单</div>
-            <div v-if="sizeTypeClass == 'a5'">
+            <div v-if="sizeTypeClass == 'A5'">
                 <div class="print-fee-info">
                     <div class="print-fee-item-wrapper row">
                         <div class="print-fee-value">单号:{{ feeInfo.no }} 登记人:{{ nickname() }} </div>
@@ -76,7 +76,7 @@
                 </div>
             </div>
             <div v-else>
-                <div v-if="sizeTypeClass == 'mm80'">
+                <div v-if="sizeTypeClass == '80mm'">
                     <div class="row">
                         <div class="flex-1">
                             <div class="print-fee-title">单号:</div>

+ 15 - 15
src/views/settings/components/modules/printComponents/settlePrint.vue

@@ -4,46 +4,46 @@
         <div class="print-no">NO.{{ feeInfo.no }}</div>
         <div class="print-fee-info">
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">姓名<span v-if="sizeTypeClass == 'a5'">/Name</span>:</div>
+                <div class="print-fee-title">姓名<span v-if="sizeTypeClass == 'A5'">/Name</span>:</div>
                 <div class="print-fee-value value-underline">{{ feeInfo.name }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">单号<span v-if="sizeTypeClass == 'a5'">/No</span>:</div>
+                <div class="print-fee-title">单号<span v-if="sizeTypeClass == 'A5'">/No</span>:</div>
                 <div class="print-fee-value value-underline">{{ feeInfo.no }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">房号<span v-if="sizeTypeClass == 'a5'">/RoomNo</span>:</div>
+                <div class="print-fee-title">房号<span v-if="sizeTypeClass == 'A5'">/RoomNo</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.roomName }}</div>
             </div>
             <div class="print-fee-item-wrapper ">
-                <div class="print-fee-title">来时<span v-if="sizeTypeClass == 'a5'">/CheckIn</span>:</div>
+                <div class="print-fee-title">来时<span v-if="sizeTypeClass == 'A5'">/CheckIn</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.arrivalTime }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'a5'">/Days</span>:</div>
+                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'A5'">/Days</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dayCount }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'a5'">/CheckOut</span>:</div>
+                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'A5'">/CheckOut</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dueOutTime }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'a5'">/Member</span>:</div>
+                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'A5'">/Member</span>:</div>
                 <div class="print-fee-value">{{ (feeInfo.isVip) }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">协议<span v-if="sizeTypeClass == 'a5'">/Company</span>:</div>
+                <div class="print-fee-title">协议<span v-if="sizeTypeClass == 'A5'">/Company</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contractInfo ? feeInfo.contractInfo.name : '无' }}</div>
             </div>
         </div>
 
         <div class="print-fees">
             <div class="print-fees-header fee-row">
-                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'a5'">/RoomNo</span></div>
-                <div class="fee-cell">科目<span v-if="sizeTypeClass == 'a5'">/Project</span></div>
-                <div class="fee-cell">收款<span v-if="sizeTypeClass == 'a5'">/Pay Amount</span></div>
-                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'a5'">/Cost</span></div>
-                <div class="fee-cell flex-3">支付方式<span v-if="sizeTypeClass == 'a5'">/Pay Type</span></div>
+                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'A5'">/RoomNo</span></div>
+                <div class="fee-cell">科目<span v-if="sizeTypeClass == 'A5'">/Project</span></div>
+                <div class="fee-cell">收款<span v-if="sizeTypeClass == 'A5'">/Pay Amount</span></div>
+                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'A5'">/Cost</span></div>
+                <div class="fee-cell flex-3">支付方式<span v-if="sizeTypeClass == 'A5'">/Pay Type</span></div>
             </div>
         </div>
 
@@ -82,7 +82,7 @@
             </div>
 
             <div class="print-fee-item-wrapper" style="margin-top: 20px;">
-                <div>贵宾签字<span v-if="sizeTypeClass == 'a5'">/Guest Signture</span>:</div>
+                <div>贵宾签字<span v-if="sizeTypeClass == 'A5'">/Guest Signture</span>:</div>
                 <div class="print-fee-value value-underline"></div>
             </div>
         </div>
@@ -195,7 +195,7 @@ export default {
         }
 
         .print-fee-title {
-            width: 40%;
+            width: 40% !important;
             text-align: right;
         }
 

+ 16 - 16
src/views/settings/components/modules/printComponents/teamCheckIn.vue

@@ -4,59 +4,59 @@
 
         <div class="print-fee-info">
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">编号<span v-if="sizeTypeClass == 'a5'">/ID</span>:</div>
+                <div class="print-fee-title">编号<span v-if="sizeTypeClass == 'A5'">/ID</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.no }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">名称<span v-if="sizeTypeClass == 'a5'">/Name</span>:</div>
+                <div class="print-fee-title">名称<span v-if="sizeTypeClass == 'A5'">/Name</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.name }}</div>
             </div>
             <div class="print-fee-item-wrapper row">
-                <div class="print-fee-title">公付<span v-if="sizeTypeClass == 'a5'">/Public Pay</span>:</div>
+                <div class="print-fee-title">公付<span v-if="sizeTypeClass == 'A5'">/Public Pay</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.publicPay }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">领队<span v-if="sizeTypeClass == 'a5'">/Leader</span>:</div>
+                <div class="print-fee-title">领队<span v-if="sizeTypeClass == 'A5'">/Leader</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.leader }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">联系人<span v-if="sizeTypeClass == 'a5'">/Contact</span>:</div>
+                <div class="print-fee-title">联系人<span v-if="sizeTypeClass == 'A5'">/Contact</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contact }}</div>
             </div>
             <div class="print-fee-item-wrapper row">
-                <div class="print-fee-title">电话<span v-if="sizeTypeClass == 'a5'">/Tel</span>:</div>
+                <div class="print-fee-title">电话<span v-if="sizeTypeClass == 'A5'">/Tel</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.tel }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">客人来源<span v-if="sizeTypeClass == 'a5'">/Source</span>:</div>
+                <div class="print-fee-title">客人来源<span v-if="sizeTypeClass == 'A5'">/Source</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.source }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">客人类型<span v-if="sizeTypeClass == 'a5'">/Type</span>:</div>
+                <div class="print-fee-title">客人类型<span v-if="sizeTypeClass == 'A5'">/Type</span>:</div>
                 <div class="print-fee-value">{{ (feeInfo.type) }}</div>
             </div>
             <div class="print-fee-item-wrapper row">
-                <div class="print-fee-title">协议单位<span v-if="sizeTypeClass == 'a5'">/Company</span>:</div>
+                <div class="print-fee-title">协议单位<span v-if="sizeTypeClass == 'A5'">/Company</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contractInfo ? feeInfo.contractInfo.name : '无' }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">到时<span v-if="sizeTypeClass == 'a5'">/CheckIn</span>:</div>
+                <div class="print-fee-title">到时<span v-if="sizeTypeClass == 'A5'">/CheckIn</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.arrivalTime }}</div>
             </div>
             <div class="print-fee-item-wrapper  small-item">
-                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'a5'">/CheckOut</span>:</div>
+                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'A5'">/CheckOut</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dueOutTime }}</div>
             </div>
             <div class="print-fee-item-wrapper row" v-if="defModel.isShowBreakfast == 0">
-                <div class="print-fee-title">早餐<span v-if="sizeTypeClass == 'a5'">/Breakfirst</span>:</div>
+                <div class="print-fee-title">早餐<span v-if="sizeTypeClass == 'A5'">/Breakfirst</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.breakFirst }}</div>
             </div>
             <div class="print-fee-item-wrapper row row1">
-                <div class="print-fee-title">收款<span v-if="sizeTypeClass == 'a5'">/Payment</span>:</div>
+                <div class="print-fee-title">收款<span v-if="sizeTypeClass == 'A5'">/Payment</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.payment }}</div>
             </div>
             <div class="print-fee-item-wrapper row row1">
-                <div class="print-fee-title">押金<span v-if="sizeTypeClass == 'a5'">/Money</span>:</div>
+                <div class="print-fee-title">押金<span v-if="sizeTypeClass == 'A5'">/Money</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.deposit }}</div>
             </div>
         </div>
@@ -93,12 +93,12 @@
                 <div class="print-fee-title">预定电话:</div>
                 <div class="print-fee-value">{{ storeInfo.linkTel }}</div>
             </div>
-            <div class="print-fee-item-wrapper" v-if="sizeTypeClass == 'a5'">
+            <div class="print-fee-item-wrapper" v-if="sizeTypeClass == 'A5'">
                 <div class="print-fee-title">打印人:</div>
                 <div class="print-fee-value">{{ nickname() }}</div>
             </div>
             <div class="print-fee-item-wrapper time">
-                <div class="print-fee-title">打印时间<span v-if="sizeTypeClass == 'a5'">/Print Time</span>:</div>
+                <div class="print-fee-title">打印时间<span v-if="sizeTypeClass == 'A5'">/Print Time</span>:</div>
                 <div class="print-fee-value">{{ printDate }}</div>
             </div>
         </div>

+ 21 - 21
src/views/settings/components/modules/printComponents/teamCheckOut.vue

@@ -8,59 +8,59 @@
                 <div style="text-align: right;flex: 1">NO.{{feeInfo.checkOutNo}}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">编号<span v-if="sizeTypeClass == 'a5'">/ID</span>:</div>
+                <div class="print-fee-title">编号<span v-if="sizeTypeClass == 'A5'">/ID</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.no }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">名称<span v-if="sizeTypeClass == 'a5'">/Name</span>:</div>
+                <div class="print-fee-title">名称<span v-if="sizeTypeClass == 'A5'">/Name</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.name }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">类型<span v-if="sizeTypeClass == 'a5'">/Type</span>:</div>
+                <div class="print-fee-title">类型<span v-if="sizeTypeClass == 'A5'">/Type</span>:</div>
                 <div class="print-fee-value">{{ (feeInfo.type) }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">领队<span v-if="sizeTypeClass == 'a5'">/Leader</span>:</div>
+                <div class="print-fee-title">领队<span v-if="sizeTypeClass == 'A5'">/Leader</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.leader }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">联系人<span v-if="sizeTypeClass == 'a5'">/Contact</span>:</div>
+                <div class="print-fee-title">联系人<span v-if="sizeTypeClass == 'A5'">/Contact</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contact }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">电话<span v-if="sizeTypeClass == 'a5'">/Tel</span>:</div>
+                <div class="print-fee-title">电话<span v-if="sizeTypeClass == 'A5'">/Tel</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.tel }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">到时<span v-if="sizeTypeClass == 'a5'">/CheckIn</span>:</div>
+                <div class="print-fee-title">到时<span v-if="sizeTypeClass == 'A5'">/CheckIn</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.arrivalTime }}</div>
             </div>
             <div class="print-fee-item-wrapper">
-                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'a5'">/CheckOut</span>:</div>
+                <div class="print-fee-title">离时<span v-if="sizeTypeClass == 'A5'">/CheckOut</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dueOutTime }}</div>
             </div>
             <div class="print-fee-item-wrapper row">
-                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'a5'">/Days</span>:</div>
+                <div class="print-fee-title">天数<span v-if="sizeTypeClass == 'A5'">/Days</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.dayCount }}</div>
             </div>
             <div class="print-fee-item-wrapper small-item">
-                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'a5'">/Member</span>:</div>
+                <div class="print-fee-title">会员<span v-if="sizeTypeClass == 'A5'">/Member</span>:</div>
                 <div class="print-fee-value">{{ (feeInfo.isVip) }}</div>
             </div>
             <div class="print-fee-item-wrapper row">
-                <div class="print-fee-title">协议单位<span v-if="sizeTypeClass == 'a5'">/Company</span>:</div>
+                <div class="print-fee-title">协议单位<span v-if="sizeTypeClass == 'A5'">/Company</span>:</div>
                 <div class="print-fee-value">{{ feeInfo.contractInfo ? feeInfo.contractInfo.name : '无' }}</div>
             </div>
         </div>
 
         <div class="print-fees">
             <div class="print-fees-header fee-row">
-                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'a5'">/RoomNo</span></div>
-                <div class="fee-cell">项目<span v-if="sizeTypeClass == 'a5'">/Project</span></div>
-                <div class="fee-cell" v-if="sizeTypeClass == 'a5'">发生时间/Time</div>
-                <div class="fee-cell" >收款<span v-if="sizeTypeClass == 'a5'">/Pay Amount</span></div>
-                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'a5'">/Cost</span></div>
-                <div class="fee-cell flex-3">付款方式<span v-if="sizeTypeClass == 'a5'">/Pay Type</span></div>
+                <div class="fee-cell flex-2">房间号<span v-if="sizeTypeClass == 'A5'">/RoomNo</span></div>
+                <div class="fee-cell">项目<span v-if="sizeTypeClass == 'A5'">/Project</span></div>
+                <div class="fee-cell" v-if="sizeTypeClass == 'A5'">发生时间/Time</div>
+                <div class="fee-cell" >收款<span v-if="sizeTypeClass == 'A5'">/Pay Amount</span></div>
+                <div class="fee-cell">费用<span v-if="sizeTypeClass == 'A5'">/Cost</span></div>
+                <div class="fee-cell flex-3">付款方式<span v-if="sizeTypeClass == 'A5'">/Pay Type</span></div>
             </div>
         </div>
 
@@ -69,7 +69,7 @@
         <div class="print-fees-header fee-row" style="padding-bottom: 5px" v-for="(item,index) in dataSource.childs">
             <div class="fee-cell flex-2">{{item.roomNo}}</div>
             <div class="fee-cell">{{item.projectName}}</div>
-            <div class="fee-cell" v-if="sizeTypeClass == 'a5'">{{item.occurTime}}</div>
+            <div class="fee-cell" v-if="sizeTypeClass == 'A5'">{{item.occurTime}}</div>
             <div class="fee-cell" >{{item.amount}}</div>
             <div class="fee-cell">{{item.cost}}</div>
             <div class="fee-cell flex-3">{{item.payName}}</div>
@@ -80,7 +80,7 @@
             <div class="print-fees-header fee-row">
                 <div class="fee-cell flex-2">合计:</div>
                 <div class="fee-cell">/</div>
-                <div class="fee-cell" v-if="sizeTypeClass == 'a5'">/</div>
+                <div class="fee-cell" v-if="sizeTypeClass == 'A5'">/</div>
                 <div class="fee-cell">{{dataSource.amount}}</div>
                 <div class="fee-cell">{{dataSource.cost}}</div>
                 <div class="fee-cell flex-3"></div>
@@ -88,7 +88,7 @@
         </div>
 
         <div class="print-fee-item-wrapper">
-            <div>客人签名<span v-if="sizeTypeClass == 'a5'">/Guest Signture</span>:</div>
+            <div>客人签名<span v-if="sizeTypeClass == 'A5'">/Guest Signture</span>:</div>
             <div class="print-fee-value value-underline"></div>
         </div>
 
@@ -112,7 +112,7 @@
                 <div class="print-fee-value">{{ nickname() }}</div>
             </div>
             <div class="print-fee-item-wrapper time">
-                <div class="print-fee-title">打印时间<span v-if="sizeTypeClass == 'a5'">(Print Time)</span>:</div>
+                <div class="print-fee-title">打印时间<span v-if="sizeTypeClass == 'A5'">(Print Time)</span>:</div>
                 <div class="print-fee-value">{{ printDate }}</div>
             </div>
         </div>

+ 164 - 55
src/views/settings/components/modules/printTemplateForm.vue

@@ -97,7 +97,7 @@
           </a-form-model>
         </j-form-container>
       </div>
-      <div class="right">
+      <div class="right" id="print_content">
         <div v-if="model.type == 1">
           <jzd :sizeTypeClass="sizeTypeClass" :defContent="model.remarks" :defModel="model"></jzd>
         </div>
@@ -153,6 +153,21 @@
       </div>
     </div>
 
+      <!--      测试打印-->
+<!--      <a-dropdown>-->
+<!--          <a-button icon="printer" type="primary">-->
+<!--              打印选项-->
+<!--              <a-icon type="down" />-->
+<!--          </a-button>-->
+<!--          <a-menu slot="overlay">-->
+<!--              <a-menu-item type="primary" @click="printPreview(0)">直接打印</a-menu-item>-->
+<!--              <a-menu-item type="primary" @click="printPreview(1)">打印预览</a-menu-item>-->
+<!--              <a-menu-item type="primary" @click="printPreview(2)">打印维护</a-menu-item>-->
+<!--              <a-menu-item type="primary" @click="printPreview(3)">打印设计</a-menu-item>-->
+<!--          </a-menu>-->
+<!--      </a-dropdown>-->
+
+<!--      <a-button type="info" @click="handlePrint()">打印</a-button>-->
   </a-spin>
 </template>
 
@@ -178,6 +193,10 @@
   import jbb from './printComponents/handoverPrint.vue'
   import jbmxb from './printComponents/handoverDetailPrint.vue'
 
+  import { getLodop } from '../../../../utils/lodop/LodopFuncs'
+  import Print from '../../../../utils/lodop/print.min'
+
+
   export default {
     name: 'printTemplateForm',
     components: {
@@ -255,64 +274,154 @@
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
     },
     methods: {
-      add () {
-        this.edit(this.modelDefault);
-      },
-      edit (record) {
-        console.log(record)
-        this.model = Object.assign({}, record);
-        this.width = record.specs;
-        if (record.specs === 'a5'){
-          // this.width = '210mm';
-          this.sizeTypeClass = "a5"
-        }else if(record.specs === '58mm'){
-          this.sizeTypeClass = "mm58"
-        }
-        else{
-          this.sizeTypeClass = "mm80"
-        }
-        this.visible = true;
-      },
-      submitForm () {
-        const that = this;
-        // 触发表单验证
-        this.$refs.form.validate(valid => {
-          if (valid) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-              var info = JSON.parse(localStorage.getItem("storeInfo"));
-              this.model.hotelId = info.id;
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
+        add() {
+            this.edit(this.modelDefault);
+        },
+        edit(record) {
+            console.log(record)
+            this.model = Object.assign({}, record);
+            this.width = record.specs;
+            if (record.specs === 'A5') {
+                // this.width = '210mm';
+                this.sizeTypeClass = "a5"
+            } else if (record.specs === '58mm') {
+                this.sizeTypeClass = "mm58"
+            } else {
+                this.sizeTypeClass = "mm80"
             }
-            httpAction(httpurl,this.model,method).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.$emit('ok');
-              }else{
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
+            this.visible = true;
+        },
+        submitForm() {
+            const that = this;
+            // 触发表单验证
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    that.confirmLoading = true;
+                    let httpurl = '';
+                    let method = '';
+                    if (!this.model.id) {
+                        httpurl += this.url.add;
+                        method = 'post';
+                        var info = JSON.parse(localStorage.getItem("storeInfo"));
+                        this.model.hotelId = info.id;
+                    } else {
+                        httpurl += this.url.edit;
+                        method = 'put';
+                    }
+                    httpAction(httpurl, this.model, method).then((res) => {
+                        if (res.success) {
+                            that.$message.success(res.message);
+                            that.$emit('ok');
+                        } else {
+                            that.$message.warning(res.message);
+                        }
+                    }).finally(() => {
+                        that.confirmLoading = false;
+                    })
+                }
+
             })
-          }
+        },
+        onSpecsChange(val) {
+            if (val == '80mm') {
+                this.sizeTypeClass = 'mm80'
+            } else if (val == '58mm') {
+                this.sizeTypeClass = 'mm58'
+            } else {
+                this.sizeTypeClass = 'a5'
+            }
+        },
+        printPreview(s) {
+            this.CreateOneFormPage()
+            if (s == 0) {
+                LODOP.PRINT() //直接打印
+            }
+            if (s == 1) {
+                LODOP.PREVIEW() //打印预览
+            }
+            if (s == 2) {
+                LODOP.PRINT_SETUP() //打印维护
+            }
+            if (s == 3) {
+                LODOP.PRINT_DESIGN() //打印设计
+            }
+        },
+        CreateOneFormPage() {
+            LODOP = getLodop()
+            //样式
+            var olstyle1 = '<style>' + document.getElementById('olstyle1') + '</style>'
+            var body = olstyle1 + '<body>' + document.getElementById('print_content').innerHTML + '</body>'
+            console.log(body)
+            // var body = document.getElementById('print_content').innerHTML;
+            LODOP.PRINT_INIT(this.model.name) //打印初始化
+            // LODOP.SET_PRINT_STYLE('FontSize', 18) //设置对象风格
+            LODOP.SET_PRINT_STYLE('Bold', 1) //设置对象风格
+            // LODOP.ADD_PRINT_TEXT(50,521, 130, 39, this.description) //增加纯文本项
+            var _left = 0;
+            var _wight = 2000;
+            var _height = 2000;
+            //SET_PRINT_PAGESIZE(intOrient,intPageWidth,intPageHeight,strPageName)设定纸张大小
+            if (this.model.specs == '58mm') {
+                _wight = 580;
+                _height = 4000;
+            } else if (this.model.specs == '80mm') {
+                _wight = 800
+                _height = 2190;
+            } else if (this.model.specs == 'A5') {
+                _wight = 2100;
+                _height = 2970;
+            } else {
 
-        })
-      },
-      onSpecsChange(val){
-        if(val == '80mm') {
-          this.sizeTypeClass = 'mm80'
-        } else if(val == '58mm') {
-          this.sizeTypeClass = 'mm58'
-        } else {
-          this.sizeTypeClass = 'a5'
+            }
+            _left = this.model.printPaperOffset;
+            LODOP.SET_PRINT_PAGESIZE(_left, _wight, _height, '') //设定纸张大小
+            /*
+            intDispMode:预览比例,数字型,0-适度高 1-正常大小 2-适度宽
+            intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏   1-显示(下方)按钮栏 2-两个都显示3-两个都不显示
+            blDirectPrint:打印按钮是否“直接打印” 1-是 0-否(弹出界面“选择打印”)
+            intWidth,intHeight 窗口的宽和高,整数型,单位px
+            strTitleButtonCaption:预览窗口和打印按钮的名称组合,字符型,用“点”分隔
+            */
+
+            LODOP.SET_PREVIEW_WINDOW(0, 0, 1, 0, 0, "");
+            // LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '55%')//设置缩放
+            // LODOP.SET_PREVIEW_WINDOW(2, 2, 0, 0, 0, '')//设置窗口
+            // 打印二维码
+            // LODOP.ADD_PRINT_BARCODE(23,23,233,233,"QRCode","https://blog.csdn.net/qq_43652509");
+            //打印网址
+            // LODOP.ADD_PRINT_URL(222,2000,2000,233,"https://blog.csdn.net/qq_43652509");
+            //打印图片
+            // LODOP.ADD_PRINT_IMAGE(100,100,400,400,"<img border='0' src='http://s1.sinaimg.cn/middle/4fe4ba17hb5afe2caa990&690' width='345' height='250'>");
+
+            // ● ADD_PRINT_HTM(intTop,intLeft,intWidth,intHeight,strHtml)增加超文本项
+            // ● ADD_PRINT_TEXT(intTop,intLeft,intWidth,intHeight,strContent)增加纯文本项
+            // ● ADD_PRINT_TABLE(intTop,intLeft,intWidth,intHeight,strHtml)增加表格项
+            // ● ADD_PRINT_SHAPE(intShapeType,intTop,intLeft,intWidth,intHeight,intLineStyle,intLineWidth,intColor)画图形
+            LODOP.ADD_PRINT_HTM(this.model.printContentOffset, this.model.printContentOffset, _wight - this.model.printContentOffset, _height - this.model.printContentOffset, body) //增加超文本项
+        },
+        handlePrint() {
+            var _content = this.model.printContentOffset;
+            var _maxWidth = 210;
+            if (this.model.specs == '58mm') {
+                _maxWidth = 580;
+            } else if (this.model.specs == '80mm') {
+                _maxWidth = 800
+            } else if (this.model.specs == 'A5') {
+                _maxWidth = 2100;
+            } else {
+
+            }
+            printJS({
+                printable: "print_content", // 'printFrom', // 标签元素id
+                type: 'html',
+                header: '', // '表单',
+                targetStyles: ['*'],
+                maxWidth:_maxWidth,
+                style: '@page {margin:'+_content+'mm};', // 可选-打印时去掉眉页眉尾
+                ignoreElements: [], // ['no-print']
+                properties: null
+            })
         }
-      }
     }
   }
 </script>