(function (vc) { vc.extends({ data: { reportFeeDetailInfo: { _currentTab: 'reportFeeDetailRoom', floors: [], moreCondition: false, communitys: [], conditions: { floorId: '', objName: '', startDate: '', endDate: '', configId: '', feeTypeCd: '', ownerName: '', link: '', communityId: '' } } }, _initMethod: function () { vc.component._initDate(); vc.component._loadStaffCommunitys(); vc.component.reportFeeDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId; vc.component.reportFeeDetailInfo.conditions.communityName = vc.getCurrentCommunity().name; vc.component.changeTab(vc.component.reportFeeDetailInfo._currentTab); }, _initEvent: function () { vc.on("indexContext", "_queryIndexContextData", function (_param) { }); }, methods: { _initDate: function () { vc.initDate('startDate', function (_value) { vc.component.reportFeeDetailInfo.conditions.startDate = _value; }); vc.initDate('endDate', function (_value) { vc.component.reportFeeDetailInfo.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"; } vc.component.reportFeeDetailInfo.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"; } vc.component.reportFeeDetailInfo.conditions.endDate = _newDate; }, changeTab: function (_tab) { vc.component.reportFeeDetailInfo._currentTab = _tab; vc.emit(_tab, 'switch', vc.component.reportFeeDetailInfo.conditions) }, //查询 _queryMethod: function () { vc.component.changeTab(vc.component.reportFeeDetailInfo._currentTab); }, //重置 _resetMethod: function () { vc.component.reportFeeDetailInfo.conditions.startDate = ""; vc.component.reportFeeDetailInfo.conditions.endDate = ""; vc.component.reportFeeDetailInfo.conditions.objName = ""; vc.component.reportFeeDetailInfo.conditions.ownerName = ""; vc.component.reportFeeDetailInfo.conditions.link = ""; // vc.component.reportFeeDetailInfo.conditions.communityId = ""; vc.component._initDate(); vc.component.changeTab(vc.component.reportFeeDetailInfo._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); vc.component.reportFeeDetailInfo.communitys = _data.communitys; } }, function () { console.log('请求失败处理'); } ); }, _changCommunity: function () { vc.component.changeTab(vc.component.reportFeeDetailInfo._currentTab); }, _moreCondition: function () { if (vc.component.reportFeeDetailInfo.moreCondition) { vc.component.reportFeeDetailInfo.moreCondition = false; } else { vc.component.reportFeeDetailInfo.moreCondition = true; } } } }) })(window.vc);