王震
2023-11-17 2c25d4e4112fce9b00ec8ffefde6461a8b193d8f
src/views/quality/finishedProductInspection/index.vue
@@ -217,14 +217,19 @@
            },
            //打印按钮
            printFun() {
            // this.printDialogVisible = false;
            // const imgWidth = 841.89 - margin * 2
            // const imgHeight = 841.89 / (canvas.width / canvas.height) - margin * 2
                const printSettings = {
                        paper: {
                        width: 827, // A4纸的宽度(单位:像素)
                        height: 595, // A4纸的高度(单位:像素)
                        orientation: 'portrait', // 竖向打印
                        }}
                PrintJS({
                    printable: "printRaw",
                    type: "html",
                    header:"",
                    maxWidth: 950,
                    printSettings,
                    style: '@page {margin: 2.0mm 2.0mm}',
                    targetStyles: ["*"],
                    // importCSS: true,
@@ -239,10 +244,8 @@
                    this.printFormData = res.data.data
                    this.printFormData.createTime = row.createTime
                    this.printFormData.updateTime = row.updateTime
                    // console.log(this.printFormData,"7777777777=====");
                    this.printDialogVisible = true
                }).catch(error=>{
                    // console.log(error);
                })
            },
            exportExcel(){