zhijiezhao 3 роки тому
батько
коміт
8f8dff174c

+ 13 - 0
src/main/java/com/caimei/modules/supervip/entity/CmSvipGive.java

@@ -13,6 +13,19 @@ public class CmSvipGive  extends DataEntity<CmSvipGive> {
      */
     private String clubId;
 
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
     public String getMonth() {
         return month;
     }

+ 7 - 2
src/main/java/com/caimei/modules/supervip/web/CmSvipGiveController.java

@@ -1,8 +1,6 @@
 package com.caimei.modules.supervip.web;
 
 import com.caimei.modules.supervip.entity.CmSvipGive;
-import com.caimei.modules.supervip.entity.CmSvipHistory;
-import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.web.BaseController;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -30,4 +28,11 @@ public class CmSvipGiveController  extends BaseController {
         return "modules/super/cmSvipGiveForm";
     }
 
+    @RequestMapping(value = "save")
+    public String save(CmSvipGive cmSvipGive, HttpServletRequest request, HttpServletResponse response, Model model) {
+        System.out.println(cmSvipGive.toString());
+
+        return "modules/svip/cmSvipHistoryList";
+    }
+
 }

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/coupon/toAddClub.jsp

@@ -92,6 +92,7 @@
         var item = $('.check-item:checked').val();
         var club = JSON.parse(item);
         var items = {
+            "clubID": club.clubID,
             "userID": club.userID,
             "name": club.name,
             "shortName": club.shortName,

+ 59 - 60
src/main/webapp/WEB-INF/views/modules/super/cmSvipGiveForm.jsp

@@ -4,7 +4,63 @@
 <head>
     <title>赠送超级会员</title>
     <meta name="decorator" content="default"/>
-    <script type="text/javascript">
+    <script>
+        //点击添加机构
+        function showSelectClub() {
+            var url = "${ctx}/coupon/cmCoupon/toAddClub";
+            var title = '';
+            title = "选择机构";
+            top.$.jBox("iframe:" + url, {
+                iframeScrolling: 'yes',
+                width: $(top.document).width() - 400,
+                height: $(top.document).height() - 160,
+                persistent: true,
+                title: title,
+                buttons: {"确定": '1', "取消": '-1'},
+                submit: function (v, h, f) {
+                    //确定
+                    var $jboxFrame = top.$('#jbox-iframe');
+                    var $mainFrame = top.$('#mainFrame');
+                    if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                        var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                        console.log(items);
+                        insertHtmlClub(items);
+                    }
+                    return true;
+                }
+            });
+        }
+
+        function insertHtmlClub(data) {
+            var html = '<tr>' +
+                '<td>' +
+                data.clubID+
+                '</td>' +
+                '<td>' +
+                data.name +
+                '</td>' +
+                '<td>' +
+                data.linkMan +
+                '</td>' +
+                '<td>' +
+                data.contractMobile +
+                '</td>' +
+                '<td>' +
+                '<a href="javascript:;" onclick="deleteClub()">删除</a>' +
+                '</td>' +
+                '</tr>';
+            $("#contentTableClub").show();
+            $("#chooseClub").hide();
+            $("#hotSearchClub").html(html);
+            $("#userId").val(data.userID);
+        }
+
+        function deleteClub() {
+            $("#hotSearchClub").html("");
+            $("#contentTableClub").hide();
+            $("#chooseClub").show();
+            $("#userId").val("");
+        }
 
     </script>
 </head>
@@ -22,11 +78,12 @@
         <label class="control-label"><font color="red">*</font>机构:</label>
         <div class="controls">
             <a href="javascript:void(0);" onclick="showSelectClub()" id="chooseClub">请选择机构</a>
+            <input type="hidden" name="userId" id="userId" value="${cmCoupon.userId}">
             <table id="contentTableClub" class="table table-striped table-bordered table-condensed" hidden="hidden">
                 <thead>
                 <tr>
+                    <th>机构ID</th>
                     <th>机构名称</th>
-                    <th>机构简称</th>
                     <th>联系人</th>
                     <th>手机号</th>
                     <th>操作</th>
@@ -48,63 +105,5 @@
     </div>
 </form:form>
 </body>
-<script>
-    //点击添加机构
-    function showSelectClub() {
-        var url = "${ctx}/coupon/cmCoupon/toAddClub";
-        var title = '';
-        title = "选择机构";
-        top.$.jBox("iframe:" + url, {
-            iframeScrolling: 'yes',
-            width: $(top.document).width() - 400,
-            height: $(top.document).height() - 160,
-            persistent: true,
-            title: title,
-            buttons: {"确定": '1', "取消": '-1'},
-            submit: function (v, h, f) {
-                //确定
-                var $jboxFrame = top.$('#jbox-iframe');
-                var $mainFrame = top.$('#mainFrame');
-                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
-                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
-                    console.log(items);
-                    insertHtmlClub(items);
-                }
-                return true;
-            }
-        });
-    }
-
-    function insertHtmlClub(data) {
-        var html = '<tr>' +
-            '<td>' +
-            data.name +
-            '</td>' +
-            '<td>' +
-            data.shortName +
-            '</td>' +
-            '<td>' +
-            data.linkMan +
-            '</td>' +
-            '<td>' +
-            data.contractMobile +
-            '</td>' +
-            '<td>' +
-            '<a href="javascript:;" onclick="deleteClub()">删除</a>' +
-            '</td>' +
-            '</tr>';
-        $("#contentTableClub").show();
-        $("#chooseClub").hide();
-        $("#hotSearchClub").html(html);
-        $("#userId").val(data.userID);
-    }
-
-    function deleteClub() {
-        $("#hotSearchClub").html("");
-        $("#contentTableClub").hide();
-        $("#chooseClub").show();
-        $("#userId").val("");
-    }
 
-</script>
 </html>