|
|
@@ -58,7 +58,7 @@
|
|
|
<template slot-scope="{ row }">
|
|
|
<span v-if="row.result==0">待定</span>
|
|
|
<span v-if="row.result==1">合格</span>
|
|
|
- <span v-if="row.result==2">不合格</span>
|
|
|
+ <span v-if="row.result==2" style="color:red">不合格</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 质检报告 -->
|
|
|
@@ -67,12 +67,20 @@
|
|
|
label="质检报告"
|
|
|
align="center"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <i v-if="row.result>0"
|
|
|
+ @click="downloadFile(row)"
|
|
|
+ class="el-icon-download table-operation"
|
|
|
+ style="color: #f50;"
|
|
|
+ v-hasPermission="['file:download']"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
|
|
|
+ </el-table-column>
|
|
|
<!-- 零件唯一码 -->
|
|
|
<el-table-column
|
|
|
prop="id"
|
|
|
@@ -97,13 +105,13 @@
|
|
|
:label="$t("runCenter.table.orderSldPro.name")"
|
|
|
align="center"
|
|
|
/>
|
|
|
- <!-- 零部件编号 -->
|
|
|
+ <!-- 零部件编号
|
|
|
<el-table-column
|
|
|
prop="partsAlias"
|
|
|
:label="$t("runCenter.table.orderSldPro.partsAlias")"
|
|
|
align="center"
|
|
|
width="120px"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<!-- 计划开始日期 -->
|
|
|
<el-table-column
|
|
|
prop="startTime"
|
|
|
@@ -144,7 +152,7 @@ import inspectionApi from "@/api/runManageCenter/inspection"
|
|
|
// 【分页】组件
|
|
|
import Pagination from "@/components/Pagination"
|
|
|
// 【共通】函数
|
|
|
-import { initQueryParams } from '@/utils/commons'
|
|
|
+import {downloadFile, initQueryParams } from '@/utils/commons'
|
|
|
export default {
|
|
|
name: 'ViewResult',
|
|
|
components: { Pagination },
|
|
|
@@ -251,13 +259,18 @@ export default {
|
|
|
if(val){
|
|
|
this.tenant = { ...val }
|
|
|
}
|
|
|
- this.getWorkpiece()
|
|
|
- this.fetch()
|
|
|
+ this.getWorkpiece()
|
|
|
},
|
|
|
close () {
|
|
|
this.$emit('close')
|
|
|
},
|
|
|
-
|
|
|
+ downloadFile(row) {
|
|
|
+ this.queryParams.map.fileName = '下载抽检报表'+row.report
|
|
|
+ this.queryParams.model.id = row.id
|
|
|
+ inspectionApi.export(this.queryParams).then(response => {
|
|
|
+ downloadFile(response);
|
|
|
+ });
|
|
|
+ },
|
|
|
// 【重置】按钮-事件
|
|
|
reset () {
|
|
|
// 初始化表单
|
|
|
@@ -270,10 +283,12 @@ export default {
|
|
|
let params = {current:1, size:1000, model:{planId: this.tenant.id}}
|
|
|
await inspectionApi.getWorkpiece(params).then(response => {
|
|
|
const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.workpieceId=[]
|
|
|
res.data.records.forEach(item =>{
|
|
|
this.workpieceId.push(item.id);
|
|
|
- });
|
|
|
+ });
|
|
|
+ this.fetch()
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -287,34 +302,37 @@ export default {
|
|
|
// 必须传的参数
|
|
|
//this.queryParams.model.orderId = this.tenant.orderId
|
|
|
this.queryParams.model.planId = this.tenant.id
|
|
|
-
|
|
|
+
|
|
|
// 测试数据,真实数据,请使用page
|
|
|
inspectionApi.page(this.queryParams).then(response => {
|
|
|
const res = response.data
|
|
|
if (res.isSuccess) {
|
|
|
- //console.log(res.data.records)
|
|
|
- // 总数
|
|
|
- this.tableData.total = this.tenant.planBomNum;
|
|
|
- //console.log(this.tenant)
|
|
|
- this.tableData.records = []
|
|
|
- for(let i=Number(this.tenant.completeNum); i<this.tableData.total; i++){
|
|
|
- let plan = {bomName:this.tenant.bomDesc, partsNo:this.tenant.partsNo,partsAlias:this.tenant.partsAlias,
|
|
|
- startTime:this.tenant.startTime, endTime:this.tenant.endTime, id:this.workpieceId[i], hasChildren:false
|
|
|
- }
|
|
|
+ this.tableData.records = []
|
|
|
if(res.data.records.length > 0){
|
|
|
- plan.children = []
|
|
|
- res.data.records.forEach(item =>{
|
|
|
- if(plan.id == item.workpieceId){
|
|
|
- let workpiece = {procedureNo:item.procedureNo, procedureName:item.procedureName,
|
|
|
- result: item.result, report:item.report
|
|
|
- }
|
|
|
- plan.children.push(workpiece)
|
|
|
- plan.hasChildren = true
|
|
|
- }
|
|
|
- });
|
|
|
+ let planMap = new Map();
|
|
|
+ res.data.records.forEach(item =>{
|
|
|
+ let plan = {bomName:this.tenant.bomDesc, partsNo:this.tenant.partsNo,partsAlias:this.tenant.partsAlias,
|
|
|
+ startTime:this.tenant.startTime, endTime:this.tenant.endTime, hasChildren:false
|
|
|
+ }
|
|
|
+ let workpiece = {procedureNo:item.procedureNo, procedureName:item.procedureName,
|
|
|
+ result: item.result, report:item.report }
|
|
|
+ let planObj = planMap.get(item.workpieceId);
|
|
|
+ if(planObj==null){
|
|
|
+ plan.id = item.workpieceId
|
|
|
+ plan.children = [workpiece]
|
|
|
+ plan.hasChildren = true
|
|
|
+ planMap.set(item.workpieceId, plan)
|
|
|
+ }else{
|
|
|
+ planObj.children.push(workpiece)
|
|
|
+ planMap.set(item.workpieceId, planObj)
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ planMap.forEach((value)=>{
|
|
|
+ this.tableData.records.push(value)
|
|
|
+ });
|
|
|
}
|
|
|
- this.tableData.records.push(plan)
|
|
|
- }
|
|
|
+ this.tableData.total = this.tableData.records.length
|
|
|
}
|
|
|
// eslint-disable-next-line no-return-assign
|
|
|
}).finally(() => this.loading = false)
|