Sfoglia il codice sorgente

RoomDto 中加入ownerId

wuxw 6 anni fa
parent
commit
7fb4b60a82

+ 2 - 87
WebService/src/main/resources/components/owner-room/ownerRoom.js

@@ -4,101 +4,16 @@
 (function(vc){
 (function(vc){
     vc.extends({
     vc.extends({
         data:{
         data:{
-            sellRoomInfo:{
-                ownerId:'',
-                roomId:'',
-                state:'',
-                remark:''
-            }
+
         },
         },
         _initMethod:function(){
         _initMethod:function(){
-
+            //根据请求参数查询 查询 业主信息
         },
         },
         _initEvent:function(){
         _initEvent:function(){
-            vc.on('sellRoom','notify',function(_param){
-                  //vc.copyObject(_param,vc.component.sellRoomInfo);
-
-                  if(_param.hasOwnProperty("ownerId")){
-                    vc.component.sellRoomInfo.ownerId = _param.ownerId;
-                  }
-
-                   if(_param.hasOwnProperty("roomId")){
-                      vc.component.sellRoomInfo.roomId = _param.roomId;
-                    }
-
-                if(_param.hasOwnProperty("otherState")){
-                   vc.component.sellRoomInfo.state = _param.otherState;
-                 }
-
-                  if(_param.hasOwnProperty("otherRemark")){
-                     vc.component.sellRoomInfo.remark = _param.otherRemark;
-                   }
 
 
-
-            });
         },
         },
         methods:{
         methods:{
-            sellRoomValidate:function(){
-                        return vc.validate.validate({
-                            sellRoomInfo:vc.component.sellRoomInfo
-                        },{
-                            'sellRoomInfo.ownerId':[
-                                {
-                                    limit:"required",
-                                    param:"",
-                                    errInfo:"未选择业主"
-                                }
-                            ],
-                            'sellRoomInfo.roomId':[
-                                {
-                                    limit:"required",
-                                    param:"",
-                                    errInfo:"未选择房屋"
-                                }
-                            ],
-                            'sellRoomInfo.state':[
-                                {
-                                    limit:"required",
-                                    param:"",
-                                    errInfo:"未选择出售状态"
-                                }
-                            ],
-
-
-                        });
-             },
-
-            doSellRoom:function(){
-                //
-                if(!vc.component.sellRoomValidate()){
-                    vc.message(vc.validate.errInfo);
-                    return ;
-                }
-
-                vc.component.sellRoomInfo.communityId=vc.getCurrentCommunity().communityId;
-            vc.http.post(
-                    'sellRoom',
-                    'sell',
-                    JSON.stringify(vc.component.sellRoomInfo),
-                    {
-                        emulateJSON:true
-                     },
-                     function(json,res){
-                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
-                        if(res.status == 200){
-                            //关闭model
-                            vc.jumpToPage("/")
-                            return ;
-                        }
-                        vc.message(json);
-                     },
-                     function(errInfo,error){
-                        console.log('请求失败处理');
-
-                        vc.message(errInfo);
-                     });
 
 
-            }
         }
         }
     });
     });
 })(window.vc);
 })(window.vc);

+ 14 - 1
WebService/src/main/resources/components/sell-room-select-owner/sellRoomSelectOwner.js

@@ -19,7 +19,8 @@
             }
             }
         },
         },
         _initMethod:function(){
         _initMethod:function(){
-
+            //根据请求参数查询 查询 业主信息
+            vc.component.loadOwnerData();
         },
         },
         _initEvent:function(){
         _initEvent:function(){
             vc.on('sellRoomSelectOwner','chooseOwner',function(_owner){
             vc.on('sellRoomSelectOwner','chooseOwner',function(_owner){
@@ -32,6 +33,18 @@
 
 
             openSearchOwnerModel(){
             openSearchOwnerModel(){
                 vc.emit('searchOwner','openSearchOwnerModel',{});
                 vc.emit('searchOwner','openSearchOwnerModel',{});
+            },
+            loadOwnerData:function(){
+               vc.component.ownerInfo.ownerId = vc.getParam("ownerId");
+               vc.component.ownerInfo.name = vc.getParam("name");
+               vc.component.ownerInfo.age = vc.getParam("age");
+               vc.component.ownerInfo.sex = vc.getParam("sex");
+               vc.component.ownerInfo.userName = vc.getParam("userName");
+               vc.component.ownerInfo.link = vc.getParam("link");
+
+               if(vc.component.ownerInfo.ownerId != ''){
+                  vc.emit($props.callBackComponent,'notify',vc.component.ownerInfo);
+               }
             }
             }
         }
         }
     });
     });

