王震
2023-11-20 f47d5f26a54cf2e72cd741bca541ded5f6a4b743
src/views/quality/finishedProductInspection/index.vue
@@ -211,24 +211,15 @@
        }
    },
      methods: {
            closedown(){
                // this.printFormData = []
                this.printDialogVisible = false;
            },
            //打印按钮
            printFun() {
            // this.printDialogVisible = false;
            // const imgWidth = 841.89 - margin * 2
            // const imgHeight = 841.89 / (canvas.width / canvas.height) - margin * 2
                PrintJS({
                    printable: "printRaw",
                    type: "html",
                    header:"",
                    maxWidth: 950,
                    style: '@page {margin: 2.0mm 2.0mm}',
                    maxWidth: 1000,
                    // header: "产品检测报告",
                    style: '@page {margin: 10mm 5mm; margin-bottom: 0;margin-top:0;}',
                    targetStyles: ["*"],
                    // importCSS: true,
                    fontSize: '30px',
                    ignoreElements: ["no-ignore"],
                    orientation: 'portrait'
                });
@@ -239,10 +230,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(){