cmServiceteamRoleForm.jsp 7.2 KB

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