公章显示

This commit is contained in:
hongchao 2024-12-25 13:50:18 +08:00
parent 15e7c52540
commit d9dc57e7b0
1 changed files with 46 additions and 9 deletions

View File

@ -490,7 +490,7 @@
append-to-body
>
<div style="height: 500px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<vue-easy-print tableShow ref="remarksPrintRefCheck" class="print">
<div
class="title"
style="text-align: center; font-weight: 600; font-size: 16px"
@ -554,11 +554,11 @@
justify-content: right;
"
>
<div class="item" style="width: 33%">
<div class="item" style="width: 33%; display: flex; align-items: center;">
<div>
<span>检验单位</span>
<span>检验单位xxxxxxxx</span>
</div>
<div style="position: absolute; top: 0%; left: 25%">
<div >
<canvas id="canvas" width="180" height="180"></canvas>
</div>
</div>
@ -568,7 +568,7 @@
</div>
<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>
</div>
</el-dialog>
@ -951,9 +951,7 @@ export default {
created() {
this.getList();
},
mounted() {
chapter('机具检验专用章', '重庆送变电工程有限公司')
},
methods: {
//
handleSelectionChange(selection) {
@ -1171,6 +1169,9 @@ export default {
handlePrint(row) {
// this.query.taskId = row.taskId
// this.getPrintTable(row.taskId)
setTimeout(() => {
chapter('机具检验专用章', '重庆送变电工程有限公司')
}, 100);
this.openPrint = true;
this.title = "出库检验单";
},
@ -1186,7 +1187,43 @@ export default {
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() {
this.$refs.remarksPrintRef.print();
},