diff --git a/src/views/firefighting/points/components/list.vue b/src/views/firefighting/points/components/list.vue index decdf53..966cb81 100644 --- a/src/views/firefighting/points/components/list.vue +++ b/src/views/firefighting/points/components/list.vue @@ -29,7 +29,11 @@ - + @@ -67,16 +71,22 @@ - + + + + @@ -98,6 +124,7 @@
新增 批量删除 + 批量修改负责人
- -
-
-

消防点位信息

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
消防点位维护信息告知牌
+
+
+
+
消防点位
+
{{ qrInfo.FIRE_POINT_NAME }}
+
+
+
点位编号
+
{{ qrInfo.FIRE_POINT_CODE }}
+
+
+
+
+
检查码
+
+ +
+
查询码
+
+ +
+
+
- - - - - - - - - - - - - -
消防区域{{ qrInfo.FIRE_REGION_NAME }}消防点位{{ qrInfo.FIRE_POINT_NAME }}
负责部门{{ qrInfo.DEPARTMENT_NAME }}负责人{{ qrInfo.USERNAME }}
-
- +
+
+
+
消防点位
+
{{ qrInfo.FIRE_POINT_NAME }}
+
+
+
点位编号
+
{{ qrInfo.FIRE_POINT_CODE }}
+
+
+
+
+
检查码
+
+ +
+
+
+
查询码
+
+ +
+
+
+ + +
+
+

检查记录二维码

+
+
+ +
+
+ +
+ + + + + + + + + + + + +
@@ -148,9 +278,7 @@ import waves from '@/directive/waves' // waves directive import SelectTree from '@/components/SelectTree' export default { - components: { Pagination, SelectTree, vueQr }, - directives: { waves }, data() { return { @@ -158,7 +286,11 @@ export default { addBtnType: true, listLoading: true, dialogFormShow: false, - qrcodeStr: '', + dialogRecordFormShow: false, + qrcodeStr_jianchama: '', + qrcodeStr_chaxunma: '', + tabsActive: 'horizontal', + recordQrcodeStr: '', qrInfo: {}, add: false, del: false, @@ -173,6 +305,9 @@ export default { KEYWORDS: '', FIRE_POINT_NAME: '', FIRE_POINT_CODE: '', + selectForm: { + DEPARTMENT_ID: '' + }, // 树形菜单 filterText: '', varList: [], @@ -181,7 +316,28 @@ export default { value: 'id', children: 'nodes', label: 'name' - } + }, + editDataIds: [], + dialogEditUser: false, + dialogEditUserForm: { + USER_ID: '' + }, + dialogEditUserRules: { + USER_ID: [{ required: true, message: '请选择负责人', trigger: 'change' }] + }, + deptTreeData: [], + userList: [], + punctuationStatusList: [ + { + value: 0, + label: '是' + }, + { + value: 1, + label: '否' + } + ], + IS_PUNCTUATION: '' } }, watch: { @@ -193,36 +349,44 @@ export default { created() { this.getList() this.hasButton() + this.getTreeData() }, methods: { - handleShowQr(ROW) { + handleShowNotificationCard(ROW) { this.dialogFormShow = true this.qrInfo = ROW - this.qrcodeStr = this.config.weburlWaiwang + 'static/qrcode/views/bsbw/point_list.html?id=' + ROW.FIRE_POINT_ID + // 检查码 + this.qrcodeStr_chaxunma = JSON.stringify({ + MANAGER_TYPE: 'checkRecordManager', + USER_ID: ROW.USER_ID, + DEPARTMENT_ID: ROW.DEPARTMENT_ID, + FIRE_POINT_ID: ROW.FIRE_POINT_ID + }) + // 查询码 + this.qrcodeStr_jianchama = JSON.stringify({ + MANAGER_TYPE: 'fireListManager', + FIRE_POINT_ID: ROW.FIRE_POINT_ID + }) }, handleEdit(FIRE_POINT_ID) { this.$parent.FIRE_POINT_ID = FIRE_POINT_ID this.$parent.activeName = 'Edit' }, selectable(row, index) { - return row.DEVICE_COUNT == 0 + return true }, getRowKey(row) { return row.FIRE_POINT_ID }, - // 添加 handleAdd() { this.$parent.activeName = 'Edit' this.$parent.FIRE_POINT_ID = '' this.$parent.FIRE_POINT_CODE = '' this.$parent.FIRE_POINT_NAME = '' }, - // 搜索 getQuery() { - // this.$refs.multipleTable.clearSelection() this.getList() }, - // 获取列表 getList(pid) { this.listLoading = true this.varList = [] @@ -231,7 +395,9 @@ export default { '/firePoint/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page, { FIRE_POINT_NAME: this.FIRE_POINT_NAME, - FIRE_POINT_CODE: this.FIRE_POINT_CODE + FIRE_POINT_CODE: this.FIRE_POINT_CODE, + DEPARTMENT_ID: this.selectForm.DEPARTMENT_ID, + IS_PUNCTUATION: this.IS_PUNCTUATION } ).then((data) => { this.listLoading = false @@ -241,9 +407,14 @@ export default { }).catch((e) => { this.listLoading = false }) - }, goKeyReset() { + }, + goKeyReset() { this.FIRE_POINT_NAME = '' this.FIRE_POINT_CODE = '' + this.IS_PUNCTUATION = '' + this.selectForm = { + DEPARTMENT_ID: '' + } this.getList() }, getDict() { @@ -283,6 +454,88 @@ export default { this.listLoading = false }) }, + getTreeData() { + requestFN( + '/department/listTreeV2', + {} + ).then((data) => { + this.deptTreeData = JSON.parse(data.zTreeNodes) + }).catch((e) => { + }) + }, + handleEditUser(row) { + this.editDataIds = [] + if (row.FIRE_POINT_ID) { + this.editDataIds.push(row.FIRE_POINT_ID) + } else { + const selection = this.$refs.multipleTable.selection + if (!selection.length > 0) { + this.$message({ + type: 'warning', + message: '请选择要修改的数据' + }) + return + } + selection.forEach(item => { + this.editDataIds.push(item.FIRE_POINT_ID) + }) + } + const selection = this.$refs.multipleTable.selection + const DEPARTMENT_ID = selection[0].DEPARTMENT_ID + if (selection.length > 1) { + let flag = false + selection.forEach(item => { + if (DEPARTMENT_ID !== item.DEPARTMENT_ID) { + this.$message({ + type: 'warning', + message: '只能选择同一部门下的数据' + }) + flag = true + } + }) + if (flag) { + return + } + } + this.getUserList(DEPARTMENT_ID) + this.dialogEditUserForm = { + USER_ID: '' + } + this.dialogEditUser = true + }, + getUserList(DEPARTMENT_ID) { + requestFN( + '/user/listAll', + { + DEPARTMENT_ID: DEPARTMENT_ID + } + ).then((data) => { + this.userList = data.userList + }).catch((e) => { + }) + }, + dialogEditUserConfirm() { + this.$refs.firefightingBatchEditDept.validate((valid) => { + if (valid) { + this.listLoading = true + requestFN( + '/firePoint/batchEditFirePointUser', + { + DATA_IDS: this.editDataIds.join(','), + USER_ID: this.dialogEditUserForm.USER_ID + } + ).then(() => { + this.$message({ + message: '修改成功', + type: 'success' + }) + this.dialogEditUser = false + this.getList() + }).catch(() => { + }) + } + }) + }, handleDelete(row) { const DATA_IDS = [] if (row.FIRE_POINT_ID) { @@ -296,6 +549,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) }) @@ -347,15 +613,17 @@ export default { } - + +