SMRFE00200.js 10 KB

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