有报表导出

This commit is contained in:
java110 2022-04-11 16:43:37 +08:00
parent 3be61a6192
commit 06c2b057ea
2 changed files with 60 additions and 22 deletions

View File

@ -11,13 +11,11 @@
<div class="row">
<div class="col-sm-3" v-for="(conditionItem,conditionIndex) in item.conditions">
<div class="form-group">
<input :type="conditionItem.type" :placeholder="conditionItem.holdpace"
v-model="conditionItem.value" class=" form-control" :class="">
<input :type="conditionItem.type" :placeholder="conditionItem.holdpace" v-model="conditionItem.value" class=" form-control" :class="">
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_queryReportTableMethod(item)">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryReportTableMethod(item)">
<i class="fa fa-search"></i> 查询
</button>
</div>
@ -32,6 +30,9 @@
<div class="ibox-title">
<h5>{{item.componentName}}</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-white btn-sm" v-on:click="_exportReportTableMethod(item)">
导出
</button>
</div>
</div>
<div class="ibox-content">

View File

@ -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)
}
}
});