SSMNP01100.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /* ---------------------------------------------------------------------
  2. 응급수술현황 통계 (SSMNP01100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2008-11-19 오후 3:07:20
  7. ---------------------------------------------------------------------- */
  8. /**
  9. * @group :
  10. * @ver : 2008-09-23 오후 4:20:36
  11. * @by :
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 초기화
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInit(){
  21. model.setValue("/root/hidden/condition/frdd", getCurrentDate());
  22. model.setValue("/root/hidden/condition/todd" , getCurrentDate());
  23. model.refresh();
  24. //2010-03-10 오후 6:06:58 taebum add 연으로만 조회됨 오류 올라온건 관련 수정작업
  25. model.setValue("/root/temp/org_searfromdd", getCurrentDate());
  26. model.refresh();
  27. model.setValue("/root/init/tab", "dept");
  28. model.toggle("case1");
  29. model.removeNodeSet("/root/main/deptlists/deptlist");
  30. datagrid1.refresh();
  31. model.removeNodeSet("/root/main/monthlists/monthlist");
  32. datagrid2.refresh();
  33. model.removeNodeSet("/root/main/roomlists/roomlist");
  34. datagrid3.refresh();
  35. model.removeNodeSet("/root/main/weeklists/weeklist");
  36. datagrid4.refresh();
  37. }
  38. function fOnClickSearchBtn(){
  39. var sCurrentTab = model.getValue("/root/init/tab");
  40. if(sCurrentTab == "" || sCurrentTab == null || sCurrentTab == "undefined"){
  41. return;
  42. }
  43. model.setValue("/root/send/frdd", model.getValue("/root/hidden/condition/frdd"));
  44. model.setValue("/root/send/todd", model.getValue("/root/hidden/condition/todd"));
  45. model.setValue("/root/send/anstflag1", model.getValue("/root/hidden/condition/anstflag1"));
  46. model.setValue("/root/send/anstflag2", model.getValue("/root/hidden/condition/anstflag2"));
  47. model.setValue("/root/send/anstflag3", model.getValue("/root/hidden/condition/anstflag3"));
  48. model.setValue("/root/send/etcflag1", model.getValue("/root/hidden/condition/etcflag1"));
  49. model.setValue("/root/send/etcflag2", model.getValue("/root/hidden/condition/etcflag2"));
  50. model.setValue("/root/send/etcflag3", model.getValue("/root/hidden/condition/etcflag3"));
  51. switch(sCurrentTab){
  52. case "dept" :
  53. if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){
  54. messageBox("시작일, 종료일은 필수입력 사항입니다.", "I000");
  55. return;
  56. }
  57. if((model.getValue("/root/send/frdd")).length < 8){
  58. messageBox("시작일 입력형식은 년-월-일 입니다.", "I000");
  59. return;
  60. }
  61. model.removeNodeSet("/root/main/deptlists/deptlist");
  62. datagrid1.refresh();
  63. if(submit("TRSNP01100")){
  64. //진료과 갯수를 count하여 진료과명이 없는 Line은 width를 0으로 줄인다.
  65. var iGridCnt = getNodesetCnt(model, "/root/main/deptlists/deptlist");
  66. fHiddenGridCol(iGridCnt, datagrid1);
  67. }
  68. break;
  69. case "month" :
  70. if(model.getValue("/root/send/frdd") == "" || (model.getValue("/root/send/frdd")).length < 4){
  71. messageBox("년도는 필수입력 사항입니다.", "I000");
  72. return;
  73. }
  74. model.removeNodeSet("/root/main/monthlists/monthlist");
  75. datagrid2.refresh();
  76. submit("TRSNP01101");
  77. break;
  78. case "room" :
  79. if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){
  80. messageBox("시작일, 종료일은 필수입력 사항입니다.", "I000");
  81. return;
  82. }
  83. if((model.getValue("/root/send/frdd")).length < 8){
  84. messageBox("시작일 입력형식은 년-월-일 입니다.", "I000");
  85. return;
  86. }
  87. model.removeNodeSet("/root/main/roomlists/roomlist");
  88. datagrid3.refresh();
  89. if(submit("TRSNP01102")){
  90. var iGridCnt = getNodesetCnt(model, "/root/main/roomlists/roomlist");
  91. fHiddenGridCol(iGridCnt, datagrid3);
  92. }
  93. break;
  94. case "day" :
  95. if(model.getValue("/root/send/frdd") == "" || model.getValue("/root/send/todd") == ""){
  96. messageBox("시작일, 종료일은 필수입력 사항입니다.", "I000");
  97. return;
  98. }
  99. if((model.getValue("/root/send/frdd")).length < 8){
  100. messageBox("시작일 입력형식은 년-월-일 입니다.", "I000");
  101. return;
  102. }
  103. model.removeNodeSet("/root/main/weeklists/weeklist");
  104. datagrid4.refresh();
  105. submit("TRSNP01103");
  106. break;
  107. default :
  108. break;
  109. }
  110. }
  111. /**
  112. * 탭 버튼 클릭시 이벤트
  113. *
  114. */
  115. function fClickTab(pFlag){
  116. if(pFlag == "dept"){
  117. model.setValue("/root/init/tab", "dept");
  118. ipt_refcond.visible = true;
  119. caption1.visible = true;
  120. input1.visible = true;
  121. ipt_refcond.attribute("maxlength")= 8;
  122. ipt_refcond.attribute("format")= "yyyy-mm-dd";
  123. //2010-03-10 오후 6:06:58 taebum add 연으로만 조회됨 오류 올라온건 관련 수정작업
  124. if((model.getValue("/root/hidden/condition/frdd")).length < 5){
  125. model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd"));
  126. model.refresh();
  127. }
  128. }else if(pFlag == "month"){
  129. model.setValue("/root/init/tab", "month");
  130. ipt_refcond.visible = true;
  131. caption1.visible = false;
  132. input1.visible = false;
  133. ipt_refcond.attribute("maxlength")= 4;
  134. ipt_refcond.attribute("format")= "yyyy";
  135. model.setValue("/root/hidden/condition/frdd", (model.getValue("/root/hidden/condition/frdd").substr(0,4)));
  136. ipt_refcond.refresh();
  137. }else if(pFlag == "room"){
  138. model.setValue("/root/init/tab", "room");
  139. ipt_refcond.visible = true;
  140. caption1.visible = true;
  141. input1.visible = true;
  142. ipt_refcond.attribute("maxlength")= 8;
  143. ipt_refcond.attribute("format")= "yyyy-mm-dd";
  144. //2010-03-10 오후 6:06:58 taebum add 연으로만 조회됨 오류 올라온건 관련 수정작업
  145. if((model.getValue("/root/hidden/condition/frdd")).length < 7){
  146. model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd"));
  147. model.refresh();
  148. }
  149. }else if(pFlag == "day"){
  150. model.setValue("/root/init/tab", "day");
  151. ipt_refcond.visible = true;
  152. caption1.visible = true;
  153. input1.visible = true;
  154. ipt_refcond.attribute("maxlength")= 8;
  155. ipt_refcond.attribute("format")= "yyyy-mm-dd";
  156. //2010-03-10 오후 6:06:58 taebum add 연으로만 조회됨 오류 올라온건 관련 수정작업
  157. if((model.getValue("/root/hidden/condition/frdd")).length < 7){
  158. model.setValue("/root/hidden/condition/frdd", model.getValue("/root/temp/org_searfromdd"));
  159. model.refresh();
  160. }
  161. }
  162. }
  163. /**
  164. * @group :
  165. * @ver : 2007.10.17
  166. * @by : Grace
  167. * @---------------------------------------------------
  168. * @type : function
  169. * @access : public
  170. * @desc : Exel 저장
  171. * @param :
  172. * @return :
  173. * @---------------------------------------------------
  174. */
  175. function fSaveExcel(){
  176. var sCurrentTab = model.getValue("/root/init/tab");
  177. if(sCurrentTab == "" || sCurrentTab == null || sCurrentTab == "undefined"){
  178. return;
  179. }
  180. var fileName = null;
  181. switch(sCurrentTab){
  182. case "dept" :
  183. fileName = window.fileDialog("save", ",", false, "응급수술현황_집도과별_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  184. if (fileName != "" && fileName != null) {
  185. datagrid1.saveExcel(fileName, "SheetName", true, true, "", "", false);
  186. }
  187. break;
  188. case "month" :
  189. fileName = window.fileDialog("save", ",", false, "응급수술현황_월별_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  190. if (fileName != "" && fileName != null) {
  191. datagrid2.saveExcel(fileName, "SheetName", true, true, "", "", false);
  192. }
  193. break;
  194. case "room" :
  195. fileName = window.fileDialog("save", ",", false, "응급수술현황_방별_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  196. if (fileName != "" && fileName != null) {
  197. datagrid3.saveExcel(fileName, "SheetName", true, true, "", "", false);
  198. }
  199. break;
  200. case "day" :
  201. fileName = window.fileDialog("save", ",", false, "응급수술현황_요일별_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  202. if (fileName != "" && fileName != null) {
  203. datagrid3.saveExcel(fileName, "SheetName", true, true, "", "", false);
  204. }
  205. break;
  206. default :
  207. break;
  208. }
  209. }
  210. /**
  211. * @group :
  212. * @ver : 2007.10.17
  213. * @by :
  214. * @---------------------------------------------------
  215. * @type : function
  216. * @access : public
  217. * @desc : 그리드의 1행에 데이터 없는 열 감추기
  218. * @param :
  219. * @return :
  220. * @---------------------------------------------------
  221. */
  222. function fHiddenGridCol(iGridCnt, pGrid){
  223. if(iGridCnt >1){
  224. for(var i = 1; i < pGrid.cols; i++){
  225. if(pGrid.valuematrix(1, i) == ""){
  226. pGrid.colwidth(i) = 0;
  227. }
  228. }
  229. }
  230. }