/**
|
入驻小区
|
**/
|
(function (vc) {
|
var DEFAULT_PAGE = 1;
|
var DEFAULT_ROWS = 10;
|
vc.extends({
|
data: {
|
reportOweFeeDetailInfo: {
|
fees: [],
|
floors: [],
|
total: 0,
|
records: 1,
|
moreCondition: false,
|
title: '',
|
feeTypeCds: [],
|
communitys: [],
|
totalPreferentialAmount: 0.0,
|
allOweAmount: 0.0,
|
conditions: {
|
floorId: '',
|
floorName: '',
|
roomNum: '',
|
objNameLike: '',
|
feeTypeCd: '',
|
startTime: '',
|
endTime: '',
|
communityId: '',
|
ownerNameLike: '',
|
}
|
}
|
},
|
_initMethod: function () {
|
vc.initDate('startTime', function (_value) {
|
$that.reportOweFeeDetailInfo.conditions.startTime = _value;
|
});
|
vc.initDate('endTime', function (_value) {
|
$that.reportOweFeeDetailInfo.conditions.endTime = _value;
|
});
|
vc.getDict('pay_fee_config', "fee_type_cd", function (_data) {
|
$that.reportOweFeeDetailInfo.feeTypeCds = _data
|
});
|
$that.reportOweFeeDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
$that._listFloors();
|
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
$that._loadStaffCommunitys();
|
|
$(".popover-show").mouseover(() => { $('.popover-show').popover('show'); })
|
$(".popover-show").mouseleave(() => { $('.popover-show').popover('hide'); })
|
},
|
_initEvent: function () {
|
vc.on('reportOweFeeDetail', 'chooseFloor', function (_param) {
|
$that.reportOweFeeDetailInfo.conditions.floorId = _param.floorId;
|
$that.reportOweFeeDetailInfo.conditions.floorName = _param.floorName;
|
$that.loadUnits(_param.floorId);
|
});
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
$that._listFees(_currentPage, DEFAULT_ROWS);
|
});
|
},
|
methods: {
|
//查询
|
_queryMethod: function () {
|
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
//重置
|
_resetMethod: function () {
|
$that._resetFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
//查询方法
|
_listFees: function (_page, _rows) {
|
$that.reportOweFeeDetailInfo.conditions.page = _page;
|
$that.reportOweFeeDetailInfo.conditions.row = _rows;
|
//$that.reportOweFeeDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
let param = {
|
params: $that.reportOweFeeDetailInfo.conditions
|
};
|
//发送get请求
|
vc.http.apiGet('/reportFeeMonthStatistics/queryOweFeeDetail',
|
param,
|
function (json, res) {
|
let _json = JSON.parse(json);
|
$that.reportOweFeeDetailInfo.total = _json.total;
|
$that.reportOweFeeDetailInfo.records = _json.records;
|
$that.reportOweFeeDetailInfo.fees = _json.data;
|
//计算小计
|
let _totalPreferentialAmount = 0.0;
|
_json.data.forEach(item => {
|
_totalPreferentialAmount += parseFloat(item.oweAmount);
|
});
|
$that.reportOweFeeDetailInfo.totalPreferentialAmount = _totalPreferentialAmount.toFixed(2);
|
if (_json.data.length > 0) {
|
$that.reportOweFeeDetailInfo.allOweAmount = _json.data[0].allOweAmount;
|
} else {
|
$that.reportOweFeeDetailInfo.allOweAmount = 0.0.toFixed(2);
|
}
|
vc.emit('pagination', 'init', {
|
total: $that.reportOweFeeDetailInfo.records,
|
dataCount: $that.reportOweFeeDetailInfo.total,
|
currentPage: _page
|
});
|
}, function (errInfo, error) {
|
console.log('请求失败处理');
|
}
|
);
|
},
|
//重置方法
|
_resetFees: function (_page, _rows) {
|
$that.reportOweFeeDetailInfo.conditions.floorName = "";
|
$that.reportOweFeeDetailInfo.conditions.floorId = "";
|
$that.reportOweFeeDetailInfo.conditions.objName = "";
|
$that.reportOweFeeDetailInfo.conditions.startTime = "";
|
$that.reportOweFeeDetailInfo.conditions.endTime = "";
|
$that.reportOweFeeDetailInfo.roomUnits = [];
|
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
swatchFloor: function (_floorId) {
|
$that.reportOweFeeDetailInfo.conditions.floorId = _floorId;
|
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
},
|
_listFloors: function () {
|
let param = {
|
params: {
|
page: 1,
|
row: 100,
|
communityId: $that.reportOweFeeDetailInfo.conditions.communityId
|
}
|
};
|
//发送get请求
|
vc.http.apiGet('/floor.queryFloors', param,
|
function (json, res) {
|
let _json = JSON.parse(json);
|
$that.reportOweFeeDetailInfo.floors = _json.apiFloorDataVoList;
|
},
|
function (errInfo, error) {
|
console.log('请求失败处理');
|
});
|
},
|
_openChooseFloorMethod: function () {
|
vc.emit('searchFloor', 'openSearchFloorModel', {});
|
},
|
_moreCondition: function () {
|
if ($that.reportOweFeeDetailInfo.moreCondition) {
|
$that.reportOweFeeDetailInfo.moreCondition = false;
|
} else {
|
$that.reportOweFeeDetailInfo.moreCondition = true;
|
}
|
},
|
_exportExcel: function () {
|
$that.reportOweFeeDetailInfo.conditions.pagePath = 'reportOweFeeDetail';
|
let _param = {
|
params: $that.reportOweFeeDetailInfo.conditions
|
}
|
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('请求失败处理');
|
});
|
},
|
_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.reportOweFeeDetailInfo.communitys = _data.communitys;
|
}
|
}, function () {
|
console.log('请求失败处理');
|
}
|
);
|
},
|
_changCommunity: function () {
|
$that.reportOweFeeDetailInfo.conditions.floorId = "";
|
$that._listFloors();
|
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
|
}
|
}
|
});
|
})(window.vc);
|