SPMMO05700.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 마취과스케줄 담당관리 ( SPMMO05700_마취과스케줄 담당관리.xrw - JScript )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. /**
  7. * @desc : 마취과스케줄 담당관리 초기화
  8. * @
  9. * @param :
  10. * @return :
  11. * @author : 오지훈
  12. * @---------------------------------------------------
  13. */
  14. function fInitialize_SPMMO05700(){
  15. model.removeNodeset("/root/main/chrgschedwlist/chrgschedwlist");
  16. reqHardCodeInfo("/root/send/reqdata", "/root/init/hardcd", 18);
  17. var deptcd = model.getValue("/root/init/hardcd/hardcd/hardcd");
  18. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", deptcd);
  19. model.copyNode("/root/main/userlist", "/root/init/userlist");
  20. fReqChrgScheDWList(); //스케줄 담당요일 조회
  21. fReqOpScheRegTimeList(); //스케줄 정규시간 조회
  22. fSetupRegltmInfo(); //수술스케줄 정규시간 설정가능 범위 조회
  23. }
  24. /**
  25. * @desc : 등록버튼 클릭
  26. * @
  27. * @param :
  28. * @return :
  29. * @author : 오지훈
  30. * @---------------------------------------------------
  31. */
  32. function fClkBtnRgst(){
  33. for(var i = 0; i < grd_anstdrlist.selectedRows; i++){
  34. var currow = grd_anstdrlist.selectedRow(i);
  35. var userid = grd_anstdrlist.valueMatrix(currow, grd_anstdrlist.colRef("userid"));
  36. var usernm = grd_anstdrlist.valueMatrix(currow, grd_anstdrlist.colRef("usernm"));
  37. //var orddrid = model.getValue("/root/main/chrgschedwlist/chrgschedwlist[orddrid = '" + userid + "']/orddrid");
  38. //if(orddrid != ""){continue;}
  39. grd_chrgschedwlist.addRow(false, true);
  40. grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("orddrid")) = userid;
  41. grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("hngnm")) = usernm;
  42. grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status")) = "i";
  43. }
  44. grd_chrgschedwlist.refresh();
  45. group1.attribute("visibility") = "hidden";
  46. group1.refresh();
  47. }
  48. /**
  49. * @desc : 닫기버튼 클릭
  50. * @
  51. * @param :
  52. * @return :
  53. * @author : 오지훈
  54. * @---------------------------------------------------
  55. */
  56. function fClkBtnClose(){
  57. group1.attribute("visibility") = "hidden";
  58. group1.refresh();
  59. }
  60. /**
  61. * @desc : 추가버튼 클릭
  62. * @
  63. * @param :
  64. * @return :
  65. * @author : 오지훈
  66. * @---------------------------------------------------
  67. */
  68. function fClkBtnAdd(){
  69. group1.attribute("visibility") = "visible";
  70. group1.refresh();
  71. }
  72. /**
  73. * @desc : 스케줄 담당요일 저장
  74. * @
  75. * @param :
  76. * @return :
  77. * @author : 오지훈
  78. * @---------------------------------------------------
  79. */
  80. function fSaveChrgScheDWList(){
  81. model.removeNodeset("/root/send/savedata");
  82. var chrgschedwlist = getNodeListCSV(instance1.selectNodes("/root/main/chrgschedwlist/chrgschedwlist"));
  83. model.makeValue("/root/send/savedata", chrgschedwlist);
  84. if(submit("TXMMO05702")){
  85. }
  86. }
  87. /**
  88. * @desc : 스케줄 담당요일 조회
  89. * @
  90. * @param :
  91. * @return :
  92. * @author : 오지훈
  93. * @---------------------------------------------------
  94. */
  95. function fReqChrgScheDWList(){
  96. submit("TRMMO05703");
  97. }
  98. /**
  99. * @desc : 담당스케줄 요일리스트 변경
  100. * @
  101. * @param :
  102. * @return :
  103. * @author : 오지훈
  104. * @---------------------------------------------------
  105. */
  106. function fChngChrgScheDWList(){
  107. var status = grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status"));
  108. if(status != "i"){ //신규
  109. grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status")) = "u";
  110. }
  111. grd_chrgschedwlist.refresh();
  112. }
  113. /**
  114. * @desc : 담당스케줄 시간 조회
  115. * @
  116. * @param :
  117. * @return :
  118. * @author : 오지훈
  119. * @---------------------------------------------------
  120. */
  121. function fReqOpScheRegTimeList(){
  122. model.makeValue("/root/send/reqdata/nextdate", "");
  123. if(submit("TRMMO05705")){
  124. var rsltxml = instance1.selectSingleNode("/root/main/scheregtimelist/scheregtimelist");
  125. if(rsltxml == null){
  126. model.makeNode("/root/main/scheregtimelist/scheregtimelist");
  127. model.makeValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , "08");
  128. model.makeValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , "17");
  129. model.makeValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", "17");
  130. model.makeValue("/root/main/scheregtimelist/scheregtimelist/irregendtm" , "08");
  131. }
  132. //현재 설정된 값을 변수와 함께 관리, 값 입력 시 범위에 벗어나 값을 롤백시킬 때 필요 (2009.10.23 JJE)
  133. startfromtmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
  134. starttotmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  135. endfromtmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm");
  136. endtotmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregendtm");
  137. }
  138. model.refresh();
  139. }
  140. /**
  141. * @desc : 시간 증가, 감사
  142. * @
  143. * @param : srctime - 원래시간
  144. * : chngval - 변경값(+1, -1)
  145. *
  146. * @return : destime - 변경시간
  147. * @author : 오지훈
  148. * @---------------------------------------------------
  149. */
  150. function fIncDecTime(srctime, chngval){
  151. if(srctime.substr(0,1) == "0"){
  152. srctime = srctime.substr(1,1);
  153. }
  154. destime = eval(srctime) + chngval;
  155. if(destime == -1){
  156. return "00";
  157. }else if(destime == 25){
  158. return "24";
  159. }
  160. if(destime < 10){destime = "0".concat(destime);}
  161. return destime;
  162. }
  163. /**
  164. * @desc : 정규시간 저장
  165. * @
  166. * @param :
  167. * @return :
  168. * @author : 오지훈
  169. * @---------------------------------------------------
  170. */
  171. function fSaveOpScheRegTimeList(){
  172. model.removeNodeset("/root/send/savedata");
  173. var regfromtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
  174. var regendtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  175. var irregfromtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm");
  176. var irregendtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregendtm");
  177. model.makeValue("/root/send/savedata/regfromtm" , regfromtm.concat("0000"));
  178. model.makeValue("/root/send/savedata/regendtm" , regendtm.concat("0000"));
  179. model.makeValue("/root/send/savedata/irregfromtm", irregfromtm.concat("0000"));
  180. model.makeValue("/root/send/savedata/irregendtm" , irregendtm.concat("0000"));
  181. submit("TXMMO05703");
  182. }
  183. /**
  184. * @desc : 수술스케줄 관리자 조회
  185. * @
  186. * @param :
  187. * @return :
  188. * @author : 박유미
  189. * @---------------------------------------------------
  190. */
  191. function fGetOpScheSrchList() {
  192. model.removeNodeset("/root/send/reqdata");
  193. model.makeValue("/root/send/reqdata/cond", model.getValue("/root/main/cond/srchcond"));
  194. model.makeValue("/root/send/reqdata/data", model.getValue("/root/main/cond/srchdata"));
  195. submit("TRMMO05706");
  196. }
  197. /**
  198. * @desc : 수술스케줄 정규시간 설정가능 범위 정보 조회/셋팅 (병원별 정규시간 범위 제한을 달리 해달라고 요청함)
  199. * @
  200. * @param :
  201. * @return :
  202. * @author : 전지은 (2009.12.23)
  203. * @---------------------------------------------------
  204. */
  205. function fSetupRegltmInfo(){
  206. var rsltSrc = "/root/init/regltminfo/hardcd";
  207. startfromtm = "";
  208. starttotm = "";
  209. endfromtm = "";
  210. endtotm = "";
  211. mmbfGetHardCodeInfoNm("/root/send/reqdata", "/root/init/regltminfo" , 137); //20091023 JJE 추가
  212. if( getNodesetCount(rsltSrc) > 0 ){
  213. var startTmNode = instance1.selectSingleNode(rsltSrc + "[" + 1 + "]/hardcd"); //시작시간 From~To
  214. var endTmNode = instance1.selectSingleNode(rsltSrc + "[" + 2 + "]/hardcd"); //종료시간 From~To
  215. if( startTmNode != null ) startfromtm = startTmNode.text.split("|")[0];
  216. if( startTmNode != null ) starttotm = startTmNode.text.split("|")[1];
  217. if( endTmNode != null ) endfromtm = endTmNode.text.split("|")[0];
  218. if( endTmNode != null ) endtotm = endTmNode.text.split("|")[1];
  219. model.removeNodeset(rsltSrc);
  220. }
  221. if( startfromtm == "" ) startfromtm = "08";
  222. if( starttotm == "" ) starttotm = "-";
  223. if( endfromtm == "" ) endfromtm = "17";
  224. if( endtotm == "" ) endtotm = "21";
  225. model.makeValue("/root/init/regltminfo/startfromtm", startfromtm);
  226. model.makeValue("/root/init/regltminfo/starttotm" , starttotm);
  227. model.makeValue("/root/init/regltminfo/endfromtm" , endfromtm);
  228. model.makeValue("/root/init/regltminfo/endtotm" , endtotm);
  229. }
  230. /**
  231. * @desc : fromTm 변경
  232. * @
  233. * @param :
  234. * @return :
  235. * @author : 전지은 (2009.12.23)
  236. * @---------------------------------------------------
  237. */
  238. function fSetDownFromTm(){
  239. //정규시작시간 감소
  240. var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
  241. if(srctime <= startfromtm){ //제한 기준 변경 8 -> startfromtm (2009.10.23 by JJE)
  242. return;
  243. }
  244. var destime = fIncDecTime(srctime, -1);
  245. model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm", destime);
  246. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", destime);
  247. startfromtmVal = destime;
  248. endtotmVal = destime;
  249. model.refresh();
  250. }
  251. /**
  252. * @desc : fromTm 변경
  253. * @
  254. * @param :
  255. * @return :
  256. * @author : 전지은 (2009.12.23)
  257. * @---------------------------------------------------
  258. */
  259. function fSetUpFromTm(){
  260. //정규시작시간 증가
  261. var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
  262. var tmptime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  263. if(srctime >= tmptime - 1){ //시작시간이 종료시간보다 크거나 같은 경우
  264. return;
  265. }
  266. var destime = fIncDecTime(srctime, 1);
  267. model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm", destime);
  268. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", destime);
  269. startfromtmVal = destime;
  270. endtotmVal = destime;
  271. model.refresh();
  272. }
  273. /**
  274. * @desc : toTm 변경
  275. * @
  276. * @param :
  277. * @return :
  278. * @author : 전지은 (2009.12.23)
  279. * @---------------------------------------------------
  280. */
  281. function fSetDownToTm(){
  282. //정규종료시간 감소
  283. var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  284. if(srctime <= endfromtm){ //제한 기준 변경 17 -> endfromtm (2009.10.23 by JJE)
  285. return;
  286. }
  287. var destime = fIncDecTime(srctime, -1);
  288. model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm", destime);
  289. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", destime);
  290. starttotmVal = destime;
  291. endfromtmVal = destime;
  292. model.refresh();
  293. }
  294. /**
  295. * @desc : toTm 변경
  296. * @
  297. * @param :
  298. * @return :
  299. * @author : 전지은 (2009.12.23)
  300. * @---------------------------------------------------
  301. */
  302. function fSetUpToTm(){
  303. //정규종료시간 증가
  304. var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  305. if(srctime >= endtotm){ //제한 기준 변경 21 -> endtotm (2009.10.23 by JJE)
  306. return;
  307. }
  308. var destime = fIncDecTime(srctime, 1);
  309. model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm", destime);
  310. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", destime);
  311. starttotmVal = destime;
  312. endfromtmVal = destime;
  313. model.refresh();
  314. }
  315. /**
  316. * @desc : inputbox에 값 직접 수정 시 체크
  317. * @
  318. * @param :
  319. * @return :
  320. * @author : 전지은 (2009.12.23)
  321. * @---------------------------------------------------
  322. */
  323. function fCheckVal( flag, val ){
  324. val = val.getLeftPad(2, "0");
  325. if( flag == "from" ){
  326. var tmptime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
  327. if( val < startfromtm || val > tmptime - 1 ){
  328. model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , startfromtmVal);
  329. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", endtotmVal);
  330. }else{
  331. model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , val);
  332. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", val);
  333. startfromtmVal = val;
  334. endtotmVal = val;
  335. }
  336. }else if( flag == "to" ){
  337. if( val < endfromtm || val > endtotm ){
  338. model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , starttotmVal);
  339. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", endfromtmVal);
  340. }else{
  341. model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , val);
  342. model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", val);
  343. starttotmVal = val;
  344. endfromtmVal = val;
  345. }
  346. }
  347. model.refresh();
  348. }