公章显示
This commit is contained in:
parent
15e7c52540
commit
d9dc57e7b0
|
|
@ -490,7 +490,7 @@
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
<div style="height: 500px; overflow-y: scroll">
|
<div style="height: 500px; overflow-y: scroll">
|
||||||
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
<vue-easy-print tableShow ref="remarksPrintRefCheck" class="print">
|
||||||
<div
|
<div
|
||||||
class="title"
|
class="title"
|
||||||
style="text-align: center; font-weight: 600; font-size: 16px"
|
style="text-align: center; font-weight: 600; font-size: 16px"
|
||||||
|
|
@ -554,11 +554,11 @@
|
||||||
justify-content: right;
|
justify-content: right;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="item" style="width: 33%">
|
<div class="item" style="width: 33%; display: flex; align-items: center;">
|
||||||
<div>
|
<div>
|
||||||
<span>检验单位:</span>
|
<span>检验单位:xxxxxxxx</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: absolute; top: 0%; left: 25%">
|
<div >
|
||||||
<canvas id="canvas" width="180" height="180"></canvas>
|
<canvas id="canvas" width="180" height="180"></canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -568,7 +568,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||||
<el-button type="primary" @click="print">打 印</el-button>
|
<el-button type="primary" @click="printCheck">打 印</el-button>
|
||||||
<el-button @click="openPrint = false">关 闭</el-button>
|
<el-button @click="openPrint = false">关 闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -951,9 +951,7 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
chapter('机具检验专用章', '重庆送变电工程有限公司')
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
|
|
@ -1171,6 +1169,9 @@ export default {
|
||||||
handlePrint(row) {
|
handlePrint(row) {
|
||||||
// this.query.taskId = row.taskId
|
// this.query.taskId = row.taskId
|
||||||
// this.getPrintTable(row.taskId)
|
// this.getPrintTable(row.taskId)
|
||||||
|
setTimeout(() => {
|
||||||
|
chapter('机具检验专用章', '重庆送变电工程有限公司')
|
||||||
|
}, 100);
|
||||||
this.openPrint = true;
|
this.openPrint = true;
|
||||||
this.title = "出库检验单";
|
this.title = "出库检验单";
|
||||||
},
|
},
|
||||||
|
|
@ -1186,7 +1187,43 @@ export default {
|
||||||
console.log(this.leaseApplyData);
|
console.log(this.leaseApplyData);
|
||||||
},
|
},
|
||||||
|
|
||||||
//打印
|
//出库检验单打印
|
||||||
|
printCheck() {
|
||||||
|
// 获取打印内容的容器
|
||||||
|
const printContent = this.$refs.remarksPrintRefCheck.$el;
|
||||||
|
|
||||||
|
// 获取公章canvas元素
|
||||||
|
const canvas = document.getElementById('canvas');
|
||||||
|
// 将canvas转换为图像
|
||||||
|
const imgData = canvas.toDataURL('image/png');
|
||||||
|
// 创建一个新的图像元素
|
||||||
|
const img = new Image();
|
||||||
|
img.src = imgData;
|
||||||
|
|
||||||
|
// 等待图像加载完成
|
||||||
|
img.onload = () => {
|
||||||
|
console.log('Image loaded:', img);
|
||||||
|
// 将图像插入到打印内容中
|
||||||
|
img.style.display = 'block'; // 确保图像可见
|
||||||
|
img.style.zIndex = '9999'; // 确保图像在最上层
|
||||||
|
// 将图像插入到打印内容中
|
||||||
|
printContent.appendChild(img);
|
||||||
|
console.log('content:', printContent.innerHTML);
|
||||||
|
// 调用打印方法
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.remarksPrintRefCheck.print({
|
||||||
|
// 自定义打印内容
|
||||||
|
content: printContent.innerHTML
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
|
||||||
|
// 打印完成后移除图像
|
||||||
|
printContent.removeChild(img);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
//领料单打印
|
||||||
print() {
|
print() {
|
||||||
this.$refs.remarksPrintRef.print();
|
this.$refs.remarksPrintRef.print();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue