wuxw
2019-08-01 2f73a671db8bf132baaba12a5c2a9c3b611589e9
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
/**
    入驻小区
**/
(function(vc){
    vc.extends({
        data:{
            sellRoomInfo:{
                ownerId:'',
                roomId:'',
                state:'',
                remark:'',
                ownerInfo:{
                    ownerId:"",
                    name:"",
                    age:"",
                    sex:"",
                    userName:"",
                    remark:"",
                    link:"",
                },
            }
        },
        _initMethod:function(){
 
        },
        _initEvent:function(){
            vc.on('sellRoom','notify',function(_param){
                  vc.copyObject(_param,vc.component.sellRoomInfo.ownerInfo);
 
                  if(_param.hasOwnProperty("ownerId")){
                    vc.component.sellRoomInfo.ownerId = _param.ownerId;
                  }
 
                   if(_param.hasOwnProperty("roomId")){
                      vc.component.sellRoomInfo.roomId = _param.roomId;
                    }
 
                if(_param.hasOwnProperty("otherState")){
                   vc.component.sellRoomInfo.state = _param.otherState;
                 }
 
                  if(_param.hasOwnProperty("otherRemark")){
                     vc.component.sellRoomInfo.remark = _param.otherRemark;
                   }
 
 
            });
        },
        methods:{
            sellRoomValidate:function(){
                        return vc.validate.validate({
                            sellRoomInfo:vc.component.sellRoomInfo
                        },{
                            'sellRoomInfo.ownerId':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"未选择业主"
                                }
                            ],
                            'sellRoomInfo.roomId':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"未选择房屋"
                                }
                            ],
                            'sellRoomInfo.state':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"未选择出售状态"
                                }
                            ],
 
 
                        });
             },
 
            doSellRoom:function(){
                //
                if(!vc.component.sellRoomValidate()){
                    vc.message(vc.validate.errInfo);
                    return ;
                }
 
                vc.component.sellRoomInfo.communityId=vc.getCurrentCommunity().communityId;
            vc.http.post(
                    'sellRoom',
                    'sell',
                    JSON.stringify(vc.component.sellRoomInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            vc.jumpToPage("/flow/ownerRoomFlow?" + vc.objToGetParam(vc.component.sellRoomInfo.ownerInfo));
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
 
                        vc.message(errInfo);
                     });
 
            }
        }
    });
})(window.vc);