57301a31 by renchao@pashanhoo.com

Merge branch 'dev'

2 parents 19499817 a1646884
1 <!--
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-11-22 17:09:14
5 -->
6 <template>
7 <div style="text-align:center">
8 <el-button type="primary" @click="handlePrint(1)">打印第1页</el-button>
9 <el-button type="primary" @click="handlePrint(2)">打印第2页</el-button>
10 <!-- 打印模板需要此模块 -->
11 <object
12 id="LODOP_OB"
13 classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
14 v-show="false">
15 <embed
16 id="LODOP_EM"
17 type="application/x-print-lodop"
18 width="820"
19 height="450"
20 pluginspage="install_lodop32.exe" />
21 </object>
22 </div>
23 </template>
24 <script>
25 import Vue from 'vue'
26 import { getLodop } from "@/utils/LodopFuncs";
27 import { getPrintTemplateByCode } from "@/api/print";
28 import { getPrintApplicationForm } from "@/api/workFlow.js";
29 export default {
30 props: {
31 formData: {
32 type: Object,
33 default: () => {
34 return {}
35 }
36 }
37 },
38 data () {
39 return {
40 }
41 },
42 methods: {
43 handlePrint (val) {
44 if (val == 1) {
45 getPrintTemplateByCode({ tmpno: Vue.prototype.BASE_API.adapter }).then(res => {
46 if (res.code === 200) {
47 getPrintApplicationForm(this.formData.bsmSldy).then(infoRes => {
48 if (infoRes.code === 200) {
49 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
50
51 // 装载第一个模板并设置数据
52 LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
53 for (let key in infoRes.result) {
54 LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
55 }
56
57 // 进行预览
58 LODOP.PREVIEW();
59 } else {
60 this.$message.error(infoRes.message);
61 }
62 });
63 } else {
64 this.$message.error(res.message);
65 }
66 })
67 } else {
68 getPrintTemplateByCode({ tmpno: Vue.prototype.BASE_API.adapter + '-2' }).then(res => {
69 if (res.code === 200) {
70 getPrintApplicationForm(this.formData.bsmSldy).then(infoRes => {
71 if (infoRes.code === 200) {
72 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
73
74 // 装载第一个模板并设置数据
75 LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
76 for (let key in infoRes.result) {
77 LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
78 }
79
80 // 进行预览
81 LODOP.PREVIEW();
82 } else {
83 this.$message.error(infoRes.message);
84 }
85 });
86 } else {
87 this.$message.error(res.message);
88 }
89 })
90 }
91
92 }
93 }
94 }
95 </script>
...\ No newline at end of file ...\ No newline at end of file
1 /* 1 /*
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-11-22 13:18:47 4 * @LastEditTime: 2023-11-22 17:05:55
5 */ 5 */
6 import Vue from 'vue' 6 import Vue from 'vue'
7 import { getPrintTemplateByCode } from "@/api/print"; 7 import { getPrintTemplateByCode } from "@/api/print";
...@@ -134,40 +134,32 @@ export default { ...@@ -134,40 +134,32 @@ export default {
134 this.$popupDialog("证书修改", "workflow/components/dialog/zsxg", { bsmSlsq: this.bsmSlsq, }, '55%', true) 134 this.$popupDialog("证书修改", "workflow/components/dialog/zsxg", { bsmSlsq: this.bsmSlsq, }, '55%', true)
135 break; 135 break;
136 case "B6": 136 case "B6":
137 this.$popupDialog("打印申请书", "workflow/components/dialog/sqs",
138 { bsmSldy: this.currentSelectProps.bsmSldy }, '30%', true
139 )
137 //根据编号获取对应信息 140 //根据编号获取对应信息
138 getPrintTemplateByCode({ tmpno: Vue.prototype.BASE_API.adapter }).then(res => { 141 // getPrintTemplateByCode({ tmpno: Vue.prototype.BASE_API.adapter }).then(res => {
139 if (res.code === 200) { 142 // if (res.code === 200) {
140 getPrintTemplateByCode({ tmpno: Vue.prototype.BASE_API.adapter + '-2' }).then(res1 => { 143 // getPrintApplicationForm(this.currentSelectProps.bsmSldy).then(infoRes => {
141 getPrintApplicationForm(this.currentSelectProps.bsmSldy).then(infoRes => { 144 // if (infoRes.code === 200) {
142 if (infoRes.code === 200) { 145 // let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
143 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
144
145 // 装载第一个模板并设置数据
146 LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
147 for (let key in infoRes.result) {
148 LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
149 }
150 146
151 // 手动分页 147 // // 装载第一个模板并设置数据
152 LODOP.NewPage(); 148 // LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
149 // for (let key in infoRes.result) {
150 // LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
151 // }
153 152
154 // 装载第二个模板并设置数据 153 // // 进行预览
155 LODOP.ADD_PRINT_DATA("ProgramData", res1.result.tmpcontent); 154 // LODOP.PREVIEW();
156 for (let key in res1.result) { 155 // } else {
157 LODOP.SET_PRINT_STYLEA(key, "CONTENT", res1.result[key]); 156 // this.$message.error(infoRes.message);
158 } 157 // }
159 158 // });
160 // 进行预览 159 // } else {
161 LODOP.PREVIEW(); 160 // this.$message.error(res.message);
162 } else { 161 // }
163 this.$message.error(infoRes.message); 162 // })
164 }
165 });
166 });
167 } else {
168 this.$message.error(res.message);
169 }
170 })
171 break; 163 break;
172 case "B7": 164 case "B7":
173 this.$popupDialog("证书领取", "workflow/components/dialog/zslq", 165 this.$popupDialog("证书领取", "workflow/components/dialog/zslq",
......