From 24104ca69c3319595642aa44a01e93512b4cc777 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 17 Sep 2025 10:18:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=89=A9=E6=96=99=E7=BC=96=E8=BE=91=E5=90=8E=E5=8F=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=BD=93=E5=89=8D=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/mlogbw_check_table.vue | 46 +++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) 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;