SMRFE00200.xjs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/* ---------------------------------------------------------------------
  3. *
  4. * SMRFE00200_자산변동사항 관리
  5. *
  6. * - Version :
  7. * 1) : Ver.1.00.00
  8. * : Create By
  9. * : 2010.03.08
  10. * //이현민 20100308
  11. ---------------------------------------------------------------------- */
  12. var selectedTab = "MultiEdit";
  13. function fInitialize()
  14. {
  15. model.resetInstanceNode("/root/send");
  16. misfGridInit(grd_fixasetlist);
  17. misfGridInit(grd_chgnhistlist);
  18. misfGridInit(grd_histlist); //이현민추가-20100224
  19. model.refresh();
  20. rszfGoodFlagListByPgmGubn(cmb_goodflag_search,"2","N");
  21. addComboItem( "cmb_goodflag_search", "- 전 체 -", "", "above" );
  22. misfComboComCdListMulti("C0048,R0044,R0044,R0044,R0047,R0035,R0044,R0044,R0044",
  23. "cmb_instcd,grd_fixasetexcellist.histupdtflag,grd_chgnhistlist.updtflag,cmb_cron_updtflag,grd_chgnhistlist.curncyunit,grd_fixasetlist.prodplce,chk_dsplflag_search,grd_histlist.updtflag,grd_fixasetlist.dsplflag");
  24. addComboItem( "chk_dsplflag_search", "전체", "A", "below" );
  25. chk_dsplflag_search.value = "A";
  26. // 대분류 코드 콤보 설정.
  27. rszfLMSComboList("FIX_ALL", "", "", "cmb_lrgcd_search", "", "L", "Y", "Y");
  28. rszfLMSComboList("FIX_ALL", "ALL", "", "cmb_mdlcd_search", "", "M", "Y", "Y");
  29. cmb_goodflag_search.dispatch("xforms-value-changed");
  30. //물품구분에 따른 그리드 출력 폼 설정.
  31. fGridGoodflagCheck();
  32. //물품구분 설정 (비품)
  33. model.setValue(cmb_instcd.attribute("ref"), getUserInfo("dutplceinstcd")); // 기관 설정
  34. misfMsterDetailSet(grd_chgnhistlist, null, "TRRFE00201", "Y");
  35. misfMsterDetailSet(grd_fixasetlist, null, "TRRFC00202", "N");
  36. grd_chgnhistlist.selectionmode = "list";
  37. grd_fixasetlist.selectionMode = "list";
  38. btn_multi.dispatch("DOMActivate");
  39. model.refresh();
  40. }
  41. function fGridGoodflagCheck()
  42. {
  43. if(cmb_goodflag_search.value == 'EQ') {
  44. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflaghngnm")) = true;
  45. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflagengnm")) = false;
  46. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("forgncurncyamt")) = false;
  47. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("curncyunit")) = false;
  48. } else {
  49. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflaghngnm")) = false;
  50. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflagengnm")) = true;
  51. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("forgncurncyamt")) = true;
  52. grd_fixasetlist.colHidden(grd_fixasetlist.colRef("curncyunit")) = true;
  53. }
  54. grd_fixasetlist.refresh();
  55. }
  56. function fsearch()
  57. {
  58. if(!isRequiredControls("cmb_instcd")) return;
  59. model.makeValue("/root/send/fixasetlist/queryflag", " ");
  60. //misfGridInit(grd_chgnhistlist);
  61. //misfGridInit(grd_fixasetlist);
  62. misfGridInit(grd_histlist);
  63. if(submit("TRRFC00202",false)) {
  64. var gridNode = instance1.selectNodes(grd_fixasetlist.nodeset);
  65. var resultNode = instance1.selectNodes("/root/temp/searchresult/fixaset/fixasetlist");
  66. if(model.getValue(chk_addsearch.attribute("ref")) == "Y" && gridNode != null && gridNode.length > 0) {
  67. if(resultNode != null && resultNode.length > 0) {
  68. for(var i=0; i<resultNode.length; i++) {
  69. var selNode = resultNode.item(i);
  70. var fixasetcd = selNode.selectSingleNode("fixasetcd").text;
  71. var checkNode = instance1.selectNodes(grd_fixasetlist.nodeset + "[fixasetcd='" + fixasetcd + "']");
  72. if(checkNode == null || checkNode.length < 1) {
  73. copyNodesetType(grd_fixasetlist.nodeset, "/root/temp/searchresult/fixaset/fixasetlist[" + (i+1) + "]","after");
  74. }
  75. }
  76. }
  77. } else {
  78. misfGridInit(grd_fixasetlist); // 고정자산 List
  79. if(resultNode != null && resultNode.length > 0) {
  80. model.makeNode(grd_fixasetlist.nodeset);
  81. copyNodesetType(grd_fixasetlist.nodeset, "/root/temp/searchresult/fixaset/fixasetlist","replace");
  82. }
  83. }
  84. grd_fixasetlist.refresh();
  85. if(grd_fixasetlist.rows != grd_fixasetlist.fixedRows)
  86. {
  87. grd_fixasetlist.row = grd_fixasetlist.fixedRows;
  88. grd_fixasetlist.dispatch("onrowchanged");
  89. grd_fixasetlist.select(grd_fixasetlist.row, grd_fixasetlist.colRef("goodflaghngnm")) = true;
  90. }
  91. }
  92. }
  93. function fsearch_excel()
  94. {
  95. if(!isRequiredControls("cmb_instcd")) return;
  96. if(!isRequiredControls("cmb_goodflag_search")) return;
  97. model.makeValue("/root/send/fixasetlist/queryflag", "H");
  98. misfGridInit(grd_chgnhistlist);
  99. submit("TRRFC00209");
  100. model.refresh();
  101. }
  102. function fSave()
  103. {
  104. var updtdata = getGridUpdateData(grd_chgnhistlist);
  105. if (updtdata == "")
  106. {
  107. messageBox("변경된 데이터가","I004");
  108. return;
  109. }
  110. if(!checkKeyColumn("grd_chgnhistlist")) return;
  111. misfSave("TXRFE00201");
  112. //btn_search.dispatch("DOMActivate");
  113. if (model.getValue(gvErrorMsgPath + "/type") != "error" ) btn_search.dispatch("DOMActivate");
  114. }
  115. // 부모 윈도우에서 넘겨 받은 값을 컨트롤에 세팅
  116. function fGetdata()
  117. {
  118. var sCheck = "";
  119. var sInstcd = model.getValue("/root/temp/instcd");
  120. var sFixasetcd = model.getValue("/root/temp/fixasetcd");
  121. var sInstallplcecd = model.getValue("/root/temp/installplcecd");
  122. var sInstallplcenm = model.getValue("/root/temp/installplcenm");
  123. var sGoodspec = model.getValue("/root/temp/goodspec");
  124. var sMngtno = model.getValue("/root/temp/mngtno");
  125. var sCntrdeptcd = model.getValue("/root/temp/cntrdeptcd");
  126. var sCntrdeptnm = model.getValue("/root/temp/cntrdeptnm");
  127. var sPossndd = model.getValue("/root/temp/possndd");
  128. var sPossnamt = model.getValue("/root/temp/possnamt");
  129. if(sInstcd != "")
  130. cmb_instcd.value = model.getValue("/root/temp/instcd");
  131. if(sFixasetcd != "")
  132. {
  133. ipt_fixasetcd.value = model.getValue("/root/temp/fixasetcd");
  134. model.setValue(cmb_goodflag_search.attribute("ref"), model.getValue("/root/temp/fixasetcd").substr(0,1) );
  135. ipt_fixasetcd.dispatch("xforms-value-changed");
  136. }
  137. // if(sInstallplcecd != "")
  138. // ipt_installplcecd.value = model.getValue("/root/temp/installplcecd");
  139. //
  140. // if(sInstallplcenm != "")
  141. // opt_installplcenm.value = model.getValue("/root/temp/installplcenm");
  142. //
  143. // if(sGoodspec != "")
  144. // ipt_goodspec.value = model.getValue("/root/temp/goodspec");
  145. //
  146. // if(sMngtno != "")
  147. // ipt_mngtno.value = model.getValue("/root/temp/mngtno");
  148. //
  149. // if(sCntrdeptcd != "")
  150. // ipt_cntrdeptcd.value = model.getValue("/root/temp/cntrdeptcd");
  151. //
  152. // if(sCntrdeptnm != "")
  153. // opt_cntrdeptcd.value = model.getValue("/root/temp/cntrdeptnm");
  154. //
  155. // if(sPossndd != "")
  156. // ipt_possndd.value = model.getValue("/root/temp/possndd");
  157. //
  158. // if(sPossnamt != "")
  159. // ipt_possnamt.value = model.getValue("/root/temp/possnamt");
  160. //
  161. // if(sMngtno == "")
  162. if(sFixasetcd != "")
  163. btn_search.dispatch("DOMActivate");
  164. }
  165. function fViewListSetting()
  166. {
  167. grp_setlist.visible = true;
  168. }
  169. function fSetSelectList()
  170. {
  171. var updtdd = model.getValue("/root/temp/cron/updtdd");
  172. var updtflag = model.getValue("/root/temp/cron/updtflag");
  173. var mngtdeptcd = model.getValue("/root/temp/cron/mngtdeptcd");
  174. var mngtdeptnm = model.getValue("/root/temp/cron/mngtdeptnm");
  175. var installplcecd = model.getValue("/root/temp/cron/installplcecd");
  176. var installplcenm = model.getValue("/root/temp/cron/installplcenm");
  177. for(var idx = 0; idx<grd_chgnhistlist.selectedRows; idx++){
  178. var sel_row = grd_chgnhistlist.selectedRow(idx);
  179. if(updtdd != "") {
  180. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("updtdd")) = updtdd;
  181. }
  182. if(updtflag != "") {
  183. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("updtflag")) = updtflag;
  184. }
  185. if(mngtdeptcd != "") {
  186. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("upddeptcd")) = mngtdeptcd;
  187. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("upddeptnm")) = mngtdeptnm;
  188. }
  189. if(installplcecd != "") {
  190. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("chnginstallplcecd")) = installplcecd;
  191. grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("installplcenm")) = installplcenm;
  192. }
  193. }
  194. grd_chgnhistlist.disabled = false;
  195. grd_chgnhistlist.refresh();
  196. grp_setlist.visible = false;
  197. }
  198. function fsetGubun_set(pGubun)
  199. {
  200. for (var currow = grd_chgnhistlist.fixedRows ; currow < grd_chgnhistlist.rows; currow++) {
  201. model.setValue(grd_chgnhistlist.nodeset + "[" + currow + "]/updtflag" ,pGubun);
  202. }
  203. }
  204. /* -------------------------------------------------- */
  205. //mngtdeptcd
  206. function fSetMainCustLastInstallplce() {
  207. model.setValue(opt_popcond.attribute("ref"),"installplce");
  208. model.setValue(opt_poptitle.attribute("ref"), "설치장소를 선택해 주세요");
  209. //rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03701" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  210. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRFE00201" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  211. model.refresh();
  212. fSetAllApply_a(grd_fixasetlist,"installplcecd,installplcenm", model.getValue(opt_popinputcd.attribute("ref")));
  213. }
  214. function fSetMainCustLastMngtdept() {
  215. //SPRPZ00200_부서코드HELP.xrw
  216. //TRRPZ00201
  217. model.setValue(opt_popcond.attribute("ref"),"mngtdept");
  218. model.setValue(opt_poptitle.attribute("ref"), "사용부서를 선택해 주세요");
  219. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRFE00201" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  220. model.refresh();
  221. fSetAllApply_a(grd_fixasetlist,"mngtdeptcd,mngtdeptnm", model.getValue(opt_popinputcd.attribute("ref")));
  222. }
  223. function fSetAllApply_a(f_grid, f_id , f_value) {
  224. if(f_id == null || f_id.length == 0 || f_value == null || f_value.length == 0 )return;
  225. var f_selid = f_id.split(",");
  226. var f_selvalue = f_value.split(",");
  227. for(currow = 0 ; currow < f_grid.selectedRows; currow++)
  228. {
  229. for (var k = 0; k < f_selid.length; k++) {
  230. if(f_grid.colRef(f_selid[k]) != -1)
  231. {
  232. if(model.getValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k]) != f_selvalue[k])
  233. {
  234. //model.setValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k] ,f_selvalue[k]);
  235. f_grid.valueMatrix( (f_grid.selectedRow(currow)- f_grid.fixedRows + 1), f_grid.colRef( f_selid[k] ) ) = f_selvalue[k];
  236. if(f_grid.rowStatus(f_grid.selectedRow(currow)) == "0")f_grid.rowStatus(f_grid.selectedRow(currow)) = "2";
  237. }
  238. }
  239. }
  240. }
  241. }
  242. function fSearchHistory() {
  243. misfGridInit(grd_histlist);
  244. grd_fixasetlist.dispatch("onmouseup");
  245. model.copyNode("/root/send/rfchcgmt_send", "/root/main/list/fixaset/fixasetlist["+grd_fixasetlist.row + "]");
  246. model.makeValue("/root/send/rfchcgmt_send/dsplflag", model.getValue(chk_dsplflag_search.attribute("ref")));
  247. if(submit("TRRFE00202",false)) {
  248. grd_histlist.refresh();
  249. }
  250. }]]></Script>