SSZFM00301.xjs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[
  3. //==============================================================================================
  4. // Lib Include
  5. //----------------------------------------------------------------------------------------------
  6. include "com_commonxp::comm_main.xjs"
  7. //==============================================================================================
  8. // Global Form Variable
  9. //----------------------------------------------------------------------------------------------
  10. var lgv_sControlArrange = "1"; //초기값 가로.
  11. var lgv_nLineHeight = 5;
  12. var lgv_nControlSpace = 24;
  13. var lgv_nComponentSpace = 3;
  14. var lgv_firstCtrl = edt_pid; //첫번째 컨트롤(default : edt_pid)
  15. var lgv_secondCtrl = edt_patnm; //두번째 컨트롤(default : edt_patnm)
  16. var lgv_thirdCtrl = null; //세번째 컨트롤
  17. var lgv_srchCond = "2"; //조회조건 세팅값
  18. var lgv_showPtPopup = false; //돋보기 버튼 눌렀을 때 팝업창 호출 여부(true : 무조건 호출 false : 조회건수가 2건 이상일 경우만 호출)
  19. //==============================================================================================
  20. // Function
  21. //----------------------------------------------------------------------------------------------
  22. /***********************************************************************************************
  23. * 함수명 : att_setArrange
  24. * 설 명 : 컨트롤들의 배열을 설정한다.(가로배열, 세로배열)
  25. * argument : sFlag - 가로, 세로 여부(1: 가로배열, 2: 세로배열)
  26. * return Type :
  27. ************************************************************************************************/
  28. function att_setArrange(sFlag)
  29. {
  30. if("1" == sFlag){ //가로 배열
  31. if(lgv_srchCond != "1" && lgv_srchCond != "2") return; //등록번호와 환자명만 이동 가능
  32. lgv_sControlArrange = 1;
  33. lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
  34. stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
  35. lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  36. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
  37. stt_patnm.position.y = stt_pid.position.y;
  38. lgv_secondCtrl.position.y = lgv_firstCtrl.position.y;
  39. btn_search.position.y = lgv_secondCtrl.position.y;
  40. }else if("2" == sFlag){ //세로 배열
  41. if(lgv_srchCond != "1" && lgv_srchCond != "2") return; //등록번호와 환자명만 이동 가능
  42. lgv_sControlArrange = 2;
  43. lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
  44. stt_patnm.position.x = stt_pid.position.x;
  45. lgv_secondCtrl.position.x = lgv_firstCtrl.position.x;
  46. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
  47. if(stt_pid.position.width < stt_patnm.position.width){
  48. //edt_pid.position.x = edt_patnm.position.x;
  49. lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  50. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
  51. lgv_firstCtrl.position.x = lgv_secondCtrl.position.x;
  52. }
  53. stt_patnm.position.y = stt_pid.position.height + lgv_nLineHeight;
  54. lgv_secondCtrl.position.y = stt_patnm.position.y;
  55. btn_search.position.y = stt_patnm.position.y;
  56. }else if("3" == sFlag){ //등록번호 캡션 숨기기
  57. lgv_firstCtrl.position.x = 0;
  58. stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
  59. lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  60. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
  61. }else if("4" == sFlag){ //등록번호 캡션 보이기
  62. lgv_firstCtrl.position.x = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
  63. stt_patnm.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nControlSpace;
  64. lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  65. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace ;
  66. }else if("5" == sFlag){ //성명캡션 숨기기
  67. lgv_secondCtrl.position.x = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
  68. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
  69. }else if("6" == sFlag){ //성명캡션 보이기
  70. lgv_secondCtrl.position.x = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  71. btn_search.position.x = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
  72. }
  73. }
  74. /***********************************************************************************************
  75. * 함수명 : att_setVisible
  76. * 설 명 : 컨트롤을 숨긴다.
  77. * argument : sControls - 컨트롤명 배열
  78. * : visibleYN - 숨김여부(Y: 보임, N: 숨김)
  79. * return Type :
  80. ************************************************************************************************/
  81. function att_setVisible(sControls, visibleYN)
  82. {
  83. var arrControls = sControls.split("|");
  84. var nControlIndex;
  85. for (var i = 0 ; i < arrControls.length; i++){
  86. nControlIndex = arrControls[i].trim();
  87. switch(nControlIndex){
  88. case "1" :
  89. stt_pid.visible = visibleYN;
  90. if("1" == lgv_sControlArrange){
  91. if(visibleYN) att_setArrange(4);
  92. else att_setArrange(3);
  93. }
  94. break;
  95. case "2" :
  96. edt_pid.visible = visibleYN;
  97. break;
  98. case "3" :
  99. stt_patnm.visible = visibleYN;
  100. if("1" == lgv_sControlArrange){
  101. if(visibleYN) att_setArrange(6);
  102. else att_setArrange(5);
  103. }
  104. break;
  105. case "4" :
  106. edt_patnm.visible = visibleYN;
  107. break;
  108. case "5" :
  109. btn_search.visible = visibleYN;
  110. break;
  111. }
  112. }
  113. }
  114. /***********************************************************************************************
  115. * 함수명 : att_setVisible
  116. * 설 명 : 컨트롤들의 width를 설정한다.
  117. * argument : sEdt_pidWidth - 등록번호 에디트 컨트롤 width값
  118. * : sEdt_patnmWidth - 환자명 에디트 컨트롤 width값
  119. * return Type :
  120. ************************************************************************************************/
  121. function att_setControlWidth(sEdt_pidWidth, sEdt_patnmWidth)
  122. {
  123. edt_pid.position.width = sEdt_pidWidth;
  124. edt_patnm.position.width = sEdt_patnmWidth;
  125. if(lgv_sControlArrange == "1"){ //컨트롤 배치가 가로일 때
  126. att_setArrange("1");
  127. }else if(lgv_sControlArrange == "2"){ //컨트롤 배치가 세로일 때
  128. att_setArrange("2");
  129. }
  130. }
  131. /***********************************************************************************************
  132. * 함수명 : att_setStaticText
  133. * 설 명 : Static의 Text를 변경한다.
  134. * argument : sSttPid - 등록번호 Static 명칭
  135. * : sSttPatnm - 환자명 Static 명칭
  136. * return Type :
  137. ************************************************************************************************/
  138. function att_setStaticText(sSttPid, sSttPatnm){
  139. if(!utlf_isNull(sSttPid)){
  140. stt_pid.text = sSttPid;
  141. stt_pid.position.width = sSttPid.length * 13 + 16;
  142. }
  143. if(!utlf_isNull(sSttPatnm)){
  144. stt_patnm.text = sSttPatnm;
  145. stt_patnm.position.width = sSttPatnm.length * 13 + 16;
  146. }
  147. if("1" == lgv_sControlArrange){ //가로 배열일 때
  148. att_setArrange("1");
  149. }else if("2" == lgv_sControlArrange){ //세로 배열일 때
  150. att_setArrange("2");
  151. }
  152. }
  153. /***********************************************************************************************
  154. * 함수명 : lf_setCtrl
  155. * 설 명 : 조회 컨트롤을 세팅하는 함수
  156. * argument : pSrchCond : 조회 구분
  157. * (1, 2 : 등록번호, 3 : 주민번호, 4 : 환자명/주민번호
  158. * 7 : 환자명/주소, 8 : 피보험자/주민번호
  159. * 9 : 전화/핸드폰번호
  160. * return Type :
  161. ************************************************************************************************/
  162. function lf_setCtrl(pSrchCond, pShowPopup)
  163. {
  164. var sBtnPos=0; //조회버튼 위치
  165. var sEdtPos=0; //컨트롤 위치
  166. lgv_srchCond = pSrchCond;
  167. //컨트롤 값 초기화
  168. edt_pid.value = ""; //등록번호
  169. edt_patnm.value = ""; //성명 채우기
  170. edt_rgstno1.value = ""; //주민번호1
  171. edt_rgstno2.value = ""; //주민번호2
  172. edt_address.value = ""; //주소
  173. edt_hometel.value = ""; //전화번호
  174. edt_mphone.value = ""; //핸드폰
  175. //dataset 초기화
  176. ds_patInfo.clear();
  177. ds_ptsp.clear();
  178. if(!utlf_isNull(lgv_firstCtrl)) lgv_firstCtrl.visible = false;
  179. if(!utlf_isNull(lgv_secondCtrl)) lgv_secondCtrl.visible = false;
  180. if(!utlf_isNull(lgv_thirdCtrl)) lgv_thirdCtrl.visible = false;
  181. lgv_showPtPopup = utlf_isNull(pShowPopup) ? false : Boolean(pShowPopup); //팝업창 호출 옵션
  182. switch(pSrchCond){
  183. case "1": //등록번호
  184. case "2": //환자명
  185. lgv_firstCtrl = edt_pid;
  186. lgv_secondCtrl = edt_patnm;
  187. lgv_secondCtrl.kind = "2";
  188. lgv_thirdCtrl = null;
  189. stt_pid.visible = true;
  190. stt_patnm.visible = true;
  191. stt_pid.text = "등록번호";
  192. stt_patnm.text = "성명";
  193. break;
  194. case "3": //주민번호
  195. lgv_firstCtrl = edt_rgstno1;
  196. lgv_secondCtrl = edt_rgstno2;
  197. lgv_thirdCtrl = null;
  198. stt_pid.visible = true;
  199. stt_patnm.visible = false;
  200. stt_pid.text = "주민번호";
  201. stt_patnm.text = "";
  202. break;
  203. case "4": //환자명/주민번호
  204. lgv_firstCtrl = edt_patnm;
  205. lgv_firstCtrl.kind = "4";
  206. lgv_secondCtrl = edt_rgstno1;
  207. lgv_thirdCtrl = edt_rgstno2;
  208. stt_pid.visible = true;
  209. stt_patnm.visible = true;
  210. stt_pid.text = "환자명";
  211. stt_patnm.text = "주민번호";
  212. break;
  213. case "7": //환자명/주소
  214. lgv_firstCtrl = edt_patnm;
  215. lgv_firstCtrl.kind = "7";
  216. lgv_secondCtrl = edt_address;
  217. lgv_thirdCtrl = null;
  218. stt_pid.visible = true;
  219. stt_patnm.visible = true;
  220. stt_pid.text = "환자명";
  221. stt_patnm.text = "주소";
  222. break;
  223. case "9": //전화/핸드폰번호
  224. lgv_firstCtrl = edt_hometel;
  225. lgv_secondCtrl = edt_mphone;
  226. lgv_thirdCtrl = null;
  227. stt_pid.visible = true;
  228. stt_patnm.visible = true;
  229. stt_pid.text = "전화";
  230. stt_patnm.text = "핸드폰번호";
  231. break;
  232. }
  233. var objExtCommon = new ExtCommon();
  234. var sCellTextLen;
  235. if(stt_pid.visible == true){
  236. sCellTextLen = objExtCommon.getTextExtent(stt_pid, stt_pid.text);
  237. stt_pid.position.width = sCellTextLen[1] + 20;
  238. sEdtPos = stt_pid.position.x + stt_pid.position.width + lgv_nComponentSpace;
  239. }
  240. if(!utlf_isNull(lgv_firstCtrl)){
  241. lgv_firstCtrl.position.x = sEdtPos;
  242. lgv_firstCtrl.position.y = 0;
  243. lgv_firstCtrl.visible = true;
  244. sEdtPos = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
  245. sBtnPos = lgv_firstCtrl.position.x + lgv_firstCtrl.position.width + lgv_nComponentSpace;
  246. }
  247. if(stt_patnm.visible == true){
  248. sCellTextLen = objExtCommon.getTextExtent(stt_patnm, stt_patnm.text);
  249. stt_patnm.position.x = lgv_nControlSpace + sEdtPos;
  250. stt_patnm.position.width = sCellTextLen[1] + 20;
  251. sEdtPos = stt_patnm.position.x + stt_patnm.position.width + lgv_nComponentSpace;
  252. }
  253. if(!utlf_isNull(lgv_secondCtrl)){
  254. lgv_secondCtrl.position.x = sEdtPos;
  255. lgv_secondCtrl.position.y = 0;
  256. lgv_secondCtrl.visible = true;
  257. sEdtPos = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
  258. sBtnPos = lgv_secondCtrl.position.x + lgv_secondCtrl.position.width + lgv_nComponentSpace;
  259. }
  260. if(!utlf_isNull(lgv_thirdCtrl)){
  261. lgv_thirdCtrl.position.x = sEdtPos;
  262. lgv_thirdCtrl.position.y = 0;
  263. lgv_thirdCtrl.visible = true;
  264. sBtnPos = lgv_thirdCtrl.position.x + lgv_thirdCtrl.position.width + lgv_nComponentSpace;
  265. }
  266. btn_search.position.x = sBtnPos;
  267. }
  268. ]]></Script>