cmAgencyList.jsp 41 KB

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