zhangjq
2026-01-27 6f51f667ae7b13dca029045c221d0b1722cf98df
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
/**
 业主详情页面
 **/
(function (vc) {
    vc.extends({
        data: {
            feeDetailInfo: {
                viewOwnerFlag: '',
                roomNum: '',
                owner:{},
                roomDto:{},
                carFeeList: [],
                otherFeeList: [],
                propertyFeeList: [],
 
 
                name: "",
                age: "",
                sex: "",
                userName: "",
                remark: "",
                idCard: "",
                link: "",
                ownerPhoto: "/img/noPhoto.jpg",
                ownerAttrDtos: [],
                faceUrl: '',
                _currentTab: 'ownerDetailRoom',
                personType: '',
                personTypeName: '',
                personRole: '',
                personRoleName: '',
                concactLink: '',
                concactPerson: '',
                needBack: false,
                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,
                    },
                    {
                        year: 2025,
                        value1: 200,
                        value2: 200,
                        value3: 200,
                    }
                ],
                mail: [{
                        year: '中国邮政挂号信1',
                        value1: 200,
                        value2: 200,
                        value3: 200,
                        value4: 200,
                    },
                    {
                        year: '中国邮政挂号信1',
                        value1: 200,
                        value2: 200,
                        value3: 200,
                        value4: 200,
                    },
                    {
                        year: '中国邮政挂号信1',
                        value1: 200,
                        value2: 200,
                        value3: 200,
                        value4: 200,
                    },
                    {
                        year: '中国邮政挂号信1',
                        value1: 200,
                        value2: 200,
                        value3: 200,
                        value4: 200,
                    },
                    {
                        year: '中国邮政挂号信1',
                        value1: 200,
                        value2: 200,
                        value3: 200,
                        value4: 200,
                    }
                ],
                phone: [{
                    year: '中国邮政挂号信1',
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                },
                {
                    year: '中国邮政挂号信1',
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                },
                {
                    year: '中国邮政挂号信1',
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                },
                {
                    year: '中国邮政挂号信1',
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                },
                {
                    year: '中国邮政挂号信1',
                    value1: 200,
                    value2: 200,
                    value3: 200,
                    value4: 200,
                }
            ],
 
            }
        },
        _initMethod: function () {
            // 初始化时设置参数
            this.feeDetailInfo.roomNum = vc.getParam('roomNum'); 
            this.feeDetailInfo.needBack = vc.getParam('needBack');
            
            let _currentTab = vc.getParam('currentTab');
            if (_currentTab) {
                this.feeDetailInfo._currentTab = _currentTab;
            }
            
            console.log('费用明细组件初始化完成');
        },
        // 组件挂载完成后立即加载数据
        mounted: function() {
            console.log('费用明细组件已挂载,立即加载数据');
            
            // 立即加载数据
            this._loadOwnerInfo();
            
            // 添加全局刷新事件监听
            vc.on('globalRefresh', 'refreshData', function () {
                if (vc.component) {
                    console.log('收到全局刷新事件,重新加载费用明细数据');
                    vc.component._loadOwnerInfo();
                }
            });
            
            // 添加页面可见性变化监听
            document.addEventListener('visibilitychange', () => {
                if (document.visibilityState === 'visible' && vc.component) {
                    console.log('页面变为可见,重新加载费用明细数据');
                    vc.component._loadOwnerInfo();
                }
            });
            
            // 添加组件激活监听
            window.addEventListener('hashchange', () => {
                if (window.location.hash.includes('managementFeesDetail') && vc.component) {
                    console.log('组件激活,重新加载费用明细数据');
                    vc.component._loadOwnerInfo();
                }
            });
        },
        _initEvent: function () {
            vc.on('ownerDetail', 'listOwnerData', function (_info) {
                if (vc.component) {
                    vc.component._loadOwnerInfo();
                }
            });
        },
        methods: {
            _computeTableDivWidth: function () {
                let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
                //let treeWidth = document.getElementsByClassName('room-floor-unit-tree')[0].offsetWidth;
                mainWidth = mainWidth - 20 - 15 - 20;
                //document.getElementsByClassName('hc-table-div')[0].style.width=mainWidth+'px';
                return mainWidth + 'px';
            },
            _loadOwnerInfo: function () {
                // 在方法内部使用this,确保组件上下文正确
                const _this = this;
                
                let param = {
                    params: {
                        roomNum: _this.feeDetailInfo.roomNum, 
                        communityId: vc.getCurrentCommunity().communityId,
                    }
                }
                //发送get请求
                vc.http.apiGet('/fee.reportPropertyFeeCmd',
                    param,
                    function (json, res) {
                        // 在回调中使用vc.component确保组件存在
                        if (!vc.component) {
                            console.error('组件已销毁,无法更新费用明细数据');
                            return;
                        }
                        
                        let _json = JSON.parse(json);
                        console.log('===========json=========',_json.data);
 
                        
                        vc.copyObject(_json.data[0], vc.component.feeDetailInfo);
                        vc.component.feeDetailInfo.owner = _json.data.owner;
                        vc.component.feeDetailInfo.roomDto = _json.data.roomDto;
                        vc.component.feeDetailInfo.carFeeList = _json.data.carFeeList;
                        vc.component.feeDetailInfo.otherFeeList = _json.data.otherFeeList;
                        vc.component.feeDetailInfo.propertyFeeList = _json.data.propertyFeeList;
 
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理:', errInfo, error);
                    }
                );
            },
        }
    });
})(window.vc);