更新维修模块逻辑
This commit is contained in:
parent
b554654871
commit
187fa28ea6
@ -28,12 +28,17 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<sc-table ref="table" :data="repair_records" style="width: 100%;" :hidePagination="true" :hideDo="true" :hideEmpty="true" :size="size">
|
||||
<sc-table-column align="center" prop="part_mpn" label="部件MPN" :show-overflow-tooltip="true" width="160"></sc-table-column>
|
||||
<sc-table-column align="center" prop="part_sn" label="部件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
|
||||
<sc-table-column align="center" prop="sla" label="部件SLA" :show-overflow-tooltip="true" width="160"></sc-table-column>
|
||||
<sc-table-column align="center" prop="work_order_number" label="维修单号" :show-overflow-tooltip="true" width="160"></sc-table-column>
|
||||
<sc-table-column align="center" prop="machine_sn" label="整机SN" :show-overflow-tooltip="true" width="160"></sc-table-column>
|
||||
<sc-table-column align="center" prop="fault_type" label="故障类型" :show-overflow-tooltip="true" width="160"></sc-table-column>
|
||||
<sc-table-column align="center" prop="part_sn_two" label="新件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
|
||||
<sc-table-column align="center" prop="part_mpn_two" label="新件MPN" :show-overflow-tooltip="true" width="130"></sc-table-column>
|
||||
<sc-table-column align="center" prop="part_sn_one" label="旧件SN" :show-overflow-tooltip="true" width="130"></sc-table-column>
|
||||
<sc-table-column align="center" prop="part_mpn_one" label="旧件MPN" :show-overflow-tooltip="true" width="130"></sc-table-column>
|
||||
<sc-table-column align="center" prop="confirmed_defects" label="不良现象" :show-overflow-tooltip="true" width="150"></sc-table-column>
|
||||
<sc-table-column align="center" prop="sla_non_compliance_reason" label="SLA不达标原因" :show-overflow-tooltip="true" width="120"></sc-table-column>
|
||||
<sc-table-column align="center" prop="analysis_steps" label="现场步骤分析" :show-overflow-tooltip="true" width="120"></sc-table-column>
|
||||
<sc-table-column align="center" prop="sla_non_compliance_reason" label="SLA不达标原因" :show-overflow-tooltip="true" width="120"></sc-table-column>
|
||||
<sc-table-column align="center" prop="remark" label="备注" :show-overflow-tooltip="true" ></sc-table-column>
|
||||
</sc-table>
|
||||
</template>
|
||||
</div>
|
||||
@ -93,7 +98,23 @@ export default {
|
||||
}
|
||||
// res.data.business_status>4
|
||||
if(res.data.repair_records && res.data.repair_records.length>0){
|
||||
this.repair_records = res.data.repair_records;
|
||||
// 取数组 m_ascription 为 1, 2 的最后一条数据
|
||||
res.data.repair_records.forEach(item=>{
|
||||
item.fault_type = res.data.fault_type;
|
||||
})
|
||||
let m_ascription_one = res.data.repair_records.filter(item=>item.m_ascription === 1).pop();
|
||||
let m_ascription_two = res.data.repair_records.filter(item=>item.m_ascription === 2).pop();
|
||||
|
||||
if(m_ascription_one){
|
||||
m_ascription_one.part_sn_one = m_ascription_one.part_sn;
|
||||
m_ascription_one.part_mpn_one = m_ascription_one.part_mpn;
|
||||
}
|
||||
if(m_ascription_two){
|
||||
m_ascription_one.part_sn_two = m_ascription_two.part_sn;
|
||||
m_ascription_one.part_mpn_two = m_ascription_two.part_mpn;
|
||||
}
|
||||
|
||||
this.repair_records = [m_ascription_one].filter(item=>item);
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
|
||||
@ -239,6 +239,14 @@ export default {
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
this.params.repair_status = {
|
||||
operator:"in",
|
||||
value:[2,3]
|
||||
};
|
||||
searchParams.repair_status = {
|
||||
operator:"in",
|
||||
value:[2,3]
|
||||
};
|
||||
const res = await this.$API.orders.order.repair.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
@ -342,6 +350,10 @@ export default {
|
||||
this.selection = selection;
|
||||
},
|
||||
upSearch(){
|
||||
this.params.repair_status = {
|
||||
operator:"in",
|
||||
value:[2,3]
|
||||
};
|
||||
this.$refs.table.upData(this.params);
|
||||
},
|
||||
reset(){
|
||||
|
||||
@ -1,13 +1,5 @@
|
||||
<template>
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<!-- <el-header class="header">-->
|
||||
<!-- <div class="left-panel">-->
|
||||
<!-- <el-button type="primary" :disabled="selection.length!==1" :size="size" icon="sc-icon-MaintenanceSetup" @click="upkeep">执行维修</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="right-panel">-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- </el-header>-->
|
||||
<el-main class="nopadding">
|
||||
<div class="flowPath">
|
||||
<flow :list="flowList"/>
|
||||
@ -32,7 +24,6 @@
|
||||
<herderMultipleSearch @fieldsSwitch="fieldsSwitch" @fieldsSearch="fieldsSearch" :fieldsShow="fieldsShow" :searchList="list.fields"></herderMultipleSearch>
|
||||
</div>
|
||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
|
||||
<!-- <el-table-column type="selection" align="center" width="40"></el-table-column>-->
|
||||
<template #repair_status="scope">
|
||||
<span v-for="(item,ind) in setMap.statusList" :key="ind">
|
||||
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
|
||||
@ -45,7 +36,6 @@
|
||||
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<!-- <el-dropdown-item icon="sc-icon-MaintenanceSetup" @click="table_upkeep(scope.row)">执行维修</el-dropdown-item>-->
|
||||
<el-dropdown-item icon="sc-icon-See" @click="table_show(scope.row, 'see')">工单详情</el-dropdown-item>
|
||||
<el-dropdown-item icon="sc-icon-OrderLog" @click="table_logs(scope.row)" divided>工单日志</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -222,6 +212,15 @@ export default {
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
// 这里重新赋值给 params 和 searchParams
|
||||
this.params.repair_status = {
|
||||
operator:"in",
|
||||
value:[4]
|
||||
};
|
||||
searchParams.repair_status = {
|
||||
operator:"in",
|
||||
value:[4]
|
||||
};
|
||||
const res = await this.$API.orders.order.repair.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
@ -292,6 +291,10 @@ export default {
|
||||
this.selection = selection;
|
||||
},
|
||||
upSearch(){
|
||||
this.params.repair_status = {
|
||||
operator:"in",
|
||||
value:[4]
|
||||
};
|
||||
this.$refs.table.upData(this.params);
|
||||
},
|
||||
reset(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user