| | |
| | | :visible.sync="dialogVisible" |
| | | width="60%"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" size="small" @click="printFun()">打印</el-button> |
| | | <el-button type="primary" @click="printFun()">打印</el-button> |
| | | </span> |
| | | <div class="printStyle"> |
| | | <preview id="printDiv"></preview> |
| | | <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"> |
| | |
| | | </template></el-table-column |
| | | > |
| | | <el-table-column |
| | | prop="materialCode" |
| | | prop="reportCode" |
| | | label="报告单号" |
| | | sortable |
| | | min-width="10%" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span style="color: #409eff;"> |
| | | {{ scope.row.materialCode }} |
| | | {{ scope.row.reportCode }} |
| | | </span> |
| | | </template></el-table-column |
| | | > |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { selectAllReport } from "@/api/experiment/checkTheReport"; |
| | | 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() { |
| | | return { |
| | | reportData: [], |
| | | reportType: 0, |
| | | searchData:{ |
| | | sample_code:'', |
| | | reportCode:'', |
| | | 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(){ |
| | | // this.dialogVisible = true; |
| | | }, |
| | | components:{ |
| | | Preview |
| | | Preview, |
| | | TestReport |
| | | }, |
| | | methods: { |
| | | //预览按钮 |
| | | previewFun(){ |
| | | async queryReportByRCode(code){ |
| | | const resp = await getReportData({code:code}); |
| | | this.reportData = resp.data; |
| | | this.dialogVisible = true; |
| | | console.log(this.reportData); |
| | | }, |
| | | //查看报告按钮 |
| | | previewFun(row){ |
| | | console.log(row) |
| | | this.reportType = row.type; |
| | | this.queryReportByRCode(row.reportCode); |
| | | }, |
| | | //打印按钮 |
| | | printFun(){ |
| | | PrintJS({ |
| | | printable: "printDiv", |
| | | type: "html", |
| | | // header: "原材料检测报告", |
| | | targetStyles: ["*"], |
| | | ignoreElements: ["no-ignore"], |
| | | }); |
| | | this.dialogVisible = false; |
| | | PrintJS({ |
| | | printable: this.reportType===0 ? "printRaw" : "printFinished", |
| | | type: "html", |
| | | // header: "原材料检测报告", |
| | | targetStyles: ["*"], |
| | | ignoreElements: ["no-ignore"], |
| | | }); |
| | | }, |
| | | // 状态按钮 |
| | | handleRadioChange() { |
| | |
| | | } |
| | | } |
| | | .library-table { |
| | | height: 80vh; |
| | | overflow: scroll; |
| | | background-color: #fff; |
| | | flex: 1; |
| | | margin: 0px -15px; |
| | |
| | | } |
| | | .printStyle{ |
| | | overflow: scroll; |
| | | height:600px; |
| | | height:500px; |
| | | .el-button{ |
| | | position: absolute; |
| | | top: 10vh; |