| | |
| | | }, |
| | | //打印按钮 |
| | | 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' |
| | | }); |
| | |
| | | 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(){ |