| | |
| | | <template> |
| | | <div class="content-main"> |
| | | <div class="top-bar"> |
| | | <el-form ref="form" :inline="true"> |
| | | <el-form-item class="sermargin"> |
| | | <el-form ref="form" :inline="true" :model="searchData" label-position="left"> |
| | | <el-form-item label="样品编号:"> |
| | | <el-input |
| | | v-model="input" |
| | | v-model="searchData.sample_code" |
| | | class="input-form" |
| | | placeholder="请直接输入样式编号/报告单号/样品编号/进行搜索或下拉选择进行组合查询" |
| | | placeholder="请输入样品编号" |
| | | @keyup.enter.native="getData" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="报告单号:"> |
| | | <el-input |
| | | v-model="searchData.reportCode" |
| | | class="input-form" |
| | | placeholder="请输入报告单号" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="申请单号:"> |
| | | <el-input |
| | | v-model="searchData.application_code" |
| | | class="input-form" |
| | | placeholder="请输入申请单号" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getData()">查询</el-button> |
| | | <el-button type="primary" plain @click="resetData()">重置</el-button> |
| | | </el-form-item> |
| | | <el-dropdown> |
| | | <span class="el-dropdown-link"> |
| | | 高级搜索<i class="el-icon-arrow-down el-icon--right"></i> |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item>高级搜索</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </el-form> |
| | | <el-form> |
| | | <el-button |
| | | class="rightBtn" |
| | | type="primary" |
| | | icon="el-icon-document" |
| | | @click="exportData" |
| | | <el-button class="rightBtn" type="primary" icon="el-icon-document" |
| | | >导出报告</el-button |
| | | > |
| | | </el-form> |
| | |
| | | <el-radio-button>全部</el-radio-button> |
| | | <el-radio-button label="0">待提交</el-radio-button> |
| | | <el-radio-button label="1">待审核</el-radio-button> |
| | | <el-radio-button label="2">已审核</el-radio-button> |
| | | <el-radio-button label="2">待签字</el-radio-button> |
| | | <el-radio-button label="3">已完成</el-radio-button> |
| | | </el-radio-group> |
| | | |
| | | <el-checkbox v-model="checked" style="margin-left: 20px" |
| | |
| | | > |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | top="10vh" |
| | | title="报告预览" |
| | | :visible.sync="dialogVisible" |
| | | width="60%"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="printFun()">打印</el-button> |
| | | </span> |
| | | <div class="printStyle"> |
| | | <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"> |
| | | <el-table |
| | | ref="reportTable" |
| | |
| | | label="样品编号" |
| | | sortable |
| | | min-width="10%" |
| | | /> |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span style="color: #409eff;"> |
| | | {{ scope.row.materialCode }} |
| | | </span> |
| | | </template></el-table-column |
| | | > |
| | | <el-table-column |
| | | prop="reportCode" |
| | | label="报告单号" |
| | | sortable |
| | | min-width="10%" |
| | | /> |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span style="color: #409eff;"> |
| | | {{ scope.row.reportCode }} |
| | | </span> |
| | | </template></el-table-column |
| | | > |
| | | <el-table-column |
| | | prop="inspectionCode" |
| | | label="申请单号" |
| | | sortable |
| | | min-width="10%" |
| | | /> |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span style="color: #409eff;"> |
| | | {{ scope.row.inspectionCode }} |
| | | </span> |
| | | </template></el-table-column |
| | | > |
| | | <el-table-column prop="approver" label="审批人" min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <span> |
| | | <el-tag type="info" icon="el-icon-user"> |
| | | <el-tag v-if="scope.row.approver!=null && scope.row.approver!=''" type="info" icon="el-icon-user"> |
| | | <i class="el-icon-user">{{ scope.row.approver }}</i> |
| | | </el-tag> |
| | | </span> |
| | |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="handleClick(scope.row)" |
| | | >预览</el-button |
| | | @click="previewFun(scope.row)" |
| | | >查看报告</el-button |
| | | > |
| | | <el-button type="text" size="small">打印</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </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 { |
| | | input: "", |
| | | 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, |
| | | checked: true, |
| | | dialogVisible: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | // this.getData(); |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | components:{ |
| | | Preview, |
| | | TestReport |
| | | }, |
| | | methods: { |
| | | 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(){ |
| | | this.dialogVisible = false; |
| | | PrintJS({ |
| | | printable: this.reportType===0 ? "printRaw" : "printFinished", |
| | | type: "html", |
| | | // header: "原材料检测报告", |
| | | targetStyles: ["*"], |
| | | ignoreElements: ["no-ignore"], |
| | | }); |
| | | }, |
| | | // 状态按钮 |
| | | handleRadioChange() { |
| | | this.getData(); |
| | |
| | | }, |
| | | // 重置按钮 |
| | | resetData() { |
| | | this.input = undefined; |
| | | this.searchData={ |
| | | sample_code:'', |
| | | reportCode:'', |
| | | application_code: '' |
| | | }, |
| | | this.page = 1; |
| | | this.pageSize = 10; |
| | | this.checkStatus = undefined; |
| | |
| | | const params = { |
| | | page: this.page, |
| | | pageSize: this.pageSize, |
| | | name: this.input ? this.input : undefined, |
| | | name: this.searchData.sample_code ? this.searchData.sample_code : undefined, |
| | | status: this.checkStatus ? this.checkStatus : undefined, |
| | | }; |
| | | const { data } = await selectAllReport(params); |
| | | this.reportTable = data.row; |
| | | console.log(data.row); |
| | | this.total = data.total; |
| | | }, |
| | | }, |
| | |
| | | justify-content: space-between; |
| | | padding: 5px 24px 0px 24px; |
| | | .input-form { |
| | | width: 700px; |
| | | width: 250px; |
| | | margin-right: 30px; |
| | | } |
| | | .el-dropdown-link { |
| | | cursor: pointer; |
| | |
| | | } |
| | | } |
| | | .library-table { |
| | | height: 80vh; |
| | | overflow: scroll; |
| | | background-color: #fff; |
| | | flex: 1; |
| | | margin: 0px -15px; |
| | |
| | | margin: 10px 0; |
| | | } |
| | | } |
| | | .printStyle{ |
| | | overflow: scroll; |
| | | height:500px; |
| | | .el-button{ |
| | | position: absolute; |
| | | top: 10vh; |
| | | left: 90%; |
| | | } |
| | | } |
| | | } |
| | | </style> |