| | |
| | | <el-button type="primary" @click="printFun()">打印</el-button> |
| | | </span> |
| | | <div class="printStyle"> |
| | | <preview id="printDiv" :reportData="reportData" v-if="reportType===0"></preview> |
| | | <div v-else>成品检测报告</div> |
| | | <Preview id="printRaw" :reportData="reportData" v-if="reportType===0"></Preview> |
| | | <TestReport id="printFinished" :reportData="reportData" v-else></TestReport> |
| | | </div> |
| | | </el-dialog> |
| | | <div class="table-box"> |
| | |
| | | <script> |
| | | import { selectAllReport,getReportData } from "@/api/experiment/checkTheReport"; |
| | | import Preview from "@/components/experiment/checkTheReport/index.vue"; |
| | | import TestReport from "@/components/experiment/template_testReport/index.vue" |
| | | import PrintJS from 'print-js' |
| | | export default { |
| | | data() { |
| | |
| | | application_code: '' |
| | | }, |
| | | checkStatus: undefined, |
| | | reportTable: [], |
| | | reportTable: [ |
| | | { |
| | | materialCode:'SN23-0517001', |
| | | reportCode: 'SN23-0517001', |
| | | inspectionCode: 'SN23-0517001', |
| | | approver:'黄小明', |
| | | status: '', |
| | | conclusion: 1, |
| | | name: '黄小明' |
| | | }, |
| | | { |
| | | materialCode:'SN23-0517001', |
| | | reportCode: 'SN23-0517001', |
| | | inspectionCode: 'SN23-0517001', |
| | | approver:'黄小明', |
| | | status: '', |
| | | conclusion: 1, |
| | | name: '黄小明' |
| | | } |
| | | ], |
| | | page: 1, |
| | | total: 0, |
| | | pageSize: 10, |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | // this.getData(); |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | components:{ |
| | | Preview |
| | | Preview, |
| | | TestReport |
| | | }, |
| | | methods: { |
| | | async queryReportByRCode(code){ |
| | |
| | | }, |
| | | //查看报告按钮 |
| | | previewFun(row){ |
| | | console.log(row) |
| | | this.reportType = row.type; |
| | | this.queryReportByRCode(row.reportCode); |
| | | }, |
| | |
| | | printFun(){ |
| | | this.dialogVisible = false; |
| | | PrintJS({ |
| | | printable: "printDiv", |
| | | printable: this.reportType===0 ? "printRaw" : "printFinished", |
| | | type: "html", |
| | | // header: "原材料检测报告", |
| | | targetStyles: ["*"], |