SSMNW00300.xjs 10 KB

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