| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | 入驻小区 |
| | | **/ |
| | | (function (vc) { |
| | | vc.extends({ |
| | | data:{ |
| | | serviceBindingInfo:{ |
| | | $step:{}, |
| | | index:0, |
| | | infos:[] |
| | | data: { |
| | | serviceBindingInfo: { |
| | | $step: {}, |
| | | index: 0, |
| | | infos: [] |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | _initMethod: function () { |
| | | vc.component._initStep(); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on("serviceBinding", "notify", function(_info){ |
| | | _initEvent: function () { |
| | | vc.on("serviceBinding", "notify", function (_info) { |
| | | vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index] = _info; |
| | | }); |
| | | |
| | | }, |
| | | methods:{ |
| | | _initStep:function(){ |
| | | methods: { |
| | | _initStep: function () { |
| | | vc.component.serviceBindingInfo.$step = $("#step"); |
| | | vc.component.serviceBindingInfo.$step.step({ |
| | | index: 0, |
| | | time: 500, |
| | | title: ["选择应用","选择服务","扩展信息"] |
| | | title: ["选择应用", "选择服务", "扩展信息"] |
| | | }); |
| | | vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex(); |
| | | }, |
| | | _prevStep:function(){ |
| | | _prevStep: function () { |
| | | vc.component.serviceBindingInfo.$step.prevStep(); |
| | | vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex(); |
| | | |
| | | vc.emit('viewAppInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRouteView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRouteView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | |
| | | }, |
| | | _nextStep:function(){ |
| | | _nextStep: function () { |
| | | var _currentData = vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index]; |
| | | if( _currentData == null || _currentData == undefined){ |
| | | if (_currentData == null || _currentData == undefined) { |
| | | vc.message("请选择或填写必选信息"); |
| | | return ; |
| | | return; |
| | | } |
| | | vc.component.serviceBindingInfo.$step.nextStep(); |
| | | vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex(); |
| | | |
| | | vc.emit('viewAppInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRouteView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewAppInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRouteView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | |
| | | }, |
| | | _finishStep:function(){ |
| | | _finishStep: function () { |
| | | |
| | | |
| | | var _currentData = vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index]; |
| | | if( _currentData == null || _currentData == undefined){ |
| | | if (_currentData == null || _currentData == undefined) { |
| | | vc.message("请选择或填写必选信息"); |
| | | return ; |
| | | return; |
| | | } |
| | | |
| | | var param = { |
| | | data:vc.component.serviceBindingInfo.infos |
| | | data: vc.component.serviceBindingInfo.infos |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'serviceBinding', |
| | | 'binding', |
| | | JSON.stringify(param), |
| | | { |
| | | emulateJSON:true |
| | | vc.http.post( |
| | | 'serviceBinding', |
| | | 'binding', |
| | | JSON.stringify(param), |
| | | { |
| | | emulateJSON: true |
| | | }, |
| | | function(json,res){ |
| | | if(res.status == 200){ |
| | | function (json, res) { |
| | | if (res.status == 200) { |
| | | |
| | | vc.message('处理成功',true); |
| | | //关闭model |
| | | vc.jumpToPage("/flow/serviceRegisterFlow?" + vc.objToGetParam(JSON.parse(json))); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | vc.message('处理成功', true); |
| | | //关闭model |
| | | vc.jumpToPage("/flow/serviceRegisterFlow?" + vc.objToGetParam(JSON.parse(json))); |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | vc.message(errInfo); |
| | | }); |
| | | } |
| | | } |
| | |
| | | vc.component.newVisitInfo.$step.prevStep(); |
| | | vc.component.newVisitInfo.index = vc.component.newVisitInfo.$step.getIndex(); |
| | | |
| | | vc.emit('viewSelectParkingSpace', 'onIndex', vc.component.newVisitInfo.index); |
| | | vc.emit('viewOwnerInfo', 'onIndex', vc.component.newVisitInfo.index); |
| | | vc.emit('addVisit', 'onIndex', vc.component.newVisitInfo.index); |
| | | vc.emit('viewVisitInfo', 'onIndex', vc.component.newVisitInfo.index); |
| | | vc.emit('addCar', 'onIndex', vc.component.newVisitInfo.index); |
| | | |
| | | if(vc.component.newVisitInfo.index == 1){ |
| | |
| | | |
| | | }, |
| | | _nextStep:function(){ |
| | | var _currentData = vc.component.newVisitInfo.infos[vc.component.newVisitInfo.index]; |
| | | var _currentData = vc.component.newVisitInfo.infos[vc.component.viewVisitInfo.index]; |
| | | if( _currentData == null || _currentData == undefined){ |
| | | vc.message("请选择或填写必选信息"); |
| | | return ; |
| | |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">访客姓名</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="viewVisitInfo.name" type="text" placeholder="必填,请填写应用名称" |
| | | <input v-model="addVisitInfo.name" type="text" placeholder="必填,请填写访客姓名" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">性别</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="viewVisitInfo.visitGender"> |
| | | <select class="custom-select" v-model="addVisitInfo.visitGender"> |
| | | <option selected disabled value="">必填,请选择性别</option> |
| | | <option value="0">男</option> |
| | | <option value="1">女</option> |
| | |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">访客联系方式</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="viewVisitInfo.phoneNumber" type="text" placeholder="必填,请填写访客联系方式" |
| | | <input v-model="addVisitInfo.phoneNumber" type="text" placeholder="必填,请填写访客联系方式" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | |
| | | callBackFunction: vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data:{ |
| | | viewVisitInfo:{ |
| | | index:0, |
| | | flowComponent:'visit', |
| | | needShowAddAppButton:'true' |
| | | addVisitInfo:{ |
| | | name:'', |
| | | visitGender:'', |
| | | phoneNumber:'' |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | |
| | | $("#addNewVisitModel").modal("show"); |
| | | }); |
| | | |
| | | // vc.on('viewVisitInfo', 'onIndex', function(_index){ |
| | | // vc.component.viewVisitInfo.index = _index; |
| | | // }); |
| | | vc.on('addVisit', 'onIndex', function(_index){ |
| | | vc.component.viewVisitInfo.index = _index; |
| | | }); |
| | | |
| | | }, |
| | | methods:{ |
| | | addAppValidate() { |
| | | return vc.validate.validate({ |
| | | viewVisitInfo: vc.component.viewVisitInfo |
| | | addVisitInfo: vc.component.addVisitInfo |
| | | }, { |
| | | 'viewVisitInfo.name': [ |
| | | 'addVisitInfo.name': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "访客姓名不能为空" |
| | | } |
| | | ], |
| | | 'viewVisitInfo.visitGender': [ |
| | | 'addVisitInfo.visitGender': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "访客性别不能为空" |
| | | } |
| | | ], |
| | | 'viewVisitInfo.phoneNumber': [ |
| | | 'addVisitInfo.phoneNumber': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | |
| | | |
| | | return; |
| | | } |
| | | vc.component.addAppInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | vc.emit($props.callBackListener, $props.callBackFunction, vc.component.viewVisitInfo); |
| | | $('#addAppModel').modal('hide'); |
| | | vc.component.addVisitInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | vc.emit("viewVisitInfo", "addNewVisit", vc.component.addVisitInfo); |
| | | $('#addNewVisitModel').modal('hide'); |
| | | }, |
| | | _openAddAppInfoModel(){ |
| | | vc.emit('addApp','openAddAppModal',{}); |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >访客ID:</label> |
| | | <label class="">{{viewVisitInfo.appId}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">访客姓名:</label> |
| | | <label class="">{{viewVisitInfo.name}}</label> |
| | | </div> |
| | |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >访客联系方式:</label> |
| | | <label class="">{{viewVisitInfo.securityCode}}</label> |
| | | <label class="">{{viewVisitInfo.phoneNumber}}</label> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >访客性别:</label> |
| | | <label class="">{{viewVisitInfo.whileListIp}}</label> |
| | | <label class="">{{viewVisitInfo.visitGender=="0"?"男":"女"}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >访客到访事由:</label> |
| | | <label class="">{{viewVisitInfo.blackListIp}}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- viewVisitInfo--> |
| | | </div> |
| | | </div> |
| | |
| | | viewVisitInfo:{ |
| | | index:0, |
| | | flowComponent:'visit', |
| | | needShowAddAppButton:'true' |
| | | needShowAddAppButton:'true', |
| | | name:'', |
| | | visitGender:'', |
| | | phoneNumber:'' |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('viewVisitInfo','addNewVisit',function(_app){ |
| | | vc.copyObject(_app, vc.component.viewAppInfo); |
| | | vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewAppInfo); |
| | | console.log(_app); |
| | | |
| | | vc.copyObject(_app, vc.component.viewVisitInfo); |
| | | vc.emit('addVisitSpace','notify',vc.component.viewVisitInfo); |
| | | }); |
| | | |
| | | vc.on('viewAppInfo', 'onIndex', function(_index){ |
| | | vc.on('viewVisitInfo', 'onIndex', function(_index){ |
| | | vc.component.viewAppInfo.index = _index; |
| | | }); |
| | | |
| | |
| | | 事件监听 |
| | | **/ |
| | | vc.on = function(_componentName,_value,_callback){ |
| | | // console.log(_componentName+'_'+_value+" 进入"); |
| | | vc.component.$on(_componentName+'_'+_value,_callback); |
| | | // console.log(_componentName+'_'+_value); |
| | | }; |
| | | |
| | | /** |
| | | 事件触发 |
| | | **/ |
| | | vc.emit = function(_componentName,_value,_param){ |
| | | console.log(_componentName+'_'+_value+" 进入"); |
| | | vc.component.$emit(_componentName+'_'+_value,_param); |
| | | console.log(_componentName+'_'+_value); |
| | | }; |
| | | |
| | | })(window.vc); |