DoctorList.aspx 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DoctorList.aspx.cs" Inherits="CLIP.eForm.Consent.Dfh.Web.DoctorList" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <title>수술/시술과(의) 선택</title>
  6. <script src="jquery-1.8.3.min.js" type="text/javascript"></script>
  7. <script src="json2.js" type="text/javascript"></script>
  8. <script type="text/javascript">
  9. $(document).ready( function() {
  10. // 진료과 Dropdown list 만들기
  11. makeDeptDropdown("");
  12. // 진료과 Dropdown 클릭 이벤트
  13. $("#dept_dropdown_selected").bind("click", function () {
  14. var list = $(".dept_dropdown_list");
  15. if (list.is(":visible")) {
  16. list.hide();
  17. } else {
  18. list.show();
  19. }
  20. });
  21. });
  22. function deptDropdownInit(deptName){
  23. $("#dept_dropdown_selected").trigger("click");
  24. if(deptName != "" && deptName != undefined && deptName != null){
  25. var list = $(".dept_dropdown_list tr td");
  26. for(var i=0; i<list.length; i++){
  27. var name = list.eq(i).text();
  28. if(deptName == name){
  29. list.eq(i).trigger("click");
  30. }
  31. }
  32. }
  33. };
  34. // 진료과 Dropdown list 만들기
  35. function makeDeptDropdown(data) {
  36. $(".dept_dropdown_list tbody tr").remove();
  37. var colCount = 4;
  38. var depts = data;
  39. if (depts != undefined && depts != null && depts != "") {
  40. var array = $.parseJSON(depts);
  41. var tbody = $(".dept_dropdown_list tbody");
  42. var trs = "";
  43. trs += "<tr>";
  44. if (array[0].DeptListVo.deptcd == "") array.splice(0, 1);
  45. for(var i = 0; i<array.length; i++){
  46. var deptnm = array[i].DeptListVo.deptnm;
  47. var deptcd = array[i].DeptListVo.deptcd;
  48. if(i==0){
  49. $("#dept_name").text(deptnm);
  50. $("#dept_name").val(deptcd);
  51. trs +="<td class='dropdown_selected' attr-data="+deptcd+">";
  52. }else{
  53. trs +="<td class='' attr-data="+deptcd+">";
  54. }
  55. trs += deptnm;
  56. trs +="</td>";
  57. if((i+1) % colCount == 0){
  58. trs += "</tr><tr>";
  59. }
  60. }
  61. trs += "</tr>";
  62. tbody.append(trs);
  63. // 진료과 Dropdown list 클릭 이벤트
  64. $(".dept_dropdown_list td").bind("click", function () {
  65. $(".dept_dropdown_list").hide();
  66. $(".dept_dropdown_list td").removeClass("dropdown_selected");
  67. $(this).addClass("dropdown_selected");
  68. $("#dept_name").text($(this).text());
  69. $("#dept_name").val($(this).attr("attr-data"));
  70. selectDept($("#dept_name").val(), $("#dept_name").text());
  71. });
  72. }else{
  73. //alert("진료과가 없습니다.");
  74. }
  75. if(navigator.userAgent.indexOf("Android") > 0){
  76. $(".dept_dropdown_list tr td").css("font-size", "16px");
  77. }else{
  78. $(".dept_dropdown_list tr td").css("font-size", "14px");
  79. }
  80. var IO_OPdept = $('#IO_OPdept').text();
  81. if (IO_OPdept != undefined && IO_OPdept != null && IO_OPdept != "") {
  82. deptDropdownInit(IO_OPdept);
  83. } else {
  84. deptDropdownInit("");
  85. }
  86. }
  87. </script>
  88. <script type="text/javascript">
  89. function selectRow(obj) {
  90. var resultData = JSON.parse($(obj).attr('attr-ResultData'));
  91. if (resultData != undefined && resultData != null)
  92. {
  93. var osObject = getOsObject();
  94. osObject.SetControlValue('UC_IO_OPdept', resultData.deptNm);
  95. osObject.SetControlValue('UC_IO_OPdr', resultData.doctornm);
  96. osObject.OkClose();
  97. }
  98. }
  99. function getOsObject() {
  100. var strOs = OSCheck();
  101. var result;
  102. if (strOs == "Android") {
  103. result = window.android;
  104. }
  105. else if (strOs == "Windows") {
  106. result = window.external;
  107. }
  108. return result;
  109. }
  110. function OSCheck() {
  111. var playerOS = 'dont know';
  112. if (navigator.userAgent.match(/iPhone|iPad/gi)) {
  113. playerOS = 'iOS';
  114. }
  115. else if (navigator.userAgent.match(/Android/gi)) {
  116. playerOS = 'Android';
  117. }
  118. else if (navigator.userAgent.match(/Windows/gi)) {
  119. playerOS = 'Windows';
  120. }
  121. else if (navigator.userAgent.match(/Linux/gi)) {
  122. playerOS = 'Linux';
  123. }
  124. if (navigator.userAgent.match(/OSX/gi)) {
  125. playerOS = 'Mac OS';
  126. }
  127. return playerOS;
  128. }
  129. function Cancel() {
  130. var osObject = getOsObject();
  131. osObject.CancelClose();
  132. }
  133. </script>
  134. <script type="text/javascript">
  135. function selectRadio(gubun) {
  136. if (gubun == undefined || gubun == null)
  137. {
  138. gubun = get_radio_value(document.getElementsByName("gubun"));
  139. }
  140. $.ajax({
  141. type: "POST",
  142. url: "DoctorList.aspx/SetDeptDropdown",
  143. data: '{"gubun":"' + gubun + '"}',
  144. contentType: "application/json; charset=utf-8",
  145. dataType: "json",
  146. success: function (msg) {
  147. makeDeptDropdown(msg.d);
  148. }
  149. });
  150. }
  151. function get_radio_value(obj) {
  152. if (typeof (obj) == 'undefined') return;
  153. cnt = obj.length;
  154. if (cnt > 1) {
  155. for (i = 0; i < cnt; ++i) {
  156. if (obj[i].checked) return obj[i].value;
  157. }
  158. } else {
  159. if (obj.checked) return obj.value;
  160. }
  161. }
  162. function selectDept(deptCd, deptNm) {
  163. var srchdd = $('#IO_ADdate').text();
  164. $.ajax({
  165. type: "POST",
  166. url: "DoctorList.aspx/SetDoctorList",
  167. data: '{"deptCd":"' + deptCd + '","deptNm":"' + deptNm + '","srchdd":"' + srchdd + '"}',
  168. contentType: "application/json; charset=utf-8",
  169. dataType: "json",
  170. success: function (msg) {
  171. listView(msg.d);
  172. }
  173. });
  174. }
  175. function listView(data) {
  176. var colCount = 4;
  177. $("#dataTbody tr").remove();
  178. if (data == null || data == '') {
  179. var clone = $('#noDataTbodyTemplate').clone();
  180. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  181. return;
  182. }
  183. var resultList = JSON.parse(data);
  184. if (resultList != null && resultList != undefined) {
  185. if (resultList.length > 0) {
  186. for (var i = 0; i < resultList.length; i++) {
  187. var clone = $('#dataTbodyTemplate').clone();
  188. if (resultList[i].doctornm == "전체") i++;
  189. if (i == resultList.length)
  190. {
  191. if (resultList.length == 1) {
  192. var clone = $('#noDataTbodyTemplate').clone();
  193. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  194. }
  195. break;
  196. }
  197. clone.find('.dataTdTemplate1').text(resultList[i].doctornm);
  198. clone.find(".dataTdTemplate1").attr('attr-ResultData', JSON.stringify(resultList[i]));
  199. // 진료의사 클릭 이벤트
  200. clone.find(".dataTdTemplate1").bind("click", function () {
  201. selectRow($(this));
  202. });
  203. i++;
  204. for (var j = 2; j < 6; j++)
  205. {
  206. if (i < resultList.length) {
  207. clone.find('.dataTdTemplate' + j).text(resultList[i].doctornm);
  208. clone.find(".dataTdTemplate" + j).attr('attr-ResultData', JSON.stringify(resultList[i]));
  209. // 진료의사 클릭 이벤트
  210. clone.find(".dataTdTemplate" + j).bind("click", function () {
  211. selectRow($(this));
  212. });
  213. i++;
  214. }
  215. }
  216. i--;
  217. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  218. }
  219. }
  220. }
  221. }
  222. </script>
  223. <style>
  224. .tdCategory {width:20%;}
  225. .tdSelect {width:60%;}
  226. table {border-collapse:collapse; border-spacing:0; empty-cells:show;}
  227. .data_table01 {width:100%;}
  228. table.data_table01{border-top:1px solid #c3c3c3; border-left: 1px solid #c3c3c3; font-family: dotum; font-size: 12px;}
  229. .data_table01 tr th{padding:5px 10px 5px; color:#666; line-height:20px; text-align:left; font-weight:bold; background: #e9e9e9; text-align:center;}
  230. .data_table01 tr td{padding:5px 7px 5px; background: #fff; color:#6d6d6d; line-height:20px; font-weight:bold; cursor:pointer; }
  231. .data_table01 th {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  232. .data_table01 td {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  233. .data_table01 td.center{padding-left:0; padding-right:0; text-align:center;}
  234. /* 진료과 Dropdown CSS */
  235. .dept_dropdown_selected{
  236. text-align: left;
  237. white-space: nowrap;
  238. width: 14em;
  239. padding: .4em 1em;
  240. display: inline-block;
  241. position: relative;
  242. line-height: normal;
  243. margin-right: .1em;
  244. cursor: pointer;
  245. vertical-align: middle;
  246. -webkit-user-select: none;
  247. -moz-user-select: none;
  248. -ms-user-select: none;
  249. user-select: none;
  250. /* Support: IE <= 11 */
  251. overflow: visible;
  252. border: 1px solid #c5c5c5;
  253. background: #f6f6f6;
  254. }
  255. .dept_dropdown_selected .dropdown_icon{
  256. background-position: -65px -16px;
  257. background-image: url(https://code.jquery.com/ui/1.12.1/themes/base/images/ui-icons_777777_256x240.png);
  258. float: right;
  259. margin-top: 0;
  260. width: 16px;
  261. height: 16px;
  262. }
  263. .dept_dropdown_selected .dept_name{
  264. display: block;
  265. margin-right: 20px;
  266. overflow: hidden;
  267. text-overflow: ellipsis;
  268. }
  269. /* 진료과 Dropdown list CSS */
  270. .dept_dropdown_list {border-collapse:separate; border-spacing:5px;}
  271. .dept_dropdown_list tr td {height: 30px;background:#FCDBF2; font-size: 14px;}
  272. .dept_dropdown_list .dropdown_selected {background:#A2D4F1}
  273. .defaultTextFont {font-size: 16px;}
  274. </style>
  275. </head>
  276. <body style="padding:0; margin:10px;">
  277. <form id="form1" runat="server">
  278. <div id="dataDiv">
  279. <table id="dataTable2" class="data_table01">
  280. <tr style="display:none;">
  281. <td class="tdCategory defaultTextFont">
  282. 구분 :
  283. <input type="radio" class="defaultTextFont" name="gubun" value="OP" checked onclick="selectRadio('OP')"/> 수술
  284. <input type="radio" class="defaultTextFont" name="gubun" value="OI" onclick="selectRadio('OI')"/> 시술
  285. </td>
  286. </tr>
  287. <tr>
  288. <td class="tdSelect">
  289. <div id="dept_dropdown">
  290. <span tabindex="0" id="dept_dropdown_selected" class="dept_dropdown_selected defaultTextFont" role="combobox">
  291. <span class="dropdown_icon"></span>
  292. <span id="dept_name" class="dept_name"></span>
  293. </span>
  294. <table class="dept_dropdown_list" summary="진료과를 선택 하세요." style="display: none;">
  295. <caption></caption>
  296. <colgroup>
  297. <col width="25%">
  298. <col width="25%">
  299. <col width="25%">
  300. <col width="25%">
  301. </colgroup>
  302. <tbody>
  303. </tbody>
  304. </table>
  305. </div>
  306. </td>
  307. </tr>
  308. </table>
  309. <br />
  310. <table id="dataTable" class="data_table01">
  311. <colgroup>
  312. <col width="20%" />
  313. <col width="20%" />
  314. <col width="20%" />
  315. <col width="20%" />
  316. <col width="20%" />
  317. </colgroup>
  318. <tr>
  319. <th align="center" colspan="5" class="defaultTextFont">수술/시술의</th>
  320. </tr>
  321. <tbody id="dataTbody">
  322. </tbody>
  323. </table>
  324. <table id="dataTableTemplate" class="data_table01" style="display:none;">
  325. <colgroup>
  326. <col width="20%" />
  327. <col width="20%" />
  328. <col width="20%" />
  329. <col width="20%" />
  330. <col width="20%" />
  331. </colgroup>
  332. <tr>
  333. <th align="center" colspan="5">수술/시술의</th>
  334. </tr>
  335. <tbody id="dataTbodyTemplate">
  336. <tr class="dataTrTemplate">
  337. <td class="dataTdTemplate1 defaultTextFont" align="center"></td>
  338. <td class="dataTdTemplate2 defaultTextFont" align="center"></td>
  339. <td class="dataTdTemplate3 defaultTextFont" align="center"></td>
  340. <td class="dataTdTemplate4 defaultTextFont" align="center"></td>
  341. <td class="dataTdTemplate5 defaultTextFont" align="center"></td>
  342. </tr>
  343. </tbody>
  344. <tbody id="noDataTbodyTemplate">
  345. <tr class="dataTrTemplate">
  346. <td align="center" colspan="5">조회된 데이터가 없습니다.</td>
  347. </tr>
  348. </tbody>
  349. </table>
  350. </div>
  351. </form>
  352. <div id="dis" style="display:none;">
  353. <asp:Label ID="IO_ADdate" runat="server" />
  354. <asp:Label ID="IO_OPdept" runat="server" />
  355. </div>
  356. <script language="C#" runat="server">
  357. protected void Page_Load(Object s, EventArgs e)
  358. {
  359. string IO_ADdate = (string.IsNullOrEmpty(this.Request.Params["IO_ADdate"])) ? DateTime.Now.ToShortDateString() : this.Request.Params["IO_ADdate"];
  360. this.IO_ADdate.Text = (IO_ADdate);
  361. string IO_OPdept = (string.IsNullOrEmpty(this.Request.Params["IO_OPdept"])) ? string.Empty : this.Request.Params["IO_OPdept"];
  362. this.IO_OPdept.Text = (IO_OPdept);
  363. }
  364. </script>
  365. <script>
  366. function loadEnd() {
  367. if (document.getElementById("dataTable") == null || document.getElementById("dataTable") == undefined) {
  368. document.getElementById("dataDiv").innerHTML = "<table class='data_table01'><tr><td height='100' align='center'>조회된 데이터가 없습니다.</td></tr></table>";
  369. }
  370. }
  371. loadEnd();
  372. </script>
  373. <script>
  374. selectRadio(null);
  375. </script>
  376. </body>
  377. </html>