add.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <%@ include file="../../common/head.jsp"%>
  9. <cs:initFile/>
  10. </head>
  11. <body>
  12. <div class="wrapper wrapper-content">
  13. <div class="row">
  14. <div class="col-sm-12">
  15. <cs:form_validate formId="addMenuForm"/>
  16. <form class="form-horizontal" action="add.cs" id="addMenuForm" method="POST">
  17. <div class="form-group">
  18. <label class="col-sm-3 control-label">上级分类:</label>
  19. <div class="col-sm-6">
  20. <select class="form-control m-b" id="pid" name="pid" onchange="menuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  21. <option value="">请选择</option>
  22. <c:forEach items="${firstCategory }" var="superMenu">
  23. <option value="${superMenu.id }"
  24. <c:if test="${superMenu.id == mgmProductCategory.id }"> selected</c:if>
  25. >${superMenu.gcName}</option>
  26. </c:forEach>
  27. </select>
  28. </div>
  29. </div>
  30. <script type="text/javascript">
  31. function menuChange(obj){
  32. var ss = $(obj).children('option:selected').val();
  33. if (ss == "0") {
  34. $('#lb').css("display", "block");
  35. } else if (ss != "0") {
  36. $('#lb').css("display", "none");
  37. }
  38. $.ajax({
  39. type: "get",
  40. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  41. data: {id:ss},
  42. dataType: "json",
  43. success: function(data){
  44. if(data.type == "1"){
  45. $("#tlb").css("display","none");
  46. $("#tolb").css("display","none");
  47. $("#xm").css("display","block");
  48. }else if(data.type == "2"){
  49. $("#tlb").css("display","block");
  50. $("#tolb").css("display","block");
  51. $("#xm").css("display","none");
  52. data.mlist.forEach(function(val,index,arr){
  53. $("#ptid").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  54. });
  55. }
  56. }
  57. });
  58. }
  59. function twoMenuChange(obj){
  60. var ss = $(obj).children('option:selected').val();
  61. if (ss == "0") {
  62. $('#tolb').css("display", "block");
  63. } else if (ss != "0") {
  64. $('#tolb').css("display", "none");
  65. }
  66. $.ajax({
  67. type: "get",
  68. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  69. data: {id:ss},
  70. dataType: "json",
  71. success: function(data){
  72. if(data.type == "2"){
  73. if(data.twotype == "2"){
  74. }else if(data.twotype == "3"){
  75. $("#thlb").css("display","block");
  76. data.mlist.forEach(function(val,index,arr){
  77. $("#pSid").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  78. });
  79. }
  80. }
  81. }
  82. });
  83. }
  84. </script>
  85. <div id="tlb" class="form-group" style="display:none;" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  86. <label class="col-sm-3 control-label">二级分类:</label>
  87. <div class="col-sm-6">
  88. <select class="form-control m-b" id="ptid" name="ptid" onchange="twoMenuChange(this)">
  89. <option value="">请选择</option>
  90. </select>
  91. </div>
  92. </div>
  93. <div id="thlb" class="form-group" style="display:none;" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  94. <label class="col-sm-3 control-label">三级分类:</label>
  95. <div class="col-sm-6">
  96. <select class="form-control m-b" id="pSid" name="pSid" >
  97. <option value="">请选择</option>
  98. </select>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label class="col-sm-3 control-label">名称:</label>
  103. <div class="col-sm-6">
  104. <input id="gcName" name="gcName" class="form-control" validate="{required:true, minlength:1}" validateMessage="{required:'请输入菜单名称,不能重复',minlength:'至少一个字符以上'}" >
  105. </div>
  106. </div>
  107. <div class="form-group">
  108. <label class="col-sm-3 control-label">分类图标:</label>
  109. <div class="col-sm-6">
  110. <cs:file name="gcIcon" type="100" num="1"></cs:file>
  111. </div>
  112. </div>
  113. <div id="xm" class="form-group" style="display:none;">
  114. <label class="col-sm-3 control-label">所属项目:</label>
  115. <div class="col-sm-6">
  116. <select class="form-control m-b" id="projectId" name="projectId" validate="{required:true}" validateMessage="{required:'请选择所属项目'}" >
  117. <option value="">请选择</option>
  118. <c:forEach items="${project }" var="superMenu">
  119. <option value="${superMenu.id }" >${superMenu.name}</option>
  120. </c:forEach>
  121. </select>
  122. </div>
  123. </div>
  124. <div id="tolb" class="form-group" style="display:none;">
  125. <label class="col-sm-3 control-label">产品级数:</label>
  126. <div class="col-sm-6">
  127. <select class="form-control m-b" id="twoType" name="twoType" validate="{required:true, minlength:1}" validateMessage="{required:'请选择分类类型'}">
  128. <option value="">请选择</option>
  129. <option value="2">2级</option>
  130. <option value="3">3级</option>
  131. </select>
  132. </div>
  133. </div>
  134. <div id="lb" class="form-group" <c:if test="${mgmProductCategory != null }">style="display:none;"</c:if>>
  135. <label class="col-sm-3 control-label">分类类型:</label>
  136. <div class="col-sm-6">
  137. <select class="form-control m-b" id="type" name="type" validate="{required:true, minlength:1}" validateMessage="{required:'请选择分类类型'}">
  138. <option value="">请选择</option>
  139. <option value="1">项目类型</option>
  140. <option value="2">产品类型</option>
  141. </select>
  142. </div>
  143. </div>
  144. <div class="form-group">
  145. <label class="col-sm-3 control-label" >权重:</label>
  146. <div class="col-sm-6">
  147. <input validate="{required:true, min:0}" validateMessage="{required:'请输入权重数值',min:'请输入大于0的数字'}" id="gcSort" name="gcSort" class="form-control" >
  148. </div>
  149. </div>
  150. <div class="form-group">
  151. <label class="col-sm-3 control-label">关键字:</label>
  152. <div class="col-sm-6">
  153. <input id="gcKeywords" name="gcKeywords" class="form-control" validate="{required:true, minlength:1}" validateMessage="{required:'请输入分类关键字',minlength:'至少一个字符以上'}" >
  154. </div>
  155. </div>
  156. <div class="form-group">
  157. <label class="col-sm-3 control-label">描述:</label>
  158. <div class="col-sm-6">
  159. <textarea rows="12" cols="" id="gcDesc" name="gcDesc" class="form-control"></textarea>
  160. </div>
  161. </div>
  162. <div class="form-group">
  163. <div class="col-sm-4 col-sm-offset-3 pull-left">
  164. <button class="btn btn-default btn-dlg-close">取消</button>
  165. <button class="btn btn-primary" type="submit">提交</button>
  166. </div>
  167. </div>
  168. </form>
  169. </div>
  170. </div>
  171. </div>
  172. </body>
  173. </html>