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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
 入驻小区
 **/
(function(vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            reportFeeSummaryPrintInfo: {
                fees: [],
                conditions: {
                    floorId: '',
                    floorName: '',
                    roomNum: '',
                    unitId: '',
                    startTime: '',
                    endTime: '',
                    communityId: vc.getCurrentCommunity().communityId
                }
            }
        },
        _initMethod: function() {
 
            $that.reportFeeSummaryPrintInfo.conditions.floorId = vc.getParam('floorId');
            $that.reportFeeSummaryPrintInfo.conditions.floorName = vc.getParam('floorName');
            $that.reportFeeSummaryPrintInfo.conditions.roomNum = vc.getParam('roomNum');
            $that.reportFeeSummaryPrintInfo.conditions.unitId = vc.getParam('unitId');
            $that.reportFeeSummaryPrintInfo.conditions.startTime = vc.getParam('startTime');
            $that.reportFeeSummaryPrintInfo.conditions.endTime = vc.getParam('endTime');
            $that.reportFeeSummaryPrintInfo.conditions.communityId = vc.getParam('communityId');
 
            vc.component._listFees(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        methods: {
            //查询方法
            _listFees: function(_page, _rows) {
                vc.component.reportFeeSummaryPrintInfo.conditions.page = _page;
                vc.component.reportFeeSummaryPrintInfo.conditions.row = _rows;
                vc.component.reportFeeSummaryPrintInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                var param = {
                    params: vc.component.reportFeeSummaryPrintInfo.conditions
                };
                //发送get请求
                vc.http.apiGet('/reportFeeMonthStatistics/queryReportFeeSummary',
                    param,
                    function(json, res) {
                        var _reportFeeSummaryInfo = JSON.parse(json);
                        vc.component.reportFeeSummaryPrintInfo.fees = _reportFeeSummaryInfo.data;
                    },
                    function(errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _getFeeReceivedAmountAmount: function(item, fee) {
                let _items = fee.feeConfigDtos;
                if (!_items) {
                    return 0;
                }
                let _value = 0;
                _items.forEach(tmp => {
                    if (tmp.configId == item.configId) {
                        _value = tmp.amount;
                        return;
                    }
                })
                return _value;
            },
            _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.reportFeeSummaryInfo) {
                    return 0;
                }
                let _amount = 0;
                $that.reportFeeSummaryInfo.fees.forEach(item => {
                    _amount += parseFloat($that._computeOweFee(item));
                })
                return _amount.toFixed(2);
            },
            _computeTotalHisOweReceivedAmount: function() {
                if (!window.$that) {
                    return 0;
                }
                if (!$that.reportFeeSummaryInfo) {
                    return 0;
                }
                let _amount = 0;
                $that.reportFeeSummaryInfo.fees.forEach(item => {
                    _amount += parseFloat(item.hisOweReceivedAmount);
                })
                return _amount.toFixed(2);
            },
            _printPurchaseApplyDiv: function() {
 
                $that.printFlag = '1';
                console.log('console.log($that.printFlag);', $that.printFlag);
                document.getElementById("print-btn").style.display = "none"; //隐藏
 
                window.print();
                //$that.printFlag = false;
                window.opener = null;
                window.close();
            },
            _closePage: function() {
                window.opener = null;
                window.close();
            },
        }
    });
})(window.vc);