+ 12 - 3
WebService/src/main/resources/components/sell-room/sellRoom.js

@@ -8,7 +8,16 @@
                 ownerId:'',
                 ownerId:'',
                 roomId:'',
                 roomId:'',
                 state:'',
                 state:'',
-                remark:''
+                remark:'',
+                ownerInfo:{
+                    ownerId:"",
+                    name:"",
+                    age:"",
+                    sex:"",
+                    userName:"",
+                    remark:"",
+                    link:"",
+                },
             }
             }
         },
         },
         _initMethod:function(){
         _initMethod:function(){
@@ -16,7 +25,7 @@
         },
         },
         _initEvent:function(){
         _initEvent:function(){
             vc.on('sellRoom','notify',function(_param){
             vc.on('sellRoom','notify',function(_param){
-                  //vc.copyObject(_param,vc.component.sellRoomInfo);
+                  vc.copyObject(_param,vc.component.sellRoomInfo.ownerInfo);
 
 
                   if(_param.hasOwnProperty("ownerId")){
                   if(_param.hasOwnProperty("ownerId")){
                     vc.component.sellRoomInfo.ownerId = _param.ownerId;
                     vc.component.sellRoomInfo.ownerId = _param.ownerId;
@@ -87,7 +96,7 @@
                         //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                         //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                         if(res.status == 200){
                         if(res.status == 200){
                             //关闭model
                             //关闭model
-                            vc.jumpToPage("/")
+                            vc.jumpToPage("/flow/ownerRoomFlow?" + vc.objToGetParam(vc.component.sellRoomInfo.ownerInfo));
                             return ;
                             return ;
                         }
                         }
                         vc.message(json);
                         vc.message(json);

+ 32 - 2
WebService/src/main/resources/static/js/core.js

@@ -126,8 +126,8 @@
 
 
     //绑定跳转函数
     //绑定跳转函数
     vc.jumpToPage = function(url){
     vc.jumpToPage = function(url){
-                                    window.location.href = url;
-                                };
+          window.location.href = url;
+    };
     //保存菜单
     //保存菜单
     vc.setCurrentMenu = function(_menuId){
     vc.setCurrentMenu = function(_menuId){
         window.localStorage.setItem('hc_menuId',_menuId);
         window.localStorage.setItem('hc_menuId',_menuId);
@@ -181,6 +181,36 @@
                 dst[key] = org[key]
                 dst[key] = org[key]
             }
             }
         }
         }
+    };
+    //获取url参数
+    vc.getParam = function(_key){
+        //返回当前 URL 的查询部分(问号 ? 之后的部分)。
+        var urlParameters = location.search;
+        //如果该求青中有请求的参数,则获取请求的参数,否则打印提示此请求没有请求的参数
+        if (urlParameters.indexOf('?') != -1)
+        {
+            //获取请求参数的字符串
+            var parameters = decodeURI(urlParameters.substr(1));
+            //将请求的参数以&分割中字符串数组
+            parameterArray = parameters.split('&');
+            //循环遍历,将请求的参数封装到请求参数的对象之中
+            for (var i = 0; i < parameterArray.length; i++) {
+                if(_key == parameterArray[i].split('=')[0]){
+                    return parameterArray[i].split('=')[1];
+                }
+            }
+        }
+
+        return "";
+    };
+    //对象转get参数
+    vc.objToGetParam =function(obj){
+         var str = [];
+         for (var p in obj)
+          if (obj.hasOwnProperty(p)) {
+           str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
+          }
+         return str.join("&");
     }
     }
 
 
 
 

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/RoomDto.java

@@ -27,6 +27,7 @@ public class RoomDto extends PageDto implements Serializable {
     private String communityId;
     private String communityId;
     private String floorId;
     private String floorId;
     private String userName;
     private String userName;
+    private String ownerId;
 
 
     private String state;
     private String state;
 
 
@@ -185,4 +186,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setState(String state) {
     public void setState(String state) {
         this.state = state;
         this.state = state;
     }
     }
+
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
 }
 }