DoctorList.aspx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  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. // 사용자 부서가 리스트 내 있다면 해당 리스트 클릭 이벤트를 수행
  27. for (var i = 0; i < list.length; i++){
  28. var deptValue = list.eq(i).text();
  29. //alert(deptValue + ' == ' + deptName);
  30. //console.log(deptValue + ' == ' + deptName)
  31. if(deptName == deptValue){
  32. list.eq(i).trigger("click");
  33. }
  34. }
  35. }
  36. };
  37. // 진료과 Dropdown list 만들기
  38. function makeDeptDropdown(data) {
  39. //console.log('makeDeptDropdown ' + data);
  40. $(".dept_dropdown_list tbody tr").remove();
  41. var colCount = 4;
  42. var depts = data;
  43. var dept = $('#dept').text();
  44. var deptName = "";
  45. if (depts != undefined && depts != null && depts != "") {
  46. var array = $.parseJSON(depts);
  47. var tbody = $(".dept_dropdown_list tbody");
  48. var trs = "";
  49. trs += "<tr>";
  50. // 전체 속성을 제거 한다
  51. if (array[0].DeptListVo.deptcd == "") array.splice(0, 1);
  52. for(var i = 0; i < array.length; i++){
  53. var deptnm = array[i].DeptListVo.deptnm;
  54. var deptcd = array[i].DeptListVo.deptcd;
  55. var deptAbbr = array[i].DeptListVo.deptAbbr;
  56. if(i==0){
  57. $("#dept_name").text(deptnm);
  58. $("#dept_name").val(deptAbbr);
  59. trs +="<td class='dropdown_selected' value=" + deptAbbr + " attr-data=" + deptcd + ">";
  60. } else {
  61. trs +="<td class='' value=" + deptAbbr + " attr-data=" + deptcd + ">";
  62. }
  63. trs += deptnm;
  64. trs +="</td>";
  65. if((i+1) % colCount == 0){
  66. trs += "</tr><tr>";
  67. }
  68. if (dept == deptAbbr) {
  69. deptName = deptnm;
  70. }
  71. }
  72. trs += "</tr>";
  73. tbody.append(trs);
  74. // 진료과 Dropdown list 클릭 이벤트
  75. $(".dept_dropdown_list td").bind("click", function () {
  76. $(".dept_dropdown_list").hide();
  77. $(".dept_dropdown_list td").removeClass("dropdown_selected");
  78. $(this).addClass("dropdown_selected");
  79. $("#dept_name").text($(this).text());
  80. $("#dept_name").val($(this).attr("attr-data"));
  81. selectDept($("#dept_name").val(), $("#dept_name").text());
  82. });
  83. } else {
  84. //alert("진료과가 없습니다.");
  85. }
  86. if(navigator.userAgent.indexOf("Android") > 0){
  87. $(".dept_dropdown_list tr td").css("font-size", "16px");
  88. }else{
  89. $(".dept_dropdown_list tr td").css("font-size", "14px");
  90. }
  91. //var dept = $('#dept').text();
  92. if (dept != undefined && dept != null && dept != "") {
  93. deptDropdownInit(deptName);
  94. } else {
  95. deptDropdownInit("");
  96. }
  97. }
  98. </script>
  99. <script type="text/javascript">
  100. function selectRow(obj) {
  101. var resultData = JSON.parse($(obj).attr('attr-ResultData'));
  102. if (resultData != undefined && resultData != null) {
  103. var osObject = getOsObject();
  104. var deptValue = $('#dept').text();
  105. var doctorSeq = $('#doctorSeq').text();
  106. // 마취과가 아니라면
  107. if (deptValue != 'AN') {
  108. if (deptValue != 'AN' && doctorSeq == "1") {
  109. // 주치의1, 마취의 1
  110. if (resultData.drKind == "B") {
  111. osObject.SetControlValue('DocRadio1', "Special1");
  112. osObject.SetControlValue('DocSpecial1', resultData.deptNm);
  113. osObject.SetControlValue('DocGeneral1', "");
  114. }
  115. else if(resultData.drKind == "A"){
  116. osObject.SetControlValue('DocRadio1', "General1");
  117. osObject.SetControlValue('DocSpecial1', "");
  118. osObject.SetControlValue('DocGeneral1', resultData.deptNm);
  119. }
  120. osObject.SetControlValue('DoctorNm1', resultData.doctornm);
  121. }
  122. else if (deptValue != 'AN' && doctorSeq == "2") {
  123. // 주치의2, 마취의 2
  124. if (resultData.drKind == "B") {
  125. osObject.SetControlValue('DocRadio2', "Special2");
  126. osObject.SetControlValue('DocSpecial2', resultData.deptNm);
  127. osObject.SetControlValue('DocGeneral2', "");
  128. }
  129. else if(resultData.drKind == "A"){
  130. osObject.SetControlValue('DocRadio2', "General2");
  131. osObject.SetControlValue('DocSpecial2', "");
  132. osObject.SetControlValue('DocGeneral2', resultData.deptNm);
  133. }
  134. osObject.SetControlValue('DoctorNm2', resultData.doctornm);
  135. }
  136. }
  137. /// 마취의
  138. else {
  139. if (doctorSeq == "1") {
  140. // 마취의 1
  141. if (resultData.drKind == "B") {
  142. osObject.SetControlValue('AnstDrRadio1', "Special1");
  143. osObject.SetControlValue('anstDrSpecial1', resultData.deptNm);
  144. osObject.SetControlValue('anstDrGeneral1', "");
  145. }
  146. else if(resultData.drKind == "A"){
  147. osObject.SetControlValue('AnstDrRadio1', "General1");
  148. osObject.SetControlValue('anstDrSpecial1', "");
  149. osObject.SetControlValue('anstDrGeneral1', resultData.deptNm);
  150. }
  151. osObject.SetControlValue('anstDr1Nm', resultData.doctornm);
  152. }
  153. else if (doctorSeq == "2") {
  154. // 마취의 2
  155. if (resultData.drKind == "B") {
  156. osObject.SetControlValue('AnstDrRadio2', "Special2");
  157. osObject.SetControlValue('anstDrSpecial2', resultData.deptNm);
  158. osObject.SetControlValue('anstDrGeneral2', "");
  159. }
  160. else if(resultData.drKind == "A"){
  161. osObject.SetControlValue('AnstDrRadio2', "General2");
  162. osObject.SetControlValue('anstDrSpecial2', "");
  163. osObject.SetControlValue('anstDrGeneral2', resultData.deptNm);
  164. }
  165. osObject.SetControlValue('anstDr2Nm', resultData.doctornm);
  166. }
  167. else if (doctorSeq == "3") {
  168. // 마취의 3
  169. if (resultData.drKind == "B") {
  170. osObject.SetControlValue('AnstDrRadio3', "Special3");
  171. osObject.SetControlValue('anstDrSpecial3', resultData.deptNm);
  172. osObject.SetControlValue('anstDrGeneral3', "");
  173. }
  174. else if(resultData.drKind == "A"){
  175. osObject.SetControlValue('AnstDrRadio3', "General3");
  176. osObject.SetControlValue('anstDrSpecial3', "");
  177. osObject.SetControlValue('anstDrGeneral3', resultData.deptNm);
  178. }
  179. osObject.SetControlValue('anstDr3Nm', resultData.doctornm);
  180. }
  181. else if (doctorSeq == "4") {
  182. // 마취의 4
  183. if (resultData.drKind == "B") {
  184. osObject.SetControlValue('AnstDrRadio4', "Special4");
  185. osObject.SetControlValue('anstDrSpecial4', resultData.deptNm);
  186. osObject.SetControlValue('anstDrGeneral4', "");
  187. }
  188. else if(resultData.drKind == "A"){
  189. osObject.SetControlValue('AnstDrRadio4', "General4");
  190. osObject.SetControlValue('anstDrSpecial4', "");
  191. osObject.SetControlValue('anstDrGeneral4', resultData.deptNm);
  192. }
  193. osObject.SetControlValue('anstDr4Nm', resultData.doctornm);
  194. }
  195. }
  196. var tmp = "T";
  197. osObject.SetPopupResult(tmp);
  198. //osObject.SetPopupResult(msgReturn);
  199. osObject.OkClose();
  200. }
  201. }
  202. function getOsObject() {
  203. var strOs = OSCheck();
  204. var result;
  205. if (strOs == "Android") {
  206. result = window.android;
  207. }
  208. else if (strOs == "Windows") {
  209. result = window.external;
  210. }
  211. return result;
  212. }
  213. function OSCheck() {
  214. var playerOS = 'dont know';
  215. if (navigator.userAgent.match(/iPhone|iPad/gi)) {
  216. playerOS = 'iOS';
  217. }
  218. else if (navigator.userAgent.match(/Android/gi)) {
  219. playerOS = 'Android';
  220. }
  221. else if (navigator.userAgent.match(/Windows/gi)) {
  222. playerOS = 'Windows';
  223. }
  224. else if (navigator.userAgent.match(/Linux/gi)) {
  225. playerOS = 'Linux';
  226. }
  227. if (navigator.userAgent.match(/OSX/gi)) {
  228. playerOS = 'Mac OS';
  229. }
  230. return playerOS;
  231. }
  232. function Cancel() {
  233. var osObject = getOsObject();
  234. osObject.CancelClose();
  235. }
  236. </script>
  237. <script type="text/javascript">
  238. function selectRadio(gubun) {
  239. if (gubun == undefined || gubun == null)
  240. {
  241. gubun = get_radio_value(document.getElementsByName("gubun"));
  242. }
  243. var instcd = $('#instcd').text();
  244. $.ajax({
  245. type: "POST",
  246. url: "DoctorList.aspx/SetDeptDropdown",
  247. data: '{"gubun":"' + gubun + '", "instcd":"' + instcd + '"}',
  248. contentType: "application/json; charset=utf-8",
  249. dataType: "json",
  250. async: false,
  251. success: function (msg) {
  252. //console.log('step 2');
  253. makeDeptDropdown(msg.d);
  254. }
  255. });
  256. }
  257. function get_radio_value(obj) {
  258. if (typeof (obj) == 'undefined') return;
  259. cnt = obj.length;
  260. if (cnt > 1) {
  261. for (i = 0; i < cnt; ++i) {
  262. if (obj[i].checked) return obj[i].value;
  263. }
  264. } else {
  265. if (obj.checked) return obj.value;
  266. }
  267. }
  268. function selectDept(deptCd, deptNm) {
  269. //console.log('selectDept deptCd: ' + deptCd + ', deptNm: ' + deptNm);
  270. var srchdd = $('#clnDt').text();
  271. var dutinstcd = $('#instcd').text();
  272. $.ajax({
  273. type: "POST",
  274. url: "DoctorList.aspx/SetDoctorList",
  275. async: false,
  276. data: '{"deptCd":"' + deptCd + '","deptNm":"' + deptNm + '","srchdd":"' + srchdd + '", "dutinstcd":"' + dutinstcd + '"}',
  277. contentType: "application/json; charset=utf-8",
  278. dataType: "json",
  279. success: function (msg) {
  280. listView(msg.d);
  281. }
  282. });
  283. }
  284. function listView(data) {
  285. var colCount = 4;
  286. $("#dataTbody tr").remove();
  287. if (data == null || data == '') {
  288. var clone = $('#noDataTbodyTemplate').clone();
  289. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  290. return;
  291. }
  292. var resultList = JSON.parse(data);
  293. if (resultList != null && resultList != undefined) {
  294. if (resultList.length > 0) {
  295. for (var i = 0; i < resultList.length; i++) {
  296. var clone = $('#dataTbodyTemplate').clone();
  297. if (resultList[i].doctornm == "전체") i++;
  298. if (i == resultList.length)
  299. {
  300. if (resultList.length == 1) {
  301. var clone = $('#noDataTbodyTemplate').clone();
  302. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  303. }
  304. break;
  305. }
  306. clone.find('.dataTdTemplate1').text(resultList[i].doctornm);
  307. clone.find(".dataTdTemplate1").attr('attr-ResultData', JSON.stringify(resultList[i]));
  308. // 진료의사 클릭 이벤트
  309. clone.find(".dataTdTemplate1").bind("click", function () {
  310. selectRow($(this));
  311. });
  312. i++;
  313. for (var j = 2; j < 6; j++)
  314. {
  315. if (i < resultList.length) {
  316. clone.find('.dataTdTemplate' + j).text(resultList[i].doctornm);
  317. clone.find(".dataTdTemplate" + j).attr('attr-ResultData', JSON.stringify(resultList[i]));
  318. // 진료의사 클릭 이벤트
  319. clone.find(".dataTdTemplate" + j).bind("click", function () {
  320. selectRow($(this));
  321. });
  322. i++;
  323. }
  324. }
  325. i--;
  326. $('#dataTbody').append(clone.find(".dataTrTemplate"));
  327. }
  328. }
  329. }
  330. }
  331. </script>
  332. <style>
  333. .tdCategory {width:20%;}
  334. .tdSelect {width:60%;}
  335. table {border-collapse:collapse; border-spacing:0; empty-cells:show;}
  336. .data_table01 {width:100%;}
  337. table.data_table01{border-top:1px solid #c3c3c3; border-left: 1px solid #c3c3c3; font-family: dotum; font-size: 12px;}
  338. .data_table01 tr th{padding:5px 10px 5px; color:#666; line-height:20px; text-align:left; font-weight:bold; background: #e9e9e9; text-align:center;}
  339. .data_table01 tr td{padding:5px 7px 5px; background: #fff; color:#6d6d6d; line-height:20px; font-weight:bold; cursor:pointer; }
  340. .data_table01 th {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  341. .data_table01 td {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
  342. .data_table01 td.center{padding-left:0; padding-right:0; text-align:center;}
  343. /* 진료과 Dropdown CSS */
  344. .dept_dropdown_selected{
  345. text-align: left;
  346. white-space: nowrap;
  347. width: 14em;
  348. padding: .4em 1em;
  349. display: inline-block;
  350. position: relative;
  351. line-height: normal;
  352. margin-right: .1em;
  353. cursor: pointer;
  354. vertical-align: middle;
  355. -webkit-user-select: none;
  356. -moz-user-select: none;
  357. -ms-user-select: none;
  358. user-select: none;
  359. /* Support: IE <= 11 */
  360. overflow: visible;
  361. border: 1px solid #c5c5c5;
  362. background: #f6f6f6;
  363. }
  364. .dept_dropdown_selected .dropdown_icon{
  365. background-position: -65px -16px;
  366. background-image: url(https://code.jquery.com/ui/1.12.1/themes/base/images/ui-icons_777777_256x240.png);
  367. float: right;
  368. margin-top: 0;
  369. width: 16px;
  370. height: 16px;
  371. }
  372. .dept_dropdown_selected .dept_name{
  373. display: block;
  374. margin-right: 20px;
  375. overflow: hidden;
  376. text-overflow: ellipsis;
  377. }
  378. /* 진료과 Dropdown list CSS */
  379. .dept_dropdown_list {border-collapse:separate; border-spacing:5px;}
  380. .dept_dropdown_list tr td {height: 30px;background:#FCDBF2; font-size: 14px;}
  381. .dept_dropdown_list .dropdown_selected {background:#A2D4F1}
  382. .defaultTextFont {font-size: 16px;}
  383. </style>
  384. </head>
  385. <body style="padding:0; margin:10px;">
  386. <form id="form1" runat="server">
  387. <div id="dataDiv">
  388. <table id="dataTable2" class="data_table01">
  389. <tr style="display:none;">
  390. <td class="tdCategory defaultTextFont">
  391. 구분 :
  392. <input type="radio" class="defaultTextFont" name="gubun" value="OP" checked onclick="selectRadio('OP')"/> 수술
  393. <input type="radio" class="defaultTextFont" name="gubun" value="OI" onclick="selectRadio('OI')"/> 시술
  394. </td>
  395. </tr>
  396. <tr>
  397. <td class="tdSelect">
  398. <div id="dept_dropdown">
  399. <span tabindex="0" id="dept_dropdown_selected" class="dept_dropdown_selected defaultTextFont" role="combobox">
  400. <span class="dropdown_icon"></span>
  401. <span id="dept_name" class="dept_name"></span>
  402. </span>
  403. <table class="dept_dropdown_list" summary="진료과를 선택 하세요." style="display: none;">
  404. <caption></caption>
  405. <colgroup>
  406. <col width="25%"/>
  407. <col width="25%"/>
  408. <col width="25%"/>
  409. <col width="25%"/>
  410. </colgroup>
  411. <tbody>
  412. </tbody>
  413. </table>
  414. </div>
  415. </td>
  416. </tr>
  417. </table>
  418. <br />
  419. <table id="dataTable" class="data_table01">
  420. <colgroup>
  421. <col width="20%" />
  422. <col width="20%" />
  423. <col width="20%" />
  424. <col width="20%" />
  425. <col width="20%" />
  426. </colgroup>
  427. <tr>
  428. <th align="center" colspan="5" class="defaultTextFont">수술/시술의</th>
  429. </tr>
  430. <tbody id="dataTbody">
  431. </tbody>
  432. </table>
  433. <table id="dataTableTemplate" class="data_table01" style="display:none;">
  434. <colgroup>
  435. <col width="20%" />
  436. <col width="20%" />
  437. <col width="20%" />
  438. <col width="20%" />
  439. <col width="20%" />
  440. </colgroup>
  441. <tr>
  442. <th align="center" colspan="5">수술/시술의</th>
  443. </tr>
  444. <tbody id="dataTbodyTemplate">
  445. <tr class="dataTrTemplate">
  446. <td class="dataTdTemplate1 defaultTextFont" align="center"></td>
  447. <td class="dataTdTemplate2 defaultTextFont" align="center"></td>
  448. <td class="dataTdTemplate3 defaultTextFont" align="center"></td>
  449. <td class="dataTdTemplate4 defaultTextFont" align="center"></td>
  450. <td class="dataTdTemplate5 defaultTextFont" align="center"></td>
  451. </tr>
  452. </tbody>
  453. <tbody id="noDataTbodyTemplate">
  454. <tr class="dataTrTemplate">
  455. <td align="center" colspan="5">조회된 데이터가 없습니다.</td>
  456. </tr>
  457. </tbody>
  458. </table>
  459. </div>
  460. </form>
  461. <div id="dis" style="display:none;">
  462. <asp:Label ID="clnDt" runat="server" />
  463. <asp:Label ID="dept" runat="server" />
  464. <asp:Label ID="doctorSeq" runat="server" />
  465. <asp:Label ID="instcd" runat="server" />
  466. </div>
  467. <script language="C#" runat="server">
  468. protected void Page_Load(Object s, EventArgs e) {
  469. string clnDt = (string.IsNullOrEmpty(this.Request.Params["clnDt"])) ? DateTime.Now.ToShortDateString() : this.Request.Params["clnDt"];
  470. this.clnDt.Text = (clnDt);
  471. string dept = (string.IsNullOrEmpty(this.Request.Params["dept"])) ? string.Empty : this.Request.Params["dept"];
  472. this.dept.Text = (dept);
  473. string doctorSeq = (string.IsNullOrEmpty(this.Request.Params["doctorSeq"])) ? string.Empty : this.Request.Params["doctorSeq"];
  474. this.doctorSeq.Text = (doctorSeq);
  475. string instcd = (string.IsNullOrEmpty(this.Request.Params["instcd"])) ? string.Empty : this.Request.Params["instcd"];
  476. this.instcd.Text = (instcd);
  477. }
  478. </script>
  479. <script>
  480. function loadEnd() {
  481. if (document.getElementById("dataTable") == null || document.getElementById("dataTable") == undefined) {
  482. document.getElementById("dataDiv").innerHTML = "<table class='data_table01'><tr><td height='100' align='center'>조회된 데이터가 없습니다.</td></tr></table>";
  483. }
  484. }
  485. loadEnd();
  486. </script>
  487. <script>
  488. selectRadio(null);
  489. </script>
  490. </body>
  491. </html>