模板打印
Showing
3 changed files
with
63 additions
and
20 deletions
1 | //==本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序== | 1 | //==本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序== |
2 | 2 | import { MessageBox } from 'element-ui'; | |
3 | var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState; | 3 | var CreatedOKLodopObject, CLodopIsLocal, CLodopJsState; |
4 | 4 | ||
5 | //==判断是否需要CLodop(那些不支持插件的浏览器):== | 5 | //==判断是否需要CLodop(那些不支持插件的浏览器):== |
... | @@ -88,11 +88,29 @@ export function getLodop (oOBJECT, oEMBED) { | ... | @@ -88,11 +88,29 @@ export function getLodop (oOBJECT, oEMBED) { |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | if (!LODOP) { | 90 | if (!LODOP) { |
91 | document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : "") + strCLodopInstall_3 + document.body.innerHTML; | 91 | MessageBox.confirm('打印控件未安装,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', { |
92 | confirmButtonText: '下载', | ||
93 | cancelButtonText: '取消', | ||
94 | type: 'warning' | ||
95 | }).then(() => { | ||
96 | window.open('http://192.168.2.38:9000/bdcdj/20221212/b8702920-987d-4685-aff4-ade7a3a2b868/CLodop_Setup_for_Win32NT.zip') | ||
97 | }).catch(() => { | ||
98 | |||
99 | }); | ||
100 | //document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : "") + strCLodopInstall_3 + document.body.innerHTML; | ||
92 | return; | 101 | return; |
93 | } else { | 102 | } else { |
94 | if (CLODOP.CVERSION < "4.0.9.9") { | 103 | if (CLODOP.CVERSION < "4.0.9.9") { |
95 | document.body.innerHTML = strCLodopUpdate + document.body.innerHTML; | 104 | MessageBox.confirm('打印控件需要升级,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', { |
105 | confirmButtonText: '下载', | ||
106 | cancelButtonText: '取消', | ||
107 | type: 'warning' | ||
108 | }).then(() => { | ||
109 | window.open('http://192.168.2.38:9000/bdcdj/20221212/cc00035b-4240-439a-b6a3-302cab44cb1e/install_lodop32.zip') | ||
110 | }).catch(() => { | ||
111 | |||
112 | }); | ||
113 | //document.body.innerHTML = strCLodopUpdate + document.body.innerHTML; | ||
96 | } | 114 | } |
97 | if (oEMBED && oEMBED.parentNode) | 115 | if (oEMBED && oEMBED.parentNode) |
98 | oEMBED.parentNode.removeChild(oEMBED); | 116 | oEMBED.parentNode.removeChild(oEMBED); |
... | @@ -122,17 +140,35 @@ export function getLodop (oOBJECT, oEMBED) { | ... | @@ -122,17 +140,35 @@ export function getLodop (oOBJECT, oEMBED) { |
122 | LODOP = CreatedOKLodopObject; | 140 | LODOP = CreatedOKLodopObject; |
123 | //==Lodop插件未安装时提示下载地址:== | 141 | //==Lodop插件未安装时提示下载地址:== |
124 | if ((!LODOP) || (!LODOP.VERSION)) { | 142 | if ((!LODOP) || (!LODOP.VERSION)) { |
125 | if (ua.indexOf('Chrome') >= 0) | 143 | MessageBox.confirm('打印控件未安装,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', { |
126 | document.body.innerHTML = strHtmChrome + document.body.innerHTML; | 144 | confirmButtonText: '下载', |
127 | if (ua.indexOf('Firefox') >= 0) | 145 | cancelButtonText: '取消', |
128 | document.body.innerHTML = strHtmFireFox + document.body.innerHTML; | 146 | type: 'warning' |
129 | document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML; | 147 | }).then(() => { |
148 | window.open('http://192.168.2.38:9000/bdcdj/20221212/b8702920-987d-4685-aff4-ade7a3a2b868/CLodop_Setup_for_Win32NT.zip') | ||
149 | }).catch(() => { | ||
150 | |||
151 | }); | ||
152 | // if (ua.indexOf('Chrome') >= 0) | ||
153 | // document.body.innerHTML = strHtmChrome + document.body.innerHTML; | ||
154 | // if (ua.indexOf('Firefox') >= 0) | ||
155 | // document.body.innerHTML = strHtmFireFox + document.body.innerHTML; | ||
156 | // document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML; | ||
130 | return LODOP; | 157 | return LODOP; |
131 | } | 158 | } |
132 | } | 159 | } |
133 | if (LODOP.VERSION < "6.2.2.6") { | 160 | if (LODOP.VERSION < "6.2.2.6") { |
134 | if (!needCLodop()) | 161 | if (!needCLodop()) |
135 | document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML; | 162 | MessageBox.confirm('打印控件需要升级,点击下载执行安装,安装后请刷新页面或重新进入', '系统提示', { |
163 | confirmButtonText: '下载', | ||
164 | cancelButtonText: '取消', | ||
165 | type: 'warning' | ||
166 | }).then(() => { | ||
167 | window.open('http://192.168.2.38:9000/bdcdj/20221212/cc00035b-4240-439a-b6a3-302cab44cb1e/install_lodop32.zip') | ||
168 | }).catch(() => { | ||
169 | |||
170 | }); | ||
171 | //document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML; | ||
136 | } | 172 | } |
137 | //===如下空白位置适合调用统一功能(如注册语句、语言选择等):== | 173 | //===如下空白位置适合调用统一功能(如注册语句、语言选择等):== |
138 | LODOP.SET_LICENSES("", "13528A153BAEE3A0254B9507DCDE2839", "EDE92F75B6A3D917F65910", ""); | 174 | LODOP.SET_LICENSES("", "13528A153BAEE3A0254B9507DCDE2839", "EDE92F75B6A3D917F65910", ""); | ... | ... |
... | @@ -30,14 +30,14 @@ class data extends filter { | ... | @@ -30,14 +30,14 @@ class data extends filter { |
30 | prop: "tmpname", | 30 | prop: "tmpname", |
31 | label: "模板名称", | 31 | label: "模板名称", |
32 | }, | 32 | }, |
33 | { | 33 | // { |
34 | prop: "tmpfont", | 34 | // prop: "tmpfont", |
35 | label: "模板字体", | 35 | // label: "模板字体", |
36 | }, | 36 | // }, |
37 | { | 37 | // { |
38 | prop: "tmpfontsize", | 38 | // prop: "tmpfontsize", |
39 | label: "模板字体大小", | 39 | // label: "模板字体大小", |
40 | }, | 40 | // }, |
41 | { | 41 | { |
42 | prop: "updatetime", | 42 | prop: "updatetime", |
43 | label: "最近操作时间", | 43 | label: "最近操作时间", | ... | ... |
1 | import { getWorkFlowImage } from "@/api/workflow/jsydsyqFlow.js"; | 1 | import { getWorkFlowImage } from "@/api/workflow/jsydsyqFlow.js"; |
2 | import { popupDialog } from "@/utils/popup.js"; | 2 | import { popupDialog } from "@/utils/popup.js"; |
3 | import { getPrintTemplateByCode } from "@/api/system"; | 3 | import { getPrintTemplateByCode } from "@/api/system"; |
4 | import { getPrintApplicationInfo } from "@/api/fqsq"; | ||
4 | import { getLodop } from "@/utils/LodopFuncs" | 5 | import { getLodop } from "@/utils/LodopFuncs" |
5 | import { | 6 | import { |
6 | leftMenu, | 7 | leftMenu, |
... | @@ -137,15 +138,21 @@ export default { | ... | @@ -137,15 +138,21 @@ export default { |
137 | //根据编号获取对应信息 | 138 | //根据编号获取对应信息 |
138 | getPrintTemplateByCode({tmpno: 'dysqs'}).then(res => { | 139 | getPrintTemplateByCode({tmpno: 'dysqs'}).then(res => { |
139 | if(res.code == 200){ | 140 | if(res.code == 200){ |
141 | getPrintApplicationInfo(this.currentSelectProps).then(infoRes => { | ||
142 | if(infoRes.code == 200){ | ||
140 | //打开模板设计 | 143 | //打开模板设计 |
141 | let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM')); | 144 | let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM')); |
142 | LODOP.ADD_PRINT_DATA("ProgramData",res.result.tmpcontent); //装载模板 | 145 | LODOP.ADD_PRINT_DATA("ProgramData",res.result.tmpcontent); //装载模板 |
143 | |||
144 | //todo 调取后端接口获取数据 循环set | 146 | //todo 调取后端接口获取数据 循环set |
145 | 147 | for(let key in infoRes.result){ | |
146 | LODOP.SET_PRINT_STYLEA("qlrmc","CONTENT","计划大河风流看"); | 148 | LODOP.SET_PRINT_STYLEA(key,"CONTENT",infoRes.result[key]); |
149 | } | ||
147 | LODOP.PREVIEW(); | 150 | LODOP.PREVIEW(); |
148 | }else{ | 151 | }else{ |
152 | this.$message.error(infoRes.message) | ||
153 | } | ||
154 | }) | ||
155 | }else{ | ||
149 | this.$message.error(res.message) | 156 | this.$message.error(res.message) |
150 | } | 157 | } |
151 | }) | 158 | }) | ... | ... |
-
Please register or sign in to post a comment