SMMCT00203.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /* ---------------------------------------------------------------------
  2. 수술실 시점별 소요시간 (SMMCT00203.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2009-09-24 오전 9:57:31
  7. ---------------------------------------------------------------------- */
  8. /**
  9. * @group :
  10. * @ver :2009-09-24 오전 9:16:55
  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/oppnttmusetminfo/oppnttmusetmlist");
  26. grd_oppnttmusetmlst.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. submit("TRMCT00208");
  33. //수술방 정보 조회
  34. fGetOproomList();
  35. addComboItem("cmb_subdept");
  36. fValueChangedSchCombo();
  37. }
  38. /*
  39. * 1달을 자동 세팅되게 하는 함수
  40. * sDate : 일자(string)
  41. * iFlag : int 1/-1 (1달 이전/이후의 날짜 계산용도)
  42. */
  43. function fCalcDate(sDt,iFlag){
  44. var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D")
  45. //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- 해당요일
  46. rtnDate = sDate.getFullYear();
  47. rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
  48. rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
  49. return rtnDate;
  50. }
  51. /**
  52. * @group :
  53. * @ver : 2009-09-24 오전 9:17:01
  54. * @by :
  55. * @---------------------------------------------------
  56. * @type : function
  57. * @access : public
  58. * @desc : 조회
  59. * @param :
  60. * @return :
  61. * @---------------------------------------------------
  62. */
  63. function fClickSearchBtn(){
  64. model.resetInstanceNode("/root/send");
  65. var todd = model.getValue("/root/main/condition/todd");
  66. var fromdd = model.getValue("/root/main/condition/fromdd");
  67. var oproomcd = model.getValue("/root/main/condition/oproomcd");
  68. var subdeptcd = model.getValue("/root/main/condition/subdeptcd");
  69. var orddrid = model.getValue("/root/main/condition/orddrid");
  70. var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091222
  71. if(fromdd == "" || fromdd == "undefined" || fromdd == null){
  72. model.alert("시작일자는 필수 입력 항목입니다.");
  73. return;
  74. }
  75. if(todd == "" || todd == "undefined" || todd == null){
  76. model.alert("종료일자는 필수 입력 항목입니다.");
  77. return;
  78. }
  79. //현재시간을 비교하여 근무시간 이후일 경우 6개월이상 조회가능 하도록 설정
  80. var sCurrentTm = getCurrentTime().substr(0,4);
  81. var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K");
  82. if(sCurrentDay == "월" || sCurrentDay == "화" || sCurrentDay == "수" ||
  83. sCurrentDay == "목" || sCurrentDay == "금"){
  84. //오후 5시 이전일 경우 조회 조건은 6달이상 조회되지 않도록 함.
  85. if(sCurrentTm < "1700"){
  86. var sSearchTerm = getDateInterval(fromdd, todd);
  87. if(sSearchTerm > 183){
  88. model.alert("근무시간에는 6개월 이상 조회할 수 없습니다.");
  89. return;
  90. }
  91. }
  92. }
  93. model.setValue("/root/send/todd" , todd );
  94. model.setValue("/root/send/fromdd" , fromdd );
  95. model.setValue("/root/send/tab" , tab ); // 방별, 과별, 의사별 구분 추가 by 박영우 20091222
  96. model.setValue("/root/send/oproomcd" , oproomcd );
  97. model.setValue("/root/send/subdeptcd", subdeptcd);
  98. model.setValue("/root/send/orddrid" , orddrid );
  99. model.removeNodeSet("/root/main/oppnttmusetminfo/oppnttmusetmlist");
  100. grd_oppnttmusetmlst.refresh();
  101. if(submit("TRMCT00203")){
  102. }
  103. }
  104. /**
  105. * @group :
  106. * @ver : 2009-09-24 오전 9:17:04
  107. * @by :
  108. * @---------------------------------------------------
  109. * @type : function
  110. * @access : public
  111. * @desc : 진료과 변경시 의사 조회 이벤트
  112. * @param :
  113. * @return :
  114. * @---------------------------------------------------
  115. */
  116. function fValueChangedOrddrCombo(){
  117. var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // 대표/분과/서브 구분
  118. var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // 센터/대표 구분
  119. var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // 상위부서코드
  120. var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091222
  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. if(tab=="D") { //과,의사별일 경우에만 의사리스트 조회 by 박영우 20091222
  139. submit("TRMNO00104"); // 의사리스트 조회
  140. addComboItem("cmb_orddrid");
  141. }
  142. }
  143. /**
  144. * @group :
  145. * @ver : 2009-12-22 오후 4:27:47
  146. * @by : 박영우
  147. * @---------------------------------------------------
  148. * @type : function
  149. * @access : public
  150. * @desc : 검색 combo 변경시 이벤트
  151. * @param :
  152. * @return :
  153. * @---------------------------------------------------
  154. */
  155. function fValueChangedSchCombo(){
  156. var sTab = model.getValue("/root/main/condition/tab");
  157. if(sTab == "R"){ //방별
  158. //combo변경시 시간 재조정 by 박영우 20091222
  159. model.removenodeset("/root/main/oppnttmusetminfo");
  160. model.setValue("/root/main/condition/oproomcd", "");
  161. model.setValue("/root/main/condition/subdeptcd", "");
  162. model.setValue("/root/main/condition/orddrid", "");
  163. caption14.visible = true;
  164. cmb_oproom.visible = true;
  165. caption7.visible = false;
  166. cmb_subdept.visible = false;
  167. caption1.visible = false;
  168. cmb_orddrid.visible = false;
  169. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("oproomnm"))=false;
  170. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("deptengabbr"))=true;
  171. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("perfdrnm"))=true;
  172. model.refresh();
  173. }else if(sTab == "E"){ //과별 추가 by 박영우 20091216
  174. //combo변경시 그리드, 과별, 시간 재조정 by 박영우 20091222
  175. model.removenodeset("/root/main/oppnttmusetminfo");
  176. model.setValue("/root/main/condition/oproomcd", "");
  177. model.setValue("/root/main/condition/subdeptcd", "");
  178. model.setValue("/root/main/condition/orddrid", "");
  179. caption14.visible = false;
  180. cmb_oproom.visible = false;
  181. caption7.visible = true;
  182. cmb_subdept.visible = true;
  183. caption1.visible = false;
  184. cmb_orddrid.visible = false;
  185. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("oproomnm"))=true;
  186. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("deptengabbr"))=false;
  187. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("perfdrnm"))=true;
  188. model.refresh();
  189. }else if(sTab == "D"){
  190. //combo변경시 그리드, 과별, 의사별, 시간 재조정 by 박영우 20091222
  191. model.removenodeset("/root/main/oppnttmusetminfo");
  192. model.setValue("/root/main/condition/oproomcd", "");
  193. model.setValue("/root/main/condition/subdeptcd", "");
  194. model.setValue("/root/main/condition/orddrid", "");
  195. caption14.visible = false;
  196. cmb_oproom.visible = false;
  197. caption7.visible = true;
  198. cmb_subdept.visible = true;
  199. caption1.visible = true;
  200. cmb_orddrid.visible = true;
  201. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("oproomnm"))=true;
  202. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("deptengabbr"))=false;
  203. grd_oppnttmusetmlst.colHidden(grd_oppnttmusetmlst.colref("perfdrnm"))=false;
  204. model.refresh();
  205. }
  206. }
  207. /**
  208. * @group :
  209. * @ver : 2009-09-15 오후 6:45:47
  210. * @by :
  211. * @---------------------------------------------------
  212. * @type : function
  213. * @access : public
  214. * @desc : 수술방 정보 조회
  215. * @param :
  216. * @return :
  217. * @---------------------------------------------------
  218. */
  219. function fGetOproomList(){
  220. model.setValue("/root/send/fromdd" , getCurrentDate() );
  221. //현재일자에 유효한 수술방을 조회한다.
  222. submit("TRMCT00207");
  223. addComboItem("cmb_oproom");
  224. }