Browse Source

优化单元选择功能

wuxw 6 years ago
parent
commit
9c95e3fe8f

+ 9 - 1
WebService/src/main/resources/components/floorPackage/floor-select2/floorSelect2.js

@@ -6,11 +6,19 @@
         data:{
             floorSelect2Info:{
                 floors:[],
-                floorId:'',
+                floorId:'-1',
                 floorNum:'',
                 floorName:'',
             }
         },
+        watch:{
+            floorSelect2Info:{
+                deep: true,
+                handler:function(){
+                    vc.emit('unitSelect2', "transferFloor" ,vc.component.floorSelect2Info);
+                }
+            }
+        },
         _initMethod:function(){
                 vc.component._initFloorSelect2();
         },

+ 1 - 5
WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js

@@ -8,7 +8,7 @@
         data:{
             unitSelect2Info:{
                 units:[],
-                floorId:'',
+                floorId:'-1',
                 unitId:'',
                 unitNum:'',
                 unitName:'',
@@ -39,10 +39,6 @@
                 console.log("调用_initUnitSelect2 方法");
                 $.fn.modal.Constructor.prototype.enforceFocus = function () {};
                 $.fn.select2.defaults.set('width', '100%');
-                if(!vc.notNull(vc.component.unitSelect2Info.floorId)){
-                    vc.toast("未选择楼栋信息,请先选择楼栋");
-                    return ;
-                }
                 $('.unitSelector').select2({
                     placeholder: '必填,请选择单元',
                     ajax: {