MRF07000.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. function fRemoveBlank(str)
  2. {
  3. str = str.replace(/\s/g,'');
  4. return str;
  5. }
  6. /**
  7. * @desc : 화면초기화
  8. * @ root/init/today, time에 현재 날짜와 시간 설정
  9. * @ 초기 화면의 번튼 비활성화
  10. * @param :
  11. * @return :
  12. * @---------------------------------------------------
  13. */
  14. function fInitialize(){
  15. grd_pltte.rowHeight(0) = grd_pltte.rowHeight(0) + 10;
  16. grd_pltte.frozenCols = 7;
  17. model.setFocus("ipt_srchdata");
  18. //submit("TRMRF00706");
  19. //zbcfGetCodeList( new Array("M0534"), new Array("/root/init/M0534list") );
  20. /**
  21. * 수정 : 2009.09.15 안치원 TASK-2897
  22. * 내용 : 서식관리화면에서 서식조회조건으로 기관코드추가
  23. */
  24. /* 2010.05.28, 주희경 , 기관별 서식 사용이력을 볼 때 기관별로 조회가능하여야 하도록 주석처리
  25. if (getUserInfo("posinstcd") == "001" && getUserInfo("posdeptcd") == "4130700000") {
  26. cmb_cond_instcd.attribute("visibility") = "visible";
  27. } else {
  28. cmb_cond_instcd.attribute("visibility") = "hidden";
  29. }
  30. */
  31. model.setValue("/root/main/condition/reqinstcd", getUserInfo("dutplceinstcd"));
  32. model.refresh();
  33. }
  34. /**
  35. * @desc : Grid 저장 후 화면을 clear
  36. *
  37. * @param : 그리드 id (grdID)
  38. * @return :
  39. * @---------------------------------------------------
  40. */
  41. function fClrGrdStatus(grdID){
  42. var totRow = grdID.rows;
  43. for(var i = grdID.fixedRows; i < totRow; i++){
  44. var statusflag = grdID.rowstatus(i);
  45. if(statusflag == 1 || statusflag == 2){
  46. grdID.rowstatus(i) = 0;
  47. }else if(statusflag == 4){
  48. grdID.deleteItem(i);
  49. }
  50. }
  51. }
  52. function fSrchForm()
  53. {
  54. var formnm = "";
  55. var reqflag = model.getValue("/root/main/condition/reqflag");
  56. if(reqflag == "formcd"){
  57. var sCode = model.getValue("/root/main/condition/reqdata");
  58. var sTmp = "";
  59. var iTmp = 0;
  60. // form코드 입력시 자릿수 채워준다
  61. var iCodeLength = sCode.length;
  62. if(iCodeLength ==0){
  63. messageBox(ipt_srchdata.label +" 서식코드 조건을", "C001");
  64. return;
  65. }
  66. else if(iCodeLength > 10){
  67. messageBox(ipt_srchdata.label +" 서식코드 자리수를 올바르게 ", "C001");
  68. return;
  69. }
  70. var temp = 10 - iCodeLength;
  71. for(var i = 1; i <= temp; i++){
  72. sTmp += "0";
  73. }
  74. sTmp = sTmp + sCode;
  75. model.setValue("/root/main/condition/reqdata",sTmp);
  76. }
  77. formnm = model.getValue("/root/main/condition/reqdata");
  78. // 유효 및 전체 조회시 검색 값이 없는 경우 검색값 요청을 하도록 수정
  79. if(formnm == "")
  80. {
  81. messageBox(ipt_srchdata.label +" 조회할 서식을 ", "C001");
  82. return;
  83. }
  84. model.setValue("/root/main/condition/reqdata",formnm.toUpperCase());
  85. // 서식관리에서 보낸 쿼리라는것을 명시
  86. model.makeValue("/root/main/condition/reqsrch", "formmaster");
  87. model.makeNode("/root/send/reqdata");
  88. model.copyNode("/root/send/reqdata", "/root/main/condition");
  89. submit("TRMRF07001");
  90. // 서식디자인 생성안한 것들을 색상으로 표시
  91. //fClassificationForm();
  92. }
  93. function fClassificationForm()
  94. {
  95. // 서식을 생성하지 않은 것들을 색상으로 분류함.
  96. try
  97. {
  98. /*
  99. // 과별서식, 공통서식
  100. var srchformlist = model.instances(0).selectNodes("/root/main/formlist[formprogflag != 'OCR' and formprogflag != 'PROF(CODE)' and formprogflag != 'PROF']");
  101. //var srchformlist = model.instances(0).selectNodes("/root/main/formlist[formprogflag = '-' or (formprogflag = 'PROG' and formcd = srcformcd and formkind = 'C' and formprognm != '-']");
  102. var totalRows = grd_formlist.rows - 1;
  103. if(totalRows < 1){
  104. return;
  105. }
  106. var forminfo = "";
  107. for(var idx = 0 ; idx < totalRows; idx++)
  108. {
  109. forminfo = srchformlist.item(idx);
  110. if(forminfo != null)
  111. {
  112. var formcd = forminfo.selectSingleNode("formcd").text;
  113. if(forminfo.selectSingleNode("formdegnseq").text == ""
  114. || forminfo.selectSingleNode("formdegnseq").text == "0")
  115. {
  116. grd_formlist.rowstyle(idx + 1, "data", "background-color") = "#FFCCFF";
  117. }
  118. }
  119. }
  120. grd_formlist.refresh();
  121. */
  122. }
  123. catch(e)
  124. {
  125. return;
  126. }
  127. }
  128. function fPreviewFormdegn()
  129. {
  130. var row = grd_formlist.row;
  131. var formcd = model.getValue("/root/main/formlist["+row+"]/formcd");
  132. var formprogflag = model.getValue("/root/main/formlist["+row+"]/formprogflag");
  133. var formxrwyn = model.getValue("/root/main/formlist["+row+"]/formxrwyn");
  134. var formdegnseq = model.getValue("/root/main/formlist["+row+"]/formdegnseq");
  135. model.copyNode("/root/main/forminfo/formmast", "/root/main/formlist["+row+"]");
  136. if(formprogflag == "MAIN" || formprogflag == "PROF" || formprogflag == "-" || formprogflag == "PROG")
  137. {
  138. if(formxrwyn == "Y" && formdegnseq != "")
  139. {
  140. setParameter("SPMRF05500_formcd", formcd);
  141. modal("SPMRF05500", 1,10, 10, "SPMRF05500", "", "");
  142. //open("SPMRF05500", "2", 0, 0, "SPMRF05500", "", "");
  143. }
  144. else
  145. messageBox("해당 서식은 저장되지", "E007");
  146. }
  147. else
  148. {
  149. messageBox("해당 서식은 " + formprogflag + " 유형 서식", "I009");
  150. return;
  151. }
  152. }
  153. function fShowCntl()
  154. {
  155. /*var ref = grd_pltte.attribute("nodeset");
  156. var degnitemno = model.getValue(ref + "[" + grd_pltte.row + "]/degnitemno");
  157. var degnitemkind = model.getvalue(ref + "[" + grd_pltte.row + "]/degnitemkind");
  158. var degncntrviewflag = model.getValue(ref + "[" + grd_pltte.row + "]/degncntrviewflag");
  159. var ctrl = canvas.window.document.controls(degnitemkind + "_" + degnitemseqno);
  160. if(ctrl != null)
  161. {
  162. if(degncntrviewflag == "A")
  163. ctrl.attribute("visibility") = "hidden";
  164. else
  165. ctrl.attribute("visibility") = "visible";
  166. ctrl.refresh();
  167. }*/
  168. }
  169. function fShowLbl()
  170. {
  171. /*var ref = grd_pltte.attribute("nodeset");
  172. var degnitemseqno = model.getValue(ref + "[" + grd_pltte.row + "]/degnitemseqno");
  173. var degnlblviewyn = model.getValue(ref + "[" + grd_pltte.row + "]/degnlblviewyn");
  174. var ctrl = canvas.window.document.controls("LBL_" + degnitemseqno);
  175. if(ctrl != null)
  176. {
  177. if(degnlblviewyn == "N")
  178. ctrl.attribute("visibility") = "hidden";
  179. else
  180. ctrl.attribute("visibility") = "visible";
  181. ctrl.refresh();
  182. }*/
  183. }
  184. function fSelectVallist()
  185. {
  186. var ref = grd_pltte.attribute("nodeset");
  187. var degnitemkind = model.getValue(ref + "[" + grd_pltte.row + "]/degnitemkind");
  188. var itemattrval = model.getValue(ref + "[" + grd_pltte.row + "]/itemattrval");
  189. if(degnitemkind != "RDO" && degnitemkind != "CMB" && degnitemkind != "CHK" && degnitemkind != "GRD" && degnitemkind != "GSU")
  190. return;
  191. if(degnitemkind == "GSU")
  192. {
  193. if(isSearchString(itemattrval, "axtype:COMBO") != true)
  194. {
  195. return;
  196. }
  197. }
  198. if(degnitemkind == "GRD")
  199. {
  200. modal("SPMRF01700_누적선택", 1, 100, 100);
  201. /*var grupcd = getParameter("grupcd");
  202. var grupnm = getParameter("grupnm");
  203. model.setValue(ref + "[" + grd_pltte.row + "]/valgrupcd", grupcd);
  204. model.setValue(ref + "[" + grd_pltte.row + "]/valgrupnm", grupnm);
  205. grd_pltte.refresh();*/
  206. }
  207. else
  208. {
  209. //데이타갱신
  210. modal("SPMRF01600_밸류리스트선택", 1, 100, 100);
  211. var grupcd = getParameter("grupcd");
  212. var grupnm = getParameter("grupnm");
  213. if(grupcd != "")
  214. {
  215. model.setValue(ref + "[" + grd_pltte.row + "]/valgrupcd", grupcd);
  216. model.setValue(ref + "[" + grd_pltte.row + "]/valgrupnm", grupnm);
  217. grd_pltte.refresh();
  218. setParameter("grupcd", "");
  219. setParameter("grupnm", "");
  220. }
  221. }
  222. }
  223. function fSelectUnit()
  224. {
  225. var ref = grd_pltte.attribute("nodeset");
  226. var degnitemkind = model.getValue(ref + "[" + grd_pltte.row + "]/degnitemkind");
  227. var degnattrval = model.getValue(ref + "[" + grd_pltte.row + "]/degnattrval");
  228. if(degnitemkind == "STX" || degnitemkind == "SSU" || degnitemkind == "CMB")
  229. {
  230. if(degnitemkind == "CMB")
  231. {
  232. var itemattrval = model.getValue(ref + "[" + grd_pltte.row + "]/itemattrval");
  233. if(isSearchString(itemattrval, "extn") == true)
  234. {
  235. var ret = messageBox("단위를 설정하려면 확장컨트롤을 삭제하여야 합니다.", "Q001");
  236. if(ret == "6")
  237. {
  238. fDelExtnStx();
  239. }
  240. else
  241. {
  242. return;
  243. }
  244. }
  245. }
  246. modal("SPMRF01500_단위선택",1, 100, 100);
  247. //데이터갱신
  248. var ref = grd_pltte.attribute("nodeset");
  249. var unitcd = getParameter("unitcd");
  250. var unitnm = getParameter("unitnm");
  251. model.setValue(ref + "[" + grd_pltte.row + "]/unitcd", unitcd);
  252. model.setValue(ref + "[" + grd_pltte.row + "]/unitnm", unitnm);
  253. grd_pltte.refresh();
  254. }
  255. //화면갱신
  256. /*var degnitemno = model.getValue(ref + "[" + grd_pltte.row + "]/degnitemno");
  257. var ctrlid = "UNIT_" + degnitemno;
  258. var ctrl = canvas.window.document.controls(ctrlid);
  259. if(ctrl == null)
  260. return;
  261. ctrl.attribute("text") = unitnm;
  262. ctrl.refresh();*/
  263. }
  264. function fSelectForm()
  265. {
  266. if(!isDataCell())
  267. return;
  268. iRow = grd_formlist.row;
  269. if(iRow < 1){
  270. return;
  271. }
  272. model.makeNode("/root/send/reqdata/formcd");
  273. model.setValue("/root/send/reqdata/formcd", model.getValue("/root/main/formlist[" + iRow + "]/formcd") );
  274. submit("TRMRF07002");
  275. submit("TRMRF07003");
  276. model.removenode("/root/main/forminfo");
  277. model.makeNode("/root/main/forminfo");
  278. model.refresh();
  279. btn_master.selected = "false";
  280. btn_design.selected = "true";
  281. model.toggle("case2");
  282. }
  283. function fSelectionDsgnForm()
  284. {
  285. if( grd_dsgnlist.row < grd_dsgnlist.fixedRows )
  286. return false;
  287. var iRow = grd_dsgnlist.row;
  288. if(iRow < 1){
  289. return;
  290. }
  291. if(model.getValue("/root/main/dsgnlist[" + iRow + "]/formdegnseq") == "")
  292. return;
  293. model.removenode("/root/main/forminfo");
  294. model.makeNode("/root/main/forminfo");
  295. model.refresh();
  296. //model.setValue("/root/send/formdegnseqno", model.getValue("/root/main/formlist[" + iRow + "]/valu"));
  297. model.makeValue("/root/send/req/formcd", "");
  298. model.makeValue("/root/send/req/formdegnseq", model.getValue("/root/main/dsgnlist[" + iRow + "]/formdegnseq"));
  299. model.makeValue("/root/send/req/extnunitformlistyn", "N");
  300. model.makeValue("/root/send/req/cashedformdegnseq", "");
  301. model.makeValue("/root/send/req/sysformrecdt", model.getValue("/root/main/dsgnlist[" + iRow + "]/formdegnfromdt"));
  302. model.makeValue("/root/send/req/mode", "D");
  303. submit("TRMRF07004");
  304. var colLevl = grd_pltte.colref("degnitemlevlno");
  305. btn_collapsed.attribute("background-image") = "..\\..\\..\\com\\commonweb\\images\\tree_plus.gif";
  306. setTree(grd_pltte, colLevl, grd_pltte.colref("degnitemcd"), true);
  307. }
  308. var g_pageInfo = new PAGEINFO();
  309. var openWindow;
  310. function fOnCreate(viewerobj)
  311. {
  312. return new PAGEINFO(viewerobj);
  313. }
  314. function fAppDegn(mode)
  315. {
  316. if(mode == null)
  317. mode = "design";
  318. //item정보 카피
  319. var pageInfo = fOnCreate(openWindow);
  320. copyNode(openWindow.model, model, pageInfo.forminfoRef, pageInfo.forminfoRef);
  321. openWindow.window.javascript.fCreateDegnBySelfInfo(pageInfo, openWindow, mode);
  322. setTree(grd_pltte, grd_pltte.colref("degnitemlevlno"), grd_pltte.colref("degnitemcd"), false);
  323. }
  324. function fSetDegnCmpltYN(check) {
  325. }
  326. function fSetDegnItemStyle(ctrl, attrName, attrValue, bEmpty) {
  327. }
  328. function fPopViewer(mode) {
  329. button1.dispatch("DOMActivate");
  330. model.makeValue("/root/temp/mode", mode);
  331. open("SSMRF01100", 1, 0, 0, "tempWin", "", "");
  332. openWindow = window.children("tempWin");
  333. }