cmAgencyList.jsp 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  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. <style type="text/css">
  8. .reg-row .new-tag.active{border:1px solid #de5801}
  9. .reg-row{margin-bottom:20px}
  10. .reg-row .reg-label{display:inline-block;width:120px;text-align:right;font-size:13px}
  11. .the-oradio{display:inline-block;vertical-align:top}
  12. .the-oradio div{width:85px;display:inline-block;font-size:12px;color:#666}
  13. .the-oradio div input[type="radio"]{width:17px;height:17px;margin-right:5px;vertical-align:text-top}
  14. .med-option{display:block;margin:10px 0 0 125px}
  15. .reg-row .business-license{position:relative;display:inline-block;width:166px;height:123px;border-radius:6px;margin:18px 0 0 125px}
  16. #medicalPracticeLicenseImgPreview{display:inline-block}
  17. .qualification{margin-top:20px}
  18. .reg-row .tags-area{display:inline-block;width:420px}
  19. .reg-row .new-tag{display:inline-block;width:70px;border:1px solid #e5e5e5;border-radius:6px;padding:5px;margin-right:14px;margin-bottom:14px;text-align:center;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
  20. .reg-row .tags-operate{margin-left:125px}
  21. .reg-row .reg-input{width:336px;height:32px;padding:0 8px;margin-right:20px;border:1px solid #dcdcdc;border-radius:6px}
  22. .reg-row .tags-operate .tag-input{width:159px;margin-right:13px;display:none;vertical-align:top}
  23. .reg-row .tags-operate .tag-add{line-height:20px;vertical-align:middle;margin-bottom:0;vertical-align:top}
  24. .reg-row .tags-area{vertical-align:top}
  25. .tag-add{display:none}
  26. .table th{text-align:center}
  27. .table td{text-align:center}
  28. .modal{width:700px;margin-left:-350px}
  29. #myModal{display:none}
  30. .modal-body{max-height:300px !important}
  31. .modal.fade.in{top:0 !important}
  32. #btnSubmit{margin-left:20px}
  33. .flex-wrap .item{margin-right:20px}
  34. #auditBox{padding:20px;line-height:30px}
  35. #auditBox .bd-row{display:flex;margin-bottom:15px}
  36. #auditBox .bd-row > span{display:inline-block;width:60px}
  37. #auditBox .auditCheckBox{width:250px}
  38. #auditBox .auditCheckBox label{margin:0 5px 5px 0}
  39. #auditBox .auditCheckBox input{display:none}
  40. #auditBox .auditCheckBox input + span{display:inline-block;line-height:24px;padding:0 12px;border:1px solid #666;border-radius:5px}
  41. #auditBox .auditCheckBox input:checked + span{background-color:#E6633A}
  42. #alertModal{width:300px;height:200px;border:1px solid #ebebeb;border-radius:10px;position:fixed;top:0;bottom:0;left:0;right:0;margin:auto;background:#FFFFFF;display:none}
  43. #alertModal .title{height:50px;line-height:50px;font-size:14px;font-weight:bold;text-align:center;position:relative;border-bottom:1px solid #EBEBEB}
  44. #alertModal .close{width:50px;height:50px;display:block;position:absolute;right:0;top:0;line-height:50px;color:#000;font-weight:bold;text-align:center;font-style:normal;font-size:18px}
  45. #alertModal .alert-content{width:260px;height:60px;padding:20px}
  46. #alertModal .alertModal-btn{width:260px;height:49px;padding:0 20px;border-top:1px solid #EBEBEB}
  47. #alertModal .alertModal-btn button{float:right;margin:5px}
  48. </style>
  49. </head>
  50. <body>
  51. <ul class="nav nav-tabs">
  52. <li class="active"><a href="${ctx}/new/user/agency/">机构列表</a></li>
  53. <li><a href="${ctx}/user/clubTemporary/">未确认机构</a></li>
  54. </ul>
  55. <form:form id="searchForm" modelAttribute="newCmClub" action="${ctx}/new/user/agency/" method="post"
  56. class="breadcrumb form-search">
  57. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  58. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  59. <div class="flex-wrap">
  60. <div class="item">
  61. <label>机构名称:</label>
  62. <form:input path="searchName" htmlEscape="false" maxlength="50" class="input-medium"/>
  63. </div>
  64. <div class="item">
  65. <label>联系人:</label>
  66. <form:input path="searchUserName" htmlEscape="false" maxlength="50" class="input-medium"/>
  67. </div>
  68. <div class="item">
  69. <label>手机号:</label>
  70. <form:input path="searchBindMobile" htmlEscape="false" maxlength="50" class="input-medium"/>
  71. </div>
  72. <div class="item">
  73. <label>邮箱:</label>
  74. <form:input path="searchEmail" htmlEscape="false" maxlength="50" class="input-medium"/>
  75. </div>
  76. <div class="item">
  77. <label> 状态:</label>
  78. <form:select path="searchStatus" class="input-medium">
  79. <form:option value="" label="请选择"/>
  80. <form:options items="${fns:getDictList('club_status')}" itemLabel="label" itemValue="value"
  81. htmlEscape="false"/>
  82. </form:select>
  83. </div>
  84. <div class="item">
  85. <label>机构类别:</label>
  86. <form:select path="searchUserIdentity" class="input-medium">
  87. <form:option value="" label="请选择"/>
  88. <form:option value="4" label="个人机构"/>
  89. <form:option value="2" label="资质机构"/>
  90. <form:option value="8" label="超级会员"/>
  91. </form:select>
  92. </div>
  93. <div class="item">
  94. <label>注册时间:</label>
  95. <form:input path="searchStartTime" type="text" maxlength="20" class="input-mini Wdate" value="${startTime}"
  96. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  97. -
  98. <form:input path="searchEndTime" type="text" maxlength="20" class="input-mini Wdate" value="${endTime}"
  99. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  100. </div>
  101. <div class="item">
  102. <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  103. </div>
  104. </div>
  105. </form:form>
  106. <sys:message content="${message}"/>
  107. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  108. <thead>
  109. <tr>
  110. <th>机构名称</th>
  111. <th>机构简称</th>
  112. <th>联系人</th>
  113. <th>手机号</th>
  114. <th>邮箱</th>
  115. <th>协销人员</th>
  116. <th>状态</th>
  117. <th>机构类别</th>
  118. <th>注册IP</th>
  119. <th>注册时间</th>
  120. <th>审核时间</th>
  121. <shiro:hasPermission name="user:newCmClub:edit">
  122. <th>操作</th>
  123. </shiro:hasPermission>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. <c:forEach items="${page.list}" var="newCmClubList">
  128. <tr>
  129. <td>
  130. <c:if test="${newCmClubList.userIdentity eq 2}">
  131. ${newCmClubList.name}
  132. </c:if>
  133. <c:if test="${newCmClubList.userIdentity eq 4}">
  134. <c:if test="${newCmClubList.name ne newCmClubList.userName}">
  135. ${newCmClubList.name}
  136. </c:if>
  137. <c:if test="${newCmClubList.name eq newCmClubList.userName}">
  138. --
  139. </c:if>
  140. </c:if>
  141. </td>
  142. <td>
  143. <c:if test="${newCmClubList.userIdentity eq 2}">
  144. ${newCmClubList.sname}
  145. </c:if>
  146. <c:if test="${newCmClubList.userIdentity eq 4}">
  147. <c:if test="${newCmClubList.sname ne newCmClubList.userName}">
  148. ${newCmClubList.sname}
  149. </c:if>
  150. <c:if test="${newCmClubList.sname eq newCmClubList.userName}">
  151. --
  152. </c:if>
  153. </c:if>
  154. </td>
  155. <td>
  156. ${newCmClubList.userName}
  157. </td>
  158. <td>
  159. ${newCmClubList.bindMobile}
  160. </td>
  161. <td>${newCmClubList.email}</td>
  162. <td>
  163. ${newCmClubList.spName}
  164. </td>
  165. <td>
  166. <c:choose>
  167. <c:when test="${newCmClubList.status eq 90}">
  168. <font color="green">已上线</font>
  169. <%--不存在组织的用户为采美用户,只有采美用户才有上线下线功能--%>
  170. <%-- <c:if test="${newCmClubList.userOrganizeID eq null or newCmClubList.userOrganizeID eq 0}">--%>
  171. &nbsp;&nbsp;<a href="${ctx}/new/user/agency/offline?id=${newCmClubList.clubID}&searchName=${newCmClub.searchName}&searchUserName=${newCmClub.searchUserName}&searchBindMobile=${newCmClub.searchBindMobile}&searchEmail=${newCmClub.searchEmail}&searchUserOrganizeID=${newCmClub.searchUserOrganizeID}&searchStatus=${newCmClub.searchStatus}&searchUserIdentity=${newCmClub.searchUserIdentity}&searchStartTime=${newCmClub.searchStartTime}&searchEndTime=${newCmClub.searchEndTime}" onclick="return confirmx('确定下线该会所吗?', this.href)" style="text-decoration:underline;">下线</a>
  172. <%-- </c:if>--%>
  173. </c:when>
  174. <c:when test="${newCmClubList.status eq 91}">
  175. <font color="red">已下线</font>
  176. <%-- <c:if test="${newCmClubList.userOrganizeID eq null or newCmClubList.userOrganizeID eq 0}">--%>
  177. &nbsp;&nbsp;<a href="${ctx}/new/user/agency/online?id=${newCmClubList.clubID}&searchName=${newCmClub.searchName}&searchUserName=${newCmClub.searchUserName}&searchBindMobile=${newCmClub.searchBindMobile}&searchEmail=${newCmClub.searchEmail}&searchUserOrganizeID=${newCmClub.searchUserOrganizeID}&searchStatus=${newCmClub.searchStatus}&searchUserIdentity=${newCmClub.searchUserIdentity}&searchStartTime=${newCmClub.searchStartTime}&searchEndTime=${newCmClub.searchEndTime}" onclick="return confirmx('确定上线该会所吗?', this.href)" style="text-decoration:underline;">上线</a>
  178. <%-- </c:if>--%>
  179. </c:when>
  180. <c:when test="${newCmClubList.status eq 92}">
  181. <a href="JavaScript:;" onclick="return alertx('不通过原因:${newCmClubList.auditNote}')"
  182. style="text-decoration:underline;"><font color="red">审核未通过</font></a>
  183. </c:when>
  184. <c:when test="${newCmClubList.status eq 93}">
  185. <font color="#BF826C">已确认</font>
  186. </c:when>
  187. <c:when test="${newCmClubList.status eq 94}">
  188. <font color="red">已冻结</font>
  189. </c:when>
  190. <c:otherwise>
  191. ${fns:getDictLabel(newCmClubList.status, 'club_status', newCmClubList.status)}
  192. </c:otherwise>
  193. </c:choose>
  194. </td>
  195. <td>
  196. <c:if test="${newCmClubList.userIdentity eq 4}">
  197. 个人机构
  198. </c:if>
  199. <c:if test="${newCmClubList.userIdentity eq 2}">
  200. 资质机构
  201. </c:if>
  202. <c:if test="${newCmClubList.svipUserFlag eq 1}">
  203. <font color="red">(超级会员)</font>
  204. </c:if>
  205. <c:if test="${newCmClubList.userIdentity eq 2 and newCmClubList.svipUserFlag eq 0}">
  206. <font color="red">(普通会员)</font>
  207. </c:if>
  208. </td>
  209. <td>
  210. <c:if test="${newCmClubList.registerIP eq '192.168.1.10'}">
  211. 协销代注册
  212. </c:if>
  213. <c:if test="${newCmClubList.registerIP ne '192.168.1.10'}">
  214. ${newCmClubList.registerIP}
  215. <c:if test="${newCmClubList.source eq '0'}">
  216. (网站)
  217. </c:if>
  218. <c:if test="${newCmClubList.source eq '1'}">
  219. (小程序)
  220. </c:if>
  221. </c:if>
  222. </td>
  223. <td>
  224. <fmt:formatDate value="${newCmClubList.registerTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>
  225. </td>
  226. <td>
  227. ${newCmClubList.auditTime}
  228. </td>
  229. <td>
  230. <shiro:hasPermission name="club:cmAgency:edit">
  231. <a href="${ctx}/new/user/agency/form?id=${newCmClubList.clubID}&source=1&searchName=${newCmClub.searchName}&searchUserName=${newCmClub.searchUserName}&searchBindMobile=${newCmClub.searchBindMobile}&searchEmail=${newCmClub.searchEmail}&searchUserOrganizeID=${newCmClub.searchUserOrganizeID}&searchStatus=${newCmClub.searchStatus}&searchUserIdentity=${newCmClub.searchUserIdentity}&searchStartTime=${newCmClub.searchStartTime}&searchEndTime=${newCmClub.searchEndTime}">编辑</a>
  232. </shiro:hasPermission>
  233. <c:if test="${newCmClubList.status eq 90 || newCmClubList.status eq 91 || newCmClubList.status eq 40}">
  234. <shiro:hasPermission name="club:cmAgency:password">
  235. <a href="javascript:void(0);" onclick="updatePwd(${newCmClubList.userID})">重置密码</a>
  236. </shiro:hasPermission>
  237. </c:if>
  238. <c:if test="${newCmClubList.status eq 90 || newCmClubList.status eq 40 || newCmClubList.status eq 1 || newCmClubList.status eq 92}">
  239. <shiro:hasPermission name="club:cmAgency:changSp">
  240. <a href="javascript:void(0);" onclick="showSPSelect(${newCmClubList.clubID})">更换协销</a>
  241. </shiro:hasPermission>
  242. <shiro:hasPermission name="club:cmAgency:showOp">
  243. <a href="${ctx}/new/user/agency/operation?userOrganizeID=${newCmClubList.userOrganizeID}&clubID=${newCmClubList.clubID}&userID=${newCmClubList.userID}&name=${newCmClubList.name}">查看运营人员</a>
  244. </shiro:hasPermission>
  245. </c:if>
  246. <c:if test="${newCmClubList.status eq 1 || newCmClubList.status eq 92}">
  247. <shiro:hasPermission name="club:cmAgency:audit">
  248. <a href="javascript:void(0);" onclick="toAudit(${newCmClubList.clubID},'${newCmClubList.userName}','${newCmClubList.bindMobile}')">审核</a>
  249. </shiro:hasPermission>
  250. </c:if>
  251. <shiro:hasPermission name="club:cmAgency:category">
  252. <a href="javascript:void(0);" onclick="showClubAlert(${newCmClubList.clubID},${newCmClubList.userIdentity})">设置机构类别</a>
  253. </shiro:hasPermission>
  254. <c:if test="${newCmClubList.status eq 92 || newCmClubList.status eq 93}">
  255. <shiro:hasPermission name="club:cmAgency:conform">
  256. <a href="${ctx}/user/clubTemporary/confirmRecord?confirmUserId=${newCmClubList.userID}">确认记录</a>
  257. </shiro:hasPermission>
  258. </c:if>
  259. <shiro:hasPermission name="club:cmAgency:remarks">
  260. <a href="${ctx}/new/user/agency/remarks?clubId=${newCmClubList.clubID}">客户画像</a>
  261. </shiro:hasPermission>
  262. </td>
  263. </tr>
  264. </c:forEach>
  265. </tbody>
  266. </table>
  267. <div class="pagination">${page}</div>
  268. <!-- 模态框(Modal) -->
  269. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  270. <div class="modal-dialog">
  271. <div class="modal-content">
  272. <div class="modal-header">
  273. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  274. <h4 class="modal-title" id="myModalLabel"></h4>
  275. </div>
  276. <div class="modal-body">
  277. <div class="reg-row">
  278. <label class="reg-label" for=""><span class="require-xin">*</span>会所类型:</label>
  279. <div class="medical-radio the-oradio">
  280. <div class="med-beauty"><input name="firstClubType" value="1" type="radio"/>医美</div>
  281. <div class="raw-beauty"><input name="firstClubType" value="2" type="radio"/>生美</div>
  282. </div>
  283. <span class="err-tip"></span>
  284. <div class="med-option the-oradio" style="display: none">
  285. <div class="med-beauty"><input name="secondClubType" value="1" type="radio"/>诊所</div>
  286. <div class="med-beauty"><input name="secondClubType" value="2" type="radio"/>门诊</div>
  287. <div class="med-beauty"><input name="secondClubType" value="3" type="radio"/>医院</div>
  288. <span class="err-tip"></span>
  289. </div>
  290. <div class="qualification reg-row" style="display: none">
  291. <label class="reg-label" for=""><span class="require-xin">*</span>资质:</label>
  292. <input id="medicalPracticeLicenseImg" name="url" type="hidden" maxlength="255"
  293. class="input-xlarge ">
  294. <sys:ckfinder input="medicalPracticeLicenseImg" type="images"
  295. uploadPath="/medicalPracticeLicenseImg" selectMultiple="false" maxWidth="100"
  296. maxHeight="100"/>
  297. </div>
  298. <div class="epart" style="display: none">
  299. <label class="reg-label">科室:</label>
  300. <input class="reg-input" type="text" name="department" id="Department"
  301. placeholder="请填写您的所经营的科室,用逗号隔开。(至少三个)">
  302. <span class="err-tip"></span>
  303. </div>
  304. </div>
  305. <div class="reg-row Main-content">
  306. <label class="reg-label top-label" for=""><span class="require-xin">*</span>主营内容:</label>
  307. <div class="tags-area" id="clubArea"></div>
  308. <span class="err-tip" style="display: inline-block;margin-left:-55px;"></span>
  309. <input type="hidden" name="mainpro" value="" id="cMainPro">
  310. <div class="tags-operate">
  311. <span class="new-tag tag-other" id="clubOther">其他</span>
  312. <input type="text" class="reg-input tag-input" id="clubInput" placeholder="请输入自定义品项目">
  313. <span class="new-tag tag-add" id="clubAdd">确认添加</span>
  314. </div>
  315. </div>
  316. </div>
  317. <div class="modal-footer">
  318. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  319. <button type="button" class="btn btn-primary" id="confirm">确认</button>
  320. </div>
  321. </div><!-- /.modal-content -->
  322. </div><!-- /.modal -->
  323. </div>
  324. <%--设置机构类别弹窗--%>
  325. <div class="alert-modal" id="alertModal">
  326. <div class="title">
  327. <p>机构类别</p>
  328. <i class="close" id="alertModal-close">X</i>
  329. </div>
  330. <div class="alert-content">
  331. <p>请选择类别</p>
  332. <div class="from-radio">
  333. <input type="radio" value="1" name="clubType">资质机构
  334. <input type="radio" value="2" name="clubType">个人机构
  335. </div>
  336. </div>
  337. <div class="alertModal-btn">
  338. <button type="button" class="btn btn-default" id="close-clubleibie">取消</button>
  339. <button type="button" class="btn btn-primary" id="confirm-clubleibie">确认</button>
  340. </div>
  341. </div>
  342. <script type="text/javascript">
  343. $(document).ready(function () {
  344. //会所品项选择
  345. var opts = {
  346. $tag: $('.up-club-tag'),
  347. $tagArea: $('#clubArea'),
  348. $mainPro: $('#cMainPro'),
  349. $other: $('#clubOther'),
  350. $input: $('#clubInput'),
  351. $add: $('#clubAdd'),
  352. $type: 'club'
  353. }
  354. _util.getTags(opts);
  355. });
  356. function page(n, s) {
  357. $("#pageNo").val(n);
  358. $("#pageSize").val(s);
  359. $("#searchForm").submit();
  360. return false;
  361. }
  362. var _util = {
  363. // 隐藏输入错误提示(参数为提示元素)
  364. hideTip: function ($ele) {
  365. setTimeout(function () {
  366. $ele.hide();
  367. }, 5000);
  368. },
  369. setTags: function (opts) {
  370. var tagArr = [];
  371. opts.$tagArea.find('.new-tag.active').each(function (i, v) {
  372. var _typeName = $(v).attr('data-typeName');
  373. tagArr.push(_typeName);
  374. opts.$mainPro.val(tagArr.join('/'));
  375. })
  376. },
  377. getTags: function (opts) {
  378. opts.$tagArea.on('click', '.new-tag', function () {
  379. $('#cMainPro').val('')
  380. var $this = $(this);
  381. $this.toggleClass('active');
  382. _util.setTags(opts);
  383. })
  384. opts.$other.on('click', function () {
  385. opts.$input.css('display', 'inline-block');
  386. opts.$add.css('display', 'inline-block');
  387. })
  388. opts.$add.on('click', function () {
  389. var _tag = $.trim(opts.$input.val());
  390. if (_tag) {
  391. var flag = false;
  392. opts.$tagArea.find('.new-tag').each(function (i, v) {
  393. var _name = $(v).attr('data-typeName');
  394. if (_tag == _name) {
  395. flag = true;
  396. return false;
  397. } else {
  398. if (i == opts.$tagArea.find('.new-tag').length) {
  399. flag = false;
  400. }
  401. }
  402. })
  403. if (flag) {
  404. opts.$tagArea.find('.new-tag').each(function (i, v) {
  405. var _name = $(v).attr('data-typeName');
  406. if (_tag == _name) {
  407. $(v).addClass('active');
  408. layer.tips('该类型已存在', opts.$add);
  409. flag = true;
  410. return false;
  411. }
  412. })
  413. } else {
  414. opts.$tagArea.append('<span class="new-tag up-' + opts.$type + '-tag active" data-typeName="' + _tag + '">' + _tag + '</span> ');
  415. _util.setTags(opts);
  416. opts.$input.val('');
  417. return;
  418. }
  419. }
  420. })
  421. },
  422. }
  423. </script>
  424. <script>
  425. $(document).ready(function () {
  426. var flag = $('.clubType').attr("data-flag");//设置判断值
  427. //新增会所选择验证
  428. $('.medical-radio div input[name="firstClubType"]').on('click', function () {
  429. console.log($(this))
  430. var html = '';
  431. var nameval = $(this).val();
  432. if (nameval == '1') {
  433. $('.med-option,.qualification').show();
  434. html += '<span class="new-tag up-club-tag" data-typeName="整形">整形</span>',
  435. html += '<span class="new-tag up-club-tag" data-typeName="轻医美">轻医美</span>',
  436. html += '<span class="new-tag up-club-tag" data-typeName="皮肤科">皮肤科</span>';
  437. $('#clubArea').html(html);
  438. $('.Main-content').show();
  439. } else if (nameval == '2') {
  440. $('.med-option,.qualification,.epart').hide();
  441. $('input[name="secondClubType"]').attr('checked', false);
  442. html += '<span class="new-tag up-club-tag" data-typeName="美容">美容</span>',
  443. html += '<span class="new-tag up-club-tag" data-typeName="美体">美体</span>',
  444. html += '<span class="new-tag up-club-tag" data-typeName="美发">美发</span>',
  445. html += '<span class="new-tag up-club-tag" data-typeName="皮肤管理">皮肤管理</span>',
  446. html += '<span class="new-tag up-club-tag" data-typeName="光电">光电</span>',
  447. html += '<span class="new-tag up-club-tag" data-typeName="综合类">综合类</span>',
  448. html += '<span class="new-tag up-club-tag" data-typeName="中医养生">中医养生</span>',
  449. html += '<span class="new-tag up-club-tag" data-typeName="spa">spa</span>'
  450. $('#clubArea').html(html);
  451. $('.Main-content').show();
  452. }
  453. });
  454. //医美二级选择
  455. $('.med-option div input[name="secondClubType"]').on('click', function () {
  456. var nameVal = $(this).val();
  457. if (nameVal == '1') {
  458. $('.epart').hide()
  459. } else if (nameVal == '2') {
  460. $('.epart').show()
  461. } else if (nameVal == '3') {
  462. $('.epart').show()
  463. }
  464. });
  465. $('.clubType').on('click', function () {
  466. $('#confirm').attr('data-id', $(this).attr('data-clubID'))
  467. $('#myModal').modal();
  468. var that = $(this);
  469. var flag = that.attr("data-flag");
  470. $('#confirm').attr('data-flag', flag)
  471. var clubID = that.attr("data-clubID");
  472. if ("0" == flag) {
  473. $("#myModalLabel").html("设置分类");
  474. }
  475. if ("1" == flag) {
  476. $("#myModalLabel").html("修改分类");
  477. var json = JSON.parse($(this).attr('data-value'));
  478. var firstClubType = json["firstClubType"];
  479. var secondClubType = json["secondClubType"];
  480. var medicalPracticeLicenseImg = json["medicalPracticeLicenseImg"];
  481. var department = json["department"];
  482. var mainpro = json["mainpro"];
  483. console.log(firstClubType)
  484. if (firstClubType) {
  485. $('input[name="firstClubType"]').parent('div').eq(firstClubType - 1).find('input').attr("checked", "checked")
  486. $('input[name="firstClubType"]').parent('div').eq(firstClubType - 1).find('input').click();
  487. if (secondClubType) {
  488. $('input[name="secondClubType"]').parent('div').eq(secondClubType - 1).find('input').attr("checked", "checked")
  489. $('input[name="secondClubType"]').parent('div').eq(secondClubType - 1).find('input').click();
  490. }
  491. if (medicalPracticeLicenseImg) {
  492. $('#medicalPracticeLicenseImg').val(medicalPracticeLicenseImg);
  493. $('#medicalPracticeLicenseImgPreview').find('li').html('<img style="max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;" src="' + medicalPracticeLicenseImg + '" />')
  494. }
  495. if (department) {
  496. $('#Department').val(department);
  497. }
  498. if (mainpro) {
  499. var span_ = $('#clubArea').find('span'); // 固定值
  500. var mainpro_ = mainpro.split('/'); // 回显值
  501. var defaultVal = [];
  502. var resArr = [];
  503. var html = '';
  504. $('#clubArea').html('');
  505. for (var i = 0; i < span_.length; i++) {
  506. defaultVal.push(span_[i].textContent);
  507. }
  508. var concatArr = defaultVal.concat(mainpro_);
  509. for (var i = 0; i < concatArr.length; i++) {
  510. if (resArr.indexOf(concatArr[i]) == -1) {
  511. resArr.push(concatArr[i]);
  512. html += '<span class="new-tag up-club-tag ' + concatArr[i] + '" data-typeName="' + concatArr[i] + '">' + concatArr[i] + '</span>';
  513. }
  514. }
  515. $('#clubArea').append(html);
  516. for (var i = 0; i < mainpro_.length; i++) {
  517. $('.' + mainpro_[i]).addClass('active');
  518. $('#cMainPro').val(mainpro)
  519. }
  520. }
  521. }
  522. var secondClubType = json["secondClubType"];
  523. var department = json["department"];
  524. var medicalPracticeLicenseImg = json["medicalPracticeLicenseImg"];
  525. }
  526. });
  527. $('#confirm').on('click', function () {
  528. if (flag == 0) {
  529. //会所类型
  530. if (!$('input[name="firstClubType"]').is(':checked')) {
  531. alertx('请选择会所类型')
  532. _util.hideTip($('.err-tip'));
  533. return false
  534. } else if ($('input[name="firstClubType"]:checked').val() == 1) {
  535. if (!$('input[name="secondClubType"]').is(':checked')) {
  536. alertx('请选择会所类型')
  537. _util.hideTip($('.err-tip'));
  538. return false
  539. }
  540. if ($('#medicalPracticeLicenseImg').val() == '') {
  541. alertx('请上传图片')
  542. return false
  543. }
  544. if ($('input[name="secondClubType"]:checked').val() == 2 || $('input[name="secondClubType"]:checked').val() == 3) {
  545. if ($('#Department').val() == '') {
  546. alertx('请输入科室')
  547. }
  548. } else if ($('input[name="firstClubType"]:checked').val() == 2) {
  549. }
  550. }
  551. } else {
  552. if (!$('input[name="firstClubType"]').is(':checked')) {
  553. $('input[name="firstClubType"]').parents('.medical-radio').next().show().html('请选择会所类型');
  554. _util.hideTip($('.err-tip'));
  555. return false
  556. }
  557. }
  558. if ($('#cMainPro').val() == '') {
  559. alertx('请选择主营内容')
  560. return false
  561. }
  562. var params = {
  563. mainpro: $('#cMainPro').val(),
  564. clubID: $(this).attr('data-id'),
  565. flagC: $(this).attr('data-flag')
  566. }
  567. if ($('input[name="firstClubType"]:checked').val() == 1) {
  568. params.firstClubType = 1;//会所分类
  569. params.secondClubType = $('input[name="secondClubType"]:checked').val();//二级分类
  570. params.medicalPracticeLicenseImg = $('#medicalPracticeLicenseImg').val();//资质
  571. if ($('input[name="secondClubType"]:checked').val() == 2 ||
  572. $('input[name="secondClubType"]:checked').val() == 3) {
  573. params.department = $('#Department').val();//科室
  574. }
  575. } else {
  576. params.firstClubType = 2;//会所分类
  577. }
  578. $.ajax({
  579. type: "post",
  580. url: "${ctx}/new/user/agency/editClubType",
  581. data: params,
  582. success: function (res) {
  583. if (res.errcode == '1') {
  584. alertx(res.errmsg);
  585. }
  586. if (res.errcode == '0') {
  587. console.log(res.data);
  588. window.location.href = res.data;
  589. }
  590. },
  591. error: function (res) {
  592. }
  593. });
  594. })
  595. $(document).on("change", "#auditStatus", function () {
  596. if ($("#auditStatus").val() == 2) {
  597. $("#auditNopass").show();
  598. } else {
  599. $("#auditNopass").hide();
  600. }
  601. })
  602. });
  603. var $ClubAlertContent = $('#alertModal');
  604. var $alertModalClose = $('#alertModal-close');
  605. var $alertModalCloseBtn = $('#close-clubleibie ');
  606. var $alertModalConfirm = $('#confirm-clubleibie ');
  607. //选择机构类别
  608. function showClubAlert(clubID, type) {
  609. if (type == 2) {
  610. $ClubAlertContent.find("input[type=radio][value='1']").attr("checked", true);
  611. } else {
  612. $ClubAlertContent.find("input[type=radio][value='2']").attr("checked", true);
  613. }
  614. $ClubAlertContent.show();
  615. $alertModalClose.click(function () {
  616. closeAlertConten($ClubAlertContent)
  617. })
  618. $alertModalCloseBtn.click(function () {
  619. closeAlertConten($ClubAlertContent)
  620. })
  621. $alertModalConfirm.click(function () {
  622. var $Value = $ClubAlertContent.find("input[name='clubType']:checked").val();
  623. $.post("${ctx}/new/user/agency/upgradeClub", {'id': clubID, 'type': $Value}, function (data) {
  624. console.log(data)
  625. if (true == data.success) {
  626. console.log(data.success)
  627. closeAlertConten($ClubAlertContent);
  628. window.location.reload();
  629. } else {
  630. alertx(data.msg);
  631. }
  632. }, "JSON");//这里返回的类型有:json,html,xml,text
  633. });
  634. }
  635. function closeAlertConten(obj) {
  636. obj.hide();
  637. }
  638. //更换协销
  639. function showSPSelect(clubID) {
  640. top.$.jBox("iframe:${ctx}/user/cmSp/showSelectSP", {
  641. iframeScrolling: 'no',
  642. width: 1000,
  643. height: 550,
  644. persistent: true,
  645. showScrolling: false,
  646. title: "选择协销",
  647. bottomText: '请从可供选择的项目中选择一个',
  648. buttons: {"确定": '1', "关闭": '-1'},
  649. submit: function (v, h, f) {
  650. //确定
  651. var $jboxFrame = top.$('#jbox-iframe');
  652. var $mainFrame = top.$('#mainFrame');
  653. if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
  654. var spID = $jboxFrame[0].contentWindow.getCheckedItems();
  655. console.log(spID);
  656. if ("" != spID && null != spID) {
  657. setSPSelect(spID, clubID);
  658. return true;
  659. } else {
  660. top.$.jBox.tip("请选择...");
  661. return false;
  662. }
  663. }
  664. return true;
  665. }
  666. });
  667. }
  668. function setSPSelect(spID, clubID) {
  669. console.log(spID + "=====" + clubID);
  670. $.post("${ctx}/new/user/agency/changeSp", {'spID': spID, 'clubID': clubID}, function (data) {
  671. if (true == data.success) {
  672. closeP();
  673. } else {
  674. alertx(data.msg);
  675. }
  676. }, "JSON");//这里返回的类型有:json,html,xml,text
  677. }
  678. function closeP() {
  679. var msg = '提交成功,请去“协销审核”页面进行审核';
  680. top.$.jBox.confirm(msg, '提示', function (v, h, f) {
  681. if (v == true) {
  682. window.location.href = "${ctx}/new/user/cmSp/clubChangeSp";
  683. return true;
  684. }
  685. window.location.href = "${ctx}/new/user/agency/";
  686. return true;
  687. }, {buttons: {'去审核': true, '取消': false}});
  688. }
  689. // 修改密码
  690. function updatePwd(id) {
  691. var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
  692. var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
  693. "<input type='password' id='newPwd' name='newPwd' rows='1' cols='12'/>" +
  694. "</br><font color='red'>*</font>确认密码:" +
  695. "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
  696. var submit = function (v, h, f) {
  697. // 密码
  698. if (!regPwd.test(f.newPwd)) {
  699. $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
  700. return false;
  701. }
  702. if (f.newPwd !== f.surePwd) {
  703. $.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
  704. return false;
  705. }
  706. $.post("${ctx}/new/user/agency/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
  707. if (true == data.success) {
  708. $.jBox.tip(data.msg, 'info');
  709. $("#searchForm").submit();
  710. } else {
  711. $.jBox.tip(data.msg, 'error');
  712. }
  713. }, "JSON");//这里返回的类型有:json,html,xml,text
  714. };
  715. $.jBox(html, {title: "确定修改密码?", submit: submit});
  716. }
  717. function toAudit(id,userName,bindMobile) {
  718. if(null == bindMobile || "" == bindMobile){
  719. alertx("手机号尚未填写,请先编辑手机号再进行审核");
  720. return;
  721. }
  722. if(null == userName || "" == userName){
  723. alertx("联系人尚未尚未填写,请先编辑联系人再进行审核");
  724. return;
  725. }
  726. var html = "<div id='auditBox'>"
  727. + " <div class='bd-row'>"
  728. + " <span><font color='red'>*</font>审核:</span>"
  729. + " <select name='auditStatus' id='auditStatus'>"
  730. + " <option value='1'>审核通过</option>"
  731. + " <option value='2'>审核未通过</option>"
  732. + " <select/>"
  733. + " </div>"
  734. + " <div id='auditNopass' style='display: none;'>"
  735. + " <div class='bd-row'>"
  736. + " <span><font color='red'>*</font>原因:</span>"
  737. + " <div class='auditCheckBox'>"
  738. + " <label><input name='auditCheckBox' type='checkbox' value='图片模糊'><span>图片模糊</span></label>"
  739. + " <label><input name='auditCheckBox' type='checkbox' value='营业执照错误'><span>营业执照错误</span></label>"
  740. + " <label><input name='auditCheckBox' type='checkbox' value='详细信息不全'><span>详细信息不全</span></label>"
  741. + " <label><input name='auditCheckBox' type='checkbox' value='机构名称敏感'><span>机构名称敏感</span></label>"
  742. + " <label><input name='auditCheckBox' type='checkbox' value='不符合平台要求'><span>不符合平台要求</span></label>"
  743. + " </div>"
  744. + " </div>"
  745. + " <div class='bd-row'>"
  746. + " <span></span>"
  747. + " <div>"
  748. + " <textarea name='auditNote'></textarea>"
  749. + " <p class='err-tip' style='display:none;margin-left:-55px;color:red;'>请选择审核未通过的原因</p>"
  750. + " </div>"
  751. + " </div>"
  752. + " </div>"
  753. + "</div>";
  754. var submit = function (v, h, f) {
  755. if (f.auditStatus == '') {
  756. $.jBox.tip("请选择状态", 'error', {focusId: "auditStatus"});
  757. return false;
  758. } else if (f.auditStatus == 2 && f.auditNote == '' && !f.auditCheckBox) {
  759. $.jBox.tip("请选择审核未通过的原因", 'error', {focusId: "auditNote"});
  760. return false;
  761. } else if (f.auditStatus == 2 && f.auditNote.length > 100) {
  762. $.jBox.tip("内容过长", 'error', {focusId: "auditNote"});
  763. return false;
  764. }
  765. var auditText = f.auditCheckBox ? (f.auditCheckBox.toString() + ',' + f.auditNote) : f.auditNote;
  766. $.post("${ctx}/new/user/agency/auditClub", {
  767. 'auditStatus': f.auditStatus,
  768. 'id': id,
  769. 'auditNote': auditText
  770. }, function (data) {
  771. if (true == data.success) {
  772. $.jBox.tip(data.msg, 'info');
  773. // $("#searchForm").submit();
  774. window.location.href = "${ctx}/new/user/agency/";
  775. } else {
  776. $.jBox.tip(data.msg, 'error');
  777. }
  778. }, "JSON");//这里返回的类型有:json,html,xml,text
  779. };
  780. $.jBox(html, {title: "审核", submit: submit});
  781. }
  782. </script>
  783. </body>
  784. </html>