修改维修提交

This commit is contained in:
龙运模 2025-02-12 10:25:35 +08:00
parent 95fbe0176c
commit e2c11c0b5d

View File

@ -80,7 +80,7 @@
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24" style="margin: 0"> <el-row :gutter="24" style="margin: 0" v-if="item.repair_action != 3">
<el-col :span="6" :lg="6" :md="8" :xs="24"> <el-col :span="6" :lg="6" :md="8" :xs="24">
<span class="name">不良现象</span> <span class="name">不良现象</span>
<div class="text"> <div class="text">
@ -91,21 +91,24 @@
<el-col :span="6" :lg="6" :md="8" :xs="24"> <el-col :span="6" :lg="6" :md="8" :xs="24">
<span class="name">SLA不达标原因</span> <span class="name">SLA不达标原因</span>
<div class="text"> <div class="text">
<el-input :size="size" v-model="item.sla_non_compliance_reason" placeholder="SLA不达标原因"></el-input> <el-input :size="size" v-model="item.sla_non_compliance_reason"
placeholder="SLA不达标原因"></el-input>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24" style="margin: 0"> <el-row :gutter="24" style="margin: 0" v-if="item.repair_action != 3">
<el-col :span="12" :lg="12" :md="12" :xs="24"> <el-col :span="12" :lg="12" :md="12" :xs="24">
<span class="name">现场步骤分析</span> <span class="name">现场步骤分析</span>
<div class="text"> <div class="text">
<el-input type="textarea" :size="size" v-model="item.analysis_steps" placeholder="现场步骤分析"></el-input> <el-input type="textarea" :size="size" v-model="item.analysis_steps"
placeholder="现场步骤分析"></el-input>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="btnAdd" v-if="item.repair_action === 1"> <div class="btnAdd" v-if="item.repair_action === 1">
<div class="cardBody"> <div class="cardBody">
<sc-table ref="table" :data="params.repair_info" style="width: 100%;" :hidePagination="true" :hideDo="true" :hideEmpty="true" :size="size"> <sc-table ref="table" :data="params.repair_info" style="width: 100%;" :hidePagination="true"
:hideDo="true" :hideEmpty="true" :size="size">
<sc-table-column type="index" label="序号" width="65"></sc-table-column> <sc-table-column type="index" label="序号" width="65"></sc-table-column>
<sc-table-column prop="new_part_mpn" label="部件MPN" :show-overflow-tooltip="true" width="240"> <sc-table-column prop="new_part_mpn" label="部件MPN" :show-overflow-tooltip="true" width="240">
<template #default="scope"> <template #default="scope">
@ -133,40 +136,41 @@
</el-scrollbar> </el-scrollbar>
</el-main> </el-main>
</el-container> </el-container>
<info-save-dialog ref="saveDialog" v-if="dialog.save" @success="handleSaveSuccess" @closed="dialog.save=false"></info-save-dialog> <info-save-dialog ref="saveDialog" v-if="dialog.save" @success="handleSaveSuccess"
@closed="dialog.save=false"></info-save-dialog>
</template> </template>
<script> <script>
import infoSaveDialog from "@/views/order/components/infoSave"; import infoSaveDialog from "@/views/order/components/infoSave";
export default { export default {
name: "repairAction", name: "repairAction",
components:{ components: {
infoSaveDialog infoSaveDialog
}, },
data(){ data() {
return{ return {
size:'small', size: 'small',
dialog:{ dialog: {
save:false, save: false,
}, },
params:{ params: {
order_id:Number(this.$route.query.order_id), order_id: Number(this.$route.query.order_id),
repair_id:Number(this.$route.query.id), repair_id: Number(this.$route.query.id),
repair_info:[ repair_info: [
{ {
new_part_mpn:"", new_part_mpn: "",
new_part_sn:"", new_part_sn: "",
sla:"", sla: "",
sla_non_compliance_reason:"", sla_non_compliance_reason: "",
confirmed_defects:"", confirmed_defects: "",
analysis_steps:"", analysis_steps: "",
repair_action:"" repair_action: 3
} }
] ]
}, },
info:{ info: {
is_verify_erp_inventory:false, is_verify_erp_inventory: false,
component_info:[], component_info: [],
} }
} }
}, },
@ -176,13 +180,13 @@ export default {
unmounted() { unmounted() {
}, },
methods:{ methods: {
async getInfo() { async getInfo() {
let params = { let params = {
order_id:this.params.order_id order_id: this.params.order_id
} }
const res = await this.$API.orders.order.repair.info.post(params); const res = await this.$API.orders.order.repair.info.post(params);
if(res.code == 200){ if (res.code == 200) {
this.info = res.data; this.info = res.data;
await this.repairing(); await this.repairing();
@ -190,66 +194,102 @@ export default {
}, },
async repairing() { async repairing() {
let params = { let params = {
repair_id:this.info.id repair_id: this.info.id
} }
await this.$API.orders.order.repair.repairing.post(params); await this.$API.orders.order.repair.repairing.post(params);
}, },
handleSaveSuccess(){ handleSaveSuccess() {
}, },
async submit() { async submit() {
const res = await this.$API.orders.order.repair.submit.post(this.params); let data = this.$TOOL.objCopy(this.params)
if(res.code == 200){ data.repair_info.forEach(item => {
console.log(res.data) if (item.repair_action === 2) {
delete item.new_part_mpn
delete item.new_part_sn
delete item.sla
} else if (item.repair_action === 3) {
delete item.new_part_mpn
delete item.new_part_sn
delete item.sla
delete item.confirmed_defects
delete item.sla_non_compliance_reason
delete item.analysis_steps
}
});
const res = await this.$API.orders.order.repair.submit.post(data);
if (res.code == 200) {
this.$message.success('操作成功')
} }
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.mainView{background: #fff;} .mainView {
.title{color: #222;font-weight: 600;} background: #fff;
.boxListBorderBottom{ }
.title {
color: #222;
font-weight: 600;
}
.boxListBorderBottom {
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
padding-bottom: 5px; padding-bottom: 5px;
margin-bottom: 15px; margin-bottom: 15px;
} }
.boxList{
.boxList {
margin-top: 15px; margin-top: 15px;
.el-row{
.el-row {
margin: 0; margin: 0;
padding: 0; padding: 0;
.el-col{
.el-col {
margin: 0 0 12px 0; margin: 0 0 12px 0;
padding: 0; padding: 0;
} }
.flexCol{
.flexCol {
padding: 5px 12px 6px 12px; padding: 5px 12px 6px 12px;
} }
} }
.name{
.name {
color: #555; color: #555;
display: inline-block; display: inline-block;
margin-bottom: 6px; margin-bottom: 6px;
} }
} }
.btnBox{
.btnBox {
text-align: right; text-align: right;
} }
.cardBody{
.cardBody {
margin-top: 15px; margin-top: 15px;
} }
.flexCol{
display: flex;align-items: center; .flexCol {
.name{ display: flex;
align-items: center;
.name {
margin-bottom: 0; margin-bottom: 0;
margin-right: 15px; margin-right: 15px;
} }
.text{
.text {
font-weight: 400; font-weight: 400;
} }
} }
.btnAdd{margin-top: 15px;}
.btnAdd {
margin-top: 15px;
}
</style> </style>