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
/**
 入驻小区
 **/
(function (vc) {
    vc.extends({
        data: {
            roomCreateFeeInfo: {
                roomName: '',
                roomId: '',
                ownerId: '',
                ownerName: '',
                roomType: '',
                _currentTab: 'simplifyRoomFee',
                condition: {
                    roomNum: '',
                    ownerName: '',
                }
            },
        },
        _initMethod: function () {
            vc.emit('roomTreeDiv', 'initRoomTreeDiv', {
                callName: 'roomCreateFee'
            });
        },
        _initEvent: function () {
            vc.on('roomCreateFee', 'selectRoom', function (_param) {
                $that.roomCreateFeeInfo.ownerName = '';
                $that.roomCreateFeeInfo.ownerId = '';
                $that.roomCreateFeeInfo.roomId = _param.roomId;
                $that.roomCreateFeeInfo.roomName = _param.roomName;
 
                $that.roomCreateFeeInfo.condition.ownerName = '';
                $that.roomCreateFeeInfo.condition.roomNum = '';
                $that.listRoomInRoomCreateFee();
            });
            vc.on('roomCreateFee', 'notifyRoomByOwner', function (_room) {
                vc.copyObject(_room, $that.roomCreateFeeInfo);
                $that.roomCreateFeeInfo.roomId = _room.roomId;
                $that.roomCreateFeeInfo.roomName = _room.floorNum + "-" + _room.unitNum + "-" + _room.roomNum;
                $that.listRoomInRoomCreateFee();
            });
 
        },
        methods: {
            listRoomInRoomCreateFee: function () {
                let param = {
                    params: {
                        page: 1,
                        row: 1,
                        communityId: vc.getCurrentCommunity().communityId,
                        roomId: $that.roomCreateFeeInfo.roomId,
                    }
                };
                if ($that.roomCreateFeeInfo.condition.roomNum) {
                    param.params.flag = '1';
                    param.params.roomNum = $that.roomCreateFeeInfo.condition.roomNum;
                    param.params.roomId = '';
                    $that.roomCreateFeeInfo.roomName = "";
                    $that.roomCreateFeeInfo.ownerName = "";
                    $that.roomCreateFeeInfo.ownerId = "";
                    $that.roomCreateFeeInfo.roomId = "";
 
                }
                //发送get请求
                vc.http.apiGet('/room.queryRooms',
                    param,
                    function (json, res) {
                        console.log('Room query response:', json);
                        let _json = JSON.parse(json);
                        if (_json.rooms && _json.rooms.length > 0) {
                            let roomInfo = _json.rooms[0];
                            console.log('Fetched room info:', roomInfo);
                            vc.copyObject(roomInfo, $that.roomCreateFeeInfo);
                            $that.changeTab('simplifyRoomFee');
                        } else {
                            console.error('No room data found for roomId:', $that.roomCreateFeeInfo.roomId);
                        }
 
                    },
                    function (errInfo, error) {
                        console.error('Room query failed:', errInfo, error);
                    }
                );
            },
 
 
 
            _inputRoomByOwner: function () {
                if ($that.roomCreateFeeInfo.timer) {
                    clearTimeout($that.roomCreateFeeInfo.timer)
                }
                $that.roomCreateFeeInfo.timer = setTimeout(() => {
                    vc.emit('inputSearchRoomByOwner', 'searchRoom', {
                        callComponent: 'roomCreateFee',
                        ownerName: $that.roomCreateFeeInfo.condition.ownerName
                    });
                }, 1500)
            },
            //查询
            _queryRoomCreateFeeMethod: function () {
                // 关闭查询组件
                $that.listRoomInRoomCreateFee();
            },
            //重置
            _resetRoomCreateFeeMethod: function () {
 
                // 关闭查询组件
                vc.emit('inputSearchRoomInfo', 'close', {});
                vc.emit('inputSearchRoomByOwner', 'close', {});
                $that.roomCreateFeeInfo.roomNum = "";
                $that.roomCreateFeeInfo.ownerName = "";
                $that.roomCreateFeeInfo.ownerId = "";
                $that.roomCreateFeeInfo.condition.ownerName = '';
                $that.roomCreateFeeInfo.condition.roomNum = '';
                $that.changeTab('simplifyRoomFee');
            },
 
            changeTab: function (_tab) {
                $that.roomCreateFeeInfo._currentTab = _tab;
                console.log('Changing to tab:', _tab, 'with room info:', $that.roomCreateFeeInfo);
                
                // 构建完整的房间信息对象
                let roomInfo = {
                    ownerId: $that.roomCreateFeeInfo.ownerId || '',
                    ownerName: $that.roomCreateFeeInfo.ownerName || '',
                    roomId: $that.roomCreateFeeInfo.roomId || '',
                    roomName: $that.roomCreateFeeInfo.roomName || '',
                    floorNum: $that.roomCreateFeeInfo.floorNum || '',
                    unitNum: $that.roomCreateFeeInfo.unitNum || '',
                    roomNum: $that.roomCreateFeeInfo.roomNum || '',
                    roomType: $that.roomCreateFeeInfo.roomType || '',
                    builtUpArea: $that.roomCreateFeeInfo.builtUpArea || 0
                };
                
                console.log('Emitting room info to', _tab, ':', roomInfo);
                vc.emit(_tab, 'switch', roomInfo);
            },
            _roomCreateFeetoSimplifyAcceptance: function () {
                let _date = new Date();
                vc.saveData("JAVA110_IS_BACK", _date.getTime());
                vc.saveData('simplifyAcceptanceSearch', {
                    searchType: '1',
                    searchValue: $that.roomCreateFeeInfo.floorNum + "-" + $that.roomCreateFeeInfo.unitNum + "-" + $that.roomCreateFeeInfo.roomNum,
                    searchPlaceholder: '请输入房屋编号 楼栋-单元-房屋 如1-1-1',
                })
                vc.jumpToPage('/#/pages/property/simplifyAcceptance?tab=业务受理');
            },
            _toBatchCreateFee: function (_room, _isMore) {
                vc.jumpToPage('/#/pages/fee/roomCreatePayFee')
            },
            _downloadCollectionLetterOrder: function () {
                vc.jumpToPage('/#/pages/fee/addOweFeeCallable?callableWay=EXCEL');
            },
            _downloadRoomCollectionLetterOrder: function (_room) {
                vc.emit('downloadCollectionLetterOrder', 'openExportExcel', {
                    roomId: _room.roomId
                })
            },
            _openFeeImportExcel: function () {
                vc.emit('exportFeeImportExcel', 'openExportFeeImportExcelModal', {})
            },
            _openDoCreateRoomFee: function () {
                vc.emit('doImportCreateFee', 'openDoImportCreateFeeModal', {})
            },
            _openRoomCreateFeeComboModal: function () {
                vc.jumpToPage('/#/pages/property/createFeeByCombo?payerObjId=' +
                    $that.roomCreateFeeInfo.roomId +
                    "&payerObjName=" + $that.roomCreateFeeInfo.roomName +
                    "&payerObjType=3333")
            },
            _exportRoomCreateFee: function () {
                $that.roomCreateFeeInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                // $that.roomCreateFeeInfo.conditions.payerObjId=  $that.roomCreateFeeInfo.conditions.roomId;
                $that.roomCreateFeeInfo.conditions.pagePath = 'roomCreateFee';
                let param = {
                    params: $that.roomCreateFeeInfo.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('请求失败处理');
                    });
            },
            _splitPayFee: function (_fee) {
                vc.emit('splitFee', 'openSplitFeeModal', _fee);
            }
        }
    });
})(window.vc);