style:打印
Showing
3 changed files
with
41 additions
and
30 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-08-25 10:34:46 | 4 | * @LastEditTime: 2023-08-25 14:43:39 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -26,6 +26,10 @@ | ... | @@ -26,6 +26,10 @@ |
26 | <canvas ref="zs" width="1000" class="zsyl" height="700"></canvas> | 26 | <canvas ref="zs" width="1000" class="zsyl" height="700"></canvas> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | <!-- 打印模板需要此模块 --> | ||
30 | <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false"> | ||
31 | <embed id="LODOP_EM" type="application/x-print-lodop" width="1180" height="720" pluginspage="install_lodop32.exe" /> | ||
32 | </object> | ||
29 | <div class="text-center pt-10"> | 33 | <div class="text-center pt-10"> |
30 | <el-button @click="$popupCacel">取消</el-button> | 34 | <el-button @click="$popupCacel">取消</el-button> |
31 | <el-button type="primary" @click="handleSubmit">确定</el-button> | 35 | <el-button type="primary" @click="handleSubmit">确定</el-button> |
... | @@ -36,6 +40,8 @@ | ... | @@ -36,6 +40,8 @@ |
36 | <script> | 40 | <script> |
37 | import store from '@/store/index.js' | 41 | import store from '@/store/index.js' |
38 | import { datas } from "../../javascript/zsyl.js"; | 42 | import { datas } from "../../javascript/zsyl.js"; |
43 | import { getPrintTemplateByCode } from "@/api/print"; | ||
44 | import { getLodop } from "@/utils/LodopFuncs" | ||
39 | import { readYsxlh, certificate, getSlsqBdcqzList } from "@/api/bdcqz.js"; | 45 | import { readYsxlh, certificate, getSlsqBdcqzList } from "@/api/bdcqz.js"; |
40 | export default { | 46 | export default { |
41 | props: { | 47 | props: { |
... | @@ -89,7 +95,6 @@ | ... | @@ -89,7 +95,6 @@ |
89 | } | 95 | } |
90 | }) | 96 | }) |
91 | }, | 97 | }, |
92 | //获取受理申请下全部不动产权证 | ||
93 | /** | 98 | /** |
94 | * @description: 获取受理申请下全部不动产权证 | 99 | * @description: 获取受理申请下全部不动产权证 |
95 | * @author: renchao | 100 | * @author: renchao |
... | @@ -189,29 +194,9 @@ | ... | @@ -189,29 +194,9 @@ |
189 | }) | 194 | }) |
190 | }) | 195 | }) |
191 | } | 196 | } |
192 | // context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 129, 429); | ||
193 | // 权利其他状态 | 197 | // 权利其他状态 |
194 | const maxWidth = 332; // 最大宽度限制 | 198 | const maxWidth = 332; // 最大宽度限制 |
195 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; | 199 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; |
196 | // lines.forEach((line, index) => { | ||
197 | // const y = 463 + (index * 33); // 每行文本的垂直位置 | ||
198 | // let currentLine = ''; | ||
199 | // let arr = []; | ||
200 | // for (let word of line) { | ||
201 | // const testLine = currentLine + word; | ||
202 | // const lineWidth = context.measureText(testLine).width; | ||
203 | // if (lineWidth <= maxWidth) { | ||
204 | // currentLine = testLine; | ||
205 | // } else { | ||
206 | // arr.push(currentLine); | ||
207 | // currentLine = word; | ||
208 | // } | ||
209 | // } | ||
210 | // arr.push(currentLine); | ||
211 | // arr.forEach((line, index) => { | ||
212 | // context.fillText(line, 129, y + (index * 17)); // 调整行高 | ||
213 | // }) | ||
214 | // }) | ||
215 | for (let i = 0; i < lines.length; i++) { | 200 | for (let i = 0; i < lines.length; i++) { |
216 | if (getByteLen(lines[i]) > 41) { | 201 | if (getByteLen(lines[i]) > 41) { |
217 | let currentLine = ''; | 202 | let currentLine = ''; |
... | @@ -350,19 +335,44 @@ | ... | @@ -350,19 +335,44 @@ |
350 | handleSubmit () { | 335 | handleSubmit () { |
351 | this.savePrintRecord() | 336 | this.savePrintRecord() |
352 | }, | 337 | }, |
353 | //保存打印记录 | ||
354 | /** | 338 | /** |
355 | * @description: 保存打印记录 | 339 | * @description: 保存打印记录 |
356 | * @author: renchao | 340 | * @author: renchao |
357 | */ | 341 | */ |
358 | savePrintRecord () { | 342 | savePrintRecord () { |
343 | let that = this | ||
359 | this.ruleForm.bsmBdcqz = this.formData.bdcqz.bsmBdcqz; | 344 | this.ruleForm.bsmBdcqz = this.formData.bdcqz.bsmBdcqz; |
360 | this.ruleForm.bdcqzlx = this.formData.bdcqz.bdcqzlx; | 345 | this.ruleForm.bdcqzlx = this.formData.bdcqz.bdcqzlx; |
361 | this.ruleForm.szzh = this.formData.bdcqz.bdcqzh; | 346 | this.ruleForm.szzh = this.formData.bdcqz.bdcqzh; |
362 | certificate(this.ruleForm).then((res) => { | 347 | certificate(this.ruleForm).then((res) => { |
363 | if (res.code === 200) { | 348 | if (res.code === 200) { |
364 | this.$popupCacel() | 349 | that.$popupCacel() |
365 | this.$message.success("提交成功") | 350 | // this.$message.success("提交成功") |
351 | getPrintTemplateByCode({ tmpno: 'zsdy' }).then(res => { | ||
352 | if (res.code == 200) { | ||
353 | getSlsqBdcqzList({ bsmSlsq: this.formData.bsmSlsq }).then(infoRes => { | ||
354 | if (infoRes.code == 200) { | ||
355 | if (infoRes.result && infoRes.result.length > 0) { | ||
356 | //打开模板设计 | ||
357 | let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM')); | ||
358 | LODOP.ADD_PRINT_DATA("ProgramData", res.result.tmpcontent); //装载模板 | ||
359 | |||
360 | infoRes.result[0].bdcdyh1 = infoRes.result[0].bdcdyh.slice(0, 6) + ' ' + infoRes.result[0].bdcdyh.slice(6, 12) + ' ' + | ||
361 | infoRes.result[0].bdcdyh.slice(12, 19) + ' ' + infoRes.result[0].bdcdyh.slice(19, infoRes.result[0].bdcdyh.length) | ||
362 | //todo 调取后端接口获取数据 循环set | ||
363 | for (let key in infoRes.result[0]) { | ||
364 | LODOP.SET_PRINT_STYLEA(key, "CONTENT", infoRes.result[0][key]); | ||
365 | } | ||
366 | LODOP.PREVIEW(); | ||
367 | that.$popupCacel() | ||
368 | } | ||
369 | } | ||
370 | }) | ||
371 | } else { | ||
372 | this.$message.error(res.message) | ||
373 | } | ||
374 | }) | ||
375 | |||
366 | //刷新列表 | 376 | //刷新列表 |
367 | store.dispatch('user/reWorkFresh', true) | 377 | store.dispatch('user/reWorkFresh', true) |
368 | } else { | 378 | } else { | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-08-25 13:19:14 | 4 | * @LastEditTime: 2023-08-25 14:10:54 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;"> | 7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;"> |
... | @@ -406,7 +406,7 @@ | ... | @@ -406,7 +406,7 @@ |
406 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; | 406 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; |
407 | if (lines[0]) { | 407 | if (lines[0]) { |
408 | lines[0].split(' ').forEach((line, index) => { | 408 | lines[0].split(' ').forEach((line, index) => { |
409 | const y = 415 + (index * 60); // 每行文本的垂直位置 | 409 | const y = 415 + (index * 30); // 每行文本的垂直位置 |
410 | let currentLine = ''; | 410 | let currentLine = ''; |
411 | let arr = []; | 411 | let arr = []; |
412 | for (let word of line) { | 412 | for (let word of line) { |
... | @@ -421,13 +421,13 @@ | ... | @@ -421,13 +421,13 @@ |
421 | } | 421 | } |
422 | arr.push(currentLine); | 422 | arr.push(currentLine); |
423 | arr.forEach((line, index) => { | 423 | arr.forEach((line, index) => { |
424 | context.fillText(line, 775, y + (index * 23)); // 调整行高 | 424 | context.fillText(line, 775, y + (index * 14)); // 调整行高 |
425 | }); | 425 | }); |
426 | }); | 426 | }); |
427 | } | 427 | } |
428 | 428 | ||
429 | lines.slice(1).forEach((line, index) => { | 429 | lines.slice(1).forEach((line, index) => { |
430 | const y = ((parseInt(lines[0].length) / 19) * 22) + 415 + (index * 30); // 每行文本的垂直位置 | 430 | const y = ((parseInt(lines[0].length) / 19) * 22) + 415 + (index * 20); // 每行文本的垂直位置 |
431 | let currentLine = ''; | 431 | let currentLine = ''; |
432 | let arr = []; | 432 | let arr = []; |
433 | for (let word of line) { | 433 | for (let word of line) { | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-08-24 15:38:52 | 4 | * @LastEditTime: 2023-08-25 14:03:00 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="szxx"> | 7 | <div class="szxx"> |
... | @@ -75,6 +75,7 @@ | ... | @@ -75,6 +75,7 @@ |
75 | <script> | 75 | <script> |
76 | import { mapGetters } from 'vuex' | 76 | import { mapGetters } from 'vuex' |
77 | import store from '@/store/index.js' | 77 | import store from '@/store/index.js' |
78 | import { getPrintTemplateByCode } from "@/api/print"; | ||
78 | import { getSlsqBdcqzList, invalidCertificate } from "@/api/bdcqz.js"; | 79 | import { getSlsqBdcqzList, invalidCertificate } from "@/api/bdcqz.js"; |
79 | export default { | 80 | export default { |
80 | props: {}, | 81 | props: {}, | ... | ... |
-
Please register or sign in to post a comment