SMMNA01040.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /***********************************************************************************************************************************************
  2. * create date : 2008.02.12
  3. * author : dhkim
  4. * file name : SMMNA01040.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. zbcfGetCodeList(new Array("M0376","L0095"), new Array("/root/init/M0376list","/root/init/L0095list")); //혈액형,직업코드
  19. //grd_dnorlist.extendLastCol = true;
  20. grd_dnorlist.frozencols = grd_dnorlist.colref("sex");
  21. fSearch();
  22. }
  23. /*
  24. * APU 헌혈자 명단를 조회한다.
  25. */
  26. function fSearch(){
  27. var fromdd = model.getValue(xCondPath+'/fromdd');
  28. var todd = model.getValue(xCondPath+'/todd');
  29. var pidflag = model.getValue(xCondPath+'/pidflag');
  30. var pid = model.getValue(xCondPath+'/pid');
  31. var btype = model.getValue(xCondPath+'/btype');
  32. var kindflag = model.getValue(xCondPath+'/kindflag');
  33. if(fromdd == '')
  34. fromdd = currentDate;
  35. if(todd == '')
  36. todd = currentDate;
  37. model.removeNodeset(xDnorPath + "/dnorlist");
  38. model.removeNodeset(xReqPath);
  39. model.makeValue(xReqPath + '/fromdd', fromdd);
  40. model.makeValue(xReqPath + '/todd', todd);
  41. model.makeValue(xReqPath + '/pidflag', pidflag);
  42. model.makeValue(xReqPath + '/pid', pid);
  43. model.makeValue(xReqPath + '/btype', btype);
  44. model.makeValue(xReqPath + '/kindflag', kindflag);
  45. if(!submit('TRMNA01041')){
  46. messageBox('조회를', 'E009');
  47. }
  48. }
  49. /*
  50. * 엑셀출력
  51. */
  52. function fExcel(){
  53. var pGrd = grd_dnorlist;
  54. if (pGrd.rows > pGrd.fixedrows ) {
  55. var fileName = window.fileDialog("save", ",", false, "APU헌혈자명단_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  56. if (fileName != "") {
  57. pGrd.saveExcel(fileName, "SheetName", true, true, "", "", false);
  58. messageBox("엑셀저장이 ", "I002", ""); //I002 : 완료되었습니다.
  59. }
  60. } else {
  61. messageBox("자료가 존재하지 않습니다.", "E999", "");
  62. }
  63. }
  64. /*
  65. * 팝업
  66. */
  67. function fSearchPatInfo() {
  68. var flag = model.getValue("/root/cond/pidflag");
  69. var vPid = "";
  70. if (flag =="") return;
  71. vPid = model.getValue("/root/cond/pid");
  72. var vsrchcond = "1";
  73. //팝업조건설정
  74. switch (flag) {
  75. case "1": // 공여자팝업
  76. //dnorno
  77. model.removenode("/root/temp");
  78. model.makeValue("/root/temp/srchcond", vsrchcond);
  79. model.makeValue("/root/temp/dnorno", vPid);
  80. model.makeValue("/root/temp/autoflag", "Y"); //Y:조회 내역이 1건일 경우 자동 화면 닫기
  81. //NON:조회 내역이 없을 경우 자동 화면 닫기
  82. //dnornm
  83. if ( vPid.isNumber() != true ) {
  84. vsrchcond = "2";
  85. model.removenode("/root/temp");
  86. model.makeValue("/root/temp/srchcond", vsrchcond);
  87. model.makeValue("/root/temp/dnornm", vPid);
  88. model.makeValue("/root/temp/autoflag", "Y");
  89. }
  90. //팝업호출
  91. modal("SPMNA02000", "1","150", "150", "SPMNA02000", "/root/temp", "/root/send");
  92. break;
  93. case "2": // 환자팝업
  94. //pid
  95. model.removenode("/root/temp");
  96. model.makeValue("/root/temp/srchcond", vsrchcond);
  97. model.makeValue("/root/temp/pid", vPid);
  98. model.makeValue("/root/temp/autoflag", "Y");
  99. //명칭
  100. if ( vPid.isNumber() != true ) {
  101. vsrchcond = "2";
  102. model.removenode("/root/temp");
  103. model.makeValue("/root/temp/srchcond", vsrchcond);
  104. model.makeValue("/root/temp/pid", '');
  105. model.makeValue("/root/temp/hngnm", vPid);
  106. model.makeValue("/root/temp/autoflag", "Y");
  107. }
  108. //팝업호출
  109. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/temp", "/root/send");
  110. break;
  111. }
  112. //리턴값
  113. if (model.getValue("/root/main/popupendflag") == "ok") {
  114. var idnorno = model.getValue("/root/main/dnorpopinfo/dnorpoplist/dnorno");
  115. var idnornm = model.getValue("/root/main/dnorpopinfo/dnorpoplist/dnornm");
  116. var irrgstno = model.getValue("/root/main/dnorpopinfo/dnorpoplist/rrgstno1") + "-" +
  117. model.getValue("/root/main/dnorpopinfo/dnorpoplist/rrgstno2") ;
  118. model.setValue("/root/cond/pid", idnorno );
  119. model.setValue("/root/cond/pidnm", idnornm );
  120. model.setValue("/root/cond/rrgstno", irrgstno );
  121. model.refresh();
  122. }
  123. }