From ea4e931b3e06e4abcd31d74de9e90fa0a8998f3a Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期三, 02 十月 2019 23:50:53 +0800
Subject: [PATCH] 业主报修功能开发完成

---
 WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js b/WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js
index a6e0845..8ee970a 100644
--- a/WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js
+++ b/WebService/src/main/resources/components/unitPackage/add-unit/addUnit.js
@@ -1,6 +1,10 @@
 (function(vc,vm){
 
     vc.extends({
+        propTypes: {
+                   callBackListener:vc.propTypes.string, //鐖剁粍浠跺悕绉�
+                   callBackFunction:vc.propTypes.string //鐖剁粍浠剁洃鍚柟娉�
+        },
         data:{
             addUnitInfo:{
                 floorId:'',
@@ -15,6 +19,12 @@
 
          },
          _initEvent:function(){
+             vc.on('addUnit','openAddUnitModal',function(_params){
+                 vc.component.refreshAddUnitInfo();
+                $('#addUnitModel').modal('show');
+                vc.component.addUnitInfo.floorId = _params.floorId;
+                vc.component.addUnitInfo.communityId = vc.getCurrentCommunity().communityId;
+             });
              vc.on('addUnit','addUnitModel',function(_params){
                 vc.component.refreshAddUnitInfo();
                 $('#addUnitModel').modal('show');
@@ -41,9 +51,9 @@
                                     errInfo:"鍗曞厓缂栧彿涓嶈兘涓虹┖"
                                 },
                                 {
-                                    limit:"maxLength",
-                                    param:"12",
-                                    errInfo:"鍗曞厓缂栧彿闀垮害涓嶈兘瓒呰繃12浣�"
+                                    limit:"num",
+                                    param:"",
+                                    errInfo:"鍗曞厓缂栧彿蹇呴』涓烘暟瀛�"
                                 },
                             ],
                             'addUnitInfo.layerCount':[
@@ -81,6 +91,15 @@
                     return ;
                 }
 
+                 vc.component.addUnitInfo.communityId = vc.getCurrentCommunity().communityId;
+
+                //涓嶆彁浜ゆ暟鎹皢鏁版嵁 鍥炶皟缁欎睛鍚鐞�
+                if(vc.notNull($props.callBackListener)){
+                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addUnitInfo);
+                    $('#addUnitModel').modal('hide');
+                    return ;
+                }
+
                 vc.http.post(
                     'addUnit',
                     'save',

--
Gitblit v1.8.0