From 533c901b47187eb7dfbcc066f17c3145e7c55041 Mon Sep 17 00:00:00 2001 From: limingyu Date: Mon, 1 Apr 2024 19:15:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E5=8C=BA=E5=9F=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=81=E6=B6=88=E9=98=B2=E7=82=B9=E4=BD=8D=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E9=80=89=E6=8B=A9=E6=A1=86=E5=85=A8=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../firefighting/points/components/list.vue | 16 +++++++++++++++- .../firefighting/region/components/list.vue | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/views/firefighting/points/components/list.vue b/src/views/firefighting/points/components/list.vue index 0a2a9c7..da325ad 100644 --- a/src/views/firefighting/points/components/list.vue +++ b/src/views/firefighting/points/components/list.vue @@ -235,7 +235,8 @@ export default { this.$parent.activeName = 'Edit' }, selectable(row, index) { - return row.DEVICE_COUNT == 0 + // return row.DEVICE_COUNT == 0 + return true }, getRowKey(row) { return row.FIRE_POINT_ID @@ -413,6 +414,19 @@ export default { }) return } + var flag = true + selection.forEach(item => { + if (item.DEVICE_COUNT > 0) { + flag = false + } + }) + if (!flag) { + this.$message({ + type: 'warning', + message: '选择的点位中有子数据,不能删除' + }) + return + } selection.forEach(item => { DATA_IDS.push(item.FIRE_POINT_ID) }) diff --git a/src/views/firefighting/region/components/list.vue b/src/views/firefighting/region/components/list.vue index b4298be..2bf4a5f 100644 --- a/src/views/firefighting/region/components/list.vue +++ b/src/views/firefighting/region/components/list.vue @@ -268,7 +268,8 @@ export default { return row.FIRE_REGION_ID }, selectable(row, index) { - return row.ITEMCOUNT == 0 + // return row.ITEMCOUNT == 0 + return true }, // 批量修改负责部门 handelEditDept(row) { @@ -334,6 +335,19 @@ export default { }) return } + var isFlag = true + selection.forEach(item => { + if (item.ITEMCOUNT > 0) { + isFlag = false + } + }) + if (!isFlag) { + this.$message({ + type: 'warning', + message: '选择区域中存在下级数据,不能删除' + }) + return + } selection.forEach(item => { DATA_IDS.push(item.FIRE_REGION_ID) })