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
/**
 入驻小区
 **/
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            propertyRightRegistrationManageInfo: {
                propertyRightRegistrations: [],
                total: 0,
                records: 1,
                moreCondition: false,
                prrId: '',
                states: [],
                floors: [],
                units: [],
                conditions: {
                    roomId: '',
                    roomNum: '',
                    unitNum: '',
                    floorNum: '',
                    allNum: '',
                    name: '',
                    link: '',
                    idCard: '',
                    address: '',
                    idCardUrl: '',
                    housePurchaseUrl: '',
                    repairUrl: '',
                    deedTaxUrl: '',
                    state: '',
                    floorId: '',
                    unitId: '',
                    communityId: vc.getCurrentCommunity().communityId
                }
            }
        },
        _initMethod: function () {
            vc.component.selectFloor();
            vc.component._listPropertyRightRegistrations(DEFAULT_PAGE, DEFAULT_ROWS);
            //与字典表费用类型关联
            vc.getDict('property_right_registration', "state", function (_data) {
                vc.component.propertyRightRegistrationManageInfo.states = _data;
            });
        },
        _initEvent: function () {
            vc.on('propertyRightRegistrationManage', 'listPropertyRightRegistration', function (_param) {
                vc.component._listPropertyRightRegistrations(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listPropertyRightRegistrations(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _listPropertyRightRegistrations: function (_page, _rows) {
                vc.component.propertyRightRegistrationManageInfo.conditions.page = _page;
                vc.component.propertyRightRegistrationManageInfo.conditions.row = _rows;
                var param = {
                    params: vc.component.propertyRightRegistrationManageInfo.conditions
                };
                param.params.roomNum = param.params.roomNum.trim();
                param.params.unitNum = param.params.unitNum.trim();
                param.params.floorNum = param.params.floorNum.trim();
                param.params.roomId = param.params.roomId.trim();
                param.params.allNum = param.params.allNum.trim();
                param.params.name = param.params.name.trim();
                param.params.link = param.params.link.trim();
                param.params.address = param.params.address.trim();
                param.params.idCard = param.params.idCard.trim();
                let _allNum = $that.propertyRightRegistrationManageInfo.conditions.allNum;
                if (_allNum.split('-').length == 3) {
                    let _allNums = _allNum.split('-');
                    param.params.floorNum = _allNums[0].trim();
                    param.params.unitNum = _allNums[1].trim();
                    param.params.roomNum = _allNums[2].trim();
                } else {
                    param.params.floorNum = "";
                    param.params.unitNum = "";
                    param.params.roomNum = "";
                }
                //发送get请求
                vc.http.apiGet('propertyRightRegistration.listPropertyRightRegistration',
                    param,
                    function (json, res) {
                        var _propertyRightRegistrationManageInfo = JSON.parse(json);
                        vc.component.propertyRightRegistrationManageInfo.total = _propertyRightRegistrationManageInfo.total;
                        vc.component.propertyRightRegistrationManageInfo.records = _propertyRightRegistrationManageInfo.records;
                        vc.component.propertyRightRegistrationManageInfo.propertyRightRegistrations = _propertyRightRegistrationManageInfo.data;
                        vc.emit('pagination', 'init', {
                            total: vc.component.propertyRightRegistrationManageInfo.records,
                            dataCount: vc.component.propertyRightRegistrationManageInfo.total,
                            currentPage: _page
                        });
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _openAddPropertyRightRegistrationModal: function () {
                vc.emit('addPropertyRightRegistration', 'openAddPropertyRightRegistrationModal', {});
            },
            _openEditPropertyRightRegistrationModel: function (_propertyRightRegistration) {
                vc.emit('editPropertyRightRegistration', 'openEditPropertyRightRegistrationModal', _propertyRightRegistration);
            },
            _openDeletePropertyRightRegistrationModel: function (_propertyRightRegistration) {
                vc.emit('deletePropertyRightRegistration', 'openDeletePropertyRightRegistrationModal', _propertyRightRegistration);
            },
            //查询
            _queryPropertyRightRegistrationMethod: function () {
                vc.component._listPropertyRightRegistrations(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            //重置
            _resetPropertyRightRegistrationMethod: function () {
                vc.component.propertyRightRegistrationManageInfo.conditions.roomId = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.roomNum = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.unitNum = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.floorNum = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.allNum = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.name = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.link = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.idCard = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.address = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.state = "";
                vc.component.propertyRightRegistrationManageInfo.conditions.floorId = "";
                vc.component.propertyRightRegistrationManageInfo.floors = [];
                vc.component.propertyRightRegistrationManageInfo.conditions.unitId = "";
                vc.component.propertyRightRegistrationManageInfo.units = [];
                vc.component.selectFloor();
                vc.component._listPropertyRightRegistrations(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            //查询楼栋
            selectFloor: function () {
                var param = {
                    params: {
                        communityId: vc.getCurrentCommunity().communityId,
                        page: 1,
                        row: 50
                    }
                };
                vc.http.apiGet(
                    '/floor.queryFloors',
                    param,
                    function (json, res) {
                        var listFloorData = JSON.parse(json);
                        vc.component.propertyRightRegistrationManageInfo.floors = listFloorData.apiFloorDataVoList;
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast(errInfo);
                    });
            },
            //查询单元
            selectUnit: function () {
                var param = {
                    params: {
                        floorId: vc.component.propertyRightRegistrationManageInfo.conditions.floorId,
                        communityId: vc.getCurrentCommunity().communityId,
                        page: 1,
                        row: 50
                    }
                };
                vc.http.apiGet('/unit.queryUnits',
                    param,
                    function (json, res) {
                        var listUnitData = JSON.parse(json);
                        vc.component.propertyRightRegistrationManageInfo.units = listUnitData;
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast(errInfo);
                    });
            },
            //详情
            _openPropertyRightRegistrationDetail: function (_propertyRightRegistration) {
                vc.jumpToPage('/#/pages/property/listPropertyRightRegistrationDetail?prrId=' + _propertyRightRegistration.prrId +
                    "&floorNum=" + _propertyRightRegistration.floorNum + "&unitNum=" + _propertyRightRegistration.unitNum + "&roomNum=" + _propertyRightRegistration.roomNum);
            },
            //审核
            _openExaminePropertyRightRegistration: function (_propertyRightRegistration) {
                vc.emit('examinePropertyRightRegistration', 'openExaminePropertyRightRegistrationModal', _propertyRightRegistration);
            },
            _moreCondition: function () {
                if (vc.component.propertyRightRegistrationManageInfo.moreCondition) {
                    vc.component.propertyRightRegistrationManageInfo.moreCondition = false;
                } else {
                    vc.component.propertyRightRegistrationManageInfo.moreCondition = true;
                }
            }
        }
    });
})(window.vc);