dce29980 by jiaozeping@pashanhoo.com

打印审批表

1 parent f68c37f2
......@@ -6,6 +6,11 @@
<template>
<div class="spyj" v-Loading="loading">
<div class="box">
<div style="text-align:left">
<el-button type="primary" @click="handlePrint()">打印</el-button>
</div>
<div class="spyj_title">
<div class="righttitle">审批表</div>
</div>
......@@ -66,12 +71,31 @@
<el-button type="primary" :disabled="shows" @click="onSubmit()">保存</el-button>
</div>
</div>
<!-- 打印模板需要此模块 -->
<object
id="LODOP_OB"
classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
v-show="false">
<embed
id="LODOP_EM"
type="application/x-print-lodop"
width="820"
height="450"
pluginspage="install_lodop32.exe" />
</object>
</div>
</template>
<script>
import { saveSpyjBySlsq, getSpyjList } from "@/api/opinion.js";
import { saveSpyjBySlsq, getSpyjList ,getSpyjdy} from "@/api/opinion.js";
import { mapGetters } from "vuex";
import { getNewDatesh } from "@/utils/util";
import Vue from 'vue'
import { getLodop } from "@/utils/LodopFuncs";
import { getPrintTemplateByCode } from "@/api/print";
import { getPrintApplicationForm } from "@/api/workFlow.js";
export default {
computed: {
...mapGetters(["dqhj", "yjsqOptions", "userInfo"]),
......@@ -225,6 +249,31 @@
this.$set(this.tableData[this.currentindex], "shyj", val);
}
},
handlePrint(){
getPrintTemplateByCode({ tmpno: 'spb' }).then(res => {
if (res.code === 200) {
getSpyjdy(this.propsParam.bsmBusiness).then(infoRes => {
if (infoRes.code === 200) {
let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
// 装载第一个模板并设置数据
LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent);
for (let key in infoRes.result) {
LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[key]);
}
// 进行预览
LODOP.PREVIEW();
} else {
this.$message.error(infoRes.message);
}
});
} else {
this.$message.error(res.message);
}
})
},
},
};
</script>
......