SSMRC03300.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  1. /**
  2. * @desc : 폼초기화
  3. * @
  4. * @param :
  5. * @return :
  6. * @authur : 이은영 2008.03.18
  7. * @---------------------------------------------------
  8. */
  9. function fFormInit()
  10. {
  11. /* 마스터 정보 가져오기..
  12. //공통코드 가져오기...
  13. //M0392:챠트미대출사유코드
  14. //M0412:과보관사유코드
  15. //M0424:차트상태(분실)코드
  16. zbcfGetCodeList(new Array("M0392","M0412","M0424"), new Array("/root/init/M0392","/root/init/M0412","/root/init/M0424"));
  17. // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
  18. model.makeValue("/root/send/reqdata/ioflag" , "O");
  19. model.makeValue("/root/send/reqdata/useyn" , "");
  20. model.makeValue("/root/send/reqdata/allwardyn", "");
  21. model.refresh();
  22. submit("TRMRC00100");
  23. //*/
  24. model.setValue("/root/send/reqdata/rendcd" , "ALL");
  25. model.setValue("/root/send/reqdata/appdept" , "ALL");
  26. model.setValue("/root/send/reqdata/appdd" , getCurrentDate());
  27. model.setValue("/root/send/reqdata/chrtman" , "ALL");
  28. model.setValue("/root/send/reqdata/keepplce", "ALL");
  29. model.setValue("/root/send/reqdata/renddd" , getCurrentDate());
  30. model.setValue("/root/send/reqdata/resettm" , getCurrentTime());
  31. model.setValue("/root/send/reqdata/acptid" , getUserId());
  32. // 2008.07.30. 차트자동대출 , 차트기타대출 : display 구분
  33. model.setValue("/root/send/reqdata/autolendflag", "A");
  34. model.refresh();
  35. fDisplayAutoLend();
  36. }
  37. /**
  38. * @desc : 차트자동대출 , 차트기타대출 : display
  39. * @
  40. * @param :
  41. * @return :
  42. * @authur : 이은영 2008.07.30
  43. * @---------------------------------------------------
  44. */
  45. function fDisplayAutoLend()
  46. {
  47. var flag = model.getValue("/root/send/reqdata/autolendflag");
  48. if (flag == "A") {
  49. model.toggle("lendinfo_etc");
  50. lendinfo_etc.disabled = true;
  51. grup_chrtlist.disabled = true;
  52. }
  53. else if (flag == "I") { //2010.12.27, 주희경, 입원대출 추가
  54. model.toggle("lendinfo_inpt");
  55. grup_chrtlist.disabled = false;
  56. cbo_lenddeptcd.dispatch("xforms-value-changed");
  57. } else {
  58. model.toggle("lendinfo_etc");
  59. lendinfo_etc.disabled = false;
  60. grup_chrtlist.disabled = false;
  61. cmb_l_appdeptcd.dispatch("xforms-value-changed");
  62. }
  63. ipt_l_lendmanid.disabled = true;
  64. ipt_l_appmanid.disabled = true;
  65. ipt_l_appmannm.disabled = true;
  66. ipt_chrtpnm.disabled = true;
  67. }
  68. /**
  69. * @desc : 챠트 대출 우클릭시 - > 챠트대출
  70. * @
  71. * @param :
  72. * @return :
  73. * @authur : 이은영 2008.03.18
  74. * @---------------------------------------------------
  75. */
  76. function fsetrendchart()
  77. {
  78. fUpdateRendDelFlagYN("N");
  79. }
  80. /**
  81. * @desc : 챠트 대출 우클릭시 - > 대출 신청 취소
  82. * @
  83. * @param :
  84. * @return :
  85. * @authur : 이은영 2008.03.18
  86. * @---------------------------------------------------
  87. */
  88. function fsetrendcncl()
  89. {
  90. fUpdateRendDelFlagYN("Y");
  91. }
  92. /**
  93. * @desc : 챠트 대출 우클릭시 - > 챠트 대출 또는 대출 신청 취소(update)
  94. * @
  95. * @param : flag ('N'=> 챠트대출, 'Y'=>신청취소)
  96. * @return :
  97. * @authur : 이은영 2008.03.18
  98. * @---------------------------------------------------
  99. */
  100. function fUpdateRendDelFlagYN(flag)
  101. {
  102. var ref = "/root/main/chrtlend/applist";
  103. var grdObj = grd_applist;
  104. var savedata = "m▦chrtseqno▦medirecno▦pid▦rendcd▦appmanid▦appdeptcd▦delyn▦renddd▦resettm▦acptid▦ioflag▩";
  105. var dataString = "";
  106. var dataCount = 0;
  107. var renddd = getCurrentDate();
  108. model.setValue("/root/send/reqdata/renddd" , getCurrentDate());
  109. var resettm = model.getValue("/root/send/reqdata/resettm");
  110. var acptid = model.getValue("/root/send/reqdata/acptid");
  111. for ( var i = 0; i < grdObj.selectedRows; i++)
  112. {
  113. var chrtlendyn = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/chrtlendyn");
  114. if (chrtlendyn != "Y")
  115. {
  116. var chrtseqno = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/chrtseqno");
  117. var medirecno = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/medirecno");
  118. var pid = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/pid");
  119. var rendcd = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/rendcd");
  120. var appmanid = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/appmanid");
  121. var appdeptcd = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/appdeptcd");
  122. //2010.12.28, 주희경, 입원대출 시에는 ioflag를 I로 설정
  123. if ( model.getValue("/root/send/reqdata/autolendflag") == "I" )
  124. {
  125. var ioflag = "I";
  126. }
  127. dataString = dataString + "u▦" + chrtseqno + "▦" + medirecno + "▦" + pid + "▦" + rendcd + "▦" + appmanid + "▦" + appdeptcd + "▦" + flag + "▦";
  128. dataString = dataString + renddd + "▦" + resettm + "▦" + acptid + "▦"+ioflag+"▩";
  129. dataCount = dataCount + 1;
  130. }
  131. }
  132. if (dataString.length > 0)
  133. {
  134. model.makeValue("/root/send/savedata", savedata + dataString);
  135. if (flag == "N") {
  136. submit("TXMRC00120");
  137. alert("총 " + dataCount + " 건 챠트대출 되었습니다.");
  138. // 2008.01.02. 대출현황 조회 총건수..
  139. model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  140. cap_rendlist.refresh();
  141. } else {
  142. submit("TXMRC00105");
  143. alert("총 " + dataCount + " 건 대출신청이 취소되었습니다.");
  144. }
  145. // 접수현황 다시 조회하기..
  146. fGetLendList();
  147. }
  148. }
  149. /**
  150. * @desc : 챠트 대출 우클릭시 - > 미대출 사유 입력
  151. * @
  152. * @param :
  153. * @return :
  154. * @authur : 이은영 2008.03.18
  155. * @---------------------------------------------------
  156. */
  157. function fsetrendresn(){
  158. if(grd_applist.row < 1){
  159. return;
  160. }
  161. // 2007.12.27. 미대출사유 입력하기...
  162. fShowWndIptBox("0");
  163. }
  164. /**
  165. * @desc : 챠트 대출 우클릭시 - > 미대출 사유 업데이트 (update)
  166. * @
  167. * @param :
  168. * @return :
  169. * @authur : 이은영 2008.03.18
  170. * @---------------------------------------------------
  171. */
  172. function fUpdateUnrendresn(){
  173. // 2007.12.27. 미대출사유 입력하기...
  174. var unrendcd = model.getValue("/root/hidden/applist/unrendcd");
  175. var unrendresn = model.getValue("/root/hidden/applist/unrendresn");
  176. var savedata ="chrtseqno▦unrendcd▦unrendresn▩";
  177. var dataString = "";
  178. var dataCount = 0;
  179. for ( var i = 0; i < grd_applist.selectedRows; i++)
  180. {
  181. var chrtseqno = model.getValue("/root/main/chrtlend/applist[" + grd_applist.selectedrow(i) + "]/chrtseqno");
  182. if (chrtseqno != "") {
  183. dataString = dataString + chrtseqno + "▦" + unrendcd + "▦" + unrendresn + "▩";
  184. dataCount = dataCount + 1;
  185. }
  186. }
  187. grup_unrendresn.visible = false;
  188. if (dataString.length > 0)
  189. {
  190. model.makeValue("/root/send/savedata", savedata + dataString);
  191. model.refresh();
  192. submit("TXMRC00102");
  193. alert("총 " + dataCount + " 건 미대출(사유입력) 되었습니다.");
  194. // 다시 조회하기..
  195. fGetLendList();
  196. }
  197. }
  198. /**
  199. * @desc : 챠트 대출 조회
  200. * @
  201. * @param :
  202. * @return :
  203. * @authur : 이은영 2008.03.18
  204. * @---------------------------------------------------
  205. */
  206. function fGetLendList()
  207. {
  208. submit("TRMRC00110");
  209. //var pid = model.getValue("/root/send/reqdata/pid");
  210. //if (pid.length > 0) {
  211. // model.setValue("/root/send/reqdata/pid", pid);
  212. // model.refresh();
  213. // btn_chrtlist.dispatch("DOMActivate");
  214. //}
  215. }
  216. /**
  217. * @desc : 챠트 대출 조회 - 바크도 입력후 대출현황만 다시조회한다. (로그인 사용자별)
  218. * @
  219. * @param :
  220. * @return :
  221. * @authur : 이은영 2008.03.18
  222. * @---------------------------------------------------
  223. */
  224. function fGetUserLendList()
  225. {
  226. submit("TRMRC00113");
  227. //2008.01.02. 대출현황 조회 총건수..
  228. //model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  229. //cap_rendlist.refresh();
  230. }
  231. /**
  232. * @desc : 종이챠트 선택 후 -> 대출등록
  233. * @
  234. * @param :
  235. * @return :
  236. * @authur : 이은영 2008.03.18
  237. * @---------------------------------------------------
  238. */
  239. function fSetLendChart()
  240. {
  241. // 대출등록
  242. var rendcd = model.getValue("/root/main/lendinfo/rendcd");
  243. var appdeptcd = model.getValue("/root/main/lendinfo/appdeptcd");
  244. var lendmanid = model.getValue("/root/main/lendinfo/lendmanid");
  245. var appmanid = model.getValue("/root/main/lendinfo/appmanid");
  246. var cntctelno = model.getValue("/root/main/lendinfo/cntctelno");
  247. var msgcnts = model.getValue("/root/main/lendinfo/msgcnts");
  248. var chrtpid = model.getValue("/root/main/lendinfo/chrtpid");
  249. var autolendflag = model.getValue("/root/send/reqdata/autolendflag");
  250. if (rendcd == ""){
  251. window.alert("대출용도를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  252. model.setFocus("cmb_l_rendcd");
  253. return;
  254. }
  255. if (appdeptcd == ""){
  256. window.alert("대출과를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  257. model.setFocus("cmb_l_appdeptcd");
  258. return;
  259. }
  260. if (lendmanid == "" || lendmanid.isNumber()== false){
  261. window.alert("대출자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  262. model.setFocus("ipt_l_lendmanid");
  263. return;
  264. }
  265. if ( appmanid == "" || appmanid.isNumber()== false ){
  266. window.alert("신청자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  267. model.setFocus("ipt_l_appmanid");
  268. return;
  269. }
  270. // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
  271. // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
  272. if (rendcd == "021" || rendcd == "022"){
  273. msgcnts = msgcnts.getTrimLeft();
  274. msgcnts = msgcnts.getTrimRight();
  275. if (msgcnts.length == ""){
  276. window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
  277. model.setFocus("ipt_l_msgcnts");
  278. return;
  279. }
  280. }
  281. // 2009.03.18. 대출과가 센터인 경우 진료과 선택 체킹하기...
  282. var orddeptkind = model.getValue("/root/main/lendinfo/orddeptkind");
  283. var orddeptcd = model.getValue("/root/main/lendinfo/orddeptcd");
  284. if (orddeptkind == "C" && orddeptcd == "-"){
  285. window.alert("대출과가 센터인 경우 진료과를 선택해주세요.", "차트대출신청", 0 | 64);
  286. model.setFocus("cmb_l_orddeptcd");
  287. return;
  288. }
  289. // 2009.03.18. 대출과가 센터인 경우 진료과 , 센터과 저장
  290. var centcd = "-";
  291. if (orddeptkind == "C") {
  292. centcd = model.getValue("/root/main/lendinfo/appdeptcd");
  293. }
  294. model.setValue("/root/send/reqdata/status", "i");
  295. // 2007.12.14. 대출일자는 당일로 한다...
  296. var renddd = getCurrentDate();
  297. model.makeValue("/root/send/reqdata/renddd", renddd);
  298. var resettm = model.getValue("/root/send/reqdata/resettm");
  299. var acptid = model.getValue("/root/send/reqdata/acptid");
  300. var icnt = 0;
  301. var tmpSaveData = "status▦rendcd▦appdeptcd▦lendmanid▦appmanid▦cntctelno▦msgcnts▦renddd▦bcno▦";
  302. tmpSaveData = tmpSaveData + "pid▦chrtpid▦ioflag▦chrtflag▦medirecno▦resettm▦acptid▦orddeptcd▦centcd▩";
  303. for ( var i = 1; i < grd_chrtlist.rows; i++)
  304. {
  305. var ioflag = model.getValue("/root/main/chrtlist["+ i +"]/ioflag");
  306. //2010.12.28, 주희경, 입원대출 시에는 ioflag를 I로 설정
  307. if ( autolendflag == "I" )
  308. {
  309. ioflag = "I";
  310. }
  311. var chkflag = model.getValue("/root/main/chrtlist["+ i +"]/chkflag");
  312. var chrtflag = "P";
  313. var medirecno = model.getValue("/root/main/chrtlist["+ i +"]/medirecno");
  314. var pid = model.getValue("/root/main/chrtlist["+ i +"]/pid");
  315. if(chkflag == "Y"){
  316. tmpSaveData = tmpSaveData + "i▦" + rendcd + "▦" + appdeptcd + "▦" + lendmanid + "▦" + appmanid + "▦" + cntctelno + "▦" + msgcnts + "▦";
  317. tmpSaveData = tmpSaveData + renddd + "▦" + "" + "▦" + pid + "▦" + chrtpid + "▦" + ioflag + "▦" + chrtflag + "▦" + medirecno + "▦";
  318. tmpSaveData = tmpSaveData + resettm + "▦" + acptid + "▦" + orddeptcd + "▦" + centcd + "▩";
  319. icnt++;
  320. }
  321. }
  322. if(icnt < 1){
  323. window.alert("대출할 차트를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  324. return;
  325. }
  326. model.makeValue("/root/send/savedata", tmpSaveData);
  327. submit("TXMRC00100");
  328. // 2008.01.02. 대출현황 조회 총건수..
  329. //model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  330. //cap_rendlist.refresh();
  331. // 다시조회.. 종이챠트 리스트
  332. btn_chrtlist.dispatch("DOMActivate");
  333. }
  334. /**
  335. * @desc : 바코드입력 후 엔터시 -> 대출등록 * @
  336. * @
  337. * @param :
  338. * @return :
  339. * @authur : 이은영 2008.03.18
  340. * @---------------------------------------------------
  341. */
  342. function fSetLendChartBcno()
  343. {
  344. var bcno = model.getValue("/root/send/reqdata/bcno");
  345. if (bcno == "" || bcno == "0"){
  346. window.alert("바코드를 입력해 주세요", "차트대출 및 반납", 0 | 64);
  347. model.setFocus("ipt_lendbcno");
  348. return;
  349. }
  350. // 2009.04.13. 의정부 성모인 경우..
  351. // 바코드 리딩시 lpad 로 해서 '0' 을 체움..
  352. // 리팅값과 DB값이 다를수 있음..
  353. // 바코드번호를 외래간호에서 생성하면 '0' 이 없고,
  354. // 의료정보팀에서 생성하면 '0' 이 있음..
  355. if (getUserInfo("dutplceinstcd") == "013") {
  356. if (bcno.length < 12) { bcno = bcno.getLeftPad(12, "0"); }
  357. }
  358. var autoflag = model.getValue("/root/send/reqdata/autolendflag");
  359. if (autoflag == "A"){ // 자동대출인 경우
  360. // 데이타 셋하기.. 외래/입원구분, 처리자ID, 대출일, 조회시간, 바코드
  361. var resettm = model.getValue("/root/send/reqdata/resettm");
  362. model.makeValue("/root/send/req/ioflag" , "O");
  363. model.makeValue("/root/send/req/acptid" , getUserId());
  364. model.makeValue("/root/send/req/renddd" , getCurrentDate());
  365. model.makeValue("/root/send/req/resettm" , resettm);
  366. model.makeValue("/root/send/req/bcno" , bcno.toUpperCase());
  367. setErrorOff();
  368. var result = submit("TXMRC03001", "", "/root/send/req", "/root/main/chrtlend/rendlist");
  369. if (result == false)
  370. {
  371. var message = model.getValue("/root/properties/error/msg");
  372. if (message == "차트대출 신청건이 2건 이상 있습니다......!")
  373. {
  374. // 노드 클리어..
  375. model.destroy("/root/hidden/chrtapplist");
  376. model.refresh();
  377. // 신청내역조회하기..
  378. submit("TRMRC00180");
  379. // 두개이상의 신청내역이 있으면 팝업으로 선택하게 한다.
  380. grup_applist.visible = "true";
  381. return;
  382. } else {
  383. alert(message);
  384. }
  385. }
  386. } else if (autoflag == "E"){ // 기타대출인 경우
  387. //fSetLendChartBcnoEtc();
  388. //** 2008.11.19. 이은영.. 기타대출 속도 향상을 위해..
  389. // 대출등록
  390. var rendcd = model.getValue("/root/main/lendinfo/rendcd");
  391. var appdeptcd = model.getValue("/root/main/lendinfo/appdeptcd");
  392. var lendmanid = model.getValue("/root/main/lendinfo/lendmanid");
  393. var appmanid = model.getValue("/root/main/lendinfo/appmanid");
  394. var cntctelno = model.getValue("/root/main/lendinfo/cntctelno");
  395. var msgcnts = model.getValue("/root/main/lendinfo/msgcnts");
  396. if (rendcd == ""){
  397. window.alert("대출용도를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  398. model.setFocus("cmb_l_rendcd");
  399. return;
  400. }
  401. if (appdeptcd == ""){
  402. window.alert("대출과를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  403. model.setFocus("cmb_l_appdeptcd");
  404. return;
  405. }
  406. if (lendmanid == "" || lendmanid.isNumber()== false){
  407. window.alert("대출자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  408. model.setFocus("ipt_l_lendmanid");
  409. return;
  410. }
  411. if (appmanid == "" || appmanid.isNumber()== false){
  412. window.alert("신청자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  413. model.setFocus("ipt_l_appmanid");
  414. return;
  415. }
  416. // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
  417. // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
  418. if (rendcd == "021" || rendcd == "022"){
  419. msgcnts = msgcnts.getTrimLeft();
  420. msgcnts = msgcnts.getTrimRight();
  421. if (msgcnts.length == ""){
  422. window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
  423. model.setFocus("ipt_l_msgcnts");
  424. return;
  425. }
  426. }
  427. // 2009.03.18. 대출과가 센터인 경우 진료과 선택 체킹하기...
  428. var orddeptkind = model.getValue("/root/main/lendinfo/orddeptkind");
  429. var orddeptcd = model.getValue("/root/main/lendinfo/orddeptcd");
  430. if (orddeptkind == "C" && orddeptcd == "-"){
  431. window.alert("대출과가 센터인 경우 진료과를 선택해주세요.", "차트대출신청", 0 | 64);
  432. model.setFocus("cmb_l_orddeptcd");
  433. return;
  434. }
  435. // 노드 클리어..
  436. model.destroy("/root/hidden/chrtapplist");
  437. model.refresh();
  438. // 데이타 셋하기.. 외래/입원구분, 처리자ID, 대출일, 조회시간, 바코드
  439. var resettm = model.getValue("/root/send/reqdata/resettm");
  440. model.makeValue("/root/send/req/ioflag" , "O");
  441. //2010.12.28, 주희경, 입원대출 시에는 ioflag를 I로 설정
  442. if ( model.getValue("/root/send/reqdata/autolendflag") == "I" )
  443. {
  444. ioflag = "I";
  445. }
  446. model.makeValue("/root/send/req/acptid" , getUserId());
  447. model.makeValue("/root/send/req/renddd" , getCurrentDate());
  448. model.makeValue("/root/send/req/resettm" , resettm);
  449. model.makeValue("/root/send/req/bcno" , bcno.toUpperCase());
  450. // 추가 데이타.. 대출용도, 대출신청과, 대출자ID, 신청자ID, 연락처, 전달메세지
  451. model.makeValue("/root/send/req/rendcd" , rendcd);
  452. model.makeValue("/root/send/req/appdeptcd" , appdeptcd);
  453. model.makeValue("/root/send/req/lendmanid" , lendmanid);
  454. model.makeValue("/root/send/req/appmanid" , appmanid);
  455. model.makeValue("/root/send/req/cntctelno" , cntctelno);
  456. model.makeValue("/root/send/req/msgcnts" , msgcnts);
  457. // 2009.03.18. 대출과가 센터인 경우 진료과 , 센터과 저장
  458. var orddeptkind = model.getValue("/root/main/lendinfo/orddeptkind");
  459. var centcd = "-";
  460. if (orddeptkind == "C") {
  461. centcd = model.getValue("/root/main/lendinfo/appdeptcd");
  462. }
  463. var orddeptcd = model.getValue("/root/main/lendinfo/orddeptcd");
  464. model.makeValue("/root/send/req/centcd" , centcd);
  465. model.makeValue("/root/send/req/orddeptcd" , orddeptcd);
  466. setErrorOff();
  467. var result = submit("TXMRC03003", "", "/root/send/req", "/root/main/chrtlend/rendlist");
  468. if (result == false)
  469. {
  470. var message = model.getValue("/root/properties/error/msg");
  471. alert(message);
  472. }
  473. //*/
  474. }
  475. // 2008.01.25. 바코드 번호 클리어...
  476. model.makeValue("/root/send/reqdata/bcno", "");
  477. ipt_lendbcno.refresh();
  478. model.setFocus("ipt_lendbcno");
  479. // 2008.01.02. 대출현황 조회 총건수..
  480. //model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  481. //cap_rendlist.refresh();
  482. }
  483. /**
  484. * @desc : 바코드입력 후 엔터시 -> 대출등록 * @
  485. * @
  486. * @param :
  487. * @return :
  488. * @authur : 이은영 2008.03.18
  489. * @---------------------------------------------------
  490. */
  491. function fSetLendChartBcnoEtc()
  492. {
  493. // 노드 클리어..
  494. model.destroy("/root/hidden/chrtapplist");
  495. model.refresh();
  496. // 2009.04.13. 의정부 성모인 경우..
  497. // 바코드 리딩시 lpad 로 해서 '0' 을 체움..
  498. // 리팅값과 DB값이 다를수 있음..
  499. // 바코드번호를 외래간호에서 생성하면 '0' 이 없고,
  500. // 의료정보팀에서 생성하면 '0' 이 있음..
  501. var bcno = model.getValue("/root/send/reqdata/bcno");
  502. if (getUserInfo("dutplceinstcd") == "013") {
  503. if (bcno.length < 12) { bcno = bcno.getLeftPad(12, "0"); }
  504. }
  505. model.makeValue("/root/hidden/chkchrt/bcno", bcno.toUpperCase());
  506. model.makeValue("/root/hidden/chkchrt/medirecno", "");
  507. model.makeValue("/root/hidden/chkchrt/ioflag", "O");
  508. model.refresh();
  509. model.copyNode("/root/send/req", "/root/hidden/chkchrt");
  510. submit("TRMRC00180");
  511. // 2008.01.18. 바코드 리더기 대출 처리시
  512. // 1. 대출챠트인가?
  513. // 2. 대출신청건이 있는가?
  514. // 3. 대출신청건이 몇건인가?
  515. var lendyn = model.getValue("/root/hidden/chrtapplist[1]/lendyn");
  516. var chrtseqno = model.getValue("/root/hidden/chrtapplist[1]/chrtseqno");
  517. if (lendyn == "Y") {
  518. alert("이미 대출된 챠트입니다.");
  519. return;
  520. }
  521. // 2007.12.14. 대출일자는 당일로 한다...
  522. var renddd = getCurrentDate();
  523. model.makeValue("/root/send/reqdata/renddd", renddd);
  524. var resettm = model.getValue("/root/send/reqdata/resettm");
  525. var acptid = model.getValue("/root/send/reqdata/acptid");
  526. var cnt = getNodesetCnt(model, "/root/hidden/chrtapplist");
  527. if (cnt > 0) {
  528. if (lendyn == "N" && cnt == 1 && chrtseqno == "") {
  529. // 대출등록
  530. var rendcd = model.getValue("/root/main/lendinfo/rendcd");
  531. var appdeptcd = model.getValue("/root/main/lendinfo/appdeptcd");
  532. var lendmanid = model.getValue("/root/main/lendinfo/lendmanid");
  533. var appmanid = model.getValue("/root/main/lendinfo/appmanid");
  534. var cntctelno = model.getValue("/root/main/lendinfo/cntctelno");
  535. var msgcnts = model.getValue("/root/main/lendinfo/msgcnts");
  536. if (rendcd == ""){
  537. window.alert("대출용도를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  538. model.setFocus("cmb_l_rendcd");
  539. return;
  540. }
  541. if (appdeptcd == ""){
  542. window.alert("대출과를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  543. model.setFocus("cmb_l_appdeptcd");
  544. return;
  545. }
  546. if (lendmanid == "" || lendmanid.isNumber()== false){
  547. window.alert("대출자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  548. model.setFocus("ipt_l_lendmanid");
  549. return;
  550. }
  551. if (appmanid == "" || appmanid.isNumber()== false){
  552. window.alert("신청자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
  553. model.setFocus("ipt_l_appmanid");
  554. return;
  555. }
  556. // 2008.09.01. 차트신청시 [ 021:연구용, 022:임상연구용 ]
  557. // 전달메세지 : 반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..
  558. if (rendcd == "021" || rendcd == "022"){
  559. msgcnts = msgcnts.getTrimLeft();
  560. msgcnts = msgcnts.getTrimRight();
  561. if (msgcnts.length == ""){
  562. window.alert("반드시 전달메세지 (연구 제목 및 기타사항) 을 입력해 주십시오..", "차트대출신청", 0 | 64);
  563. model.setFocus("ipt_l_msgcnts");
  564. return;
  565. }
  566. }
  567. var pid = model.getValue("/root/hidden/chrtapplist[1]/pid");
  568. var medirecno = model.getValue("/root/hidden/chrtapplist[1]/medirecno");
  569. var bcno = model.getValue("/root/hidden/chrtapplist[1]/bcno");
  570. var tmpSaveData = "status▦rendcd▦rendschedd▦appdeptcd▦lendmanid▦appmanid▦";
  571. tmpSaveData = tmpSaveData + "cntctelno▦msgcnts▦renddd▦";
  572. tmpSaveData = tmpSaveData + "bcno▦pid▦ioflag▦chrtflag▦medirecno▦renddd▦resettm▦acptid▩";
  573. tmpSaveData = tmpSaveData + "i▦" + rendcd + "▦" + renddd + "▦" + appdeptcd + "▦" + lendmanid + "▦" + appmanid + "▦";
  574. tmpSaveData = tmpSaveData + cntctelno + "▦" + msgcnts + "▦" + renddd + "▦";
  575. tmpSaveData = tmpSaveData + "" + "▦" + pid + "▦O▦P▦" + medirecno + "▦" + renddd + "▦" + resettm + "▦" + acptid + "▩";
  576. model.makeValue("/root/send/savedata", tmpSaveData);
  577. submit("TXMRC00100");
  578. // 2008.01.02. 대출현황 조회 총건수..
  579. //model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  580. //cap_rendlist.refresh();
  581. } else {
  582. // 대출신청이 있음
  583. window.alert("대출 신청건이 있습니다. 확인하세요.", "차트대출 및 반납", 0 | 64);
  584. }
  585. }
  586. }
  587. /**
  588. * @desc : 등록된 환자번호인지 체킹한다..
  589. * @
  590. * @param : iptObj - 환자번호 입력 컨트롤 (pid)
  591. * @return :
  592. * @authur : 이은영 2008.09.17
  593. * @---------------------------------------------------
  594. */
  595. function fGetPidNo(iptObj, ref)
  596. {
  597. var chkyn = model.getValue(ref);
  598. if (chkyn == "Y") {
  599. if (iptObj.currentText.length > 0) {
  600. var pid = iptObj.currentText;
  601. pid = getCretCheckNo(pid, getUserInfo("dutplceinstcd"));
  602. model.makeValue(iptObj.attribute("ref"), pid);
  603. iptObj.refresh();
  604. }
  605. }
  606. }
  607. /**
  608. * @desc : 등록된 환자번호인지 체킹한다..
  609. * @
  610. * @param : iptObj - 환자번호 입력 컨트롤 (pid)
  611. * @return : pnm - 환자명
  612. * @authur : 이은영 2008.03.18
  613. * @---------------------------------------------------
  614. */
  615. function fCheckPid(iptObj, refPnm)
  616. {
  617. model.makeValue("/root/send/req/srchcond", "1");
  618. model.makeValue("/root/send/req/pid", iptObj.currentText);
  619. //환자등록번호 체크
  620. if(iptObj.currentText.length > 0 ){
  621. model.resetInstanceNode("/root/main/result/patinfo");
  622. model.makeNode("/root/main/result/patinfo");
  623. if(submit("TRPMC02500", "", "/root/send/req", "/root/main/result/patinfo")){
  624. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  625. if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 ){
  626. model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
  627. //* 2009.04.07. 이중번호 메세지 ( 14257937 박용석 -> 13275912 신옥순 )
  628. var sBindPid = model.getValue("/root/main/result/patinfo/patinfolist/bindpid");
  629. if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' ){
  630. //합번된 등록번호 메세지 처리
  631. var sPid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
  632. var sHngnm = model.getValue("/root/main/result/patinfo/patinfolist/hngnm");
  633. var retValue = messageBox(sPid + " (" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
  634. if( retValue == '6' ){
  635. model.makeValue(iptObj.attribute("ref"), sBindPid);
  636. iptObj.refresh();
  637. fCheckPid(iptObj, refPnm);
  638. return "";
  639. }
  640. }
  641. //*/
  642. var pid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
  643. var pnm = model.getValue("/root/main/result/patinfo/patinfolist/hngnm");
  644. if (refPnm != null)
  645. {
  646. model.makeValue(refPnm, pnm);
  647. }
  648. return pnm;
  649. }else{
  650. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  651. messageBox("없는 환자 번호 입니다.", "E999", "");
  652. model.refresh();
  653. return "";
  654. }
  655. }
  656. }else{
  657. messageBox("환자등록번호를 정확히", "C001");
  658. return "";
  659. }
  660. }
  661. /**
  662. * @desc : 환자등록번호 조회 팝업
  663. * @
  664. * @param : refPid - 환자번호 참고 node path
  665. * refPnm - 환자명 참고 node path
  666. * @return :
  667. * @authur : 이은영 2008.03.18
  668. * @---------------------------------------------------
  669. */
  670. function fGetPid(refPid, refPnm)
  671. {
  672. //조회건수가 1건일 경우 팝업창을 바로 닫는다.
  673. model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
  674. model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "N");
  675. if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
  676. model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '2');
  677. }
  678. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
  679. model.resetInstanceNode("/root/source");
  680. //환자번호 copy
  681. var popupendflag = model.getValue("/root/main/popupendflag");
  682. if (popupendflag == "ok")
  683. {
  684. model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
  685. if (refPnm == null) { refPnm = "" }
  686. if (refPnm != "") {
  687. model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  688. }
  689. model.refresh();
  690. }
  691. }
  692. /**
  693. * @desc : 등록된 사용자 번호인지 체킹한다..
  694. * @
  695. * @param : iptObj - 사용자 ID 입력 컨트롤 (userid)
  696. * @return : posdeptcd - 사용자 부서코드
  697. * @authur : 이은영 2008.03.18
  698. * @---------------------------------------------------
  699. */
  700. function fCheckUserid(iptObj)
  701. {
  702. setInputNodeCurText();
  703. // 사용자 번호 체크
  704. if(iptObj.currentText.length > 0 ){
  705. // 사용자 조회
  706. model.removenode("/root/hidden/tmp/tempuserinfo/list");
  707. model.reset("/root/hidden/tmp/tempuserinfo");
  708. model.setValue("/root/hidden/tmp/userpopupinfo/param", "_OneS");
  709. model.setValue("/root/hidden/tmp/userpopupinfo/flag", "userid");
  710. model.setValue("/root/hidden/tmp/userpopupinfo/searchitem", iptObj.currentText);
  711. modal("SPZSU10103", "", "200", "200", "SPZSU10103","/root/hidden/tmp/userpopupinfo","/root/main/temp");
  712. var iParam = getParameter("SPZSU10103_");
  713. setCSVToNode("/root/hidden/tmp/tempuserinfo", iParam);
  714. clearParameter("SPZSU10103_");
  715. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  716. if( getNodesetCount("/root/hidden/tmp/tempuserinfo/list") > 0 ){
  717. var userid = model.getValue("/root/hidden/tmp/tempuserinfo/list/userid");
  718. var posdeptcd = model.getValue("/root/hidden/tmp/tempuserinfo/list/posdeptcd");
  719. iptObj.value = userid;
  720. model.refresh();
  721. return posdeptcd;
  722. //fSearch();
  723. }else{
  724. model.resetInstanceNode("/root/hidden/tmp/tempuserinfo/list");
  725. messageBox("없는 사용자 번호 입니다.", "E999", "");
  726. model.refresh();
  727. }
  728. }else{
  729. messageBox("사용자 번호를 정확히", "C001");
  730. iptObj.value = "";
  731. model.refresh();
  732. }
  733. return "";
  734. }
  735. /**
  736. * @desc : 마우스 오른쪽 버튼 팝업창
  737. * @
  738. * @param : job - 0:챠트대출, 1:챠트반납, 2:접수자명단
  739. * @return :
  740. * @authur : 이은영 2008.03.18
  741. * @---------------------------------------------------
  742. */
  743. function fMouseRghtBtnPopup(gridObj, job)
  744. {
  745. if (event.button == 3) {
  746. if (gridObj.isCell(event.target) && gridObj.mouseRow >= gridObj.fixedrows) {
  747. if (job == "0") {
  748. model.removeNodeset("/root/send/savedata");
  749. window.setPopupMenu(true, "/root/hidden/applist_menu/menu", "label", "func", false);
  750. } else {
  751. window.setPopupMenu(false);
  752. }
  753. } else {
  754. window.setPopupMenu(false);
  755. }
  756. } else {
  757. window.setPopupMenu(false);
  758. }
  759. }
  760. /**
  761. * @desc : 팝업폼 보여주기..
  762. * @
  763. * @param : job - 0:챠트대출(미대출사유) , 1:챠트반납(과보관사유),
  764. * @ 2:접수자명단(미대출사유), 3:챠트반납(대출연장) , 4:챠트반납(차트분실)
  765. * @return :
  766. * @authur : 이은영 2008.03.18
  767. * @---------------------------------------------------
  768. */
  769. function fShowWndIptBox(job)
  770. {
  771. grup_unrendresn.visible = "false";
  772. if (job == "0") {
  773. model.setValue("/root/hidden/applist/unrendcd", "00");
  774. model.setValue("/root/hidden/applist/unrendresn", "");
  775. model.refresh();
  776. if (event.clientY < 100) {
  777. grup_unrendresn.attribute("top") = event.clientY-90;
  778. } else {
  779. grup_unrendresn.attribute("top") = 100;
  780. }
  781. grup_unrendresn.visible = "true";
  782. }
  783. }
  784. /**
  785. * @desc : 대출신청내역이 여러 개인 경우 더블클릭으로 선택시 대출처리한다.
  786. * @
  787. * @param :
  788. * @return :
  789. * @authur : 이은영 2008.03.18
  790. * @---------------------------------------------------
  791. */
  792. function fChoiceChrtSeqNo()
  793. {
  794. var ref = "/root/hidden/chrtapplist";
  795. var grdObj = grd_chrtapplist;
  796. if (grdObj.row < 1){
  797. grup_applist.visible = "false";
  798. return;
  799. }
  800. var savedata = "m▦chrtseqno▦medirecno▦pid▦rendcd▦delyn▦renddd▦resettm▦acptid▦ioflag▩";
  801. var dataString = "";
  802. var renddd = model.getValue("/root/send/reqdata/renddd");
  803. var resettm = model.getValue("/root/send/reqdata/resettm");
  804. var acptid = model.getValue("/root/send/reqdata/acptid");
  805. var chrtseqno = model.getValue(ref + "[" + grdObj.row + "]/chrtseqno");
  806. var medirecno = model.getValue(ref + "[" + grdObj.row + "]/medirecno");
  807. var pid = model.getValue(ref + "[" + grdObj.row + "]/pid");
  808. var rendcd = model.getValue(ref + "[" + grdObj.row + "]/rendcd");
  809. var ioflag = "";
  810. //2010.12.28, 주희경, 입원대출 시에는 ioflag를 I로 설정
  811. if ( model.getValue("/root/send/reqdata/autolendflag") == "I" )
  812. {
  813. ioflag = "I";
  814. }
  815. dataString = "u▦" + chrtseqno + "▦" + medirecno + "▦" + pid + "▦" + rendcd + "▦N▦" + renddd + "▦" + resettm + "▦" + acptid + "▦O▩";
  816. if (dataString.length > 0)
  817. {
  818. model.makeValue("/root/send/savedata", savedata + dataString);
  819. submit("TXMRC00120");
  820. // 2008.01.25. 바코드 번호 클리어...
  821. model.makeValue("/root/send/reqdata/bcno", "");
  822. ipt_lendbcno.refresh();
  823. // 2008.01.02. 대출현황 조회 총건수..
  824. //model.setValue ("/root/init/count", grd_rendlist.rows - 1);
  825. //cap_rendlist.refresh();
  826. }
  827. grup_applist.visible = "false";
  828. }
  829. /**
  830. * @desc : 대출용도 코드 입력시 대출용도 콤보 선택되도록 함
  831. * @
  832. * @param :
  833. * @return :
  834. * @authur : 이은영 2008.05.30
  835. * @---------------------------------------------------
  836. */
  837. function fSelectedComboLendCd(iptObj, comboRef)
  838. {
  839. var lendcd = iptObj.currentText;
  840. lendcd = lendcd.getLeftPad(3, "0");
  841. var ref = iptObj.attribute("ref");
  842. model.setValue(ref, lendcd);
  843. model.setValue(comboRef, lendcd);
  844. model.refresh();
  845. }
  846. /**
  847. * @desc : 대출과 약어 입력시 대출과 콤보 선택되도록 함
  848. * @
  849. * @param :
  850. * @return :
  851. * @authur : 이은영 2008.05.30
  852. * @---------------------------------------------------
  853. */
  854. function fSelectedComboLendDeptCd(iptObj, comboObj)
  855. {
  856. var lenddeptabbr = iptObj.currentText;
  857. lenddeptabbr = lenddeptabbr.toUpperCase( );
  858. var ref = iptObj.attribute("ref");
  859. model.setValue(ref, lenddeptabbr);
  860. var deptcd = model.getValue("/root/init/lendmastinfo/lenddeptlist[lenddeptabbr ='" + lenddeptabbr + "']/lenddeptcd");
  861. var comboRef = comboObj.attribute("ref");
  862. model.setValue(comboRef, deptcd);
  863. model.refresh();
  864. if (deptcd != ""){
  865. // 대출과에 따른 대출자(의사) 조회하기
  866. comboObj.dispatch("xforms-value-changed");
  867. }
  868. }
  869. /**
  870. * @desc : 환자 외래 차트 리스트 조회
  871. * @
  872. * @param :
  873. * @return :
  874. * @authur : 이은영 2008.08.07
  875. * @---------------------------------------------------
  876. */
  877. function fGetChrtList()
  878. {
  879. fCheckPid(ipt_chrtpid, "/root/main/lendinfo/pnm");
  880. model.makeValue("/root/send/req/ioflag", model.getValue("/root/main/lendinfo/ioflag"));
  881. model.makeValue("/root/send/req/pid" , model.getValue("/root/main/lendinfo/pid"));
  882. submit("TRMRC00144","","/root/send/req","/root/main/chrtlist");
  883. }
  884. /**
  885. * @desc : 사용자콤보 조회
  886. * @
  887. * @param : ref - reference path
  888. * rsltref - result reference path
  889. * deptcd - 부서코드
  890. * jobkindcd - 직종코드
  891. * jobposcd - 직책코드
  892. * specordyn - 선택진료여부
  893. * @return :
  894. * @author :
  895. * @---------------------------------------------------
  896. */
  897. function fGetUserComboList(ref, rsltref, deptcd, jobkindcd, specordyn)
  898. {
  899. model.removeNode(ref);
  900. model.makeValue(ref + "/deptcd" , deptcd); //부서코드
  901. model.makeValue(ref + "/jobkindcd", jobkindcd); //직종코드(의사:0330)
  902. model.makeValue(ref + "/specordyn", specordyn); //선택진료여부
  903. model.removeNode(rsltref);
  904. model.makeValue(rsltref + "/userlist/usercombo[1]/usernm", '-');
  905. model.makeValue(rsltref + "/userlist/usercombo[1]/userid", '');
  906. model.refresh();
  907. submit("TRMMB04102", "false", ref, rsltref + "/userlist");
  908. }
  909. /**
  910. * @desc : 대출자 조회
  911. * @
  912. * @param : refUserid - 대출자 ID, refUserDeptcd - 소속부서코드 ( posdeptcd )
  913. * @return :
  914. * @authur : 이은영 2008.03.18
  915. * @---------------------------------------------------
  916. */
  917. function fGetUserid(refUserid, refUsernm, refUserDeptcd, cmbObj)
  918. {
  919. model.removenode("/root/hidden/tmp/tempuserinfo/list");
  920. model.reset("/root/hidden/tmp/tempuserinfo");
  921. var user = model.getValue(refUserid);
  922. var flag = "userid";
  923. if(isNaN(user)){
  924. flag = "usernm";
  925. }
  926. model.setValue("/root/hidden/tmp/userpopupinfo/param", "_OneS");
  927. model.setValue("/root/hidden/tmp/userpopupinfo/flag", flag);
  928. model.setValue("/root/hidden/tmp/userpopupinfo/searchitem", user);
  929. modal("SPZSU10103", "", "200", "200", "SPZSU10103","/root/hidden/tmp/userpopupinfo","/root/main/temp");
  930. var iParam = getParameter("SPZSU10103_");
  931. setCSVToNode("/root/hidden/tmp/tempuserinfo", iParam);
  932. clearParameter("SPZSU10103_");
  933. model.refresh();
  934. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  935. if( getNodesetCount("/root/hidden/tmp/tempuserinfo/list") > 0 ){
  936. var userid = model.getValue("/root/hidden/tmp/tempuserinfo/list/userid");
  937. var usernm = model.getValue("/root/hidden/tmp/tempuserinfo/list/usernm");
  938. var posdeptcd = model.getValue("/root/hidden/tmp/tempuserinfo/list/posdeptcd");
  939. if (!isNull(refUsernm)){
  940. if (isNaN(refUsernm)){
  941. model.makeValue(refUsernm, usernm);
  942. }
  943. }
  944. if (!isNull(refUserDeptcd)){
  945. if (isNaN(refUserDeptcd)){
  946. model.makeValue(refUserDeptcd, posdeptcd);
  947. }
  948. }
  949. if (cmbObj != null){
  950. fAddUser(userid, usernm, cmbObj);
  951. }
  952. model.makeValue(refUserid, userid);
  953. model.refresh();
  954. }
  955. }
  956. /**
  957. * @desc : 대출자ID, 대출자명 콤보에 추가하기
  958. * @
  959. * @param : refUserid - 대출자 ID, refUsernm - 대출자명
  960. * @return :
  961. * @authur : 이은영 2008.09.01
  962. * @---------------------------------------------------
  963. */
  964. function fAddUser(Userid, Usernm, cmbObj)
  965. {
  966. var ref = cmbObj.choices.itemset.attribute("nodeset");
  967. var cnt = getNodesetCnt(model, ref) + 1 ;
  968. var userid = model.getValue(ref + "[userid ='" + Userid + "']/userid");
  969. if (userid == ""){
  970. model.makeValue(ref + "["+ cnt +"]/userid", Userid);
  971. model.makeValue(ref + "["+ cnt +"]/usernm", Usernm);
  972. var dataRef = cmbObj.attribute("ref");
  973. model.setValue(dataRef, Userid);
  974. cmbObj.refresh();
  975. }
  976. }
  977. /**
  978. * @desc : excel 저장 하기
  979. * @
  980. * @param :
  981. * @return :
  982. * @authur : 이은영 2008.07.14
  983. * @---------------------------------------------------
  984. */
  985. function fExcel(gridObj, title){
  986. if (title == null) { title = "" }
  987. var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  988. if (fileName != "") {
  989. gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
  990. }
  991. }
  992. /**
  993. * @desc : 선택된 환자등록번호로 현위치조회 텝이동..
  994. * @
  995. * @param : gridObj - 그리드 컨트롤, ref - node path
  996. * @return :
  997. * @authur : 이은영 2008.03.18
  998. * @---------------------------------------------------
  999. */
  1000. function fMoveTabChartByPid(gridObj, ref){
  1001. if (isDataCell() == false){
  1002. return;
  1003. }
  1004. if (gridObj.row < 1){
  1005. return;
  1006. }
  1007. var pid = model.getValue(ref + "[" + gridObj.row + "]/pid");
  1008. var pnm = model.getValue(ref + "[" + gridObj.row + "]/pnm");
  1009. window.parent.model.makeValue("/root/send/reqdata/pid" , pid);
  1010. window.parent.model.makeValue("/root/send/reqdata/pnm" , pnm);
  1011. window.parent.model.makeValue("/root/send/reqdata/rrgstno", "");
  1012. window.parent.model.refresh();
  1013. window.parent.btn_ChrtInfo.dispatch("onclick");
  1014. window.parent.javascript.fChartHistory();
  1015. }
  1016. /**
  1017. * @desc : 단축키 선택시 커서이동
  1018. * @
  1019. * @param :
  1020. * @return :
  1021. * @authur : 이은영 2009.01.28
  1022. * @---------------------------------------------------
  1023. */
  1024. function fMoveCursor(){
  1025. // 2009.02.17. 단축키 커서 이동시 자동대출 선택후 바코드에 커서가 위치하도록 수정함.
  1026. model.setValue("/root/send/reqdata/autolendflag", "A");
  1027. rdo_autolendflag.refresh();
  1028. fDisplayAutoLend();
  1029. model.setFocus("ipt_lendbcno");
  1030. ipt_lendbcno.refresh();
  1031. }
  1032. /**
  1033. * @desc : 단축키 선택시 커서이동
  1034. * @
  1035. * @param :
  1036. * @return :
  1037. * @authur : 이은영 2009.01.28
  1038. * @---------------------------------------------------
  1039. */
  1040. function fKeyDown(){
  1041. // F7 : 118, F8 : 119 , F9 : 120, F10 : 121
  1042. var keyCode = event.keyCode;
  1043. if (keyCode == "118") {
  1044. window.parent.javascript.fAccessKey1();
  1045. } else if (keyCode == "119") {
  1046. window.parent.javascript.fAccessKey2();
  1047. } else if (keyCode == "120") {
  1048. window.parent.javascript.fAccessKey3();
  1049. } else if (keyCode == "121") {
  1050. window.parent.javascript.fAccessKey4();
  1051. }
  1052. }