| | |
| | | <printTemplate id="printRaw" :formData="printFormData"></printTemplate> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="()=>{printDialogVisible = false;this.printFormData=null}">取 消</el-button> |
| | | <el-button @click="()=>{printDialogVisible = false;printFormData=null}">取 消</el-button> |
| | | <el-button type="primary" @click="printFun()">打 印</el-button> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | watch:{ |
| | | printFormData(newVal){ |
| | | if(newVal){ |
| | | console.log("pData变化--",newVal); |
| | | this.printFormData = newVal |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | closedown(){ |
| | | // this.printFormData = [] |
| | | this.printDialogVisible = false; |
| | | }, |
| | | //打印按钮 |
| | | printFun() { |
| | | this.printDialogVisible = false; |
| | | PrintJS({ |
| | | printable: "printRaw", |
| | | type: "html", |
| | | maxWidth: 700, |
| | | style: '@page {margin: 0 5mm}', |
| | | maxWidth: 950, |
| | | style: '@page {margin: 2.0mm 2.0mm}', |
| | | targetStyles: ["*"], |
| | | // importCSS: true, |
| | | ignoreElements: ["no-ignore"], |
| | | orientation: 'portrait' |
| | | }); |