SMMNH06400.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. 호스피스의뢰환자현황(SMMNH06400.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("TRMNH06401");
  73. if ( nSwIdx == 2 ) { // 일별
  74. grd_list2.colWidth(grd_list2.cols - 3) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "" ? 0 : 50);
  75. grd_list2.colWidth(grd_list2.cols - 4) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "" ? 0 : 50);
  76. grd_list2.colWidth(grd_list2.cols - 5) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "" ? 0 : 50);
  77. grd_list2.colWidth(grd_list2.cols - 6) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "" ? 0 : 50);
  78. grd_list2.colWidth(grd_list2.cols - 7) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "" ? 0 : 50);
  79. grd_list2.colWidth(grd_list2.cols - 8) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "" ? 0 : 50);
  80. //grd_list2.colHidden(grd_list2.cols - 3) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "");
  81. //grd_list2.colHidden(grd_list2.cols - 4) = (model.getValue("/root/main/agonal/list[1]/cnt31") == "");
  82. //grd_list2.colHidden(grd_list2.cols - 5) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "");
  83. //grd_list2.colHidden(grd_list2.cols - 6) = (model.getValue("/root/main/agonal/list[1]/cnt30") == "");
  84. //grd_list2.colHidden(grd_list2.cols - 7) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "");
  85. //grd_list2.colHidden(grd_list2.cols - 8) = (model.getValue("/root/main/agonal/list[1]/cnt29") == "");
  86. } else if ( nSwIdx == 0 ) { // 년별
  87. var cap1 = "의뢰경로^과^주치의";
  88. var cap2 = "의뢰경로^과^주치의";
  89. for ( var nCnt = grd_list0.fixedCols; nCnt < grd_list0.cols; nCnt++ ){
  90. grd_list0.colWidth(nCnt) = 0;
  91. //grd_list0.colHidden(nCnt) = true;
  92. }
  93. for ( var nCnt = endYear, nPos = 0; nCnt >= bgnYear; nCnt--, nPos++ ) {
  94. cap1 += "^ " + nCnt + " ^ " + nCnt + " ^ " + nCnt + " ^ " + nCnt + " ^ " + nCnt + " ";
  95. cap2 += "^ " + nCnt + "년 ^%^ " + (nCnt-1) + "년 ^%^ 증감(%) ";
  96. grd_list0.colHidden(nPos * 5 + grd_list0.fixedCols) = false;
  97. grd_list0.colHidden(nPos * 5 + 1 + grd_list0.fixedCols) = false;
  98. grd_list0.colHidden(nPos * 5 + 2 + grd_list0.fixedCols) = false;
  99. grd_list0.colHidden(nPos * 5 + 3 + grd_list0.fixedCols) = false;
  100. grd_list0.colHidden(nPos * 5 + 4 + grd_list0.fixedCols) = false;
  101. grd_list0.colWidth(nPos * 5 + grd_list0.fixedCols) = 90;
  102. grd_list0.colWidth(nPos * 5 + 1 + grd_list0.fixedCols) = 90;
  103. grd_list0.colWidth(nPos * 5 + 2 + grd_list0.fixedCols) = 90;
  104. grd_list0.colWidth(nPos * 5 + 3 + grd_list0.fixedCols) = 90;
  105. grd_list0.colWidth(nPos * 5 + 4 + grd_list0.fixedCols) = 90;
  106. }
  107. grd_list0.caption = cap1 + "|" + cap2;
  108. }
  109. model.refresh();
  110. }
  111. /**
  112. * @group :
  113. * @ver : 2010.06.07
  114. * @by : byday
  115. * @---------------------------------------------------
  116. * @type : function
  117. * @access : public
  118. * @desc : 년도별조회 (
  119. * @param :
  120. * @param :
  121. * @return :
  122. * @---------------------------------------------------
  123. */
  124. function fSearchYear() {
  125. model.toggle("case1");
  126. ipt_bgndt.visible = true;
  127. ipt_bgndt2.visible = false;
  128. cap_tilde.visible = true;
  129. ipt_enddt.visible = true;
  130. cap_search.text = "조회년도 :";
  131. model.setValue("/root/main/cond/dtflag", "Y");
  132. btn_search.dispatch("DOMActivate");
  133. }
  134. /**
  135. * @group :
  136. * @ver : 2010.06.07
  137. * @by : byday
  138. * @---------------------------------------------------
  139. * @type : function
  140. * @access : public
  141. * @desc : 월별조회 (
  142. * @param :
  143. * @param :
  144. * @return :
  145. * @---------------------------------------------------
  146. */
  147. function fSearchMonth() {
  148. model.toggle("case2");
  149. ipt_bgndt.visible = true;
  150. ipt_bgndt2.visible = false;
  151. cap_tilde.visible = false;
  152. ipt_enddt.visible = false;
  153. cap_search.text = "조회년도 :";
  154. model.setValue("/root/main/cond/dtflag", "M");
  155. btn_search.dispatch("DOMActivate");
  156. }
  157. /**
  158. * @group :
  159. * @ver : 2010.06.07
  160. * @by : byday
  161. * @---------------------------------------------------
  162. * @type : function
  163. * @access : public
  164. * @desc : 일별조회 (
  165. * @param :
  166. * @param :
  167. * @return :
  168. * @---------------------------------------------------
  169. */
  170. function fSearchDay() {
  171. model.toggle("case3");
  172. ipt_bgndt.visible = false;
  173. ipt_bgndt2.visible = true;
  174. cap_tilde.visible = false;
  175. ipt_enddt.visible = false;
  176. cap_search.text = "조회년월 :";
  177. model.setValue("/root/main/cond/dtflag", "D");
  178. btn_search.dispatch("DOMActivate");
  179. }
  180. /**
  181. * @desc : excel 저장 하기
  182. * @
  183. * @param :
  184. * @return :
  185. * @authur : 이은영 2008.07.14
  186. * @---------------------------------------------------
  187. */
  188. function fExcel(gridObj, title){
  189. if (title == null) { title = "" }
  190. var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  191. if (fileName != "") {
  192. gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
  193. }
  194. }