| | |
| | | import { transform } from '@/util/fileTransform' |
| | | import printTemplate from './finishedProducter-print.vue' |
| | | import PrintJS from 'print-js' |
| | | import { title } from 'process' |
| | | export default { |
| | | components: { |
| | | finishedProductInspectionAdd, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | closedown(){ |
| | | // this.printFormData = [] |
| | | this.printDialogVisible = false; |
| | | }, |
| | | //打印按钮 |
| | | printFun() { |
| | | this.printDialogVisible = false; |
| | | const style = '@page {margin: 10mm 5mm; margin-bottom: 0;margin-top:0;} ' +'@media print {.title{font-size:30pt;font-weight: 400;font-family: 黑体;!important;}' ; |
| | | PrintJS({ |
| | | printable: "printRaw", |
| | | type: "html", |
| | | maxWidth: 950, |
| | | style: '@page {margin: 2.0mm 2.0mm}', |
| | | scanStyles: false, |
| | | maxWidth: 1200, |
| | | header: "产品检测报告", |
| | | style:style, |
| | | css:'./title.css', |
| | | 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(){ |