优化代码

This commit is contained in:
java110 2020-10-19 18:39:57 +08:00
parent 110c17c017
commit 8398aa3d1e
2 changed files with 61 additions and 8 deletions

View File

@ -24,7 +24,7 @@
top: 35px;
color: #487bff;
font-size: 22px;">
<a href="/">控制台</span>
<a href="/">控制台</a>
</div>
<div class="container m-20">
<div class="row">

View File

@ -33,7 +33,7 @@
for (let _inIndex = 0; _inIndex < _dataArr.length; _inIndex++) {
_li += "<li>" + (_inIndex + 1) + ".0、" + _dataArr[_inIndex].msg + "</li>";
if(_inIndex >=5){
if (_inIndex >= 5) {
break;
}
}
@ -41,18 +41,20 @@
}
function initPrePayment(_dataArr) {
let _todayInpection = document.getElementById("todayPreFee");
let _li = "<li>预交费提醒:</li>";
let _li = "<li onclick='_toPrePayment()'>预交费提醒:</li>";
for (let _inIndex = 0; _inIndex < _dataArr.length; _inIndex++) {
_li += "<li>" + (_inIndex + 1) + ".0、" + _dataArr[_inIndex].feeName + _dataArr[_inIndex].objCount +"户</li>";
_li += "<li>" + (_inIndex + 1) + "、" + _dataArr[_inIndex].feeName + " " + _dataArr[_inIndex].objCount + "户</li>";
if(_inIndex >=5){
if (_inIndex >= 1) {
break;
}
}
_todayInpection.innerHTML = _li;
_loadOwePaymentCount( _li);
}
function _loadPrePaymentCount(params) {
let param = {
params: {
@ -79,8 +81,59 @@
});
}
function initOwePayment(_dataArr, _li) {
let _todayInpection = document.getElementById("todayPreFee");
_li += "<li onclick='_toOwePayment()'>欠费提醒:</li>";
for (let _inIndex = 0; _inIndex < _dataArr.length; _inIndex++) {
_li += "<li>" + (_inIndex + 1) + "、" + _dataArr[_inIndex].feeName + " " + _dataArr[_inIndex].objCount + "户</li>";
if (_inIndex >= 1) {
break;
}
}
_todayInpection.innerHTML = _li;
}
function _loadOwePaymentCount(_li) {
let param = {
params: {
communityId: vc.getCurrentCommunity().communityId
}
}
vc.http.apiGet(
'/reportFeeMonthStatistics/queryOwePaymentCount',
param,
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
let _data = _json.data;
initOwePayment(_data, _li);
return;
}
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
}
window._toPrePayment = function () {
vc.jumpToPage('/admin.html#/pages/property/reportPrePaymentFee');
}
window._toOwePayment = function () {
vc.jumpToPage('/admin.html#/pages/property/reportOweFeeDetail');
}
_loadAssetInspection();
_loadPrePaymentCount();
})()
})()