SMMCT00204.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /* ---------------------------------------------------------------------
  2. 임상과별 수술명별 평균 수술시간 (SMMCT00204.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2009-09-25 오후 2:52:20
  7. ---------------------------------------------------------------------- */
  8. /**
  9. * @group :
  10. * @ver : 2009-09-25 오후 2:40:53
  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/avgoptminfo/avgoptmlist");
  26. grd_avgoptmlst.refresh();
  27. var instcd = getUserInfo("dutplceinstcd");
  28. var rslt_ref = "/root/init/orddeptlist";
  29. model.setValue("/root/main/condition/orddrid", "");
  30. chk_secprcp.value = "Y";
  31. //zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate);
  32. submit("TRMCT00208");
  33. addComboItem("cmb_subdept");
  34. }
  35. /*
  36. * 1달을 자동 세팅되게 하는 함수
  37. * sDate : 일자(string)
  38. * iFlag : int 1/-1 (1달 이전/이후의 날짜 계산용도)
  39. */
  40. function fCalcDate(sDt,iFlag){
  41. var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D")
  42. //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- 해당요일
  43. rtnDate = sDate.getFullYear();
  44. rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
  45. rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
  46. return rtnDate;
  47. }
  48. /**
  49. * @group :
  50. * @ver : 2009-09-15 오후 6:45:47
  51. * @by :
  52. * @---------------------------------------------------
  53. * @type : function
  54. * @access : public
  55. * @desc : 조회
  56. * @param :
  57. * @return :
  58. * @---------------------------------------------------
  59. */
  60. function fClickSearchBtn(){
  61. model.resetInstanceNode("/root/send");
  62. var todd = model.getValue("/root/main/condition/todd");
  63. var fromdd = model.getValue("/root/main/condition/fromdd");
  64. var subdeptcd = model.getValue("/root/main/condition/subdeptcd");
  65. var orddrid = model.getValue("/root/main/condition/orddrid");
  66. var search = model.getValue("/root/main/condition/search").toUpperCase();
  67. var searchcond = model.getValue("/root/main/condition/searchcond");
  68. var secprcpyn = model.getValue("/root/main/condition/secprcpyn");
  69. if(fromdd == "" || fromdd == "undefined" || fromdd == null){
  70. model.alert("시작일자는 필수 입력 항목입니다.");
  71. return;
  72. }
  73. if(todd == "" || todd == "undefined" || todd == null){
  74. model.alert("종료일자는 필수 입력 항목입니다.");
  75. return;
  76. }
  77. //현재시간을 비교하여 근무시간 이후일 경우 6개월이상 조회가능 하도록 설정
  78. var sCurrentTm = getCurrentTime().substr(0,4);
  79. var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K");
  80. if(sCurrentDay == "월" || sCurrentDay == "화" || sCurrentDay == "수" ||
  81. sCurrentDay == "목" || sCurrentDay == "금"){
  82. //오후 5시 이전일 경우 조회 조건은 1달이상 조회되지 않도록 함.
  83. if(sCurrentTm < "1700"){
  84. var sSearchTerm = getDateInterval(fromdd, todd);
  85. if(sSearchTerm > 30){
  86. model.alert("근무시간에는 1달 이상 조회할 수 없습니다.");
  87. return;
  88. }
  89. }
  90. }
  91. model.setValue("/root/send/todd" , todd );
  92. model.setValue("/root/send/fromdd" , fromdd );
  93. model.setValue("/root/send/subdeptcd", subdeptcd);
  94. model.setValue("/root/send/orddrid" , orddrid );
  95. model.setValue("/root/send/search", search);
  96. model.setValue("/root/send/searchcond", searchcond);
  97. model.setValue("/root/send/secprcpyn", secprcpyn);
  98. model.removeNodeSet("/root/main/avgoptminfo/avgoptmlist");
  99. grd_avgoptmlst.refresh();
  100. if(submit("TRMCT00204")){
  101. }else{
  102. model.alert("수술명단 조회 시 서버 오류가 발생되었습니다.");
  103. return;
  104. }
  105. }
  106. /**
  107. * @group :
  108. * @ver : 2009-09-15 오후 6:45:47
  109. * @by :
  110. * @---------------------------------------------------
  111. * @type : function
  112. * @access : public
  113. * @desc : 진료과 변경시 의사 조회 이벤트
  114. * @param :
  115. * @return :
  116. * @---------------------------------------------------
  117. */
  118. function fValueChangedOrddrCombo(){
  119. var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // 대표/분과/서브 구분
  120. var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // 센터/대표 구분
  121. var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // 상위부서코드
  122. var sorddeptflag = "";
  123. if (sorddeptkind == "C") { // 센터이면
  124. sorddeptflag = "C";
  125. } else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  126. sorddeptflag = "A";
  127. } else { // 그외에 기타과
  128. sorddeptflag = "etc";
  129. }
  130. if(model.getValue("/root/main/condition/subdeptcd") == ""){
  131. model.setValue("/root/main/condition/orddrid","");
  132. cmb_orddrid.refresh();
  133. }
  134. model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag);
  135. model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd);
  136. model.makeValue("/root/send/reqdata/prcpspecflag", "Y");
  137. model.makeValue("/root/send/reqdata/orddd", getCurrentDate());
  138. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/condition/subdeptcd"));
  139. submit("TRMNO00104"); // 의사리스트 조회
  140. addComboItem("cmb_orddrid");
  141. }
  142. /**
  143. * @group :
  144. * @ver : 2009-09-23 오후 3:17:39
  145. * @by :
  146. * @---------------------------------------------------
  147. * @type : function
  148. * @access : public
  149. * @desc : Excel 저장 버튼 클릭 시
  150. * @param :
  151. * @return :
  152. * @---------------------------------------------------
  153. */
  154. function fOnClickExcelBtn(){
  155. fileName = window.fileDialog("save", ",", false, "임상과별 수술명별 평균 수술시간_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  156. if (fileName != "" && fileName != null) {
  157. grd_avgoptmlst.saveExcel(fileName, "SheetName", true, true, "", "", false);
  158. }
  159. }