dce29980 by jiaozeping@pashanhoo.com

打印审批表

1 parent f68c37f2
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
6 <template> 6 <template>
7 <div class="spyj" v-Loading="loading"> 7 <div class="spyj" v-Loading="loading">
8 <div class="box"> 8 <div class="box">
9 <div style="text-align:left">
10 <el-button type="primary" @click="handlePrint()">打印</el-button>
11
12 </div>
13
9 <div class="spyj_title"> 14 <div class="spyj_title">
10 <div class="righttitle">审批表</div> 15 <div class="righttitle">审批表</div>
11 </div> 16 </div>
...@@ -66,12 +71,31 @@ ...@@ -66,12 +71,31 @@
66 <el-button type="primary" :disabled="shows" @click="onSubmit()">保存</el-button> 71 <el-button type="primary" :disabled="shows" @click="onSubmit()">保存</el-button>
67 </div> 72 </div>
68 </div> 73 </div>
74
75 <!-- 打印模板需要此模块 -->
76 <object
77 id="LODOP_OB"
78 classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
79 v-show="false">
80 <embed
81 id="LODOP_EM"
82 type="application/x-print-lodop"
83 width="820"
84 height="450"
85 pluginspage="install_lodop32.exe" />
86 </object>
87
69 </div> 88 </div>
70 </template> 89 </template>
71 <script> 90 <script>
72 import { saveSpyjBySlsq, getSpyjList } from "@/api/opinion.js"; 91 import { saveSpyjBySlsq, getSpyjList ,getSpyjdy} from "@/api/opinion.js";
73 import { mapGetters } from "vuex"; 92 import { mapGetters } from "vuex";
74 import { getNewDatesh } from "@/utils/util"; 93 import { getNewDatesh } from "@/utils/util";
94 import Vue from 'vue'
95 import { getLodop } from "@/utils/LodopFuncs";
96 import { getPrintTemplateByCode } from "@/api/print";
97 import { getPrintApplicationForm } from "@/api/workFlow.js";
98
75 export default { 99 export default {
76 computed: { 100 computed: {
77 ...mapGetters(["dqhj", "yjsqOptions", "userInfo"]), 101 ...mapGetters(["dqhj", "yjsqOptions", "userInfo"]),
...@@ -225,6 +249,31 @@ ...@@ -225,6 +249,31 @@
225 this.$set(this.tableData[this.currentindex], "shyj", val); 249 this.$set(this.tableData[this.currentindex], "shyj", val);
226 } 250 }
227 }, 251 },
252
253 handlePrint(){
254 getPrintTemplateByCode({ tmpno: 'spb' }).then(res => {
255 if (res.code === 200) {
256 getSpyjdy(this.propsParam.bsmBusiness).then(infoRes => {
257 if (infoRes.code === 200) {
258 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
259
260 // 装载第一个模板并设置数据
261 LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
262 for (let key in infoRes.result) {
263 LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
264 }
265
266 // 进行预览
267 LODOP.PREVIEW();
268 } else {
269 this.$message.error(infoRes.message);
270 }
271 });
272 } else {
273 this.$message.error(res.message);
274 }
275 })
276 },
228 }, 277 },
229 }; 278 };
230 </script> 279 </script>
......