From a7601efa3daf8e7a199833738b377c5cf4b0b24c Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Fri, 25 Mar 2022 16:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=B4=E8=B4=B9=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/addRoomView/addRoomView.js | 103 ++++++------ .../property/deleteRoom/deleteRoom.js | 58 ++++--- .../components/property/editRoom/editRoom.js | 123 +++++++------- .../property/addRoomBinding/addRoomBinding.js | 15 +- .../reportFeeDetail/reportFeeDetail.html | 150 ++++++++++-------- .../reportFeeDetail/reportFeeDetail.js | 114 +++++++++---- public/pages/property/room/room.js | 5 +- 7 files changed, 306 insertions(+), 262 deletions(-) diff --git a/public/components/property/addRoomView/addRoomView.js b/public/components/property/addRoomView/addRoomView.js index ef6f0b088..9693cf9f9 100755 --- a/public/components/property/addRoomView/addRoomView.js +++ b/public/components/property/addRoomView/addRoomView.js @@ -1,4 +1,4 @@ -(function (vc) { +(function(vc) { vc.extends({ propTypes: { callBackListener: vc.propTypes.string, @@ -29,44 +29,43 @@ watch: { addRoomViewInfo: { deep: true, - handler: function () { + handler: function() { vc.component.saveAddRoomInfo(); } } }, - _initMethod: function () { + _initMethod: function() { $that._loadRoomAttrSpec(); - //与字典表关联 - vc.getDict('building_room', "room_sub_type", function (_data) { + //与字典表关联 + vc.getDict('building_room', "room_sub_type", function(_data) { vc.component.addRoomViewInfo.roomSubTypes = _data; }); }, - _initEvent: function () { + _initEvent: function() { vc.on('addRoomViewInfo', 'onIndex', - function (_index) { + function(_index) { vc.component.addRoomViewInfo.index = _index; }); - + }, methods: { addRoomValidate() { vc.component.addRoomViewInfo.apartment = vc.component.addRoomViewInfo.apartment1 + vc.component.addRoomViewInfo.apartment2; return vc.validate.validate({ addRoomViewInfo: vc.component.addRoomViewInfo - }, - { - 'addRoomViewInfo.roomNum': [{ + }, { + 'addRoomViewInfo.roomNum': [{ limit: "required", param: "", errInfo: "房屋编号不能为空" }, { limit: "maxLength", - param: "12", - errInfo: "房屋编号长度不能超过12位" + param: "64", + errInfo: "房屋编号长度不能超过64位" }, - ], - 'addRoomViewInfo.layer': [{ + ], + 'addRoomViewInfo.layer': [{ limit: "required", param: "", errInfo: "房屋楼层不能为空" @@ -76,8 +75,8 @@ param: "", errInfo: "房屋楼层高度必须为数字" }, - ], - 'addRoomViewInfo.apartment': [{ + ], + 'addRoomViewInfo.apartment': [{ limit: "required", param: "", errInfo: "房屋户型不能为空" @@ -87,8 +86,8 @@ param: "50", errInfo: "房屋户型不能大于50" }, - ], - 'addRoomViewInfo.builtUpArea': [{ + ], + 'addRoomViewInfo.builtUpArea': [{ limit: "required", param: "", errInfo: "建筑面积不能为空" @@ -98,8 +97,8 @@ param: "", errInfo: "建筑面积错误,如 300.00" }, - ], - 'addRoomViewInfo.roomArea': [{ + ], + 'addRoomViewInfo.roomArea': [{ limit: "required", param: "", errInfo: "室内面积不能为空" @@ -109,20 +108,19 @@ param: "", errInfo: "室内面积错误,如 300.00" }, - ], - 'addRoomViewInfo.feeCoefficient': [ - { - limit: "required", - param: "", - errInfo: "算费系数不能为空" - }, - { - limit: "money", - param: "", - errInfo: "算费系数错误,如 300.00" - } - ], - 'addRoomViewInfo.state': [{ + ], + 'addRoomViewInfo.feeCoefficient': [{ + limit: "required", + param: "", + errInfo: "算费系数不能为空" + }, + { + limit: "money", + param: "", + errInfo: "算费系数错误,如 300.00" + } + ], + 'addRoomViewInfo.state': [{ limit: "required", param: "", errInfo: "房屋状态不能为空" @@ -132,23 +130,22 @@ param: "12", errInfo: "房屋状态 不能超过12位" }, - ], - 'addRoomViewInfo.roomSubType': [{ - limit: "required", - param: "", - errInfo: "房屋类型不能为空" - } - ], - 'addRoomViewInfo.remark': [{ - limit: "maxLength", - param: "200", - errInfo: "备注内容不能超过200" - }], - }); + ], + 'addRoomViewInfo.roomSubType': [{ + limit: "required", + param: "", + errInfo: "房屋类型不能为空" + }], + 'addRoomViewInfo.remark': [{ + limit: "maxLength", + param: "200", + errInfo: "备注内容不能超过200" + }], + }); }, - _loadRoomAttrSpec: function () { + _loadRoomAttrSpec: function() { $that.addRoomViewInfo.attrs = []; - vc.getAttrSpec('building_room_attr', function (data) { + vc.getAttrSpec('building_room_attr', function(data) { data.forEach(item => { item.value = ''; if (item.specShow == 'Y') { @@ -160,8 +157,8 @@ }); }); }, - _loadAttrValue: function (_specCd, _values) { - vc.getAttrValue(_specCd, function (data) { + _loadAttrValue: function(_specCd, _values) { + vc.getAttrValue(_specCd, function(data) { data.forEach(item => { if (item.valueShow == 'Y') { _values.push(item); @@ -169,7 +166,7 @@ }); }); }, - saveAddRoomInfo: function () { + saveAddRoomInfo: function() { if (vc.component.addRoomValidate()) { // 验证attr必填项 let msg = ''; diff --git a/public/components/property/deleteRoom/deleteRoom.js b/public/components/property/deleteRoom/deleteRoom.js index ea5725301..35451ced8 100755 --- a/public/components/property/deleteRoom/deleteRoom.js +++ b/public/components/property/deleteRoom/deleteRoom.js @@ -1,48 +1,46 @@ -(function(vc){ +(function(vc) { vc.extends({ - data:{ - deleteRoomInfo:{} + data: { + deleteRoomInfo: {} }, - _initEvent:function(){ - vc.on('deleteRoom','openRoomModel',function(_roomInfo){ - vc.component.deleteRoomInfo = _roomInfo; - $('#deleteRoomModel').modal('show'); - }); + _initEvent: function() { + vc.on('deleteRoom', 'openRoomModel', function(_roomInfo) { + vc.component.deleteRoomInfo = _roomInfo; + $('#deleteRoomModel').modal('show'); + }); }, - methods:{ - closeDeleteRoomModel:function(){ + methods: { + closeDeleteRoomModel: function() { $('#deleteRoomModel').modal('hide'); }, - deleteRoom:function(){ + deleteRoom: function() { vc.component.deleteRoomInfo.communityId = vc.getCurrentCommunity().communityId; - vc.http.post( - 'deleteRoom', - 'delete', - JSON.stringify(vc.component.deleteRoomInfo), - { - emulateJSON:true - }, - function(json,res){ - //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); - if(res.status == 200){ + vc.http.apiPost( + '/room.deleteRoom', + JSON.stringify(vc.component.deleteRoomInfo), { + emulateJSON: true + }, + function(json, res) { + let _tmpResJson = JSON.parse(json); + if (_tmpResJson.code == 0) { //关闭model $('#deleteRoomModel').modal('hide'); - vc.emit('room','loadData',{ - floorId:vc.component.deleteRoomInfo.floorId + vc.emit('room', 'loadData', { + floorId: vc.component.deleteRoomInfo.floorId }); - vc.emit('shops','loadData',{ - floorId:vc.component.deleteRoomInfo.floorId + vc.emit('shops', 'loadData', { + floorId: vc.component.deleteRoomInfo.floorId }); - return ; + return; } - vc.toast(json); - }, - function(errInfo,error){ + vc.toast(_tmpResJson.msg); + }, + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); - }); + }); } } }); diff --git a/public/components/property/editRoom/editRoom.js b/public/components/property/editRoom/editRoom.js index f22562ba8..bd541e84c 100755 --- a/public/components/property/editRoom/editRoom.js +++ b/public/components/property/editRoom/editRoom.js @@ -1,4 +1,4 @@ -(function (vc, vm) { +(function(vc, vm) { vc.extends({ data: { @@ -24,15 +24,15 @@ roomSubTypes: [] } }, - _initMethod: function () { + _initMethod: function() { $that._loadRoomAttrSpec(); }, - _initEvent: function () { - vc.on('editRoom', 'openEditRoomModal', function (_room) { + _initEvent: function() { + vc.on('editRoom', 'openEditRoomModal', function(_room) { $that.refreshEditRoomInfo(); //与字典表关联 - vc.getDict('building_room', "room_sub_type", function (_data) { + vc.getDict('building_room', "room_sub_type", function(_data) { vc.component.editRoomInfo.roomSubTypes = _data; }); vc.copyObject(_room, vc.component.editRoomInfo); @@ -60,7 +60,7 @@ /** 根据楼ID加载房屋 **/ - loadUnitsFromEditRoom: function (_floorId) { + loadUnitsFromEditRoom: function(_floorId) { vc.component.editRoomUnits = []; var param = { params: { @@ -72,7 +72,7 @@ 'editRoom', '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); @@ -93,16 +93,16 @@ } vc.toast(json); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - _loadRoomAttrSpec: function () { + _loadRoomAttrSpec: function() { $that.editRoomInfo.attrs = []; - vc.getAttrSpec('building_room_attr', function (data) { + vc.getAttrSpec('building_room_attr', function(data) { data.forEach(item => { item.value = ''; item.values = []; @@ -114,8 +114,8 @@ }); }, - _loadAttrValue: function (_specCd, _values) { - vc.getAttrValue(_specCd, function (data) { + _loadAttrValue: function(_specCd, _values) { + vc.getAttrValue(_specCd, function(data) { data.forEach(item => { if (item.valueShow == 'Y') { _values.push(item); @@ -124,19 +124,16 @@ }); }, - editRoomValidate: function () { + editRoomValidate: function() { return vc.validate.validate({ editRoomInfo: vc.component.editRoomInfo }, { - 'editRoomInfo.unitId': [ - { - limit: "required", - param: "", - errInfo: "小区楼房屋不能为空" - } - ], - 'editRoomInfo.roomNum': [ - { + 'editRoomInfo.unitId': [{ + limit: "required", + param: "", + errInfo: "小区楼房屋不能为空" + }], + 'editRoomInfo.roomNum': [{ limit: "required", param: "", errInfo: "房屋编号不能为空" @@ -147,8 +144,7 @@ errInfo: "房屋编号长度不能超过12位" }, ], - 'editRoomInfo.layer': [ - { + 'editRoomInfo.layer': [{ limit: "required", param: "", errInfo: "房屋楼层高度不能为空" @@ -159,22 +155,17 @@ errInfo: "房屋楼层高度必须为数字" } ], - 'editRoomInfo.state': [ - { - limit: "required", - param: "", - errInfo: "房间状态不能为空" - } - ], - 'editRoomInfo.apartment': [ - { - limit: "required", - param: "", - errInfo: "户型不能为空" - } - ], - 'editRoomInfo.builtUpArea': [ - { + 'editRoomInfo.state': [{ + limit: "required", + param: "", + errInfo: "房间状态不能为空" + }], + 'editRoomInfo.apartment': [{ + limit: "required", + param: "", + errInfo: "户型不能为空" + }], + 'editRoomInfo.builtUpArea': [{ limit: "required", param: "", errInfo: "建筑面积不能为空" @@ -191,18 +182,17 @@ } ], 'editRoomInfo.roomArea': [{ - limit: "required", - param: "", - errInfo: "室内面积不能为空" - }, - { - limit: "money", - param: "", - errInfo: "室内面积错误,如 300.00" - }, - ], - 'editRoomInfo.feeCoefficient': [ + limit: "required", + param: "", + errInfo: "室内面积不能为空" + }, { + limit: "money", + param: "", + errInfo: "室内面积错误,如 300.00" + }, + ], + 'editRoomInfo.feeCoefficient': [{ limit: "required", param: "", errInfo: "算费系数不能为空" @@ -217,19 +207,16 @@ limit: "required", param: "", errInfo: "房屋类型不能为空" - } - ], - 'editRoomInfo.remark': [ - { - limit: "maxLength", - param: "200", - errInfo: "备注长度不能超过200位" - }, - ] + }], + 'editRoomInfo.remark': [{ + limit: "maxLength", + param: "200", + errInfo: "备注长度不能超过200位" + }, ] }); }, - editRoom: function () { + editRoom: function() { if (!vc.component.editRoomValidate()) { vc.toast(vc.validate.errInfo); return; @@ -238,14 +225,12 @@ if ('' == vc.component.editRoomInfo.unitPrice || null == vc.component.editRoomInfo.unitPrice) { vc.component.editRoomInfo.unitPrice = '0'; } - vc.http.post( - 'editRoom', - 'update', - JSON.stringify(vc.component.editRoomInfo), - { + vc.http.apiPost( + '/room.updateRoom', + JSON.stringify(vc.component.editRoomInfo), { 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) { @@ -258,13 +243,13 @@ } vc.toast(_json.msg); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - refreshEditRoomInfo: function () { + refreshEditRoomInfo: function() { let _attrs = $that.editRoomInfo.attrs; _attrs.forEach(_item => { _item.attrId = ''; diff --git a/public/pages/property/addRoomBinding/addRoomBinding.js b/public/pages/property/addRoomBinding/addRoomBinding.js index 94a64b374..2fddbac94 100755 --- a/public/pages/property/addRoomBinding/addRoomBinding.js +++ b/public/pages/property/addRoomBinding/addRoomBinding.js @@ -71,24 +71,21 @@ data: vc.component.addRoomBindingInfo.infos } - vc.http.post( - 'addRoomBindingBinding', - 'binding', + vc.http.apiPost( + '/room.addRoomBinding', JSON.stringify(param), { emulateJSON: true }, function(json, res) { - if (res.status == 200) { - + let _tmpResJson = JSON.parse(json); + if (_tmpResJson.code == 0) { vc.toast('处理成功'); //关闭model - var _tmpResJson = JSON.parse(json); - /* _tmpResJson[floorName] = vc.component._getFloorName();*/ - // vc.jumpToPage("/#/pages/property/room"); + console.log(_tmpResJson); vc.goBack(); return; } - vc.toast(json); + vc.toast(_tmpResJson.msg); }, function(errInfo, error) { console.log('请求失败处理'); diff --git a/public/pages/property/reportFeeDetail/reportFeeDetail.html b/public/pages/property/reportFeeDetail/reportFeeDetail.html index c82779329..c6c396004 100755 --- a/public/pages/property/reportFeeDetail/reportFeeDetail.html +++ b/public/pages/property/reportFeeDetail/reportFeeDetail.html @@ -5,8 +5,7 @@
查询条件
-
@@ -14,11 +13,9 @@
- +
-
@@ -26,8 +23,7 @@
-
- +
-
@@ -55,8 +49,7 @@
-
- +
- +
@@ -98,61 +87,90 @@
- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + +
费用编号房号业主面积费用项费用开始时间费用结束时间应收金额实收金额更新时间
费用编号房号业主面积费用项费用开始时间费用结束时间历史欠费(单位:元)当月应收(单位:元)应收合计(单位:元)当月实收(单位:元)欠费追回(单位:元)预交费用(单位:元)实收合计(单位:元)欠费金额(单位:元)更新时间
{{index+1}}{{fee.objName}}{{fee.ownerName}}{{fee.builtUpArea}}{{fee.feeName}}{{vc.dateFormat(fee.feeCreateTime)}} - {{vc.dateFormat(fee.deadlineTime)}} - - {{vc.dateSubOneDay(vc.dateFormat(fee.feeCreateTime),vc.dateFormat(fee.deadlineTime),fee.feeFlag)}} - {{fee.receivableAmount}}{{fee.receivedAmount}}{{fee.updateTime}}
{{index+1}}{{fee.objName}}{{fee.ownerName}}{{fee.builtUpArea}}{{fee.feeName}}{{vc.dateFormat(fee.feeCreateTime)}} + {{vc.dateFormat(fee.deadlineTime)}} + + {{vc.dateSubOneDay(vc.dateFormat(fee.feeCreateTime),vc.dateFormat(fee.deadlineTime),fee.feeFlag)}} + {{fee.hisOweAmount}}{{fee.curReceivableAmount}}{{_computeSum(fee.hisOweAmount,fee.curReceivableAmount)}}{{fee.curReceivedAmount}}{{fee.hisOweReceivedAmount}}{{fee.preReceivedAmount}}{{_computeSum(_computeSum(fee.hisOweReceivedAmount,fee.preReceivedAmount),fee.curReceivedAmount)}}{{_computeOweFee(fee)}}{{fee.updateTime}}
-
    -
    +
      +
      -
      - 小计应收: {{reportFeeDetailInfo.totalReceivableAmount}}元 - 小计实收: {{reportFeeDetailInfo.totalReceivedAmount}}元 -
      -
      - -
      + +
      小计
      +
      大计
      +
      + +
      应收: {{reportFeeDetailInfo.totalReceivableAmount}}元
      +
      应收: {{reportFeeDetailInfo.allReceivableAmount}}元
      +
      + +
      实收: {{reportFeeDetailInfo.totalReceivedAmount}}元
      +
      实收: {{reportFeeDetailInfo.allReceivedAmount}}元
      +
      + +
      欠费: {{_computeTotalOweAmount()}}元
      +
      欠费: {{reportFeeDetailInfo.allOweAmount}}元
      +
      + +
      欠费追回: {{_computeTotalHisOweReceivedAmount()}}元
      +
      欠费追回: {{reportFeeDetailInfo.allHisOweReceivedAmount}}元
      +
      -
      -
      - 大计应收: {{reportFeeDetailInfo.allReceivableAmount}}元 - 大计实收: {{reportFeeDetailInfo.allReceivedAmount}}元 +
      +
      +
      欠费金额 = 历史欠费 + 当月应收 - 当月实收 - 欠费追回
      +
      历史欠费:当月之前欠费;当月应收:当前月收费;当月实收:当月收到中属于当前月应收费用部分;
      +
      欠费追回:当月收到中属于历史欠费部分;预交费用:当月收到中属于预交费用部分
      +
      +
      +
      diff --git a/public/pages/property/reportFeeDetail/reportFeeDetail.js b/public/pages/property/reportFeeDetail/reportFeeDetail.js index 2304bf2ee..bf0079258 100755 --- a/public/pages/property/reportFeeDetail/reportFeeDetail.js +++ b/public/pages/property/reportFeeDetail/reportFeeDetail.js @@ -1,7 +1,7 @@ /** 入驻小区 **/ -(function (vc) { +(function(vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ @@ -13,12 +13,15 @@ moreCondition: false, title: '', totalReceivableAmount: 0.0, - totalReceivedAmount: 0.0, allReceivableAmount: 0.0, + totalReceivedAmount: 0.0, allReceivedAmount: 0.0, + totalPreferentialAmount: 0.0, + allHisOweReceivedAmount: 0.0, primeRates: [], roomUnits: [], feeConfigDtos: [], + conditions: { floorId: '', floorName: '', @@ -32,7 +35,7 @@ } } }, - _initMethod: function () { + _initMethod: function() { vc.component._initDate(); vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS); // vc.initDateMonth('startTime', function (_startTime) { @@ -48,18 +51,18 @@ // } // }); }, - _initEvent: function () { - vc.on('reportFeeDetail', 'chooseFloor', function (_param) { + _initEvent: function() { + vc.on('reportFeeDetail', 'chooseFloor', function(_param) { vc.component.reportFeeDetailInfo.conditions.floorId = _param.floorId; vc.component.reportFeeDetailInfo.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', @@ -81,12 +84,12 @@ todayBtn: true }); $('.startTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".startTime").val(); vc.component.reportFeeDetailInfo.conditions.startTime = value; }); $('.endTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".endTime").val(); vc.component.reportFeeDetailInfo.conditions.endTime = value; let start = Date.parse(new Date($that.reportFeeDetailInfo.conditions.startTime)) @@ -97,11 +100,11 @@ } }); }, - _queryMethod: function () { + _queryMethod: function() { vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, //查询方法 - _listFees: function (_page, _rows) { + _listFees: function(_page, _rows) { vc.component.reportFeeDetailInfo.conditions.page = _page; vc.component.reportFeeDetailInfo.conditions.row = _rows; vc.component.reportFeeDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId; @@ -111,39 +114,49 @@ //发送get请求 vc.http.apiGet('/reportFeeMonthStatistics/queryFeeDetail', param, - function (json, res) { + function(json, res) { var _reportFeeDetailInfo = JSON.parse(json); vc.component.reportFeeDetailInfo.total = _reportFeeDetailInfo.total; vc.component.reportFeeDetailInfo.records = _reportFeeDetailInfo.records; vc.component.reportFeeDetailInfo.fees = _reportFeeDetailInfo.data; + //计算小计 + let _totalReceivableAmount = 0.0; + let _totalReceivedAmount = 0.0; + let _totalPreferentialAmount = 0.0; + + _reportFeeDetailInfo.data.forEach(item => { + _totalReceivableAmount += parseFloat(item.receivableAmount); + _totalReceivedAmount += parseFloat(item.receivedAmount); + _totalPreferentialAmount += parseFloat(item.oweAmount); + }); + + $that.reportFeeDetailInfo.totalReceivableAmount = _totalReceivableAmount.toFixed(2); + $that.reportFeeDetailInfo.totalReceivedAmount = _totalReceivedAmount.toFixed(2); + $that.reportFeeDetailInfo.totalPreferentialAmount = _totalPreferentialAmount.toFixed(2); + if (_reportFeeDetailInfo.data.length > 0) { - vc.component.reportFeeDetailInfo.totalReceivableAmount = _reportFeeDetailInfo.data[0].totalReceivableAmount; - vc.component.reportFeeDetailInfo.allReceivableAmount = _reportFeeDetailInfo.data[0].allReceivableAmount; - vc.component.reportFeeDetailInfo.totalReceivedAmount = _reportFeeDetailInfo.data[0].totalReceivedAmount; - vc.component.reportFeeDetailInfo.allReceivedAmount = _reportFeeDetailInfo.data[0].allReceivedAmount; - vc.component.reportFeeDetailInfo.feeConfigDtos = _reportFeeDetailInfo.data[0].feeConfigDtos; - } else { - vc.component.reportFeeDetailInfo.totalReceivableAmount = 0.0; - vc.component.reportFeeDetailInfo.totalReceivedAmount = 0.0; - vc.component.reportFeeDetailInfo.allReceivableAmount = 0.0; - vc.component.reportFeeDetailInfo.allReceivedAmount = 0.0; + $that.reportFeeDetailInfo.allReceivableAmount = _reportFeeDetailInfo.data[0].allReceivableAmount; + $that.reportFeeDetailInfo.allReceivedAmount = _reportFeeDetailInfo.data[0].allReceivedAmount; + $that.reportFeeDetailInfo.allOweAmount = _reportFeeDetailInfo.data[0].allOweAmount; + $that.reportFeeDetailInfo.allHisOweReceivedAmount = _reportFeeDetailInfo.data[0].allHisOweReceivedAmount; } vc.emit('pagination', 'init', { total: vc.component.reportFeeDetailInfo.records, dataCount: vc.component.reportFeeDetailInfo.total, currentPage: _page }); - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, //重置 - _resetMethod: function () { + _resetMethod: function() { vc.component._resetListFees(DEFAULT_PAGE, DEFAULT_ROWS); }, //重置方法 - _resetListFees: function (_page, _rows) { + _resetListFees: function(_page, _rows) { vc.component.reportFeeDetailInfo.conditions.floorName = ''; vc.component.reportFeeDetailInfo.conditions.floorId = ''; vc.component.reportFeeDetailInfo.conditions.unitId = ''; @@ -153,7 +166,7 @@ vc.component.reportFeeDetailInfo.conditions.configId = ''; $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS); }, - loadUnits: function (_floorId) { + loadUnits: function(_floorId) { var param = { params: { floorId: _floorId, @@ -164,7 +177,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); @@ -173,24 +186,61 @@ } 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.reportFeeDetailInfo.moreCondition) { vc.component.reportFeeDetailInfo.moreCondition = false; } else { vc.component.reportFeeDetailInfo.moreCondition = true; } }, - _exportFee: function () { + _exportFee: function() { vc.jumpToPage('/callComponent/exportReportFee/exportData?pagePath=reportFeeDetail&' + vc.objToGetParam($that.reportFeeDetailInfo.conditions)); + }, + _computeSum: function(a, b) { + return (parseFloat(a) + parseFloat(b)).toFixed(2) + }, + _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() { + if (!window.$that) { + return 0; + } + if (!$that.reportFeeDetailInfo) { + return 0; + } + let _amount = 0; + $that.reportFeeDetailInfo.fees.forEach(item => { + _amount += parseFloat($that._computeOweFee(item)); + }) + console.log(_amount) + return _amount.toFixed(2); + }, + _computeTotalHisOweReceivedAmount: function() { + if (!window.$that) { + return 0; + } + if (!$that.reportFeeDetailInfo) { + return 0; + } + let _amount = 0; + $that.reportFeeDetailInfo.fees.forEach(item => { + _amount += parseFloat(item.hisOweReceivedAmount); + }) + return _amount.toFixed(2); } } }); -})(window.vc); +})(window.vc); \ No newline at end of file diff --git a/public/pages/property/room/room.js b/public/pages/property/room/room.js index 23c9b0804..1f062e8a0 100755 --- a/public/pages/property/room/room.js +++ b/public/pages/property/room/room.js @@ -82,8 +82,7 @@ param.params.roomId = ''; } //发送get请求 - vc.http.get('room', - 'listRoom', + vc.http.apiGet('/room.queryRooms', param, function(json, res) { var listRoomData = JSON.parse(json); @@ -160,7 +159,7 @@ }, _loadDataByParam: function() { vc.component.roomInfo.conditions.floorId = vc.getParam("floorId"); - vc.component.roomInfo.conditions.floorId = vc.getParam("floorName"); + vc.component.roomInfo.conditions.floorName = vc.getParam("floorName"); let param = { params: {