保养计划-修改

master
wws 1 year ago
parent 6c7fa5fdc0
commit 0b29476e55

@ -202,10 +202,10 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:inspectionPlan:add']"
>新增
>添加计划
</el-button>
</el-col>
<el-col :span="1.5">
<el-col v-if="false" :span="1.5">
<el-button
type="success"
plain
@ -873,49 +873,22 @@ export default {
//
this.itemDetailList = [];
//
if (e.equCheckItemList == null) {
// -
for (let i = 0; i < e.equPlanDetailList.length; i++) {
for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) {
//
e.equPlanDetailList[i].equPlanStandardList[j].itemName = e.equPlanDetailList[i].itemName;
//
if (e.equPlanDetailList[i].equPlanStandardList[j].standardType == "qualitative") {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定性";
} else {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定量";
}
this.itemDetailList.push(e.equPlanDetailList[i].equPlanStandardList[j]);
}
}
} else {
// -
for (let i = 0; i < e.equCheckItemList.length; i++) {
for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) {
//
e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName;
// false
if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) {
e.equCheckItemList[i].equCheckItemDetailList.splice(j, 1);
}
for (let i = 0; i < this.form.equipmentItem.length; i++) {
if (e.code == this.form.equipmentItem[i].code) {
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
var itemName = this.form.equipmentItem[i].equPlanDetailList[j].itemName;
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++){
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemName = itemName;
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardType == "qualitative") {
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定性";
}else {
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
}
//
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
} else {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
}
this.itemDetailList.push(e.equCheckItemList[i].equCheckItemDetailList[j]);
}
}
}
this.editorItem = true;

@ -212,7 +212,7 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:upkeepPlan:add']"
>新增
>添加计划
</el-button>
</el-col>
<el-col :span="1.5">
@ -221,10 +221,9 @@
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:upkeepPlan:edit']"
>修改
v-hasPermi="['device:upkeepPlan:add']"
>委外计划
</el-button>
</el-col>
<el-col :span="1.5">
@ -239,7 +238,7 @@
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-col v-if="false" :span="1.5">
<el-button
type="warning"
plain
@ -306,7 +305,7 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -822,7 +821,7 @@ import {
updateUpkeepPlan,
formatEquItem, setSpareList, querySpareList
} from "@/api/device/upkeepPlan";
import {getEquList, getPersonList, getWorkCenter} from "@/api/device/plan";
import {getEquList, getPersonList, getWorkCenter, initUpdatePlanInfo} from "@/api/device/plan";
export default {
name: "UpkeepPlan",
@ -1182,49 +1181,22 @@ export default {
//
this.itemDetailList = [];
//
if (e.equCheckItemList == null) {
// -
for (let i = 0; i < e.equPlanDetailList.length; i++) {
for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) {
//
e.equPlanDetailList[i].equPlanStandardList[j].itemName = e.equPlanDetailList[i].itemName;
//
if (e.equPlanDetailList[i].equPlanStandardList[j].standardType == "qualitative") {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定性";
} else {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定量";
}
this.itemDetailList.push(e.equPlanDetailList[i].equPlanStandardList[j]);
}
}
} else {
// -
for (let i = 0; i < e.equCheckItemList.length; i++) {
for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) {
//
e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName;
// false
if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) {
e.equCheckItemList[i].equCheckItemDetailList.splice(j, 1);
}
for (let i = 0; i < this.form.equipmentItem.length; i++) {
if (e.code == this.form.equipmentItem[i].code) {
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
var itemName = this.form.equipmentItem[i].equPlanDetailList[j].itemName;
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++){
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemName = itemName;
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardType == "qualitative") {
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定性";
}else {
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
}
//
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
} else {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
}
this.itemDetailList.push(e.equCheckItemList[i].equCheckItemDetailList[j]);
}
}
}
this.editorItem = true;
@ -1384,12 +1356,37 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const planId = row.planId || this.ids
getUpkeepPlan(planId).then(response => {
//
this.queryEquipment = [];
this.upkeepSteps = 0;
this.selectPersonList = [];
this.personList = [];
this.setPerson();
this.setWorkCenter();
initUpdatePlanInfo(row).then(response => {
this.form = response.data;
console.log("这里!!!!")
console.log(response.data)
this.selectPersonList = response.data.personListVO;
for (let i = 0; i < this.form.equipmentItem.length; i++) {
if (this.form.equipmentItem[i].itemTempName == null) {
this.form.equipmentItem[i].itemTempName = '';
}
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
this.form.equipmentItem[i].itemTempName = this.form.equipmentItem[i].itemTempName + this.form.equipmentItem[i].equPlanDetailList[j].itemName + ","
}
}
console.log("这里时修改前")
console.log(this.form)
this.open = true;
this.title = "修改保养计划";
});
this.title = "修改计划";
})
},
/** 提交按钮 */
submitForm() {
@ -1397,6 +1394,8 @@ export default {
if (valid) {
if (this.form.planId != null) {
this.form.personList = this.selectPersonList;
console.log("这里时修改后")
console.log(this.form)
updateUpkeepPlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;

Loading…
Cancel
Save