diff --git a/src/views/check/listmanager/components/list.vue b/src/views/check/listmanager/components/list.vue index 25fe2f3..5dab278 100644 --- a/src/views/check/listmanager/components/list.vue +++ b/src/views/check/listmanager/components/list.vue @@ -300,7 +300,13 @@ export default { goQrcode(row) { this.dialogVisible = true this.pd = Object.assign({}, row) - this.qrcodeStr = row.LISTMANAGER_ID + // this.qrcodeStr = row.LISTMANAGER_ID + const json = { + LISTMANAGER_ID: row.LISTMANAGER_ID, + MANAGER_TYPE: 'listManager' + } + const jsonStr = JSON.stringify(json) + this.qrcodeStr = jsonStr }, // 判断按钮权限,用于是否显示按钮 hasButton: function() { diff --git a/src/views/firefighting/checklist/components/edit.vue b/src/views/firefighting/checklist/components/edit.vue index 982f05f..137f116 100644 --- a/src/views/firefighting/checklist/components/edit.vue +++ b/src/views/firefighting/checklist/components/edit.vue @@ -23,30 +23,40 @@ + - - - - - - - + placeholder="请选择部门" + no-options-text="暂无数据" + no-children-text="暂无数据" + style="width: 100%;" + @select="handleSelect" + @deselect="handleRemove" + /> + + + @@ -343,8 +363,10 @@ export default { FIRE_CHECK_TYPE: '', POST_ID: [], FIRE_CHECK_TYPE_NAME: '', - DEPARTMENT_ID: '', + DEPARTMENT_ID: [], + UPDATE_DEPARTMENT_ID: '', USER_ID: [], + UPDATE_USER_ID: '', DATA: '' }, rules: { @@ -394,7 +416,17 @@ export default { }, multipleSelectionAll: [], // 所有选中的数据包含跨页数据 multipleSelection: [], // 当前页选中的数据 - accidentList: [] + accidentList: [], + updateValue: true, + normalizer(node) { + return { + id: node.id, + label: node.name, + children: node.nodes, + isDisabled: node.pId === '0' + } + }, + userListChangeValue: 0 } }, watch: { @@ -420,21 +452,34 @@ export default { if (newVal !== '') this.getDeviceByPointId(newVal) }, immediate: false }, - 'form.POST_ID': { - handler(newVal, oldVal) { - this.peopleList = [] - this.form.USER_ID = [] - if (this.form.POST_ID != '') this.getUserList() - } - }, + // 'form.POST_ID': { + // handler(newVal, oldVal) { + // this.peopleList = [] + // this.form.USER_ID = [] + // if (this.form.POST_ID != '') this.getUserList() + // } + // }, 'form.DEPARTMENT_ID': { // 选择了负责部门 查询相关的点检 handler(newVal, oldVal) { this.peopleList = [] - if (newVal !== '') this.form.POST_ID = '' - if (newVal !== '') this.getList(newVal) - if (newVal !== '') this.getCheckList(newVal) - if (newVal !== '') this.getPostList(newVal) + // if (newVal !== '') this.form.POST_ID = '' + if (newVal.length !== 0) this.getList(newVal) + if (newVal.length !== 0) this.getCheckList(newVal) + // if (newVal !== '') this.getPostList(newVal) + if (newVal.length !== 0) this.getUserList() + }, + immediate: false + }, + 'form.UPDATE_DEPARTMENT_ID': { + // 选择了负责部门 查询相关的点检 + handler(newVal, oldVal) { + this.peopleList = [] + // if (newVal !== '') this.form.POST_ID = '' + if (newVal.length !== 0) this.getList(newVal) + if (newVal.length !== 0) this.getCheckList(newVal) + // if (newVal !== '') this.getPostList(newVal) + if (newVal.length !== 0) this.getUserList() }, immediate: false } @@ -451,11 +496,18 @@ export default { }, methods: { getUserList() { + let DEPARTMENT_ID = '' + if (this.FIRE_CHECK_ID != '') { + DEPARTMENT_ID = this.form.UPDATE_DEPARTMENT_ID + } else { + DEPARTMENT_ID = this.form.DEPARTMENT_ID.toString() + } requestFN( '/user/listAll', { - DEPARTMENT_ID: this.form.DEPARTMENT_ID, - POST_ID: this.form.POST_ID + DEPARTMENT_ID: DEPARTMENT_ID + // DEPARTMENT_ID: this.form.DEPARTMENT_ID, + // POST_ID: this.form.POST_ID } ).then((data) => { this.peopleList = data.userList @@ -526,12 +578,18 @@ export default { }, // 部门列表树 async getTreeData() { - requestFN( - '/department/listTree', - {} - ).then((data) => { - this.treeData = JSON.parse(data.zTreeNodes) - }).catch((e) => { + return new Promise((resolve, reject) => { + requestFN( + '/department/listTree', + {} + ).then((data) => { + this.treeData = JSON.parse(data.zTreeNodes) + this.treeData.forEach((item) => { + item.isDisabled = true + }) + resolve() + }).catch((e) => { + }) }) }, getList(DEPARTMENT_ID) { @@ -544,7 +602,7 @@ export default { '/user/getDepartmentId', { KEYWORDS: this.KEYWORDS, - DEPARTMENT_ID: this.DEPARTMENT_ID + DEPARTMENT_ID: this.DEPARTMENT_ID.toString() } ).then((data) => { this.listLoading = false @@ -639,7 +697,7 @@ export default { if (!this.FIRE_CHECK_ID) { requestFN( '/fireCheckList/getCheckList', - { DEPARTMENT_ID: DEPARTMENT_ID } + { DEPARTMENT_ID: DEPARTMENT_ID.toString() } ).then((data) => { this.checkList = data.varList this.checkListBackUp = data.varList @@ -923,13 +981,16 @@ export default { ).then((data) => { this.form.FIRE_CHECK_STANDARD_NAME = data.checkListInfo.FIRE_CHECK_STANDARD_NAME this.form.FIRE_CHECK_TYPE = data.checkListInfo.FIRE_CHECK_TYPE - this.form.DEPARTMENT_ID = data.checkListInfo.DEPARTMENT_ID + // this.form.DEPARTMENT_ID = data.checkListInfo.DEPARTMENT_ID + this.form.DEPARTMENT_ID.push(data.checkListInfo.DEPARTMENT_ID) + this.form.UPDATE_DEPARTMENT_ID = data.checkListInfo.DEPARTMENT_ID this.$nextTick(() => { - this.form.POST_ID = data.checkListInfo.POST_ID + // this.form.POST_ID = data.checkListInfo.POST_ID this.userList = [] this.getUserList() const u = [] u.push(data.checkListInfo.USER_ID) + this.form.UPDATE_USER_ID = data.checkListInfo.USER_ID this.$nextTick(() => { this.form.USER_ID = u this.checkListBackUp = data.checkStandardList @@ -968,6 +1029,56 @@ export default { ).then((data) => { this.deviceTypeList = data.list }) + }, + onClick() { + this.updateValue = false + this.$nextTick(() => { + this.updateValue = true + }) + }, + // 选择项时触发的事件 + handleSelect(selectedItems) { + // 选择父节点时同时勾选全部子节点 + if (!this.form.DEPARTMENT_ID.includes(selectedItems.id)) { + this.form.DEPARTMENT_ID.push(selectedItems.id) + } + this.pullSelectedNodes(selectedItems) + this.onClick() + }, + // 将树节点的子节点全部添加到数组中 + pullSelectedNodes(selectedItems) { + if (selectedItems.nodes && selectedItems.nodes.length > 0) { + for (let i = 0; i < selectedItems.nodes.length; i++) { + if (!this.form.DEPARTMENT_ID.includes(selectedItems.nodes[i].id)) { + this.form.DEPARTMENT_ID.push(selectedItems.nodes[i].id) + } + this.pullSelectedNodes(selectedItems.nodes[i]) + } + } + }, + // 移除选中项时触发的事件 + handleRemove(selectedItems) { + this.form.USER_ID = [] + // 移除选中项时同时移除全部子节点 + if (this.form.INVOLVING_CORPS_DEPART_ID.includes(selectedItems.id)) { + this.form.INVOLVING_CORPS_DEPART_ID.splice(this.form.INVOLVING_CORPS_DEPART_ID.indexOf(selectedItems.id), 1) + } + this.removeSelectedNodes(selectedItems) + this.onClick() + }, + // 将选中项的子节点全部移除 + removeSelectedNodes(selectedItems) { + if (selectedItems.nodes && selectedItems.nodes.length > 0) { + for (let i = 0; i < selectedItems.nodes.length; i++) { + if (this.form.INVOLVING_CORPS_DEPART_ID.includes(selectedItems.nodes[i].id)) { + this.form.INVOLVING_CORPS_DEPART_ID.splice(this.form.INVOLVING_CORPS_DEPART_ID.indexOf(selectedItems.nodes[i].id), 1) + } + this.removeSelectedNodes(selectedItems.nodes[i]) + } + } + }, + updateDeptChange() { + this.form.UPDATE_USER_ID = '' } } } diff --git a/src/views/firefighting/device/components/list.vue b/src/views/firefighting/device/components/list.vue index 09cc403..14c8689 100644 --- a/src/views/firefighting/device/components/list.vue +++ b/src/views/firefighting/device/components/list.vue @@ -34,6 +34,16 @@ + + + + + + + + + + @@ -183,7 +193,9 @@ export default { FIRE_DEVICE_TYPE_ID: '', FIRE_REGION_ID: '', FIRE_POINT_NAME: '', - FIRE_DEVICE_CODE: '' + FIRE_DEVICE_CODE: '', + DEPARTMENT_NAME: '', + USER_NAME: '' }, treeData: [], typeData: [], @@ -284,7 +296,9 @@ export default { FIRE_REGION_ID: this.keySelect.FIRE_REGION_ID, FIRE_DEVICE_TYPE_ID: this.keySelect.FIRE_DEVICE_TYPE_ID, FIRE_POINT_NAME: this.keySelect.FIRE_POINT_NAME, - FIRE_DEVICE_CODE: this.keySelect.FIRE_DEVICE_CODE + FIRE_DEVICE_CODE: this.keySelect.FIRE_DEVICE_CODE, + DEPARTMENT_NAME: this.keySelect.DEPARTMENT_NAME, + USER_NAME: this.keySelect.USER_NAME } ).then((data) => { this.listLoading = false @@ -299,6 +313,8 @@ export default { this.keySelect.FIRE_DEVICE_TYPE_ID = '' this.keySelect.FIRE_REGION_ID = '' this.keySelect.FIRE_DEVICE_CODE = '' + this.keySelect.DEPARTMENT_NAME = '' + this.keySelect.USER_NAME = '' this.getList() }, getDict() { diff --git a/src/views/firefighting/points/components/list.vue b/src/views/firefighting/points/components/list.vue index 895841d..0a2a9c7 100644 --- a/src/views/firefighting/points/components/list.vue +++ b/src/views/firefighting/points/components/list.vue @@ -13,6 +13,19 @@ + + + + + @@ -78,6 +91,7 @@
新增 批量删除 + 批量修改负责人
打 印
+ + + + + + + + + + + + + @@ -153,6 +183,9 @@ export default { KEYWORDS: '', FIRE_POINT_NAME: '', FIRE_POINT_CODE: '', + selectForm: { + DEPARTMENT_ID: '' + }, // 树形菜单 filterText: '', varList: [], @@ -161,7 +194,17 @@ export default { value: 'id', children: 'nodes', label: 'name' - } + }, + editDataIds: [], + dialogEditUser: false, + dialogEditUserForm: { + USER_ID: '' + }, + dialogEditUserRules: { + USER_ID: [{ required: true, message: '请选择负责人', trigger: 'change' }] + }, + deptTreeData: [], + userList: [] } }, watch: { @@ -173,12 +216,19 @@ export default { created() { this.getList() this.hasButton() + this.getTreeData() }, methods: { handleShowQr(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 = this.config.weburlWaiwang + 'static/qrcode/views/bsbw/point_list.html?id=' + ROW.FIRE_POINT_ID + const json = { + MANAGER_TYPE: 'fireListManager', + FIRE_POINT_ID: ROW.FIRE_POINT_ID + } + const jsonStr = JSON.stringify(json) + this.qrcodeStr = jsonStr }, handleEdit(FIRE_POINT_ID) { this.$parent.FIRE_POINT_ID = FIRE_POINT_ID @@ -211,7 +261,8 @@ 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 } ).then((data) => { this.listLoading = false @@ -224,6 +275,9 @@ export default { }, goKeyReset() { this.FIRE_POINT_NAME = '' this.FIRE_POINT_CODE = '' + this.selectForm = { + DEPARTMENT_ID: '' + } this.getList() }, getDict() { @@ -263,6 +317,89 @@ 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) { diff --git a/src/views/firefighting/region/components/edit.vue b/src/views/firefighting/region/components/edit.vue index f892cba..2a2cb57 100644 --- a/src/views/firefighting/region/components/edit.vue +++ b/src/views/firefighting/region/components/edit.vue @@ -42,6 +42,14 @@
+ + + + 相机照相 + 相册获取 + + +
@@ -73,7 +81,8 @@ export default { FIRE_REGION_ID: '', DEPARTMENT_ID: '', REMAKE: '', - FIRE_REGION_CODE: '' + FIRE_REGION_CODE: '', + PHOTO_UPLOAD_METHOD: '' // 1相机 2相册 }, riskForm: {}, KEYWORDS: '', @@ -139,7 +148,8 @@ export default { FIRE_REGION_CODE: this.form.FIRE_REGION_CODE, DEPARTMENT_ID: this.form.DEPARTMENT_ID, DEPARTMENT_ID_OLD: this.DEPARTMENT_ID_OLD, - REMAKE: this.form.REMAKE + REMAKE: this.form.REMAKE, + PHOTO_UPLOAD_METHOD: this.form.PHOTO_UPLOAD_METHOD } ).then((data) => { if (data.code != 0) { @@ -186,6 +196,7 @@ export default { this.DEPARTMENT_ID_OLD = data.res.DEPARTMENT_ID this.form.FIRE_REGION_ID = data.res.FIRE_REGION_ID this.form.REMAKE = data.res.REMAKE + this.form.PHOTO_UPLOAD_METHOD = data.res.PHOTO_UPLOAD_METHOD.toString() this.dialogFormVisible = false }).catch((e) => { this.dialogFormVisible = false diff --git a/src/views/firefighting/region/components/list.vue b/src/views/firefighting/region/components/list.vue index 1e79e13..b4298be 100644 --- a/src/views/firefighting/region/components/list.vue +++ b/src/views/firefighting/region/components/list.vue @@ -80,6 +80,7 @@
新增 批量删除 + 批量修改负责部门
+ + + + + + + + + + @@ -128,7 +152,16 @@ export default { value: 'id', children: 'nodes', label: 'name' - } + }, + dialogEditDept: false, + form: { + DEPARTMENT_ID: '' + }, + rule: { + DEPARTMENT_ID: [{ required: true, message: '负责部门不能为空', trigger: 'blur' }] + }, + deptTreeData: [], + editDataIds: [] } }, watch: { @@ -141,6 +174,7 @@ export default { this.getList() this.hasButton() this.getTreeList() + this.getTreeData() }, methods: { filterNode(value, data) { @@ -162,6 +196,16 @@ export default { this.$parent.FIRE_REGION_NAME = FIRE_REGION_ID this.$parent.activeName = 'Subset' }, + // 部门列表树 + getTreeData() { + requestFN( + '/department/listTreeV2', + {} + ).then((data) => { + this.deptTreeData = JSON.parse(data.zTreeNodes) + }).catch((e) => { + }) + }, handleClose(FIRE_REGION_ID, name) { this.$confirm('确定要禁用[' + name + ']吗?', { confirmButtonText: '确定', @@ -226,6 +270,56 @@ export default { selectable(row, index) { return row.ITEMCOUNT == 0 }, + // 批量修改负责部门 + handelEditDept(row) { + this.editDataIds = [] + if (row.FIRE_REGION_ID) { + this.editDataIds.push(row.FIRE_REGION_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_REGION_ID) + }) + } + this.dialogEditDept = true + this.form = { + DEPARTMENT_ID: '' + } + }, + dialogEditDeptConfirm() { + this.$refs.firefightingBatchEditDept.validate((valid) => { + if (valid) { + this.listLoading = true + requestFN( + '/fireregion/batchEditDeptByIds', + { + DATA_IDS: this.editDataIds.join(','), + DEPARTMENT_ID: this.form.DEPARTMENT_ID + } + ).then(() => { + this.$message({ + message: '修改成功', + type: 'success' + }) + this.$refs.multipleTable.clearSelection() + this.listLoading = false + this.dialogEditDept = false + this.varList = [] + this.listQuery.page = 1 + this.getList() + }).catch((e) => { + this.listLoading = false + }) + } + }) + }, // 批量删除 handelDelete(row) { const DATA_IDS = [] diff --git a/src/views/hotwork/hotwork/components/list.vue b/src/views/hotwork/hotwork/components/list.vue index c8f5d5e..71632aa 100644 --- a/src/views/hotwork/hotwork/components/list.vue +++ b/src/views/hotwork/hotwork/components/list.vue @@ -94,7 +94,8 @@ 查看 - 删除 + + 删除 @@ -204,7 +205,8 @@ export default { HOT_WORK_POSITION: '', UNIT_LEADER_DEPARTMENT_ID: '' }, - loginUserID: '' + loginUserID: '', + loginRoleNumber: JSON.parse(sessionStorage.getItem('user')).RNUMBER } }, created() { @@ -335,7 +337,8 @@ export default { requestFN( '/hotworkapplication/delete', { - HOTWORKAPPLICATION_ID: id + HOTWORKAPPLICATION_ID: id, + loginUserId: this.loginUserID } ).then(() => { this.$message({ diff --git a/src/views/safetyenvironmental/archive/components/info.vue b/src/views/safetyenvironmental/archive/components/info.vue index 172cb8c..f8ff359 100644 --- a/src/views/safetyenvironmental/archive/components/info.vue +++ b/src/views/safetyenvironmental/archive/components/info.vue @@ -145,8 +145,8 @@ :preview-src-list="new Array(config.fileUrl + pd.INSPECTED_SITEUSER_SIGN_IMG)" style="width: 100px; height: 100px"/> - 确认时间: - {{ pd.INSPECTED_SITEUSER_SIGN_TIME }} + + diff --git a/src/views/safetyenvironmental/inspection/components/info.vue b/src/views/safetyenvironmental/inspection/components/info.vue index 532620f..2414b31 100644 --- a/src/views/safetyenvironmental/inspection/components/info.vue +++ b/src/views/safetyenvironmental/inspection/components/info.vue @@ -182,8 +182,8 @@ :preview-src-list="new Array(config.fileUrl + pd.INSPECTED_SITEUSER_SIGN_IMG)" style="width: 100px; height: 100px"/> - 确认时间: - {{ pd.INSPECTED_SITEUSER_SIGN_TIME }} + +