SMMNA01050.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /***********************************************************************************************************************************************
  2. * create date : 2008.02.12
  3. * author : dhkim
  4. * file name : SMMNA01000.js
  5. * desc : APU_업무현황조회
  6. ***********************************************************************************************************************************************/
  7. var xDnorPath = '/root/main/dnorinfo';
  8. var xCondPath = '/root/cond';
  9. var xReqPath = '/root/send/reqdata';
  10. var currentDate = getCurrentDate();
  11. /*
  12. * 초기화
  13. */
  14. function fInit(){
  15. model.removeNodeset(xDnorPath);
  16. model.setValue(xCondPath + '/fromdd', currentDate);
  17. model.setValue(xCondPath + '/todd', currentDate);
  18. //20090206 dhkim
  19. //공통코드
  20. zbcfGetCodeList(new Array("L0099"
  21. , "L0100"
  22. , "L0101"
  23. , "L0102"
  24. , "L0103")
  25. , new Array("/root/init/L0099list"
  26. , "/root/init/L0100list"
  27. , "/root/init/L0101list"
  28. , "/root/init/L0102list"
  29. , "/root/init/L0103list")
  30. , true);
  31. //zbcfGetCodeList(new Array("M0376"), new Array("/root/init/M0376list")); //혈액형
  32. submit("TRMNA01053"); //병동콤보
  33. //grd_dnorlist.extendLastCol = true;
  34. grd_dnorsum.frozencols = grd_dnorsum.colRef("depttotal");
  35. grd_dnorlist.frozencols = grd_dnorlist.colRef("execdt");
  36. grd_dnorsum.rowheight(0) = 30;
  37. grd_dnorsum.rowheight(1) = 35;
  38. //alert(grd_dnorsum.rowheight(0) + "/" + grd_dnorsum.rowheight(1));
  39. fSearch();
  40. }
  41. /*
  42. * APU_업무현황조회
  43. */
  44. function fSearch(){
  45. var dayflag = model.getValue(xCondPath+'/dayflag');
  46. var fromdd = model.getValue(xCondPath+'/fromdd');
  47. var todd = model.getValue(xCondPath+'/todd');
  48. if(fromdd == '')
  49. fromdd = currentDate;
  50. if(todd == '')
  51. todd = currentDate;
  52. if (dayflag == "M") {
  53. fromdd = fromdd.substring(0,6) + '01';
  54. todd = todd.substring(0,6) + '31' ;
  55. }
  56. if (dayflag == "Y") {
  57. fromdd = fromdd.substring(0,4)+ '0101' ;
  58. todd = todd.substring(0,4)+ '1231';
  59. }
  60. model.removeNodeset(xDnorPath + "/dnorlist");
  61. model.removeNodeset(xReqPath);
  62. model.makeValue(xReqPath + '/dayflag', dayflag);
  63. model.makeValue(xReqPath + '/fromdd', fromdd);
  64. model.makeValue(xReqPath + '/todd', todd);
  65. //if(!submit('TRMNA01051')){
  66. if(!submit('TRMNA01052')){
  67. messageBox('조회를', 'E009');
  68. }
  69. fSearch2();
  70. }
  71. /*
  72. * 집계그리드 만들기
  73. */
  74. function fSearch2(){
  75. //1.타이틀만들기
  76. //2.그리드생성하기
  77. }
  78. /*
  79. * 엑셀출력
  80. */
  81. function fExcel(flag){
  82. var fileNm = "";
  83. var pGrd ;
  84. switch (flag) {
  85. case "S":
  86. fileNm = "APU 업무내역SUM";
  87. pGrd = grd_dnorsum;
  88. break;
  89. case "D":
  90. fileNm = "APU 업무내역LIST";
  91. pGrd = grd_dnorlist;
  92. break;
  93. }
  94. if (pGrd.rows > pGrd.fixedrows ) {
  95. var fileName = window.fileDialog("save", ",", false, fileNm + "_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  96. if (fileName != "") {
  97. pGrd.saveExcel(fileName, "SheetName", true, true, "", "", false);
  98. messageBox("엑셀저장이 ", "I002", ""); //I002 : 완료되었습니다.
  99. }
  100. } else {
  101. messageBox("자료가 존재하지 않습니다.", "E999", "");
  102. }
  103. }
  104. /**
  105. * 년,월,일별 검색조건에 따라 조회시작, 종료 날짜 컴퍼넌트를 년,월,일 형식에 맞게 바꿔준다.
  106. *
  107. */
  108. function fChangeDDFlag(ddflag){
  109. var xCondPath = '/root/cond'; //조회 xPath
  110. //model.removeNodeset(xCondPath);
  111. //model.makeNode(xCondPath + '/dayflag');
  112. //model.makeNode(xCondPath + '/fromdd');
  113. //model.makeNode(xCondPath + '/todd');
  114. //var condDate = currentDate;
  115. if(ddflag == 'D'){
  116. cap_date.value = '시행일자 : ';
  117. ipt_Fromdd.attribute("width") = "95";
  118. ipt_Enddd.attribute("width") = "95";
  119. ipt_Fromdd.attribute('format') = 'yyyy-mm-dd';
  120. ipt_Enddd.attribute('format') = 'yyyy-mm-dd';
  121. }else if(ddflag == 'M'){
  122. //condDate = condDate.substring(0, 6);
  123. cap_date.value = '시행년월 : ';
  124. ipt_Fromdd.attribute("width") = "80";
  125. ipt_Enddd.attribute("width") = "80";
  126. ipt_Fromdd.attribute('format') = 'yyyy-mm';
  127. ipt_Enddd.attribute('format') = 'yyyy-mm';
  128. }else if(ddflag == 'Y'){
  129. //condDate = condDate.substring(0, 4);
  130. cap_date.value = '시행년도 : ';
  131. ipt_Fromdd.attribute("width") = "60";
  132. ipt_Enddd.attribute("width") = "60";
  133. ipt_Fromdd.attribute('format') = 'yyyy';
  134. ipt_Enddd.attribute('format') = 'yyyy';
  135. }
  136. //model.setValue(xCondPath + '/ddflag', ddflag);
  137. //model.setValue(xCondPath + '/fromdd', condDate);
  138. //model.setValue(xCondPath + '/todd', condDate);
  139. model.refresh();
  140. }