zhangjiaqing
8 天以前 1cef3adee31c6934c0da4b4f0b8a6f5ac03b364f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
 入驻小区
 **/
(function(vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 20;
    vc.extends({
        data: {
            reportFeeSummaryDetailInfo: {
                fees: [],
                conditions: {
                    floorId: '',
                    floorName: '',
                    roomNum: '',
                    unitId: '',
                    startTime: '',
                    endTime: '',
                    feeYear: '',
                    feeMonth: '',
                    communityId: vc.getCurrentCommunity().communityId,
                    configIds: ''
                }
            }
        },
        _initMethod: function() {
            $that.reportFeeSummaryDetailInfo.conditions.floorId = vc.getParam('floorId');
            $that.reportFeeSummaryDetailInfo.conditions.floorName = vc.getParam('floorName');
            $that.reportFeeSummaryDetailInfo.conditions.roomNum = vc.getParam('roomNum');
            $that.reportFeeSummaryDetailInfo.conditions.unitId = vc.getParam('unitId');
            $that.reportFeeSummaryDetailInfo.conditions.startTime = vc.getParam('startTime');
            $that.reportFeeSummaryDetailInfo.conditions.endTime = vc.getParam('endTime');
            $that.reportFeeSummaryDetailInfo.conditions.feeYear = vc.getParam('feeYear');
            $that.reportFeeSummaryDetailInfo.conditions.feeMonth = vc.getParam('feeMonth');
            $that.reportFeeSummaryDetailInfo.conditions.configIds = vc.getParam('configIds');
            $that._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent: function() {
            vc.on('pagination', 'page_event', function(_currentPage) {
                $that._listFees(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            //查询方法
            _listFees: function(_page, _rows) {
                $that.reportFeeSummaryDetailInfo.conditions.page = _page;
                $that.reportFeeSummaryDetailInfo.conditions.row = _rows;
                $that.reportFeeSummaryDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                var param = {
                    params: $that.reportFeeSummaryDetailInfo.conditions
                };
                //发送get请求
                vc.http.apiGet('/reportFeeMonthStatistics/queryReportFeeSummaryDetail',
                    param,
                    function(json, res) {
                        var _reportFeeSummaryDetailInfo = JSON.parse(json);
                        $that.reportFeeSummaryDetailInfo.total = _reportFeeSummaryDetailInfo.total;
                        $that.reportFeeSummaryDetailInfo.records = _reportFeeSummaryDetailInfo.records;
                        $that.reportFeeSummaryDetailInfo.fees = _reportFeeSummaryDetailInfo.data;
                        vc.emit('pagination', 'init', {
                            total: $that.reportFeeSummaryDetailInfo.records,
                            dataCount: $that.reportFeeSummaryDetailInfo.total,
                            currentPage: _page
                        });
                    },
                    function(errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _exportExcel: function() {
                vc.jumpToPage('/callComponent/exportReportFee/exportData?pagePath=reportFeeSummaryDetail&' + vc.objToGetParam($that.reportFeeSummaryDetailInfo.conditions));
            },
            _goBack: function() {
                vc.goBack();
            },
            _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;
            },
        }
    });
})(window.vc);