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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            flowchartFee: {
                _currentTab: 'reportFeeDetailRoom',
                floors: [],
                moreCondition: false,
                communitys: [],
                fees: [],
                feeTypeCds: [],
                total: 0,
                records: 0,
                conditions: {
                    floorId: '',
                    objName: '',
                    endYear: '',
                    startDate: '',
                    endDate: '',
                    configId: '',
                    feeTypeCd: '',
                    ownerName: '',
                    link: '',
                    communityId: ''
                },
                query: {
                    endYear: '',
                    communityId: ''
                },
                yearArr: [],
                yearArr2: [],
                reportLength: 10,
                years: [2025],
                history: [{
                        year: 2020,
                        value1: 200,
                        value2: 200,
                        value3: 200,
                    },
                    {
                        year: 2021,
                        value1: 200,
                        value2: 200,
                        value3: 200,
                    },
                    {
                        year: 2023,
                        value1: 200,
                        value2: 200,
                        value3: 200,
                    },
                    {
                        year: 2024,
                        value1: 200,
                        value2: 200,
                        value3: 200,
                    },
                ],
                today: {
                    year: 2025,
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                }
 
            },
        },
        _initMethod: function () {
            // $that._initDate();
            $that._loadStaffCommunitys();
            $that.flowchartFee.conditions.communityId = vc.getCurrentCommunity().communityId;
            // $that.changeTab($that.flowchartFee._currentTab);
            vc.getDict('pay_fee_config', "fee_type_cd_show", function (_data) {
                $that.flowchartFee.feeTypeCds = _data
            });
            $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent: function () {
            vc.on("indexContext", "_queryIndexContextData", function (_param) {});
            vc.on('reportFeeDetailOwner', 'switch', function (_data) {
                $that.flowchartFee.conditions = _data;
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('reportFeeDetailOwner', 'notify', function (_data) {
                $that.flowchartFee.conditions = _data;
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('reportFeeDetailOwner', 'paginationPlus', 'page_event', function (_currentPage) {
                $that._listReportFeeDetailOwners(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _toDetail: function (_fee) {
                vc.jumpToPage('/#/pages/property/flowchartFeesDetail?feeId=' + _fee.feeId);
            },
            _computeTableDivWidth: function () {
                let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
                mainWidth = mainWidth - 20 - 15 - 20;
                return mainWidth + 'px';
            },
            _computeTableDivHeight: function () {
                // 使用 getElementsByClassName 代替 getElementByClassName
                let mainHeight = document.getElementsByClassName('vc-main-content')[0].clientHeight - document.getElementsByClassName('ibox')[0].offsetHeight;
                mainHeight = mainHeight - 160;
                return mainHeight + 'px';
            },
            
            // _initDate: function () {
            //     vc.initDate('startDate', function (_value) {
            //         $that.flowchartFee.conditions.startDate = _value;
            //     });
            //     vc.initDate('endDate', function (_value) {
            //         $that.flowchartFee.conditions.endDate = _value;
            //     });
            //     let _data = new Date();
            //     let _month = _data.getMonth() + 1;
            //     let _newDate = "";
            //     if (_month < 10) {
            //         _newDate = _data.getFullYear() + "-0" + _month + "-01";
            //     } else {
            //         _newDate = _data.getFullYear() + "-" + _month + "-01";
            //     }
            //     $that.flowchartFee.conditions.startDate = _newDate;
            //     _data.setMonth(_data.getMonth() + 1);
            //     _month = _data.getMonth() + 1;
            //     if (_month < 10) {
            //         _newDate = _data.getFullYear() + "-0" + _month + "-01";
            //     } else {
            //         _newDate = _data.getFullYear() + "-" + _month + "-01";
            //     }
            //     // $that.flowchartFee.conditions.endDate = _newDate;
            // },
            changeTab: function (_tab) {
                $that.flowchartFee._currentTab = _tab;
                vc.emit(_tab, 'switch', $that.flowchartFee.conditions)
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            //查询
            _queryMethod: function () {
                $that.changeTab($that.flowchartFee._currentTab);
            },
            _reloadMethod: function () {
                vc.component.flowchartFee.conditions.endYear = "";
                $that._listReportFeeDetailOwners(DEFAULT_PAGE, DEFAULT_ROWS,true)
            },
            //重置
            _resetMethod: function () {
                vc.component.flowchartFee.conditions.endYear = "";
                // vc.component.flowchartFee.conditions.endDate = "";
                // vc.component.flowchartFee.conditions.objName = "";
                // vc.component.flowchartFee.conditions.ownerName = "";
                // vc.component.flowchartFee.conditions.link = "";
                // // vc.component.flowchartFee.conditions.communityId = "";
                // $that._initDate();
                $that.changeTab($that.flowchartFee._currentTab);
            },
            _loadStaffCommunitys: function () {
                let param = {
                    params: {
                        _uid: '123mlkdinkldldijdhuudjdjkkd',
                        page: 1,
                        row: 100,
                    }
                };
                vc.http.apiGet('/community.listMyEnteredCommunitys',
                    param,
                    function (json, res) {
                        if (res.status == 200) {
                            let _data = JSON.parse(json);
                            $that.flowchartFee.communitys = _data.communitys;
                        }
                    },
                    function () {
                        console.log('请求失败处理');
                    }
                );
            },
            _changCommunity: function () {
                $that.changeTab($that.flowchartFee._currentTab);
            },
            _moreCondition: function () {
                if (vc.component.flowchartFee.moreCondition) {
                    vc.component.flowchartFee.moreCondition = false;
                } else {
                    vc.component.flowchartFee.moreCondition = true;
                }
            },
            _listReportFeeDetailOwners: function (_page, _rows, _reload) {
 
 
                let param = {
                    params: {
                        endYear: vc.component.flowchartFee.conditions.endYear,
                        communityId: vc.getCurrentCommunity().communityId
                    }
                };
                if (_reload) {
                    param.params.reload = true;
                }
                //发送get请求
                vc.http.apiGet('/fee.reportFeeCmd',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        let _data = _json.data || {};
                        console.log('_listReportFeeDetailOwners11111',_data);
 
                        $that.flowchartFee.total = _json.total;
                        $that.flowchartFee.fees = _data.repostList || [];
                        $that.flowchartFee.yearArr = _data.yearArr || []
                        $that.flowchartFee.yearArr2 = _data.yearArr2 || []
 
                        $that.flowchartFee.reportLength = _data.reportLength || 10;
                        console.log('_listReportFeeDetailOwners2222',_data.yearArr,_data.reportLength);
 
                        
                        vc.emit('reportFeeDetailOwner', 'paginationPlus', 'init', {
                            total: $that.flowchartFee.records,
                            dataCount: $that.flowchartFee.total,
                            currentPage: _page,
                        });
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _exportflowchartManageOwnerExcel: function () {
                $that.flowchartFee.conditions.communityId = vc.getCurrentCommunity().communityId;
                $that.flowchartFee.conditions.communityName = vc.getCurrentCommunity().name;
                $that.flowchartFee.conditions.pagePath = 'reportFee';
                let param = {
                    params: $that.flowchartFee.conditions
                };
                //发送get请求
                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);