cmSpList.jsp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: Administrator
  4. Date: 2020/4/12
  5. Time: 12:01
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  9. <%@ page contentType="text/html;charset=UTF-8" %>
  10. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  11. <html>
  12. <head>
  13. <title>协销人员管理</title>
  14. <meta name="decorator" content="default"/>
  15. <style type="text/css">
  16. .table th{text-align: center;}
  17. .table td{text-align: center;}
  18. </style>
  19. <script type="text/javascript">
  20. $(document).ready(function() {
  21. });
  22. function page(n,s){
  23. $("#pageNo").val(n);
  24. $("#pageSize").val(s);
  25. $("#searchForm").submit();
  26. return false;
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <ul class="nav nav-tabs">
  32. <li class="active"><a href="${ctx}/new/user/cmSp/cmSpList/">协销人员列表</a></li>
  33. <shiro:hasPermission name="user:newCmClub:edit"><li><a href="${ctx}/new/user/cmSp/cmSpForm">添加协销人员</a></li></shiro:hasPermission>
  34. <li><a href="${ctx}/serviceteam/cmServiceteamRole/">协销小组</a></li>
  35. <li><a href="${ctx}/new/user/cmSp/leader/">协销总管理员</a></li>
  36. </ul>
  37. <form:form id="searchForm" modelAttribute="newCmSp" action="${ctx}/new/user/cmSp/cmSpList/" method="post" class="breadcrumb form-search">
  38. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  39. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  40. <div class="ul-form">
  41. <%--<label>协销ID:</label>
  42. <form:input path="serviceProviderID" htmlEscape="false" maxlength="20" class="input-medium"/>--%>
  43. <label>协销姓名:</label>
  44. <form:input path="linkMan" htmlEscape="false" maxlength="20" class="input-medium"/>
  45. <label>状态:</label>
  46. <form:select path="status" class="input-medium">
  47. <form:option value="" label="请选择"/>
  48. <form:options items="${fns:getDictList('sp_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  49. </form:select>
  50. <label>手机号:</label>
  51. <form:input path="contractMobile" htmlEscape="false" maxlength="20" class="input-medium"/>
  52. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  53. <div class="clearfix"></div>
  54. </div>
  55. </form:form>
  56. <sys:message content="${message}"/>
  57. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  58. <thead>
  59. <tr>
  60. <th>协销ID</th>
  61. <th>协销姓名</th>
  62. <%--<th>联系人</th>--%>
  63. <th>手机号</th>
  64. <th>状态</th>
  65. <%--<th>身份</th>--%>
  66. <th>创建时间</th>
  67. <shiro:hasPermission name="user:newCmClub:edit"><th>操作</th></shiro:hasPermission>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <c:forEach items="${page.list}" var="newCmSp">
  72. <tr>
  73. <td>${newCmSp.serviceProviderID}</td>
  74. <%--<td>${newCmSp.name}</td>--%>
  75. <td>${newCmSp.linkMan}</td>
  76. <td>${newCmSp.contractMobile}</td>
  77. <td>
  78. <c:if test="${newCmSp.status eq 90}">
  79. 已上线
  80. </c:if>
  81. <c:if test="${newCmSp.status eq 91}">
  82. 已下线
  83. </c:if>
  84. </td>
  85. <%--<td>${newCmSp.spIdentity}</td>--%>
  86. <td>${newCmSp.addTime}</td>
  87. <shiro:hasPermission name="user:newCmClub:edit">
  88. <td>
  89. <c:if test="${newCmSp.status eq 90 || newCmSp.status eq 91}">
  90. <c:if test="${newCmSp.status eq 90}">
  91. <a href="${ctx}/new/user/cmSp/cmSpOffLine?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确定下线该协销人员吗?', this.href)">下线</a>
  92. </c:if>
  93. <c:if test="${newCmSp.status eq 91}">
  94. <a href="${ctx}/new/user/cmSp/cmSpOnLine?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确定上线该协销人员吗?', this.href)">上线</a>
  95. </c:if>
  96. <a href="javascript:void(0);" onclick="updatePwd(${newCmSp.serviceProviderID})">重置密码</a>
  97. <a href="javascript:void(0);" onclick="sendMsg(${newCmSp.serviceProviderID})">发送消息</a>
  98. <a href="${ctx}/new/user/cmSp/cmSpEdit?id=${newCmSp.serviceProviderID}">编辑</a>
  99. <%--<shiro:hasPermission name="user:newCmClub:delete">
  100. <a href="${ctx}/new/user/cmSp/cmSpDelete?id=${newCmSp.serviceProviderID}" onclick="return confirmx('确认要删除该协销人员吗?', this.href)">删除</a>
  101. </shiro:hasPermission>--%>
  102. </c:if>
  103. <c:if test="${newCmSp.status eq 1 || newCmSp.status eq 92}">
  104. <a href="javascript:void(0);" onclick="audit('${newCmSp.serviceProviderID}','${newCmSp.name}', '${newCmSp.contractMobile}', '${hasManager}')">审核</a>
  105. </c:if>
  106. </td>
  107. </shiro:hasPermission>
  108. </tr>
  109. </c:forEach>
  110. </tbody>
  111. </table>
  112. <div class="pagination">${page}</div>
  113. <script>
  114. //审核
  115. function audit(spID, name, mobile, hasManager) {
  116. var html = "<div style='padding:20px;'>" +
  117. "<font color='red'>*</font>联系人:" + "<span>" + name + "</span>" + "</br>" +
  118. "<font color='red'>*</font>手机号:" + "<span>" + mobile + "</span>" + "</br>" +
  119. "</br>" +
  120. "<font color='red'>*</font>职位:" +
  121. "<select name='position' id='position' rows='1' cols='8'>";
  122. if (hasManager == "0") {
  123. html = html + "<option value='1'>协销经理</option>";
  124. }
  125. html = html + "<option value='0'>协销员工</option><select/>" +
  126. "</br>"
  127. +"<font color='red'>*</font>审核:" +
  128. "<select name='auditStatus' id='auditStatus' rows='1' cols='8'>" +
  129. "<option value='1'>通过</option>" +
  130. "<option value='0'>驳回</option><select/>" +
  131. "</br>" +
  132. "<font color='red'>*</font>审核批注:" +
  133. "<textarea name='auditNote' id='auditNote' rows='3' cols='8'/></div>";
  134. var submit = function (v, h, f) {
  135. if (f.auditNote == '') {
  136. $.jBox.tip("请输入审核意见", 'error', {focusId: "title"});
  137. return false;
  138. }
  139. $.post("${ctx}/user/cmSp/auditSp", {'spID': spID,'auditNote':f.auditNote, 'auditStatus': f.auditStatus, 'position': f.position}, function (data) {
  140. if (true == data.success) {
  141. $.jBox.tip(data.msg, 'info');
  142. } else {
  143. $.jBox.tip(data.msg, 'error');
  144. }
  145. $("#searchForm").submit();
  146. }, "JSON");//这里返回的类型有:json,html,xml,text
  147. };
  148. $.jBox(html, {title: "审核 | 协销ID" + spID, submit: submit});
  149. }
  150. // 修改密码
  151. function updatePwd(id) {
  152. var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
  153. var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
  154. "<input type='password' id='newPwd' name='newPwd' rows='1' cols='12'/>" +
  155. "</br><font color='red'>*</font>确认密码:" +
  156. "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
  157. var submit = function (v, h, f) {
  158. // 密码
  159. if (!regPwd.test(f.newPwd)) {
  160. $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
  161. return false;
  162. }
  163. if (f.newPwd !== f.surePwd) {
  164. $.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
  165. return false;
  166. }
  167. $.post("${ctx}/user/cmSp/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
  168. if (true == data.success) {
  169. $.jBox.tip(data.msg, 'info');
  170. } else {
  171. $.jBox.tip(data.msg, 'error');
  172. }
  173. $("#searchForm").submit();
  174. }, "JSON");//这里返回的类型有:json,html,xml,text
  175. };
  176. $.jBox(html, {title: "确定修改密码?", submit: submit});
  177. }
  178. // 发送消息
  179. function sendMsg(id) {
  180. var html = "<div style='padding:20px;'><font color='red'>*</font>标题:" +
  181. "<input id='title' name='title' type='text' rows='1' cols='12'/></br>" +
  182. "<font color='red'>*</font>内容:" +
  183. "<textarea name='content' id='content' rows='5' cols='12'/></div>";
  184. var submit = function (v, h, f) {
  185. if (f.title == '') {
  186. $.jBox.tip("请输入标题", 'error', {focusId: "title"});
  187. return false;
  188. }else if (f.title.length > 20){
  189. $.jBox.tip("标题过长", 'error', {focusId: "content"});
  190. return false;
  191. }else if (f.content == '') {
  192. $.jBox.tip("请输入内容", 'error', {focusId: "content"});
  193. return false;
  194. }else if(f.content.length > 500){
  195. $.jBox.tip("内容过长", 'error', {focusId: "content"});
  196. return false;
  197. }
  198. $.post("${ctx}/user/cmSp/sendMsg", {'title': f.title, 'id': id,'content':f.content}, function (data) {
  199. if (true == data.success) {
  200. $.jBox.tip(data.msg, 'info');
  201. } else {
  202. $.jBox.tip(data.msg, 'error');
  203. }
  204. $("#searchForm").submit();
  205. }, "JSON");//这里返回的类型有:json,html,xml,text
  206. };
  207. $.jBox(html, {title: "确定发送消息吗?", submit: submit});
  208. }
  209. </script>
  210. </body>
  211. </html>