SSMNW00300.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /***************************************************************************************************************************************************
  2. * create : 2009.01.14
  3. * author : dhkim
  4. * desc : 특수주사실 통합통계
  5. *
  6. ***************************************************************************************************************************************************/
  7. /*
  8. * create : 20090114
  9. * author : dhkim
  10. * desc : 초기화
  11. */
  12. function fInit(){
  13. //model.removenode('/root/cond');
  14. model.makeValue('/root/cond/yyyy', getCurrentDate().substring(0, 4));
  15. //default 항암치료시간통계
  16. model.makeValue('/root/cond/swflag', '1');
  17. model.toggle("case1");
  18. model.setValue(ipt_fromdd.attribute("ref"), getCurrentDate());
  19. model.setValue(ipt_todd.attribute("ref"), getCurrentDate());
  20. model.setValue(ipt_srchfromdd.attribute("ref"), getCurrentDate());
  21. model.setValue(ipt_srchtodd.attribute("ref"), getCurrentDate());
  22. ipt_stddd.refresh();
  23. ipt_fromdd.refresh();
  24. ipt_todd.refresh();
  25. ipt_srchfromdd.refresh();
  26. ipt_srchtodd.refresh();
  27. fSearch();
  28. }
  29. /*
  30. * create : 20090114
  31. * author : dhkim
  32. * desc : 항암치료시간통계 조회
  33. */
  34. function fSearchChemoTime(){
  35. var yyyy = model.getValue('/root/cond/yyyy');
  36. if(yyyy == null || yyyy == ''){
  37. yyyy = getCurrentDate().substring(0, 4);
  38. model.setValue('/root/cond/yyyy', yyyy);
  39. model.refresh();
  40. }
  41. model.removenode('/root/main/chemotimeinfo');
  42. model.makenode('/root/main/chemotimeinfo');
  43. model.removenode('/root/send');
  44. model.makeValue('/root/send/yyyy', yyyy);
  45. model.refresh();
  46. if(!submit('TRSNW00301')){
  47. messageBox('항암치료 시간 통계 조회를 실패하였습니다.', 'E999');
  48. }
  49. }
  50. /*
  51. * create : 20090114
  52. * author : dhkim
  53. * desc : 임상과별통계 조회
  54. */
  55. function fSearchDeptGrp(){
  56. var yyyy = model.getValue('/root/cond/yyyy');
  57. if(yyyy == null || yyyy == ''){
  58. yyyy = getCurrentDate().substring(0, 4);
  59. model.setValue('/root/cond/yyyy', yyyy);
  60. model.refresh();
  61. }
  62. model.removenode('/root/main/deptgrpinfo');
  63. model.makenode('/root/main/deptgrpinfo');
  64. model.removenode('/root/send');
  65. model.makeValue('/root/send/yyyy', yyyy);
  66. model.refresh();
  67. if(!submit('TRSNW00302')){
  68. messageBox('임상과별 이용 통계 조회를 실패하였습니다.', 'E999');
  69. }
  70. }
  71. /*
  72. * create : 20090114
  73. * author : dhkim
  74. * desc : 요일별통계 조회
  75. */
  76. function fSearchDayGrp(){
  77. var yyyy = model.getValue('/root/cond/yyyy');
  78. if(yyyy == null || yyyy == ''){
  79. yyyy = getCurrentDate().substring(0, 4);
  80. model.setValue('/root/cond/yyyy', yyyy);
  81. model.refresh();
  82. }
  83. model.removenode('/root/main/daygrpinfo');
  84. model.makenode('/root/main/daygrpinfo');
  85. model.removenode('/root/send');
  86. model.makeValue('/root/send/yyyy', yyyy);
  87. model.refresh();
  88. if(!submit('TRSNW00303')){
  89. messageBox('요일별 통계 조회를 실패하였습니다.', 'E999');
  90. }
  91. }
  92. /*
  93. * create : 20090115
  94. * author : dhkim
  95. * desc : 조회조건 작년으로 이동
  96. */
  97. function fMovePreYear(){
  98. var yyyy = model.getValue('/root/cond/yyyy');
  99. if(yyyy == null || yyyy == ''){
  100. yyyy = getCurrentDate().substring(0, 4);
  101. model.setValue('/root/cond/yyyy', yyyy);
  102. model.refresh();
  103. }
  104. yyyy = parseInt(yyyy) - 1;
  105. model.setValue('/root/cond/yyyy', yyyy);
  106. model.refresh();
  107. fSearch();
  108. }
  109. /*
  110. * create : 20090115
  111. * author : dhkim
  112. * desc : 조회조건 내년으로 이동
  113. */
  114. function fMoveNextYear(){
  115. var yyyy = model.getValue('/root/cond/yyyy');
  116. if(yyyy == null || yyyy == ''){
  117. yyyy = getCurrentDate().substring(0, 4);
  118. model.setValue('/root/cond/yyyy', yyyy);
  119. model.refresh();
  120. }
  121. yyyy = parseInt(yyyy) + 1;
  122. model.setValue('/root/cond/yyyy', yyyy);
  123. model.refresh();
  124. fSearch();
  125. }
  126. /*
  127. * create : 20090115
  128. * author : dhkim
  129. * desc : 탭별 조회
  130. */
  131. function fSearch(){
  132. fSearchChemoTime();
  133. fSearchDeptGrp();
  134. fSearchDayGrp();
  135. fSearchDayPatCnt();
  136. fSearchOpRatioInfo();
  137. //var swflag = model.getValue('/root/cond/swflag');
  138. //if(swflag == '1'){
  139. // fSearchChemoTime();
  140. //}else if(swflag == '2'){
  141. // fSearchDeptGrp();
  142. //}else if(swflag == '3'){
  143. // fSearchDayGrp();
  144. //}
  145. }
  146. function fSearchDayPatCnt() {
  147. model.copyNode("/root/send", "/root/cond");
  148. submit("TRSNW00304");
  149. }
  150. function fSearchOpRatioInfo() {
  151. model.makeNode("/root/send/reqdata");
  152. model.copyNode("/root/send/reqdata", "/root/cond");
  153. submit("TRSNW00305");
  154. }
  155. /**
  156. * @group :
  157. * @ver :
  158. * @by : 김기용
  159. * @---------------------------------------------------
  160. * @type : function
  161. * @access : public
  162. * @desc : 그리드 별 엑셀저장
  163. * @param :
  164. * @return :
  165. * @---------------------------------------------------
  166. */
  167. function saveExcelAll(){
  168. var paramLen = saveExcelAll.arguments.length;
  169. // 마지막 인자가 Boolean일 경우 처리
  170. var extendsCaptionBool;
  171. if( typeof(saveExcelAll.arguments[paramLen - 1]) == "boolean" ) {
  172. extendsCaptionBool = saveExcelAll.arguments[paramLen - 1];
  173. paramLen = paramLen - 1;
  174. }
  175. else{
  176. extendsCaptionBool = false;
  177. }
  178. var tmpParamArray = new Array();
  179. if( extendsCaptionBool ) {
  180. for( var i = 0; i < paramLen; i++ ) {
  181. tmpParamArray[i] = saveExcelAll.arguments[i];
  182. }
  183. saveExcelAllWithCaption(tmpParamArray);
  184. }
  185. else{
  186. for( var i = 0; i < paramLen; i++ ) {
  187. tmpParamArray[i] = saveExcelAll.arguments[i];
  188. }
  189. saveExcelAllWithNotCaption(tmpParamArray);
  190. }
  191. }
  192. function saveExcelAllWithCaption( sheetArray ) {
  193. // alert(gridCaptionArray);
  194. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  195. if( fileName == "" )
  196. return;
  197. // var sheetArray = new Array("grd_bizprescondstats|업무현황", "grd_patprescondstats|환자현황", "grd_hdstatsinfo|혈액투석현황", "grd_pdstatsinfo|복막투석현황", "grd_pdbizstatsinfo|복막투석업무현황");
  198. var sheetArrayLen = sheetArray.length;
  199. var gridId;
  200. var gridObj;
  201. for( var i = 0; i < sheetArray.length; i++ ) {
  202. gridId = sheetArray[i].split("|")[0];
  203. gridObj = document.all.item(gridId);
  204. // saveText() 함수는 Caption저장이 불가능 하여 SaveExcel()을 이용한다.
  205. gridObj.saveExcel("C:\\Temp\\tmp_TFExcel_" + i +".xls");
  206. }
  207. // excel application 실행함
  208. tfexcel.launchnewinstance(0);
  209. //실행된 excel application에서 새로운 workbook을 생성
  210. tfexcel.createworkbook();
  211. tfexcel.activatesheet(1);
  212. var sheetName;
  213. var nResult;
  214. for( var i = 0; i < sheetArrayLen; i++ )
  215. {
  216. sheetName = sheetArray[i].split("|")[1];
  217. if( i > 1 ) {
  218. nResult = tfexcel.activatesheet(i+1);
  219. tfexcel.sheetname(i+1) = sheetName;
  220. }
  221. else {
  222. nResult = tfexcel.addsheet(i+1, sheetName);
  223. }
  224. if( nResult < 0 ) {
  225. messageBox(sheetName + " 저장을", "E009");
  226. // alert(sheetName + " 오류발생");
  227. return;
  228. }
  229. tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
  230. }
  231. // tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel.xls");
  232. //workbook을 저장.
  233. tfexcel.save(fileName);
  234. //excel application을 종료. excel application 생성 후 반드시 close해야함.
  235. tfexcel.close();
  236. var fso = new ActiveXObject("Scripting.FileSystemObject");
  237. for( var i = 0; i < sheetArrayLen; i++ ) {
  238. fso.DeleteFile("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
  239. }
  240. var rmsg = messageBox("저장된 Excel을", "Q004");
  241. // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
  242. if( rmsg == 6 )
  243. window.exec("excel.exe", '\"' + fileName + '\"');
  244. }
  245. function fShowCntrl() {
  246. var swflag = model.getValue("/root/cond/swflag");
  247. if(swflag == "4") {
  248. group3.visible = true;
  249. group1.visible = false;
  250. group4.visible = false;
  251. } else if(swflag == "5") {
  252. group3.visible = false;
  253. group1.visible = false;
  254. group4.visible = true;
  255. } else {
  256. group3.visible = false;
  257. group1.visible = true;
  258. group4.visible = false;
  259. }
  260. }
  261. function fShowCtrl2() {
  262. var val = rdo_srchflag.value;
  263. if(val == "1") {
  264. ipt_srchfromdd.visible = true;
  265. ipt_srchtodd.visible = true;
  266. cap_bar.visible = true;
  267. ipt_srchmm.visible = false;
  268. ipt_srchyy.visible = false;
  269. } else if(val == "2") {
  270. ipt_srchfromdd.visible = false;
  271. ipt_srchtodd.visible = false;
  272. ipt_srchmm.visible = true;
  273. ipt_srchyy.visible = false;
  274. cap_bar.visible = false;
  275. } else if(val == "3") {
  276. ipt_srchfromdd.visible = false;
  277. ipt_srchtodd.visible = false;
  278. ipt_srchmm.visible = false;
  279. ipt_srchyy.visible = true;
  280. cap_bar.visible = false;
  281. }
  282. }