123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <%--
- Created by IntelliJ IDEA.
- User: Administrator
- Date: 2020/4/12
- Time: 12:01
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>协销人员管理</title>
- <meta name="decorator" content="default"/>
- <style type="text/css">
- .table th{text-align: center;}
- .table td{text-align: center;}
- </style>
- <script type="text/javascript">
- $(document).ready(function() {
- });
- function page(n,s){
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li class="active"><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>
- </ul>
- <form:form id="searchForm" modelAttribute="newCmSp" action="${ctx}/new/user/cmSp/cmSpList/" method="post" class="breadcrumb form-search">
- <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
- <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
- <div class="ul-form">
- <%--<label>协销ID:</label>
- <form:input path="serviceProviderID" htmlEscape="false" maxlength="20" class="input-medium"/>--%>
- <label>协销姓名:</label>
- <form:input path="linkMan" htmlEscape="false" maxlength="20" class="input-medium"/>
- <label>状态:</label>
- <form:select path="status" class="input-medium">
- <form:option value="" label="请选择"/>
- <form:options items="${fns:getDictList('sp_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- <label>手机号:</label>
- <form:input path="contractMobile" htmlEscape="false" maxlength="20" class="input-medium"/>
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
- <div class="clearfix"></div>
- </div>
- </form:form>
- <sys:message content="${message}"/>
- <table id="contentTable" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th>协销ID</th>
- <th>协销姓名</th>
- <%--<th>联系人</th>--%>
- <th>手机号</th>
- <th>状态</th>
- <%--<th>身份</th>--%>
- <th>创建时间</th>
- <shiro:hasPermission name="user:newCmClub:edit"><th>操作</th></shiro:hasPermission>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${page.list}" var="newCmSp">
- <tr>
- <td>${newCmSp.serviceProviderID}</td>
- <%--<td>${newCmSp.name}</td>--%>
- <td>${newCmSp.linkMan}</td>
- <td>${newCmSp.contractMobile}</td>
- <td>
- <c:if test="${newCmSp.status eq 90}">
- 已上线
- </c:if>
- <c:if test="${newCmSp.status eq 91}">
- 已下线
- </c:if>
- </td>
- <%--<td>${newCmSp.spIdentity}</td>--%>
- <td>${newCmSp.addTime}</td>
- <shiro:hasPermission name="user:newCmClub:edit">
- <td>
- <c:if test="${newCmSp.status eq 90 || newCmSp.status eq 91}">
- <c:if test="${newCmSp.status eq 90}">
- <a href="${ctx}/new/user/cmSp/cmSpOffLine?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确定下线该协销人员吗?', this.href)">下线</a>
- </c:if>
- <c:if test="${newCmSp.status eq 91}">
- <a href="${ctx}/new/user/cmSp/cmSpOnLine?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确定上线该协销人员吗?', this.href)">上线</a>
- </c:if>
- <a href="javascript:void(0);" onclick="updatePwd(${newCmSp.serviceProviderID})">重置密码</a>
- <a href="javascript:void(0);" onclick="sendMsg(${newCmSp.serviceProviderID})">发送消息</a>
- <a href="${ctx}/new/user/cmSp/cmSpEdit?id=${newCmSp.serviceProviderID}">编辑</a>
- <%--<shiro:hasPermission name="user:newCmClub:delete">
- <a href="${ctx}/new/user/cmSp/cmSpDelete?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确认要删除该协销人员吗?', this.href)">删除</a>
- </shiro:hasPermission>--%>
- </c:if>
- <c:if test="${newCmSp.status eq 1 || newCmSp.status eq 92}">
- <a href="javascript:void(0);" onclick="audit('${newCmSp.serviceProviderID}','${newCmSp.name}', '${newCmSp.contractMobile}', '${hasManager}')">审核</a>
- </c:if>
- </td>
- </shiro:hasPermission>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div class="pagination">${page}</div>
- <script>
- //审核
- function audit(spID, name, mobile, hasManager) {
- var html = "<div style='padding:20px;'>" +
- "<font color='red'>*</font>联系人:" + "<span>" + name + "</span>" + "</br>" +
- "<font color='red'>*</font>手机号:" + "<span>" + mobile + "</span>" + "</br>" +
- "</br>" +
- "<font color='red'>*</font>职位:" +
- "<select name='position' id='position' rows='1' cols='8'>";
- if (hasManager == "0") {
- html = html + "<option value='1'>协销经理</option>";
- }
- html = html + "<option value='0'>协销员工</option><select/>" +
- "</br>"
- +"<font color='red'>*</font>审核:" +
- "<select name='auditStatus' id='auditStatus' rows='1' cols='8'>" +
- "<option value='1'>通过</option>" +
- "<option value='0'>驳回</option><select/>" +
- "</br>" +
- "<font color='red'>*</font>审核批注:" +
- "<textarea name='auditNote' id='auditNote' rows='3' cols='8'/></div>";
- var submit = function (v, h, f) {
- if (f.auditNote == '') {
- $.jBox.tip("请输入审核意见", 'error', {focusId: "title"});
- return false;
- }
- $.post("${ctx}/user/cmSp/auditSp", {'spID': spID,'auditNote':f.auditNote, 'auditStatus': f.auditStatus, 'position': f.position}, function (data) {
- if (true == data.success) {
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg, 'error');
- }
- $("#searchForm").submit();
- }, "JSON");//这里返回的类型有:json,html,xml,text
- };
- $.jBox(html, {title: "审核 | 协销ID" + spID, submit: submit});
- }
- // 修改密码
- function updatePwd(id) {
- var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
- var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
- "<input type='password' id='newPwd' name='newPwd' rows='1' cols='12'/>" +
- "</br><font color='red'>*</font>确认密码:" +
- "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
- var submit = function (v, h, f) {
- // 密码
- if (!regPwd.test(f.newPwd)) {
- $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
- return false;
- }
- if (f.newPwd !== f.surePwd) {
- $.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
- return false;
- }
- $.post("${ctx}/user/cmSp/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
- if (true == data.success) {
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg, 'error');
- }
- $("#searchForm").submit();
- }, "JSON");//这里返回的类型有:json,html,xml,text
- };
- $.jBox(html, {title: "确定修改密码?", submit: submit});
- }
- // 发送消息
- function sendMsg(id) {
- var html = "<div style='padding:20px;'><font color='red'>*</font>标题:" +
- "<input id='title' name='title' type='text' rows='1' cols='12'/></br>" +
- "<font color='red'>*</font>内容:" +
- "<textarea name='content' id='content' rows='5' cols='12'/></div>";
- var submit = function (v, h, f) {
- if (f.title == '') {
- $.jBox.tip("请输入标题", 'error', {focusId: "title"});
- return false;
- }else if (f.title.length > 20){
- $.jBox.tip("标题过长", 'error', {focusId: "content"});
- return false;
- }else if (f.content == '') {
- $.jBox.tip("请输入内容", 'error', {focusId: "content"});
- return false;
- }else if(f.content.length > 500){
- $.jBox.tip("内容过长", 'error', {focusId: "content"});
- return false;
- }
- $.post("${ctx}/user/cmSp/sendMsg", {'title': f.title, 'id': id,'content':f.content}, function (data) {
- if (true == data.success) {
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg, 'error');
- }
- $("#searchForm").submit();
- }, "JSON");//这里返回的类型有:json,html,xml,text
- };
- $.jBox(html, {title: "确定发送消息吗?", submit: submit});
- }
- </script>
- </body>
- </html>
|