sso

create_org.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <meta name="keywords" content="酷医,酷医云,酷医聚客,病人关系管理,微信管理平台,肾病科宣,慢病管理云平台,SCRM,SPRM,血透管理,科室品牌推广">
  8. <meta name="description"
  9. content="酷医云,是专为肾科和血透中心研发的免费血透管理平台,覆盖诊前、诊中、诊后全流程管理;为血透中心提供覆盖智能营销管理、血透管理、慢病管理、医患沟通、进销存管理以及商城管理等全流程一体化的管理平台。全国数百家血透中心信赖的选择。">
  10. <title>酷医云-填写机构信息</title>
  11. <link rel="stylesheet" href="/static/css/mobile.css?v=1.0.0">
  12. <link rel="stylesheet" href="/static/css/weui.css" />
  13. <link rel="stylesheet" href="/static/css/weuix.css" />
  14. <script src="/static/js/zepto.min.js"></script>
  15. <script src="/static/js/zepto.weui.js"></script>
  16. <script src="/static/js/picker.city.js"></script>
  17. <script>
  18. var _hmt = _hmt || [];
  19. (function() {
  20. var hm = document.createElement("script");
  21. hm.src = "https://hm.baidu.com/hm.js?7577c975fa7ae685efd61deb009d1b5b";
  22. var s = document.getElementsByTagName("script")[0];
  23. s.parentNode.insertBefore(hm, s);
  24. })();
  25. </script>
  26. </head>
  27. <body>
  28. <div class="tip">请正确填写以下信息,后续可在账号设置中修改</div>
  29. <div class="weui-cells weui-cells_form">
  30. <div class="weui-cell">
  31. <div class="weui-cell__hd">
  32. <label class="weui-label">机构名称</label>
  33. </div>
  34. <div class="weui-cell__bd">
  35. <input id="org_name" class="weui-input">
  36. </div>
  37. </div>
  38. <div class="weui-cell arrow">
  39. <div class="weui-cell__hd">
  40. <label class="weui-label">机构类型</label>
  41. </div>
  42. <div class="weui-cell__bd">
  43. <input class="weui-input" id="org_cat" type="text" value="">
  44. <input id="cat_id" type="hidden" value="0">
  45. </div>
  46. </div>
  47. <div class="weui-cell arrow">
  48. <div class="weui-cell__hd">
  49. <label class="weui-label">机构地址</label>
  50. </div>
  51. <div class="weui-cell__bd">
  52. <input id="city" class="weui-input" type="text" value="">
  53. <input id="province" type="hidden" value="">
  54. <input id="city_n" type="hidden" value="">
  55. <input id="district" type="hidden" value="">
  56. </div>
  57. </div>
  58. <div class="weui-cell">
  59. <div class="weui-cell__hd">
  60. <label class="weui-label">详细地址</label>
  61. </div>
  62. <div class="weui-cell__bd">
  63. <input id="address" class="weui-input">
  64. </div>
  65. </div>
  66. <div class="weui-cell">
  67. <div class="weui-cell__hd">
  68. <label class="weui-label">机构联系人</label>
  69. </div>
  70. <div class="weui-cell__bd">
  71. <input id="contact" class="weui-input">
  72. </div>
  73. </div>
  74. <div class="weui-cell">
  75. <div class="weui-cell__hd">
  76. <label class="weui-label">机构电话</label>
  77. </div>
  78. <div class="weui-cell__bd">
  79. <input id="org_phone" class="weui-input">
  80. </div>
  81. </div>
  82. <!-- 多选 -->
  83. <div class="weui-cell weui-cell-flex">
  84. <div class="weui-cell__hd">
  85. <label class="weui-label">选择启用的应用</label>
  86. </div>
  87. <div class="weui-form">
  88. <div class="weui-form-li iblock">
  89. <input class="weui-form-checkbox" name="appcb" id="app3" value="血透管理" type="checkbox">
  90. <label for="app3">
  91. <i class="weui-icon-checkbox"></i>
  92. <div class="weui-form-text">
  93. <p>血透管理</p>
  94. </div>
  95. </label>
  96. </div>
  97. <div class="weui-form-li iblock">
  98. <input class="weui-form-checkbox" name="appcb" id="app4" value="慢病管理" type="checkbox">
  99. <label for="app4">
  100. <i class="weui-icon-checkbox"></i>
  101. <div class="weui-form-text">
  102. <p>慢病管理</p>
  103. </div>
  104. </label>
  105. </div>
  106. <div class="weui-form-li iblock">
  107. <input class="weui-form-checkbox" name="appcb" id="app1" value="SCRM" type="checkbox">
  108. <label for="app1">
  109. <i class="weui-icon-checkbox"></i>
  110. <div class="weui-form-text">
  111. <p>SCRM</p>
  112. </div>
  113. </label>
  114. </div>
  115. <div class="weui-form-li iblock">
  116. <input class="weui-form-checkbox" name="appcb" id="app5" value="微商城" type="checkbox">
  117. <label for="app5">
  118. <i class="weui-icon-checkbox"></i>
  119. <div class="weui-form-text">
  120. <p>微商城</p>
  121. </div>
  122. </label>
  123. </div>
  124. </div>
  125. </div>
  126. <!-- 按钮 -->
  127. <div class="join">
  128. <button id="submit" class="submit">立即开启智慧管理之旅</button>
  129. </div>
  130. </div>
  131. </body>
  132. <script type="text/javascript">
  133. $(function () {
  134. $("#app3").attr("checked", "checked");
  135. var catsJSON = "{{.categories}}";
  136. var cats = $.parseJSON(catsJSON);
  137. var catOptions = [];
  138. for (let index = 0; index < cats.length; index++) {
  139. catOptions.push(cats[index].name);
  140. }
  141. $("#org_cat").picker({
  142. title: "请选择您的机构类型",
  143. cols: [{
  144. textAlign: 'center',
  145. values: catOptions,
  146. }],
  147. onChange: function (p, v, dv) {
  148. var cat = v[0];
  149. for (let index = 0; index < cats.length; index++) {
  150. const c = cats[index];
  151. if (c.name == cat) {
  152. $("#cat_id").val(c.id);
  153. return;
  154. }
  155. }
  156. $("#cat_id").val("0");
  157. },
  158. });
  159. $("#city").cityPicker({
  160. title: "选择目的地",
  161. onChange: function (picker, codes, city_names) {
  162. $("#province").val(city_names[0]);
  163. $("#city_n").val(city_names[1]);
  164. $("#district").val(city_names[2]);
  165. }
  166. });
  167. $("#submit").click(function() {
  168. var checkErr = checkInfoFull();
  169. if (checkErr.length > 0) {
  170. $.toast(checkErr, "cancel");
  171. return;
  172. }
  173. var open_xt = false;
  174. var open_cdm = false;
  175. var open_scrm = false;
  176. var open_mall = false;
  177. if ($("#app3").prop("checked") == true) {
  178. open_xt = true
  179. }
  180. if ($("#app4").prop("checked") == true) {
  181. open_cdm = true
  182. }
  183. if ($("#app1").prop("checked") == true) {
  184. open_scrm = true
  185. }
  186. if ($("#app5").prop("checked") == true) {
  187. open_mall = true
  188. }
  189. if (!open_xt && !open_cdm && !open_scrm && !open_mall) {
  190. $.toast("请选择要启用的应用", "cancel");
  191. return;
  192. }
  193. var postData = {
  194. name: $("#org_name").val(),
  195. contact_name: $("#contact").val(),
  196. province: $("#province").val(),
  197. city: $("#city_n").val(),
  198. district: $("#district").val(),
  199. address: $("#address").val(),
  200. category: $("#cat_id").val(),
  201. org_phone: $("#org_phone").val(),
  202. open_xt: open_xt,
  203. open_cdm: open_cdm,
  204. open_scrm: open_scrm,
  205. open_mall: open_mall,
  206. }
  207. $.showLoading("加载中");
  208. $.ajax({
  209. url: "/mobile/org/create/submit",
  210. type: "POST",
  211. data: postData,
  212. async: true,
  213. dataType: "json",
  214. headers: {
  215. "X-Xsrftoken": function() {
  216. var xsrf, xsrflist;
  217. xsrf = getCookie("_xsrf");
  218. if (xsrf == null || xsrf == "" || typeof(xsrf) == "undefined") {
  219. return "";
  220. }
  221. xsrflist = xsrf.split("|");
  222. var _xsrf = atob(xsrflist[0]);
  223. return _xsrf;
  224. }()
  225. },
  226. success: function(json) {
  227. $.hideLoading();
  228. if (json.state == 1) {
  229. window.location.href = "/mobile/finish";
  230. } else {
  231. $.toast(json.msg, "cancel");
  232. }
  233. },
  234. error: function() {
  235. $.hideLoading();
  236. $.toast("连接失败,请检查网络", "cancel");
  237. }
  238. });
  239. });
  240. });
  241. function getCookie(name) {
  242. var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
  243. if(arr=document.cookie.match(reg))
  244. return unescape(arr[2]);
  245. else
  246. return null;
  247. }
  248. function checkInfoFull() {
  249. if ($("#org_name").val().length == 0) {
  250. return "请填写机构名称";
  251. }
  252. if ($("#cat_id").val().length == 0 || $("#cat_id").val() == "0") {
  253. return "请选择机构类型";
  254. }
  255. if ($("#city").val().length == 0) {
  256. return "请填写机构地址";
  257. }
  258. if ($("#address").val().length == 0) {
  259. return "请填写详细地址";
  260. }
  261. if ($("#contact").val().length == 0) {
  262. return "请填写联系人姓名";
  263. }
  264. if ($("#org_phone").val().length > 0) {
  265. if (/^(\d{3,4}-?\d{7,8}$)|(1\d{10}$)/.test($("#org_phone").val()) == false) {
  266. return "请填写正确的机构电话";
  267. }
  268. }
  269. return "";
  270. }
  271. </script>
  272. </html>