/** 入驻小区 **/ (function (vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ data: { reportPayFeeDepositInfo: { total: 0, records: 1, moreCondition: false, title: '', depositFees: [], sumTotal: [], feeConfigs: [], states: [], payerObjTypes: [], detailStates: [], roomUnits: [], conditions: { floorId: '', floorName: '', roomNum: '', unitId: '', feeId: '', state: '', payerObjType: '', startTime: '', endTime: '', configId: '', detailState: '', feeTypeCd: '888800010006', //押金 communityId: vc.getCurrentCommunity().communityId } } }, _initMethod: function () { // $that.initFeeConfig(); $that._initDate(); //与字典表收费状态关联 vc.getDict('pay_fee', "state", function (_data) { $that.reportPayFeeDepositInfo.states = _data; }); //与字典表付费对象类型关联 vc.getDict('pay_fee', "payer_obj_type", function (_data) { $that.reportPayFeeDepositInfo.payerObjTypes = _data; }); //与字典表退费状态关联 vc.getDict('pay_fee_detail', "state", function (_data) { $that.reportPayFeeDepositInfo.detailStates = _data; }); $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS); $(".popover-show").mouseover(() => { $('.popover-show').popover('show'); }) $(".popover-show").mouseleave(() => { $('.popover-show').popover('hide'); }) }, _initEvent: function () { vc.on('reportPayFeeDeposit', 'chooseFloor', function (_param) { $that.reportPayFeeDepositInfo.conditions.floorId = _param.floorId; $that.reportPayFeeDepositInfo.conditions.floorName = _param.floorName; $that.loadUnits(_param.floorId); }); vc.on('pagination', 'page_event', function (_currentPage) { $that._listFees(_currentPage, DEFAULT_ROWS); }); }, methods: { _initDate: function () { $(".startTime").datetimepicker({ language: 'zh-CN', fontAwesome: 'fa', format: 'yyyy-mm-dd hh:ii:ss', initTime: true, initialDate: new Date(), autoClose: 1, // todayBtn: true, clearBtn: true }); $(".endTime").datetimepicker({ language: 'zh-CN', fontAwesome: 'fa', format: 'yyyy-mm-dd hh:ii:ss', initTime: true, initialDate: new Date(), autoClose: 1, todayBtn: true, clearBtn: true }); $('.startTime').datetimepicker() .on('changeDate', function (ev) { var value = $(".startTime").val(); $that.reportPayFeeDepositInfo.conditions.startTime = value; }); $('.endTime').datetimepicker() .on('changeDate', function (ev) { var value = $(".endTime").val(); $that.reportPayFeeDepositInfo.conditions.endTime = value; let start = Date.parse(new Date($that.reportPayFeeDepositInfo.conditions.startTime)) let end = Date.parse(new Date($that.reportPayFeeDepositInfo.conditions.endTime)) if (start - end >= 0) { vc.toast("结束时间必须大于开始时间") $that.reportPayFeeDepositInfo.conditions.endTime = ''; } }); //防止多次点击时间插件失去焦点 document.getElementsByName('startTime')[0].addEventListener('click', myfunc) function myfunc(e) { e.currentTarget.blur(); } document.getElementsByName("endTime")[0].addEventListener('click', myfunc) function myfunc(e) { e.currentTarget.blur(); } }, //查询 _queryMethod: function () { $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, //查询方法 _listFees: function (_page, _rows) { $that.reportPayFeeDepositInfo.conditions.page = _page; $that.reportPayFeeDepositInfo.conditions.row = _rows; let param = { params: $that.reportPayFeeDepositInfo.conditions }; param.params.feeId = param.params.feeId.trim(); //发送get请求 vc.http.apiGet('/reportFeeMonthStatistics/queryPayFeeDeposit', param, function (json, res) { let _json = JSON.parse(json); $that.reportPayFeeDepositInfo.total = _json.total; $that.reportPayFeeDepositInfo.records = _json.records; $that.reportPayFeeDepositInfo.depositFees = _json.data; $that.reportPayFeeDepositInfo.sumTotal = _json.sumTotal; if (_json.data.length > 0) { $that.reportPayFeeDepositInfo.feeConfigs = _json.data[0].feeConfigDtos } vc.emit('pagination', 'init', { total: $that.reportPayFeeDepositInfo.records, currentPage: _page, dataCount: $that.reportPayFeeDepositInfo.total }); }, function (errInfo, error) { console.log('请求失败处理'); } ); }, //重置 _resetMethod: function (_page, _rows) { $that.reportPayFeeDepositInfo.conditions.configId = ''; $that.reportPayFeeDepositInfo.conditions.feeId = ''; $that.reportPayFeeDepositInfo.conditions.payerObjType = ''; $that.reportPayFeeDepositInfo.conditions.state = ''; $that.reportPayFeeDepositInfo.conditions.startTime = ''; $that.reportPayFeeDepositInfo.conditions.endTime = ''; $that.reportPayFeeDepositInfo.conditions.detailState = ''; $that.reportPayFeeDepositInfo.conditions.floorId = ''; $that.reportPayFeeDepositInfo.conditions.floorName = ''; $that.reportPayFeeDepositInfo.conditions.roomNum = ''; $that.reportPayFeeDepositInfo.conditions.unitId = ''; $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, _moreCondition: function () { if ($that.reportPayFeeDepositInfo.moreCondition) { $that.reportPayFeeDepositInfo.moreCondition = false; } else { $that.reportPayFeeDepositInfo.moreCondition = true; } }, _openChooseFloorMethod: function () { vc.emit('searchFloor', 'openSearchFloorModel', {}); }, loadUnits: function (_floorId) { var param = { params: { floorId: _floorId, communityId: vc.getCurrentCommunity().communityId } } vc.http.apiGet( '/unit.queryUnits', param, function (json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); if (res.status == 200) { let tmpUnits = JSON.parse(json); $that.reportPayFeeDepositInfo.roomUnits = tmpUnits; return; } vc.toast(json); }, function (errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, _exportFee: function () { $that.reportPayFeeDepositInfo.conditions.pagePath = 'reportPayFeeDeposit'; let param = { params: $that.reportPayFeeDepositInfo.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('请求失败处理'); }); }, _openPayFeeDetail: function (_param) { vc.jumpToPage('/#/pages/property/propertyFee?feeId=' + _param.feeId); } } }); })(window.vc);