SSMNP01300.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /* ---------------------------------------------------------------------
  2. 기간별수술집계환자조회 (SSMNP01300.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2009-10-01 오전 10:45:03
  7. ---------------------------------------------------------------------- */
  8. /**
  9. * @group :
  10. * @ver : 2009-09-15 오후 6:45:47
  11. * @by :
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 초기화
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInit(){
  21. var currDate = getCurrentDate();
  22. model.setValue("/root/main/condition/fromdd" , fCalcDate(currDate,-1));
  23. model.setValue("/root/main/condition/todd" , currDate);
  24. model.refresh();
  25. model.removeNodeSet("/root/main/oppatlists/oppatlist");
  26. datagrid1.refresh();
  27. var instcd = getUserInfo("dutplceinstcd");
  28. var rslt_ref = "/root/init/orddeptlist";
  29. //model.setValue("/root/main/cond/orddeptcd", "%");
  30. model.setValue("/root/main/condition/orddrid", "");
  31. zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate);
  32. //수술방 정보 조회
  33. fGetOproomList();
  34. addComboItem("cmb_subdept");
  35. //기초코드 조회
  36. zbcfGetCodeList(new Array("M0065"), new Array("/root/init/M0065list"), true);
  37. addComboItem("cmb_opstatcd");
  38. }
  39. /*
  40. * 1달을 자동 세팅되게 하는 함수
  41. * sDate : 일자(string)
  42. * iFlag : int 1/-1 (1달 이전/이후의 날짜 계산용도)
  43. */
  44. function fCalcDate(sDt,iFlag){
  45. var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D")
  46. //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- 해당요일
  47. rtnDate = sDate.getFullYear();
  48. rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
  49. rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
  50. return rtnDate;
  51. }
  52. /**
  53. * @group :
  54. * @ver : 2009-09-15 오후 6:45:47
  55. * @by :
  56. * @---------------------------------------------------
  57. * @type : function
  58. * @access : public
  59. * @desc : 조회
  60. * @param :
  61. * @return :
  62. * @---------------------------------------------------
  63. */
  64. function fOnClickSearchBtn(){
  65. model.resetInstanceNode("/root/send");
  66. var todd = model.getValue("/root/main/condition/todd");
  67. var fromdd = model.getValue("/root/main/condition/fromdd");
  68. var oproomcd = model.getValue("/root/main/condition/oproomcd");
  69. var subdeptcd = model.getValue("/root/main/condition/subdeptcd");
  70. var orddrid = model.getValue("/root/main/condition/orddrid");
  71. var opstatcd = model.getValue("/root/main/condition/opstatcd");
  72. if(fromdd == "" || fromdd == "undefined" || fromdd == null){
  73. model.alert("시작일자는 필수 입력 항목입니다.");
  74. return;
  75. }
  76. if(todd == "" || todd == "undefined" || todd == null){
  77. model.alert("종료일자는 필수 입력 항목입니다.");
  78. return;
  79. }
  80. //현재시간을 비교하여 근무시간 이후일 경우 6개월이상 조회가능 하도록 설정
  81. var sCurrentTm = getCurrentTime().substr(0,4);
  82. var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K");
  83. if(sCurrentDay == "월" || sCurrentDay == "화" || sCurrentDay == "수" ||
  84. sCurrentDay == "목" || sCurrentDay == "금"){
  85. //오후 5시 이전일 경우 조회 조건은 6달이상 조회되지 않도록 함.
  86. if(sCurrentTm < "1700"){
  87. var sSearchTerm = getDateInterval(fromdd, todd);
  88. if(sSearchTerm > 183){
  89. model.alert("근무시간에는 6개월 이상 조회할 수 없습니다.");
  90. return;
  91. }
  92. }
  93. }
  94. model.setValue("/root/send/todd" , todd );
  95. model.setValue("/root/send/fromdd" , fromdd );
  96. model.setValue("/root/send/oproomcd" , oproomcd );
  97. model.setValue("/root/send/subdeptcd", subdeptcd);
  98. model.setValue("/root/send/orddrid" , orddrid );
  99. model.setValue("/root/send/opstatcd" , opstatcd );
  100. model.removeNodeSet("/root/main/oppatlists/oppatlist");
  101. datagrid1.refresh();
  102. if(submit("TRSNP01300")){
  103. }
  104. }
  105. /**
  106. * @group :
  107. * @ver : 2009-09-15 오후 6:45:47
  108. * @by :
  109. * @---------------------------------------------------
  110. * @type : function
  111. * @access : public
  112. * @desc : 진료과 변경시 의사 조회 이벤트
  113. * @param :
  114. * @return :
  115. * @---------------------------------------------------
  116. */
  117. function fValueChangedOrddrCombo(){
  118. var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // 대표/분과/서브 구분
  119. var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // 센터/대표 구분
  120. var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // 상위부서코드
  121. var sorddeptflag = "";
  122. if (sorddeptkind == "C") { // 센터이면
  123. sorddeptflag = "C";
  124. } else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  125. sorddeptflag = "A";
  126. } else { // 그외에 기타과
  127. sorddeptflag = "etc";
  128. }
  129. if(model.getValue("/root/main/condition/subdeptcd") == ""){
  130. model.setValue("/root/main/condition/orddrid","");
  131. cmb_orddrid.refresh();
  132. }
  133. model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag);
  134. model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd);
  135. model.makeValue("/root/send/reqdata/prcpspecflag", "Y");
  136. model.makeValue("/root/send/reqdata/orddd", getCurrentDate());
  137. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/condition/subdeptcd"));
  138. submit("TRMNO00104"); // 의사리스트 조회
  139. addComboItem("cmb_orddrid");
  140. }
  141. /**
  142. * @group :
  143. * @ver : 2009-09-15 오후 6:45:47
  144. * @by :
  145. * @---------------------------------------------------
  146. * @type : function
  147. * @access : public
  148. * @desc : 수술방 정보 조회
  149. * @param :
  150. * @return :
  151. * @---------------------------------------------------
  152. */
  153. function fGetOproomList(){
  154. model.setValue("/root/send/fromdd" , getCurrentDate() );
  155. //현재일자에 유효한 수술방을 조회한다.
  156. submit("TRMCT00207");
  157. addComboItem("cmb_oproom");
  158. }
  159. /**
  160. * @group :
  161. * @ver : 2009-10-01 오후 3:07:17
  162. * @by :
  163. * @---------------------------------------------------
  164. * @type : function
  165. * @access : public
  166. * @desc : 엑셀저장
  167. * @param :
  168. * @return :
  169. * @---------------------------------------------------
  170. */
  171. function fSaveExcel(){
  172. fileName = window.fileDialog("save", ",", false, "수술집계환자상세내역_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  173. if (fileName != "" && fileName != null) {
  174. datagrid1.saveExcel(fileName, "SheetName", true, true, "", "", false);
  175. }
  176. }