cmServiceteamRoleForm.jsp 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>协销小组管理</title>
  6. <meta name="decorator" content="default"/>
  7. <script type="text/javascript">
  8. $(document).ready(function () {
  9. //$("#name").focus();
  10. $("#inputForm").validate({
  11. submitHandler: function (form) {
  12. var ids=document.getElementsByName("ids");
  13. var checks;
  14. for (let i = 0; i < ids.length; i++) {
  15. if(ids[i].checked){
  16. checks=ids[i];
  17. break;
  18. }
  19. }
  20. if(null==checks){
  21. alertx("请选择组员!");
  22. return false;
  23. }
  24. var cc=$("#findgroup").val();
  25. // console.log("选中的values---------------------------"+cc);
  26. debugger;
  27. if (null == cc || cc < 1) {
  28. alertx("请选择小组管理员!");
  29. return false;
  30. }
  31. loading('正在提交,请稍等...');
  32. form.submit();
  33. },
  34. errorContainer: "#messageBox",
  35. errorPlacement: function (error, element) {
  36. $("#messageBox").text("输入有误,请先更正。");
  37. if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
  38. error.appendTo(element.parent().parent());
  39. } else {
  40. error.insertAfter(element);
  41. }
  42. }
  43. });
  44. });
  45. function getMember() {
  46. var m = document.getElementsByName("ids");
  47. var opts = "<option value=''>" +"请选择组长" + "</option>";
  48. var count = 0;
  49. for (let i = 0; i < m.length; i++) {
  50. if (count >= 10) {
  51. var n = document.getElementsByName("ids");
  52. for (let i = 0; i < n.length; i++) {
  53. if (!n[i].checked) {
  54. var p = n[i].className;
  55. $('.' + p).hide();
  56. }
  57. }
  58. } else {
  59. var n = document.getElementsByName("ids");
  60. for (let i = 0; i < n.length; i++) {
  61. if (!n[i].checked) {
  62. var p = n[i].className;
  63. $('.' + p).show();
  64. }
  65. }
  66. }
  67. if (m[i].checked && count < 10) {
  68. opts += "<option value='" + m[i].value + "'>" + m[i].id + "</option>";
  69. count++;
  70. }
  71. }
  72. if (count >= 10) {
  73. alert("最多选择十个组员!");
  74. }
  75. $("#findgroup").html('').append(opts);
  76. }
  77. </script>
  78. </head>
  79. <body>
  80. <ul class="nav nav-tabs">
  81. <li><a href="${ctx}/new/user/cmSp/cmSpList/">协销人员列表</a></li>
  82. <shiro:hasPermission name="user:newCmClub:edit">
  83. <li><a href="${ctx}/new/user/cmSp/cmSpForm">添加协销人员</a></li>
  84. </shiro:hasPermission>
  85. <li><a href="${ctx}/serviceteam/cmServiceteamRole/">协销小组</a></li>
  86. <li><a href="${ctx}/new/user/cmSp/leader/">协销总管理员</a></li>
  87. <li><a href="${ctx}/new/user/cmSp/cmSpLivelyClubList/">机构活跃分析</a></li>
  88. <li class="active"><a
  89. href="${ctx}/serviceteam/cmServiceteamRole/form?teamId=${cmServiceteamRole.teamId}">协销小组${not empty cmServiceteamRole.teamId?'编辑':'添加'}</a>
  90. </li>
  91. </ul>
  92. <br/>
  93. <form:form id="inputForm" modelAttribute="cmServiceteamRole" action="${ctx}/serviceteam/cmServiceteamRole/save"
  94. method="post" class="form-horizontal">
  95. <form:hidden path="id"/>
  96. <form:hidden path="teamId"/>
  97. <sys:message content="${message}"/>
  98. <div class="control-group">
  99. <div class="controls">
  100. <c:if test="${not empty cmServiceteamRole.teamId}">
  101. <span style="color:red;">本页面包含本组组员和所有未分组协销账号,上限选择十个,如已选十个则不可选更多组员,取消已选项可复选至十个</span>
  102. <br/>
  103. <br/>
  104. </c:if>
  105. <c:if test="${empty cmServiceteamRole.teamId}">
  106. <span style="color:red;">本页面包含所有未分组协销账号,上限选择十个,如已选十个则不可选更多组员,取消已选项可复选至十个</span>
  107. <br/>
  108. <br/>
  109. </c:if>
  110. </div>
  111. <label class="control-label"><font color="red">*</font>组员:</label>
  112. <div class="controls">
  113. <c:forEach items="${cmServiceteamRole.group}" var="group" varStatus="status">
  114. <c:if test="${not empty group.teamFlag}">
  115. <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
  116. value="${group.serviceProviderID}" style="zoom: 150%" checked
  117. onclick="getMember()">
  118. <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name}&nbsp;&nbsp;</span>
  119. </c:if>
  120. <c:if test="${empty group.teamFlag}">
  121. <c:if test="${empty cmServiceteamRole.fullFlag}">
  122. <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
  123. value="${group.serviceProviderID}" style="zoom: 150%"
  124. onclick="getMember()">
  125. <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name}&nbsp;&nbsp;</span>
  126. </c:if>
  127. <c:if test="${not empty cmServiceteamRole.fullFlag}">
  128. <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
  129. value="${group.serviceProviderID}" style="zoom: 150%;display: none"
  130. onclick="getMember()">
  131. <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name}&nbsp;&nbsp;</span>
  132. </c:if>
  133. </c:if>
  134. <c:if test="${status.count%10 eq 0}">
  135. <hr/>
  136. </c:if>
  137. </c:forEach>
  138. </div>
  139. <br/>
  140. <br/>
  141. <label class="control-label"><font color="red">*</font>小组管理员:</label>
  142. <div class="controls">
  143. <c:if test="${not empty cmServiceteamRole.teamId}">
  144. <form:select path="leaderId" class="input-medium" id="findgroup">
  145. <form:option value="" label="请在组员中选择"/>
  146. <form:option value="${cmServiceteamRole.leaderId}" label="${cmServiceteamRole.leaderName}"/>
  147. <c:forEach items="${cmServiceteamRole.group}" var="group">
  148. <c:if test="${group.serviceProviderID ne cmServiceteamRole.leaderId && not empty group.teamFlag}">
  149. <form:option value="${group.serviceProviderID}" label="${group.name}"/>
  150. </c:if>
  151. </c:forEach>
  152. </form:select>
  153. </c:if>
  154. <c:if test="${empty cmServiceteamRole.teamId}">
  155. <form:select path="leaderId" class="input-medium" id="findgroup">
  156. <form:option value="" label="请在组员中选择"/>
  157. </form:select>
  158. </c:if>
  159. </div>
  160. </div>
  161. <div class="form-actions">
  162. <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp
  163. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  164. </div>
  165. </form:form>
  166. </body>
  167. </html>