4e450e2e by 蔡俊立

打印模板

1 parent 7c91f8dd
...@@ -171,3 +171,48 @@ export function setAllRead () { ...@@ -171,3 +171,48 @@ export function setAllRead () {
171 method: 'get' 171 method: 'get'
172 }) 172 })
173 } 173 }
174
175 //获取打印模板列表
176 export function selectPrintTemplateList (data) {
177 return request({
178 url: SERVER.SERVERAPI + '/rest/system/print/selectPrintTemplateList',
179 method: 'post',
180 data
181 })
182 }
183
184 //新增打印模板列表
185 export function addPrintTemplate (data) {
186 return request({
187 url: SERVER.SERVERAPI + '/rest/system/print/addPrintTemplate',
188 method: 'post',
189 data
190 })
191 }
192
193 //编辑打印模板列表
194 export function editPrintTemplate (data) {
195 return request({
196 url: SERVER.SERVERAPI + '/rest/system/print/editPrintTemplate',
197 method: 'post',
198 data
199 })
200 }
201
202 //删除打印模板列表
203 export function delPrintTemplate (params) {
204 return request({
205 url: SERVER.SERVERAPI + '/rest/system/print/delPrintTemplate',
206 method: 'get',
207 params: params
208 })
209 }
210
211 //根据模板编号获取打印模板
212 export function getPrintTemplateByCode (params) {
213 return request({
214 url: SERVER.SERVERAPI + '/rest/system/print/getPrintTemplateByCode',
215 method: 'get',
216 params: params
217 })
218 }
......
1 <template>
2 <dialogBox title="打印模板" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="30%"
3 @closeDialog="closeDialog" v-model="myValue">
4 <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
5 <el-row>
6 <el-col :span="24">
7 <el-form-item label="模板编码:" prop="tmpno">
8 <el-input v-model="ruleForm.tmpno" :disabled="editFlag"></el-input>
9 </el-form-item>
10 </el-col>
11 </el-row>
12 <el-row>
13 <el-col :span="24">
14 <el-form-item label="模板名称:" prop="tmpname">
15 <el-input v-model="ruleForm.tmpname" :disabled="editFlag"></el-input>
16 </el-form-item>
17 </el-col>
18 </el-row>
19 <el-row>
20 <el-col :span="12">
21 <el-form-item label="模板设计:">
22 <el-button type="primary" @click="designByPRGData(ruleForm.tmpcontent)">模板设计</el-button>
23 <i class="el-icon-loading" style="font-size:24px;margin-left:10px;" v-if="loadStatus == '1'"></i>
24 <i class="el-icon-circle-check" style="font-size:24px;margin-left:10px;color:green" v-if="loadStatus == '2'"></i>
25 </el-form-item>
26 </el-col>
27 </el-row>
28 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
29 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe"/>
30 </object>
31 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea>
32 </el-form>
33 </dialogBox>
34 </template>
35
36 <script>
37 import { getLodop } from "@/utils/LodopFuncs"
38 import { mapGetters } from 'vuex'
39 import {addPrintTemplate,editPrintTemplate} from "@/api/system.js"
40 export default {
41 computed: {
42 ...mapGetters(['dictData']),
43 },
44 props: {
45 value: { type: Boolean, default: false },
46 },
47 data () {
48 return {
49 myValue: this.value,
50 editFlag: false,
51 //打印模板设计保存状态 0:未操作 1:保存中 2:已保存
52 loadStatus: '0',
53 //表单提交数据
54 ruleForm: {
55 tmpno: '',
56 tmpname: '',
57 tmpfont: '',
58 tmpfontsize: '',
59 tmpcontent: ''
60 },
61 rules: {
62 tmpno: [
63 { required: true, message: '模板编号不能为空', trigger: 'blur' }
64 ],
65 tmpname: [
66 { required: true, message: '模板名称不能为空', trigger: 'blur' }
67 ],
68 },
69 }
70 },
71 watch: {
72 value (val) {
73 this.myValue = val
74 }
75 },
76 methods: {
77 //表单提交
78 submitForm () {
79 if(this.loadStatus == '1'){
80 return this.$message.error("模板设计保存中,请等待...")
81 }
82 this.$refs.ruleForm.validate(valid => {
83 if (valid) {
84 if(this.editFlag){
85 this.editTemplate();
86 }else{
87 this.addTemplate();
88 }
89 } else {
90 // console.log('error submit!!');
91 return false;
92 }
93 });
94 },
95 //新增
96 addTemplate(){
97 addPrintTemplate(this.ruleForm).then(res => {
98 if(res.code == 200){
99 this.$parent.fetchData();
100 this.$message.success('保存成功');
101 this.closeDialog();
102 }else{
103 this.$message.error(res.message)
104 }
105 })
106 },
107 //编辑
108 editTemplate() {
109 editPrintTemplate(this.ruleForm).then(res => {
110 if(res.code == 200){
111 this.$parent.fetchData();
112 this.$message.success('保存成功');
113 this.closeDialog();
114 }else{
115 this.$message.error(res.message)
116 }
117 })
118 },
119 closeDialog () {
120 this.$emit("input", false);
121 this.ruleForm = {
122 tmpno: '',
123 tmpname: '',
124 tmpfont: '',
125 tmpfontsize: '',
126 tmpcontent: ''
127 },
128 this.loadStatus = '0'
129 this.editFlag = false;
130 },
131 getDetailInfo(item){
132 this.ruleForm = item;
133 this.editFlag = true;
134 },
135 //设计打印模板
136 designByPRGData() {
137 let that = this;
138 that.loadStatus = '1';
139 let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
140 LODOP.ADD_PRINT_DATA("ProgramData",this.ruleForm.tmpcontent); //装载模板
141 //窗口关闭后,回调函数中保存的设计代码
142 if (LODOP.CVERSION)
143 CLODOP.On_Return = function (TaskID, printList) {
144 if (LODOP.CVERSION)
145 LODOP.On_Return = function (TaskID, Value) {
146 document.getElementById("S1").value = Value;
147 };
148 document.getElementById("S1").value = LODOP.GET_VALUE(
149 "ProgramData",
150 0
151 );
152 setTimeout(() => {
153 that.ruleForm.tmpcontent = document.getElementById("S1").value;
154 that.loadStatus = '2';
155 }, 1000);
156 };
157 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后
158 }
159 }
160 }
161 </script>
162 <style scoped lang="scss">
163 @import "~@/styles/mixin.scss";
164
165 .font-red {
166 color: red
167 }
168
169 .middle-margin-bottom {
170 margin-top: 20px
171 }
172 </style>
...@@ -23,38 +23,38 @@ class data extends filter { ...@@ -23,38 +23,38 @@ class data extends filter {
23 } 23 }
24 }, 24 },
25 { 25 {
26 prop: "mbmc", 26 prop: "tmpno",
27 label: "模板编码", 27 label: "模板编码",
28 }, 28 },
29 { 29 {
30 prop: "mblx", 30 prop: "tmpname",
31 label: "模板类型", 31 label: "模板名称",
32 }, 32 },
33 { 33 {
34 prop: "zt", 34 prop: "tmpfont",
35 label: "字体", 35 label: "模板字体",
36 }, 36 },
37 { 37 {
38 prop: "ztdx", 38 prop: "tmpfontsize",
39 label: "字体大小", 39 label: "模板字体大小",
40 }, 40 },
41 { 41 {
42 prop: "zjczsj", 42 prop: "updatetime",
43 label: "最近操作时间", 43 label: "最近操作时间",
44 }, 44 },
45 { 45 {
46 prop: "zjczr", 46 prop: "updater",
47 label: "最近操作人", 47 label: "最近操作人",
48 }, 48 },
49 { 49 {
50 label: '操作', 50 label: '操作',
51 width: '150',
52 align: 'center', 51 align: 'center',
53 fixed: 'right',
54 render: (h, scope) => { 52 render: (h, scope) => {
55 return ( 53 return (
56 <div> 54 <div>
57 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope) }}>设置打印模板</el-button> 55 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.openEditDialog(scope.row) }}>编辑</el-button>
56 {/* <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.DesignByPRGData(scope.row) }}>设计</el-button> */}
57 {/* <el-button type="text" icon="el-icon-delete" onClick={() => { vm.removeTemplate(scope.row) }}>删除</el-button> */}
58 </div> 58 </div>
59 ) 59 )
60 } 60 }
......
1 <template> 1 <template>
2 <div class="dymbgl from-clues-content"> 2 <div class="from-clues">
3 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :heightNum="215" :total="tableData.total" 3 <div class="from-clues-header">
4 <el-form>
5 <el-row>
6 <el-col :span="24" class="btnColRight">
7 <el-form-item>
8 <el-button type="primary" @click="fetchData">查询</el-button>
9 <el-button type="primary" @click="openAddDialog">新增</el-button>
10 </el-form-item>
11 </el-col>
12 </el-row>
13 </el-form>
14 </div>
15 <div class="from-clues-content">
16 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :heightNum="215" :total="tableData.total"
4 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 17 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
5 :data="tableData.data"> 18 :data="tableData.data"></lb-table>
6 </lb-table> 19 </div>
20 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
21 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe"/>
22 </object>
7 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea> 23 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea>
24 <editDialog ref="editDialog" v-model="isDialog" />
8 </div> 25 </div>
9 </template> 26 </template>
10 <script> 27 <script>
11 import { getLodop } from "@/utils/LodopFuncs" 28 import { getLodop } from "@/utils/LodopFuncs"
12 import table from "@/utils/mixin/table" 29 import table from "@/utils/mixin/table"
13 import { datas, sendThis } from "./dymbgl" 30 import { datas, sendThis } from "./dymbgl"
31 import editDialog from "./components/editDialog.vue";
32 import {selectPrintTemplateList,delPrintTemplate} from "@/api/system.js"
14 export default { 33 export default {
15 name: "djbcx", 34 name: "dymbgl",
16 mixins: [table], 35 mixins: [table],
17 mounted () { 36 components: {editDialog},
18 sendThis(this);
19 },
20 data () { 37 data () {
21 return { 38 return {
22 isDialog: false, 39 isDialog: false,
...@@ -24,34 +41,82 @@ export default { ...@@ -24,34 +41,82 @@ export default {
24 tableData: { 41 tableData: {
25 total: 0, 42 total: 0,
26 columns: datas.columns(), 43 columns: datas.columns(),
27 data: [ 44 data: []
28 {
29 slsj: "2022-5-12",
30 }
31 ]
32 }, 45 },
46 printItem: "",
33 printList: { 47 printList: {
34 year: '', 48
35 month: '',
36 day: '',
37 bh: '', // 编号
38 xzq: '',
39 xh: '',
40 d: '',
41 h: '',
42
43 qlr: '',
44 ywr: '',
45 zl: '',
46 bdcdyh: '',
47 qt: '',
48 fj: '',
49 zmsx: "证明事项",
50 }, 49 },
51 } 50 }
52 }, 51 },
52 mounted(){
53 sendThis(this);
54 this.fetchData()
55 },
53 methods: { 56 methods: {
54 fetchData () { 57 fetchData () {
58 selectPrintTemplateList({...this.pageData}).then(res => {
59 if(res.code == 200){
60 let { total, records } = res.result
61 this.tableData.total = total ? total : 0
62 this.tableData.data = records ? records : []
63 }
64 })
65 },
66 //打开新增弹窗
67 openAddDialog(){
68 this.isDialog = true;
69 },
70 //打开编辑弹窗
71 openEditDialog(item){
72 this.isDialog = true;
73 this.$nextTick(() => {
74 this.$refs.editDialog.getDetailInfo(item);
75 })
76 },
77 //删除数据
78 removeTemplate(item){
79 this.$confirm("确定要删除吗, 是否继续?", "提示", {
80 confirmButtonText: "确定",
81 cancelButtonText: "取消",
82 type: "warning",
83 }).then(() => {
84 delPrintTemplate({bsmTmp: item.bsmTmp}).then((res) => {
85 if (res.code == 200) {
86 this.$message.success("删除成功");
87 this.fetchData();
88 } else {
89 this.$message.error(res.message);
90 }
91 });
92 })
93 .catch(() => {
94 this.$message({
95 type: "info",
96 message: "已取消删除",
97 });
98 });
99 },
100 //设计打印模板
101 DesignByPRGData(item) {
102 let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
103 LODOP.ADD_PRINT_DATA("ProgramData",item.tmpcontent); //装载模板
104 //窗口关闭后,回调函数中保存的设计代码
105 if (LODOP.CVERSION)
106 CLODOP.On_Return = function (TaskID, printList) {
107 if (LODOP.CVERSION)
108 LODOP.On_Return = function (TaskID, Value) {
109 document.getElementById("S1").value = Value;
110 };
111 document.getElementById("S1").value = LODOP.GET_VALUE(
112 "ProgramData",
113 0
114 );
115 setTimeout(() => {
116 item.tmpcontent = document.getElementById("S1").value;
117 }, 1000);
118 };
119 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后
55 }, 120 },
56 editClick () { 121 editClick () {
57 let LODOP = getLodop(); 122 let LODOP = getLodop();
...@@ -95,18 +160,9 @@ export default { ...@@ -95,18 +160,9 @@ export default {
95 }; 160 };
96 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 161 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后
97 }, 162 },
98 handlePrint () {
99 let LODOP = getLodop();
100 // LODOP.ADD_PRINT_DATA("ProgramData", getSession("printValue"));
101 LODOP.PREVIEW();
102 },
103 }, 163 },
104 }; 164 };
105 </script> 165 </script>
106 <style scoped lang="scss"> 166 <style scoped lang="scss">
107 @import "~@/styles/public.scss"; 167 @import "~@/styles/public.scss";
108
109 .dymbgl {
110 margin-top: -1px;
111 }
112 </style> 168 </style>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
5 <el-tab-pane :label="item.qlr + '(' + item.bdcqzh + ')'" :name="item.bsmBdcqz" v-for="(item,index) in headTabBdcqz" :key="index"></el-tab-pane> 5 <el-tab-pane :label="item.qlr + '(' + item.bdcqzh + ')'" :name="item.bsmBdcqz" v-for="(item,index) in headTabBdcqz" :key="index"></el-tab-pane>
6 </el-tabs> 6 </el-tabs>
7 <!-- <div class="zsyl-title">{{bdcqz.bdcqzlx == '1' ? '不动产权证书' : '不动产权证明'}}</div> --> 7 <!-- <div class="zsyl-title">{{bdcqz.bdcqzlx == '1' ? '不动产权证书' : '不动产权证明'}}</div> -->
8 <div class="no-data">暂无数据</div>
8 <img :src="previewImage" class="imgClass"> 9 <img :src="previewImage" class="imgClass">
9 </div> 10 </div>
10 </template> 11 </template>
...@@ -137,4 +138,11 @@ export default { ...@@ -137,4 +138,11 @@ export default {
137 padding: 5px 0px; 138 padding: 5px 0px;
138 font-size: 20px; 139 font-size: 20px;
139 } 140 }
141
142 .no-data{
143 font-size:18px;
144 display: flex;
145 text-align: center;
146 justify-content: center;
147 }
140 </style> 148 </style>
......
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";
4 import { getLodop } from "@/utils/LodopFuncs"
3 import { 5 import {
4 leftMenu, 6 leftMenu,
5 stepExpandInfo, 7 stepExpandInfo,
...@@ -132,8 +134,21 @@ export default { ...@@ -132,8 +134,21 @@ export default {
132 }, '1070px') 134 }, '1070px')
133 break; 135 break;
134 case "B6": 136 case "B6":
135 popupDialog("打印申请书", "workflow/components/printApplication", this.currentSelectProps 137 //根据编号获取对应信息
136 , '1070px') 138 getPrintTemplateByCode({tmpno: 'dysqs'}).then(res => {
139 if(res.code == 200){
140 //打开模板设计
141 let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
142 LODOP.ADD_PRINT_DATA("ProgramData",res.result.tmpcontent); //装载模板
143
144 //todo 调取后端接口获取数据 循环set
145
146 LODOP.SET_PRINT_STYLEA("qlrmc","CONTENT","计划大河风流看");
147 LODOP.PREVIEW();
148 }else{
149 this.$message.error(res.message)
150 }
151 })
137 break; 152 break;
138 case "B7": 153 case "B7":
139 this.$popup("证书领取", "workflow/components/zslq", { 154 this.$popup("证书领取", "workflow/components/zslq", {
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
68 </div> 68 </div>
69 </div> 69 </div>
70 </div> 70 </div>
71 <!-- 打印模板需要此模块 -->
72 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
73 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe"/>
74 </object>
71 <fqsqDialog v-model="isDialog" :djywbm="$route.query.sqywbm" :isJump="true" @updateDialog="updateDialog" /> 75 <fqsqDialog v-model="isDialog" :djywbm="$route.query.sqywbm" :isJump="true" @updateDialog="updateDialog" />
72 </div> 76 </div>
73 </template> 77 </template>
......