| | |
| | | @refreshDataList="getData" |
| | | ></RawMaterialForm> |
| | | <el-dialog |
| | | top="10vh" |
| | | top="7vh" |
| | | title="打印预览" |
| | | :visible.sync="printDialogVisible" |
| | | width="60%"> |
| | | <div style="width:100%;height: 60vh;overflow-y: scroll;"> |
| | | width="70%"> |
| | | <div style="width:90%;margin-left:5%;height: 60vh;overflow-y: scroll;"> |
| | | <printTemplate id="printRaw" :formData="printFormData"></printTemplate> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | </template> |
| | | <script> |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | | import { getRawInspectList,delObj,exportRawMaterial,getObj } from '@/api/quality/rawMaterial' |
| | | import { getRawInspectList,delObj,exportRawMaterial,getObj,downloadReport } from '@/api/quality/rawMaterial' |
| | | import RawMaterialForm from './rawMaterial-form' |
| | | import * as fecha from 'element-ui/lib/utils/date' |
| | | import { mapGetters } from 'vuex' |
| | | import PrintJS from 'print-js' |
| | | import { transformZip } from '@/util/fileTransform' |
| | | import printTemplate from './rawMaterial-print.vue' |
| | | export default { |
| | | data() { |
| | |
| | | fun: this.downloadReport |
| | | } |
| | | ], |
| | | operator: [{ |
| | | text: '打印', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.previewFun, |
| | | show: { |
| | | val: [ |
| | | '1', |
| | | '0' |
| | | ], |
| | | key: 'judgeState' |
| | | } |
| | | }, |
| | | operator: [ |
| | | // { |
| | | // text: '打印', |
| | | // type: 'text', |
| | | // size: 'small', |
| | | // fun: this.previewFun, |
| | | // show: { |
| | | // val: [ |
| | | // '1', |
| | | // '0' |
| | | // ], |
| | | // key: 'judgeState' |
| | | // } |
| | | // }, |
| | | { |
| | | text: '作废', |
| | | type: 'text', |
| | |
| | | this.$message.error("只能选择已检测的数据") |
| | | return |
| | | } |
| | | console.log(selection) |
| | | let ids = [] |
| | | selection.forEach(ele=>{ |
| | | ids.push(ele.id) |
| | | }) |
| | | downloadReport({ids : ids}).then(res=>{ |
| | | transformZip(res) |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | } |
| | | }, |
| | | //查看报告按钮 |
| | |
| | | type: "html", |
| | | // header: "原材料检测报告", |
| | | targetStyles: ["*"], |
| | | style: `@page {margin: 0mm 5mm;size: A4;}; |
| | | html {zoom:100%;}; |
| | | style: `@page {margin: 0mm 5mm;size: A4;} |
| | | html {zoom:100%;} |
| | | @media print { |
| | | html,body{ |
| | | width:880pt; |
| | | height:900pt; |
| | | margin:0; |
| | | width:200mm; |
| | | height:297mm; |
| | | } |
| | | }`, |
| | | ignoreElements: ["no-ignore"], |
| | |
| | | }, |
| | | exportRawMaterial(){ |
| | | exportRawMaterial(this.queryParam).then(res=>{ |
| | | console.log(res) |
| | | this.downloadFun(res) |
| | | }).catch(error=>{ |
| | | console.log(error); |