MRF03100.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 서식SET관리 ( SMMRF03100_서식SET.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. * 수정이력:
  7. 2008-11-26 fFormInit() 과 코드 불러오는 함수 파라미터 변경.
  8. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  9. */
  10. var refresh_u = 0;
  11. var refresh_d = 0;
  12. var refresh_a = 0;
  13. var sSETLIST = "/root/main/indxlist/item";
  14. var sSETLIST_HIDDEN = "/root/hidden/indxlist/item";
  15. var sMOUSE_CLK_STATUS; //마우스 클릭 좌우버튼 구분
  16. //var obj; //트리뷰 구분
  17. /**
  18. * @desc : 폼초기화
  19. * @
  20. * @param : flag (0:서식목록, 1:서식셋관리)
  21. * @return :
  22. * @---------------------------------------------------
  23. */
  24. function fFormInit(flag){
  25. // 폴더명칭 popup
  26. grup_saveas.visible = "false";
  27. model.removeNodeset("/root/main/formlist/row");
  28. // 부서코드 리스트 불러오기...
  29. // 과 코드 불러오는 함수 파라미터 변경.
  30. //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "D");
  31. //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "O");
  32. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "A");
  33. addComboInstance("/root/init/deptlist/orddept", "deptcd^depthngnm", "-^전체", "dept"); //진료과 전체항목 추가
  34. /*model.setValue("/root/cond/orddeptcd", "-");
  35. reqGetDeptList("/root/send/reqdeptlist", "/root/init/deptlist", "", "012");
  36. model.makeValue("/root/init/deptlist/orddept/deptcd","ALL");
  37. model.makeValue("/root/init/deptlist/orddept/deptnm","전체");
  38. */
  39. model.refresh();
  40. model.setValue("/root/send/reqformlist/formdeptcd",getUserInfo("dutplcecd"));
  41. // admin 인가? 보여줄것만 보여준다..
  42. // 관리자 : 개인, 과, 전체 등록/수정/삭제 가능
  43. // 사용자 : 개인만 가능
  44. var result = fUserAdmin();
  45. // var result = true;
  46. if (result == true)
  47. {
  48. grup_srch1.visible = "true";
  49. grup_srch2.visible = "true";
  50. model.setValue("/root/send/cond/admin", "true");
  51. } else {
  52. grup_srch1.visible = "false";
  53. grup_srch2.visible = "false";
  54. model.setValue("/root/send/cond/admin", "false");
  55. // 사용자정보 셋.
  56. model.setValue("/root/send/cond/userid", getUserId());
  57. model.setValue("/root/send/cond/usernm", getUserInfo("usernm"));
  58. model.setValue("/root/send/cond/deptcd", getUserInfo("dutplcecd"));
  59. model.setValue("/root/send/cond/mydeptcd", getUserInfo("dutplcecd"));
  60. model.setValue("/root/send/cond/jobkind", getUserInfo("jobkindcd"));
  61. }
  62. model.toggle("case_dept");
  63. btn_dept.dispatch("DOMActivate");
  64. // 디폴트 트리뷰
  65. if (flag == 0 ) {
  66. // 서식목록일때만 과코드 부여해준다..
  67. model.setValue("/root/send/reqdata/deptcd", getUserInfo("dutplcecd"));
  68. // Switch (개인,과,전체,서식목록)
  69. sw_setflag.case_user.selected = "false";
  70. sw_setflag.case_dept.selected = "true";
  71. sw_setflag.case_all.selected = "false";
  72. sw_setflag.case_list.selected = "false";
  73. sw_setflag.refresh();
  74. // 과 목록 보여주자~
  75. fSetIndxListSelect("D");
  76. } else {
  77. // Switch (개인,과,전체,서식목록)
  78. sw_setflag.case_user.selected = "false";
  79. sw_setflag.case_dept.selected = "true";
  80. sw_setflag.case_all.selected = "false";
  81. sw_setflag.refresh();
  82. // 과 목록 보여주자~
  83. fSetIndxListSelect("D");
  84. }
  85. }
  86. /**
  87. * @desc : 버튼 클릭 (개인/과/전체)
  88. * @
  89. * @param :
  90. * @return :
  91. * @---------------------------------------------------
  92. */
  93. function fSetIndxListSelect(setflag){
  94. model.setValue("/root/send/cond/setflag", setflag);
  95. model.refresh();
  96. grup_saveas.visible = "false";
  97. // 개인
  98. if (setflag == "U") {
  99. btn_user.selected = "true";
  100. if (refresh_u == 0) {
  101. submit("TRMRF03102");
  102. model.removeNodeset("/root/main/indxlist_u/item");
  103. copyNode(model, model, "/root/main/indxlist_u", "/root/main/indxlist");
  104. trv_indxlist_u.rebuild();
  105. } else {
  106. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_u/item");
  107. model.refresh();
  108. }
  109. refresh_u = 1;
  110. // 첫번째 만 오픈하자!!
  111. trv_indxlist_u.expand(0, true);
  112. // 과
  113. } else if (setflag == "D") {
  114. btn_dept.selected = "true";
  115. if (refresh_d == 0) {
  116. submit("TRMRF03102");
  117. model.removeNodeset("/root/main/indxlist_d/item");
  118. copyNode(model, model, "/root/main/indxlist_d", "/root/main/indxlist");
  119. trv_indxlist_d.rebuild();
  120. } else {
  121. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_d/item");
  122. model.refresh();
  123. }
  124. refresh_d = 1;
  125. // 첫번째 만 오픈하자!!
  126. trv_indxlist_d.expand(0, true);
  127. // 공통
  128. } else if (setflag == "A") {
  129. btn_all.selected = "true";
  130. if (refresh_a == 0) {
  131. submit("TRMRF03102");
  132. model.removeNodeset("/root/main/indxlist_a/item");
  133. copyNode(model, model, "/root/main/indxlist_a", "/root/main/indxlist");
  134. model.refresh();
  135. } else {
  136. copyNodeset("/root/main/indxlist/item", "/root/main/indxlist_a/item");
  137. model.refresh();
  138. }
  139. refresh_a = 1;
  140. // 첫번째 만 오픈하자!!
  141. trv_indxlist_a.expand(0, true);
  142. }
  143. }
  144. /**
  145. * @desc : 과 선택
  146. * @
  147. * @param :
  148. * @return :
  149. * @---------------------------------------------------
  150. */
  151. function fDeptCDSelect(){
  152. model.setValue("/root/send/cond/userid","");
  153. submit("TRMRF03102");
  154. model.removeNodeset("/root/main/indxlist_d/item");
  155. //model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  156. copyNode(model, model, "/root/main/indxlist_d", "/root/main/indxlist");
  157. model.refresh();
  158. }
  159. /**
  160. * @desc : 사용자정보
  161. * @
  162. * @param :
  163. * @return :
  164. * @---------------------------------------------------
  165. */
  166. function fGetUserInfo(userid,usernm,deptcd , instcd)
  167. {
  168. model.setValue("/root/send/cond/userid", userid);
  169. model.setValue("/root/send/cond/usernm", usernm);
  170. model.setValue("/root/send/cond/deptcd", deptcd);
  171. ipt_saveas_userid.text = usernm;
  172. ipt_saveas_userid.refresh();
  173. submit("TRMRF03102");
  174. model.makeValue("/root/temp/instcd",instcd); //조회한 사용자 기관코드
  175. model.removeNodeset("/root/main/indxlist_u/item");
  176. //model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  177. copyNode(model, model, "/root/main/indxlist_u", "/root/main/indxlist");
  178. model.refresh();
  179. }
  180. /**
  181. * @desc : 트리뷰 셋
  182. * @
  183. * @param :
  184. * @return :
  185. * @---------------------------------------------------
  186. */
  187. function fSetTreeView(){
  188. var setflag = model.getValue("/root/send/cond/setflag");
  189. var rtn = "";
  190. if (setflag == "U") {
  191. rtn = "trv_indxlist_u" + "|" + "/root/main/indxlist_u/item";
  192. }
  193. if (setflag == "D") {
  194. rtn = "trv_indxlist_d" + "|" + "/root/main/indxlist_d/item";
  195. }
  196. if (setflag == "A") {
  197. rtn = "trv_indxlist_a" + "|" + "/root/main/indxlist_a/item";
  198. }
  199. return rtn;
  200. }
  201. /**
  202. * @desc : 마우스 오른쪽 버튼 팝업창
  203. * @
  204. * @param :
  205. * @return :
  206. * @---------------------------------------------------
  207. * 1. 마우스 우클릭인가?
  208. * 2. 관리자인가? 사용자인가?
  209. * 3. 구분이 개인인가? 과인가? 전체인가?
  210. * 4. 폴더인가? 파일인가? 루트인가?
  211. */
  212. function fMouseRghtBtnPopup()
  213. {
  214. var rtn = fSetTreeView();
  215. rtn = rtn.split("|");
  216. var obj = document.controls(rtn[0]);
  217. var path = rtn[1];
  218. if(event.button == 3)
  219. {
  220. if(obj.isCell(event.target) && obj.selectedIndex > -1)
  221. {
  222. var item = obj.item(obj.selectedIndex);
  223. var rowpos = item.index + 1;
  224. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  225. var item_length = obj.length;
  226. // 루트인가? (보여주는 부분으로..)
  227. if (depth == 1 && item_length > 1) {
  228. window.setPopupMenu(false); return;
  229. }
  230. // 관리자인가? 구분이 개인인가?
  231. var admin = model.getValue("/root/send/cond/admin");
  232. var setflag = model.getValue("/root/send/cond/setflag");
  233. if(setflag =="U"){ // 개인 indx
  234. sSETLIST = "/root/main/indxlist_u/item"
  235. }else if(setflag =="D"){ // 과 indx
  236. sSETLIST = "/root/main/indxlist_d/item"
  237. }
  238. if (admin == "true" || setflag == "U")
  239. {
  240. if(setflag == "A"){ //전체는 입력안됨
  241. return;
  242. }
  243. if("공통서식" == model.getValue("/root/main/indxlist_d/item[" + rowpos + "]/indxnm"))
  244. {
  245. return;
  246. }
  247. if (depth == 2)
  248. {
  249. window.setPopupMenu(true, "/root/temp/menu2/menu", "label", "func", false); return;
  250. }
  251. else
  252. {
  253. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  254. if (linkflag == "N")
  255. {
  256. // 폴더인경우, 새폴더/폴더수정/폴더삭제..
  257. window.setPopupMenu(true, "/root/temp/menu/menu", "label", "func", false); return;
  258. }
  259. else if (linkflag == "Y")
  260. {
  261. // 파일인경우, 파일삭제만..
  262. window.setPopupMenu(true, "/root/temp/menu1/menu", "label", "func", false); return;
  263. }
  264. else
  265. {
  266. window.setPopupMenu(false);
  267. }
  268. }
  269. }
  270. else
  271. {
  272. window.setPopupMenu(false);
  273. }
  274. }
  275. else
  276. {
  277. window.setPopupMenu(false);
  278. }
  279. }
  280. else
  281. {
  282. window.setPopupMenu(false);
  283. }
  284. }
  285. /**
  286. * @desc : 새폴더 추가
  287. * @
  288. * @param :
  289. * @return :
  290. * @---------------------------------------------------
  291. */
  292. function fAddDiagSet(){
  293. var rtn = fSetTreeView();
  294. rtn = rtn.split("|");
  295. var obj = document.controls(rtn[0]);
  296. var path = rtn[1];
  297. var item = obj.item(obj.selectedIndex);
  298. var rowPos = item.index + 1;
  299. fSetDiagInfo(rowPos, "i");
  300. model.setValue(sSETLIST_HIDDEN + "/status", "i");
  301. model.setValue("/root/main/iptbox/indxnm", "");
  302. model.refresh();
  303. fShowWndIptBox();
  304. }
  305. /**
  306. * @desc : 폴더 삭제
  307. * @
  308. * @param :
  309. * @return :
  310. * @---------------------------------------------------
  311. */
  312. function fDelDiagSet()
  313. {
  314. // 확인 버튼
  315. var ret = messageBox("정말","Q001");
  316. if(ret != "6")
  317. {
  318. return;
  319. }
  320. var rtn = fSetTreeView();
  321. rtn = rtn.split("|");
  322. var obj = document.controls(rtn[0]);
  323. var path = rtn[1];
  324. var item = obj.item(obj.selectedIndex);
  325. var rowPos = item.index + 1;
  326. if(fSetDiagInfo(rowPos, "d")!= -1){
  327. fSaveDiagSet("Y");
  328. }
  329. }
  330. /**
  331. * @desc : 폴더 수정
  332. * @
  333. * @param :
  334. * @return :
  335. * @---------------------------------------------------
  336. */
  337. function fUpdtDiagSet(){
  338. var rtn = fSetTreeView();
  339. rtn = rtn.split("|");
  340. var obj = document.controls(rtn[0]);
  341. var path = rtn[1];
  342. var item = obj.item(obj.selectedIndex);
  343. var rowPos = item.index + 1;
  344. var indxnm = item.label;
  345. model.setValue("/root/main/iptbox/indxnm", indxnm);
  346. model.refresh();
  347. if(fSetDiagInfo(rowPos, "u")!=-1){
  348. fShowWndIptBox();
  349. }
  350. }
  351. /**
  352. * @desc : 서식 SET 저장
  353. * @
  354. * @param :
  355. * @return :
  356. * @---------------------------------------------------
  357. */
  358. function fSaveDiagSet(linkflag)
  359. {
  360. grup_saveas.visible = "false";
  361. var indxnm = model.getValue("/root/main/iptbox/indxnm");
  362. if (linkflag == "N" && indxnm == "") {
  363. messageBox("폴더명칭을 ", "C001");
  364. return;
  365. }
  366. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  367. model.setValue(sSETLIST_HIDDEN + "/linkflag" , linkflag);
  368. var admin = model.getValue("/root/send/cond/admin");
  369. model.setvalue(sSETLIST_HIDDEN + "/admin" , admin);
  370. var setflag = model.getValue("/root/send/cond/setflag");
  371. model.setvalue(sSETLIST_HIDDEN + "/setflag" , setflag);
  372. // 구분에 따라 [과, 사용자] 정보를 넘겨야 하는데...
  373. var userid = model.getValue("/root/send/cond/userid");
  374. var deptcd = model.getValue("/root/send/cond/deptcd");
  375. if (setflag == "U")
  376. {
  377. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  378. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  379. var instcd = model.getValue("/root/temp/instcd");
  380. if(instcd == ""){
  381. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  382. }else {
  383. model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd);
  384. }
  385. } else if (setflag == "D")
  386. {
  387. model.setValue(sSETLIST_HIDDEN + "/userid" , "");
  388. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  389. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  390. }
  391. // 로그인 과 정보 넘기기...
  392. model.makeValue(sSETLIST_HIDDEN + "/mydeptcd", getUserInfo("dutplcecd"));
  393. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  394. submit("TXMRF03101");
  395. if (setflag == "U") {
  396. model.removeNodeset("/root/main/indxlist_u/item");
  397. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  398. refresh_u = 1; refresh_a = 0;
  399. trv_indxlist_u.rebuild();
  400. } else if (setflag == "D") {
  401. model.removeNodeset("/root/main/indxlist_d/item");
  402. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  403. refresh_d = 1; refresh_a = 0;
  404. trv_indxlist_d.rebuild();
  405. } else if (setflag == "A") {
  406. model.removeNodeset("/root/main/indxlist_a/item");
  407. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  408. refresh_u = 0; refresh_d = 0; refresh_a = 1;
  409. }
  410. model.refresh();
  411. }
  412. /**
  413. * @desc : 서식관리 폴더명을 입력할 InputBox를 보여줌.
  414. * @
  415. * @param :
  416. * @return :
  417. * @---------------------------------------------------
  418. */
  419. function fShowWndIptBox(){
  420. grup_saveas.attribute("top") = event.clientY;
  421. grup_saveas.visible = "true";
  422. model.setFocus("ipt_saveas_indxnm1");
  423. }
  424. /**
  425. * @desc : 서식 SET 조회
  426. * @
  427. * @param :
  428. * @return :
  429. * @---------------------------------------------------
  430. */
  431. function fReqDetlSet(){
  432. var rtn = fSetTreeView();
  433. rtn = rtn.split("|");
  434. var obj = document.controls(rtn[0]);
  435. var path = rtn[1];
  436. if (obj.selectedIndex == 0) {
  437. return;
  438. }
  439. var item = obj.item(obj.selectedIndex);
  440. if (item != null) {
  441. var rowpos = item.index + 1;
  442. fSetDiagInfo(rowpos);
  443. var depth = model.getValue(sSETLIST_HIDDEN + "/depth");
  444. if(depth == 2){
  445. return;
  446. }
  447. }
  448. }
  449. /**
  450. * @desc : Mouse Drag Drop
  451. * @
  452. * @param :
  453. * @return : void
  454. * @authur :
  455. * @---------------------------------------------------
  456. */
  457. function fOndrop(){
  458. var rtn = fSetTreeView();
  459. rtn = rtn.split("|");
  460. var obj = document.controls(rtn[0]);
  461. var path = rtn[1];
  462. var rowpos = obj.mouseRow + 1;
  463. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  464. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  465. var x = event.clientX;
  466. var maxposX = 24 + 16 * (depth - 1) + ( 13 * indxnm.length);
  467. var minposX = 24 + 16 * (depth - 1);
  468. if(maxposX > x){
  469. fDiagSetDrop();
  470. }else{
  471. return;
  472. }
  473. }
  474. /**
  475. * @desc : Mouse Drag Over
  476. * @
  477. * @param :
  478. * @return : void
  479. * @authur :
  480. * @---------------------------------------------------
  481. */
  482. function fMouseOver(){
  483. var rtn = fSetTreeView();
  484. rtn = rtn.split("|");
  485. var obj = document.controls(rtn[0]);
  486. var path = rtn[1];
  487. var rowpos = obj.mouseRow + 1;
  488. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  489. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  490. var x = event.clientX;
  491. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  492. var minposX = 24 + 16 * (depth - 1);
  493. if(maxposX > x){
  494. for ( var i = 0; i < obj.length; i++ ) {
  495. obj.item(i).attribute("background-color") = "#ffffff";
  496. obj.item(i).attribute("text-decoration") = "";
  497. }
  498. obj.item(obj.mouseRow).attribute("background-color") = "#ece1ec";
  499. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  500. }
  501. }
  502. /**
  503. * @desc : TreeView에 Drag상태로 Mouse over된 경우 item의 background color를 clear함
  504. * @
  505. * @param :
  506. * @return : void
  507. * @authur :
  508. * @---------------------------------------------------
  509. */
  510. function fOnDragMouseOver(){
  511. var rtn = fSetTreeView();
  512. rtn = rtn.split("|");
  513. var obj = document.controls(rtn[0]);
  514. var path = rtn[1];
  515. var treeObj = document.controls.item(event.currentTarget);
  516. var rowpos = obj.mouseRow + 1;
  517. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  518. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  519. var x = event.clientX;
  520. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  521. var minposX = 24 + 16 * (depth - 1);
  522. if(maxposX > x){
  523. if( obj.selectedIndex != treeObj.mouseRow ) {
  524. for ( var i = 0; i < treeObj.length; i++ ) {
  525. treeObj.item(i).attribute("background-color") = "#ffffff";
  526. treeObj.item(i).attribute("text-decoration") = "";
  527. }
  528. treeObj.item(treeObj.mouseRow).attribute("background-color") = "#ece1ec";
  529. treeObj.item(treeObj.mouseRow).attribute("text-decoration") = "";
  530. }
  531. }
  532. }
  533. /**
  534. * @desc : 서식 SET Drag
  535. * @
  536. * @param :
  537. * @return :
  538. * @---------------------------------------------------
  539. */
  540. function fDiagSetDrag(){
  541. var rtn = fSetTreeView();
  542. rtn = rtn.split("|");
  543. var obj = document.controls(rtn[0]);
  544. var path = rtn[1];
  545. if (obj.selectedIndex == 0) {
  546. return;
  547. }
  548. var item = obj.item(obj.selectedIndex);
  549. if (item != null) {
  550. var rowpos = item.index + 1;
  551. fSetDiagInfo(rowpos, "u");
  552. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  553. model.setValue("/root/main/iptbox/indxnm", indxnm);
  554. model.refresh();
  555. }
  556. }
  557. /**
  558. * @desc : 서식 SET Drop
  559. * @
  560. * @param :
  561. * @return :
  562. * @---------------------------------------------------
  563. */
  564. function fDiagSetDrop(){
  565. var rtn = fSetTreeView();
  566. rtn = rtn.split("|");
  567. var obj = document.controls(rtn[0]);
  568. var path = rtn[1];
  569. fClrTreeViweSelect();
  570. var admin = model.getValue("/root/send/cond/admin");
  571. var setflag = model.getValue("/root/send/cond/setflag");
  572. // 관리자인가? 구분이 개인인가?
  573. if (admin == "true" || setflag == "U") {
  574. var treeObj = document.controls.item(event.currentTarget);
  575. var rowpos = obj.mouseRow + 1;
  576. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  577. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  578. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  579. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  580. var cmpdepth = model.getValue(sSETLIST_HIDDEN + "/depth");
  581. var cmpitemindxseq = model.getValue(sSETLIST_HIDDEN + "/itemindxseq");
  582. var cmpsupitemindxseq = model.getValue(sSETLIST_HIDDEN + "/supitemindxseq");
  583. var cmplinkflag = model.getValue(sSETLIST_HIDDEN + "/linkflag");
  584. // 이동하는 폴더가 파일 아래로 이동하는것 방지함.
  585. if(linkflag == "Y"){
  586. //messageBox("폴더가 아닌 위치로 이동", "E001");
  587. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  588. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  589. return;
  590. }
  591. if(itemindxseq == cmpitemindxseq){
  592. // messageBox("동일한 위치로 이동", "E001");
  593. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  594. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  595. return;
  596. }else if(itemindxseq == cmpsupitemindxseq){
  597. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  598. // if (deptcd != cmpdeptcd || userid != cmpuserid) {
  599. // messageBox("지정된 위치로 이동", "E001");
  600. // obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  601. // obj.item(obj.mouseRow).attribute("text-decoration") = "";
  602. // return;
  603. // }
  604. }
  605. //이동하는 SET폴더의 depth가 도착하는 곳보다 낮은 레벨일 경우,
  606. //자신의 child node 아래로 이동하는 것을 방지함.
  607. if(cmpdepth < depth){
  608. var rootdepth;
  609. var rootitemindxseq;
  610. while(cmpdepth != rootdepth){
  611. rootdepth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  612. rootitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  613. rowpos--;
  614. }
  615. if(rootitemindxseq == cmpitemindxseq){
  616. //messageBox("지정된 위치로 이동", "E001");
  617. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  618. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  619. return;
  620. }
  621. }
  622. // 이동 폴더의 (과, 사용자) 정보, 이동 대상의 (과, 사용자) 정보
  623. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  624. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  625. var cmpdeptcd = model.getValue(sSETLIST_HIDDEN + "/deptcd");
  626. var cmpuserid = model.getValue(sSETLIST_HIDDEN + "/userid");
  627. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  628. if (deptcd != cmpdeptcd || userid != cmpuserid) {
  629. //messageBox("지정된 위치로 이동", "E001");
  630. obj.item(obj.mouseRow).attribute("background-color") = "#ffffff";
  631. obj.item(obj.mouseRow).attribute("text-decoration") = "";
  632. return;
  633. }
  634. // 이동 폴더의 (과, 사용자) 정보를 셋함...
  635. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  636. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  637. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , itemindxseq);
  638. fSaveDiagSet("Y");
  639. }
  640. }
  641. /**
  642. * @desc : 폴더명 검색할 경우 검색한 위치로 focus를 이동한다.
  643. * @
  644. * @param :
  645. * @return : void
  646. * @authur :
  647. * @---------------------------------------------------
  648. */
  649. function fSrchDiagIndxNM(){
  650. var rtn = fSetTreeView();
  651. rtn = rtn.split("|");
  652. var obj = document.controls(rtn[0]);
  653. var path = rtn[1];
  654. var sFolderNM = model.getValue("/root/main/cond/foldernm");
  655. if (obj.selectedIndex+1 == obj.length) {
  656. obj.selectedIndex = 0;
  657. }
  658. for(var i=obj.selectedIndex+1; i<obj.length;i++){
  659. obj.select(i);
  660. if(sFolderNM == obj.label){
  661. break;
  662. }
  663. }
  664. fReqDetlSet();
  665. }
  666. /**
  667. * @desc : TreeView 선택된 item의 background color를 clear함
  668. * @
  669. * @param :
  670. * @return : void
  671. * @authur :
  672. * @---------------------------------------------------
  673. */
  674. function fClrTreeViweSelect(){
  675. var rtn = fSetTreeView();
  676. rtn = rtn.split("|");
  677. var obj = document.controls(rtn[0]);
  678. var path = rtn[1];
  679. for(var i = 0; i < obj.length; i++){
  680. obj.item(i).attribute("background-color") = "#ffffff";
  681. obj.item(i).attribute("text-decoration") = "";
  682. }
  683. }
  684. /**
  685. * @desc : 서식 SET INFO SETTING
  686. * @
  687. * @param :
  688. * @return :
  689. * @---------------------------------------------------
  690. */
  691. function fSetDiagInfo(rowpos, status){
  692. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  693. if(status == "u" && depth == 1){
  694. //messageBox("선택한 폴더는 수정", "E001");
  695. return -1;
  696. }else if(status == "d" && depth == 1){
  697. //messageBox("선택한 폴더는 삭제", "E001");
  698. return -1;
  699. }
  700. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  701. var path = model.getValue(sSETLIST + "[" + rowpos + "]/path");
  702. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  703. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  704. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  705. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  706. if(status == "d")
  707. {
  708. if(parseInt(depth) >= 3) // depth가 4이상 인것부터 확인(삭제대상은 폴더나 파일)
  709. {
  710. if(linkflag == "N")
  711. depth = 3; // 폴더
  712. else
  713. depth = 4; // 파일
  714. }
  715. }
  716. model.setValue(sSETLIST_HIDDEN + "/status" , status);
  717. model.setValue(sSETLIST_HIDDEN + "/depth" , depth);
  718. model.setValue(sSETLIST_HIDDEN + "/path" , path);
  719. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , itemindxseq);
  720. // supitemindxseq : 새로운 등록이면 상위정보, 수정이면 기존정보
  721. if(status == "i"){
  722. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", itemindxseq);
  723. }else{
  724. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", supitemindxseq);
  725. }
  726. //연결구분이 'Y' 인 경우 : 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  727. if (linkflag == 'N') {
  728. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  729. } else {
  730. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  731. }
  732. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "N");
  733. model.setValue(sSETLIST_HIDDEN + "/linkcd" , "");
  734. // 상위 정보 (사용자, 과)
  735. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  736. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  737. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  738. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  739. // 기본 정보
  740. var instflag = model.getValue("/root/send/cond/setflag"); //개인과구분
  741. if(instflag =="U"){
  742. var instcd = model.getValue("/root/temp/instcd");
  743. if(instcd == ""){
  744. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  745. }else {
  746. model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd);
  747. }
  748. }else{
  749. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  750. }
  751. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  752. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  753. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  754. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  755. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  756. // 사용자 정보(관리자, 일반사용자)
  757. // 구분 정보(개인,과,전체)
  758. var admin = model.getValue("/root/send/cond/admin");
  759. var setflag = model.getValue("/root/send/cond/setflag");
  760. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  761. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  762. model.refresh();
  763. }
  764. /**
  765. * @desc : 서식 SET 에 파일 연결하기
  766. * @
  767. * @param :
  768. * @return :
  769. * @---------------------------------------------------
  770. */
  771. function fAddindx(){
  772. var rtn = fSetTreeView();
  773. rtn = rtn.split("|");
  774. var obj = document.controls(rtn[0]);
  775. var path = rtn[1];
  776. // 선택폴더가 있는가?
  777. if (obj.selectedIndex == -1) {
  778. messageBox("폴더를 ", "C002");
  779. return;
  780. }
  781. // 선택한 아이템 로우~!!
  782. var item = obj.item(obj.selectedIndex);
  783. var rowpos = item.index + 1;
  784. // 루트인가? (이동할 수 없다..)
  785. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  786. if (depth == 1) {
  787. //messageBox("지정된 위치로 이동", "E001");
  788. return;
  789. }
  790. // 폴더인가? 파일이면 파일을 추가하지 않는다.
  791. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  792. if (linkflag == "Y") {
  793. messageBox("폴더를 ", "C002");
  794. return;
  795. }
  796. // 선택한 서식이 있는가?
  797. var checkflag = "false";
  798. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  799. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  800. if(flag == "true"){
  801. checkflag = "true";
  802. break;
  803. }
  804. }
  805. if(checkflag == "false"){
  806. messageBox("서식을 ", "C002");
  807. return;
  808. }
  809. var item = obj.item(obj.selectedIndex);
  810. var rowpos = item.index + 1;
  811. var indxfocus = item.value;
  812. model.setValue("/root/temp/indxfocus", indxfocus);
  813. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  814. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  815. if(flag=="true" ){
  816. model.setValue("/root/main/formlist/row["+ i +"]/check","false");
  817. var formcd = model.getValue("/root/main/formlist/row["+ i +"]/formcd");
  818. model.setValue(sSETLIST_HIDDEN + "/linkcd" , formcd);
  819. var userid = model.getValue("/root/send/cond/userid");
  820. var deptcd = model.getValue("/root/send/cond/deptcd");
  821. //model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  822. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  823. // 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  824. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  825. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , indxfocus);
  826. model.setValue(sSETLIST_HIDDEN + "/depth" , "");
  827. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , "");
  828. model.setValue(sSETLIST_HIDDEN + "/path" , "");
  829. model.setValue(sSETLIST_HIDDEN + "/status" , "i");
  830. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  831. // 기본 정보
  832. var instflag = model.getValue("/root/send/cond/setflag"); //개인과구분
  833. if(instflag =="U"){
  834. var instcd = model.getValue("/root/temp/instcd");
  835. if(instcd == ""){
  836. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  837. }else {
  838. model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd);
  839. }
  840. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  841. }else{
  842. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd"));
  843. }
  844. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  845. var admin = model.getValue("/root/send/cond/admin");
  846. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  847. var setflag = model.getValue("/root/send/cond/setflag");
  848. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  849. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "Y");
  850. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  851. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  852. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  853. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  854. model.makeValue("/root/send/savedata/retflag","ret"); //저장후 조회여부
  855. submit("TXMRF03101");
  856. }
  857. }
  858. submit("TRMRF03102");
  859. if (setflag == "U") {
  860. model.removeNodeset("/root/main/indxlist_u/item");
  861. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  862. } else if (setflag == "D") {
  863. model.removeNodeset("/root/main/indxlist_d/item");
  864. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  865. } else if (setflag == "A") {
  866. model.removeNodeset("/root/main/indxlist_a/item");
  867. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  868. }
  869. model.refresh();
  870. }
  871. /**
  872. * @desc : 폼코드 넘겨주기
  873. * @
  874. * @param :
  875. * @return :
  876. * @---------------------------------------------------
  877. */
  878. function fSendFormInfo()
  879. {
  880. var rtn = fSetTreeView();
  881. rtn = rtn.split("|");
  882. var obj = document.controls(rtn[0]);
  883. var path = rtn[1];
  884. var rowpos = obj.mouseRow + 1;
  885. var formcd = model.getValue(path + "[" + rowpos + "]/formcd");
  886. if (formcd != "") {
  887. parent.window.javascript.fOpenNewForm(formcd);
  888. // window.close();
  889. }
  890. }
  891. /**
  892. * @desc : 폼코드 넘겨주기
  893. * @
  894. * @param :
  895. * @return :
  896. * @---------------------------------------------------
  897. */
  898. function fSendFormListInfo()
  899. {
  900. var rowpos = trv_formlist.mouseRow + 1;
  901. var formcd = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/formcd");
  902. if (formcd != "") {
  903. // 부모창의 속성값에 정해준다..
  904. //parent.window.model.makeValue("/root/hidden/parameters/formcd",formcd);
  905. parent.window.javascript.fOpenNewForm(formcd);
  906. // 파라메타값으로 넘겨준다..
  907. //window.close();
  908. }
  909. }
  910. /**
  911. * @desc : formcd,formnm 넘겨주기
  912. * @
  913. * @param :
  914. * @return :
  915. * @---------------------------------------------------
  916. */
  917. function fSendFormcdFormnm()
  918. {
  919. var rtn = fSetTreeView();
  920. rtn = rtn.split("|");
  921. var obj = document.controls(rtn[0]);
  922. var path = rtn[1];
  923. var rowpos = obj.mouseRow + 1;
  924. var formcd = model.getValue(path + "[" + rowpos + "]/formcd");
  925. if(formcd !=""){ // 폴더 아닌경우만 formcd넘긴다
  926. var formnm = model.getValue(path + "[" + rowpos + "]/formnm");
  927. opener.javascript.setParameter("formcd", formcd);
  928. opener.javascript.setParameter("formnm", formnm);
  929. model.close();
  930. }
  931. }
  932. /**
  933. * @desc : formcd,formnm 넘겨주기
  934. * @
  935. * @param :
  936. * @return :
  937. * @---------------------------------------------------
  938. */
  939. function fSendFormListFormnm()
  940. {
  941. var rowpos = trv_formlist.mouseRow + 1;
  942. var formcd = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/formcd");
  943. if(formcd !=""){ // 폴더 아닌경우만 formcd넘긴다
  944. var formnm = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/displaynm");
  945. opener.javascript.setParameter("formcd", formcd);
  946. opener.javascript.setParameter("formnm", formnm);
  947. model.close();
  948. }
  949. }
  950. /**
  951. * @desc : 공통세션변수에 formlist저장하기
  952. * @
  953. * @param :
  954. * @return :
  955. * @---------------------------------------------------
  956. */
  957. function fFormsetglobal()
  958. {
  959. model.toggle("case_list");
  960. return;
  961. var flag = getGlobalVariable("emr_gsv_formflag");
  962. //공통세션변수에 formlist 저장
  963. if(flag!="Y"){
  964. var reqnode = instance1.selectNodes("/root/main/formlist/item");
  965. var csv = getNodeListCSV(reqnode);
  966. setGlobalVariable("emr_gsv_formflag","Y");
  967. setGlobalVariable("emr_gsv_formflag_userid",getUserId());
  968. setGlobalVariable("emr_gsv_formlist",csv);
  969. }
  970. }
  971. /**
  972. * @desc : 공통세션변수에 indxlist저장하기
  973. * @
  974. * @param :
  975. * @return :
  976. * @---------------------------------------------------
  977. */
  978. function fIndxsetglobal(flag)
  979. {
  980. return;
  981. var reqnode = instance1.selectNodes("/root/main/indxlist_"+ flag +"/item");
  982. var csv = getNodeListCSV(reqnode);
  983. setGlobalVariable("emr_gsv_formflag_"+flag, "Y");
  984. setGlobalVariable("emr_gsv_formlist_"+flag, csv);
  985. }
  986. /**
  987. * @desc : 트리 expand 상태 얻기
  988. * @
  989. * @param :
  990. * @return :
  991. * @---------------------------------------------------
  992. */
  993. function fExpandCheck(trvObj)
  994. {
  995. //alert(trvObj);
  996. var Obj = window.document.controls(trvObj);
  997. //alert(Obj);
  998. // var Obj = trvObj;
  999. var expandstr = 0; //트리 expand 값 저장
  1000. for(var i = 0; i < Obj.length ; i++){
  1001. if(Obj.item(i).expanded == 1)
  1002. {
  1003. expandstr += "."+i;
  1004. }
  1005. }
  1006. //공통세션변수에 저장
  1007. // setGlobalVariable("emr_gsv_"+trvObj ,expandstr);
  1008. //alert("a");
  1009. }
  1010. /**
  1011. * @desc : 트리 expand 상태 설정하기
  1012. * @
  1013. * @param :
  1014. * @return :
  1015. * @---------------------------------------------------
  1016. */
  1017. function fSetTreeExpand(trvObj)
  1018. {
  1019. return;
  1020. var Obj = window.document.controls(trvObj);
  1021. var str = getGlobalVariable("emr_gsv_"+trvObj);
  1022. if(str != ""){
  1023. var strlen = str.split('.');
  1024. var strArray = new Array(strlen.length);
  1025. for(var i=0; i<strlen.length; i++){
  1026. strArray[i] = strlen[i];
  1027. Obj.expand(strArray[i],true);
  1028. }
  1029. }
  1030. }
  1031. /**
  1032. * @desc : formlsit 재조회
  1033. * @
  1034. * @param :
  1035. * @return :
  1036. * @---------------------------------------------------
  1037. */
  1038. function fFormlistRefresh()
  1039. {
  1040. //세션 초기화
  1041. // setGlobalVariable("emr_gsv_formflag","");
  1042. // setGlobalVariable("emr_gsv_formflag_userid","");
  1043. // setGlobalVariable("emr_gsv_formlist","");
  1044. // setGlobalVariable("emr_gsv_formflag_u","");
  1045. // setGlobalVariable("emr_gsv_formflag_d","");
  1046. // setGlobalVariable("emr_gsv_formflag_a","");
  1047. // setGlobalVariable("emr_gsv_formlist_u","");
  1048. // setGlobalVariable("emr_gsv_formlist_d","");
  1049. // setGlobalVariable("emr_gsv_formlist_a","");
  1050. refresh_u = 0;
  1051. refresh_d = 0;
  1052. refresh_a = 0;
  1053. //선택된버튼 재조회
  1054. if(true== btn_list.selected ){
  1055. case_list.dispatch("DOMActivate");
  1056. submit("TRMMR02501");
  1057. return;
  1058. }
  1059. else if(true == btn_all.selected ){
  1060. case_all.dispatch("DOMActivate");
  1061. fSetIndxListSelect("A");
  1062. return;
  1063. }
  1064. else if(true == btn_dept.selected ){
  1065. case_dept.dispatch("DOMActivate");
  1066. fSetIndxListSelect("D");
  1067. return;
  1068. }
  1069. else if(true == btn_user.selected ){
  1070. case_user.dispatch("DOMActivate");
  1071. fSetIndxListSelect("U");
  1072. return;
  1073. }
  1074. }
  1075. /**
  1076. * @desc : formlsit 재조회
  1077. * @
  1078. * @param :
  1079. * @return :
  1080. * @---------------------------------------------------
  1081. function fFormlistRefresh()
  1082. {
  1083. // 서식목록 보여주자~
  1084. // setGlobal에 처음 select해온값 저장후 getGlobal 로 보여준다
  1085. var list = getGlobalVariable("emr_gsv_formlist");
  1086. if(list!=""){
  1087. setCSVToNode("/root/main/formlist/",list,"item");
  1088. model.refresh();
  1089. }else{
  1090. submit("TRMMR02501");
  1091. }
  1092. fFormsetglobal();
  1093. // 첫번째 본인 과는 오픈하자!!
  1094. trv_formlist.expand(0, true);
  1095. fSetTreeExpand("trv_formlist");
  1096. }
  1097. */
  1098. /**
  1099. * @desc : 서식목록조회
  1100. * @
  1101. * @param :
  1102. * @return :
  1103. * @---------------------------------------------------
  1104. */
  1105. function fGetFormlist()
  1106. {
  1107. submit("TRMMR02501");
  1108. // 첫번째 본인 과는 오픈하자!!
  1109. trv_formlist.expand(0, true);
  1110. return;
  1111. // 서식목록 보여주자~
  1112. // setGlobal에 처음 select해온값 저장후 getGlobal 로 보여준다
  1113. var list = getGlobalVariable("emr_gsv_formlist");
  1114. if(list!=""){
  1115. setCSVToNode("/root/main/formlist/",list,"item");
  1116. model.refresh();
  1117. }else{
  1118. submit("TRMMR02501");
  1119. }
  1120. }
  1121. /**
  1122. * @desc : 전체 목록에서 level 1 인 경우만 조회해서 트리에 추가해 주기..
  1123. * @
  1124. * @param :
  1125. * @return :
  1126. * @---------------------------------------------------
  1127. */
  1128. function fOpenSubTree()
  1129. {
  1130. var TREE_OBJ = trv_indxlist_a;
  1131. var item = TREE_OBJ.item(TREE_OBJ.selectedIndex);
  1132. if (item != null) {
  1133. var rowpos = item.index + 1;
  1134. var depth = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/depth");
  1135. var userid = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/userid");
  1136. if (depth == "2" && userid == "") {
  1137. var deptcd = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/deptcd");
  1138. var itemindxseq = model.getValue("/root/main/indxlist_a/item[" + rowpos + "]/itemindxseq");
  1139. var tmpsetflag = model.getValue("/root/send/cond/setflag");
  1140. model.makeValue("/root/send/cond/setflag", "S");
  1141. model.makeValue("/root/send/cond/subdeptcd", deptcd);
  1142. model.makeValue("/root/send/cond/itemindxseq", itemindxseq);
  1143. submit("TRMRF03102", true, "/root/send/cond", "/root/main/indxlist_t/item");
  1144. model.makeValue("/root/send/cond/setflag", tmpsetflag);
  1145. model.refresh();
  1146. fMoveInstance(rowpos);
  1147. model.setValue("/root/main/indxlist_a/item[" + rowpos + "]/userid", "x");
  1148. }
  1149. }
  1150. }
  1151. /**
  1152. * @desc : 전체 목록에서 level 1 인 경우만 조회해서 트리에 추가해 주기..
  1153. * @
  1154. * @param :
  1155. * @return :
  1156. * @---------------------------------------------------
  1157. */
  1158. function fMoveInstance(rowpos)
  1159. {
  1160. ref = "/root/main/indxlist_a/item";
  1161. stRef = "/root/main/indxlist_t/item";
  1162. var subNode = "";
  1163. var instance = document.models(0).instances(0);
  1164. var refNode = instance.selectSingleNode(ref + "[" + rowpos + "]"); //조회내용의 상위 항목
  1165. var nodelistTmp = instance.selectNodes(stRef);
  1166. var nodelength = nodelistTmp.length;
  1167. if(nodelength > 0)
  1168. {
  1169. var depth = "";
  1170. var itemindxseq = "";
  1171. var node = root.main.indxlist_a;
  1172. for(var i = nodelength; i > 0; i--)
  1173. {
  1174. itemindxseq = model.getValue(stRef + "[" + i + "]/itemindxseq");
  1175. depth = model.getValue(stRef + "[" + i + "]/depth");
  1176. subNode = instance.selectSingleNode(stRef + "[" + i + "]");
  1177. node.insertAfter(subNode, refNode); //조회항목을 상위항목의 자식으로 삽입
  1178. }
  1179. // 조회 레벨 오픈하자!!
  1180. model.setValue("/root/main/selected_a", itemindxseq);
  1181. model.refresh();
  1182. }
  1183. }
  1184. /**
  1185. * @desc : 그리드 선택시 check 선택
  1186. * @
  1187. * @param :
  1188. * @return :
  1189. * @---------------------------------------------------
  1190. */
  1191. function fSetCheck() {
  1192. var check = model.getValue("/root/main/formlist/row["+grd_formlist.row+"]/check");
  1193. var gridObj = event.ptarget.parent;
  1194. if( gridObj.col == "0")
  1195. {
  1196. if(check == "false")
  1197. {
  1198. model.setValue("/root/main/formlist/row["+grd_formlist.row+"]/check","false");
  1199. }
  1200. else
  1201. {
  1202. model.setValue("/root/main/formlist/row["+grd_formlist.row+"]/check","true");
  1203. }
  1204. }
  1205. else
  1206. {
  1207. if(check == "true"){
  1208. model.setValue("/root/main/formlist/row["+grd_formlist.row+"]/check","false");
  1209. }
  1210. else
  1211. {
  1212. model.setValue("/root/main/formlist/row["+grd_formlist.row+"]/check","true");
  1213. }
  1214. }
  1215. }
  1216. /**
  1217. * @desc : 마우스 우클릭
  1218. * @
  1219. * @param :
  1220. * @return :
  1221. * @---------------------------------------------------
  1222. */
  1223. function fMouseBtn(trvObj) {
  1224. var selected = trvObj.value;
  1225. if(selected == ""){
  1226. return;
  1227. }
  1228. if(trvObj.isCell(event.target) && trvObj.mouseRow <= trvObj.length)
  1229. {
  1230. fMouseRghtBtnPopup();
  1231. } else {
  1232. initPopupMenu();
  1233. }
  1234. }
  1235. function fReqFormlist()
  1236. {
  1237. model.makeValue("/root/send/reqformlist/reqkindflag", "CPLT"); // complete
  1238. model.makeValue("/root/send/reqformlist/reqformprogflag", "-"); // 서식구분이 '디자인' 인것만 나오게 수정함.
  1239. submit("TRMRF03101");
  1240. }
  1241. function fPreviewForm()
  1242. {
  1243. try
  1244. {
  1245. var rtn = fSetTreeView();
  1246. rtn = rtn.split("|");
  1247. var obj = document.controls(rtn[0]);
  1248. var path = rtn[1];
  1249. var item = obj.item(obj.selectedIndex);
  1250. var rowPos = item.index + 1;
  1251. var formcd = model.getValue("/root/main/indxlist_d/item[" + rowPos + "]/linkcd");
  1252. if(formcd != "")
  1253. {
  1254. setParameter("SPMRF05500_formcd", formcd);
  1255. model.makeValue("/root/hidden/condition/formcd", formcd);
  1256. model.makeValue("/root/hidden/condition/formdegnseq", "");
  1257. model.makeValue("/root/hidden/condition/extnunitformlistyn", "N");
  1258. model.makeValue("/root/hidden/condition/cashedformdegnseq", "");
  1259. model.makeValue("/root/hidden/condition/sysformrecdt", "");
  1260. model.makeValue("/root/hidden/condition/mode", "D");
  1261. submit("TRMRF02001");
  1262. copyNodeset("/root/main/forminfo/formmast", "/root/temp/forminfo/formmast", "replace", model, model);
  1263. var formprogflag = model.getValue("/root/main/forminfo/formmast/formprogflag");
  1264. var formxrwyn = model.getValue("/root/main/forminfo/formmast/formxrwyn");
  1265. var formdegnseq = model.getValue("/root/main/forminfo/formmast/formdegnseq");
  1266. if(formprogflag == "MAIN" || formprogflag == "PROF" || formprogflag == "-" || formprogflag == "PROG")
  1267. {
  1268. if(formxrwyn == "Y" && formdegnseq != "")
  1269. modal("SPMRF05500", 1,10, 10, "SPMRF05500", "", "");
  1270. //open("SPMRF05500", "2", 0, 0, "SPMRF05500", "", "");
  1271. else
  1272. messageBox("해당 서식은 저장되지", "E007");
  1273. }
  1274. else
  1275. {
  1276. messageBox("해당 서식은 " + formprogflag + " 유형 서식", "I009");
  1277. return;
  1278. }
  1279. }
  1280. }
  1281. catch(e)
  1282. {
  1283. }
  1284. }
  1285. function fPreviewFormByGrd()
  1286. {
  1287. try
  1288. {
  1289. var formcd = model.getValue("/root/main/formlist/row["+grd_formlist.row+"]/formcd");
  1290. if(formcd != "")
  1291. {
  1292. setParameter("SPMRF05500_formcd", formcd);
  1293. model.makeValue("/root/hidden/condition/formcd", formcd);
  1294. model.makeValue("/root/hidden/condition/formdegnseq", "");
  1295. model.makeValue("/root/hidden/condition/extnunitformlistyn", "N");
  1296. model.makeValue("/root/hidden/condition/cashedformdegnseq", "");
  1297. model.makeValue("/root/hidden/condition/sysformrecdt", "");
  1298. model.makeValue("/root/hidden/condition/mode", "D");
  1299. submit("TRMRF02001");
  1300. copyNodeset("/root/main/forminfo/formmast", "/root/temp/forminfo/formmast", "replace", model, model);
  1301. var formprogflag = model.getValue("/root/main/forminfo/formmast/formprogflag");
  1302. var formxrwyn = model.getValue("/root/main/forminfo/formmast/formxrwyn");
  1303. var formdegnseq = model.getValue("/root/main/forminfo/formmast/formdegnseq");
  1304. if(formprogflag == "MAIN" || formprogflag == "PROF" || formprogflag == "-" || formprogflag == "PROG")
  1305. {
  1306. if(formxrwyn == "Y" && formdegnseq != "")
  1307. modal("SPMRF05500", 1,10, 10, "SPMRF05500", "", "");
  1308. //open("SPMRF05500", "2", 0, 0, "SPMRF05500", "", "");
  1309. else
  1310. messageBox("해당 서식은 저장되지", "E007");
  1311. }
  1312. else
  1313. {
  1314. messageBox("해당 서식은 " + formprogflag + " 유형 서식", "I009");
  1315. return;
  1316. }
  1317. }
  1318. }
  1319. catch(e)
  1320. {
  1321. }
  1322. }