(function (vc) {
|
var DEFAULT_PAGE = 1;
|
var DEFAULT_ROWS = 10;
|
vc.extends({
|
data: {
|
flowchartFee: {
|
_currentTab: 'reportFeeDetailRoom',
|
floors: [],
|
moreCondition: false,
|
communitys: [],
|
fees: [],
|
feeTypeCds: [],
|
total: 0,
|
records: 0,
|
conditions: {
|
floorId: '',
|
objName: '',
|
endYear: '',
|
startDate: '',
|
endDate: '',
|
configId: '',
|
feeTypeCd: '',
|
ownerName: '',
|
link: '',
|
communityId: ''
|
},
|
query: {
|
endYear: '',
|
communityId: ''
|
},
|
yearArr: [],
|
yearArr2: [],
|
reportLength: 10,
|
years: [2025],
|
history: [{
|
year: 2020,
|
value1: 200,
|
value2: 200,
|
value3: 200,
|
},
|
{
|
year: 2021,
|
value1: 200,
|
value2: 200,
|
value3: 200,
|
},
|
{
|
year: 2023,
|
value1: 200,
|
value2: 200,
|
value3: 200,
|
},
|
{
|
year: 2024,
|
value1: 200,
|
value2: 200,
|
value3: 200,
|
},
|
],
|
today: {
|
year: 2025,
|
value1: 200,
|
value2: 200,
|
value3: 200,
|
value4: 200,
|
}
|
|
},
|
},
|
_initMethod: function () {
|
// $that._initDate();
|
$that._loadStaffCommunitys();
|
$that.flowchartFee.conditions.communityId = vc.getCurrentCommunity().communityId;
|
// $that.changeTab($that.flowchartFee._currentTab);
|
vc.getDict('pay_fee_config', "fee_type_cd_show", function (_data) {
|
$that.flowchartFee.feeTypeCds = _data
|
});
|
$that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
_initEvent: function () {
|
vc.on("indexContext", "_queryIndexContextData", function (_param) {});
|
vc.on('reportFeeDetailOwner', 'switch', function (_data) {
|
$that.flowchartFee.conditions = _data;
|
$that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
});
|
vc.on('reportFeeDetailOwner', 'notify', function (_data) {
|
$that.flowchartFee.conditions = _data;
|
$that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
});
|
vc.on('reportFeeDetailOwner', 'paginationPlus', 'page_event', function (_currentPage) {
|
$that._listReportFeeDetailOwners(_currentPage, DEFAULT_ROWS);
|
});
|
},
|
methods: {
|
_toDetail: function (_fee) {
|
vc.jumpToPage('/#/pages/property/flowchartFeesDetail?feeId=' + _fee.feeId);
|
},
|
_computeTableDivWidth: function () {
|
let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
|
mainWidth = mainWidth - 20 - 15 - 20;
|
return mainWidth + 'px';
|
},
|
_computeTableDivHeight: function () {
|
// 使用 getElementsByClassName 代替 getElementByClassName
|
let mainHeight = document.getElementsByClassName('vc-main-content')[0].clientHeight - document.getElementsByClassName('ibox')[0].offsetHeight;
|
mainHeight = mainHeight - 160;
|
return mainHeight + 'px';
|
},
|
|
// _initDate: function () {
|
// vc.initDate('startDate', function (_value) {
|
// $that.flowchartFee.conditions.startDate = _value;
|
// });
|
// vc.initDate('endDate', function (_value) {
|
// $that.flowchartFee.conditions.endDate = _value;
|
// });
|
// let _data = new Date();
|
// let _month = _data.getMonth() + 1;
|
// let _newDate = "";
|
// if (_month < 10) {
|
// _newDate = _data.getFullYear() + "-0" + _month + "-01";
|
// } else {
|
// _newDate = _data.getFullYear() + "-" + _month + "-01";
|
// }
|
// $that.flowchartFee.conditions.startDate = _newDate;
|
// _data.setMonth(_data.getMonth() + 1);
|
// _month = _data.getMonth() + 1;
|
// if (_month < 10) {
|
// _newDate = _data.getFullYear() + "-0" + _month + "-01";
|
// } else {
|
// _newDate = _data.getFullYear() + "-" + _month + "-01";
|
// }
|
// // $that.flowchartFee.conditions.endDate = _newDate;
|
// },
|
changeTab: function (_tab) {
|
$that.flowchartFee._currentTab = _tab;
|
vc.emit(_tab, 'switch', $that.flowchartFee.conditions)
|
$that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
//查询
|
_queryMethod: function () {
|
$that.changeTab($that.flowchartFee._currentTab);
|
},
|
_reloadMethod: function () {
|
vc.component.flowchartFee.conditions.endYear = "";
|
$that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS,true)
|
},
|
//重置
|
_resetMethod: function () {
|
vc.component.flowchartFee.conditions.endYear = "";
|
// vc.component.flowchartFee.conditions.endDate = "";
|
// vc.component.flowchartFee.conditions.objName = "";
|
// vc.component.flowchartFee.conditions.ownerName = "";
|
// vc.component.flowchartFee.conditions.link = "";
|
// // vc.component.flowchartFee.conditions.communityId = "";
|
// $that._initDate();
|
$that.changeTab($that.flowchartFee._currentTab);
|
},
|
_loadStaffCommunitys: function () {
|
let param = {
|
params: {
|
_uid: '123mlkdinkldldijdhuudjdjkkd',
|
page: 1,
|
row: 100,
|
}
|
};
|
vc.http.apiGet('/community.listMyEnteredCommunitys',
|
param,
|
function (json, res) {
|
if (res.status == 200) {
|
let _data = JSON.parse(json);
|
$that.flowchartFee.communitys = _data.communitys;
|
}
|
},
|
function () {
|
console.log('请求失败处理');
|
}
|
);
|
},
|
_changCommunity: function () {
|
$that.changeTab($that.flowchartFee._currentTab);
|
},
|
_moreCondition: function () {
|
if (vc.component.flowchartFee.moreCondition) {
|
vc.component.flowchartFee.moreCondition = false;
|
} else {
|
vc.component.flowchartFee.moreCondition = true;
|
}
|
},
|
_listReportFeeDetailOwners: function (_page, _rows, _reload) {
|
|
|
let param = {
|
params: {
|
endYear: vc.component.flowchartFee.conditions.endYear,
|
communityId: vc.getCurrentCommunity().communityId
|
}
|
};
|
if (_reload) {
|
param.params.reload = true;
|
}
|
//发送get请求
|
vc.http.apiGet('/fee.reportFeeCmd',
|
param,
|
function (json, res) {
|
let _json = JSON.parse(json);
|
let _data = _json.data || {};
|
console.log('_listReportFeeDetailOwners11111',_data);
|
|
$that.flowchartFee.total = _json.total;
|
$that.flowchartFee.fees = _data.repostList || [];
|
$that.flowchartFee.yearArr = _data.yearArr || []
|
$that.flowchartFee.yearArr2 = _data.yearArr2 || []
|
|
$that.flowchartFee.reportLength = _data.reportLength || 10;
|
console.log('_listReportFeeDetailOwners2222',_data.yearArr,_data.reportLength);
|
|
|
vc.emit('reportFeeDetailOwner', 'paginationPlus', 'init', {
|
total: $that.flowchartFee.records,
|
dataCount: $that.flowchartFee.total,
|
currentPage: _page,
|
});
|
},
|
function (errInfo, error) {
|
console.log('请求失败处理');
|
}
|
);
|
},
|
_exportflowchartManageOwnerExcel: function () {
|
$that.flowchartFee.conditions.communityId = vc.getCurrentCommunity().communityId;
|
$that.flowchartFee.conditions.communityName = vc.getCurrentCommunity().name;
|
$that.flowchartFee.conditions.pagePath = 'reportFee';
|
let param = {
|
params: $that.flowchartFee.conditions
|
};
|
//发送get请求
|
vc.http.apiGet('/export.exportData', param,
|
function (json, res) {
|
let _json = JSON.parse(json);
|
vc.toast(_json.msg);
|
if (_json.code == 0) {
|
vc.jumpToPage('/#/pages/property/downloadTempFile?tab=下载中心')
|
}
|
},
|
function (errInfo, error) {
|
console.log('请求失败处理');
|
});
|
}
|
}
|
})
|
})(window.vc);
|