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
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            transactionReport: {
                _currentTab: 'reportFeeDetailRoom',
                fees: [],
                feeTypeCds: [],
                total: 0,
                records: 0,
                conditions: {
                    importFee: '',
                    feeTypeCd: '',
                    feeYear: '',
                    communityId: vc.getCurrentCommunity().communityId,
                },
            },
        },
        _initMethod: function () {
            $that.transactionReport.conditions.communityId = vc.getCurrentCommunity().communityId;
            vc.getDict('pay_fee_config', "fee_type_cd_show", function (_data) {
                $that.transactionReport.feeTypeCds = _data
            });
            $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent: function () {
            vc.on('reportFeeDetailOwner', 'switch', function (_data) {
                $that.transactionReport.conditions = _data;
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('reportFeeDetailOwner', 'paginationPlus', 'page_event', function (_currentPage) {
                $that._listReportFeeDetailOwners(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _queryMethod: function () {
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS, true);
            },
            _resetMethod: function () {
                $that.transactionReport.conditions.importFee = "";
                $that.transactionReport.conditions.feeTypeCd = "";
                $that.transactionReport.conditions.feeYear = "";
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _computeTableDivWidth: function () {
                let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
                mainWidth = mainWidth - 20 - 15 - 20;
                return mainWidth + 'px';
            },
            _listReportFeeDetailOwners: function (_page, _rows, _reload) {
                let param = {
                    params: {
                        communityId: vc.getCurrentCommunity().communityId,
                        page: _page,
                        row: _rows,
                        importFee: $that.transactionReport.conditions.importFee,
                        feeTypeCd: $that.transactionReport.conditions.feeTypeCd,
                        feeYear: $that.transactionReport.conditions.feeYear,
                    }
                };
                if (_reload) {
                    param.params.reload = true;
                }
                vc.http.apiGet('/fee.whiteOrderReportFeeCmd', param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        $that.transactionReport.total = _json.total;
                        $that.transactionReport.records = _json.records;
                        $that.transactionReport.fees = _json.data;
                        vc.emit('reportFeeDetailOwner', 'paginationPlus', 'init', {
                            total: $that.transactionReport.records,
                            dataCount: $that.transactionReport.total,
                            currentPage: _page,
                        });
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _exportReportFeeDetailOwnerExcel: function () {
                $that.transactionReport.conditions.communityId = vc.getCurrentCommunity().communityId;
                $that.transactionReport.conditions.pagePath = 'whiteOrderReport';
                let param = {
                    params: $that.transactionReport.conditions
                };
                vc.http.apiGet('/export.exportData', param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        vc.toast(_json.msg);
                        if (_json.code === 0) {
                            vc.jumpToPage('/#/pages/property/downloadTempFile?tab=下载中心')
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    });
            }
        }
    });
})(window.vc);