123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
- <html>
- <head>
- <title>协销小组管理</title>
- <meta name="decorator" content="default"/>
- <script type="text/javascript">
- $(document).ready(function () {
- //$("#name").focus();
- $("#inputForm").validate({
- submitHandler: function (form) {
- var cc=$("#findgroup").val();
- // console.log(cc);
- if (null == cc || cc < 1) {
- alertx("请选择组长!");
- return false;
- }
- loading('正在提交,请稍等...');
- form.submit();
- },
- errorContainer: "#messageBox",
- errorPlacement: function (error, element) {
- $("#messageBox").text("输入有误,请先更正。");
- if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
- error.appendTo(element.parent().parent());
- } else {
- error.insertAfter(element);
- }
- }
- });
- });
- function getMember() {
- var m = document.getElementsByName("ids");
- var opts = "";
- var count = 0;
- for (let i = 0; i < m.length; i++) {
- if (count >= 10) {
- var n = document.getElementsByName("ids");
- for (let i = 0; i < n.length; i++) {
- if (!n[i].checked) {
- var p = n[i].className;
- $('.' + p).hide();
- }
- }
- } else {
- var n = document.getElementsByName("ids");
- for (let i = 0; i < n.length; i++) {
- if (!n[i].checked) {
- var p = n[i].className;
- $('.' + p).show();
- }
- }
- }
- if (m[i].checked && count < 10) {
- opts += "<option value='" + m[i].value + "'>" + m[i].id + "</option>";
- count++;
- }
- }
- if (count >= 10) {
- alert("最多选择十个组员!");
- }
- $("#findgroup").html('').append(opts);
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li><a href="${ctx}/new/user/cmSp/cmSpList/">协销人员列表</a></li>
- <shiro:hasPermission name="user:newCmClub:edit">
- <li><a href="${ctx}/new/user/cmSp/cmSpForm">添加协销人员</a></li>
- </shiro:hasPermission>
- <li><a href="${ctx}/serviceteam/cmServiceteamRole/">协销小组</a></li>
- <li><a href="${ctx}/new/user/cmSp/leader/">协销总管理员</a></li>
- <li class="active"><a
- href="${ctx}/serviceteam/cmServiceteamRole/form?teamId=${cmServiceteamRole.teamId}">协销小组${not empty cmServiceteamRole.teamId?'编辑':'添加'}</a>
- </li>
- </ul>
- <br/>
- <form:form id="inputForm" modelAttribute="cmServiceteamRole" action="${ctx}/serviceteam/cmServiceteamRole/save"
- method="post" class="form-horizontal">
- <form:hidden path="id"/>
- <form:hidden path="teamId"/>
- <sys:message content="${message}"/>
- <div class="control-group">
- <div class="controls">
- <c:if test="${not empty cmServiceteamRole.teamId}">
- <span style="color:red;">本页面包含本组组员和所有未分组协销账号,上限选择十个,如已选十个则不可选更多组员,取消已选项可复选至十个</span>
- <br/>
- <br/>
- </c:if>
- <c:if test="${empty cmServiceteamRole.teamId}">
- <span style="color:red;">本页面包含所有未分组协销账号,上限选择十个,如已选十个则不可选更多组员,取消已选项可复选至十个</span>
- <br/>
- <br/>
- </c:if>
- </div>
- <label class="control-label">组员:</label>
- <div class="controls">
- <c:forEach items="${cmServiceteamRole.group}" var="group" varStatus="status">
- <c:if test="${not empty group.teamFlag}">
- <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
- value="${group.serviceProviderID}" style="zoom: 150%" checked
- onclick="getMember()">
- <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name} </span>
- </c:if>
- <c:if test="${empty group.teamFlag}">
- <c:if test="${empty cmServiceteamRole.fullFlag}">
- <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
- value="${group.serviceProviderID}" style="zoom: 150%"
- onclick="getMember()">
- <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name} </span>
- </c:if>
- <c:if test="${not empty cmServiceteamRole.fullFlag}">
- <input class="N${group.serviceProviderID}" type="checkbox" name="ids" id="${group.name}"
- value="${group.serviceProviderID}" style="zoom: 150%;display: none"
- onclick="getMember()">
- <span style="font-size: 15px;" id="${group.serviceProviderID}">${group.name} </span>
- </c:if>
- </c:if>
- <c:if test="${status.count%10 eq 0}">
- <hr/>
- </c:if>
- </c:forEach>
- </div>
- <br/>
- <br/>
- <label class="control-label">小组管理员:</label>
- <div class="controls">
- <c:if test="${not empty cmServiceteamRole.teamId}">
- <form:select path="leaderId" class="input-medium" id="findgroup">
- <form:option value="" label="请在组员中选择"/>
- <form:option value="${cmServiceteamRole.leaderId}" label="${cmServiceteamRole.leaderName}"/>
- <c:forEach items="${cmServiceteamRole.group}" var="group">
- <c:if test="${group.serviceProviderID ne cmServiceteamRole.leaderId && not empty group.teamFlag}">
- <form:option value="${group.serviceProviderID}" label="${group.name}"/>
- </c:if>
- </c:forEach>
- </form:select>
- </c:if>
- <c:if test="${empty cmServiceteamRole.teamId}">
- <form:select path="leaderId" class="input-medium" id="findgroup">
- <form:option value="" label="请在组员中选择"/>
- </form:select>
- </c:if>
- </div>
- </div>
- <div class="form-actions">
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> 
- <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
- </div>
- </form:form>
- </body>
- </html>
|