wuxw
2019-07-11 b3f85b60ba9e39572e686009d36b5e5d7e81e910
WebService/src/main/resources/components/sell-car/sellCar.js
@@ -10,8 +10,21 @@
                carBrand:'',
                carType:'',
                carColor:'',
                remark:"",
                psId:''
                carRemark:"",
                psId:'',
                typeCd:'',
                receivableAmount: "0.00",
                receivedAmount:"0.00",
                sellOrHire:"S",
                ownerInfo:{
                    ownerId:"",
                    name:"",
                    age:"",
                    sex:"",
                    userName:"",
                    remark:"",
                    link:"",
                },
            }
        },
        _initMethod:function(){
@@ -19,7 +32,14 @@
        },
        _initEvent:function(){
            vc.on('sellCar','notify',function(_param){
                  vc.copyObject(_param,vc.component.sellCarInfo);
                  vc.copyObject(_param,vc.component.sellCarInfo.ownerInfo);
                  if(_param.hasOwnProperty("typeCd")){
                        vc.component.computeReceivableAmount();
                  }
            });
        },
        methods:{
@@ -34,22 +54,68 @@
                                    errInfo:"未选择业主"
                                }
                            ],
                            'sellCarInfo.roomId':[
                            'sellCarInfo.psId':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"未选择房屋"
                                    errInfo:"未选择停车位"
                                }
                            ],
                            'sellCarInfo.state':[
                            'sellCarInfo.carNum':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"未选择出售状态"
                                    errInfo:"车牌号不能为空"
                                },
                                {
                                    limit:"maxin",
                                    param:"2,12",
                                    errInfo:"车牌号不正确"
                                }
                            ],
                            'sellCarInfo.carBrand':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"车品牌不能为空"
                                },
                                {
                                    limit:"maxLength",
                                    param:"50",
                                    errInfo:"车品牌超出限制"
                                }
                            ],
                            'sellCarInfo.carType':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"车类型不能为空"
                                }
                            ],
                            'sellCarInfo.carColor':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"车颜色不能为空"
                                },
                                {
                                    limit:"maxLength",
                                    param:"12",
                                    errInfo:"车颜色超出限制"
                                }
                            ],
                            'sellCarInfo.receivedAmount':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"实收金额不能为空"
                                },
                                {
                                    limit:"money",
                                    param:"",
                                    errInfo:"实收金额格式错误,如3.00"
                                }
                            ]
                        });
             },
@@ -59,6 +125,8 @@
                    vc.message(vc.validate.errInfo);
                    return ;
                }
                //改remark
                vc.component.sellCarInfo.remark = vc.component.sellCarInfo.carRemark;
                vc.component.sellCarInfo.communityId=vc.getCurrentCommunity().communityId;
            vc.http.post(
@@ -72,7 +140,7 @@
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            vc.jumpToPage("/flow/ownerCarFlow?" + vc.objToGetParam(vc.component.sellCarInfo.ownerInfo));
                            vc.jumpToPage("/flow/ownerParkingSpaceFlow?" + vc.objToGetParam(vc.component.sellCarInfo.ownerInfo));
                            return ;
                        }
                        vc.message(json);
@@ -83,6 +151,37 @@
                        vc.message(errInfo);
                     });
            },
            computeReceivableAmount:function(){
                //
                var param = {
                        params:{
                            communityId:vc.getCurrentCommunity().communityId,
                            typeCd:vc.component.sellCarInfo.typeCd
                        }
                    };
                    vc.http.get(
                        'sellCar',
                        'loadSellParkingSpaceConfigData',
                         param,
                         function(json,res){
                            //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                            if(res.status == 200){
                                //关闭model
                                var configFee = JSON.parse(json);
                                vc.component.sellCarInfo.receivableAmount = configFee.additionalAmount;
                                vc.component.sellCarInfo.receivedAmount = configFee.additionalAmount;
                                return ;
                            }
                            vc.message(json);
                         },
                         function(errInfo,error){
                            console.log('请求失败处理');
                            vc.message(errInfo);
                         });
            }
        }
    });