SPMRI03110.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 사유입력 ( SPMRI03100_사유입력.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. /**
  8. * @desc : 화면초기화
  9. * @id :
  10. * @event : xforms-ready
  11. * @return : void
  12. * @authur : 박종훈
  13. */
  14. function fInitalize()
  15. {
  16. var sUserDeptcd = getUserInfo("dutplcecd");
  17. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  18. var iptjobkind = "";
  19. if(sJobkind == "03") {
  20. iptjobkind = "03";
  21. }
  22. else if (sJobkind == "11") {
  23. iptjobkind = "05";
  24. }
  25. else {
  26. iptjobkind = "-";
  27. }
  28. model.makeValue("/root/send/rsnsrch/instcd", getUserInfo("dutplceinstcd"));
  29. model.makeValue("/root/send/rsnsrch/jobkind", iptjobkind);
  30. model.makeValue("/root/send/rsnsrch/deptcd", sUserDeptcd);
  31. model.makeValue("/root/send/rsnsrch/topyn","Y");
  32. submit("TRMRI03102");
  33. }
  34. /**
  35. * @desc : 확인버튼 클릭
  36. * @id :
  37. * @event : DOMActivate
  38. * @return : void
  39. * @authur : 박종훈
  40. */
  41. function fConfirm(){
  42. var sRsnCd = model.getValue("/root/main/accresn/resncd");
  43. if (sRsnCd == "")
  44. {
  45. messageBox("사유를", "C002");
  46. model.setFocus("cmb_resn");
  47. return;
  48. }
  49. else if (sRsnCd == "99")
  50. {
  51. var sEtc = model.getValue("/root/main/accresn/etc");
  52. var tmpEtc = sEtc.replace(/\s/g, "");
  53. if (tmpEtc == "") //기타사유 입력여부 검사
  54. {
  55. messageBox("기타 사유를", "C001");
  56. model.setValue("/root/main/accresn/etc", tmpEtc);
  57. ipt_etc.refresh();
  58. model.setFocus("ipt_etc");
  59. return;
  60. }
  61. else
  62. {
  63. if (sEtc.length < 6)
  64. {
  65. messageBox("한글5자, 영문10자 이상 기록", "I008");
  66. model.setFocus("ipt_etc");
  67. return;
  68. }
  69. }
  70. }
  71. var sRsnCd = model.getValue("/root/main/accresn/resncd");
  72. var rsnnm = model.getValue("/root/main/accresn/etc");
  73. var deptcd = getUserInfo("dutplcecd");
  74. var instcd = getUserInfo("dutplceinstcd");
  75. var jobkindcd = getUserInfo("jobkindcd");
  76. var pid = "";
  77. var orddd = "";
  78. var cretno = "";
  79. var ioflag = "";
  80. pid = model.getValue("/root/temp/outpatpaminfo/pid");
  81. //외래일때
  82. if (pid!="") {
  83. orddd = model.getValue("/root/temp/outpatpaminfo/orddd");
  84. cretno = model.getValue("/root/temp/outpatpaminfo/cretno");
  85. ioflag = model.getValue("/root/temp/outpatpaminfo/ioflag");
  86. }
  87. else {
  88. pid = model.getValue("/root/temp/inpatpaminfo/pid");
  89. if (pid!="") {
  90. orddd = model.getValue("/root/temp/inpatpaminfo/indd");
  91. cretno = model.getValue("/root/temp/inpatpaminfo/cretno");
  92. ioflag = model.getValue("/root/temp/inpatpaminfo/ioflag");
  93. }
  94. else {
  95. pid = model.getValue("/root/temp/etcpatpaminfo/pid");
  96. orddd = model.getValue("/root/temp/etcpatpaminfo/indd");
  97. cretno = model.getValue("/root/temp/etcpatpaminfo/cretno");
  98. ioflag = model.getValue("/root/temp/etcpatpaminfo/ioflag");
  99. }
  100. }
  101. model.makeValue("/root/send/savedata/pid",pid);
  102. model.makeValue("/root/send/savedata/orddd",orddd);
  103. model.makeValue("/root/send/savedata/cretno",cretno);
  104. model.makeValue("/root/send/savedata/ioflag",ioflag);
  105. model.makeValue("/root/send/savedata/rsncd",sRsnCd);
  106. model.makeValue("/root/send/savedata/rsnnm",rsnnm);
  107. model.makeValue("/root/send/savedata/deptcd",deptcd);
  108. model.makeValue("/root/send/savedata/jobkindcd",jobkindcd);
  109. submit("TXMRI03110");
  110. opener.javascript.setParameter("SPMRI03110_param_confirmyn","Y");
  111. model.close();
  112. }
  113. /**
  114. * @desc : 사유선택
  115. * @id :
  116. * @event : xforms-value-changed
  117. * @return : void
  118. * @authur : 박종훈
  119. */
  120. function fSelectResn()
  121. {
  122. var sRsnCd = model.getValue("/root/main/accresn/resncd");
  123. var sRsnNm = model.getValue("/root/init/resn/resnlist[rsncd='" + sRsnCd + "']/rsnnm");
  124. model.setValue("/root/main/accresn/resnnm", sRsnNm);
  125. if (sRsnCd == "99")
  126. {
  127. ipt_etc.disabled = false;
  128. }
  129. else
  130. {
  131. ipt_etc.disabled = true;
  132. }
  133. }