SMMNH06500.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /*
  2. 호스피스대기환자현황(SMMNH06500.xrw)
  3. - Version : 1.00.01
  4. */
  5. /**
  6. * @group :
  7. * @ver : 2010.05.27
  8. * @by : byday
  9. * @---------------------------------------------------
  10. * @type : function
  11. * @access : public
  12. * @desc : 초기화 (
  13. * @param :
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fInit(){
  19. model.makeValue("/root/main/cond/bgndt", getCurrentDate());
  20. model.makeValue("/root/main/cond/tempdt", getCurrentDate());
  21. model.makeValue("/root/main/cond/enddt", getCurrentDate());
  22. btn_search.dispatch("DOMActivate");
  23. }
  24. /**
  25. * @group :
  26. * @ver : 2010.05.27
  27. * @by : byday
  28. * @---------------------------------------------------
  29. * @type : function
  30. * @access : public
  31. * @desc : 조회 (
  32. * @param :
  33. * @param :
  34. * @return :
  35. * @---------------------------------------------------
  36. */
  37. function fSearch(){
  38. var nSwIdx = switch1.selectedIndex;
  39. var bgnYear = model.getValue("/root/main/cond/bgndt").substring(0, 4);
  40. var endYear = model.getValue("/root/main/cond/enddt").substring(0, 4);
  41. if ( nSwIdx == 0 ) {
  42. if ( bgnYear == 0 ) {
  43. messageBox("조회시작년도를 입력하세요..", "I");
  44. return;
  45. }
  46. if ( endYear == 0 ) {
  47. messageBox("조회종료년도를 입력하세요..", "I");
  48. return;
  49. }
  50. if ( endYear < bgnYear ) {
  51. messageBox("조회시작년도가 조회종료년도보다 클 수 없습니다..", "I");
  52. return;
  53. }
  54. if ( endYear - bgnYear > 2) {
  55. messageBox("해당 조회기간을 3년이내로 설정하십시오.", "I");
  56. return;
  57. }
  58. } else if ( nSwIdx == 1 ) {
  59. if ( bgnYear == 0 ) {
  60. messageBox("조회년도를 입력하세요..", "I");
  61. return;
  62. }
  63. } else if ( nSwIdx == 2 ) {
  64. var tempDt = model.getValue("/root/main/cond/tempdt").substring(0, 6);
  65. if ( tempDt == 0 ) {
  66. messageBox("조회월을 입력하세요..", "I");
  67. return;
  68. }
  69. model.setValue("/root/main/cond/bgndt", tempDt);
  70. }
  71. model.removenode("/root/main/agonal");
  72. submit("TRMNH06501");
  73. if ( nSwIdx == 2 ) { // 일별
  74. grd_list2.colWidth(grd_list2.cols - 2) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "" ? 0 : 60);
  75. grd_list2.colWidth(grd_list2.cols - 3) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "" ? 0 : 60);
  76. grd_list2.colWidth(grd_list2.cols - 4) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "" ? 0 : 60);
  77. //grd_list2.colHidden(grd_list2.cols - 2) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "");
  78. //grd_list2.colHidden(grd_list2.cols - 3) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "");
  79. //grd_list2.colHidden(grd_list2.cols - 4) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "");
  80. } else if ( nSwIdx == 0 ) { // 년별
  81. var cap1 = "구분^상세구분";
  82. var cap2 = "구분^상세구분";
  83. for ( var nCnt = grd_list0.fixedCols; nCnt < grd_list0.cols; nCnt++ ) {
  84. grd_list0.colWidth(nCnt) = 0;
  85. //grd_list0.colHidden(nCnt) = true;
  86. }
  87. for ( var nCnt = endYear, nPos = 0; nCnt >= bgnYear; nCnt--, nPos++ ) {
  88. cap1 += "^ " + nCnt + " ^ " + nCnt + " ^ " + nCnt + " ";
  89. cap2 += "^ " + nCnt + "년 ^ " + (nCnt-1) + "년 ^ 증감(%) ";
  90. grd_list0.colHidden(nPos * 3 + grd_list0.fixedCols) = false;
  91. grd_list0.colHidden(nPos * 3 + 1 + grd_list0.fixedCols) = false;
  92. grd_list0.colHidden(nPos * 3 + 2 + grd_list0.fixedCols) = false;
  93. grd_list0.colWidth(nPos * 3 + grd_list0.fixedCols) = 90;
  94. grd_list0.colWidth(nPos * 3 + 1 + grd_list0.fixedCols) = 90;
  95. grd_list0.colWidth(nPos * 3 + 2 + grd_list0.fixedCols) = 90;
  96. }
  97. grd_list0.caption = cap1 + "|" + cap2;
  98. }
  99. model.refresh();
  100. }
  101. /**
  102. * @group :
  103. * @ver : 2010.06.07
  104. * @by : byday
  105. * @---------------------------------------------------
  106. * @type : function
  107. * @access : public
  108. * @desc : 년도별조회 (
  109. * @param :
  110. * @param :
  111. * @return :
  112. * @---------------------------------------------------
  113. */
  114. function fSearchYear() {
  115. model.toggle("case1");
  116. ipt_bgndt.visible = true;
  117. ipt_bgndt2.visible = false;
  118. cap_tilde.visible = true;
  119. ipt_enddt.visible = true;
  120. cap_search.text = "조회년도 :";
  121. model.setValue("/root/main/cond/dtflag", "Y");
  122. btn_search.dispatch("DOMActivate");
  123. }
  124. /**
  125. * @group :
  126. * @ver : 2010.06.07
  127. * @by : byday
  128. * @---------------------------------------------------
  129. * @type : function
  130. * @access : public
  131. * @desc : 월별조회 (
  132. * @param :
  133. * @param :
  134. * @return :
  135. * @---------------------------------------------------
  136. */
  137. function fSearchMonth() {
  138. model.toggle("case2");
  139. ipt_bgndt.visible = true;
  140. ipt_bgndt2.visible = false;
  141. cap_tilde.visible = false;
  142. ipt_enddt.visible = false;
  143. cap_search.text = "조회년도 :";
  144. model.setValue("/root/main/cond/dtflag", "M");
  145. btn_search.dispatch("DOMActivate");
  146. }
  147. /**
  148. * @group :
  149. * @ver : 2010.06.07
  150. * @by : byday
  151. * @---------------------------------------------------
  152. * @type : function
  153. * @access : public
  154. * @desc : 일별조회 (
  155. * @param :
  156. * @param :
  157. * @return :
  158. * @---------------------------------------------------
  159. */
  160. function fSearchDay() {
  161. model.toggle("case3");
  162. ipt_bgndt.visible = false;
  163. ipt_bgndt2.visible = true;
  164. cap_tilde.visible = false;
  165. ipt_enddt.visible = false;
  166. cap_search.text = "조회년월 :";
  167. model.setValue("/root/main/cond/dtflag", "D");
  168. btn_search.dispatch("DOMActivate");
  169. }
  170. /**
  171. * @desc : excel 저장 하기
  172. * @
  173. * @param :
  174. * @return :
  175. * @authur : 이은영 2008.07.14
  176. * @---------------------------------------------------
  177. */
  178. function fExcel(gridObj, title){
  179. if (title == null) { title = "" }
  180. var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  181. if (fileName != "") {
  182. gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
  183. }
  184. }