MicroCommunityWeb/public/components/property/deleteLocation/deleteLocation.js
2020-06-04 18:25:31 +08:00

52 lines
1.6 KiB
JavaScript

(function(vc,vm){
vc.extends({
data:{
deleteLocationInfo:{
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('deleteLocation','openDeleteLocationModal',function(_params){
vc.component.deleteLocationInfo = _params;
$('#deleteLocationModel').modal('show');
});
},
methods:{
deleteLocation:function(){
vc.component.deleteLocationInfo.communityId=vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'location.deleteLocation',
JSON.stringify(vc.component.deleteLocationInfo),
{
emulateJSON:true
},
function(json,res){
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if(res.status == 200){
//关闭model
$('#deleteLocationModel').modal('hide');
vc.emit('locationManage','listLocation',{});
return ;
}
vc.message(json);
},
function(errInfo,error){
console.log('请求失败处理');
vc.message(json);
});
},
closeDeleteLocationModel:function(){
$('#deleteLocationModel').modal('hide');
}
}
});
})(window.vc,window.vc.component);