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
/**
 入驻小区
 **/
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            parkingSpaceApplyManageInfo: {
                parkingSpaceApplys: [],
                total: 0,
                records: 1,
                moreCondition: false,
                applyId: '',
                conditions: {
                    state: '',
                    carNum: '',
                    carBrand: '',
                    applyPersonName: '',
                    applyPersonLink: '',
                    communityId: vc.getCurrentCommunity().communityId
                }
            }
        },
        _initMethod: function () {
            vc.component._listParkingSpaceApplys(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent: function () {
            vc.on('parkingSpaceApplyManage', 'listParkingSpaceApply', function (_param) {
                vc.component._listParkingSpaceApplys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listParkingSpaceApplys(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _listParkingSpaceApplys: function (_page, _rows) {
                vc.component.parkingSpaceApplyManageInfo.conditions.page = _page;
                vc.component.parkingSpaceApplyManageInfo.conditions.row = _rows;
                var param = {
                    params: vc.component.parkingSpaceApplyManageInfo.conditions
                };
                param.params.carNum = param.params.carNum.trim();
                param.params.carBrand = param.params.carBrand.trim();
                param.params.applyPersonName = param.params.applyPersonName.trim();
                param.params.applyPersonLink = param.params.applyPersonLink.trim();
                //发送get请求
                vc.http.apiGet('/parkingSpaceApply.listParkingSpaceApply',
                    param,
                    function (json, res) {
                        var _parkingSpaceApplyManageInfo = JSON.parse(json);
                        vc.component.parkingSpaceApplyManageInfo.total = _parkingSpaceApplyManageInfo.total;
                        vc.component.parkingSpaceApplyManageInfo.records = _parkingSpaceApplyManageInfo.records;
                        vc.component.parkingSpaceApplyManageInfo.parkingSpaceApplys = _parkingSpaceApplyManageInfo.data;
                        vc.emit('pagination', 'init', {
                            total: vc.component.parkingSpaceApplyManageInfo.records,
                            dataCount: vc.component.parkingSpaceApplyManageInfo.total,
                            currentPage: _page
                        });
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _openAddParkingSpaceApplyModal: function () {
                //vc.emit('addParkingSpaceApply','openAddParkingSpaceApplyModal',{});
                vc.jumpToPage('/#/pages/property/addParkingSpaceApply')
            },
            _openAuditParkingSpaceApplyModal: function (_apply) {
                vc.jumpToPage('/#/pages/property/auditParkingSpaceApply?applyId=' + _apply.applyId)
            },
            _openEditParkingSpaceApplyModel: function (_parkingSpaceApply) {
                vc.emit('editParkingSpaceApply', 'openEditParkingSpaceApplyModal', _parkingSpaceApply);
            },
            _openDeleteParkingSpaceApplyModel: function (_parkingSpaceApply) {
                vc.emit('deleteParkingSpaceApply', 'openDeleteParkingSpaceApplyModal', _parkingSpaceApply);
            },
            //查询
            _queryParkingSpaceApplyMethod: function () {
                vc.component._listParkingSpaceApplys(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            //重置
            _resetParkingSpaceApplyMethod: function () {
                vc.component.parkingSpaceApplyManageInfo.conditions.carNum = "";
                vc.component.parkingSpaceApplyManageInfo.conditions.carBrand = "";
                vc.component.parkingSpaceApplyManageInfo.conditions.applyPersonName = "";
                vc.component.parkingSpaceApplyManageInfo.conditions.applyPersonLink = "";
                vc.component.parkingSpaceApplyManageInfo.conditions.state = "";
                vc.component._listParkingSpaceApplys(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _moreCondition: function () {
                if (vc.component.parkingSpaceApplyManageInfo.moreCondition) {
                    vc.component.parkingSpaceApplyManageInfo.moreCondition = false;
                } else {
                    vc.component.parkingSpaceApplyManageInfo.moreCondition = true;
                }
            },
            _getState: function (_state) {
                if (_state == '1001') {
                    return '待审核';
                } else if (_state == '2002') {
                    return '待缴费';
                } else if (_state == '3003') {
                    return '完成';
                } else if (_state == '4004') {
                    return '审核失败';
                }
                return '状态异常';
            },
            _getCatType: function (_type) {
                if (_type == '9901') {
                    return '家用小汽车';
                } else if (_type == '9902') {
                    return '客车';
                } else if (_type == '9903') {
                    return '货车';
                }
                return '异常车辆';
            }
        }
    });
})(window.vc);