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
| (function(vc){
| //员工权限
| vc.extends({
| data:{
| unitInfo:{
| units:[],
| _currentFloorId:'',
| moreCondition:false,
| conditions:{
| floorId:'',
| floorName:'',
| unitNum:'',
| layerCount:'',
| lift:'',
| }
| }
| },
| _initMethod:function(){
|
| },
| _initEvent:function(){
| vc.on('unit','chooseFloor',function(_param){
| vc.component.conditions.floorId = _param.floorId;
| vc.component.conditions.floorName = _param.floorName;
| });
|
| vc.on('unit','loadUnit',function(_param){
| vc.component.conditions.floorId = _param.floorId;
| vc.component._loadUnits(_param);
| });
| vc.on('unit','loadData',function(_param){
| vc.component._loadUnits(_param);
| });
| },
| methods:{
| _loadUnits:function(_param){
| vc.component.unitInfo._currentFloorId=_param.floorId;
| vc.component.unitInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
| var param = {
| params:vc.component.unitInfo.conditions
| };
| //发送get请求
| vc.http.get('unit',
| 'loadUnits',
| param,
| function(json){
| var _unitInfo = JSON.parse(json);
| vc.component.unitInfo.units = _unitInfo;
| },
| function(){
| console.log('请求失败处理');
| });
| },
| _openDeleteUnitModel:function(_unit){
| _unit.floorId = vc.component.unitInfo._currentFloorId;
| vc.emit('deleteUnit','openUnitModel',_unit);
| },
| _openEditUnitModel:function(_unit){
| _unit.floorId = vc.component.unitInfo._currentFloorId;
| vc.emit('editUnit','openUnitModel',_unit);
| },
| _openChooseFloorMethod:function(){
| vc.emit('searchFloor','openSearchFloorModel',{});
| },
| openAddUnitModel(){
| vc.emit('addUnit','addUnitModel',{
| floorId:vc.component.unitInfo.conditions.floorId
| });
| },
| _moreCondition:function(){
| if(vc.component.unitInfo.moreCondition){
| vc.component.unitInfo.moreCondition = false;
| }else{
| vc.component.unitInfo.moreCondition = true;
| }
| }
| }
| });
|
| })(window.vc);
|
|