From bcf407e403a24801695859b2454af377bb006695 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Tue, 1 Mar 2022 14:59:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/community/communityTable.vue | 103 +++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index c33c0246..39b64c96 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -98,12 +98,18 @@
- + style="width: 100%" + @select-all="selectAll" + @selection-change="selectionChange"> + + @@ -162,6 +168,16 @@ :total="total">
+ +
+ 全选 + 删除 +
@@ -197,11 +213,14 @@ export default { pageSize: 20, pageNo: 0, tableLoading: true, + selAllFlag: false, + isIndeterminate: false,//复选框的不确定状态 agencyObj: {},//树所选的组织对象 ownerName: '', ownerPhone: '', tableData: [], + selection: [], //form相关 formShow: false, @@ -231,7 +250,61 @@ export default { ...mapGetters(['clientHeight']) }, methods: { + handleSelectAll (selectAllFlag) { + this.$refs.ref_table.clearSelection(); + if (selectAllFlag) { + this.tableData.forEach(row => { + this.$refs.ref_table.toggleRowSelection(row); + }); + } + }, + deleteBatch () { + if (this.selection.length > 0) { + this.$confirm("确认删除选择的小区?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.deleteCommunityBatch() + }) + .catch(err => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消删除" + // }); + } + + }); + } else { + this.$message.warning('请先选择要删除的小区') + } + }, + selectAll (selection) { + this.selection = selection + if (selection.length > 0) { + this.selAllFlag = true + } else { + this.selAllFlag = false + } + + }, + selectionChange (selection) { + this.selection = selection + + if (selection.length === this.tableData.length) { + this.selAllFlag = true + this.isIndeterminate = false + } else if (selection.length > 0) { + this.selAllFlag = false + this.isIndeterminate = true + } else { + this.selAllFlag = false + this.isIndeterminate = false + } + }, handleSearch () { this.loadTable() }, @@ -326,6 +399,26 @@ export default { }); }, + async deleteCommunityBatch () { + const url = "/gov/org/neighborhood/neighborhooddel" + + let params = { + neighborHoodId: row.neighborHoodId + } + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + this.$message({ + type: "success", + message: "删除成功" + }); + this.$emit('refreshTree') + this.loadTable() + } else { + this.$message.error(msg) + } + }, async deleteCommunity (row) { const url = "/gov/org/neighborhood/neighborhooddel" @@ -573,6 +666,12 @@ export default { .div_table { margin-top: 20px; + position: relative; +} +.div_del { + position: absolute; + left: 10px; + bottom: 0; } .div_search { display: flex; From 04347893bbb268231d35a802393dbe8f0a0cf20f Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Wed, 2 Mar 2022 15:50:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/resi.vue | 131 ++++++++++++++++++++++++++++---- 1 file changed, 118 insertions(+), 13 deletions(-) diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 86c4e35f..b062a50a 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -32,11 +32,15 @@ - + class="resi-table" + @select-all="selectAll" + @selection-change="selectionChange"> + -
- - +
+
+ 全选 + 删除 +
+
+ + +
+
@@ -240,6 +256,8 @@ export default { btnLoading: false, disabled: false, pageLoading: false, + selAllFlag: false, + isIndeterminate: false, dialogEditVisible: false, dialogVisible: false, uploadUlr: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel', @@ -262,6 +280,7 @@ export default { formList: [], tableHeader: [], tabsList: [], + selection: [], defaultCategotyKey: '', @@ -336,6 +355,61 @@ export default { const { user } = this.$store.state return id === user.agencyId }, + selectionChange (selection) { + this.selection = selection + + if (selection.length === this.tableData.length) { + this.selAllFlag = true + this.isIndeterminate = false + } else if (selection.length > 0) { + this.selAllFlag = false + this.isIndeterminate = true + } else { + this.selAllFlag = false + this.isIndeterminate = false + } + }, + handleSelectAll (selectAllFlag) { + this.$refs.ref_table.clearSelection(); + if (selectAllFlag) { + this.tableData.forEach(row => { + this.$refs.ref_table.toggleRowSelection(row); + }); + } + }, + selectAll (selection) { + this.selection = selection + + if (selection.length > 0) { + this.selAllFlag = true + } else { + this.selAllFlag = false + } + + }, + deleteBatch () { + if (this.selection.length > 0) { + this.$confirm("删除之后无法恢复,确认删除?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.deleteresiBatch() + }) + .catch(err => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消删除" + // }); + } + + }); + } else { + this.$message.warning('请先选择要删除的小区') + } + }, handleSizeChange (val) { console.log(`每页 ${val} 条`) this.pageSize = val @@ -627,7 +701,7 @@ export default { handleDel (row) { let params = { formCode: 'resi_base_info', - icResiUserId: row.icResiUserId + userIds: [row.icResiUserId] } console.log('row1', row) this.$http @@ -926,7 +1000,29 @@ export default { .catch(() => { return this.$message.error('网络错误') }) - } + }, + async deleteresiBatch () { + if (this.selection.length === 0) return this.$message.error('请选择之后进行操作') + let userIds = this.selection.map(item => item.icResiUserId) + let params = { + formCode: 'resi_base_info', + userIds + } + this.$http + .post('/epmetuser/icresiuser/delete', params) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + this.$message.success('删除成功') + this.getTableData() + } + }) + .catch((err) => { + console.log('row4', err) + return this.$message.error('网络错误') + }) + }, } } @@ -1033,4 +1129,13 @@ export default { margin-top: 20px; text-align: center; } +.div-flex { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + .div_del { + margin-top: 15px; + } +} From 7633b946ef59f48602386eee11c72cce7a3c1a2c Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Thu, 3 Mar 2022 13:46:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AF=BC=E5=85=A5ddd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityService/sqzzz/index.vue | 65 ++++++++++++------- .../visual/communityParty/community.vue | 25 +++++-- 2 files changed, 63 insertions(+), 27 deletions(-) diff --git a/src/views/modules/communityService/sqzzz/index.vue b/src/views/modules/communityService/sqzzz/index.vue index c6e74ee5..0524e4f5 100644 --- a/src/views/modules/communityService/sqzzz/index.vue +++ b/src/views/modules/communityService/sqzzz/index.vue @@ -270,34 +270,53 @@ export default { } return fileType && isLt1M; }, - uploadHttpRequest(file) { + async uploadHttpRequest(file) { this.importLoading = true; this.importBtnTitle = "正在上传中..."; + this.$message({ + showClose: true, + message: '导入中,请到系统管理-导入记录中查看进度', + duration: 0 + }) const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 formData.append("file", file.file); //添加文件对象 - axios({ - url: - window.SITE_CONFIG["apiURL"] + - "/heart/iccommunityselforganization/importcommunityselforganization", - method: "post", - data: formData, - // responseType: "blob", - }) - .then((res) => { - this.importLoading = false; - this.importBtnTitle = "excel导入"; - console.log("resresresresresresres", res); - - this.getTableData(); - if (res.data.code == 0) { - return this.$message.success(res.data.data || "导入成功"); - } else { - return this.$message.error(res.data.msg); - } + await this.$http + .post('/heart/iccommunityselforganization/importcommunityselforganization', formData).then(res => { + console.log('res-up', res) + if (res.data.code == 0 && res.data.msg == 'success') { + this.$message.success('导入成功') + this.getTableData() + } else this.$message.error(res.data.msg) + }).catch(err => { + console.log('失败', err) + file.onError() //上传失败的文件会从文件列表中删除 + this.$message.error('导入失败') }) - .catch((err) => { - console.log("失败", err); - }); + // axios({ + // url: + // window.SITE_CONFIG["apiURL"] + + // "/heart/iccommunityselforganization/importcommunityselforganization", + // method: "post", + // data: formData, + // // responseType: "blob", + // }) + // .then((res) => { + // this.importLoading = false; + // this.importBtnTitle = "excel导入"; + // console.log("resresresresresresres", res); + + // this.getTableData(); + // if (res.data.code == 0) { + // return this.$message.success(res.data.data || "导入成功"); + // } else { + // return this.$message.error(res.data.msg); + // } + // }) + // .catch((err) => { + // console.log("失败", err); + // }); + this.importLoading = false + this.importBtnTitle = 'excel导入' this.$refs.upload.clearFiles(); }, diff --git a/src/views/modules/visual/communityParty/community.vue b/src/views/modules/visual/communityParty/community.vue index b550259b..1146ca2d 100644 --- a/src/views/modules/visual/communityParty/community.vue +++ b/src/views/modules/visual/communityParty/community.vue @@ -36,7 +36,8 @@ prefix-icon="el-icon-caret-bottom" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" - :default-time="['00:00:00', '23:59:59']"> + :default-time="['00:00:00', '23:59:59']" + @change="handleTimeChange">
@@ -121,6 +122,7 @@