SMMCT00200.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /* ---------------------------------------------------------------------
  2. 수술방별 가동율 (SMMCT00200.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2009-09-21 오전 8:53:33
  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/oproomuserateinfo/oproomuseratelist");
  26. grd_oproomuseratelst.refresh();
  27. model.removeNodeSet("/root/main/opdeptdoctopinfo/opdeptdoctoplist");
  28. grd_opdeptdoctlist.refresh();
  29. var instcd = getUserInfo("dutplceinstcd");
  30. var rslt_ref = "/root/init/orddeptlist";
  31. //model.setValue("/root/main/cond/orddeptcd", "%");
  32. model.setValue("/root/main/condition/orddrid", "");
  33. //zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate);
  34. submit("TRMCT00208");
  35. //수술방 정보 조회
  36. fGetOproomList();
  37. addComboItem("cmb_subdept");
  38. fValueChangedSchCombo();
  39. }
  40. /*
  41. * 1달을 자동 세팅되게 하는 함수
  42. * sDate : 일자(string)
  43. * iFlag : int 1/-1 (1달 이전/이후의 날짜 계산용도)
  44. */
  45. function fCalcDate(sDt,iFlag){
  46. var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D")
  47. //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- 해당요일
  48. rtnDate = sDate.getFullYear();
  49. rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
  50. rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
  51. return rtnDate;
  52. }
  53. /**
  54. * @group :
  55. * @ver : 2009-09-15 오후 6:45:47
  56. * @by :
  57. * @---------------------------------------------------
  58. * @type : function
  59. * @access : public
  60. * @desc : 조회
  61. * @param :
  62. * @return :
  63. * @---------------------------------------------------
  64. */
  65. function fClickSearchBtn(){
  66. model.resetInstanceNode("/root/send");
  67. var todd = model.getValue("/root/main/condition/todd");
  68. var fromdd = model.getValue("/root/main/condition/fromdd");
  69. var oproomcd = model.getValue("/root/main/condition/oproomcd");
  70. var subdeptcd = model.getValue("/root/main/condition/subdeptcd");
  71. var orddrid = model.getValue("/root/main/condition/orddrid");
  72. var inrmtm = model.getValue("/root/main/condition/inrmtm");
  73. var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091217
  74. if(fromdd == "" || fromdd == "undefined" || fromdd == null){
  75. model.alert("시작일자는 필수 입력 항목입니다.");
  76. return;
  77. }
  78. if(todd == "" || todd == "undefined" || todd == null){
  79. model.alert("종료일자는 필수 입력 항목입니다.");
  80. return;
  81. }
  82. //현재시간을 비교하여 근무시간 이후일 경우 6개월이상 조회가능 하도록 설정
  83. var sCurrentTm = getCurrentTime().substr(0,4);
  84. var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K");
  85. if(sCurrentDay == "월" || sCurrentDay == "화" || sCurrentDay == "수" ||
  86. sCurrentDay == "목" || sCurrentDay == "금"){
  87. //오후 5시 이전일 경우 조회 조건은 6달이상 조회되지 않도록 함.
  88. if(sCurrentTm < "1700"){
  89. var sSearchTerm = getDateInterval(fromdd, todd);
  90. if(sSearchTerm > 183){
  91. model.alert("근무시간에는 6개월 이상 조회할 수 없습니다.");
  92. return;
  93. }
  94. }
  95. }
  96. model.setValue("/root/send/todd" , todd );
  97. model.setValue("/root/send/fromdd" , fromdd );
  98. model.setValue("/root/send/oproomcd" , oproomcd );
  99. model.setValue("/root/send/subdeptcd", subdeptcd);
  100. model.setValue("/root/send/orddrid" , orddrid );
  101. model.setValue("/root/send/tab" , tab );
  102. model.setValue("/root/send/inrmtm" , inrmtm );
  103. model.removeNodeSet("/root/main/operpretcondinfo/operpretcondinfolist");
  104. grd_oproomuseratelst.refresh();
  105. if(tab == "R"){ //수술방별
  106. if(submit("TRMCT00200")){
  107. var iGridCnt = getNodesetCount("/root/main/oproomuserateinfo/oproomuseratelist");
  108. if(iGridCnt > 1){
  109. var iRegtm = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/regtm"));
  110. var iRealoptime = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/realoptime"));
  111. var iOptime = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/optime"));
  112. var sOprate = (Math.round((iOptime/iRegtm)*1000))/10;
  113. var sRealOprate = (Math.round((iRealoptime/iRegtm)*1000))/10;
  114. model.setValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/userate" ,sOprate);
  115. model.setValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/useratetotal",sRealOprate);
  116. grd_oproomuseratelst.refresh();
  117. }
  118. }
  119. }else if(tab == "D" || tab == "E"){ //과별 의사별, 과별 추가 by 박영우 20091217
  120. if(submit("TRMCT00206")){
  121. }
  122. }
  123. }
  124. /**
  125. * @group :
  126. * @ver : 2009-09-15 오후 6:45:47
  127. * @by :
  128. * @---------------------------------------------------
  129. * @type : function
  130. * @access : public
  131. * @desc : 진료과 변경시 의사 조회 이벤트
  132. * @param :
  133. * @return :
  134. * @---------------------------------------------------
  135. */
  136. function fValueChangedOrddrCombo(){
  137. var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // 대표/분과/서브 구분
  138. var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // 센터/대표 구분
  139. var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // 상위부서코드
  140. var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091217
  141. var sorddeptflag = "";
  142. if (sorddeptkind == "C") { // 센터이면
  143. sorddeptflag = "C";
  144. } else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  145. sorddeptflag = "A";
  146. } else { // 그외에 기타과
  147. sorddeptflag = "etc";
  148. }
  149. if(model.getValue("/root/main/condition/subdeptcd") == ""){
  150. model.setValue("/root/main/condition/orddrid","");
  151. cmb_orddrid.refresh();
  152. }
  153. model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag);
  154. model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd);
  155. model.makeValue("/root/send/reqdata/prcpspecflag", "Y");
  156. model.makeValue("/root/send/reqdata/orddd", getCurrentDate());
  157. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/condition/subdeptcd"));
  158. if(tab=="D") { //과,의사별일 경우에만 의사리스트 조회 by 박영우 20091217
  159. submit("TRMNO00104"); // 의사리스트 조회
  160. addComboItem("cmb_orddrid");
  161. }
  162. }
  163. /**
  164. * @group :
  165. * @ver : 2009-09-15 오후 6:45:47
  166. * @by :
  167. * @---------------------------------------------------
  168. * @type : function
  169. * @access : public
  170. * @desc : 검색 combo 변경시 이벤트
  171. * @param :
  172. * @return :
  173. * @---------------------------------------------------
  174. */
  175. function fValueChangedSchCombo(){
  176. var sTab = model.getValue("/root/main/condition/tab");
  177. if(sTab == "R"){ //방별
  178. //combo변경시 시간 재조정 by 박영우 20091222
  179. model.removenodeset("/root/main/oproomuserateinfo");
  180. model.setValue("/root/main/condition/inrmtm", "0800");
  181. caption7.visible = true;
  182. cmb_oproom.visible = true;
  183. caption14.visible = false;
  184. cmb_subdept.visible = false;
  185. caption1.visible = false;
  186. cmb_orddrid.visible = false;
  187. grd_oproomuseratelst.visible = true;
  188. grd_opdeptdoctlist.visible = false;
  189. model.refresh();
  190. }else if(sTab == "E"){ //과별 추가 by 박영우 20091216
  191. //combo변경시 그리드, 과별, 시간 재조정 by 박영우 20091222
  192. model.removenodeset("/root/main/opdeptdoctopinfo");
  193. model.setValue("/root/main/condition/subdeptcd", "");
  194. model.setValue("/root/main/condition/inrmtm", "0800");
  195. caption14.visible = true;
  196. cmb_subdept.visible = true;
  197. caption1.visible = false;
  198. cmb_orddrid.visible = false;
  199. caption7.visible = false;
  200. cmb_oproom.visible = false;
  201. grd_oproomuseratelst.visible = false;
  202. grd_opdeptdoctlist.visible = true;
  203. grd_opdeptdoctlist.colHidden(grd_opdeptdoctlist.colref("perfdrnm"))=true;
  204. model.refresh();
  205. }else if(sTab == "D"){
  206. //combo변경시 그리드, 과별, 의사별, 시간 재조정 by 박영우 20091222
  207. model.removenodeset("/root/main/opdeptdoctopinfo");
  208. model.setValue("/root/main/condition/subdeptcd", "");
  209. model.setValue("/root/main/condition/orddrid", "");
  210. model.setValue("/root/main/condition/inrmtm", "0800");
  211. caption14.visible = true;
  212. cmb_subdept.visible = true;
  213. caption1.visible = true;
  214. cmb_orddrid.visible = true;
  215. caption7.visible = false;
  216. cmb_oproom.visible = false;
  217. grd_oproomuseratelst.visible = false;
  218. grd_opdeptdoctlist.visible = true;
  219. grd_opdeptdoctlist.colHidden(grd_opdeptdoctlist.colref("perfdrnm"))=false;
  220. model.refresh();
  221. }
  222. }
  223. /**
  224. * @group :
  225. * @ver : 2009-09-15 오후 6:45:47
  226. * @by :
  227. * @---------------------------------------------------
  228. * @type : function
  229. * @access : public
  230. * @desc : 수술방 정보 조회
  231. * @param :
  232. * @return :
  233. * @---------------------------------------------------
  234. */
  235. function fGetOproomList(){
  236. model.setValue("/root/send/fromdd" , getCurrentDate() );
  237. //현재일자에 유효한 수술방을 조회한다.
  238. submit("TRMCT00207");
  239. addComboItem("cmb_oproom");
  240. }