SMMRC02800.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. function getNodeSetCnt(path)
  2. {
  3. var insXml = model.instances(0);
  4. var nodeList = insXml.selectNodes(path);
  5. return nodeList.length;
  6. }
  7. /**
  8. * @desc : 폼초기화
  9. * @
  10. * @param :
  11. * @return :
  12. * @authur : 이은영 2008.06.12
  13. * @---------------------------------------------------
  14. */
  15. function fFormInit()
  16. {
  17. //진료과/ 챠트과 불러오기.
  18. model.makeValue("/root/send/reqdata/ioflag", "O");
  19. model.makeValue("/root/send/reqdata/orddeptflag", "'D', 'X'");
  20. submit("TRMRC00050");
  21. //공통코드 가져오기...
  22. //M0412:과보관사유코드
  23. zbcfGetCodeList(new Array("M0412"), new Array("/root/init/M0412"));
  24. model.removeNodeset("/root/main/lendlist");
  25. // 대출내역 초기값
  26. model.setValue("/root/condition/ioflag" , "O");
  27. model.setValue("/root/condition/appdeptcd" , getUserInfo("dutplcecd"));
  28. model.setValue("/root/condition/pid" , "");
  29. model.setValue("/root/condition/deptkeepyn" , "Y");
  30. model.setValue("/root/condition/rendfromdd" , getCurrentDate());
  31. model.setValue("/root/condition/rendtodd" , getCurrentDate());
  32. model.refresh();
  33. }
  34. /**
  35. * @desc : 차트 대출 현황 조회하기
  36. * @
  37. * @param :
  38. * @return :
  39. * @authur : 이은영 2008.07.21
  40. * @---------------------------------------------------
  41. */
  42. function fGetLendList()
  43. {
  44. var appdeptcd = model.getValue("/root/condition/appdeptcd");
  45. var rendfromdd = model.getValue("/root/condition/rendfromdd");
  46. var rendtodd = model.getValue("/root/condition/rendtodd");
  47. var deptkeepyn = model.getValue("/root/condition/deptkeepyn");
  48. model.makeValue("/root/send/reqdata/appdeptcd" , appdeptcd);
  49. model.makeValue("/root/send/reqdata/rendfromdd" , rendfromdd);
  50. model.makeValue("/root/send/reqdata/rendtodd" , rendtodd);
  51. model.makeValue("/root/send/reqdata/deptkeepyn" , deptkeepyn);
  52. model.makeValue("/root/send/reqdata/apprendcd" , "ALL");
  53. model.refresh();
  54. submit("TRMRC00320");
  55. }
  56. /**
  57. * @desc : excel 저장 하기
  58. * @
  59. * @param :
  60. * @return :
  61. * @authur : 이은영 2008.07.14
  62. * @---------------------------------------------------
  63. */
  64. function fExcel(gridObj, title){
  65. if (title == null) { title = "" }
  66. var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  67. if (fileName != "") {
  68. gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
  69. }
  70. }
  71. /**
  72. * @desc : 마우스 오른쪽 버튼 팝업창
  73. * @
  74. * @param :
  75. * @return :
  76. * @authur : 이은영 2008.03.18
  77. * @---------------------------------------------------
  78. */
  79. function fMouseRghtBtnPopup(gridObj)
  80. {
  81. if (event.button == 3) {
  82. if (gridObj.isCell(event.target) && gridObj.mouseRow >= gridObj.fixedrows) {
  83. model.removeNodeset("/root/send/savedata");
  84. window.setPopupMenu(true, "/root/hidden/menu/menu", "label", "func", false);
  85. } else {
  86. window.setPopupMenu(false);
  87. }
  88. } else {
  89. window.setPopupMenu(false);
  90. }
  91. }
  92. /**
  93. * @desc : 챠트 반납 우클릭시 - > 과보관 사유 입력
  94. * @
  95. * @param :
  96. * @return :
  97. * @authur : 이은영 2008.07.28
  98. * @---------------------------------------------------
  99. */
  100. function fsetdeptkeep()
  101. {
  102. if(grd_lendlist.row < 1){ return; }
  103. // 2008.01.13. 과보관사유 입력하기...
  104. fShowWndIptBox();
  105. }
  106. /**
  107. * @desc : 팝업폼 보여주기..
  108. * @
  109. * @param :
  110. * @
  111. * @return :
  112. * @authur : 이은영 2008.07.28
  113. * @---------------------------------------------------
  114. */
  115. function fShowWndIptBox()
  116. {
  117. grup_deptkeep.visible = "false";
  118. model.setValue("/root/main/deptkeep/deptkeepcd", "00");
  119. model.setValue("/root/main/deptkeep/deptkeepresn", "");
  120. model.refresh();
  121. if (event.clientY < 600) {
  122. grup_deptkeep.attribute("top") = event.clientY-90;
  123. } else {
  124. grup_deptkeep.attribute("top") = 600;
  125. }
  126. grup_deptkeep.visible = "true";
  127. }
  128. /**
  129. * @desc : 챠트 반납 우클릭시 - > 과보관 사유 입력 (update)
  130. * @
  131. * @param :
  132. * @return :
  133. * @authur : 이은영 2008.07.28
  134. * @---------------------------------------------------
  135. */
  136. function fUpdateDeptKeepresn()
  137. {
  138. // 2008.01.13. 과보관사유 입력하기...
  139. var deptkeepcd = model.getValue("/root/main/deptkeep/deptkeepcd");
  140. var deptkeepresn = model.getValue("/root/main/deptkeep/deptkeepresn");
  141. var savedata ="chrtseqno▦deptkeepcd▦deptkeepresn▩";
  142. var dataString = "";
  143. var dataCount = 0;
  144. for ( var i = 0; i < grd_lendlist.selectedRows; i++)
  145. {
  146. // 2009.01.06. sort (정렬) 후 인스턴스가 바뀌어 저장시 오류 발생 수정함.
  147. // var chrtseqno = model.getValue("/root/main/lendlist[" + grd_lendlist.selectedrow(i) + "]/chrtseqno");
  148. var chrtseqno = grd_lendlist.textMatrix(grd_lendlist.selectedrow(i), grd_lendlist.colRef("chrtseqno"));
  149. dataString = dataString + chrtseqno + "▦" + deptkeepcd + "▦" + deptkeepresn + "▩";
  150. dataCount = dataCount + 1;
  151. }
  152. if (dataString.length > 0)
  153. {
  154. alert("총 " + dataCount + " 건 과보관(사유입력) 되었습니다.");
  155. model.makeValue("/root/send/savedata", savedata + dataString);
  156. model.refresh();
  157. submit("TXMRC00103");
  158. }
  159. grup_deptkeep.visible = false;
  160. // 다시 조회하기..
  161. fGetLendList();
  162. }
  163. /**
  164. * @desc : 환자등록번호 조회 팝업
  165. * @
  166. * @param : refPid - 환자번호 참고 node path
  167. * refPnm - 환자명 참고 node path
  168. * @return :
  169. * @authur : 이은영 2008.03.18
  170. * @---------------------------------------------------
  171. */
  172. function fGetPid(refPid, refPnm)
  173. {
  174. //조회건수가 1건일 경우 팝업창을 바로 닫는다.
  175. model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
  176. model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "N");
  177. if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
  178. model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '2');
  179. }
  180. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
  181. model.resetInstanceNode("/root/source");
  182. //환자번호 copy
  183. var popupendflag = model.getValue("/root/main/popupendflag");
  184. if (popupendflag == "ok")
  185. {
  186. model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
  187. if (refPnm == null) { refPnm = "" }
  188. if (refPnm != "") {
  189. model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  190. }
  191. model.refresh();
  192. }
  193. }
  194. /**
  195. * @desc : 차트 보관 관리에서 대출일자 기간 콤보 보여줄까? 말까?
  196. * @
  197. * @param :
  198. * @return :
  199. * @authur : 이은영 2009.01.06
  200. * @---------------------------------------------------
  201. */
  202. function fLendTermDisabled()
  203. {
  204. var lendtermdisabled = lendterm_disabled.value;
  205. if (lendtermdisabled == "Y") {
  206. var today = getCurrentDate();
  207. model.setValue("/root/condition/rendfromdd", today);
  208. model.setValue("/root/condition/rendtodd" , today);
  209. ipt_fromrendd.disabled = false;
  210. ipt_torendd.disabled = false;
  211. } else {
  212. model.setValue("/root/condition/rendfromdd", "");
  213. model.setValue("/root/condition/rendtodd" , "");
  214. ipt_fromrendd.disabled = true;
  215. ipt_torendd.disabled = true;
  216. }
  217. ipt_fromrendd.refresh();
  218. ipt_torendd.refresh();
  219. }