mrzcc
2020-03-06 ecdac8a738f254db2b2ea28cbe3248f7a6a7eb2b
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
/**
    入驻小区
**/
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROW = 10;
    vc.extends({
        data:{
            parkingSpaceUnits:[],
            parkingSpaceCreateFeeInfo:{
                parkingSpaces:[],
                total:0,
                records:1,
                floorId:'',
                unitId:'',
                state:'',
                num:'',
                moreCondition:false,
                conditions:{
                    psId:'',
                    num:'',
                    carNum:''
                }
            }
        },
        _initMethod:function(){
            vc.component.listParkingSpace(DEFAULT_PAGE,DEFAULT_ROW);
        },
        _initEvent:function(){
 
            vc.on('pagination','page_event',function(_currentPage){
                vc.component.listParkingSpace(_currentPage,DEFAULT_ROW);
            });
        },
        methods:{
 
            listParkingSpace:function(_page,_row){
 
                vc.component.parkingSpaceCreateFeeInfo.conditions.page=_page;
                vc.component.parkingSpaceCreateFeeInfo.conditions.row=_row;
                vc.component.parkingSpaceCreateFeeInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                var param = {
                    params:vc.component.parkingSpaceCreateFeeInfo.conditions
                };
 
               //发送get请求
               vc.http.get('parkingSpaceCreateFee',
                            'listParkingSpace',
                             param,
                             function(json,res){
                                var listParkingSpaceData =JSON.parse(json);
 
                                vc.component.parkingSpaceCreateFeeInfo.total = listParkingSpaceData.total;
                                vc.component.parkingSpaceCreateFeeInfo.records = listParkingSpaceData.records;
                                vc.component.parkingSpaceCreateFeeInfo.parkingSpaces = listParkingSpaceData.parkingSpaces;
 
                                vc.emit('pagination','init',{
                                    total:vc.component.parkingSpaceCreateFeeInfo.records,
                                    dataCount: vc.component.parkingSpaceCreateFeeInfo.total,
                                    currentPage:_page
                                });
                             },function(errInfo,error){
                                console.log('请求失败处理');
                             }
                           );
            },
            _openParkingSpaceCreateFeeAddModal:function(_parkingSpace,_isMore){
                vc.emit('parkingSpaceCreateFeeAdd', 'openParkingSpaceCreateFeeAddModal',{
                    isMore:_isMore,
                    parkingSpace:_parkingSpace
                });
            },
            _openViewParkingSpaceCreateFee:function(_parkingSpace){
                 vc.jumpToPage("/flow/listParkingSpaceFeeFlow?"+vc.objToGetParam(_parkingSpace));
            },
            _queryParkingSpaceMethod:function(){
                vc.component.listParkingSpace(DEFAULT_PAGE,DEFAULT_ROW);
            },
 
            _moreCondition:function(){
                if(vc.component.parkingSpaceCreateFeeInfo.moreCondition){
                    vc.component.parkingSpaceCreateFeeInfo.moreCondition = false;
                }else{
                    vc.component.parkingSpaceCreateFeeInfo.moreCondition = true;
                }
            }
 
        }
    });
})(window.vc);