DoctorList.aspx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DoctorList.aspx.cs" Inherits="CLIP.eForm.Consent.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. var IO_CtrlPosition= $('#IO_CtrlPosition').text();
  95. if (IO_CtrlPosition == "1") {
  96. // 주치의1, 마취의 1
  97. if (resultData.doctorkind == "전문의") {
  98. osObject.SetControlValue('PST6', resultData.deptNm);
  99. osObject.SetControlValue('PST7', "");
  100. osObject.SetControlValue('PSCSD1', "value1");
  101. osObject.SetControlValue('PSCSD2', "");
  102. }
  103. else {
  104. osObject.SetControlValue('PST6', "");
  105. osObject.SetControlValue('PST7', resultData.deptNm);
  106. osObject.SetControlValue('PSCSD1', "");
  107. osObject.SetControlValue('PSCSD2', "value1");
  108. }
  109. osObject.SetControlValue('PST3', resultData.doctornm);
  110. }
  111. else if (IO_CtrlPosition == "2") {
  112. // 주치의2, 마취의 2
  113. if (resultData.doctorkind == "전문의") {
  114. osObject.SetControlValue('PST8', resultData.deptNm);
  115. osObject.SetControlValue('PST9', "");
  116. osObject.SetControlValue('PSCSD3', "value1");
  117. osObject.SetControlValue('PSCSD4', "");
  118. }
  119. else {
  120. osObject.SetControlValue('PST8', "");
  121. osObject.SetControlValue('PST9', resultData.deptNm);
  122. osObject.SetControlValue('PSCSD3', "");
  123. osObject.SetControlValue('PSCSD4', "value1");
  124. }
  125. osObject.SetControlValue('PST4', resultData.doctornm);
  126. }
  127. else if (IO_CtrlPosition == "3") {
  128. // 주치의3, 마취의 3
  129. if (resultData.doctorkind == "전문의") {
  130. osObject.SetControlValue('PST10', resultData.deptNm);
  131. osObject.SetControlValue('PST11', "");
  132. osObject.SetControlValue('PSCSD5', "value1");
  133. osObject.SetControlValue('PSCSD6', "");
  134. }
  135. else {
  136. osObject.SetControlValue('PST10', "");
  137. osObject.SetControlValue('PST11', resultData.deptNm);
  138. osObject.SetControlValue('PSCSD5', "");
  139. osObject.SetControlValue('PSCSD6', "value1");
  140. }
  141. osObject.SetControlValue('PST5', resultData.doctornm);
  142. }
  143. var tmp = "T";
  144. osObject.SetPopupResult(tmp);
  145. //osObject.SetPopupResult(msgReturn);
  146. osObject.OkClose();
  147. }
  148. }
  149. function getOsObject() {
  150. var strOs = OSCheck();
  151. var result;
  152. if (strOs == "Android") {
  153. result = window.android;
  154. }
  155. else if (strOs == "Windows") {
  156. result = window.external;
  157. }
  158. return result;
  159. }
  160. function OSCheck() {
  161. var playerOS = 'dont know';
  162. if (navigator.userAgent.match(/iPhone|iPad/gi)) {
  163. playerOS = 'iOS';
  164. }
  165. else if (navigator.userAgent.match(/Android/gi)) {
  166. playerOS = 'Android';
  167. }
  168. else if (navigator.userAgent.match(/Windows/gi)) {
  169. playerOS = 'Windows';
  170. }
  171. else if (navigator.userAgent.match(/Linux/gi)) {
  172. playerOS = 'Linux';
  173. }
  174. if (navigator.userAgent.match(/OSX/gi)) {
  175. playerOS = 'Mac OS';
  176. }
  177. return playerOS;
  178. }
  179. function Cancel() {
  180. var osObject = getOsObject();
  181. osObject.CancelClose();
  182. }
  183. </script>
  184. <script type="text/javascript">
  185. function selectRadio(gubun) {
  186. if (gubun == undefined || gubun == null)
  187. {
  188. gubun = get_radio_value(document.getElementsByName("gubun"));
  189. }
  190. var dutinstcd = $('#IO_DutinstcdText').text();
  191. $.ajax({
  192. type: "POST",
  193. url: "DoctorList.aspx/SetDeptDropdown",
  194. data: '{"gubun":"' + gubun + '", "dutinstcd":"' + dutinstcd + '"}',
  195. contentType: "application/json; charset=utf-8",
  196. dataType: "json",
  197. success: function (msg) {
  198. makeDeptDropdown(msg.d);
  199. }
  200. });
  201. }
  202. function get_radio_value(obj) {
  203. if (typeof (obj) == 'undefined') return;
  204. cnt = obj.length;
  205. if (cnt > 1) {
  206. for (i = 0; i < cnt; ++i) {
  207. if (obj[i].checked) return obj[i].value;
  208. }
  209. } else {
  210. if (obj.checked) return obj.value;
  211. }
  212. }
  213. function selectDept(deptCd, deptNm) {
  214. var srchdd = $('#IO_ADdate').text();
  215. var dutinstcd = $('#IO_DutinstcdText').text();
  216. $.ajax({
  217. type: "POST",
  218. url: "DoctorList.aspx/SetDoctorList",
  219. data: '{"deptCd":"' + deptCd + '","deptNm":"' + deptNm + '","srchdd":"' + srchdd + '", "dutinstcd":"' + dutinstcd + '"}',
  220. contentType: "application/json; charset=utf-8",
  221. dataType: "json",
  222. success: function (msg) {
  223. listView(msg.d);
  224. }
  225. });
  226. }
  227. function listView(data) {
  228. var colCount = 4;
  229. $("#dataTbody tr").remove();
  230. if (data == null || data == '') {
  231. var clone = $('#noDataTbodyTemplate').clone();
  232. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  233. return;
  234. }
  235. var resultList = JSON.parse(data);
  236. if (resultList != null && resultList != undefined) {
  237. if (resultList.length > 0) {
  238. for (var i = 0; i < resultList.length; i++) {
  239. var clone = $('#dataTbodyTemplate').clone();
  240. if (resultList[i].doctornm == "전체") i++;
  241. if (i == resultList.length)
  242. {
  243. if (resultList.length == 1) {
  244. var clone = $('#noDataTbodyTemplate').clone();
  245. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  246. }
  247. break;
  248. }
  249. clone.find('.dataTdTemplate1').text(resultList[i].doctornm);
  250. clone.find(".dataTdTemplate1").attr('attr-ResultData', JSON.stringify(resultList[i]));
  251. // 진료의사 클릭 이벤트
  252. clone.find(".dataTdTemplate1").bind("click", function () {
  253. selectRow($(this));
  254. });
  255. i++;
  256. for (var j = 2; j < 6; j++)
  257. {
  258. if (i < resultList.length) {
  259. clone.find('.dataTdTemplate' + j).text(resultList[i].doctornm);
  260. clone.find(".dataTdTemplate" + j).attr('attr-ResultData', JSON.stringify(resultList[i]));
  261. // 진료의사 클릭 이벤트
  262. clone.find(".dataTdTemplate" + j).bind("click", function () {
  263. selectRow($(this));
  264. });
  265. i++;
  266. }
  267. }
  268. i--;
  269. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  270. }
  271. }
  272. }
  273. }
  274. </script>
  275. <style>
  276. .tdCategory {width:20%;}
  277. .tdSelect {width:60%;}
  278. table {border-collapse:collapse; border-spacing:0; empty-cells:show;}
  279. .data_table01 {width:100%;}
  280. table.data_table01{border-top:1px solid #c3c3c3; border-left: 1px solid #c3c3c3; font-family: dotum; font-size: 12px;}
  281. .data_table01 tr th{padding:5px 10px 5px; color:#666; line-height:20px; text-align:left; font-weight:bold; background: #e9e9e9; text-align:center;}
  282. .data_table01 tr td{padding:5px 7px 5px; background: #fff; color:#6d6d6d; line-height:20px; font-weight:bold; cursor:pointer; }
  283. .data_table01 th {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  284. .data_table01 td {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  285. .data_table01 td.center{padding-left:0; padding-right:0; text-align:center;}
  286. /* 진료과 Dropdown CSS */
  287. .dept_dropdown_selected{
  288. text-align: left;
  289. white-space: nowrap;
  290. width: 14em;
  291. padding: .4em 1em;
  292. display: inline-block;
  293. position: relative;
  294. line-height: normal;
  295. margin-right: .1em;
  296. cursor: pointer;
  297. vertical-align: middle;
  298. -webkit-user-select: none;
  299. -moz-user-select: none;
  300. -ms-user-select: none;
  301. user-select: none;
  302. /* Support: IE <= 11 */
  303. overflow: visible;
  304. border: 1px solid #c5c5c5;
  305. background: #f6f6f6;
  306. }
  307. .dept_dropdown_selected .dropdown_icon{
  308. background-position: -65px -16px;
  309. background-image: url(https://code.jquery.com/ui/1.12.1/themes/base/images/ui-icons_777777_256x240.png);
  310. float: right;
  311. margin-top: 0;
  312. width: 16px;
  313. height: 16px;
  314. }
  315. .dept_dropdown_selected .dept_name{
  316. display: block;
  317. margin-right: 20px;
  318. overflow: hidden;
  319. text-overflow: ellipsis;
  320. }
  321. /* 진료과 Dropdown list CSS */
  322. .dept_dropdown_list {border-collapse:separate; border-spacing:5px;}
  323. .dept_dropdown_list tr td {height: 30px;background:#FCDBF2; font-size: 14px;}
  324. .dept_dropdown_list .dropdown_selected {background:#A2D4F1}
  325. .defaultTextFont {font-size: 16px;}
  326. </style>
  327. </head>
  328. <body style="padding:0; margin:10px;">
  329. <form id="form1" runat="server">
  330. <div id="dataDiv">
  331. <table id="dataTable2" class="data_table01">
  332. <tr style="display:none;">
  333. <td class="tdCategory defaultTextFont">
  334. 구분 :
  335. <input type="radio" class="defaultTextFont" name="gubun" value="OP" checked onclick="selectRadio('OP')"/> 수술
  336. <input type="radio" class="defaultTextFont" name="gubun" value="OI" onclick="selectRadio('OI')"/> 시술
  337. </td>
  338. </tr>
  339. <tr>
  340. <td class="tdSelect">
  341. <div id="dept_dropdown">
  342. <span tabindex="0" id="dept_dropdown_selected" class="dept_dropdown_selected defaultTextFont" role="combobox">
  343. <span class="dropdown_icon"></span>
  344. <span id="dept_name" class="dept_name"></span>
  345. </span>
  346. <table class="dept_dropdown_list" summary="진료과를 선택 하세요." style="display: none;">
  347. <caption></caption>
  348. <colgroup>
  349. <col width="25%">
  350. <col width="25%">
  351. <col width="25%">
  352. <col width="25%">
  353. </colgroup>
  354. <tbody>
  355. </tbody>
  356. </table>
  357. </div>
  358. </td>
  359. </tr>
  360. </table>
  361. <br />
  362. <table id="dataTable" class="data_table01">
  363. <colgroup>
  364. <col width="20%" />
  365. <col width="20%" />
  366. <col width="20%" />
  367. <col width="20%" />
  368. <col width="20%" />
  369. </colgroup>
  370. <tr>
  371. <th align="center" colspan="5" class="defaultTextFont">수술/시술의</th>
  372. </tr>
  373. <tbody id="dataTbody">
  374. </tbody>
  375. </table>
  376. <table id="dataTableTemplate" class="data_table01" style="display:none;">
  377. <colgroup>
  378. <col width="20%" />
  379. <col width="20%" />
  380. <col width="20%" />
  381. <col width="20%" />
  382. <col width="20%" />
  383. </colgroup>
  384. <tr>
  385. <th align="center" colspan="5">수술/시술의</th>
  386. </tr>
  387. <tbody id="dataTbodyTemplate">
  388. <tr class="dataTrTemplate">
  389. <td class="dataTdTemplate1 defaultTextFont" align="center"></td>
  390. <td class="dataTdTemplate2 defaultTextFont" align="center"></td>
  391. <td class="dataTdTemplate3 defaultTextFont" align="center"></td>
  392. <td class="dataTdTemplate4 defaultTextFont" align="center"></td>
  393. <td class="dataTdTemplate5 defaultTextFont" align="center"></td>
  394. </tr>
  395. </tbody>
  396. <tbody id="noDataTbodyTemplate">
  397. <tr class="dataTrTemplate">
  398. <td align="center" colspan="5">조회된 데이터가 없습니다.</td>
  399. </tr>
  400. </tbody>
  401. </table>
  402. </div>
  403. </form>
  404. <div id="dis" style="display:none;">
  405. <asp:Label ID="IO_ADdate" runat="server" />
  406. <asp:Label ID="IO_OPdept" runat="server" />
  407. <asp:Label ID="IO_CtrlPosition" runat="server" />
  408. <asp:Label ID="IO_DutinstcdText" runat="server" />
  409. </div>
  410. <script language="C#" runat="server">
  411. protected void Page_Load(Object s, EventArgs e)
  412. {
  413. string IO_ADdate = (string.IsNullOrEmpty(this.Request.Params["IO_ADdate"])) ? DateTime.Now.ToShortDateString() : this.Request.Params["IO_ADdate"];
  414. this.IO_ADdate.Text = (IO_ADdate);
  415. string IO_OPdept = (string.IsNullOrEmpty(this.Request.Params["IO_OPdept"])) ? string.Empty : this.Request.Params["IO_OPdept"];
  416. this.IO_OPdept.Text = (IO_OPdept);
  417. string IO_CtrlPosition = (string.IsNullOrEmpty(this.Request.Params["IO_CtrlPosition"])) ? string.Empty : this.Request.Params["IO_CtrlPosition"];
  418. this.IO_CtrlPosition.Text = (IO_CtrlPosition);
  419. string IO_dutinstcd = (string.IsNullOrEmpty(this.Request.Params["IO_DUTINSTCD"])) ? string.Empty : this.Request.Params["IO_DUTINSTCD"];
  420. this.IO_DutinstcdText.Text = (IO_dutinstcd);
  421. }
  422. </script>
  423. <script>
  424. function loadEnd() {
  425. if (document.getElementById("dataTable") == null || document.getElementById("dataTable") == undefined) {
  426. document.getElementById("dataDiv").innerHTML = "<table class='data_table01'><tr><td height='100' align='center'>조회된 데이터가 없습니다.</td></tr></table>";
  427. }
  428. }
  429. loadEnd();
  430. </script>
  431. <script>
  432. selectRadio(null);
  433. </script>
  434. </body>
  435. </html>