SMMND02000.xjs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[
  3. // header파일 중 SMMND02000.js 파일 시작
  4. /*
  5. HD 업무현황 (SMMND02000.xrw - JScript )
  6. - Version :
  7. 1) : Ver.1.00.01
  8. */
  9. //**전역변수**//
  10. /**
  11. * _group :
  12. * _ver : 2007.07.11
  13. * _by : 김진아
  14. * _---------------------------------------------------
  15. * _type : function
  16. * _access : public
  17. * _desc : 화면 초기화
  18. * _param :
  19. * _return :
  20. * _---------------------------------------------------
  21. */
  22. function fDone(){
  23. var currentDate = utlf_getCurrentDate(); // 현재일자
  24. var sCurrentDate = new Date();
  25. ds_main_condition.setColumn( 0, "srchtodd" , currentDate); // 현재일자
  26. ds_main_condition.setColumn( 0, "srchfromdd", (sCurrentDate.getAddDate(-1, "M")).getDateFormat()); // 한 달 이전 일자
  27. //model.refresh();
  28. fSrchBizPresCond(); // 업무현황 조회
  29. }
  30. /**
  31. * _group :
  32. * _ver : 2007.08.13
  33. * _by : 김진아
  34. * _---------------------------------------------------
  35. * _type : function
  36. * _access : public
  37. * _desc : 업무현황 조회
  38. * _param :
  39. * _return :
  40. * _---------------------------------------------------
  41. */
  42. function fSrchBizPresCond(){
  43. var TmpPath = ds_tmp_tmpbizprescondlist_tmpbizprescondinfo; // (Tmp)
  44. var bizPresCondPath = ds_main_bizprescondstatslist_bizprescondstatsinfo; // 업무현황통계
  45. var patPresCondHDPath_1 = ds_main_patprescondstatslist_patprescondstatsinfo; //[1]"; // 환자현황통계 (HD)
  46. var patPresCondPDPath_2 = ds_main_patprescondstatslist_patprescondstatsinfo; //[2]"; // 환자현황통계 (PD)
  47. var patPresCondSumPath_3 = ds_main_patprescondstatslist_patprescondstatsinfo; //[3]"; // 환자현황통계 (Total)
  48. var HDStatsPath = ds_main_hdstatslist_hdstatsinfo; // 혈액투석 현황통계
  49. var PDStatsPath = ds_main_pdstatslist_pdstatsinfo; // 복막투석 현황통계
  50. var PDBizStatsPath = ds_main_pdbizstatslist_pdbizstatsinfo; // 복막투석업무 현황통계
  51. ds_send_reqdata.clearData();
  52. dsf_makeValue( ds_send_reqdata, "srchfromdd", "string", ds_main_condition.getColumn(0, "srchfromdd"));
  53. dsf_makeValue( ds_send_reqdata, "srchtodd", "string", ds_main_condition.getColumn(0, "srchtodd") );
  54. ds_tmp_tmpbizprescondlist.clearData();
  55. //submit("TRMND02001");
  56. var oParam = {};
  57. oParam.id = "TRMND02001";
  58. oParam.service = "dialapp.DialSpcl";
  59. oParam.method = "reqGetBizPresCondInfo";
  60. oParam.inds = "req=ds_send_reqdata";
  61. oParam.outds = "ds_tmp_tmpbizprescondlist_tmpbizprescondinfo=bizprescondinfo";
  62. oParam.async = false;
  63. tranf_submit(oParam);
  64. //** 조회된 값 설정 **//
  65. //* 업무 현황통계 *//
  66. // 입원
  67. i = 0;
  68. bizPresCondPath.setColumn(i, "hdbizprescnt" , TmpPath.getColumn(0, "hdinbizprescnt"));
  69. bizPresCondPath.setColumn(i, "pdbizprescnt" , TmpPath.getColumn(0, "pdinbizprescnt"));
  70. bizPresCondPath.setColumn(i, "hpbizprescnt" , TmpPath.getColumn(0, "hpinbizprescnt"));
  71. bizPresCondPath.setColumn(i, "hdfbizprescnt" , TmpPath.getColumn(0, "hdfinbizprescnt"));
  72. //2011.07.28 by kya SLED 항목추가
  73. bizPresCondPath.setColumn(i, "sledbizprescnt" , TmpPath.getColumn(0, "sledinbizprescnt"));
  74. //2012.02.13 by kya CRRT 항목추가
  75. bizPresCondPath.setColumn(i, "crrtbizprescnt" , TmpPath.getColumn(0, "crrtinbizprescnt"));
  76. bizPresCondPath.setColumn(i, "totalbizprescnt", TmpPath.getColumn(0, "totalinbizprescnt"));
  77. // 중환자실
  78. i = 1;
  79. bizPresCondPath.setColumn(i, "hdbizprescnt" , TmpPath.getColumn(0, "hdicubizprescnt"));
  80. bizPresCondPath.setColumn(i, "pdbizprescnt" , TmpPath.getColumn(0, "pdicubizprescnt"));
  81. bizPresCondPath.setColumn(i, "hpbizprescnt" , TmpPath.getColumn(0, "hpicubizprescnt"));
  82. bizPresCondPath.setColumn(i, "hdfbizprescnt" , TmpPath.getColumn(0, "hdficubizprescnt"));
  83. //2011.07.28 by kya SLED 항목추가
  84. bizPresCondPath.setColumn(i, "sledbizprescnt" , TmpPath.getColumn(0, "sledicubizprescnt"));
  85. //2012.02.13 by kya CRRT 항목추가
  86. bizPresCondPath.setColumn(i, "crrtbizprescnt" , TmpPath.getColumn(0, "crrticubizprescnt"));
  87. bizPresCondPath.setColumn(i, "totalbizprescnt", TmpPath.getColumn(0, "totalicubizprescnt"));
  88. // 외래
  89. i = 2;
  90. bizPresCondPath.setColumn(i, "hdbizprescnt" , TmpPath.getColumn(0, "hdoutbizprescnt"));
  91. bizPresCondPath.setColumn(i, "pdbizprescnt" , TmpPath.getColumn(0, "pdoutbizprescnt"));
  92. bizPresCondPath.setColumn(i, "hpbizprescnt" , TmpPath.getColumn(0, "hpoutbizprescnt"));
  93. bizPresCondPath.setColumn(i, "hdfbizprescnt" , TmpPath.getColumn(0, "hdfoutbizprescnt"));
  94. //2011.07.28 by kya SLED 항목추가
  95. bizPresCondPath.setColumn(i, "sledbizprescnt" , TmpPath.getColumn(0, "sledoutbizprescnt"));
  96. //2012.02.13 by kya CRRT 항목추가
  97. bizPresCondPath.setColumn(i, "crrtbizprescnt" , TmpPath.getColumn(0, "crrtoutbizprescnt"));
  98. bizPresCondPath.setColumn(i, "totalbizprescnt", TmpPath.getColumn(0, "totaloutbizprescnt"));
  99. // 응급실
  100. i = 3;
  101. bizPresCondPath.setColumn(i, "hdbizprescnt" , TmpPath.getColumn(0, "hderbizprescnt"));
  102. bizPresCondPath.setColumn(i, "pdbizprescnt" , TmpPath.getColumn(0, "pderbizprescnt"));
  103. bizPresCondPath.setColumn(i, "hpbizprescnt" , TmpPath.getColumn(0, "hperbizprescnt"));
  104. bizPresCondPath.setColumn(i, "hdfbizprescnt" , TmpPath.getColumn(0, "hdferbizprescnt"));
  105. //2011.07.28 by kya SLED 항목추가
  106. bizPresCondPath.setColumn(i, "sledbizprescnt" , TmpPath.getColumn(0, "slederbizprescnt"));
  107. //2012.02.13 by kya CRRT 항목추가
  108. bizPresCondPath.setColumn(i, "crrtbizprescnt" , TmpPath.getColumn(0, "crrterbizprescnt"));
  109. bizPresCondPath.setColumn(i, "totalbizprescnt", TmpPath.getColumn(0, "totalerbizprescnt"));
  110. // Total
  111. i = 4;
  112. bizPresCondPath.setColumn(i, "hdbizprescnt" , parseInt(TmpPath.getColumn(0, "hdinbizprescnt" ))
  113. + parseInt(TmpPath.getColumn(0, "hdicubizprescnt"))
  114. + parseInt(TmpPath.getColumn(0, "hdoutbizprescnt"))
  115. + parseInt(TmpPath.getColumn(0, "hderbizprescnt" )));
  116. bizPresCondPath.setColumn(i, "pdbizprescnt" , parseInt(TmpPath.getColumn(0, "pdinbizprescnt" ))
  117. + parseInt(TmpPath.getColumn(0, "pdicubizprescnt"))
  118. + parseInt(TmpPath.getColumn(0, "pdoutbizprescnt"))
  119. + parseInt(TmpPath.getColumn(0, "pderbizprescnt" )));
  120. bizPresCondPath.setColumn(i, "hpbizprescnt" , parseInt(TmpPath.getColumn(0, "hpinbizprescnt" ))
  121. + parseInt(TmpPath.getColumn(0, "hpicubizprescnt"))
  122. + parseInt(TmpPath.getColumn(0, "hpoutbizprescnt"))
  123. + parseInt(TmpPath.getColumn(0, "hperbizprescnt" )));
  124. bizPresCondPath.setColumn(i, "hdfbizprescnt" , parseInt(TmpPath.getColumn(0, "hdfinbizprescnt" ))
  125. + parseInt(TmpPath.getColumn(0, "hdficubizprescnt"))
  126. + parseInt(TmpPath.getColumn(0, "hdfoutbizprescnt"))
  127. + parseInt(TmpPath.getColumn(0, "hdferbizprescnt" )));
  128. //추가 2011.07.28 by kya
  129. bizPresCondPath.setColumn(i, "sledbizprescnt" , parseInt(TmpPath.getColumn(0, "sledinbizprescnt" ))
  130. + parseInt(TmpPath.getColumn(0, "sledicubizprescnt"))
  131. + parseInt(TmpPath.getColumn(0, "sledoutbizprescnt"))
  132. + parseInt(TmpPath.getColumn(0, "slederbizprescnt" )));
  133. //추가 2012.02.13 by kya
  134. bizPresCondPath.setColumn(i, "crrtbizprescnt" , parseInt(TmpPath.getColumn(0, "crrtinbizprescnt" ))
  135. + parseInt(TmpPath.getColumn(0, "crrticubizprescnt"))
  136. + parseInt(TmpPath.getColumn(0, "crrtoutbizprescnt"))
  137. + parseInt(TmpPath.getColumn(0, "crrterbizprescnt" )));
  138. bizPresCondPath.setColumn(i, "totalbizprescnt", parseInt(TmpPath.getColumn(0, "totalinbizprescnt" ))
  139. + parseInt(TmpPath.getColumn(0, "totalicubizprescnt"))
  140. + parseInt(TmpPath.getColumn(0, "totaloutbizprescnt"))
  141. + parseInt(TmpPath.getColumn(0, "totalerbizprescnt" )));
  142. //* 환자현황통계 *//
  143. // 신환 수
  144. patPresCondHDPath_1.setColumn( 0, "fnexamcnt", TmpPath.getColumn(0, "hdfnexamcnt"));
  145. patPresCondPDPath_2.setColumn( 1, "fnexamcnt", TmpPath.getColumn(0, "pdfnexamcnt"));
  146. patPresCondSumPath_3.setColumn( 2, "fnexamcnt", TmpPath.getColumn(0, "totalfnexamcnt"));
  147. // 상담건수
  148. patPresCondHDPath_1.setColumn( 0, "cnstcnt", TmpPath.getColumn(0, "hdcnstcnt"));
  149. patPresCondPDPath_2.setColumn( 1, "cnstcnt", TmpPath.getColumn(0, "pdcnstcnt"));
  150. patPresCondSumPath_3.setColumn( 2, "cnstcnt", TmpPath.getColumn(0, "totalcnstcnt"));
  151. // 처방교육건수
  152. patPresCondHDPath_1.setColumn( 0, "prcpeduccnt", TmpPath.getColumn(0, "hdprcpeduccnt"));
  153. patPresCondPDPath_2.setColumn( 1, "prcpeduccnt", TmpPath.getColumn(0, "pdprcpeduccnt"));
  154. patPresCondSumPath_3.setColumn( 2, "prcpeduccnt", TmpPath.getColumn(0, "totalprcpeduccnt"));
  155. // 기록교육건수
  156. patPresCondHDPath_1.setColumn( 0, "receduccnt", TmpPath.getColumn(0, "hdreceduccnt"));
  157. patPresCondPDPath_2.setColumn( 1, "receduccnt", TmpPath.getColumn(0, "pdreceduccnt"));
  158. patPresCondSumPath_3.setColumn( 2, "receduccnt", TmpPath.getColumn(0, "totalreceduccnt"));
  159. // 원인별 ARF건수
  160. patPresCondHDPath_1.setColumn( 0, "causecnt1", TmpPath.getColumn(0, "hdcausecnt1"));
  161. patPresCondPDPath_2.setColumn( 1, "causecnt1", TmpPath.getColumn(0, "pdcausecnt1"));
  162. patPresCondSumPath_3.setColumn( 2, "causecnt1", TmpPath.getColumn(0, "totalcausecnt1"));
  163. // 원인별 CRF건수
  164. patPresCondHDPath_1.setColumn( 0, "causecnt2", TmpPath.getColumn(0, "hdcausecnt2"));
  165. patPresCondPDPath_2.setColumn( 1, "causecnt2", TmpPath.getColumn(0, "pdcausecnt2"));
  166. patPresCondSumPath_3.setColumn( 2, "causecnt2", TmpPath.getColumn(0, "totalcausecnt2"));
  167. // 보험
  168. patPresCondHDPath_1.setColumn( 0, "healinsucnt", TmpPath.getColumn(0, "hdhealinsucnt"));
  169. patPresCondPDPath_2.setColumn( 1, "healinsucnt", TmpPath.getColumn(0, "pdhealinsucnt"));
  170. patPresCondSumPath_3.setColumn( 2, "healinsucnt", TmpPath.getColumn(0, "totalhealinsucnt"));
  171. // 보호 1종
  172. patPresCondHDPath_1.setColumn( 0, "proc1kindinsucnt", TmpPath.getColumn(0, "hdproc1kindinsucnt"));
  173. patPresCondPDPath_2.setColumn( 1, "proc1kindinsucnt", TmpPath.getColumn(0, "pdproc1kindinsucnt"));
  174. patPresCondSumPath_3.setColumn( 2, "proc1kindinsucnt", TmpPath.getColumn(0, "totalproc1kindinsucnt"));
  175. // 보호 2종
  176. patPresCondHDPath_1.setColumn( 0, "proc2kindinsucnt", TmpPath.getColumn(0, "hdproc2kindinsucnt"));
  177. patPresCondPDPath_2.setColumn( 1, "proc2kindinsucnt", TmpPath.getColumn(0, "pdproc2kindinsucnt"));
  178. patPresCondSumPath_3.setColumn( 2, "proc2kindinsucnt", TmpPath.getColumn(0, "totalproc2kindinsucnt"));
  179. // 산재
  180. patPresCondHDPath_1.setColumn( 0, "inducsinsucnt", TmpPath.getColumn(0, "hdinducsinsucnt"));
  181. patPresCondPDPath_2.setColumn( 1, "inducsinsucnt", TmpPath.getColumn(0, "pdinducsinsucnt"));
  182. patPresCondSumPath_3.setColumn( 2, "inducsinsucnt", TmpPath.getColumn(0, "totalinducsinsucnt"));
  183. // 기타
  184. patPresCondHDPath_1.setColumn( 0, "etcinsucnt", TmpPath.getColumn(0, "hdetcinsucnt"));
  185. patPresCondPDPath_2.setColumn( 1, "etcinsucnt", TmpPath.getColumn(0, "pdetcinsucnt"));
  186. patPresCondSumPath_3.setColumn( 2, "etcinsucnt", TmpPath.getColumn(0, "totaletcinsucnt"));
  187. // 전원
  188. patPresCondHDPath_1.setColumn( 0, "chnghospcnt", TmpPath.getColumn(0, "hdchnghospcnt"));
  189. patPresCondPDPath_2.setColumn( 1, "chnghospcnt", TmpPath.getColumn(0, "pdchnghospcnt"));
  190. patPresCondSumPath_3.setColumn( 2, "chnghospcnt", TmpPath.getColumn(0, "totalchnghospcnt"));
  191. // 사망
  192. patPresCondHDPath_1.setColumn( 0, "dethcnt", TmpPath.getColumn(0, "hddethcnt"));
  193. patPresCondPDPath_2.setColumn( 1, "dethcnt", TmpPath.getColumn(0, "pddethcnt"));
  194. patPresCondSumPath_3.setColumn( 2, "dethcnt", TmpPath.getColumn(0, "totaldethcnt"));
  195. // 신장이식
  196. patPresCondHDPath_1.setColumn( 0, "bdhttrnptcnt", TmpPath.getColumn(0, "hdbdhttrnptcnt"));
  197. patPresCondPDPath_2.setColumn( 1, "bdhttrnptcnt", TmpPath.getColumn(0, "pdbdhttrnptcnt"));
  198. patPresCondSumPath_3.setColumn( 2, "bdhttrnptcnt", TmpPath.getColumn(0, "totalbdhttrnptcnt"));
  199. // 전환
  200. patPresCondHDPath_1.setColumn( 0, "cvrtcnt", TmpPath.getColumn(0, "hdcvrtcnt"));
  201. patPresCondPDPath_2.setColumn( 1, "cvrtcnt", TmpPath.getColumn(0, "pdcvrtcnt"));
  202. patPresCondSumPath_3.setColumn( 2, "cvrtcnt", TmpPath.getColumn(0, "totalcvrtcnt"));
  203. //* 종류별 현황통계 *//
  204. // 혈액투석
  205. HDStatsPath.setColumn( 0, "patcnt", TmpPath.getColumn(0, "hdavfcount" ));
  206. HDStatsPath.setColumn( 1, "patcnt", TmpPath.getColumn(0, "hdavgcount" ));
  207. HDStatsPath.setColumn( 2, "patcnt", TmpPath.getColumn(0, "hdpermccount" ));
  208. HDStatsPath.setColumn( 3, "patcnt", TmpPath.getColumn(0, "hdjvccount" ));
  209. HDStatsPath.setColumn( 4, "patcnt", TmpPath.getColumn(0, "hdfvccount" ));
  210. HDStatsPath.setColumn( 5, "patcnt", TmpPath.getColumn(0, "hdsvccount" ));
  211. HDStatsPath.setColumn( 6, "patcnt", TmpPath.getColumn(0, "hdetccount" ));
  212. HDStatsPath.setColumn( 7, "patcnt", parseInt(TmpPath.getColumn(0, "hdavfcount" ))
  213. + parseInt(TmpPath.getColumn(0, "hdavgcount" ))
  214. + parseInt(TmpPath.getColumn(0, "hdpermccount"))
  215. + parseInt(TmpPath.getColumn(0, "hdjvccount" ))
  216. + parseInt(TmpPath.getColumn(0, "hdfvccount" ))
  217. + parseInt(TmpPath.getColumn(0, "hdsvccount" ))
  218. + parseInt(TmpPath.getColumn(0, "hdetccount" )));
  219. // 복막투석
  220. PDStatsPath.setColumn( 0, "patcnt", TmpPath.getColumn(0, "pdcapdcount" ));
  221. PDStatsPath.setColumn( 1, "patcnt", TmpPath.getColumn(0, "pdapdcount" ));
  222. PDStatsPath.setColumn( 2, "patcnt", TmpPath.getColumn(0, "pdipdcount" ));
  223. PDStatsPath.setColumn( 3, "patcnt", TmpPath.getColumn(0, "pdnpdcount" ));
  224. PDStatsPath.setColumn( 4, "patcnt", TmpPath.getColumn(0, "pdccpdcount" ));
  225. PDStatsPath.setColumn( 5, "patcnt", parseInt(TmpPath.getColumn(0, "pdcapdcount"))
  226. + parseInt(TmpPath.getColumn(0, "pdapdcount"))
  227. + parseInt(TmpPath.getColumn(0, "pdipdcount"))
  228. + parseInt(TmpPath.getColumn(0, "pdnpdcount"))
  229. + parseInt(TmpPath.getColumn(0, "pdccpdcount")));
  230. // 복막투석업무
  231. PDBizStatsPath.setColumn( 0, "cnt", TmpPath.getColumn(0, "catefixcount" ));
  232. PDBizStatsPath.setColumn( 1, "cnt", TmpPath.getColumn(0, "dinfcount" ));
  233. PDBizStatsPath.setColumn( 2, "cnt", TmpPath.getColumn(0, "pipecount" ));
  234. PDBizStatsPath.setColumn( 3, "cnt", TmpPath.getColumn(0, "edemacnfmcount" ));
  235. PDBizStatsPath.setColumn( 4, "cnt", TmpPath.getColumn(0, "tsetexchcount" ));
  236. PDBizStatsPath.setColumn( 5, "cnt", TmpPath.getColumn(0, "dialblodcount" ));
  237. PDBizStatsPath.setColumn( 6, "cnt", parseInt(TmpPath.getColumn(0, "catefixcount" ))
  238. + parseInt(TmpPath.getColumn(0, "dinfcount" ))
  239. + parseInt(TmpPath.getColumn(0, "pipecount" ))
  240. + parseInt(TmpPath.getColumn(0, "edemacnfmcount"))
  241. + parseInt(TmpPath.getColumn(0, "tsetexchcount" ))
  242. + parseInt(TmpPath.getColumn(0, "dialblodcount" )));
  243. }
  244. /************************************************************************************************************************/
  245. /**
  246. * _group :
  247. * _ver :
  248. * _by : 김기용
  249. * _---------------------------------------------------
  250. * _type : function
  251. * _access : public
  252. * _desc : 그리드 별 엑셀저장
  253. * _param :
  254. * _return :
  255. * _---------------------------------------------------
  256. */
  257. function saveExcelAll() {
  258. var paramLen = saveExcelAll.arguments.length;
  259. // 마지막 인자가 Boolean일 경우 처리
  260. var extendsCaptionBool;
  261. if( typeof(saveExcelAll.arguments[paramLen - 1]) == "boolean" ) {
  262. extendsCaptionBool = saveExcelAll.arguments[paramLen - 1];
  263. paramLen = paramLen - 1;
  264. }
  265. else{
  266. extendsCaptionBool = false;
  267. }
  268. var tmpParamArray = new Array();
  269. if( extendsCaptionBool ) {
  270. for( var i = 0; i < paramLen; i++ ) {
  271. tmpParamArray[i] = saveExcelAll.arguments[i];
  272. }
  273. saveExcelAllWithCaption(tmpParamArray);
  274. }
  275. else{
  276. for( var i = 0; i < paramLen; i++ ) {
  277. tmpParamArray[i] = saveExcelAll.arguments[i];
  278. }
  279. saveExcelAllWithNotCaption(tmpParamArray);
  280. }
  281. }
  282. function saveExcelAllWithCaption( sheetArray ) {
  283. // alert(gridCaptionArray);
  284. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  285. if( fileName == "" )
  286. return;
  287. // var sheetArray = new Array("grd_bizprescondstats|업무현황", "grd_patprescondstats|환자현황", "grd_hdstatsinfo|혈액투석현황", "grd_pdstatsinfo|복막투석현황", "grd_pdbizstatsinfo|복막투석업무현황");
  288. var sheetArrayLen = sheetArray.length;
  289. var gridId;
  290. var gridObj;
  291. for( var i = 0; i < sheetArray.length; i++ ) {
  292. gridId = sheetArray[i].split("|")[0];
  293. gridObj = document.all.item(gridId);
  294. // saveText() 함수는 Caption저장이 불가능 하여 SaveExcel()을 이용한다.
  295. gridObj.saveExcel("C:\\Temp\\tmp_TFExcel_" + i +".xls");
  296. }
  297. // excel application 실행함
  298. grp_biz.tfexcel.launchnewinstance(0);
  299. //실행된 excel application에서 새로운 workbook을 생성
  300. grp_biz.tfexcel.createworkbook();
  301. /* 문제있는 로직 주석처리 2013.06.13 손병은
  302. grp_biz.tfexcel.activatesheet(1);
  303. var sheetName;
  304. var nResult;
  305. for( var i = 0; i < sheetArrayLen; i++ )
  306. {
  307. sheetName = sheetArray[i].split("|")[1];
  308. if( i > 1 ) {
  309. nResult = grp_biz.tfexcel.activatesheet(i+1);
  310. grp_biz.tfexcel.sheetname(i+1) = sheetName;
  311. }
  312. else {
  313. nResult = grp_biz.tfexcel.addsheet(i+1, sheetName);
  314. }
  315. if( nResult < 0 ) {
  316. sysf_messageBox(sheetName + " 저장을", "E009");
  317. // alert(sheetName + " 오류발생");
  318. return;
  319. }
  320. grp_biz.tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
  321. }
  322. */
  323. var sheetName;
  324. var nResult;
  325. for( var i = 0; i < sheetArrayLen; i++ )
  326. {
  327. sheetName = sheetArray[i].split("|")[1];
  328. if( i > 0 ) {
  329. nResult = grp_biz.tfexcel.addsheet(i+1, sheetName);
  330. }else{
  331. nResult = grp_biz.tfexcel.activatesheet(i+1);
  332. }
  333. grp_biz.tfexcel.sheetname(i+1) = sheetName;
  334. if( nResult < 0 ) {
  335. sysf_messageBox(sheetName + " 저장을", "E009");
  336. // alert(sheetName + " 오류발생");
  337. return;
  338. }
  339. grp_biz.tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
  340. }
  341. //workbook을 저장.
  342. grp_biz.tfexcel.save(fileName);
  343. //excel application을 종료. excel application 생성 후 반드시 close해야함.
  344. grp_biz.tfexcel.close();
  345. var fso = new ActiveXObject("Scripting.FileSystemObject");
  346. for( var i = 0; i < sheetArrayLen; i++ ) {
  347. fso.DeleteFile("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
  348. }
  349. var rmsg = sysf_messageBox("저장된 Excel을", "Q004");
  350. // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
  351. if( rmsg == 6 )
  352. window.exec("excel.exe", '\"' + fileName + '\"');
  353. }
  354. function saveExcelAllWithNotCaption( sheetArray ) {
  355. // alert(gridCaptionArray);
  356. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  357. if( fileName == "" )
  358. return;
  359. // excel application 실행함
  360. grp_biz.tfexcel.launchnewinstance(0);
  361. // 실행된 excel application에서 새로운 workbook을 생성
  362. grp_biz.tfexcel.createworkbook();
  363. // var sheetArray = new Array("grd_bizprescondstats|업무현황", "grd_patprescondstats|환자현황", "grd_hdstatsinfo|혈액투석현황", "grd_pdstatsinfo|복막투석현황", "grd_pdbizstatsinfo|복막투석업무현황");
  364. var sheetArrayLen = sheetArray.length;
  365. var gridId;
  366. var gridObj;
  367. var sheetName;
  368. var nResult;
  369. for( var i = 0; i < sheetArrayLen; i++ ) {
  370. gridId = sheetArray[i].split("|")[0];
  371. gridObj = document.all.item(gridId);
  372. sheetName = sheetArray[i].split("|")[1];
  373. if( i > 1 ) {
  374. nResult = grp_biz.tfexcel.activatesheet(i+1);
  375. grp_biz.tfexcel.sheetname(i+1) = sheetName;
  376. }
  377. else {
  378. nResult = grp_biz.tfexcel.addsheet(i+1, sheetName);
  379. }
  380. if( nResult < 0 ) {
  381. sysf_messageBox(sheetName + " 저장을", "E009");
  382. // alert(sheetName + " 오류발생");
  383. return;
  384. }
  385. gridObj.saveText("C:\\Temp\\tmp_TFExcel.csv", "\n", ",", '\:', true);
  386. grp_biz.tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel.csv");
  387. }
  388. //workbook을 저장.
  389. grp_biz.tfexcel.save(fileName);
  390. //excel application을 종료. excel application 생성 후 반드시 close해야함.
  391. grp_biz.tfexcel.close();
  392. // CSV File 삭제
  393. var fso = new ActiveXObject("Scripting.FileSystemObject");
  394. fso.DeleteFile("C:\\Temp\\tmp_TFExcel.csv");
  395. var rmsg = sysf_messageBox("저장된 Excel을", "Q004");
  396. // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
  397. if( rmsg == 6 )
  398. window.exec("excel.exe", '\"' + fileName + '\"');
  399. }
  400. function createTFExcel(tfExcelID, parentObj) {
  401. if( parentObj == null )
  402. parentObj = body;
  403. var tfExcelObj = parentObj.createChild("xforms:object", "id:" + tfExcelID + "; clsid:{fe8d1001-6a9d-424d-ae2a-301493bb12da}; left:100px; top:100px; width:100px; height:100px; ");
  404. return tfExcelObj;
  405. }
  406. /************************************************************************************************************************/
  407. // header파일 중 SMMND02000.js 파일 끝]]></Script>