MRF01900.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. /**
  2. * @desc : ?????? (?????? ?????? tree?? road????)
  3. * @param : ???? id (btnID)
  4. * @return :
  5. * @---------------------------------------------------
  6. */
  7. function fIndxListSrch(){
  8. model.removeNodeset("/root/send/indxflag");
  9. model.makeValue("/root/send/indxflag","");
  10. model.setValue("/root/send/indxflag", model.getValue("/root/temp/condition/indxflag"));
  11. submit("TRMRF01901");
  12. }
  13. /**
  14. * @desc : ?????? (?????? ?????? tree?? road????)
  15. * @param : ???? id (btnID)
  16. * @return :
  17. * @---------------------------------------------------
  18. */
  19. function fIndxInfoListSrch(){
  20. var iIndx = treeview1.focusIndex + 1;
  21. var selIndxCd = model.getValue("/root/main/indxlist/item[" + iIndx + "]/itemindxseq");
  22. model.setValue("/root/temp/condition/rowcnt", iIndx);
  23. model.setValue("/root/temp/condition/selectedindx", selIndxCd);
  24. model.setValue("/root/temp/condition/focusindx", iIndx);
  25. model.makeValue("/root/send/itemindxseq", selIndxCd );
  26. model.makeValue("/root/send/indxflag", model.getValue("/root/temp/condition/indxflag"));
  27. submit("TRMRF01902");
  28. }
  29. /**
  30. * @desc :indxinfo 초기화
  31. * @
  32. * @param :
  33. * @return :
  34. * @---------------------------------------------------
  35. */
  36. function fClear(){
  37. model.resetInstanceNode("/root/main/indxinfo");
  38. model.refresh();
  39. }
  40. /**
  41. * @desc : val버튼 disabled
  42. * @
  43. * @param :
  44. * @return :
  45. * @---------------------------------------------------
  46. */
  47. function fValBtnDisable(flag){
  48. cmb_highestlvel.disabled = flag;
  49. //ipt_itemindxseq1.disabled = flag;
  50. ipt_indxnm1.disabled = flag;
  51. ipt_indxcnts1.disabled = flag;
  52. //ipt_supitemindxseq1.disabled = flag;
  53. //ipt_upindxnm1.disabled = flag;
  54. cmb_valiyn1.disabled = flag;
  55. }
  56. /**
  57. * @desc :term버튼 disabled
  58. * @
  59. * @param :
  60. * @return :
  61. * @---------------------------------------------------
  62. */
  63. function fTermBtnDisable(flag){
  64. cmb_highestlvel.disabled = flag;
  65. //ipt_itemindxseq2.disabled = flag;
  66. ipt_indxnm2.disabled = flag;
  67. ipt_indxcnts2.disabled = flag;
  68. //ipt_supitemindxseq2.disabled = flag;
  69. //ipt_upindxnm2.disabled = flag;
  70. cmb_valiyn2.disabled = flag;
  71. }
  72. /**
  73. * @desc :img버튼 disabled
  74. * @
  75. * @param :
  76. * @return :
  77. * @---------------------------------------------------
  78. */
  79. function fImgBtnDisable(flag){
  80. cmb_highestlvel.disabled = flag;
  81. //ipt_itemindxseq4.disabled = flag;
  82. ipt_indxnm4.disabled = flag;
  83. ipt_indxcnts4.disabled = flag;
  84. //ipt_supitemindxseq4.disabled = flag;
  85. //ipt_upindxnm4.disabled = flag;
  86. cmb_valiyn4.disabled = flag;
  87. }
  88. /**
  89. * @desc :unit버튼 disabled
  90. * @
  91. * @param :
  92. * @return :
  93. * @---------------------------------------------------
  94. */
  95. function fUnitBtnDisable(flag){
  96. cmb_highestlvel.disabled = flag;
  97. //ipt_itemindxseq3.disabled = flag;
  98. ipt_indxnm3.disabled = flag;
  99. ipt_indxcnts3.disabled = flag;
  100. //ipt_supitemindxseq3.disabled = flag;
  101. //ipt_upindxnm3.disabled = flag;
  102. cmb_valiyn3.disabled = flag;
  103. }
  104. /**
  105. * @desc :버튼 disabled
  106. * @
  107. * @param :
  108. * @return :
  109. * @---------------------------------------------------
  110. */
  111. function fDisable(flag){
  112. if(flag == "DA"){
  113. ipt_indxhngnm.disabled = "false";
  114. ipt_indxengnm.disabled = "false";
  115. btn_upindxcd.disabled = "false";
  116. cmb_indxdrdiflag.disabled = "false";
  117. ipt_indxseqno.disabled = "false";
  118. } else if(flag == "DD"){
  119. ipt_indxhngnm.disabled = "true";
  120. ipt_indxengnm.disabled = "true";
  121. btn_upindxcd.disabled = "true";
  122. cmb_indxdrdiflag.disabled = "true";
  123. ipt_indxseqno.disabled = "true";
  124. }
  125. model.refresh();
  126. }
  127. /* @group :
  128. * @ver : 2007.06.13
  129. * @by :
  130. * @---------------------------------------------------
  131. * @type : function
  132. * @access : public
  133. * @desc : 두개의 노드셋을 비교한다.
  134. * @param : originalNode :
  135. * @param : copyNode :
  136. * @return : true, false
  137. * @---------------------------------------------------
  138. */
  139. function fCompareNodes1(originalNode, copyNode, newstr, oldstr){
  140. var ins = document.models( 0 ).instances( 0 );
  141. var original = ins.selectSingleNode(originalNode).xml;
  142. var copy = ins.selectSingleNode(copyNode).xml;
  143. var replace = original.setReplaceWord(newstr,oldstr);
  144. if(replace == null || copy == null){
  145. return false;
  146. }else if (replace == copy){
  147. return true;
  148. }else{
  149. return false;
  150. }
  151. }
  152. /**
  153. * @desc : indx정보 저장
  154. * @
  155. * @param :
  156. * @return :
  157. * @---------------------------------------------------
  158. */
  159. function fSaveIndx(flag){
  160. var indx = null;
  161. if(flag == "I" || flag == "U" || flag == "D"){ //?? ?? ??
  162. model.removeNodeset("/root/send");
  163. model.makeValue("/root/send/state", flag); //?? : ??,??,??
  164. model.makeValue("/root/send/indxflag", model.getValue("/root/temp/condition/indxflag")); //??:??,??,???,?
  165. if(model.getValue("/root/temp/condition/indxflag") == "V"){
  166. indx = "valindx";
  167. } else if(model.getValue("/root/temp/condition/indxflag") == "F"){
  168. indx = "formindx";
  169. } else if(model.getValue("/root/temp/condition/indxflag") == "P"){
  170. indx = "imgindx";
  171. } else if(model.getValue("/root/temp/condition/indxflag") == "U"){
  172. indx = "unitindx";
  173. }
  174. model.makeValue("/root/send/supitemindxseq", model.getValue("/root/main/indxinfo/" + indx + "/supitemindxseq"));
  175. model.makeValue("/root/send/itemindxseq", model.getValue("/root/main/indxinfo/" + indx + "/itemindxseq"));
  176. model.makeValue("/root/send/indxnm", model.getValue("/root/main/indxinfo/" + indx + "/indxnm"));
  177. model.makeValue("/root/send/valiyn", model.getValue("/root/main/indxinfo/" + indx + "/valiyn"));
  178. model.makeValue("/root/send/indxcnts", model.getValue("/root/main/indxinfo/" + indx + "/indxcnts"));
  179. //model.makeValue("/root/send/sortno", model.getValue("/root/main/indxinfo/" + indx + "/sortno"));
  180. //model.makeValue("/root/send/indxengnm", model.getValue("/root/main/indxinfo/" + indx + "/indxengnm"));
  181. model.makeValue("/root/send/sortno", 0);
  182. if(flag =="U"){
  183. //수정 여부 check
  184. var compare = fCompareNodes1("/root/main/indxinfo/" + indx + "2","/root/main/indxinfo/" + indx , indx + "2", indx);
  185. if(flag =="U" && compare == true){
  186. messageBox("수정된 내용이","I004");
  187. return;
  188. }
  189. }
  190. submit("TXMRF01901");
  191. var focus = model.getValue("/root/temp/condition/focusindx") - 1; //??? ???? ???
  192. treeview1.select(focus);
  193. }
  194. var iIndx = model.getValue("/root/temp/condition/rowcnt");
  195. model.setValue("/root/temp/condition/indexcode", model.getValue("/root/main/indxlist/item[indxnm='" + model.getValue("/root/main/indxinfo/"+indx+"/indxnm") + "']/itemindxseq"));
  196. model.refresh();
  197. }
  198. /**
  199. * @desc : indx 선택 정보 표시( 밸류, 이미지, 서식, 단위)
  200. * @
  201. * @param :
  202. * @return :
  203. * @---------------------------------------------------
  204. */
  205. function fIndxSelect(){
  206. fValBtnDisable(true);
  207. fTermBtnDisable(true);
  208. fImgBtnDisable(true);
  209. fUnitBtnDisable(true);
  210. model.resetInstanceNode("/root/main/indxinfo");
  211. model.refresh();
  212. if(model.getValue("/root/temp/condition/indxflag") == "V") {
  213. model.toggle("case1");
  214. fIndxListSrch();
  215. }else if(model.getValue("/root/temp/condition/indxflag") == "F") {
  216. model.toggle("case2");
  217. fIndxListSrch();
  218. }else if(model.getValue("/root/temp/condition/indxflag") == "P"){
  219. model.toggle("case4");
  220. fIndxListSrch();
  221. }else if(model.getValue("/root/temp/condition/indxflag") == "U"){
  222. model.toggle("case3");
  223. fIndxListSrch();
  224. }else if(model.getValue("/root/temp/condition/indxflag") == ""){
  225. model.toggle("case1");
  226. model.setValue("/root/temp/condition/indxflag",'V');
  227. fIndxListSrch();
  228. }
  229. }
  230. /**
  231. * @desc : tree 선택 정보 표시( 밸류, 이미지, 서식)
  232. * @
  233. * @param :
  234. * @return :
  235. * @---------------------------------------------------
  236. */
  237. function fTreeSelect(){
  238. fValBtnDisable(true);
  239. fTermBtnDisable(true);
  240. fImgBtnDisable(true);
  241. fUnitBtnDisable(true);
  242. fIndxInfoListSrch();
  243. //itemPath 분할후 정보란에 입력
  244. var depthnm = treeview1.getItemPath(treeview1.selectedindex,",");
  245. var depth;
  246. depth = depthnm.split(',');
  247. var a1 = new Array(depth.length);
  248. var b1 = new Array(depth.length);
  249. var cc = depthnm.size;
  250. var count =0;
  251. for(var i=0; i<depth.length; i++){
  252. b1[i]= depth[i];
  253. count++;
  254. }
  255. var indx = model.getValue("/root/temp/condition/indxflag");
  256. var indxpath = null;
  257. if(indx=="V"){
  258. indxpath = "valindx";
  259. }else if(indx=="F"){
  260. indxpath = "formindx";
  261. }else if(indx=="P"){
  262. indxpath = "imgindx";
  263. }else if(indx=="U"){
  264. indxpath = "unitindx";
  265. }
  266. for(var i=0; i< count; i++){
  267. model.makeValue("/root/temp/condition/depthnm"+(i+1),b1[i]);
  268. model.makeValue("/root/main/indxinfo/" + indxpath + "/depthnm"+(i+1) ,model.getValue("/root/temp/condition/depthnm"+(i+1)));
  269. }
  270. //alert("itemseq"+model.getValue("/root/main/indxlist/item["+iIndx+"]/itemindxseq"));
  271. //model.setValue("/root/main/indxinfo/valindx/supitemindxseq" ,model.getValue("/root/main/indxlist/item/itemindxseq"));
  272. model.refresh();
  273. }
  274. /**
  275. * @desc : indx정보 저장( 밸류, 이미지, 서식)
  276. * @
  277. * @param :
  278. * @return :
  279. * @---------------------------------------------------
  280. */
  281. function fSaveIndxinfo(){
  282. var state = model.getValue("/root/temp/condition/state");
  283. /*
  284. //입력한 색인코드와 동일한 코드가 존재하는지 체크해본 후 동일한 코드 존재하면 수정, 존재하지 않으면 등록
  285. model.removeNodeset("/root/send");
  286. if(model.getValue("/root/temp/condition/indxflag") == "V") {
  287. model.makeValue("/root/send/itemindxseq", model.getValue("/root/main/indxinfo/valindx/itemindxseq")); //분기: 밸류리스트
  288. }else if(model.getValue("/root/temp/condition/indxflag") == "F") {
  289. model.makeValue("/root/send/itemindxseq", model.getValue("/root/main/indxinfo/formindx/itemindxseq")); //분기:서식
  290. }else if(model.getValue("/root/temp/condition/indxflag") == "P") {
  291. model.makeValue("/root/send/itemindxseq", model.getValue("/root/main/indxinfo/imgindx/itemindxseq")); //분기:이미지
  292. }else if(model.getValue("/root/temp/condition/indxflag") == "U") {
  293. model.makeValue("/root/send/itemindxseq", model.getValue("/root/main/indxinfo/unitindx/itemindxseq")); //분기:
  294. }
  295. model.makeValue("/root/send/indxflag", model.getValue("/root/temp/condition/indxflag"));
  296. submit("TRMRF01903");
  297. */
  298. // if(treeview1.focusindex == -1){
  299. // messageBox("색인을","C002");
  300. // return;
  301. // }
  302. if(state == "I") {
  303. fSaveIndx("I");
  304. } else if(state == "U") {
  305. fSaveIndx("U");
  306. }
  307. model.setValue("/root/temp/condition/state", "");
  308. //fClear();
  309. model.resetInstanceNode("/root/main/indxinfo");
  310. //최상위checkbox 초기화
  311. model.setValue("/root/temp/condition/highestlvel","");
  312. fValBtnDisable(true);
  313. fTermBtnDisable(true);
  314. fImgBtnDisable(true);
  315. fUnitBtnDisable(true);
  316. model.refresh();
  317. }
  318. /**
  319. * @desc : indx정보 삭제( 밸류, 이미지, 서식)
  320. * @
  321. * @param :
  322. * @return :
  323. * @---------------------------------------------------
  324. */
  325. function fDelindx(){
  326. var rtn = messageBox("색인을 ", "Q001");
  327. if (rtn == "6"){
  328. model.setValue("/root/temp/condition/state", "D");
  329. fSaveIndx("D");
  330. model.setValue("/root/temp/condition/state", "");
  331. fClear();
  332. model.refresh();
  333. }
  334. }
  335. /**
  336. * @desc : indx정보 추가( 밸류, 이미지, 서식)
  337. * @
  338. * @param :
  339. * @return :
  340. * @---------------------------------------------------
  341. */
  342. function fAddindx(){
  343. var indx = model.getValue("/root/temp/condition/rowcnt");
  344. if(indx == "" ){
  345. indx = -1;
  346. }
  347. var indxpath = null;
  348. fValBtnDisable(false);
  349. fTermBtnDisable(false);
  350. fImgBtnDisable(false);
  351. fUnitBtnDisable(false);
  352. //if(model.getValue("/root/temp/condition/selectedindx") == "" || model.getValue("/root/temp/condition/selectedindx") == null){
  353. //var rtn1 = messageBox("상위 색인을 ", "C002");
  354. //}
  355. fClear();
  356. // alert("indxexcode"+model.getValue("/root/temp/condition/indexcode"));
  357. // if(model.getValue("/root/temp/condition/indexcode") != "" ) {
  358. var selIndxCd = model.getValue("/root/main/indxlist/item[" + indx + "]/itemindxseq");
  359. if(model.getValue("/root/temp/condition/indxflag") == "V") {
  360. fValBtnDisable(false);
  361. indxpath = "valindx";
  362. } else if(model.getValue("/root/temp/condition/indxflag") == "F") {
  363. fTermBtnDisable(false);
  364. indxpath = "formindx";
  365. } else if(model.getValue("/root/temp/condition/indxflag") == "P") {
  366. fImgBtnDisable(false);
  367. indxpath = "imgindx";
  368. } else if(model.getValue("/root/temp/condition/indxflag") == "U") {
  369. fUnitBtnDisable(false);
  370. indxpath = "unitindx";
  371. }
  372. // }
  373. model.makeValue("/root/main/indxinfo/" + indxpath + "/valiyn","Y");
  374. model.makeValue("/root/main/indxinfo/" + indxpath + "/supitemindxseq", model.getValue("/root/main/indxlist/item[" + indx + "]/itemindxseq"));
  375. model.makeValue("/root/main/indxinfo/" + indxpath + "/upindxnm", model.getValue("/root/main/indxlist/item[" + indx + "]/indxnm"));
  376. model.makeValue("/root/main/indxinfo/" + indxpath + "/indxflag", model.getValue("/root/temp/condition/indxflag"));
  377. model.setValue("/root/temp/condition/state", "I"); //최상위 레벨 등록(상위코드=인덱스코드)
  378. model.setValue("/root/temp/condition/highestlvel", "");
  379. model.refresh();
  380. }
  381. /**
  382. * @desc : indx정보 수정( 밸류, 이미지, 서식, 단위)
  383. * @
  384. * @param :
  385. * @return :
  386. * @---------------------------------------------------
  387. */
  388. function fUpdateIndx(){
  389. var focus = model.getValue("/root/temp/condition/focusindx");
  390. if(focus == ""){
  391. return;
  392. }
  393. /* fValBtnDisable(false);
  394. fTermBtnDisable(false);
  395. fImgBtnDisable(false);
  396. fUnitBtnDisable(false);
  397. */
  398. model.setValue("/root/temp/condition/state", "U");
  399. var indxpath;
  400. if(model.getValue("/root/temp/condition/indxflag") == "V") {
  401. fValBtnDisable(false);
  402. indxpath = "valindx";
  403. } else if(model.getValue("/root/temp/condition/indxflag") == "F") {
  404. fTermBtnDisable(false);
  405. indxpath = "formindx";
  406. } else if(model.getValue("/root/temp/condition/indxflag") == "P") {
  407. fImgBtnDisable(false);
  408. indxpath = "imgindx";
  409. } else if(model.getValue("/root/temp/condition/indxflag") == "U") {
  410. fUnitBtnDisable(false);
  411. indxpath = "unitindx";
  412. }
  413. //fCompareNodes 비교위해 copynode
  414. model.makeNode("/root/main/indxinfo/" + indxpath + "2");
  415. model.copyNode("/root/main/indxinfo/" + indxpath + "2","/root/main/indxinfo/" + indxpath);
  416. }
  417. /**
  418. * @desc : 최상위 버튼 선택
  419. * @
  420. * @param :
  421. * @return :
  422. * @---------------------------------------------------
  423. */
  424. function fHighbtn(){
  425. if(model.getValue("/root/temp/condition/highestlvel") == "Y"){
  426. if(model.getValue("/root/temp/condition/indxflag") == "V") {
  427. model.makeValue("/root/main/indxinfo/valindx/supitemindxseq", model.getValue("/root/main/indxinfo/valindx/itemindxseq"));
  428. } else if(model.getValue("/root/temp/condition/indxflag") == "F") {
  429. model.makeValue("/root/main/indxinfo/formindx/supitemindxseq", model.getValue("/root/main/indxinfo/formindx/itemindxseq"));
  430. } else if(model.getValue("/root/temp/condition/indxflag") == "P"){
  431. model.makeValue("/root/main/indxinfo/imgindx/supitemindxseq", model.getValue("/root/main/indxinfo/imgindx/itemindxseq"));
  432. } else if(model.getValue("/root/temp/condition/indxflag") == "U"){
  433. model.makeValue("/root/main/indxinfo/unitindx/supitemindxseq", model.getValue("/root/main/indxinfo/unitindx/itemindxseq"));
  434. } else{
  435. model.makeValue("/root/main/indxinfo/imgindx/supitemindxseq", model.getValue("/root/main/indxinfo/imgindx/itemindxseq"));
  436. }
  437. model.refresh();
  438. }
  439. }