王震
2023-11-20 e1e5ccdfef4aefc70f2df86a97cb50ae4e3d2706
src/views/quality/finishedProductInspection/index.vue
@@ -217,18 +217,20 @@
            },
            //打印按钮
            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,
                    style: '@page {margin: 2.0mm 2.0mm}',
                    maxWidth: 1000,
                    // printSettings,
                    style: '@page {margin: 10mm 5mm;size:A4;}',
                    targetStyles: ["*"],
                    // importCSS: true,
                    fontSize: '30px',
                    ignoreElements: ["no-ignore"],
                    orientation: 'portrait'
                });
@@ -239,10 +241,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(){