123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[
- //==============================================================================================
- // Lib Include
- //----------------------------------------------------------------------------------------------
- include "com_commonxp::comm_main.xjs"
- //==============================================================================================
- // Global Form Variable
- //----------------------------------------------------------------------------------------------
- var lgv_sControlArrange = "1"; //초기값 가로.
- var lgv_nLineHeight = 5;
- var lgv_nControlSpace = 24;
- var lgv_nComponentSpace = 3;
- var lgv_firstCtrl = edt_pid; //첫번째 컨트롤(default : edt_pid)
- var lgv_secondCtrl = edt_patnm; //두번째 컨트롤(default : edt_patnm)
- var lgv_thirdCtrl = null; //세번째 컨트롤
- var lgv_srchCond = "2"; //조회조건 세팅값
- var lgv_showPtPopup = false; //돋보기 버튼 눌렀을 때 팝업창 호출 여부(true : 무조건 호출 false : 조회건수가 2건 이상일 경우만 호출)
- //==============================================================================================
- // Function
- //----------------------------------------------------------------------------------------------
- /***********************************************************************************************
- * 함수명 : att_setArrange
- * 설 명 : 컨트롤들의 배열을 설정한다.(가로배열, 세로배열)
- * argument : sFlag - 가로, 세로 여부(1: 가로배열, 2: 세로배열)
- * return Type :
- ************************************************************************************************/
- function att_setArrange(sFlag)
- {
- if("1" == sFlag){ //가로 배열
- if(lgv_srchCond != "1" && lgv_srchCond != "2") return; //등록번호와 환자명만 이동 가능
- lgv_sControlArrange = 1;
-
- lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
- stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
- lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
-
- stt_patnm.position.y = stt_pid.position.y;
- lgv_secondCtrl.position.y = lgv_firstCtrl.position.y;
- btn_search.position.y = lgv_secondCtrl.position.y;
- }else if("2" == sFlag){ //세로 배열
- if(lgv_srchCond != "1" && lgv_srchCond != "2") return; //등록번호와 환자명만 이동 가능
- lgv_sControlArrange = 2;
-
- lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
- stt_patnm.position.x = stt_pid.position.x;
- lgv_secondCtrl.position.x = lgv_firstCtrl.position.x;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
-
- if(stt_pid.position.width < stt_patnm.position.width){
- //edt_pid.position.x = edt_patnm.position.x;
- lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
- lgv_firstCtrl.position.x = lgv_secondCtrl.position.x;
- }
-
- stt_patnm.position.y = stt_pid.position.height + lgv_nLineHeight;
- lgv_secondCtrl.position.y = stt_patnm.position.y;
- btn_search.position.y = stt_patnm.position.y;
- }else if("3" == sFlag){ //등록번호 캡션 숨기기
- lgv_firstCtrl.position.x = 0;
- stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
- lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
-
- }else if("4" == sFlag){ //등록번호 캡션 보이기
- lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
- stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
- lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
-
- }else if("5" == sFlag){ //성명캡션 숨기기
- lgv_secondCtrl.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
- }else if("6" == sFlag){ //성명캡션 보이기
- lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
- }
- }
- /***********************************************************************************************
- * 함수명 : att_setVisible
- * 설 명 : 컨트롤을 숨긴다.
- * argument : sControls - 컨트롤명 배열
- * : visibleYN - 숨김여부(Y: 보임, N: 숨김)
- * return Type :
- ************************************************************************************************/
- function att_setVisible(sControls, visibleYN)
- {
- var arrControls = sControls.split("|");
- var nControlIndex;
-
- for (var i = 0 ; i < arrControls.length; i++){
-
- nControlIndex = arrControls[i].trim();
- switch(nControlIndex){
- case "1" :
- stt_pid.visible = visibleYN;
- if("1" == lgv_sControlArrange){
- if(visibleYN) att_setArrange(4);
- else att_setArrange(3);
- }
- break;
- case "2" :
- edt_pid.visible = visibleYN;
- break;
- case "3" :
- stt_patnm.visible = visibleYN;
- if("1" == lgv_sControlArrange){
- if(visibleYN) att_setArrange(6);
- else att_setArrange(5);
- }
- break;
- case "4" :
- edt_patnm.visible = visibleYN;
- break;
- case "5" :
- btn_search.visible = visibleYN;
- break;
- }
- }
- }
- /***********************************************************************************************
- * 함수명 : att_setVisible
- * 설 명 : 컨트롤들의 width를 설정한다.
- * argument : sEdt_pidWidth - 등록번호 에디트 컨트롤 width값
- * : sEdt_patnmWidth - 환자명 에디트 컨트롤 width값
- * return Type :
- ************************************************************************************************/
- function att_setControlWidth(sEdt_pidWidth, sEdt_patnmWidth)
- {
- edt_pid.position.width = sEdt_pidWidth;
- edt_patnm.position.width = sEdt_patnmWidth;
-
- if(lgv_sControlArrange == "1"){ //컨트롤 배치가 가로일 때
- att_setArrange("1");
- }else if(lgv_sControlArrange == "2"){ //컨트롤 배치가 세로일 때
- att_setArrange("2");
- }
- }
- /***********************************************************************************************
- * 함수명 : att_setStaticText
- * 설 명 : Static의 Text를 변경한다.
- * argument : sSttPid - 등록번호 Static 명칭
- * : sSttPatnm - 환자명 Static 명칭
- * return Type :
- ************************************************************************************************/
- function att_setStaticText(sSttPid, sSttPatnm){
- if(!utlf_isNull(sSttPid)){
- stt_pid.text = sSttPid;
- stt_pid.position.width = sSttPid.length * 13 + 16;
- }
- if(!utlf_isNull(sSttPatnm)){
- stt_patnm.text = sSttPatnm;
- stt_patnm.position.width = sSttPatnm.length * 13 + 16;
- }
-
- if("1" == lgv_sControlArrange){ //가로 배열일 때
- att_setArrange("1");
- }else if("2" == lgv_sControlArrange){ //세로 배열일 때
- att_setArrange("2");
- }
- }
- /***********************************************************************************************
- * 함수명 : lf_setCtrl
- * 설 명 : 조회 컨트롤을 세팅하는 함수
- * argument : pSrchCond : 조회 구분
- * (1, 2 : 등록번호, 3 : 주민번호, 4 : 환자명/주민번호
- * 7 : 환자명/주소, 8 : 피보험자/주민번호
- * 9 : 전화/핸드폰번호
- * return Type :
- ************************************************************************************************/
- function lf_setCtrl(pSrchCond, pShowPopup)
- {
- var sBtnPos=0; //조회버튼 위치
- var sEdtPos=0; //컨트롤 위치
- lgv_srchCond = pSrchCond;
-
- //컨트롤 값 초기화
- edt_pid.value = ""; //등록번호
- edt_patnm.value = ""; //성명 채우기
- edt_rgstno1.value = ""; //주민번호1
- edt_rgstno2.value = ""; //주민번호2
- edt_address.value = ""; //주소
- edt_hometel.value = ""; //전화번호
- edt_mphone.value = ""; //핸드폰
-
- //dataset 초기화
- ds_patInfo.clear();
- ds_ptsp.clear();
-
- if(!utlf_isNull(lgv_firstCtrl)) lgv_firstCtrl.visible = false;
- if(!utlf_isNull(lgv_secondCtrl)) lgv_secondCtrl.visible = false;
- if(!utlf_isNull(lgv_thirdCtrl)) lgv_thirdCtrl.visible = false;
-
- lgv_showPtPopup = utlf_isNull(pShowPopup) ? false : Boolean(pShowPopup); //팝업창 호출 옵션
-
- switch(pSrchCond){
- case "1": //등록번호
- case "2": //환자명
- lgv_firstCtrl = edt_pid;
- lgv_secondCtrl = edt_patnm;
- lgv_secondCtrl.kind = "2";
- lgv_thirdCtrl = null;
- stt_pid.visible = true;
- stt_patnm.visible = true;
- stt_pid.text = "등록번호";
- stt_patnm.text = "성명";
- break;
- case "3": //주민번호
- lgv_firstCtrl = edt_rgstno1;
- lgv_secondCtrl = edt_rgstno2;
- lgv_thirdCtrl = null;
-
- stt_pid.visible = true;
- stt_patnm.visible = false;
- stt_pid.text = "주민번호";
- stt_patnm.text = "";
- break;
- case "4": //환자명/주민번호
- lgv_firstCtrl = edt_patnm;
- lgv_firstCtrl.kind = "4";
- lgv_secondCtrl = edt_rgstno1;
- lgv_thirdCtrl = edt_rgstno2;
-
- stt_pid.visible = true;
- stt_patnm.visible = true;
- stt_pid.text = "환자명";
- stt_patnm.text = "주민번호";
- break;
- case "7": //환자명/주소
- lgv_firstCtrl = edt_patnm;
- lgv_firstCtrl.kind = "7";
- lgv_secondCtrl = edt_address;
- lgv_thirdCtrl = null;
- stt_pid.visible = true;
- stt_patnm.visible = true;
- stt_pid.text = "환자명";
- stt_patnm.text = "주소";
- break;
- case "9": //전화/핸드폰번호
- lgv_firstCtrl = edt_hometel;
- lgv_secondCtrl = edt_mphone;
- lgv_thirdCtrl = null;
- stt_pid.visible = true;
- stt_patnm.visible = true;
- stt_pid.text = "전화";
- stt_patnm.text = "핸드폰번호";
- break;
- }
-
- var objExtCommon = new ExtCommon();
- var sCellTextLen;
-
- if(stt_pid.visible == true){
- sCellTextLen = objExtCommon.getTextExtent(stt_pid, stt_pid.text);
- stt_pid.position.width = sCellTextLen[1] + 20;
- sEdtPos = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
- }
-
- if(!utlf_isNull(lgv_firstCtrl)){
- lgv_firstCtrl.position.x = sEdtPos;
- lgv_firstCtrl.position.y = 0;
- lgv_firstCtrl.visible = true;
- sEdtPos = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
- sBtnPos = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
- }
-
- if(stt_patnm.visible == true){
- sCellTextLen = objExtCommon.getTextExtent(stt_patnm, stt_patnm.text);
- stt_patnm.position.x = lgv_nControlSpace + sEdtPos;
- stt_patnm.position.width = sCellTextLen[1] + 20;
- sEdtPos = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
- }
-
- if(!utlf_isNull(lgv_secondCtrl)){
- lgv_secondCtrl.position.x = sEdtPos;
- lgv_secondCtrl.position.y = 0;
- lgv_secondCtrl.visible = true;
- sEdtPos = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
- sBtnPos = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
- }
-
- if(!utlf_isNull(lgv_thirdCtrl)){
- lgv_thirdCtrl.position.x = sEdtPos;
- lgv_thirdCtrl.position.y = 0;
- lgv_thirdCtrl.visible = true;
- sBtnPos = lgv_thirdCtrl.position.x + lgv_thirdCtrl.position.width + lgv_nComponentSpace;
- }
-
- btn_search.position.x = sBtnPos;
- }
- ]]></Script>
|