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) })