clubTemporaryForm.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  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. <script src="/static/modules/bulkpurchase/loadAddressById.js"></script>
  8. <script type="text/javascript">
  9. $(document).ready(function () {
  10. $("#inputForm").validate({
  11. ignore: "",
  12. submitHandler: function (form) {
  13. var bindMobile = $("#bindMobile").val();
  14. var userID = $("#userId").val();
  15. var submitFlag = true;
  16. var firstClubType = $('input[name=firstClubType]:checked').val();
  17. var secondClubType = $('input[name=secondClubType]:checked').val();
  18. if ((firstClubType == '1' && secondClubType > 4) || (firstClubType == '2' && secondClubType <= 4)) {
  19. alertx("请选择机构类型");
  20. submitFlag = false;
  21. }
  22. if (submitFlag) {
  23. $.post("${ctx}/new/user/agency/checkMobile?bindMobile="+bindMobile+"&userID="+userID, function (data) {
  24. if (data.code == -1) {
  25. alertx(data.msg);
  26. }else {
  27. loading('正在提交,请稍等...');
  28. form.submit();
  29. }
  30. })
  31. }
  32. },
  33. errorContainer: "#messageBox",
  34. errorPlacement: function (error, element) {
  35. $("#messageBox").text("输入有误,请先更正。");
  36. if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
  37. error.appendTo(element.parent().parent());
  38. } else {
  39. error.insertAfter(element);
  40. }
  41. }
  42. });
  43. });
  44. function checkMobile() {
  45. var bindMobile = $("#bindMobile").val();
  46. var userID = $("#userId").val();
  47. $.post("${ctx}/new/user/agency/checkMobile?bindMobile="+bindMobile+"&userID="+userID, function (data) {
  48. if (data.code == -1) {
  49. alertx(data.msg);
  50. }
  51. })
  52. }
  53. function onlyNumOrLetter(obj) {
  54. var reg = /^[0-9a-zA-Z]+$/;
  55. var str = document.getElementById("socialCreditCode").value;
  56. if (!reg.test(str)) {
  57. alertx("营业执照编号格式不正确");
  58. $("#socialCreditCode").val("");
  59. }
  60. }
  61. /**
  62. * @param obj
  63. * jquery控制input只能输入数字
  64. */
  65. function mobileVerification(obj) {
  66. var reg = /^1\d{10}$/;
  67. var contractMobile = document.getElementById("contractMobile").value;
  68. if (!reg.test(contractMobile)) {
  69. alertx("手机号格式不正确");
  70. $("#contractMobile").val("");
  71. }
  72. }
  73. /**
  74. * @param obj
  75. * jquery控制input只能输入数字
  76. */
  77. function onlynum(obj) {
  78. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  79. }
  80. /**
  81. * @param obj
  82. * jquery控制input只能输入数字和两位小数
  83. */
  84. function num(obj) {
  85. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
  86. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
  87. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
  88. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  89. obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  90. }
  91. function int(obj) {
  92. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  93. }
  94. //设置主营类型
  95. function setTags(opts) {
  96. var tagArr = [];
  97. opts.$mainPro.val('')
  98. opts.$tagArea.find('.new-tag.active').each(function (i, v) {
  99. var _typeName = $(v).attr('data-typeName');
  100. tagArr.push(_typeName);
  101. opts.$mainPro.val(tagArr.join('/'));
  102. })
  103. }
  104. //选择主营内容项目
  105. function getTags(opts) {
  106. opts.$tagArea.on('click', '.new-tag', function () {
  107. var $this = $(this);
  108. $this.toggleClass('active');
  109. setTags(opts);
  110. });
  111. opts.$other.on('click', function () {
  112. opts.$input.css('display', 'inline-block');
  113. opts.$add.css('display', 'inline-block');
  114. });
  115. opts.$add.on('click', function () {
  116. var _tag = $.trim(opts.$input.val());
  117. if (_tag) {
  118. var flag = false;
  119. opts.$tagArea.find('.new-tag').each(function (i, v) {
  120. var _name = $(v).attr('data-typeName');
  121. if (_tag == _name) {
  122. flag = true;
  123. return false;
  124. } else {
  125. if (i == opts.$tagArea.find('.new-tag').length) {
  126. flag = false;
  127. }
  128. }
  129. })
  130. if (flag) {
  131. opts.$tagArea.find('.new-tag').each(function (i, v) {
  132. var _name = $(v).attr('data-typeName');
  133. if (_tag == _name) {
  134. $(v).addClass('active');
  135. layer.tips('该类型已存在', opts.$add);
  136. flag = true;
  137. return false;
  138. }
  139. })
  140. } else {
  141. opts.$tagArea.append('<span class="new-tag up-' + opts.$type + '-tag active" data-typeName="' + _tag + '">' + _tag + '</span> ');
  142. setTags(opts);
  143. opts.$input.val('');
  144. return;
  145. }
  146. }
  147. })
  148. }
  149. $(document).on("change", "#auditStatus", function () {
  150. if ($("#auditStatus").val() == 2) {
  151. $("#auditNopass").show();
  152. } else {
  153. $("#auditNopass").hide();
  154. }
  155. })
  156. // 初始化选中数据
  157. $(function () {
  158. //初始化1
  159. var firstClubType = $('#firstClubType').val();
  160. console.log(firstClubType)
  161. if (firstClubType == '1') {
  162. $('.med-option,.qualification').show();
  163. }
  164. $('.medical-radio div input[name="firstClubType"]').on('click', function () {
  165. var html = '';
  166. var nameval = $(this).val();
  167. if (nameval == '1') {
  168. $('.raw-option').hide();
  169. $('.med-option,.qualification').show();
  170. html += '<span class="new-tag up-club-tag" data-typeName="整形">整形</span>',
  171. html += '<span class="new-tag up-club-tag" data-typeName="轻医美">轻医美</span>',
  172. html += '<span class="new-tag up-club-tag" data-typeName="皮肤科">皮肤科</span>';
  173. $('#clubArea').html(html);
  174. $('.Main-content').show();
  175. } else if (nameval == '2') {
  176. $('.med-option,.qualification,.epart').hide();
  177. $('.raw-option').show();
  178. $('input[name="secondClubType"]').attr('checked', false);
  179. html += '<span class="new-tag up-club-tag" data-typeName="美容">美容</span>',
  180. html += '<span class="new-tag up-club-tag" data-typeName="美体">美体</span>',
  181. html += '<span class="new-tag up-club-tag" data-typeName="美发">美发</span>',
  182. html += '<span class="new-tag up-club-tag" data-typeName="皮肤管理">皮肤管理</span>',
  183. html += '<span class="new-tag up-club-tag" data-typeName="产后修复">产后修复</span>',
  184. html += '<span class="new-tag up-club-tag" data-typeName="光电">光电</span>',
  185. html += '<span class="new-tag up-club-tag" data-typeName="综合类">综合类</span>',
  186. html += '<span class="new-tag up-club-tag" data-typeName="中医养生">中医养生</span>',
  187. html += '<span class="new-tag up-club-tag" data-typeName="spa">spa</span>'
  188. $('#clubArea').html(html);
  189. $('.Main-content').show();
  190. }
  191. });
  192. //初始化2
  193. if (firstClubType == '1') {
  194. var nameval1 = $('input[name="secondClubType"]:checked').val();
  195. if (nameval1 == '1') {
  196. $('.epart').hide()
  197. } else if (nameval1 == '2') {
  198. $('.epart').show()
  199. } else if (nameval1 == '3') {
  200. $('.epart').show()
  201. }
  202. }
  203. //医美二级选择
  204. $('.med-option div input[name="secondClubType"]').on('click', function () {
  205. var nameVal = $(this).val();
  206. if (nameVal == '1') {
  207. $('.epart').hide()
  208. } else if (nameVal == '2') {
  209. $('.epart').show()
  210. } else if (nameVal == '3') {
  211. $('.epart').show()
  212. }
  213. });
  214. //主营项目
  215. var cMainProVal = $('#cMainPro').val();
  216. if (cMainProVal != null && cMainProVal != "") {
  217. var _mainPros = cMainProVal.split('/');
  218. var proList = $('#clubArea').find('.new-tag');
  219. for (var j = 0; j < _mainPros.length; j++) {
  220. var _flag = false;
  221. for (var i = 0; i < proList.length; i++) {
  222. if ($(proList[i]).attr('data-typeName') == _mainPros[j]) {
  223. _flag = true;
  224. }
  225. }
  226. if (_flag) {
  227. for (var i = 0; i < proList.length; i++) {
  228. if ($(proList[i]).attr('data-typeName') == _mainPros[j]) {
  229. $(proList[i]).addClass('active');
  230. }
  231. }
  232. } else {
  233. $('#clubArea').append('<span class="new-tag up-club-tag active" data-typeName="' + _mainPros[j] + '">' + _mainPros[j] + '</span> ');
  234. $('.Main-content').show();
  235. }
  236. }
  237. $('#cMainPro').val(cMainProVal);
  238. }
  239. //机构品项选择
  240. var optsClub = {
  241. $tag: $('.up-club-tag'),
  242. $tagArea: $('#clubArea'),
  243. $mainPro: $('#cMainPro'),
  244. $other: $('#clubOther'),
  245. $input: $('#clubInput'),
  246. $add: $('#clubAdd'),
  247. $type: 'club'
  248. };
  249. getTags(optsClub);
  250. })
  251. </script>
  252. <style>
  253. #auditBox .bd-row {
  254. display: flex;
  255. margin-bottom: 15px;
  256. }
  257. #auditBox .bd-row > span {
  258. display: inline-block;
  259. width: 60px;
  260. }
  261. #auditBox .auditCheckBox {
  262. width: 250px;
  263. }
  264. #auditBox .auditCheckBox label {
  265. margin: 0 5px 5px 0
  266. }
  267. #auditBox .auditCheckBox input {
  268. display: none;
  269. }
  270. #auditBox .auditCheckBox input + span {
  271. display: inline-block;
  272. line-height: 24px;
  273. padding: 0 12px;
  274. border: 1px solid #666;
  275. border-radius: 5px;
  276. }
  277. #auditBox .auditCheckBox input:checked + span {
  278. background-color: #E6633A
  279. }
  280. .detailLine {
  281. width: 98%;
  282. margin-left: 10px;
  283. }
  284. th {
  285. text-align: right;
  286. white-space: nowrap;
  287. }
  288. td {
  289. padding: 5px 0;
  290. }
  291. #headpicPreview li, #businessLicenseImagePreview li {
  292. min-height: 100px;
  293. }
  294. .the-oradio {
  295. display: inline-block;
  296. vertical-align: top;
  297. }
  298. .the-oradio div {
  299. width: 85px;
  300. display: inline-block;
  301. font-size: 12px;
  302. color: #666;
  303. }
  304. .med-option {
  305. display: block;
  306. margin: 10px 0 0 160px;
  307. }
  308. .raw-option {
  309. display: block;
  310. margin: 10px 0 0 160px;
  311. }
  312. .control-group .new-tag {
  313. display: inline-block;
  314. width: 78px;
  315. height: 30px;
  316. border: 1px solid #e5e5e5;
  317. border-radius: 5px;
  318. margin: 7px;
  319. text-align: center;
  320. line-height: 30px;
  321. font-size: 14px;
  322. overflow: hidden;
  323. text-overflow: ellipsis;
  324. white-space: nowrap;
  325. cursor: pointer;
  326. }
  327. .control-group .new-tag.active {
  328. border-color: #e15616;
  329. color: #e15616;
  330. }
  331. #clubArea {
  332. display: inline-block;
  333. width: 450px;
  334. }
  335. #clubOther {
  336. height: 40px;
  337. line-height: 40px;
  338. vertical-align: middle
  339. }
  340. #clubInput {
  341. width: 159px;
  342. margin: 7px;
  343. display: inline-block;
  344. height: 30px;
  345. display: none;
  346. }
  347. .tags-operate {
  348. margin-left: 160px;
  349. }
  350. .control-group .tags-operate .tag-add {
  351. height: 40px;
  352. line-height: 40px;
  353. vertical-align: middle;
  354. display: none;
  355. }
  356. </style>
  357. </head>
  358. <body>
  359. <ul class="nav nav-tabs">
  360. <li><a href="${ctx}/new/user/agency/">机构列表</a></li>
  361. <li><a href="${ctx}/user/clubTemporary/">未确认机构</a></li>
  362. <li class="active"><a href="">未确认机构编辑</a></li>
  363. </ul>
  364. <form:form id="inputForm" modelAttribute="clubTemporary" action="${ctx}/user/clubTemporary/save" method="post" class="form-horizontal">
  365. <form:hidden path="id"/>
  366. <form:hidden path="userId" id="userId"/>
  367. <div style="max-width:1200px;padding:15px;">
  368. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  369. <tr height="28">
  370. <th>状态:</th>
  371. <td colspan="5">未确认</td>
  372. </tr>
  373. <tr height="28">
  374. <th width="12%">机构名称:</th>
  375. <td width="13%"><form:input id="name" path="name" htmlEscape="false" maxlength="20" class="input-medium"/></td>
  376. <th width="12%">机构简称:</th>
  377. <td width="13%"><form:input path="shortName" htmlEscape="false" maxlength="20" class="input-medium"/></td>
  378. <th width="12%">注册邮箱:</th>
  379. <td width="13%"><form:input path="contractEmail" htmlEscape="false" maxlength="20" class="input-medium"/></td>
  380. </tr>
  381. <tr height="28">
  382. <th width="12%"><font color="red">*</font>联系人:</th>
  383. <td width="13%">
  384. <form:input path="linkMan" htmlEscape="false" maxlength="20" class="input-medium required"/>
  385. </td>
  386. <th width="12%"><font color="red">*</font> 手机号:</th>
  387. <td colspan="3"><form:input path="bindMobile" htmlEscape="false" maxlength="20" class="input-medium required" onchange="checkMobile()"/></td>
  388. </tr>
  389. </table>
  390. </div>
  391. <input type="hidden" id="curProvince" name="curProvince" value="${clubTemporary.province }" disabled="disabled">
  392. <input type="hidden" id="curCity" name="curCity" value="${clubTemporary.city }" disabled="disabled">
  393. <input type="hidden" id="curTown" name="curTown" value="${clubTemporary.town }" disabled="disabled">
  394. <sys:message content="${message}"/>
  395. <hr class="detailLine">
  396. <div>
  397. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  398. <tr>
  399. <td colspan="2">
  400. <div class="control-group">
  401. <label class="control-label"><b>地址:</b></label>
  402. <div class="controls">
  403. <form:select path="provinceId" class="input-xlarge" id="province"
  404. onchange="loadCity()" style="width:100px;">
  405. <form:option value="" label="省" provinceId=""/>
  406. </form:select>
  407. <form:select path="cityId" class="input-xlarge" id="city" onchange="loadTown()"
  408. style="width:100px;">
  409. <form:option value="" label="市" cityId=""/>
  410. </form:select>
  411. <form:select path="townId" class="input-xlarge" id="town" style="width:100px;">
  412. <form:option value="" label="区"/>
  413. </form:select>
  414. <form:input path="address" class="input-xlarge userAddress" width="20px" maxlength="60"
  415. placeholder="请填写会所详细的地址"/>
  416. </div>
  417. </div>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td colspan="2">
  422. <div class="control-group">
  423. <label class="control-label"><b>营业执照编号:</b></label>
  424. <div class="controls">
  425. <form:input path="socialCreditCode" htmlEscape="false" maxlength="18"
  426. class="input-xlarge" onchange="onlyNumOrLetter(this)"
  427. placeholder="请填写统一社会信用代码"/>
  428. </div>
  429. </div>
  430. </td>
  431. </tr>
  432. <tr>
  433. <td>
  434. <div class="control-group">
  435. <label class="control-label"><b>营业执照:</b></label>
  436. <div class="controls">
  437. <form:hidden id="businessLicenseImage" path="businessLicense" htmlEscape="false"
  438. maxlength="255" class="input-xlarge required"/>
  439. <sys:ckfinder input="businessLicenseImage" type="images" uploadPath="/photo"
  440. selectMultiple="false" maxWidth="100" maxHeight="100"/>
  441. <font color="red">注意:请上传jpg/png格式的图片,最大不超过5M</font>
  442. </div>
  443. </div>
  444. </td>
  445. <td>
  446. <div class="control-group">
  447. <label class="control-label"><b>门头照:</b></label>
  448. <div class="controls">
  449. <form:hidden id="headpic" path="shopPhoto" htmlEscape="false" maxlength="255"
  450. class="input-xlarge"/>
  451. <sys:ckfinder input="headpic" type="images" uploadPath="/photo" maxWidth="100" maxHeight="100"/>
  452. <font color="red">注意:请上传jpg/png格式的图片,最大不超过5M</font>
  453. </div>
  454. </div>
  455. </td>
  456. </tr>
  457. <tr>
  458. <td>
  459. <div class="control-group">
  460. <label class="control-label" for=""><b>机构类型:</b></label>
  461. <div class="medical-radio the-oradio">
  462. <input value="${clubTemporary.firstClubType}" class="hide" type="text" id="firstClubType"/>
  463. <div class="med-beauty">
  464. <input name="firstClubType" value="1" type="radio" ${clubTemporary.firstClubType == "1" ? "checked" : ""}/>医美
  465. </div>
  466. <div class="raw-beauty">
  467. <input name="firstClubType" value="2" type="radio" ${clubTemporary.firstClubType == "2" ? "checked" : ""}/>生美
  468. </div>
  469. </div>
  470. <span class="err-tip"></span>
  471. <div class="med-option the-oradio" style="display: none">
  472. <div class="med-beauty"><input name="secondClubType" value="1"
  473. type="radio" ${clubTemporary.secondClubType == "1" ? "checked" : ""}/>诊所
  474. </div>
  475. <div class="med-beauty"><input name="secondClubType" value="2"
  476. type="radio" ${clubTemporary.secondClubType == "2" ? "checked" : ""}/>门诊
  477. </div>
  478. <div class="med-beauty"><input name="secondClubType" value="3"
  479. type="radio" ${clubTemporary.secondClubType == "3" ? "checked" : ""}/>医院
  480. </div>
  481. <div class="med-beauty"><input name="secondClubType" value="4"
  482. type="radio" ${cmClubinfo.secondClubType == "4" ? "checked" : ""}/>其他
  483. </div>
  484. <span class="err-tip"></span>
  485. </div>
  486. <div class="raw-option the-oradio" style="display: none">
  487. <div class="med-beauty"><input name="secondClubType" value="5"
  488. type="radio" ${cmClubinfo.secondClubType == "5" ? "checked" : ""}/>美容院
  489. </div>
  490. <div class="med-beauty"><input name="secondClubType" value="6"
  491. type="radio" ${cmClubinfo.secondClubType == "6" ? "checked" : ""}/>养生馆
  492. </div>
  493. <div class="med-beauty"><input name="secondClubType" value="7"
  494. type="radio" ${cmClubinfo.secondClubType == "7" ? "checked" : ""}/>其他
  495. </div>
  496. <span class="err-tip"></span>
  497. </div>
  498. <div class="qualification control-group" style="display: none">
  499. <label class="control-label"><b>资质:</b></label>
  500. <div class="controls" style="margin-bottom: 10px">
  501. <form:hidden id="medicalPracticeLicenseImg" path="medicalPracticeLicense"
  502. htmlEscape="false" maxlength="255"
  503. class="input-xlarge"/>
  504. <sys:ckfinder input="medicalPracticeLicenseImg" type="images" uploadPath="/photo"
  505. maxWidth="100" maxHeight="100"/>
  506. <font color="red">注意:请上传jpg/png格式的图片,最大不超过5M</font>
  507. </div>
  508. </div>
  509. </div>
  510. <div class="control-group epart" style="display: none">
  511. <label class="control-label"><b>科室:</b></label>
  512. <input class="reg-input" type="text" name="department" id="Department"
  513. placeholder="请填写您的所经营的科室,用逗号隔开。(至少三个)" value="${clubTemporary.department}"
  514. style="margin-left: 10px;"/>
  515. <span class="err-tip"></span>
  516. </div>
  517. <div class="control-group Main-content" style="display: none">
  518. <label class="control-label" for=""><b>主营内容:</b></label>
  519. <div class="tags-area" id="clubArea"></div>
  520. <span class="err-tip" style="display: inline-block;margin-left:-55px;"></span>
  521. <input type="hidden" name="mainProduct" value="${clubTemporary.mainProduct}" id="cMainPro">
  522. <div class="tags-operate">
  523. <span class="new-tag tag-other" id="clubOther">其他</span>
  524. <input type="text" class="reg-input tag-input" id="clubInput" placeholder="请输入自定义品项目"
  525. maxlength="5">
  526. <span class="new-tag tag-add" id="clubAdd">确认添加</span>
  527. </div>
  528. </div>
  529. </td>
  530. </tr>
  531. </table>
  532. <div class="form-actions">
  533. <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;&nbsp;&nbsp;
  534. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  535. </div>
  536. </form:form>
  537. </body>
  538. </html>