123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530 |
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DoctorList.aspx.cs" Inherits="CLIP.eForm.Consent.Web.DoctorList" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>수술/시술과(의) 선택</title>
- <script src="jquery-1.8.3.min.js" type="text/javascript"></script>
- <script src="json2.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- // 진료과 Dropdown list 만들기
- //makeDeptDropdown("");
- // 진료과 Dropdown 클릭 이벤트
- $("#dept_dropdown_selected").bind("click", function () {
- var list = $(".dept_dropdown_list");
-
- if (list.is(":visible")) {
- list.hide();
- } else {
- list.show();
- }
- });
- });
- function deptDropdownInit(deptName) {
- $("#dept_dropdown_selected").trigger("click");
- if(deptName != "" && deptName != undefined && deptName != null){
- var list = $(".dept_dropdown_list tr td");
- // 사용자 부서가 리스트 내 있다면 해당 리스트 클릭 이벤트를 수행
- for (var i = 0; i < list.length; i++){
- var deptValue = list.eq(i).text();
- //alert(deptValue + ' == ' + deptName);
- //console.log(deptValue + ' == ' + deptName)
- if(deptName == deptValue){
- list.eq(i).trigger("click");
- }
- }
- }
- };
- // 진료과 Dropdown list 만들기
- function makeDeptDropdown(data) {
- //console.log('makeDeptDropdown ' + data);
- $(".dept_dropdown_list tbody tr").remove();
- var colCount = 4;
- var depts = data;
- var dept = $('#dept').text();
- var deptName = "";
- if (depts != undefined && depts != null && depts != "") {
- var array = $.parseJSON(depts);
- var tbody = $(".dept_dropdown_list tbody");
- var trs = "";
- trs += "<tr>";
- // 전체 속성을 제거 한다
- if (array[0].DeptListVo.deptcd == "") array.splice(0, 1);
-
- for(var i = 0; i < array.length; i++){
- var deptnm = array[i].DeptListVo.deptnm;
- var deptcd = array[i].DeptListVo.deptcd;
- var deptAbbr = array[i].DeptListVo.deptAbbr;
- if(i==0){
- $("#dept_name").text(deptnm);
- $("#dept_name").val(deptAbbr);
- trs +="<td class='dropdown_selected' value=" + deptAbbr + " attr-data=" + deptcd + ">";
- } else {
- trs +="<td class='' value=" + deptAbbr + " attr-data=" + deptcd + ">";
- }
- trs += deptnm;
- trs +="</td>";
- if((i+1) % colCount == 0){
- trs += "</tr><tr>";
- }
- if (dept == deptAbbr) {
- deptName = deptnm;
- }
- }
- trs += "</tr>";
- tbody.append(trs);
- // 진료과 Dropdown list 클릭 이벤트
- $(".dept_dropdown_list td").bind("click", function () {
- $(".dept_dropdown_list").hide();
- $(".dept_dropdown_list td").removeClass("dropdown_selected");
- $(this).addClass("dropdown_selected");
- $("#dept_name").text($(this).text());
- $("#dept_name").val($(this).attr("attr-data"));
- selectDept($("#dept_name").val(), $("#dept_name").text());
- });
- } else {
- //alert("진료과가 없습니다.");
- }
- if(navigator.userAgent.indexOf("Android") > 0){
- $(".dept_dropdown_list tr td").css("font-size", "16px");
- }else{
- $(".dept_dropdown_list tr td").css("font-size", "14px");
- }
- //var dept = $('#dept').text();
-
- if (dept != undefined && dept != null && dept != "") {
- deptDropdownInit(deptName);
- } else {
- deptDropdownInit("");
- }
- }
- </script>
- <script type="text/javascript">
- function selectRow(obj) {
- var resultData = JSON.parse($(obj).attr('attr-ResultData'));
- if (resultData != undefined && resultData != null) {
- var osObject = getOsObject();
- var deptValue = $('#dept').text();
- var doctorSeq = $('#doctorSeq').text();
- // 마취과가 아니라면
- if (deptValue != 'AN') {
- if (deptValue != 'AN' && doctorSeq == "1") {
- // 주치의1, 마취의 1
- if (resultData.drKind == "B") {
- osObject.SetControlValue('DocRadio1', "Special1");
- osObject.SetControlValue('DocSpecial1', resultData.deptNm);
- osObject.SetControlValue('DocGeneral1', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('DocRadio1', "General1");
- osObject.SetControlValue('DocSpecial1', "");
- osObject.SetControlValue('DocGeneral1', resultData.deptNm);
- }
- osObject.SetControlValue('DoctorNm1', resultData.doctornm);
- }
- else if (deptValue != 'AN' && doctorSeq == "2") {
- // 주치의2, 마취의 2
- if (resultData.drKind == "B") {
- osObject.SetControlValue('DocRadio2', "Special2");
- osObject.SetControlValue('DocSpecial2', resultData.deptNm);
- osObject.SetControlValue('DocGeneral2', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('DocRadio2', "General2");
- osObject.SetControlValue('DocSpecial2', "");
- osObject.SetControlValue('DocGeneral2', resultData.deptNm);
- }
- osObject.SetControlValue('DoctorNm2', resultData.doctornm);
- }
- }
- /// 마취의
- else {
- if (doctorSeq == "1") {
- // 마취의 1
- if (resultData.drKind == "B") {
- osObject.SetControlValue('AnstDrRadio1', "Special1");
- osObject.SetControlValue('anstDrSpecial1', resultData.deptNm);
- osObject.SetControlValue('anstDrGeneral1', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('AnstDrRadio1', "General1");
- osObject.SetControlValue('anstDrSpecial1', "");
- osObject.SetControlValue('anstDrGeneral1', resultData.deptNm);
- }
- osObject.SetControlValue('anstDr1Nm', resultData.doctornm);
- }
- else if (doctorSeq == "2") {
- // 마취의 2
- if (resultData.drKind == "B") {
- osObject.SetControlValue('AnstDrRadio2', "Special2");
- osObject.SetControlValue('anstDrSpecial2', resultData.deptNm);
- osObject.SetControlValue('anstDrGeneral2', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('AnstDrRadio2', "General2");
- osObject.SetControlValue('anstDrSpecial2', "");
- osObject.SetControlValue('anstDrGeneral2', resultData.deptNm);
- }
- osObject.SetControlValue('anstDr2Nm', resultData.doctornm);
- }
- else if (doctorSeq == "3") {
- // 마취의 3
- if (resultData.drKind == "B") {
- osObject.SetControlValue('AnstDrRadio3', "Special3");
- osObject.SetControlValue('anstDrSpecial3', resultData.deptNm);
- osObject.SetControlValue('anstDrGeneral3', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('AnstDrRadio3', "General3");
- osObject.SetControlValue('anstDrSpecial3', "");
- osObject.SetControlValue('anstDrGeneral3', resultData.deptNm);
- }
- osObject.SetControlValue('anstDr3Nm', resultData.doctornm);
- }
- else if (doctorSeq == "4") {
- // 마취의 4
- if (resultData.drKind == "B") {
- osObject.SetControlValue('AnstDrRadio4', "Special4");
- osObject.SetControlValue('anstDrSpecial4', resultData.deptNm);
- osObject.SetControlValue('anstDrGeneral4', "");
- }
- else if(resultData.drKind == "A"){
- osObject.SetControlValue('AnstDrRadio4', "General4");
- osObject.SetControlValue('anstDrSpecial4', "");
- osObject.SetControlValue('anstDrGeneral4', resultData.deptNm);
- }
- osObject.SetControlValue('anstDr4Nm', resultData.doctornm);
- }
- }
-
- var tmp = "T";
- osObject.SetPopupResult(tmp);
- //osObject.SetPopupResult(msgReturn);
- osObject.OkClose();
- }
- }
- function getOsObject() {
- var strOs = OSCheck();
- var result;
- if (strOs == "Android") {
- result = window.android;
- }
- else if (strOs == "Windows") {
- result = window.external;
- }
- return result;
- }
- function OSCheck() {
- var playerOS = 'dont know';
- if (navigator.userAgent.match(/iPhone|iPad/gi)) {
- playerOS = 'iOS';
- }
- else if (navigator.userAgent.match(/Android/gi)) {
- playerOS = 'Android';
- }
- else if (navigator.userAgent.match(/Windows/gi)) {
- playerOS = 'Windows';
- }
- else if (navigator.userAgent.match(/Linux/gi)) {
- playerOS = 'Linux';
- }
- if (navigator.userAgent.match(/OSX/gi)) {
- playerOS = 'Mac OS';
- }
- return playerOS;
- }
- function Cancel() {
- var osObject = getOsObject();
- osObject.CancelClose();
- }
- </script>
- <script type="text/javascript">
- function selectRadio(gubun) {
- if (gubun == undefined || gubun == null)
- {
- gubun = get_radio_value(document.getElementsByName("gubun"));
- }
- var instcd = $('#instcd').text();
-
- $.ajax({
- type: "POST",
- url: "DoctorList.aspx/SetDeptDropdown",
- data: '{"gubun":"' + gubun + '", "instcd":"' + instcd + '"}',
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- async: false,
- success: function (msg) {
- //console.log('step 2');
- makeDeptDropdown(msg.d);
- }
- });
- }
- function get_radio_value(obj) {
- if (typeof (obj) == 'undefined') return;
- cnt = obj.length;
- if (cnt > 1) {
- for (i = 0; i < cnt; ++i) {
- if (obj[i].checked) return obj[i].value;
- }
- } else {
- if (obj.checked) return obj.value;
- }
- }
- function selectDept(deptCd, deptNm) {
- //console.log('selectDept deptCd: ' + deptCd + ', deptNm: ' + deptNm);
- var srchdd = $('#clnDt').text();
- var dutinstcd = $('#instcd').text();
- $.ajax({
- type: "POST",
- url: "DoctorList.aspx/SetDoctorList",
- async: false,
- data: '{"deptCd":"' + deptCd + '","deptNm":"' + deptNm + '","srchdd":"' + srchdd + '", "dutinstcd":"' + dutinstcd + '"}',
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (msg) {
- listView(msg.d);
- }
- });
- }
- function listView(data) {
- var colCount = 4;
- $("#dataTbody tr").remove();
- if (data == null || data == '') {
- var clone = $('#noDataTbodyTemplate').clone();
- $('#dataTbody').append(clone.find(".dataTrTemplate"));
- return;
- }
- var resultList = JSON.parse(data);
- if (resultList != null && resultList != undefined) {
- if (resultList.length > 0) {
- for (var i = 0; i < resultList.length; i++) {
- var clone = $('#dataTbodyTemplate').clone();
- if (resultList[i].doctornm == "전체") i++;
- if (i == resultList.length)
- {
- if (resultList.length == 1) {
- var clone = $('#noDataTbodyTemplate').clone();
- $('#dataTbody').append(clone.find(".dataTrTemplate"));
- }
- break;
- }
- clone.find('.dataTdTemplate1').text(resultList[i].doctornm);
- clone.find(".dataTdTemplate1").attr('attr-ResultData', JSON.stringify(resultList[i]));
- // 진료의사 클릭 이벤트
- clone.find(".dataTdTemplate1").bind("click", function () {
- selectRow($(this));
- });
- i++;
- for (var j = 2; j < 6; j++)
- {
- if (i < resultList.length) {
- clone.find('.dataTdTemplate' + j).text(resultList[i].doctornm);
- clone.find(".dataTdTemplate" + j).attr('attr-ResultData', JSON.stringify(resultList[i]));
- // 진료의사 클릭 이벤트
- clone.find(".dataTdTemplate" + j).bind("click", function () {
- selectRow($(this));
- });
- i++;
- }
- }
- i--;
- $('#dataTbody').append(clone.find(".dataTrTemplate"));
- }
- }
- }
- }
- </script>
- <style>
- .tdCategory {width:20%;}
- .tdSelect {width:60%;}
- table {border-collapse:collapse; border-spacing:0; empty-cells:show;}
- .data_table01 {width:100%;}
- table.data_table01{border-top:1px solid #c3c3c3; border-left: 1px solid #c3c3c3; font-family: dotum; font-size: 12px;}
- .data_table01 tr th{padding:5px 10px 5px; color:#666; line-height:20px; text-align:left; font-weight:bold; background: #e9e9e9; text-align:center;}
- .data_table01 tr td{padding:5px 7px 5px; background: #fff; color:#6d6d6d; line-height:20px; font-weight:bold; cursor:pointer; }
- .data_table01 th {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
- .data_table01 td {border-bottom: 1px solid #c3c3c3; border-right: 1px solid #c3c3c3;}
- .data_table01 td.center{padding-left:0; padding-right:0; text-align:center;}
-
- /* 진료과 Dropdown CSS */
- .dept_dropdown_selected{
- text-align: left;
- white-space: nowrap;
- width: 14em;
- padding: .4em 1em;
- display: inline-block;
- position: relative;
- line-height: normal;
- margin-right: .1em;
- cursor: pointer;
- vertical-align: middle;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-
- /* Support: IE <= 11 */
- overflow: visible;
- border: 1px solid #c5c5c5;
- background: #f6f6f6;
- }
- .dept_dropdown_selected .dropdown_icon{
- background-position: -65px -16px;
- background-image: url(https://code.jquery.com/ui/1.12.1/themes/base/images/ui-icons_777777_256x240.png);
- float: right;
- margin-top: 0;
- width: 16px;
- height: 16px;
- }
- .dept_dropdown_selected .dept_name{
- display: block;
- margin-right: 20px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- /* 진료과 Dropdown list CSS */
- .dept_dropdown_list {border-collapse:separate; border-spacing:5px;}
- .dept_dropdown_list tr td {height: 30px;background:#FCDBF2; font-size: 14px;}
- .dept_dropdown_list .dropdown_selected {background:#A2D4F1}
- .defaultTextFont {font-size: 16px;}
- </style>
- </head>
- <body style="padding:0; margin:10px;">
- <form id="form1" runat="server">
- <div id="dataDiv">
- <table id="dataTable2" class="data_table01">
- <tr style="display:none;">
- <td class="tdCategory defaultTextFont">
- 구분 :
- <input type="radio" class="defaultTextFont" name="gubun" value="OP" checked onclick="selectRadio('OP')"/> 수술
- <input type="radio" class="defaultTextFont" name="gubun" value="OI" onclick="selectRadio('OI')"/> 시술
- </td>
- </tr>
- <tr>
- <td class="tdSelect">
- <div id="dept_dropdown">
- <span tabindex="0" id="dept_dropdown_selected" class="dept_dropdown_selected defaultTextFont" role="combobox">
- <span class="dropdown_icon"></span>
- <span id="dept_name" class="dept_name"></span>
- </span>
- <table class="dept_dropdown_list" summary="진료과를 선택 하세요." style="display: none;">
- <caption></caption>
- <colgroup>
- <col width="25%"/>
- <col width="25%"/>
- <col width="25%"/>
- <col width="25%"/>
- </colgroup>
- <tbody>
- </tbody>
- </table>
- </div>
- </td>
- </tr>
- </table>
- <br />
-
- <table id="dataTable" class="data_table01">
- <colgroup>
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- </colgroup>
- <tr>
- <th align="center" colspan="5" class="defaultTextFont">수술/시술의</th>
- </tr>
- <tbody id="dataTbody">
- </tbody>
- </table>
- <table id="dataTableTemplate" class="data_table01" style="display:none;">
- <colgroup>
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- <col width="20%" />
- </colgroup>
- <tr>
- <th align="center" colspan="5">수술/시술의</th>
- </tr>
- <tbody id="dataTbodyTemplate">
- <tr class="dataTrTemplate">
- <td class="dataTdTemplate1 defaultTextFont" align="center"></td>
- <td class="dataTdTemplate2 defaultTextFont" align="center"></td>
- <td class="dataTdTemplate3 defaultTextFont" align="center"></td>
- <td class="dataTdTemplate4 defaultTextFont" align="center"></td>
- <td class="dataTdTemplate5 defaultTextFont" align="center"></td>
- </tr>
- </tbody>
- <tbody id="noDataTbodyTemplate">
- <tr class="dataTrTemplate">
- <td align="center" colspan="5">조회된 데이터가 없습니다.</td>
- </tr>
- </tbody>
- </table>
- </div>
- </form>
- <div id="dis" style="display:none;">
- <asp:Label ID="clnDt" runat="server" />
- <asp:Label ID="dept" runat="server" />
- <asp:Label ID="doctorSeq" runat="server" />
- <asp:Label ID="instcd" runat="server" />
- </div>
- <script language="C#" runat="server">
- protected void Page_Load(Object s, EventArgs e) {
- string clnDt = (string.IsNullOrEmpty(this.Request.Params["clnDt"])) ? DateTime.Now.ToShortDateString() : this.Request.Params["clnDt"];
- this.clnDt.Text = (clnDt);
- string dept = (string.IsNullOrEmpty(this.Request.Params["dept"])) ? string.Empty : this.Request.Params["dept"];
- this.dept.Text = (dept);
-
- string doctorSeq = (string.IsNullOrEmpty(this.Request.Params["doctorSeq"])) ? string.Empty : this.Request.Params["doctorSeq"];
- this.doctorSeq.Text = (doctorSeq);
- string instcd = (string.IsNullOrEmpty(this.Request.Params["instcd"])) ? string.Empty : this.Request.Params["instcd"];
- this.instcd.Text = (instcd);
- }
- </script>
- <script>
- function loadEnd() {
- if (document.getElementById("dataTable") == null || document.getElementById("dataTable") == undefined) {
- document.getElementById("dataDiv").innerHTML = "<table class='data_table01'><tr><td height='100' align='center'>조회된 데이터가 없습니다.</td></tr></table>";
- }
- }
- loadEnd();
- </script>
- <script>
- selectRadio(null);
- </script>
- </body>
- </html>
|