SMMNA01020.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /***********************************************************************************************************************************************
  2. * create date : 2008.02.12
  3. * author : dhkim
  4. * file name : SMMNA01020.js
  5. * desc : 년도별 채별부작용 명단
  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. var getlastDate = currentDate.substring(0, 6) + getLastDay(currentDate.substring(0, 4), currentDate.substring(4, 6));
  18. model.setValue(xCondPath + '/todd', getlastDate);
  19. model.removenode('/root/init/L0095list');
  20. model.makenode('/root/init/L0095list');
  21. // zbcfGetCodeList(new Array("M0376"), new Array("/root/init/M0376list")); //혈액형
  22. zbcfGetCodeList(new Array("L0095"), new Array("/root/init/L0095list")); //직업코드
  23. //grd_dnorlist.extendLastCol = true;
  24. grd_dnorlist.frozencols = grd_dnorlist.colref("dnorregstno");
  25. fSearch();
  26. }
  27. /*
  28. * 년도별 채별부작용 명단를 조회한다.
  29. */
  30. function fSearch(){
  31. var fromdd = model.getValue(xCondPath+'/fromdd');
  32. var todd = model.getValue(xCondPath+'/todd');
  33. // var pidflag = model.getValue(xCondPath+'/pidflag');
  34. // var pid = model.getValue(xCondPath+'/pid');
  35. // var btype = model.getValue(xCondPath+'/btype');
  36. // var kindflag = model.getValue(xCondPath+'/kindflag');
  37. if(fromdd == '')
  38. fromdd = currentDate;
  39. if(todd == '')
  40. todd = currentDate;
  41. model.removeNodeset(xDnorPath + "/dnorlist");
  42. model.removeNodeset(xReqPath);
  43. model.makeValue(xReqPath + '/fromdd', fromdd);
  44. model.makeValue(xReqPath + '/todd', todd);
  45. // model.makeValue(xReqPath + '/pidflag', pidflag);
  46. // model.makeValue(xReqPath + '/pid', pid);
  47. // model.makeValue(xReqPath + '/btype', btype);
  48. // model.makeValue(xReqPath + '/kindflag', kindflag);
  49. if(!submit('TRMNA01021')){
  50. messageBox('조회를', 'E009');
  51. }
  52. }
  53. /*
  54. * 엑셀출력
  55. */
  56. function fExcel(){
  57. var pGrd = grd_dnorlist;
  58. if (pGrd.rows > pGrd.fixedrows ) {
  59. var fileName = window.fileDialog("save", ",", false, "년도별채혈부작용명단_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  60. if (fileName != "") {
  61. pGrd.saveExcel(fileName, "SheetName", true, true, "", "", false);
  62. messageBox("엑셀저장이 ", "I002", ""); //I002 : 완료되었습니다.
  63. }
  64. } else {
  65. messageBox("자료가 존재하지 않습니다.", "E999", "");
  66. }
  67. }
  68. /*
  69. * 팝업
  70. */
  71. function fSearchPatInfo() {
  72. var flag = model.getValue("/root/cond/pidflag");
  73. var vPid = "";
  74. if (flag =="") return;
  75. switch (flag) {
  76. case "1": // 공여자팝업
  77. //만들어야함
  78. break;
  79. case "2": // 환자팝업
  80. vPid = model.getValue("/root/cond/pid");
  81. //팝업조건설정
  82. model.removenode("/root/temp/pid");
  83. model.makeValue("/root/temp/pid", vPid);
  84. //팝업호출
  85. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/temp", "/root/cond");
  86. //리턴값
  87. if (model.getValue("/root/main/popupendflag") == "ok") {
  88. var ipid = model.getValue("/root/main/patinfo/patinfolist/pid");
  89. var ihngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  90. var irrgstno= model.getValue("/root/main/patinfo/patinfolist/rrgstno1") + "-" +
  91. model.getValue("/root/main/patinfo/patinfolist/rrgstno2") ;
  92. model.setValue("/root/cond/pid", ipid );
  93. model.setValue("/root/cond/pidnm", ihngnm );
  94. model.setValue("/root/cond/rrgstno", irrgstno );
  95. model.refresh();
  96. }
  97. break;
  98. }
  99. }