巡检计划修改+删除

yangwl
wws 1 year ago
parent 9ba845c490
commit 911336944e

@ -229,7 +229,7 @@
>删除 >删除
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col v-if="false" :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -586,6 +586,7 @@ import {
formatEquItem, formatEquItem,
getPersonList, getWorkCenter, initUpdatePlanInfo getPersonList, getWorkCenter, initUpdatePlanInfo
} from "@/api/device/plan"; } from "@/api/device/plan";
import plan from "@/views/plan/plan/index.vue";
export default { export default {
name: "Plan", name: "Plan",
@ -594,17 +595,15 @@ export default {
return { return {
// //
changeCenter() { changeCenter() {
console.log("改变了工作中心")
console.log(this.form.planWorkshop)
}, },
// list // list
workCenterList:[], workCenterList: [],
// 穿 // 穿
personList: [], personList: [],
selectPersonList: [], selectPersonList: [],
// list // list
itemDetailList:[], itemDetailList: [],
// loading // loading
detailLoading: false, detailLoading: false,
// //
@ -713,11 +712,11 @@ export default {
planName: null, planName: null,
planStatus: '0', planStatus: '0',
planPerson: null, planPerson: null,
planLoop:null, planLoop: null,
planTimeArray: [], planTimeArray: [],
equipmentItem: [], equipmentItem: [],
personList: [], personList: [],
planWorkshop:null, planWorkshop: null,
planType: "inspection", planType: "inspection",
}, },
// //
@ -750,8 +749,6 @@ export default {
}, },
// //
standardBtn() { standardBtn() {
console.log("这里是你要确定的数据");
console.log(this.form.equipmentItem)
this.editorItem = false; this.editorItem = false;
}, },
// //
@ -760,25 +757,19 @@ export default {
for (let i = 0; i < this.itemDetailList.length; i++) { for (let i = 0; i < this.itemDetailList.length; i++) {
if (this.itemDetailList[i].detailCode == e.detailCode) { if (this.itemDetailList[i].detailCode == e.detailCode) {
this.itemDetailList[i].showFlag = false; this.itemDetailList[i].showFlag = false;
this.itemDetailList.splice(i,1); this.itemDetailList.splice(i, 1);
} }
} }
}, },
// - // -
editorTheItem(e) { editorTheItem(e) {
console.log(e)
// //
this.itemDetailList = []; this.itemDetailList = [];
console.log("12312312")
console.log(e.equCheckItemList)
// //
if (e.equCheckItemList == null) { if (e.equCheckItemList == null) {
// - // -
console.log("出现了")
console.log(e.equPlanDetailList)
for (let i = 0; i < e.equPlanDetailList.length; i++) { for (let i = 0; i < e.equPlanDetailList.length; i++) {
for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) { for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) {
@ -789,7 +780,7 @@ export default {
// //
if (e.equPlanDetailList[i].equPlanStandardList[j].standardType == "qualitative") { if (e.equPlanDetailList[i].equPlanStandardList[j].standardType == "qualitative") {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定性"; e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定性";
}else { } else {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定量"; e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定量";
} }
@ -797,7 +788,7 @@ export default {
} }
} }
}else { } else {
// - // -
for (let i = 0; i < e.equCheckItemList.length; i++) { for (let i = 0; i < e.equCheckItemList.length; i++) {
for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) { for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) {
@ -805,13 +796,13 @@ export default {
e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName; e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName;
// false // false
if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) { if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) {
e.equCheckItemList[i].equCheckItemDetailList.splice(j,1); e.equCheckItemList[i].equCheckItemDetailList.splice(j, 1);
} }
// //
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") { if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性"; e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
}else { } else {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量"; e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
} }
@ -825,9 +816,6 @@ export default {
}, },
// - // -
delTheEquItem(e) { delTheEquItem(e) {
console.log("删除")
console.log(e)
console.log(this.form.equipmentItem)
this.form.equipmentItem.splice(e.equipmentCode, 1) this.form.equipmentItem.splice(e.equipmentCode, 1)
}, },
// //
@ -847,8 +835,6 @@ export default {
// //
formatEquItem(this.selectEquList).then(response => { formatEquItem(this.selectEquList).then(response => {
console.log("开始格式化设备信息")
console.log(response)
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.form.equipmentItem.push(response.data[i]); this.form.equipmentItem.push(response.data[i]);
@ -860,8 +846,6 @@ export default {
}, },
// //
selectChangeEqu(e) { selectChangeEqu(e) {
console.log("这里!!!!!")
console.log(e)
this.selectEquList = e; this.selectEquList = e;
}, },
// //
@ -988,10 +972,9 @@ export default {
this.title = "添加计划"; this.title = "添加计划";
}, },
// //
setWorkCenter(){ setWorkCenter() {
getWorkCenter().then(response => { getWorkCenter().then(response => {
console.log("这里是工作中心")
console.log(response.data)
this.workCenterList = response.data; this.workCenterList = response.data;
}) })
}, },
@ -1008,9 +991,6 @@ export default {
this.setWorkCenter(); this.setWorkCenter();
initUpdatePlanInfo(row).then(response => { initUpdatePlanInfo(row).then(response => {
console.log(row)
console.log("返回数据如下")
console.log(response.data)
this.form = response.data; this.form = response.data;
this.selectPersonList = response.data.personListVO; this.selectPersonList = response.data.personListVO;
@ -1020,7 +1000,7 @@ export default {
this.form.equipmentItem[i].itemTempName = ''; this.form.equipmentItem[i].itemTempName = '';
} }
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) { 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 +"," this.form.equipmentItem[i].itemTempName = this.form.equipmentItem[i].itemTempName + this.form.equipmentItem[i].equPlanDetailList[j].itemName + ","
} }
} }
@ -1080,8 +1060,6 @@ export default {
}); });
} else { } else {
this.form.personList = this.selectPersonList; this.form.personList = this.selectPersonList;
console.log("这里是人员信息")
console.log(this.form.personList)
addPlan(this.form).then(response => { addPlan(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -1094,7 +1072,26 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const planIds = row.planId || this.ids; const planIds = row.planId || this.ids;
this.$modal.confirm('是否确认删除计划编号为"' + planIds + '"的数据项?').then(function () {
var planCodes = '';
//
for (let i = 0; i < this.planList.length; i++) {
for (let j = 0; j < planIds.length; j++) {
if (planIds[j] == this.planList[i].planId) {
planCodes = planCodes + this.planList[i].planCode + ',';
}
}
}
if (planCodes == '') {
for (let i = 0; i < this.planList.length; i++) {
if (planIds == this.planList[i].planId) {
planCodes = this.planList[i].planCode;
}
}
}
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function () {
return delPlan(planIds); return delPlan(planIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
@ -1120,6 +1117,7 @@ export default {
.my-step-body { .my-step-body {
margin-top: 15px; margin-top: 15px;
} }
.el-transfer-panel { .el-transfer-panel {
width: 300px; width: 300px;
} }

Loading…
Cancel
Save