SMMNR012.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. /*
  2. ICNP 관리(SMMNR01200.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var iICNPTreeRow = -1;
  7. var xICNPInfoPath = "/root/main/icnpmngt/icnpinfo"; // ICNP 코드 상세정보
  8. var xICNPTreePath = "/root/main/icnptreeinfo/icnptreelist"; // ICNP Semantic Type Tree Info
  9. var xSmntTypePath = "/root/main/smnttypeinfo/smnttypelist"; // ICNP Semantic Type
  10. var xRefPath = "/root/hidden/icnpinfo";
  11. var xSynomInfoPath = "/root/main/icnpmngt/synominfo/synomlist";// 동의어 정보
  12. var xICNPCodePath = "/root/main/icnpsrchinfo/icnplist"; // 검색된 ICNP Code 정보
  13. var xCondPath = "/root/main/cond";
  14. var xRefInfoPath = "/root/hidden/refinfo";
  15. /**
  16. * @group :
  17. * @ver : 2007.02.22
  18. * @by : 이은영
  19. * @---------------------------------------------------
  20. * @type : function
  21. * @access : public
  22. * @desc : 화면 초기화
  23. * @param :
  24. * @return :
  25. * @---------------------------------------------------
  26. */
  27. function fInit(){
  28. model.makeValue("/root/hidden/uid/children/wid","SPMNR02700");
  29. model.setValue(xCondPath+"/synomvaliyn","%");
  30. if(model.getValue("/root/hidden/refinfo/flag")==""){ // 팝업이 아닌 경우 선택버튼을 보여주지 않는다.
  31. btn_select.visible = false
  32. }
  33. fSearch("smnttype");
  34. }
  35. /**
  36. * @group :
  37. * @ver : 2007.02.22
  38. * @by : 이은영
  39. * @---------------------------------------------------
  40. * @type : function
  41. * @access : public
  42. * @desc : ICNP 조회 (
  43. * @param : pFlag ( smnttype : ICNP Semantic Type 조회, icnpcd : ICNP Code 탭 조회,
  44. * @param : Synom : 동의어 조회, TermSrch : ICNP Code 조회 화면의 조회버튼)
  45. * @return :
  46. * @---------------------------------------------------
  47. */
  48. function fSearch(pFlag){
  49. if(pFlag == "smnttype"){
  50. model.toggle("smntTypeSrch");
  51. model.removenodeset(xICNPTreePath);
  52. model.removenodeset(xSmntTypePath);
  53. model.removenode("/root/send");
  54. model.makeValue("/root/send/flag","smnttype");
  55. if(submit("TRMNR01201")){
  56. var RowCnt = grd_smnttype.rows - grd_smnttype.fixedRows;
  57. if(RowCnt > 0){
  58. grd_smnttype.row = 1;
  59. fClicedGrid();
  60. }
  61. }
  62. }else if(pFlag == "icnpcd"){
  63. model.toggle("icnpcdSrch");
  64. model.removenodeset(xICNPTreePath);
  65. model.removenodeset(xICNPCodePath);
  66. model.setValue(xCondPath+"/termnm","");
  67. model.setValue(xCondPath+"/codeflag","%");
  68. model.setValue(xCondPath+"/valiyn","%");
  69. model.setValue(xCondPath+"/srchscop","1");
  70. model.setFocus("ipt_srchtermnm");
  71. }else if(pFlag == "Synom"){ // 동의어 조회
  72. var localcd = model.getValue(xICNPInfoPath+"/localcd");
  73. if(localcd ==""){
  74. messageBox("ICNP 용어가 선택되지","E007");
  75. return;
  76. }
  77. model.removenodeset(xSynomInfoPath);
  78. model.removenode("/root/send");
  79. model.makeValue("/root/send/synomvaliyn", model.getValue(xCondPath+"/synomvaliyn"));
  80. model.makeValue("/root/send/localcd", localcd);
  81. submit("TRMNR01204");
  82. }else if(pFlag == "TermSrch"){
  83. model.removenodeset(xICNPCodePath);
  84. model.removenodeset(xICNPTreePath);
  85. model.removenode("/root/send");
  86. model.makeValue("/root/send/termnm", model.getValue(xCondPath+"/termnm"));
  87. model.makeValue("/root/send/codeflag", model.getValue(xCondPath+"/codeflag"));
  88. model.makeValue("/root/send/valiyn", model.getValue(xCondPath+"/valiyn"));
  89. model.makeValue("/root/send/srchscop", model.getValue(xCondPath+"/srchscop"));
  90. if(submit("TRMNR01205")){
  91. if((grd_icnp.rows-grd_icnp.fixedrows) < 1){
  92. messageBox("조회된 데이터가","I004");
  93. }
  94. }
  95. }
  96. if(pFlag != "Synom"){
  97. fICNPInfoClear();
  98. model.removenodeset(xSynomInfoPath);
  99. model.refresh();
  100. }
  101. }
  102. /**
  103. * @group :
  104. * @ver : 2007.03.12
  105. * @by : 이은영
  106. * @---------------------------------------------------
  107. * @type : function
  108. * @access : public
  109. * @desc : 용어 추가 (
  110. * @param : pFlag ( ICNP : ICNP 용어, Synom : 동의어 용어)
  111. * @return :
  112. * @---------------------------------------------------
  113. */
  114. function fAddTerm(pFlag){
  115. if(pFlag == "ICNP"){
  116. var xpos = event.screenX;
  117. var ypos = event.screenY-300;
  118. model.removenode(xRefPath);
  119. var idx = swt_icnpsrch.selectedIndex;
  120. if(idx == 0 && iICNPTreeRow < 1){
  121. messageBox("Tree 정보에서 상위 ICNP 용어가 선택되지 않았습니다.\n(최상위 코드는 ICNP Semantic Type 검색 탭에서만 가능합니다)\n 용어 등록을","E001");
  122. return;
  123. }
  124. if(idx == 1 && iICNPTreeRow < 1){
  125. var iRtn = messageBox("Tree 정보에서 상위 ICNP 용어가 선택되지 않았습니다.\n최상위 코드만 등록이 가능합니다. ","Q003");
  126. if(iRtn != 6) return;
  127. }
  128. if(iICNPTreeRow < 1){
  129. var sSmntTypeRow = grd_smnttype.row;
  130. if(sSmntTypeRow < 1){
  131. messageBox("ICNP Semantic Type이 선택되지","E007");
  132. return;
  133. }
  134. model.makeValue(xRefPath+"/stat", "I");
  135. model.makeValue(xRefPath+"/supcd","********");
  136. model.makeValue(xRefPath+"/supcnptid","");
  137. model.makeValue(xRefPath+"/smnttypecd", model.getValue(xSmntTypePath+"["+sSmntTypeRow+"]/smnttypecd"));
  138. model.makeValue(xRefPath+"/smnttypenm", model.getValue(xSmntTypePath+"["+sSmntTypeRow+"]/engnm"));
  139. model.makeValue(xRefPath+"/levl", 1);
  140. model.makeValue(xRefPath+"/termflag","ICNP");
  141. }else{
  142. model.makeValue(xRefPath+"/stat", "I");
  143. model.makeValue(xRefPath+"/supcd", model.getValue(xICNPInfoPath+"/localcd"));
  144. model.makeValue(xRefPath+"/supcnptid", model.getValue(xICNPInfoPath+"/cnptid"));
  145. model.makeValue(xRefPath+"/smnttypecd", model.getValue(xICNPInfoPath+"/smnttypecd"));
  146. model.makeValue(xRefPath+"/smnttypenm", model.getValue(xICNPInfoPath+"/smnttypenm"));
  147. model.makeValue(xRefPath+"/levl", eval(model.getValue(xICNPInfoPath+"/levl"))+1);
  148. model.makeValue(xRefPath+"/termflag","ICNP");
  149. }
  150. modal("SPMNR02700",1,xpos,ypos,model.getValue("/root/hidden/uid/children/wid"),"/root/hidden/icnpinfo","/root/hidden/icnpinfo");
  151. if(getParameter("exec") == "Y"){
  152. fClicedGrid();
  153. fICNPInfoClear();
  154. model.removenodeset(xSynomInfoPath);
  155. model.refresh();
  156. }
  157. }else if(pFlag == "Synom"){
  158. var xpos = event.screenX-500;
  159. var ypos = event.screenY-500;
  160. var localcd = model.getValue(xICNPInfoPath+"/localcd");
  161. model.removenode(xRefPath);
  162. if(localcd == ""){
  163. messageBox("동의어를 등록할 ICNP 용어가 선택되지", "E007");
  164. return;
  165. }
  166. model.makeValue(xRefPath+"/stat","I");
  167. model.makeValue(xRefPath+"/reprlocalcd",model.getValue(xICNPInfoPath+"/localcd"));
  168. model.makeValue(xRefPath+"/todd",model.getValue(xICNPInfoPath+"/todd"));
  169. model.makeValue(xRefPath+"/cnptid",model.getValue(xICNPInfoPath+"/cnptid"));
  170. model.makeValue(xRefPath+"/termflag","Synom");
  171. modal("SPMNR02700",1,xpos,ypos,model.getValue("/root/hidden/uid/children/wid"),"/root/hidden/icnpinfo","/root/hidden/icnpinfo");
  172. if(getParameter("exec") == "Y"){
  173. fSearch("Synom");
  174. }
  175. }
  176. }
  177. /**
  178. * @group :
  179. * @ver : 2007.03.12
  180. * @by : 이은영
  181. * @---------------------------------------------------
  182. * @type : function
  183. * @access : public
  184. * @desc : 용어 수정
  185. * @param : pFlag ( ICNP : ICNP 용어, Synom : 동의어 용어)
  186. * @return :
  187. * @---------------------------------------------------
  188. */
  189. function fUpdtTerm(pFlag){
  190. model.removenode(xRefPath);
  191. if(pFlag == "ICNP"){
  192. var xpos = event.screenX;
  193. var ypos = event.screenY-300;
  194. var localcd = model.getValue(xICNPInfoPath+"/localcd");
  195. if(localcd == ""){
  196. messageBox("수정할 ICNP 용어가 선택되지", "E007");
  197. return;
  198. }
  199. model.makeValue(xRefPath+"/stat", "U");
  200. model.makeValue(xRefPath+"/localcd", model.getValue(xICNPInfoPath+"/localcd"));
  201. model.makeValue(xRefPath+"/todd", model.getValue(xICNPInfoPath+"/todd"));
  202. model.makeValue(xRefPath+"/termflag","ICNP");
  203. modal("SPMNR02700",1,xpos,ypos,model.getValue("/root/hidden/uid/children/wid"),"/root/hidden/icnpinfo","/root/hidden/icnpinfo");
  204. if(getParameter("exec") == "Y"){
  205. fClicedGrid();
  206. fICNPInfoClear();
  207. model.removenodeset(xSynomInfoPath);
  208. model.refresh();
  209. }
  210. }else if(pFlag == "Synom"){
  211. var xpos = event.screenX-500;
  212. var ypos = event.screenY-500;
  213. var iRow = grd_icnpsynom.row;
  214. if(iRow < 1){
  215. messageBox("수정할 동의어가 선택되지", "E007");
  216. return;
  217. }
  218. model.makeValue(xRefPath+"/stat","U");
  219. model.makeValue(xRefPath+"/localcd",model.getValue(xSynomInfoPath+"["+iRow+"]/localcd"));
  220. model.makeValue(xRefPath+"/todd",model.getValue(xSynomInfoPath+"["+iRow+"]/todd"));
  221. modal("SPMNR02700",1,xpos,ypos,model.getValue("/root/hidden/uid/children/wid"),"/root/hidden/icnpinfo","/root/hidden/icnpinfo");
  222. if(getParameter("exec") == "Y"){
  223. fSearch("Synom");
  224. }
  225. }
  226. }
  227. /**
  228. * @group :
  229. * @ver : 2007.03.12
  230. * @by : 이은영
  231. * @---------------------------------------------------
  232. * @type : function
  233. * @access : public
  234. * @desc : 그리드 클릭시..
  235. * @param :
  236. * @return :
  237. * @---------------------------------------------------
  238. */
  239. function fClicedGrid(){
  240. var idx = swt_icnpsrch.selectedIndex;
  241. var iRow = -1;
  242. var localcd = "";
  243. if(idx == 0){ // ICNP Code 조회
  244. iRow = grd_icnp.row;
  245. if(iRow < 1) return;
  246. model.removenode("/root/send");
  247. model.makeValue("/root/send/smnttypecd",model.getValue(xICNPCodePath+"["+iRow+"]/smnttypecd"));
  248. localcd = model.getValue(xICNPCodePath+"["+iRow+"]/localcd");
  249. }else if(idx == 1) { // ICNP Semantic Type 검색
  250. iRow = grd_smnttype.row;
  251. if(iRow < 1) return;
  252. model.removenode("/root/send");
  253. model.makeValue("/root/send/smnttypecd",model.getValue(xSmntTypePath+"["+iRow+"]/smnttypecd"));
  254. }
  255. if(submit("TRMNR01202")){
  256. iICNPTreeRow = -1;
  257. if(localcd != ""){
  258. model.setValue("/root/hidden/treevalue",localcd);
  259. trv_icnptree2.refresh();
  260. }
  261. }
  262. }
  263. /**
  264. * @group :
  265. * @ver : 2007.03.13
  266. * @by : 이은영
  267. * @---------------------------------------------------
  268. * @type : function
  269. * @access : public
  270. * @desc : Tree View 클릭시..
  271. * @param :
  272. * @return :
  273. * @---------------------------------------------------
  274. */
  275. function fClickedTreeView(){
  276. var idx = swt_icnpsrch.selectedIndex;
  277. if(idx == 0){ // ICNP Code 조회
  278. iICNPTreeRow = trv_icnptree2.focusindex + 1;
  279. }else if(idx == 1){ // ICNP Semantic Type 검색
  280. iICNPTreeRow = trv_icnptree1.focusindex + 1;
  281. }
  282. if(iICNPTreeRow < 1) return;
  283. model.removenode("/root/send");
  284. model.makeValue("/root/send/localcd", model.getValue(xICNPTreePath+"["+iICNPTreeRow+"]/localcd"));
  285. model.makeValue("/root/send/todd", model.getValue(xICNPTreePath+"["+iICNPTreeRow+"]/todd"));
  286. model.makeValue("/root/send/synomvaliyn", model.getValue(xCondPath+"/synomvaliyn"));
  287. if(submit("TRMNR01203")){
  288. model.setValue(xICNPInfoPath+"/hngposinfo", model.getValue(xICNPTreePath+"["+iICNPTreeRow+"]/hngposinfo"));
  289. model.setValue(xICNPInfoPath+"/engposinfo", model.getValue(xICNPTreePath+"["+iICNPTreeRow+"]/engposinfo"));
  290. model.refresh();
  291. }
  292. }
  293. /**
  294. * @group :
  295. * @ver : 2007.03.13
  296. * @by : 이은영
  297. * @---------------------------------------------------
  298. * @type : function
  299. * @access : public
  300. * @desc : ICNP 정보 Clear
  301. * @param :
  302. * @return :
  303. * @---------------------------------------------------
  304. */
  305. function fICNPInfoClear(){
  306. model.setValue(xICNPInfoPath+"/cdflag","");
  307. model.setValue(xICNPInfoPath+"/smnttypenm","");
  308. model.setValue(xICNPInfoPath+"/localcd","");
  309. model.setValue(xICNPInfoPath+"/cnptid","");
  310. model.setValue(xICNPInfoPath+"/hngnm","");
  311. model.setValue(xICNPInfoPath+"/engnm","");
  312. model.setValue(xICNPInfoPath+"/definecnts","");
  313. model.setValue(xICNPInfoPath+"/levl","");
  314. model.setValue(xICNPInfoPath+"/srcofdata","");
  315. model.setValue(xICNPInfoPath+"/fromdd","");
  316. model.setValue(xICNPInfoPath+"/todd","");
  317. model.setValue(xICNPInfoPath+"/valiyn","");
  318. model.setValue(xICNPInfoPath+"/hngposinfo","");
  319. model.setValue(xICNPInfoPath+"/engposinfo","");
  320. model.setValue(xICNPInfoPath+"/reprlocalcd","");
  321. model.setValue(xICNPInfoPath+"/smnttypecd","");
  322. }
  323. /**
  324. * @group :
  325. * @ver : 2007.03.14
  326. * @by : 이은영
  327. * @---------------------------------------------------
  328. * @type : function
  329. * @access : public
  330. * @desc : ICNP 정보 보내기
  331. * @param :
  332. * @return :
  333. * @---------------------------------------------------
  334. */
  335. function fSendITerm(){
  336. var terminfo = model.getValue(xICNPInfoPath+"/smnttypecd")+"▦"+
  337. model.getValue(xICNPInfoPath+"/localcd")+"▦"+
  338. model.getValue(xICNPInfoPath+"/hngnm")+"▦"+
  339. model.getValue(xICNPInfoPath+"/engnm")+"▦"+
  340. model.getValue(xICNPInfoPath+"/cnptid");
  341. opener.javascript.setParameter("terminfo",terminfo);
  342. model.close();
  343. }