From 06c2b057ea97c12f30c29c80e014e59e45d601d1 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 11 Apr 2022 16:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E6=8A=A5=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonReportTable/commonReportTable.html | 9 ++- .../commonReportTable/commonReportTable.js | 73 ++++++++++++++----- 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/public/components/property/commonReportTable/commonReportTable.html b/public/components/property/commonReportTable/commonReportTable.html index af19dfe0b..04c63d366 100644 --- a/public/components/property/commonReportTable/commonReportTable.html +++ b/public/components/property/commonReportTable/commonReportTable.html @@ -11,13 +11,11 @@
- +
-
@@ -32,6 +30,9 @@
{{item.componentName}}
+
diff --git a/public/components/property/commonReportTable/commonReportTable.js b/public/components/property/commonReportTable/commonReportTable.js index da618fe59..da2b4c918 100644 --- a/public/components/property/commonReportTable/commonReportTable.js +++ b/public/components/property/commonReportTable/commonReportTable.js @@ -1,7 +1,7 @@ /** 入驻小区 **/ -(function (vc) { +(function(vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 15; vc.extends({ @@ -13,20 +13,20 @@ customId: '' } }, - _initMethod: function () { + _initMethod: function() { }, - _initEvent: function () { - vc.on('commonReportTable', 'witch', function (_value) { + _initEvent: function() { + vc.on('commonReportTable', 'witch', function(_value) { $that.commonReportTableInfo.customId = _value.customId; $that._listReportCustomTableComponent(); }) - vc.on('commonReportTable', 'paginationPlus', 'page_event', function (_currentPage) { + vc.on('commonReportTable', 'paginationPlus', 'page_event', function(_currentPage) { vc.component._listReportCustomTableDatas(_currentPage, DEFAULT_ROWS, $that.commonReportTableInfo.components[0]); }); }, methods: { - _queryReportTableMethod: function (item) { + _queryReportTableMethod: function(item) { let _condition = {}; item.conditions.forEach(_item => { _condition[_item.param] = _item.value; @@ -35,7 +35,7 @@ $that._listReportCustomTableDatas(1, 15, item, _condition); $that._listReportCustomTableFooter(1, 15, item, _condition); }, - _listReportCustomTableComponent: function () { + _listReportCustomTableComponent: function() { var param = { params: { page: 1, @@ -47,7 +47,7 @@ //发送get请求 vc.http.apiGet('/reportCustomComponentRel.listReportCustomComponentRel', param, - function (json, res) { + function(json, res) { let _reportCustomComponentRelManageInfo = JSON.parse(json); $that.commonReportTableInfo.components = _reportCustomComponentRelManageInfo.data; $that.commonReportTableInfo.components.forEach(item => { @@ -55,12 +55,13 @@ $that._listReportCustomTableDatas(1, 15, item); $that._listReportCustomTableFooter(1, 15, item); }); - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, - _listReportCustomTableConditions: function (_component) { + _listReportCustomTableConditions: function(_component) { let param = { params: { @@ -72,19 +73,20 @@ //发送get请求 vc.http.apiGet('/reportCustomComponentCondition.listReportCustomComponentCondition', param, - function (json, res) { + function(json, res) { let _componentConditionManageInfo = JSON.parse(json); _component.conditions = _componentConditionManageInfo.data; $that.$forceUpdate(); //处理日期类型 - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, - _listReportCustomTableDatas: function (_page, _row, _component, _conditions) { + _listReportCustomTableDatas: function(_page, _row, _component, _conditions) { let _community = vc.getCurrentCommunity(); let _communityId = ''; if (_community) { @@ -110,7 +112,7 @@ //发送get请求 vc.http.apiGet('/reportCustomComponent.listReportCustomComponentData', param, - function (json, res) { + function(json, res) { let _componentDataManageInfo = JSON.parse(json); if (_componentDataManageInfo.code != 0) { vc.toast(_componentDataManageInfo.msg); @@ -124,12 +126,13 @@ currentPage: _page }); $that.$forceUpdate(); - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, - _listReportCustomTableFooter: function (_page, _row, _component, _conditions) { + _listReportCustomTableFooter: function(_page, _row, _component, _conditions) { let _community = vc.getCurrentCommunity(); let _communityId = ''; if (_community) { @@ -155,7 +158,7 @@ //发送get请求 vc.http.apiGet('/reportCustomComponent.listReportCustomComponentDataFooter', param, - function (json, res) { + function(json, res) { let _componentDataManageInfo = JSON.parse(json); if (_componentDataManageInfo.code != 0) { return; @@ -163,10 +166,44 @@ let _data = _componentDataManageInfo.data; _component.footer = _data; $that.$forceUpdate(); - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); + }, + _exportReportTableMethod: function(item) { + let _community = vc.getCurrentCommunity(); + let _communityId = ''; + if (_community) { + _communityId = _community.communityId + } + let _condition = {}; + item.conditions.forEach(_item => { + _condition[_item.param] = _item.value; + }) + + _condition.page = 1; + _condition.row = 10000; + _condition.componentId = item.componentId; + _condition.communityId = _communityId + + + let _result = []; + for (let key in _condition) { + let value = _condition[key]; + + if (!value) { + continue; + } + + _result.push(key + '=' + value); + + } + let urlParam = _result.join('&'); + + vc.jumpToPage('/callComponent/importAndExportFee/exportCustomReportTableData?' + urlParam) + } } });