优化 山东济南物业需求

This commit is contained in:
java110 2022-02-25 17:24:58 +08:00
parent 999acccf4a
commit f37d44bb9c
3 changed files with 78 additions and 76 deletions

View File

@ -1,7 +1,7 @@
/**
入驻小区
**/
(function (vc) {
(function(vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
@ -36,28 +36,28 @@
}
}
},
_initMethod: function () {
_initMethod: function() {
//vc.component._initDate();
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
$that.reportFeeBreakdownInfo.conditions.yearMonth = $that._getCurrentMonth();
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
//关联字典表费用类型
vc.getDict('pay_fee_config', "fee_type_cd", function (_data) {
vc.getDict('pay_fee_config', "fee_type_cd", function(_data) {
vc.component.reportFeeBreakdownInfo.feeTypeCds = _data;
});
},
_initEvent: function () {
vc.on('reportFeeBreakdown', 'chooseFloor', function (_param) {
_initEvent: function() {
vc.on('reportFeeBreakdown', 'chooseFloor', function(_param) {
vc.component.reportFeeBreakdownInfo.conditions.floorId = _param.floorId;
vc.component.reportFeeBreakdownInfo.conditions.floorName = _param.floorName;
vc.component.loadUnits(_param.floorId);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listFees(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_initDate: function () {
_initDate: function() {
$(".startTime").datetimepicker({
minView: "month",
language: 'zh-CN',
@ -79,12 +79,12 @@
todayBtn: true
});
$('.startTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".startTime").val();
vc.component.reportFeeBreakdownInfo.conditions.startTime = value;
});
$('.endTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".endTime").val();
vc.component.reportFeeBreakdownInfo.conditions.endTime = value;
let start = Date.parse(new Date($that.reportFeeBreakdownInfo.conditions.startTime))
@ -108,11 +108,11 @@
}
},
//查询
_queryMethod: function () {
_queryMethod: function() {
vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
},
//查询方法
_listFees: function (_page, _rows) {
_listFees: function(_page, _rows) {
vc.component.reportFeeBreakdownInfo.conditions.page = _page;
vc.component.reportFeeBreakdownInfo.conditions.row = _rows;
vc.component.reportFeeBreakdownInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
@ -122,7 +122,7 @@
//发送get请求
vc.http.apiGet('/reportFeeMonthStatistics/queryFeeBreakdown',
param,
function (json, res) {
function(json, res) {
var _reportFeeBreakdownInfo = JSON.parse(json);
vc.component.reportFeeBreakdownInfo.total = _reportFeeBreakdownInfo.total;
vc.component.reportFeeBreakdownInfo.records = _reportFeeBreakdownInfo.records;
@ -158,17 +158,18 @@
dataCount: vc.component.reportFeeBreakdownInfo.total,
currentPage: _page
});
}, function (errInfo, error) {
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
//重置
_resetMethod: function () {
_resetMethod: function() {
vc.component._resetListFee(DEFAULT_PAGE, DEFAULT_ROWS);
},
//重置方法
_resetListFee: function (_page, _rows) {
_resetListFee: function(_page, _rows) {
vc.component.reportFeeBreakdownInfo.conditions.floorId = "";
vc.component.reportFeeBreakdownInfo.conditions.floorName = "";
vc.component.reportFeeBreakdownInfo.conditions.unitId = "";
@ -179,7 +180,7 @@
vc.component.reportFeeBreakdownInfo.conditions.feeTypeCd = "";
$that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
},
loadUnits: function (_floorId) {
loadUnits: function(_floorId) {
let param = {
params: {
floorId: _floorId,
@ -190,7 +191,7 @@
'room',
'loadUnits',
param,
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
let tmpUnits = JSON.parse(json);
@ -199,35 +200,35 @@
}
vc.toast(json);
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_openChooseFloorMethod: function () {
_openChooseFloorMethod: function() {
vc.emit('searchFloor', 'openSearchFloorModel', {});
},
_moreCondition: function () {
_moreCondition: function() {
if (vc.component.reportFeeBreakdownInfo.moreCondition) {
vc.component.reportFeeBreakdownInfo.moreCondition = false;
} else {
vc.component.reportFeeBreakdownInfo.moreCondition = true;
}
},
_exportExcel: function () {
_exportExcel: function() {
vc.jumpToPage('/callComponent/exportReportFee/exportData?pagePath=reportFeeBreakdown&' + vc.objToGetParam($that.reportFeeBreakdownInfo.conditions));
},
_computeSum: function (a, b) {
_computeSum: function(a, b) {
return (parseFloat(a) + parseFloat(b)).toFixed(2)
},
_computeOweFee: function (fee) {
_computeOweFee: function(fee) {
let _oweFee = (parseFloat(fee.hisOweAmount) + parseFloat(fee.curReceivableAmount) - parseFloat(fee.curReceivedAmount) - parseFloat(fee.hisOweReceivedAmount)).toFixed(2);
if (_oweFee < 0) {
return 0;
}
return _oweFee;
},
_computeTotalOweAmount: function () {
_computeTotalOweAmount: function() {
if (!window.$that) {
return 0;
}
@ -241,7 +242,7 @@
console.log(_amount)
return _amount.toFixed(2);
},
_getCurrentMonth: function () {
_getCurrentMonth: function() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
@ -252,7 +253,7 @@
return year + '' + month;
},
_computeTotalHisOweReceivedAmount: function () {
_computeTotalHisOweReceivedAmount: function() {
if (!window.$that) {
return 0;
}
@ -267,4 +268,4 @@
}
}
});
})(window.vc);
})(window.vc);

View File

@ -31,7 +31,7 @@
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryRoomMethod()">
<i class="fa fa-search"></i> 查询
</button>
<button type="button" class="btn btn-info btn-sm" v-on:click="_resetRoomMethod()" style="margin-left: 20px;">
<button type="button" class="btn btn-white btn-sm" v-on:click="_resetRoomMethod()" style="margin-left: 20px;">
<i class="fa fa-repeat"></i> 重置
</button>
</div>

View File

@ -1,7 +1,7 @@
/**
入驻小区
**/
(function (vc) {
(function(vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROW = 10;
var TEMP_SEARCH = 'roomCreateFeeSearch';
@ -34,7 +34,7 @@
},
currentPage: 1,
},
_initMethod: function () {
_initMethod: function() {
//检查是否有缓存数据
let _tempData = vc.getData(TEMP_SEARCH);
if (_tempData == null) {
@ -48,19 +48,19 @@
vc.component.listRoom(_tempData.currentPage, DEFAULT_ROW);
}
},
_initEvent: function () {
vc.on('room', 'chooseFloor', function (_param) {
_initEvent: function() {
vc.on('room', 'chooseFloor', function(_param) {
vc.component.roomCreateFeeInfo.conditions.floorId = _param.floorId;
vc.component.roomCreateFeeInfo.conditions.floorName = _param.floorName;
vc.component.loadUnits(_param.floorId);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.on('pagination', 'page_event', function(_currentPage) {
$that.updateCurrentPage(_currentPage);
vc.component.listRoom(_currentPage, DEFAULT_ROW);
});
},
methods: {
listRoom: function (_page, _row) {
listRoom: function(_page, _row) {
if (vc.component.roomCreateFeeInfo.conditions.floorName == '' || vc.component.roomCreateFeeInfo.conditions.floorName == null) {
vc.component.roomCreateFeeInfo.conditions.floorId = ''
}
@ -94,7 +94,7 @@
vc.http.get('roomCreateFee',
'listRoom',
param,
function (json, res) {
function(json, res) {
var listRoomData = JSON.parse(json);
vc.component.roomCreateFeeInfo.total = listRoomData.total;
vc.component.roomCreateFeeInfo.records = listRoomData.records;
@ -106,25 +106,26 @@
});
// 换存搜索条件
$that.saveTempSearchData();
}, function (errInfo, error) {
},
function(errInfo, error) {
vc.toast(errInfo);
console.log('请求失败处理');
}
);
},
_openRoomCreateFeeAddModal: function (_room, _isMore) {
_openRoomCreateFeeAddModal: function(_room, _isMore) {
vc.emit('roomCreateFeeAdd', 'openRoomCreateFeeAddModal', {
isMore: _isMore,
room: _room
});
},
_openViewRoomCreateFee: function (_room) {
_openViewRoomCreateFee: function(_room) {
vc.jumpToPage("/admin.html#/pages/property/listRoomFee?roomId=" + _room.roomId + '&ownerId=' + _room.ownerId);
},
/**
根据楼ID加载房屋
**/
loadUnits: function (_floorId) {
loadUnits: function(_floorId) {
vc.component.addRoomUnits = [];
var param = {
params: {
@ -136,7 +137,7 @@
'roomCreateFee',
'loadUnits',
param,
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
var tmpUnits = JSON.parse(json);
@ -145,33 +146,34 @@
}
vc.toast(json);
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
//查询
_queryRoomMethod: function () {
_queryRoomMethod: function() {
// 搜索时重置缓存分页
$that.updateCurrentPage(DEFAULT_PAGE);
vc.component.listRoom(DEFAULT_PAGE, DEFAULT_ROW);
},
//重置
_resetRoomMethod: function () {
vc.component.roomCreateFeeInfo.conditions.floorId = '';
vc.component.roomCreateFeeInfo.conditions.ownerName = '';
vc.component.roomCreateFeeInfo.conditions.floorName = '';
vc.component.roomCreateFeeInfo.conditions.unitId = '';
vc.component.roomCreateFeeInfo.conditions.roomNum = '';
vc.component.roomCreateFeeInfo.conditions.roomId = '';
vc.component.roomCreateFeeInfo.conditions.state = '';
vc.component.roomCreateFeeInfo.conditions.section = '';
vc.component.roomCreateFeeInfo.conditions.allNum = '';
vc.component.roomCreateFeeInfo.conditions.idCard = '';
vc.component.roomCreateFeeInfo.conditions.roomType = '';
_resetRoomMethod: function() {
vc.resetObject(vc.component.roomCreateFeeInfo.conditions);
// vc.component.roomCreateFeeInfo.conditions.floorId = '';
// vc.component.roomCreateFeeInfo.conditions.ownerName = '';
// vc.component.roomCreateFeeInfo.conditions.floorName = '';
// vc.component.roomCreateFeeInfo.conditions.unitId = '';
// vc.component.roomCreateFeeInfo.conditions.roomNum = '';
// vc.component.roomCreateFeeInfo.conditions.roomId = '';
// vc.component.roomCreateFeeInfo.conditions.state = '';
// vc.component.roomCreateFeeInfo.conditions.section = '';
// vc.component.roomCreateFeeInfo.conditions.allNum = '';
// vc.component.roomCreateFeeInfo.conditions.idCard = '';
// vc.component.roomCreateFeeInfo.conditions.roomType = '';
vc.component.listRoom(DEFAULT_PAGE, DEFAULT_ROW);
},
_loadDataByParam: function () {
_loadDataByParam: function() {
vc.component.roomCreateFeeInfo.conditions.floorId = vc.getParam("floorId");
vc.component.roomCreateFeeInfo.conditions.floorId = vc.getParam("floorName");
//如果 floodId 没有传 则,直接结束
@ -188,7 +190,7 @@
'roomCreateFee',
'loadFloor',
param,
function (json, res) {
function(json, res) {
if (res.status == 200) {
var _floorInfo = JSON.parse(json);
var _tmpFloor = _floorInfo.apiFloorDataVoList[0];
@ -197,42 +199,41 @@
}
vc.toast(json);
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_moreCondition: function () {
_moreCondition: function() {
if (vc.component.roomCreateFeeInfo.moreCondition) {
vc.component.roomCreateFeeInfo.moreCondition = false;
} else {
vc.component.roomCreateFeeInfo.moreCondition = true;
}
},
_openChooseFloorMethod: function () {
_openChooseFloorMethod: function() {
vc.emit('searchFloor', 'openSearchFloorModel', {});
},
_toOwnerPayFee: function (_room) {
_toOwnerPayFee: function(_room) {
let roomName = _room.floorNum + "栋" + _room.unitNum + "单元" + _room.roomNum + "室"
vc.jumpToPage('/admin.html#/pages/property/owePayFeeOrder?payObjId=' + _room.roomId + "&payObjType=3333&roomName=" + roomName);
},
_printOwnOrder: function (_room) {
_printOwnOrder: function(_room) {
//打印催交单
vc.jumpToPage('print.html#/pages/property/printOweFee?roomId=' + _room.roomId)
},
_openTranslateFeeManualCollectionDetailModel: function (_room) {
_openTranslateFeeManualCollectionDetailModel: function(_room) {
let _data = {
roomId: _room.roomId,
communityId: vc.getCurrentCommunity().communityId
}
//重新同步房屋欠费
roomId: _room.roomId,
communityId: vc.getCurrentCommunity().communityId
}
//重新同步房屋欠费
vc.http.apiPost(
'/feeManualCollection/saveFeeManualCollection',
JSON.stringify(_data),
{
JSON.stringify(_data), {
emulateJSON: true
},
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
@ -243,7 +244,7 @@
}
vc.toast(_json.msg);
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
@ -252,14 +253,14 @@
/**
* 更新当前页码
*/
updateCurrentPage: function (page) {
updateCurrentPage: function(page) {
$that.currentPage = page;
},
/**
* 保存搜索条件页码
*/
saveTempSearchData: function () {
saveTempSearchData: function() {
let conditions = $that.roomCreateFeeInfo.conditions;
//缓存起来=
vc.saveData(TEMP_SEARCH, {
@ -267,12 +268,12 @@
currentPage: $that.currentPage
});
},
_downloadCollectionLetterOrder: function () {
_downloadCollectionLetterOrder: function() {
vc.jumpToPage('/callComponent/feeManualCollection/downloadCollectionLetterOrder?communityId=' + vc.getCurrentCommunity().communityId);
},
_downloadRoomCollectionLetterOrder: function (_room) {
_downloadRoomCollectionLetterOrder: function(_room) {
vc.jumpToPage('/callComponent/feeManualCollection/downloadCollectionLetterOrder?communityId=' + vc.getCurrentCommunity().communityId + "&roomId=" + _room.roomId);
}
}
});
})(window.vc);
})(window.vc);