From e17104f537daa91711c56b54cc97f68f45823bf8 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 21 May 2021 15:12:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=98=E5=88=B6=20?= =?UTF-8?q?=E5=81=9C=E7=AB=99=E6=97=B6=E9=97=B4/=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=20=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataRelation/dwellTimeOperate/detail.vue | 27 ++++++++------- .../dataRelation/runLeveloperate/detail.vue | 33 +++++++++++-------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/dwellTimeOperate/detail.vue b/src/views/newMap/newMapdraft/dataRelation/dwellTimeOperate/detail.vue index b267b5b62..6f7a70d76 100644 --- a/src/views/newMap/newMapdraft/dataRelation/dwellTimeOperate/detail.vue +++ b/src/views/newMap/newMapdraft/dataRelation/dwellTimeOperate/detail.vue @@ -91,17 +91,22 @@ export default { }, save(index, row) { if (this.mapInfo && this.mapInfo.id) { - row.loading = true; - updateStationParkTime(this.mapInfo.id, row.id, {parkingTime:row.parkingTimeNew}).then(resp => { - this.$message.success(this.$t('tip.updateDwellTimeSuccessful')); - row.parkingTime = row.parkingTimeNew; - row.parkingTimeNew = ''; - row.edit = false; - row.loading = false; - }).catch(() => { - row.loading = false; - this.$messageBox(this.$t('tip.updateDwellTimeFailed')); - }); + if (row.parkingTimeNew > 0) { + row.loading = true; + updateStationParkTime(this.mapInfo.id, row.id, {parkingTime:row.parkingTimeNew}).then(resp => { + this.$message.success(this.$t('tip.updateDwellTimeSuccessful')); + row.parkingTime = row.parkingTimeNew; + row.parkingTimeNew = ''; + row.edit = false; + row.loading = false; + }).catch(() => { + row.loading = false; + this.$messageBox(this.$t('tip.updateDwellTimeFailed')); + }); + } else { + this.$messageBox('请输入有效的停站时间'); + } + } }, // deleteObj(index, row) { diff --git a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/detail.vue b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/detail.vue index 0d6fd9d92..43b9c0bf4 100644 --- a/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/detail.vue +++ b/src/views/newMap/newMapdraft/dataRelation/runLeveloperate/detail.vue @@ -158,20 +158,25 @@ export default { }, save(index, row) { if (this.mapInfo && this.mapInfo.id) { - row.loading = true; - putUploadLevel(this.mapInfo.id, row.id, {l1:row.l1New, l2:row.l2New, l3:row.l3New, l4:row.l1New, l5:row.l5New }).then(resp => { - this.$message.success('更新运行等级成功'); - row.l1 = row.l1New; - row.l2 = row.l2New; - row.l3 = row.l3New; - row.l4 = row.l4New; - row.l5 = row.l5New; - row.edit = false; - row.loading = false; - }).catch(() => { - row.loading = false; - this.$messageBox('更新运行等级失败'); - }); + if (row.l1New > 0 && row.l2New > 0 && row.l3New > 0 && row.l4New > 0 && row.l5New > 0) { + row.loading = true; + putUploadLevel(this.mapInfo.id, row.id, {l1:row.l1New, l2:row.l2New, l3:row.l3New, l4:row.l1New, l5:row.l5New }).then(resp => { + this.$message.success('更新运行等级成功'); + row.l1 = row.l1New; + row.l2 = row.l2New; + row.l3 = row.l3New; + row.l4 = row.l4New; + row.l5 = row.l5New; + row.edit = false; + row.loading = false; + }).catch(() => { + row.loading = false; + this.$messageBox('更新运行等级失败'); + }); + } else { + this.$messageBox('请输入有效的运行等级'); + } + } }, // deleteObj(index, row) {