From 16e83d202b3c7df620ad36c00c23bc9421e13b4c Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 31 May 2022 11:06:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=80=BB=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/factagencyuserhousedaily.vue | 166 ++++++++++++++++-- 1 file changed, 147 insertions(+), 19 deletions(-) diff --git a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue index 917751d6..8071612e 100644 --- a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue +++ b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue @@ -1,6 +1,7 @@ @@ -88,10 +124,12 @@ export default { deleteIsBatch: true }, optionsA: [], + totalVisible: false, timeRange: '', dataForm: { id: '' }, + tableData: [] } }, components: { @@ -113,13 +151,30 @@ export default { } }, methods: { + handleTotal () { + this.tableData = [] + this.$http + .get('/data/stats/factAgencyUserHouseDaily/total',{params: this.dataForm}) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + console.log('获取查询详情成功', res.data) + this.tableData.push(res.data) + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + this.totalVisible = true + }, cascaderClick (nodeData) { this.dataForm.agencyId = nodeData.agencyId; this.dataForm.level = nodeData.level this.$refs.cascaderUnit.checkedValue = nodeData.agencyId; this.$refs.cascaderUnit.computePresentText(); this.$refs.cascaderUnit.toggleDropDownVisible(false); - + }, getGridList() { const { user } = this.$store.state @@ -144,7 +199,7 @@ export default { } + + From 8fcdf95cf533f050f63fe273dd7cce89ae9b0655 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 31 May 2022 11:13:20 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/factagencyuserhousedaily.vue | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue index 8071612e..597c874b 100644 --- a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue +++ b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue @@ -47,10 +47,10 @@
- 总计 - 导出
@@ -121,7 +121,8 @@ export default { getDataListURL: '/data/stats/factAgencyUserHouseDaily/page', getDataListIsPage: true, deleteURL: '/data/stats/factAgencyUserHouseDaily', - deleteIsBatch: true + deleteIsBatch: true, + exportURL: '/data/stats/factAgencyUserHouseDaily/export' }, optionsA: [], totalVisible: false, @@ -151,7 +152,7 @@ export default { } }, methods: { - handleTotal () { + totalHandle () { this.tableData = [] this.$http .get('/data/stats/factAgencyUserHouseDaily/total',{params: this.dataForm}) @@ -168,6 +169,34 @@ export default { }) this.totalVisible = true }, + exportHandle () { + const url = this.mixinViewModuleOptions.exportURL + this.$http({ + method: 'GET', + url, + responseType: 'blob', + params: this.dataForm + }).then(res => { + // this.download(res.data, title + '.xls') + if (res.headers["content-disposition"]) { + let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) + console.log('filename', fileName) + let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + var url = window.URL.createObjectURL(blob) + var aLink = document.createElement('a') + aLink.style.display = 'none' + aLink.href = url + aLink.setAttribute('download', fileName) + document.body.appendChild(aLink) + aLink.click() + document.body.removeChild(aLink) //下载完成移除元素 + window.URL.revokeObjectURL(url) //释放掉blob对象 + } else this.$message.error('下载失败') + }).catch(err => { + console.log('err', err) + return this.$message.error('网络错误') + }) + }, cascaderClick (nodeData) { this.dataForm.agencyId = nodeData.agencyId; this.dataForm.level = nodeData.level From e56f40e25928710245ea7207a6f95d229d0752c2 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 31 May 2022 13:25:32 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/plugins/stats/factagencyuserhousedaily.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue index 597c874b..d3a6ffe4 100644 --- a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue +++ b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue @@ -59,7 +59,7 @@ - + From a10dd3856cfe09c72eb9b0e893215a41b40af9af Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 31 May 2022 15:59:43 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/view-module.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mixins/view-module.js b/src/mixins/view-module.js index ebde6a3e..dcfabd2e 100644 --- a/src/mixins/view-module.js +++ b/src/mixins/view-module.js @@ -44,16 +44,16 @@ export default { query () { this.dataListLoading = true this.$http.get( - this.mixinViewModuleOptions.getDataListURL, - { - params: { - order: this.order, - orderField: this.orderField, - page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, - limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, - ...this.dataForm + this.mixinViewModuleOptions.getDataListURL, + { + params: { + order: this.order, + orderField: this.orderField, + page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, + limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, + ...this.dataForm + } } - } ).then(({ data: res }) => { this.dataListLoading = false if (res.code !== 0) { From 4aa5145b186901be8c72f0d01fb7ea7a70333771 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 1 Jun 2022 10:16:01 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=96=87=E5=AD=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/plugins/stats/factagencyuserhousedaily.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue index d3a6ffe4..9b5a7b66 100644 --- a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue +++ b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue @@ -28,7 +28,7 @@ - Date: Wed, 1 Jun 2022 16:41:13 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/plugins/stats/factagencyuserhousedaily.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue index 9b5a7b66..b7a36560 100644 --- a/src/views/modules/plugins/stats/factagencyuserhousedaily.vue +++ b/src/views/modules/plugins/stats/factagencyuserhousedaily.vue @@ -218,6 +218,7 @@ export default { this.optionsA.push(res.data) this.dataForm.agencyId = res.data.agencyId this.dataForm.level = res.data.level + this.getDataList() } }) .catch(() => {