diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index ece7194d..4ba7fe9c 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -134,13 +134,13 @@ 编辑 删除 { + if(item.id==row.id){ + editIndex = index; + } + }) let obj = {}; obj.number = row.number; obj.mlogb = row.mlogb; @@ -646,7 +652,8 @@ export default { obj.id = row.id; that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => { that.$message.success("保存成功"); - that.getList(); + that.mlogbwlist[editIndex].isEdit = false; + // that.getList(); return res; }).catch((err) => { return err; @@ -654,7 +661,8 @@ export default { }else{ that.$API.wpm.mlogbw.create.req(obj).then((res) => { that.$message.success("添加成功"); - that.getList(); + that.mlogbwlist[editIndex].isEdit = false; + // that.getList(); return res; }).catch((err) => { return err; @@ -668,35 +676,29 @@ export default { } }); }, - formTableEdit(row) { + formTableEdit(index) { let that = this; - // if(that.route_code=='niuzhuan'&&that.optionsEq.length==0){ - // that.getEquipment4(); - // } - that.mlogbwlist.forEach((item, index) => { - if (item.id == row.id) { - that.mlogbwlist[index].isEdit = true; - let date = new Date(); - if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){ - that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss'); - } - if(that.setForm.cd_req_addr!==null&&that.setForm.cd_req_addr!==""&&that.setForm.cd_req_addr!==undefined){ - that.getEqData(index); - } - } - }); + that.mlogbwlist[index].isEdit = true; + let date = new Date(); + if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){ + that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss'); + } + if(that.setForm.cd_req_addr!==null&&that.setForm.cd_req_addr!==""&&that.setForm.cd_req_addr!==undefined){ + that.getEqData(index); + } }, formTableDelet(row){ this.mlogbwlist.pop(); }, //删除 - formTableDel(id) { + formTableDel(id,index) { let that = this; that.$confirm(`确定删除吗?`, "提示", { type: "warning", }).then(() => { that.$API.wpm.mlogbw.delete.req(id).then((res) => { that.getList(); + that.mlogbwlist.splice(index,1); that.$message.success("删除成功"); }).catch((err) => { return err;