SMMNV99000.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* ---------------------------------------------------------------------
  2. 대기안내 환자진행현황 (대기안내공통 - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By YeoWon Lim
  6. : 2015.05.02
  7. ----------------------------------------------------------------------*/
  8. var clockID ; // 하단줄의 시간 interval
  9. var grdintervalID ; // 그리드 조회 interval
  10. /**
  11. * @group :
  12. * @ver : 2008.02.13
  13. * @by : 임여원
  14. * @---------------------------------------------------
  15. * @type : function
  16. * @access : public
  17. * @desc : 대기안내 환자조회화면초기화
  18. * @param :
  19. * @param :
  20. * @return :
  21. * @---------------------------------------------------
  22. */
  23. function fInitialize(){
  24. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  25. fSetGrdTimer();
  26. }
  27. /**
  28. * @group :
  29. * @ver : 2007.10.09
  30. * @by : 문창곤
  31. * @---------------------------------------------------
  32. * @type : function
  33. * @access : public
  34. * @desc : 지정된 시간간격마다 그리드데이터 조회(화면 호출시 처음만 호출된다)
  35. * @param :
  36. * @param :
  37. * @return :
  38. * @---------------------------------------------------
  39. */
  40. function fSetGrdTimer(){
  41. clockID = window.setInterval("clock();" , 1000); //1초
  42. grdintervalID = window.setInterval("fGetOpdOrdRoomInfo();", 5000); //5초
  43. }
  44. /* --------------------------------------------------*/
  45. /* type : function */
  46. /* access : public */
  47. /* desc : 외래 진료실 진행현황 조회 */
  48. /* --------------------------------------------------*/
  49. function fGetOpdOrdRoomInfo(){
  50. var sPath = "/root/main/opdinfo";
  51. model.removenode("/root/send");
  52. model.makeValue("/root/send/bizdd", model.getValue("/root/main/cond/bizdd"));
  53. setErrorOff();
  54. if (submit("TRMNV99001",false)) {
  55. model.setValue("/root/main/cond/bizdd", getCurrentDate());
  56. model.refresh();
  57. } else {
  58. model.refresh();
  59. }
  60. }
  61. /**
  62. * @group :
  63. * @ver : 2007.10.09
  64. * @by : 문창곤
  65. * @---------------------------------------------------
  66. * @type : function
  67. * @access : public
  68. * @desc : DataTime 조회.
  69. * @param :
  70. * @param :
  71. * @return :
  72. * @---------------------------------------------------
  73. */
  74. function clock() {
  75. var tdate = getCurrentDateTime().substring(0, 4) + "년 "
  76. + getCurrentDateTime().substring(4, 6) + "월 "
  77. + getCurrentDateTime().substring(6, 8) + "일 "
  78. + getCurrentDate().toDate().getDayOfWeek("K") + "요일 ";
  79. var ttime = getCurrentDateTime().substring(8, 11) + ":"
  80. + getCurrentDateTime().substring(11, 13) + ":" +getCurrentDateTime().substring(13, 15);
  81. model.setValue("/root/hidden/date", tdate) ;
  82. model.setValue("/root/hidden/time", ttime) ;
  83. model.refresh();
  84. }
  85. /**
  86. * @group :
  87. * @ver : 2007.10.09
  88. * @by : 문창곤
  89. * @---------------------------------------------------
  90. * @type : function
  91. * @access : public
  92. * @desc : 'ESC' or 'Q' 키를 누르면 타이머 해제 및 윈도우 닫기
  93. * @param :
  94. * @param :
  95. * @return :
  96. * @---------------------------------------------------
  97. */
  98. function fClearTimer(){
  99. var keyPressed = event.keyCode ;
  100. if(keyPressed == 27 || keyPressed == 81) // 'ESC' or 'Q' 키가 눌려진 경우
  101. {
  102. var answer = messageBox("진행현황 안내 프로그램 종료합니다.", "I") ;
  103. if(answer == 1) {
  104. fCloseBoard();
  105. }
  106. }
  107. }
  108. function fCloseBoard(){
  109. if (clockID != "") window.clearInterval(clockID);
  110. if (msgintervalID != "") window.clearInterval(msgintervalID);
  111. if (grdintervalID != "") window.clearInterval(grdintervalID);
  112. if (msgintervalIDTop != "") window.clearInterval(msgintervalIDTop);
  113. if (grdintervalIDTop != "") window.clearInterval(grdintervalIDTop);
  114. model.close() ;
  115. }