SPMMB02100.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 처방분류코드 ( SMMMB02100_처방분류코드.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var sPRCPCLSCDLIST_PATH = "/root/main/prcpclscdlist/prcpclscdlist";
  9. /**
  10. * @desc : 화면 초기화
  11. * @
  12. * @param :
  13. * @event :
  14. * @return :
  15. * @---------------------------------------------------
  16. */
  17. function fInitialize(){
  18. submit("TRMMB02102");
  19. }
  20. /**
  21. * @desc : TreeView의 처방분류코드 선택시 opener에게 현재 처방분류코드 및 처방분류명 전달
  22. * @
  23. * @param :
  24. * @event :
  25. * @return :
  26. * @---------------------------------------------------
  27. */
  28. function fChoiPrcpClsCD(rowpos){
  29. var prcpclscd = model.getValue(sPRCPCLSCDLIST_PATH + "[" + rowpos + "]/prcpclscd");
  30. var prcpclsnm = model.getValue(sPRCPCLSCDLIST_PATH + "[" + rowpos + "]/path");
  31. var prcpclscd1 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + rowpos + "]/prcpclscd1");
  32. var prcpclscd2 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + rowpos + "]/prcpclscd2");
  33. var prcpclscd3 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + rowpos + "]/prcpclscd3");
  34. var useyn = "Y"; //사용구분
  35. var sPRCPCLSCDLIST_PARAM = useyn + "▩" + prcpclscd + "▩" + prcpclsnm + "▩" + prcpclscd1 + "▩" + prcpclscd2 + "▩" + prcpclscd3;
  36. //alert(prcpclscd + "," + prcpclsnm + "," + prcpclscd1 + "," + prcpclscd2 + "," + prcpclscd3);
  37. if(checkOpener()){
  38. opener.javascript.setParameter("param", sPRCPCLSCDLIST_PARAM);
  39. }else{
  40. messageBox("상위화면이 변경되어 데이터를 처리", "E001");
  41. }
  42. model.close();
  43. }
  44. /**
  45. * @desc : 마우스 오른쪽 버튼 팝업창
  46. * @
  47. * @param :
  48. * @return :
  49. * @---------------------------------------------------
  50. */
  51. function fMouseRghtBtnPopup(){
  52. if(event.button == 3){
  53. if(trv_prcpclscdlist.isCell(event.target) && trv_prcpclscdlist.focusIndex > -1)
  54. window.setPopupMenu(true, "/root/hidden/menu/menu", "label", "func", false); //팝업창 셋팅
  55. }else{
  56. window.setPopupMenu(false);
  57. }
  58. }
  59. /**
  60. * @desc : 처방분류 추가
  61. * @
  62. * @param :
  63. * @return :
  64. * @---------------------------------------------------
  65. */
  66. function fAddPrcpCls(){
  67. var item = trv_prcpclscdlist.item(trv_prcpclscdlist.selectedIndex);
  68. var iRow = item.index + 1;
  69. var lvl = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/lvl");
  70. var prcpclscd1 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd1");
  71. var prcpclscd2 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd2");
  72. var prcpclscd3 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd3");
  73. fSetCasePrcpCls(lvl, prcpclscd1, prcpclscd2, prcpclscd3);
  74. }
  75. /**
  76. * @desc : 처방분류 수정
  77. * @
  78. * @param :
  79. * @return :
  80. * @---------------------------------------------------
  81. */
  82. function fUpdtPrcpCls(){
  83. var item = trv_prcpclscdlist.item(trv_prcpclscdlist.selectedIndex);
  84. var iRow = item.index + 1;
  85. var lvl = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/lvl");
  86. var prcpclscd1 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd1");
  87. var prcpclscd2 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd2");
  88. var prcpclscd3 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd3");
  89. model.setValue("/root/send/savedata/m", "u");
  90. model.setValue("/root/send/savedata/prcpclscd1", prcpclscd1);
  91. model.setValue("/root/send/savedata/prcpclscd2", prcpclscd2);
  92. model.setValue("/root/send/savedata/prcpclscd3", prcpclscd3);
  93. fShowIptBox();
  94. }
  95. /**
  96. * @desc : 처방분류 삭제
  97. * @
  98. * @param :
  99. * @return :
  100. * @---------------------------------------------------
  101. */
  102. function fDelPrcpCls(){
  103. var item = trv_prcpclscdlist.item(trv_prcpclscdlist.selectedIndex);
  104. var iRow = item.index + 1;
  105. var lvl = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/lvl");
  106. var prcpclscd1 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd1");
  107. var prcpclscd2 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd2");
  108. var prcpclscd3 = model.getValue(sPRCPCLSCDLIST_PATH + "[" + iRow + "]/prcpclscd3");
  109. var clscdflag;
  110. switch(lvl){
  111. case "2" : clscdflag = "lrg"; break;
  112. case "3" : clscdflag = "mdl"; break;
  113. case "4" : clscdflag = "sml"; break;
  114. default : messageBox("신규 처방분류를 삭제 ", "E001"); return;
  115. }
  116. model.setValue("/root/send/savedata/m", "d");
  117. model.setValue("/root/send/savedata/clscdflag" , clscdflag);
  118. model.setValue("/root/send/savedata/prcpclscd1", prcpclscd1);
  119. model.setValue("/root/send/savedata/prcpclscd2", prcpclscd2);
  120. model.setValue("/root/send/savedata/prcpclscd3", prcpclscd3);
  121. submit("TXMMB02102");
  122. addCopyNodeset("/root/main/prcpclscdlist/prcpclscdlist", "/root/temp/prcpclscdlist", "before");
  123. model.refresh();
  124. }
  125. /**
  126. * @desc : 처방분류 추가시, 저장data 설정
  127. * @
  128. * @param :
  129. * @return :
  130. * @---------------------------------------------------
  131. */
  132. function fSetCasePrcpCls(lvl, prcpclscd1, prcpclscd2, prcpclscd3){
  133. switch(lvl){
  134. //depth level이 1인 경우
  135. case "1" : fSetReqPrcpClsData("i", "lrg", "", "00", "00");
  136. fShowIptBox();
  137. break;
  138. //depth level이 2인 경우
  139. case "2" : fSetReqPrcpClsData("i", "mdl", prcpclscd1, "", "00");
  140. fShowIptBox();
  141. break;
  142. //depth level이 3인 경우
  143. case "3" : fSetReqPrcpClsData("i", "sml", prcpclscd1, prcpclscd2, "");
  144. fShowIptBox();
  145. break;
  146. case "4" : messageBox("신규 처방분류를 생성 ", "E001");
  147. return;
  148. }
  149. }
  150. /**
  151. * @desc : 저장 데이터 설정
  152. * @
  153. * @param :
  154. * @return :
  155. * @---------------------------------------------------
  156. */
  157. function fSetReqPrcpClsData(status, clscdflag, prcpclscd1, prcpclscd2, prcpclscd3){
  158. model.setValue("/root/send/savedata/m" , status);
  159. model.setValue("/root/send/savedata/clscdflag" , clscdflag);
  160. model.setValue("/root/send/savedata/prcpclscd1", prcpclscd1);
  161. model.setValue("/root/send/savedata/prcpclscd2", prcpclscd2);
  162. model.setValue("/root/send/savedata/prcpclscd3", prcpclscd3);
  163. model.setValue("/root/send/savedata/useflag" , "Y");
  164. model.setValue("/root/send/savedata/refseq" , "0");
  165. model.refresh();
  166. }
  167. /**
  168. * @desc : 입력창 Open
  169. * @
  170. * @param :
  171. * @return :
  172. * @---------------------------------------------------
  173. */
  174. function fShowIptBox(){
  175. group1.attribute("top") = event.clientY;
  176. group1.attribute("height") = 55;
  177. model.setFocus("ipt_prcpclsnm");
  178. model.refresh();
  179. }