d48fc4a2 by tianhaohao@pashanhoo.com

修改证书打印缮证发证组件分类

1 parent 2017bf6c
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-15 15:41:43
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中...">
<!-- 表单部分 -->
<el-tabs v-model="activeName" @tab-click="handleClick" v-if="headTabBdcqz.length >1" style="margin-top:-15px">
<el-tab-pane :label="item.qlr + (item.bdcqzh !== null ? '(' + item.bdcqzh + ')' : '')" :name="item.bsmBdcqz"
v-for="(item, index) in headTabBdcqz" :key="index">
</el-tab-pane>
</el-tabs>
<el-empty description="暂无数据" v-if="headTabBdcqz.length == 0 && noData"></el-empty>
<div v-else>
<div style="height:540px">
<el-form class="zs" :model="bdcqz" v-if="this.bdcqz.bdcqzlx==1" ref="ruleForm" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="权利人">
<el-input v-model="bdcqz.qlr"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="共有情况">
<el-select v-model="bdcqz.gyqk" class="width100" placeholder="请选择">
<el-option
v-for="item in gyqkList"
:key="item.dcode"
:label="item.dname"
:value="item.dcode">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="坐落">
<el-input v-model="bdcqz.zl"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="不动产单元号">
<el-input v-model="bdcqz.bdcdyh"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="权利类型">
<el-input v-model="bdcqz.qllx"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="权利性质 ">
<el-input v-model="bdcqz.qlxz"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="用途">
<el-input v-model="bdcqz.yt"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="面积">
<el-input v-model="bdcqz.mj"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="使用期限 ">
<el-input v-model="bdcqz.syqx"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="权利其他状况">
<el-input v-model="bdcqz.qlqtzk" :rows="4" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="附记">
<el-input v-model="bdcqz.fj" :rows="4" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form :model="bdcqz" class="zm" v-else ref="ruleForm" label-width="110px">
<el-row>
<el-col :span="24">
<el-form-item label="证明权利或事项">
<el-input v-model="bdcqz.zmqlhsx"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="权利人(申请人)">
<el-input v-model="bdcqz.qlr"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="义务人">
<el-input v-model="bdcqz.ywr"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="坐落">
<el-input v-model="bdcqz.zl"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="不动产单元号">
<el-input v-model="bdcqz.bdcdyh"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="其他状况">
<el-input v-model="bdcqz.qlqtzk" :rows="6" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="附记">
<el-input v-model="bdcqz.fj" :rows="6" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div style="text-align:center">
<el-button @click="$popupCacel">取消</el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
</div>
</div>
</div>
</template>
<script>
import store from '@/store/index.js'
import { getSlsqBdcqzList, editBdcqz } from "@/api/bdcqz.js"
export default {
name: "zsxg",
props: {
formData: {
type: Object,
default: {}
}
},
data () {
return {
gyqkList: store.getters.dictData['A34'],
key: 0,
noData: false,
loading: false,
bdcqz: {},
//tab切换栏数组
headTabBdcqz: [],
//tab选择绑定值
activeName: '',
}
},
mounted () {
this.getHeadTabBdcqz()
},
methods: {
/**
* @description: 获取受理申请下全部不动产权证
* @author: renchao
*/
getHeadTabBdcqz () {
this.loading = true
getSlsqBdcqzList({ bsmSlsq: this.formData.bsmSlsq }).then(res => {
if (res.code == 200) {
this.noData = true
if (res.result && res.result.length > 0) {
this.bdcqz = res.result[0]
this.headTabBdcqz = _.cloneDeep(res.result)
if (this.formData.bsmBdcqz) {
this.activeName = this.formData.bsmBdcqz
} else {
this.activeName = res.result[0].bsmBdcqz
}
}
}
this.loading = false
})
},
handleClick (tab) {
this.bdcqz = _.cloneDeep(this.headTabBdcqz[tab.index])
},
handleSubmit () {
editBdcqz(this.bdcqz).then(res => {
if (res.code == 200) {
this.$message.success('保存成功');
//刷新列表
this.$popupCacel()
} else {
this.$message.error(res.message)
}
})
}
}
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
</style>
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-02-06 13:23:44
-->
<template>
<div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="text-align: center;">
<!-- 表单部分 -->
<div style="margin-top:-20px">
<el-tabs v-model="activeName" @tab-click="handleClick" v-if="headTabBdcqz.length >1">
<el-tab-pane :label="item.qlr + (item.bdcqzh !== null ? '(' + item.bdcqzh + ')' : '')" :name="item.bsmBdcqz"
v-for="(item, index) in headTabBdcqz" :key="index">
</el-tab-pane>
</el-tabs>
</div>
<el-empty description="暂无数据" v-if="headTabBdcqz.length == 0 && noData"></el-empty>
<div style="max-height:89vh;overflow-y:auto">
<div v-show="this.bdcqz.bdcqzlx==1">
<el-tabs v-model="activeTitle">
<el-tab-pane label="第一页" name="title1"></el-tab-pane>
<el-tab-pane label="第二页" name="title2"></el-tab-pane>
</el-tabs>
<div style="width:1169px;overflow-x: hidden;">
<canvas ref="zs1" width="1024" v-show="activeTitle=='title1'" height="739"></canvas>
<canvas ref="zs" width="1024" v-show="activeTitle=='title2'" height="739"></canvas>
</div>
</div>
<div style="width:1169px;overflow-x: hidden;" v-show="this.bdcqz.bdcqzlx==2">
<canvas ref="zm" width="1169" height="828"></canvas>
</div>
</div>
</div>
</template>
<script>
import QRCode from 'qrcode'
import { datas } from "../../javascript/zsyl.js";
import { getSlsqBdcqzList } from "@/api/bdcqz.js"
export default {
name: "zsyl",
props: {
formData: {
type: Object,
default: {}
}
},
data () {
return {
activeTitle: 'title1',
key: 0,
noData: false,
imgSrc1: require('@/image/bdcqz/bdcqzs1.jpg'),
imgSrc: require('@/image/bdcqz/bdcqzs2.jpg'),
bdczmSrc: require('@/image/bdcqz/bdczm.jpg'),
loading: false,
//印刷序列号集合
ysxlh: [],
//列名称对象
columns: [],
//选择的不动产权证文件
bdcqz: '',
//证书打开类型 是否需要展示打印按钮
isToPrint: false,
//tab切换栏数组
headTabBdcqz: [],
//tab选择绑定值
activeName: '',
//证书图片预览
previewImage: '',
ruleForm: {
bsmBdcqz: '',
szmc: '不动产权证书',
szzh: '',
ysxlh: '',
},
}
},
mounted () {
this.columns = datas.columns();
if (this.formData.bdcqz) {
//从缮证进入
this.bdcqz = this.formData.bdcqz
} else {
//从按钮进入
this.getHeadTabBdcqz();
}
},
methods: {
/**
* @description: 获取证书内容
* @param {*} code
* @author: renchao
*/
getRowValue (code) {
var value = this.bdcqz[code];
return value;
},
/**
* @description: 获取受理申请下全部不动产权证
* @author: renchao
*/
getHeadTabBdcqz () {
this.loading = true
getSlsqBdcqzList({ bsmSlsq: this.formData.bsmSlsq }).then(res => {
if (res.code == 200) {
this.noData = true
if (res.result && res.result.length > 0) {
this.bdcqz = res.result[0]
this.headTabBdcqz = res.result
if (this.formData.bsmBdcqz) {
this.activeName = this.formData.bsmBdcqz
} else {
this.activeName = res.result[0].bsmBdcqz
}
if (this.bdcqz.bdcqzlx == 1) {
this.drawTextOnImage()
} else {
this.drawTextzmImage()
}
}
}
this.loading = false
})
},
/**
* @description: tab表头切换方法
* @param {*} e
* @author: renchao
*/
handleClick (tab, event) {
this.bdcqz = this.headTabBdcqz[tab.index]
if (this.bdcqz.bdcqzlx == 1) {
this.drawTextOnImage()
} else {
this.drawTextzmImage()
}
},
/**
* @description: 不动产证书
* @author: renchao
*/
drawTextOnImage1 () {
const canvas = this.$refs.zs1;
const context = canvas.getContext('2d');
const image = new Image();
image.onload = () => {
context.drawImage(image, 0, 0);
context.font = '18px 楷体';
context.fillStyle = '#000000';
let date = this.bdcqz.djsj.split(' ')[0].split('/');
let nian = date[0]
let yue = date[1]
let ri = date[2]
this.bdcqz.nian = nian
this.bdcqz.yue = yue
this.bdcqz.ri = ri
context.fillText(nian ? nian : '', 780, 499);
context.fillText(yue ? yue : '', 840, 499);
context.fillText(ri ? ri : '', 885, 499);
QRCode.toDataURL(this.bdcqz.bdcqzh, { margin: 0 })
.then(url => {
const qrImage = new Image();
this.bdcqz.qrImage = url; // 将二维码图片的 URL 存储到 bdcqz 对象的 qrImage 属性中
qrImage.onload = () => {
context.drawImage(qrImage, 670, 400, 100, 100);
};
qrImage.src = url;
})
.catch(error => {
console.error(error);
});
context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 745, 633);
};
image.src = this.imgSrc1;
},
drawTextOnImage () {
this.drawTextOnImage1()
function getByteLen (val) {
var len = 0;
if (!val) return len;
for (var i = 0; i < val.length; i++) {
var length = val.charCodeAt(i);
if (length >= 0 && length <= 128) {
len += 1;
} else {
len += 2;
}
}
return len;
}
const canvas = this.$refs.zs;
const context = canvas.getContext('2d');
const image = new Image();
image.onload = () => {
context.drawImage(image, 0, 0);
context.font = '18px 楷体';
context.fillStyle = '#000000';
context.fillText(this.bdcqz.sjjc ? this.bdcqz.sjjc : '', 60, 56);
context.fillText(this.bdcqz.djnd ? this.bdcqz.djnd : '', 113, 56);
if (getByteLen(this.bdcqz.sxqc) > 14) {
const originalFont = context.font;
// 设置新的字体大小
context.font = '14px 楷体'; // 替换为你想要的字体和大小
// 绘制 bdcdyh
context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 165, 56);
// 恢复原始字体设置
context.font = originalFont;
} else {
context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 170, 56);
}
context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 370, 56);
context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 129, 97);
context.fillText(this.bdcqz.gyqk ? this.bdcqz.gyqk : '', 129, 136);
this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' +
this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length)
context.fillText(this.bdcdyh ? this.bdcdyh : '', 129, 223);
context.fillText(this.bdcqz.qllx ? this.bdcqz.qllx : '', 129, 263);
context.fillText(this.bdcqz.qlxz ? this.bdcqz.qlxz : '', 129, 303);
context.fillText(this.bdcqz.yt ? this.bdcqz.yt : '', 129, 346);
// context.fillText(this.bdcqz.mj ? this.bdcqz.mj : '', 129, 386);
let lines6 = this.bdcqz.mj ? this.bdcqz.mj.split(' ') : [];
if (getByteLen(this.bdcqz.mj) > 37) {
lines6.forEach((line, index) => {
const y = 378 + (index * 27); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 330) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
} else {
lines6.forEach((line, index) => {
const y = 386 + (index * 27); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 330) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
}
// 权利其他状态
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 38)
if (getByteLen(lines[i]) > 37) {
let currentLine = '';
let arr = [];
for (let word of lines[i]) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 323) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 129, 495 + (29 * (i - 1)) + 4 * num + (index * 14)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 129, 493 + (26 * (i - 1)) + (index * 14)); // 调整行高
})
}
} else {
if (i > 0) {
context.fillText(lines[i] ? lines[i] : '', 129, 500 + 4 * num + (29 * (i - 1)));
} else {
context.fillText(lines[i] ? lines[i] : '', 129, 505 + (27 * (i - 1)));
}
}
}
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 30); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 395) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 580, y + (index * 30)); // 调整行高
})
})
let lines3 = this.bdcqz.syqx ? this.bdcqz.syqx.split(' ') : [];
if (getByteLen(this.bdcqz.syqx) > 37) {
lines3.forEach((line, index) => {
const y = 423 + (index * 27); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 330) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
} else {
lines3.forEach((line, index) => {
const y = 430 + (index * 27); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 315) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
}
let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : [];
if (getByteLen(this.bdcqz.zl) > 37) {
lines2.forEach((line, index) => {
const y = 170 + (index * 20); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 336) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
} else {
lines2.forEach((line, index) => {
const y = 180 + (index * 20); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 336) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 129, y + (index * 20)); // 调整行高
})
})
}
}
image.src = this.imgSrc
},
/**
* @description: 不动产证明
* @author: renchao
*/
drawTextzmImage () {
function getByteLen (val) {
var len = 0;
if (!val) return len;
for (var i = 0; i < val.length; i++) {
var length = val.charCodeAt(i);
if (length >= 0 && length <= 128) {
len += 1;
} else {
len += 2;
}
}
return len;
}
const canvas = this.$refs.zm;
const context = canvas.getContext('2d');
const image = new Image();
image.onload = () => {
context.drawImage(image, 0, 0);
context.font = '18px 楷体';
context.fillStyle = '#000000';
// ysxlh
context.fillText(this.bdcqz.ysxlh ? this.bdcqz.ysxlh : '', 280, 712);
// djsj
if (this.bdcqz.djsj) {
let djsjList = this.bdcqz.djsj.split(' ')[0].split('/')
context.fillText(djsjList[0] ? djsjList[0] : '', 327, 580);
context.fillText(djsjList[1] ? djsjList[1] : '', 393, 580);
context.fillText(djsjList[2] ? djsjList[2] : '', 443, 580);
}
context.fillText(this.bdcqz.sjjc ? this.bdcqz.sjjc : '', 620, 125);
context.fillText(this.bdcqz.djnd ? this.bdcqz.djnd : '', 665, 125);
if (getByteLen(this.bdcqz.sxqc) > 14) {
const originalFont = context.font;
// 设置新的字体大小
context.font = '14px 楷体'; // 替换为你想要的字体和大小
// 绘制 bdcdyh
context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 725, 125);
// 恢复原始字体设置
context.font = originalFont;
} else {
context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 755, 125);
}
context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123);
context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180);
// context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228);
// 权利人
let qlrlines = this.bdcqz.qlr
if (getByteLen(this.bdcqz.qlr) > 32) {
let currentLine = '';
let arr = [];
for (let word of qlrlines) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine); // 将最后一行添加到数组
// 绘制所有行
for (let i = 0; i < arr.length; i++) {
context.fillText(arr[i], 775, 218 + i * 20); // lineHeight 为行高
}
} else {
context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228);
}
// 义务人
// context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275);
let ywrlines = this.bdcqz.ywr
if (getByteLen(this.bdcqz.ywr) > 32) {
let currentLine = '';
let arr = [];
for (let word of ywrlines) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine); // 将最后一行添加到数组
// 绘制所有行
for (let i = 0; i < arr.length; i++) {
context.fillText(arr[i], 775, 268 + i * 20); // lineHeight 为行高
}
} else {
context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275);
}
// context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325);
let lines2 = this.bdcqz.zl ? this.bdcqz.zl.split(' ') : [];
if (getByteLen(this.bdcqz.zl) > 32) {
lines2.forEach((line, index) => {
const y = 315 + (index * 20); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, y + (index * 20)); // 调整行高
})
})
} else {
lines2.forEach((line, index) => {
const y = 325 + (index * 20); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 295) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 775, y + (index * 20)); // 调整行高
})
})
}
// bdcdyh
this.bdcdyh = this.bdcqz.bdcdyh.slice(0, 6) + ' ' + this.bdcqz.bdcdyh.slice(6, 12) + ' ' +
this.bdcqz.bdcdyh.slice(12, 19) + ' ' + this.bdcqz.bdcdyh.slice(19, this.bdcqz.bdcdyh.length)
// context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// 保存当前字体设置
const originalFont = context.font;
// 设置新的字体大小
context.font = '16px 楷体'; // 替换为你想要的字体和大小
// 绘制 bdcdyh
context.fillText(this.bdcdyh ? this.bdcdyh : '', 775, 373);
// 恢复原始字体设置
context.font = originalFont;
// qlqtzk
function getByteLenBdcdy (val) {
var encoder = new TextEncoder('utf-8');
return encoder.encode(val).length;
}
const maxWidth = 295; // 最大宽度限制
let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n').filter(i => i && i.trim()) : [];
let bdcdyNum = Math.ceil(getByteLenBdcdy(lines[0]) / 43)
// 单独处理不动产单元号
let linesBdcdy = lines[0] ? lines[0].split(' ') : [];
if (getByteLenBdcdy(lines[0]) > 43) {
linesBdcdy.forEach((line, index) => {
const y = 412 + (index * 17); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 770, y + (index * 17)); // 调整行高
})
})
} else {
linesBdcdy.forEach((line, index) => {
const y = 418 + (index * 17); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 770, y + (index * 17)); // 调整行高
})
})
}
for (let i = 1; i < lines.length; i++) {
let num = Math.ceil(getByteLen(lines[i]) / 32)
if (getByteLen(lines[i]) > 32) {
let currentLine = '';
let arr = [];
for (let word of lines[i]) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 770, 408 + (bdcdyNum * 15) + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 770, 408 + (bdcdyNum * 15) + (24 * (i - 1)) + (index * 17)); // 调整行高
})
}
} else {
if (i > 0) {
context.fillText(lines[i] ? lines[i] : '', 770, 417 + (bdcdyNum * 15) + 6 * num + (25 * (i - 1)));
} else {
context.fillText(lines[i] ? lines[i] : '', 770, 417 + (bdcdyNum * 15) + (25 * (i - 1)));
}
}
}
// fj
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split('\n').filter(i => i && i.trim()) : [];
for (let i = 0; i < lines1.length; i++) {
let num = Math.ceil(getByteLen(lines1[i]) / 37)
if (getByteLen(lines1[i]) > 37) {
let currentLine = '';
let arr = [];
for (let word of lines1[i]) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= maxWidth) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
if (i > 0) {
arr.forEach((line, index) => {
context.fillText(line, 770, 605 + (24 * (i - 1)) + 5 * num + (index * 17)); // 调整行高
})
} else {
arr.forEach((line, index) => {
context.fillText(line, 770, 605 + (24 * (i - 1)) + (index * 17)); // 调整行高
})
}
} else {
if (i > 0) {
context.fillText(lines1[i] ? lines1[i] : '', 770, 616 + 6 * num + (25 * (i - 1)));
} else {
context.fillText(lines1[i] ? lines1[i] : '', 770, 616 + (25 * (i - 1)));
}
}
}
}
image.src = this.bdczmSrc;
}
}
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
/deep/.el-tabs__nav-wrap::after {
display: none;
}
/deep/.el-tabs__header {
margin: 0;
}
/deep/.el-form-item--small.el-form-item {
margin-bottom: 0;
}
/deep/.mask-content {
padding-top: 10px !important;
}
.imgClass {
display: inline-block;
height: auto;
max-width: 100%;
}
.middle_padding {
padding-bottom: 10px;
}
.zsyl-button {
text-align: center;
margin-top: 20px;
.operation_button {
width: 100px;
border: 1px solid rgb(0, 121, 254);
}
.dy-button {
color: white;
background-color: rgb(0, 121, 254);
}
}
.table-column {
border-spacing: 1px;
width: 100%;
tr td {
border: 1px solid #ccc;
text-align: center;
height: 40px;
padding: 4px;
font-size: 13px;
background: rgb(251, 249, 229);
}
}
.zsyl-title {
background: #fafbe5;
text-align: center;
padding: 5px 0px;
font-size: 20px;
}
.no-data {
font-size: 18px;
display: flex;
text-align: center;
justify-content: center;
}
</style>
......@@ -97,7 +97,7 @@
*/
zslqClick () {
store.dispatch('user/reWorkFresh', false)
this.$popupDialog("不动产权证领取", "workflow/components/dialog/zslq", {}, '80%', true)
this.$popupDialog("不动产权证领取", "workflow/main/fzxx/zslq", {}, '80%', true)
}
}
}
......
......@@ -132,7 +132,7 @@
if (type == 1) {
this.$popupDialog(
"证书证明预览",
"workflow/components/dialog/zsyl",
"workflow/top/zsyl/index",
{ bdcqz: item, bsmSlsq: this.$route.query.bsmSlsq },
'1230px',
true
......@@ -140,7 +140,7 @@
} else {
this.$popupDialog(
"证书证明打印",
"workflow/components/dialog/zsdy",
"workflow/main/szxx/zsdy",
{ ...item },
"76%",
true
......@@ -155,7 +155,7 @@
openInvalidDiglog (item) {
this.$popupDialog(
"证书证明打印",
"workflow/components/dialog/zsdy",
"workflow/main/szxx/zsdy",
{ ...item },
"76%",
true
......@@ -169,7 +169,7 @@
openRecordPop (item) {
this.$popupDialog(
"缮证记录",
"workflow/components/dialog/szRecord",
"workflow/main/szxx/szRecord",
{ bsmBdcqz: item.bsmBdcqz },
"60%",
true
......
......@@ -122,13 +122,13 @@ export default {
this.$popupDialog("登记簿详情", "registerBook/djbFrame", this.currentSelectProps, '80%', true)
break;
case "B5":
this.$popupDialog("证书证明预览", "workflow/components/dialog/zsyl", {
this.$popupDialog("证书证明预览", "workflow/top/zsyl/index", {
bsmSlsq: this.bsmSlsq,
entryType: '1'
}, '1230px', true)
break;
case "B-ZSXG":
this.$popupDialog("证书修改", "workflow/components/dialog/zsxg", { bsmSlsq: this.bsmSlsq, }, '55%', true)
this.$popupDialog("证书修改", "workflow/top/zsxg/index", { bsmSlsq: this.bsmSlsq, }, '55%', true)
break;
case "B6":
this.$popupDialog("打印申请书", "workflow/components/dialog/sqs",
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-23 17:20:01
-->
<template>
<iframe :src="ip +'/txdw/#/' + formData.bsmZd" frameborder="0" style="width: 100%; height:710px;"></iframe>
</template>
<script>
export default {
props: {
formData: {
type: Object,
default: () => {
return {}
}
}
},
data () {
return {
ip: window._config.services.management
}
}
}
</script>
\ No newline at end of file