SMMRC03600.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /**
  2. * @desc : 사용자의 권한을 체크하여 버튼셋팅.
  3. * btn_r 조회버튼, btn_x 저장 및 수정 버튼, btn_p : 출력버튼
  4. * @
  5. * @param :
  6. * @return :
  7. * @authur : 이은영 2009.03.06.
  8. * @---------------------------------------------------
  9. */
  10. function fchkAuth()
  11. {
  12. for(var i=0; i<= document.controls.length-1 ; i++){
  13. if(document.controls.item(i).elementName == "xforms:button"){
  14. if(document.controls.item(i).attribute("id").substr(0,6) == "btn_r_"){
  15. document.controls.item(i).disabled = !checkAuth("R");
  16. }
  17. if(document.controls.item(i).attribute("id").substr(0,6) == "btn_x_"){
  18. document.controls.item(i).disabled = !checkAuth("X");
  19. }
  20. if(document.controls.item(i).attribute("id").substr(0,6) == "btn_p_"){
  21. document.controls.item(i).disabled = !checkAuth("P");
  22. }
  23. }
  24. }
  25. }
  26. /**
  27. * @desc : excel 저장 하기
  28. * @
  29. * @param :
  30. * @return :
  31. * @authur : 이은영 2009.03.06.
  32. * @---------------------------------------------------
  33. */
  34. function fExcel(gridObj, title){
  35. if (title == null) { title = "" }
  36. var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  37. if (fileName != "") {
  38. gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
  39. }
  40. }
  41. /**
  42. * @desc : 폼초기화
  43. * @
  44. * @param :
  45. * @return :
  46. * @authur : 이은영 2009.03.06.
  47. * @---------------------------------------------------
  48. */
  49. function fFormInit()
  50. {
  51. // 컨트롤 권한 설정
  52. fchkAuth();
  53. // 초기화
  54. model.setValue("/root/condition/wardyn" , "N");
  55. model.setValue("/root/condition/searchflag" , "1");
  56. model.setValue("/root/condition/termflag" , "S");
  57. model.setValue("/root/condition/fromrenddd" , getCurrentDate());
  58. model.setValue("/root/condition/torenddd" , getCurrentDate());
  59. model.setValue("/root/condition/sortappdept", "Y");
  60. model.setValue("/root/condition/appdept" , "ALL");
  61. // tab 선택
  62. btn_deptlendlist.dispatch("onclick");
  63. // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
  64. submit("TRMRC00100");
  65. // 2009.03.06. 진료과/병동 리스트 셋해주기..
  66. copyNodeset("/root/init/appdept/deptlist", "/root/init/lendmastinfo/lenddeptlist[allwardyn='N']", "after"); // 진료과
  67. copyNodeset("/root/init/appward/wardlist", "/root/init/lendmastinfo/lenddeptlist[allwardyn='Y']", "after"); // 병동
  68. // 2009.03.06. 대출용도 셋 조회... (의료정보팀..3230000000)
  69. // 90000000000000055 예약
  70. // 90000000000000056 외래당일접수
  71. // 90000000000000057 병동/응급실
  72. // 90000000000000058 당일신청서
  73. // 90000000000000059 연구용
  74. // 90000000000000060 전체
  75. // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
  76. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/hardcd", 5502);
  77. var deptcd = model.getValue("/root/temp/hardcd/hardcd/hardcd")
  78. //model.makeValue("/root/send/reqdata/deptcd" , "3230000000");
  79. model.makeValue("/root/send/reqdata/deptcd" , deptcd);
  80. // KNUH_20101207_박성호_end
  81. submit("TRMRC01312");
  82. // 2009.03.06. 선택된 대출용도 코드 리스트 스트링 만들기..
  83. // 초기화 선택 셋코드.. 외래당일접수..90000000000000056
  84. fGetChkRendCdList("90000000000000060");
  85. }
  86. /**
  87. * @desc : 내원구분 외래로 진료과/병동 셋해주기..
  88. * @
  89. * @param :
  90. * @return :
  91. * @authur : 이은영 2009.03.06.
  92. * @---------------------------------------------------
  93. */
  94. function fSetAppDeptList()
  95. {
  96. var wardyn = model.getValue("/root/condition/wardyn");
  97. if (wardyn == "N") {
  98. cbo_appdept.choices.itemset.attribute("nodeset") = "/root/init/appdept/deptlist";
  99. } else {
  100. cbo_appdept.choices.itemset.attribute("nodeset") = "/root/init/appward/wardlist";
  101. }
  102. model.setValue("/root/condition/appdept" , "ALL");
  103. cbo_appdept.refresh();
  104. }
  105. /**
  106. * @desc : 선택된 대출용도 코드 리스트 스트링 만들기..
  107. * @
  108. * @param :
  109. * @return :
  110. * @authur : 이은영 2009.03.06.
  111. * @---------------------------------------------------
  112. */
  113. function fGetChkRendCdList(setcd)
  114. {
  115. model.setValue("/root/condition/setcd" , setcd);
  116. submit("TRMRC01313");
  117. var ref = "/root/init/lendsetitem/setitemlist";
  118. var cnt = getNodesetCnt(model, ref);
  119. var chkrendcdlist = "";
  120. for ( var i = 1; i <= cnt; i++)
  121. {
  122. var rendcd = model.getValue(ref + "[" + i + "]/rendcd");
  123. var srchuseyn = model.getValue(ref + "[" + i + "]/srchuseyn");
  124. if (srchuseyn == "Y") {
  125. chkrendcdlist = chkrendcdlist + rendcd + "|";
  126. }
  127. }
  128. var rendcdlist = chkrendcdlist.split("|");
  129. if (rendcdlist.length > 0) {
  130. chkrendcdlist = chkrendcdlist.substring(0, chkrendcdlist.length -1);
  131. }
  132. model.setValue("/root/condition/chkrendcdlist", chkrendcdlist);
  133. chk_rendcd.refresh();
  134. }
  135. /**
  136. * @desc : 조회하기
  137. * @
  138. * @param :
  139. * @return :
  140. * @authur : 이은영 2009.03.06.
  141. * @---------------------------------------------------
  142. */
  143. function fSearch()
  144. {
  145. // 2007.12.26. 대출용도 멀티로 조회하기.. ^^
  146. var rendcd = model.getValue("/root/condition/chkrendcdlist");
  147. var rendcdlist = "N";
  148. // 2009.01.12. 대출용도 선택항목이 전체인지 구분하기 위해서..
  149. var ref = "/root/init/lendsetitem/setitemlist";
  150. var cnt = getNodesetCnt(model, ref);
  151. var rendcdlist = rendcd.split("|");
  152. if (rendcdlist.length == 1) {
  153. rendcd = rendcd;
  154. } else if (rendcdlist.length == cnt) {
  155. rendcd = "ALL";
  156. } else {
  157. for (var i = 0 ; i < rendcdlist.length ; i++) {
  158. rendcd = rendcd.replace("|","','");
  159. }
  160. rendcdlist = "Y";
  161. rendcd = "'" + rendcd + "'";
  162. }
  163. model.setValue("/root/condition/rendcdlist", rendcdlist);
  164. model.setValue("/root/condition/rendcd", rendcd);
  165. model.refresh();
  166. // searchflag
  167. // 1. 외래현황
  168. // 2. 병동현황
  169. // 3. 부서별통계
  170. // 4. 용도별통계
  171. // 5. 대출자별통계
  172. var searchflag = model.getValue("/root/condition/searchflag");
  173. if (searchflag == "1") {
  174. btn_deptlendlist.dispatch("onclick");
  175. submit("TRMRC03601");
  176. } else if (searchflag == "2") {
  177. btn_wardlendlist.dispatch("onclick");
  178. submit("TRMRC03602");
  179. } else if (searchflag == "3") {
  180. btn_stslenddept.dispatch("onclick");
  181. submit("TRMRC03603");
  182. } else if (searchflag == "4") {
  183. btn_stsrendcd.dispatch("onclick");
  184. submit("TRMRC03604");
  185. } else if (searchflag == "5") {
  186. btn_stslendman.dispatch("onclick");
  187. submit("TRMRC03605");
  188. }
  189. }
  190. /**
  191. * @desc : 하드코드 조회
  192. * @
  193. * @param : ref - reference path
  194. * rsltref - result reference path
  195. * hardcd - 하드코드
  196. * @return :
  197. * @author : 오지훈
  198. * @---------------------------------------------------
  199. */
  200. function mmbfGetHardCodeInfo(ref, rsltref, hardcd){
  201. var mmb_rsltref = "/root/hidden/mmb/hardcd";
  202. model.removeNode(mmb_rsltref);
  203. model.makeNode(mmb_rsltref);
  204. model.removeNode(ref);
  205. model.makeValue(ref + "/hardcd", hardcd);
  206. if(submit("TRMMB04103", "false", ref, mmb_rsltref)==true){
  207. model.copyNode(rsltref, mmb_rsltref);
  208. model.removeNode(mmb_rsltref);
  209. }
  210. model.refresh();
  211. }