SPMMR03900.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 의사 진료일정 조회 ( SPMMR03900_진료일정.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - Author : 박종훈
  7. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  8. */
  9. var cnstflag = "";
  10. /**
  11. * @desc : 화면초기화
  12. * @id :
  13. * @event : xforms-ready
  14. * @return : void
  15. * @authur : 박종훈
  16. */
  17. function fInitalize()
  18. {
  19. cnstflag = parent.window.javascript.getParameter("MMR05000_cnstflag");
  20. grup_cnst3.attribute("left") = 0;
  21. if (cnstflag == "1")
  22. {
  23. var ioflag = parent.model.getValue ("/root/main/result/paminfo/list/ioflag");
  24. grup_cnst3.attribute("width") = 0;
  25. grup_cnst3.attribute("height") = 0;
  26. grup_cnst1.attribute("visibility") = "visible";
  27. if (ioflag == "I" || ioflag == "E" || ioflag == "D")
  28. {
  29. rdo_cnstioflag.attribute("visibility") = "visible";
  30. //model.setValue("/root/init/cnstioflag", ioflag);
  31. ioflag = "I";
  32. }
  33. else
  34. {
  35. rdo_cnstioflag.attribute("visibility") = "hidden";
  36. ioflag = "O";
  37. }
  38. model.setValue("/root/init/cnstioflag", ioflag);
  39. window.Height = parseInt(grup_cnst1.attribute("height")) + 55;
  40. window.width = parseInt(grup_cnst1.attribute("width")) + 25;
  41. }
  42. else if (cnstflag == "3")
  43. {
  44. grup_cnst1.attribute("width") = 0;
  45. grup_cnst1.attribute("height") = 0;
  46. grup_cnst3.attribute("visibility") = "visible";
  47. window.Height = parseInt(grup_cnst3.attribute("height")) + 55;
  48. window.width = parseInt(grup_cnst3.attribute("width")) + 25;
  49. }
  50. model.setValue("/root/send/ioflag", model.getValue("/root/init/cnstioflag"));
  51. model.setValue("/root/send/cnstflag", cnstflag);
  52. submit("TRMMR04902"); //컨설트부서조회
  53. }
  54. /**
  55. * @desc : 내원구분 선택
  56. * @id :
  57. * @event : ondblclick
  58. * @return : void
  59. * @authur : 박종훈
  60. */
  61. function fSelIOFlag()
  62. {
  63. model.removeNodeset("/root/main/cnstformlist/cnstform");
  64. model.removeNodeset("/root/main/drschlist");
  65. model.setValue("/root/send/ioflag", model.getValue("/root/init/cnstioflag"));
  66. model.setValue("/root/send/cnstflag", cnstflag);
  67. submit("TRMMR04902"); //컨설트부서조회
  68. }
  69. /**
  70. * @desc : 부서리스트 선택
  71. * @id :
  72. * @event : ondblclick
  73. * @return : void
  74. * @authur : 박종훈
  75. */
  76. function fClickDeptList()
  77. {
  78. if((grd_deptlist.isCell(event.target) && grd_deptlist.mouserow >= grd_deptlist.fixedrows && (grd_deptlist.Rows > 1))) //그리드에서 데이타영역만
  79. {
  80. //var deptcd = model.getValue("/root/main/deptlist/dept[" + grd_deptlist.row + "]deptcd");
  81. var deptcd = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptcd"));
  82. var cnstflag = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstflag"));
  83. var fr_date = new Date();
  84. var to_date = new Date();
  85. to_date = to_date.getAddDate(29, "D");
  86. //2009-06-19 오후 8:38:58 강지훈 추가 : 특정과는 진료일정이없어도 모든 진료의를 보여주어야 한다.
  87. mmbfGetHardCodeInfo("/root/send/formhrdcd", "/root/tmp/depthrcd", 9902);
  88. var cnstdeptcd = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptcd"));
  89. var seledtedDeptcd = model.getValue("/root/tmp/depthrcd/hardcd[hardcd = "+ cnstdeptcd +"]/hardcd");
  90. var cnstioflag = "";
  91. if(seledtedDeptcd == ""){
  92. cnstioflag = "O" //진료일정이 있는 의사만 보여준다.
  93. }
  94. else{
  95. cnstioflag = "I" //진료일정이 없는 의사까지 모두 보여준다.
  96. }
  97. //alert("fr_date:"+fr_date.getDateFormat());
  98. //alert("to_date:"+to_date.getDateFormat());
  99. model.makeValue("/root/send/orddeptcd", deptcd);
  100. model.makeValue("/root/send/fromdd", fr_date.getDateFormat());
  101. model.makeValue("/root/send/todd", to_date.getDateFormat());
  102. model.makeValue("/root/send/cnstdeptcd", cnstdeptcd );
  103. model.makeValue("/root/send/cnstdeptnm", grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptnm")) );
  104. model.makeValue("/root/send/formcd", grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("formcd")) );
  105. model.makeValue("/root/send/cnstioflag", cnstioflag);
  106. model.removeNodeset("/root/main/endresnlist");
  107. model.removeNodeset("/root/main/endresn");
  108. if(submit("TRMMR03901"))
  109. {
  110. grd_drschlist.rowheight(1) = 0;
  111. grd_drschlist.rowheight(2) = 0;
  112. grd_drschlist.resizeCells();
  113. fSetGrdColor();
  114. }
  115. }
  116. }
  117. /**
  118. * @desc : 재활고려서식을 위한 함수
  119. */
  120. function fClickDeptList_koryo()
  121. {
  122. if(grd_deptlist.Rows > 1) //그리드에서 데이타영역만
  123. {
  124. //var deptcd = model.getValue("/root/main/deptlist/dept[" + grd_deptlist.row + "]deptcd");
  125. var deptcd = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptcd"));
  126. var cnstflag = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstflag"));
  127. var fr_date = new Date();
  128. var to_date = new Date();
  129. to_date = to_date.getAddDate(29, "D");
  130. //2009-06-19 오후 8:38:58 강지훈 추가 : 특정과는 진료일정이없어도 모든 진료의를 보여주어야 한다.
  131. mmbfGetHardCodeInfo("/root/send/formhrdcd", "/root/tmp/depthrcd", 9902);
  132. var cnstdeptcd = grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptcd"));
  133. var seledtedDeptcd = model.getValue("/root/tmp/depthrcd/hardcd[hardcd = "+ cnstdeptcd +"]/hardcd");
  134. var cnstioflag = "";
  135. if(seledtedDeptcd == ""){
  136. cnstioflag = "O" //진료일정이 있는 의사만 보여준다.
  137. }
  138. else{
  139. cnstioflag = "I" //진료일정이 없는 의사까지 모두 보여준다.
  140. }
  141. //alert("fr_date:"+fr_date.getDateFormat());
  142. //alert("to_date:"+to_date.getDateFormat());
  143. model.makeValue("/root/send/orddeptcd", deptcd);
  144. model.makeValue("/root/send/fromdd", fr_date.getDateFormat());
  145. model.makeValue("/root/send/todd", to_date.getDateFormat());
  146. model.makeValue("/root/send/cnstdeptcd", cnstdeptcd );
  147. model.makeValue("/root/send/cnstdeptnm", grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("cnstdeptnm")) );
  148. model.makeValue("/root/send/formcd", grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colref("formcd")) );
  149. model.makeValue("/root/send/cnstioflag", cnstioflag);
  150. model.removeNodeset("/root/main/endresnlist");
  151. model.removeNodeset("/root/main/endresn");
  152. if(submit("TRMMR03901"))
  153. {
  154. grd_drschlist.rowheight(1) = 0;
  155. grd_drschlist.rowheight(2) = 0;
  156. grd_drschlist.resizeCells();
  157. fSetGrdColor();
  158. }
  159. }
  160. }
  161. /**
  162. * @desc : 일정별 색상 설정
  163. * @id :
  164. * @event : ondblclick
  165. * @return : void
  166. * @authur : 박종훈
  167. */
  168. function fSetGrdColor()
  169. {
  170. var cols = grd_drschlist.cols;
  171. var rows = grd_drschlist.rows;
  172. for( var i = 1; i <= rows; i++ )
  173. {
  174. for( var j = 1; j <= cols; j++ )
  175. {
  176. var drsch = grd_drschlist.valueMatrix(i, j);
  177. if (i > 3)
  178. {
  179. if (drsch == "오전")
  180. {
  181. grd_drschlist.cellStyle("background-color", i, j) = "#ffff99";
  182. }
  183. else if (drsch == "오후")
  184. {
  185. grd_drschlist.cellStyle("background-color", i, j) = "#ccffff";
  186. }
  187. else if (drsch == "전일")
  188. {
  189. grd_drschlist.cellStyle("background-color", i, j) = "#ffcc99";
  190. }
  191. else if (drsch.substr(0, 2) == "휴진")
  192. {
  193. grd_drschlist.cellStyle("background-color", i, j) = "#3366ff";
  194. }
  195. else if (drsch == "마감")
  196. {
  197. grd_drschlist.cellStyle("background-color", i, j) = "#999999";
  198. }
  199. else
  200. {
  201. grd_drschlist.cellStyle("background-color", i, j) = "#ffffff";
  202. }
  203. }
  204. else if (i == 1)
  205. {
  206. if (drsch == "4")
  207. {
  208. grd_drschlist.cellStyle("color", 4, j) = "#3366ff"; //토요일
  209. }
  210. else if (drsch == "8")
  211. {
  212. grd_drschlist.cellStyle("color", 4, j) = "#ff0000"; //일요일
  213. }
  214. else
  215. {
  216. grd_drschlist.cellStyle("color", 4, j) = "#4d4d4d";
  217. }
  218. }
  219. if(i == 3 || j == 1)
  220. {
  221. //grd_drschlist.cellStyle("background-color", i, j) = "#99ccff"; //날짜, 의사명
  222. grd_drschlist.cellStyle("color", i, j) = "#4d4d4d";
  223. grd_drschlist.cellStyle("background-image", i, j) = "../../../com/commonweb/images/grid_bg.gif";
  224. grd_drschlist.cellStyle("background-repeat", i, j) = "repeat-x";
  225. grd_drschlist.cellStyle("background-stretch", i, j) = "stretch";
  226. grd_drschlist.cellStyle("border-style", i, j) = "solid";
  227. grd_drschlist.cellStyle("border-left-color", i, j) = "#c6e4ff";
  228. grd_drschlist.cellStyle("border-top-color", i, j) = "#8ebcff";
  229. grd_drschlist.cellStyle("border-right-color", i, j) = "#8ebcff";
  230. grd_drschlist.cellStyle("border-bottom-color", i, j) = "#8ebcff";
  231. }
  232. }
  233. }
  234. }
  235. /**
  236. * @desc : 일정 선택
  237. * @id :
  238. * @event : ondblclick
  239. * @return : void
  240. * @authur : 박종훈
  241. */
  242. function fClickSchList_old()
  243. {
  244. var col = grd_drschlist.col;
  245. var row = grd_drschlist.row;
  246. var day_rowno = 2;
  247. var drnm = grd_drschlist.valueMatrix(row, grd_drschlist.colref("orddrnm"));
  248. if (col > 1 && row > 4)
  249. {
  250. // var drsch = grd_drschlist.valueMatrix(row, col);
  251. //
  252. // if (drsch == "")
  253. // {
  254. // messageBox("선택하신 날짜에 " + drnm + "님의 진료일정이", "I004");
  255. // }
  256. // else
  257. // {
  258. var drid = grd_drschlist.valueMatrix(row, grd_drschlist.colref("orddrid"));
  259. var cnstflag = "1";
  260. var orddd = grd_drschlist.valueMatrix(day_rowno, col);
  261. if (orddd != "")
  262. {
  263. if (orddd < getCurrentDate())
  264. {
  265. messageBox("과거일로 의뢰할 수", "I004");
  266. return;
  267. }
  268. else
  269. {
  270. var deptcd = model.getValue("/root/send/cnstdeptcd");
  271. var deptnm = model.getValue("/root/send/cnstdeptnm");
  272. var formcd = model.getValue("/root/send/formcd");
  273. //alert("부서코드=" + deptcd + ", 의사ID=" + drid + ", 의사이름=" + drnm + ", 진료일=" + orddd);
  274. parent.window.javascript.fOpenCnstForm(formcd, deptcd, deptnm, drid, drnm, orddd, cnstflag, "", "");
  275. window.close();
  276. }
  277. }
  278. // }
  279. }
  280. }
  281. /**
  282. * @desc : 타과의뢰 선택
  283. * @id :
  284. * @event : ondblclick
  285. * @return : void
  286. * @authur : 박종훈
  287. */
  288. function fClickCnstList()
  289. {
  290. var col = grd_cnstlist.col;
  291. var row = grd_cnstlist.row;
  292. var formcd = grd_cnstlist.valueMatrix(row, grd_cnstlist.colref("formcd"));
  293. var formnm = grd_cnstlist.valueMatrix(row, grd_cnstlist.colref("formnm"));
  294. var deptcd = grd_cnstlist.valueMatrix(row, grd_cnstlist.colref("cnstdeptcd"));
  295. var deptnm = grd_cnstlist.valueMatrix(row, grd_cnstlist.colref("cnstdeptnm"));
  296. var replflag = grd_cnstlist.valueMatrix(row, grd_cnstlist.colref("replflag"));
  297. var cnstflag = "3";
  298. parent.window.javascript.setParameter("SPMMR03900_formcd", formcd);
  299. parent.window.javascript.setParameter("SPMMR03900_deptcd", deptcd);
  300. parent.window.javascript.setParameter("SPMMR03900_deptnm", deptnm);
  301. parent.window.javascript.setParameter("SPMMR03900_cnstflag", cnstflag);
  302. parent.window.javascript.setParameter("SPMMR03900_formnm", formnm);
  303. parent.window.javascript.setParameter("SPMMR03900_replflag", replflag);
  304. //parent.window.javascript.fOpenCnstForm(formcd, deptcd, deptnm, "", "", "", cnstflag, formnm, replflag);
  305. window.close();
  306. }
  307. /**
  308. * @desc : 다음달, 이전달
  309. * @id :
  310. * @event : ondblclick
  311. * @return : void
  312. * @authur : 박종훈
  313. */
  314. function fCalMonth(tmp)
  315. {
  316. var tmp_fr_date = model.getValue("/root/send/fromdd").toDate();
  317. var tmp_to_date = model.getValue("/root/send/todd").toDate();
  318. if (tmp == "prev")
  319. {
  320. var fr_date = tmp_fr_date.getAddDate(-30, "D");
  321. var to_date = tmp_to_date.getAddDate(-30, "D");
  322. }
  323. else
  324. {
  325. var fr_date = tmp_fr_date.getAddDate(30, "D");
  326. var to_date = tmp_to_date.getAddDate(30, "D");
  327. }
  328. model.makeValue("/root/send/fromdd", fr_date.getDateFormat());
  329. model.makeValue("/root/send/todd", to_date.getDateFormat());
  330. if(submit("TRMMR03901"))
  331. {
  332. grd_drschlist.rowheight(1) = 0;
  333. fSetGrdColor();
  334. }
  335. }
  336. /**
  337. * @desc : 의사 선택(휴진일정 셋팅)
  338. * @id :
  339. * @event : ondblclick
  340. * @return : void
  341. * @authur : 박종훈
  342. */
  343. function fClickDrNm()
  344. {
  345. var col = grd_drschlist.col;
  346. var row = grd_drschlist.row;
  347. var day_rowno = 2;
  348. if (row > 4)
  349. {
  350. var drid = grd_drschlist.valueMatrix(row, grd_drschlist.colref("orddrid"));
  351. model.removeNodeset("/root/main/endresn");
  352. copyNodeset("/root/main/endresn", "/root/main/endresnlist[orddrid=" +drid+ "and ordendresnnm != '']", "replace", model, model);
  353. model.refresh();
  354. }
  355. }
  356. /*****************************************************************************
  357. 튜닝
  358. ******************************************************************************/
  359. /**
  360. * @group :
  361. * @ver : 2008.06.13
  362. * @by : snoweye
  363. * @---------------------------------------------------
  364. * @type : function
  365. * @access : private
  366. * @desc : 의뢰의사를 선택한다.
  367. * @param :
  368. * @return :
  369. * @---------------------------------------------------
  370. */
  371. function fClickSchList()
  372. {
  373. var col = grd_drschlist.col;
  374. var row = grd_drschlist.row;
  375. var day_rowno = 2;
  376. var drnm = grd_drschlist.valueMatrix(row, grd_drschlist.colref("orddrnm"));
  377. if (!fGetSuspendDiagInfo()) {
  378. return;
  379. }
  380. if (col > 1 && row > 4)
  381. {
  382. var drid = grd_drschlist.valueMatrix(row, grd_drschlist.colref("orddrid"));
  383. var cnstflag = "1";
  384. //2013/01/23 Start 원무팀의 외래 컨설트 hopedd 사용 할 수 있도록 수정
  385. var orddd = grd_drschlist.valueMatrix(day_rowno, col);
  386. //var orddd = getCurrentDate();
  387. //2012/01/23 End
  388. if (orddd != "")
  389. {
  390. if (orddd < getCurrentDate())
  391. {
  392. messageBox("과거일로 의뢰할 수", "I004");
  393. return;
  394. }
  395. else
  396. {
  397. var deptcd = model.getValue("/root/send/cnstdeptcd");
  398. var deptnm = model.getValue("/root/send/cnstdeptnm");
  399. var formcd = model.getValue("/root/send/formcd");
  400. var reqdeptno = model.getValue("/root/main/cnstformlist/cnstform[" + grd_deptlist.row + "]/reqdeptno");
  401. //선택된 진료의 정보를 부모창에 전달한다.
  402. parent.window.javascript.setParameter("SPMMR03900_formcd", formcd);
  403. parent.window.javascript.setParameter("SPMMR03900_deptcd", deptcd);
  404. parent.window.javascript.setParameter("SPMMR03900_deptnm", deptnm);
  405. parent.window.javascript.setParameter("SPMMR03900_drid", drid);
  406. parent.window.javascript.setParameter("SPMMR03900_drnm", drnm);
  407. parent.window.javascript.setParameter("SPMMR03900_orddd", orddd);
  408. parent.window.javascript.setParameter("SPMMR03900_cnstflag", cnstflag);
  409. parent.window.javascript.setParameter("SPMMR03900_reqdeptno", reqdeptno);
  410. parent.window.javascript.setParameter("SPMMR03900_cnstioflag", model.getValue("/root/init/cnstioflag"));
  411. //parent.window.javascript.fOpenCnstForm(formcd, deptcd, deptnm, drid, drnm, orddd, cnstflag, "", "");
  412. window.close();
  413. }
  414. }
  415. }
  416. }
  417. /**
  418. * 선택한 수신의의 휴진 정보 조회
  419. */
  420. function fGetSuspendDiagInfo() {
  421. model.makeValue("/root/send/reqsuspend/orddeptcd", model.getValue("/root/send/cnstdeptcd"));
  422. model.makeValue("/root/send/reqsuspend/orddrid", grd_drschlist.valueMatrix(grd_drschlist.row, grd_drschlist.colref("orddrid")));
  423. var sDrNm = grd_drschlist.valueMatrix(grd_drschlist.row, grd_drschlist.colref("orddrnm"));
  424. model.removeNodeset("/root/hidden/suspendinfo");
  425. if (submit("TRMMR04905")) {
  426. if (model.getValue("/root/hidden/suspendinfo/spndyn") == "Y") {
  427. if (messageBox("["+sDrNm+"] 선생님의 휴진정보입니다. \n\n"+
  428. model.getValue("/root/hidden/suspendinfo/description")+"\n\n의뢰하시겠습니까?", "Q", "") == 7) {
  429. return;
  430. }
  431. }
  432. }
  433. return true;
  434. }