SMMRT00800.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. /**
  2. * @group :
  3. * @ver : 2009.12.19
  4. * @by : 박구순
  5. * @---------------------------------------------------
  6. * @type : function
  7. * @access : public
  8. * @desc : 화면을 초기화 한다
  9. * @param :
  10. * @return :
  11. * @---------------------------------------------------
  12. */
  13. function fInitalize(){
  14. var MenuParam = getScreenMenuParameter();
  15. grd_abbrLists.attribute("height") = 645;
  16. // 공통코드를 조회한다.
  17. //zbcfGetCodeList( new Array("A0129"), new Array("/root/init/A0129list") );
  18. submit("TRMRF00802");
  19. if ( MenuParam == "S") {
  20. model.setValue("/root/init/abbrtype","02");
  21. radio1.dispatch("xforms-value-changed");
  22. radio1.refresh();
  23. fSelectAbbrMasterLists();
  24. radio1.disabled = true;
  25. }
  26. }
  27. function fInit1(){
  28. grd_abbrLists.attribute("height") = 645;
  29. model.removeNodeset("/root/main/abbrinfo");
  30. model.makeNode("/root/main/abbrinfo");
  31. model.copyNode("/root/main/abbrinfo","/root/init/abbrinfo");
  32. button9.visible = "true";
  33. button5.visible = "false"
  34. button29.visible = "false"
  35. }
  36. function fSelectAbbrType(){
  37. if(radio1.value =="01"){
  38. group2.visible = "true";
  39. model.setValue("/root/init/abbrkind","%");
  40. cmb_abbrkind.refresh();
  41. cmb_abbrkind.disabled = "false";
  42. }else{
  43. group2.visible = "false";
  44. model.setValue("/root/init/abbrkind","%");
  45. cmb_abbrkind.refresh();
  46. cmb_abbrkind.disabled = "true";
  47. }
  48. }
  49. function fSelectAbbrNM(param){
  50. fInit1();
  51. // model.setValue("/root/send/abbrtype","01");
  52. // model.setValue("/root/send/abbrkind","%");
  53. // model.setValue("/root/send/perfectyn","N");
  54. // model.setValue("/root/send/useyn","%");
  55. // model.setValue("/root/send/keyword",param);
  56. // model.setValue("/root/send/keytag","09");
  57. model.setValue("/root/send/abbrtype" ,model.getValue("/root/init/abbrtype"));
  58. model.setValue("/root/send/abbrkind" ,model.getValue("/root/init/abbrkind"));
  59. model.setValue("/root/send/perfectyn",model.getValue("/root/init/perfectyn"));
  60. model.setValue("/root/send/useyn" ,model.getValue("/root/init/useyn"));
  61. model.setValue("/root/send/keyword",param);
  62. model.setValue("/root/send/keytag","09");
  63. submit("TRMRT00801");
  64. }
  65. function fSelectAbbrMasterLists(){
  66. model.setValue("/root/send/abbrtype" ,model.getValue("/root/init/abbrtype"));
  67. model.setValue("/root/send/abbrkind" ,model.getValue("/root/init/abbrkind"));
  68. model.setValue("/root/send/perfectyn",model.getValue("/root/init/perfectyn"));
  69. model.setValue("/root/send/useyn" ,model.getValue("/root/init/useyn"));
  70. model.setValue("/root/send/keyword" ,model.getValue("/root/init/keyword"));
  71. if(ipt_keyword.value.length < 2 && model.getValue("/root/init/perfectyn") =="N" &&model.getValue("/root/init/abbrtype")=="01"){
  72. if(model.getValue("/root/init/abbrkind")=="%"||model.getValue("/root/init/abbrkind")=="01"||model.getValue("/root/init/abbrkind")=="02"){
  73. messageBox("검색어는 2자 이상 입력해야 가능 합니다. ","I007");//I007=확인하십시오.
  74. return;
  75. }
  76. }
  77. model.setValue("/root/send/keytag" ,model.getValue("/root/init/keytag"));
  78. submit("TRMRT00801");
  79. }
  80. function fSelectAbbrMasterInfo(){
  81. var cur_row = grd_abbrLists.row;
  82. var vAbbrcd = grd_abbrLists.valueMatrix(cur_row,3);
  83. if(cur_row <= 0 || cur_row =="undefined") {
  84. messageBox("수정 할 행을 선택하시기 바랍니다.","I007");
  85. return;
  86. }
  87. if(vAbbrcd !=""){
  88. var vAbbrType = grd_abbrLists.valueMatrix(cur_row,1);
  89. fSetAbbrMasterInfo("update", vAbbrType);
  90. rdo_abbrtype.disabled="true";
  91. grd_abbrLists.attribute("height") = 360;
  92. button9.visible = "false";
  93. button5.visible = "true"
  94. button29.visible = "true"
  95. model.setValue("/root/send/abbrcd" ,vAbbrcd);
  96. submit("TRMRT00802");
  97. }else{
  98. messageBox("약어코드 정보가 없습니다.","I003");
  99. }
  100. }
  101. function fSetAbbrMasterInfo(flag, vAbbrType){
  102. if(flag=="new"){
  103. if(vAbbrType =="01"){ // 약어인경우세팅
  104. // rdo_abbrtype.disabled="true"; // 수정시 약어 금지어 변경 못하게 막음
  105. btn_synominfo.visible ="true";
  106. btn_recminfo.visible ="false";
  107. model.setValue("/root/main/abbrinfo/abbrkind","01");
  108. rdo_abbrkind.refresh();
  109. rdo_abbrkind.disabled = "false";
  110. model.setValue("/root/main/abbrinfo/unitkindseq","");
  111. cmb_unitkindseq.refresh();
  112. cmb_unitkindseq.disabled = "false";
  113. model.setValue("/root/main/abbrinfo/exchval","");
  114. ipt_exchval.refresh();
  115. ipt_exchval.disabled = "false";
  116. ipt_dclrtresn.disabled="true";
  117. }else if(vAbbrType =="02"){ // 금지어 인 경우 세팅
  118. // rdo_abbrtype.disabled="true"; // 수정시 약어 금지어 변경 못하게 막음
  119. btn_synominfo.visible ="false";
  120. btn_recminfo.visible ="true";
  121. ipt_dclrtresn.disabled="false";
  122. model.setValue("/root/main/abbrinfo/abbrkind","-");
  123. rdo_abbrkind.refresh();
  124. model.setValue("/root/main/abbrinfo/unitkindseq","");
  125. cmb_unitkindseq.refresh();
  126. cmb_unitkindseq.disabled = "true";
  127. model.setValue("/root/main/abbrinfo/exchval","");
  128. ipt_exchval.refresh();
  129. ipt_exchval.disabled = "true";
  130. rdo_abbrkind.disabled = "true";
  131. }
  132. }else{
  133. if(flag =="01"){ // 약어인경우세팅
  134. // rdo_abbrtype.disabled="true"; // 수정시 약어 금지어 변경 못하게 막음
  135. btn_synominfo.visible ="true";
  136. btn_recminfo.visible ="false";
  137. rdo_abbrkind.disabled = "false";
  138. cmb_unitkindseq.disabled = "false";
  139. ipt_exchval.disabled = "false";
  140. ipt_dclrtresn.disabled="true";
  141. }else if(flag =="02"){ // 금지어 인 경우 세팅
  142. // rdo_abbrtype.disabled="true"; // 수정시 약어 금지어 변경 못하게 막음
  143. btn_synominfo.visible ="false";
  144. btn_recminfo.visible ="true";
  145. ipt_dclrtresn.disabled="false";
  146. cmb_unitkindseq.disabled = "true";
  147. ipt_exchval.disabled = "true";
  148. rdo_abbrkind.disabled = "true";
  149. }
  150. }
  151. }
  152. function fSetNewAbbrMasterInfo(){
  153. grd_abbrLists.attribute("height") = 360;
  154. rdo_abbrtype.disabled="false";
  155. model.removeNodeset("/root/main/abbrinfo");
  156. model.makeNode("/root/main/abbrinfo");
  157. model.copyNode("/root/main/abbrinfo","/root/init/abbrinfo");
  158. button9.visible = "false";
  159. button5.visible = "true"
  160. button29.visible = "true"
  161. model.makeValue("/root/main/abbrinfo/abbrtodd","29991231");
  162. model.makeValue("/root/main/abbrinfo/abbrfromdd",getCurrentDate().substr(0, 8));
  163. model.refresh();
  164. fSetAbbrMasterInfo("new","01");
  165. }
  166. /*
  167. * 저장 버튼을 클릭하였을 경우 이벤트
  168. *
  169. */
  170. function fOnClickSaveBtn(){
  171. if(""==model.getValue("/root/main/abbrinfo/abbrnm")){
  172. messageBox("약어 항목이 누락 되었습니다.","I003");
  173. return;
  174. }
  175. if(""==model.getValue("/root/main/abbrinfo/abbrengnm")){
  176. messageBox("영문명 항목이 누락 되었습니다.","I003");
  177. return;
  178. }
  179. // if(""==model.getValue("/root/main/abbrinfo/abbrhngnm")){
  180. // messageBox("한글명 항목이 누락 되었습니다.","I003");
  181. // return;
  182. // }
  183. if(""==model.getValue("/root/main/abbrinfo/abbrfromdd")){
  184. messageBox("시작일자 항목이 누락 되었습니다.","I003");
  185. return;
  186. }
  187. if(""==model.getValue("/root/main/abbrinfo/abbrtodd")){
  188. messageBox("종료일자 항목이 누락 되었습니다.","I003");
  189. return;
  190. }
  191. if("01"==model.getValue("/root/main/abbrinfo/abbrtype") && "03"==model.getValue("/root/main/abbrinfo/abbrkind")){ // 약어+단위
  192. if(""==model.getValue("/root/main/abbrinfo/unitkindseq")){ // 금지어
  193. messageBox("단위유형 항목이 누락 되었습니다.","I003");
  194. return;
  195. }
  196. // if(""==model.getValue("/root/main/abbrinfo/exchval")){ // 금지어
  197. // messageBox("단위환산값 항목이 누락 되었습니다.","I003");
  198. // return;
  199. // }
  200. }
  201. if("02"==model.getValue("/root/main/abbrinfo/abbrtype")){ // 금지어
  202. if(""==model.getValue("/root/main/abbrinfo/dclrtresn")){ // 금지어
  203. messageBox("금지사유 항목이 누락 되었습니다.","I003");
  204. return;
  205. }
  206. }
  207. // model.removeNodeset("/root/newabbrcd");
  208. if( submit("TXMRT00801")){
  209. // model.setValue("/root/send/abbrcd" ,model.getValue("/root/newabbrcd/abbrcd"));
  210. // submit("TRMRT00802");
  211. fSetAbbrMasterInfo("save",model.getValue("/root/main/abbrinfo/abbrtype"));
  212. button9.visible = "true";
  213. button5.visible = "false"
  214. button29.visible = "false"
  215. }
  216. }
  217. function fOnClickCancleBtn(){
  218. model.removeNodeset("/root/main/abbrinfo");
  219. model.makeNode("/root/main/abbrinfo");
  220. model.copyNode("/root/main/abbrinfo","/root/init/abbrinfo");
  221. button9.visible = "true";
  222. button5.visible = "false";
  223. button29.visible = "false";
  224. model.refresh();
  225. }
  226. function fOpenSynomPop(){
  227. var vAbbrcd = model.getValue("/root/main/abbrinfo/abbrcd");
  228. if(vAbbrcd!=""){
  229. setParameter("SPMRJ01800_abbrcd", vAbbrcd);
  230. modal("SPMRT01800"); //SPMRT01800_약어의동의어관리.xrw
  231. submit("TRMRT00802");
  232. }else{
  233. messageBox("약어코드 정보가 없습니다.","I003");
  234. }
  235. }
  236. function fOpenRecmPop(){
  237. var vAbbrcd = model.getValue("/root/main/abbrinfo/abbrcd");
  238. if(vAbbrcd!=""){
  239. setParameter("SPMRJ01900_abbrcd", vAbbrcd);
  240. modal("SPMRT01900"); //SPMRT01800_약어의동의어관리.xrw
  241. submit("TRMRT00802");
  242. }else{
  243. messageBox("약어코드 정보가 없습니다.","I003");
  244. }
  245. }
  246. function fOpenAbbrPop(){
  247. modal("SPMRT02000"); //SPMRT02000_약어검색.xrw
  248. }
  249. function fSaveExecl(){
  250. var vRowCount = grd_abbrLists.Rows;
  251. if( vRowCount <= 1){
  252. messageBox("저장 할 정보가 없습니다.","I003");
  253. }else{
  254. var saveFileName = getCurrentDate().substr(0, 8)+"_약어검색";
  255. var fileName = window.fileDialog("save", ",", false, saveFileName, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  256. if (fileName != ""){
  257. grd_abbrLists.saveExcel(fileName);
  258. }
  259. }
  260. }