123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- /* ---------------------------------------------------------------------
- *
- * SMRFE00200_자산변동사항 관리
- *
- * - Version :
- * 1) : Ver.1.00.00
- * : Create By
- * : 2010.03.08
- * //이현민 20100308
- ---------------------------------------------------------------------- */
- var selectedTab = "MultiEdit";
- function fInitialize()
- {
- model.resetInstanceNode("/root/send");
- misfGridInit(grd_fixasetlist);
- misfGridInit(grd_chgnhistlist);
- misfGridInit(grd_histlist); //이현민추가-20100224
- model.refresh();
- rszfGoodFlagListByPgmGubn(cmb_goodflag_search,"2","N");
- addComboItem( "cmb_goodflag_search", "- 전 체 -", "", "above" );
- misfComboComCdListMulti("C0048,R0044,R0044,R0044,R0047,R0035,R0044,R0044,R0044",
- "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");
- addComboItem( "chk_dsplflag_search", "전체", "A", "below" );
- chk_dsplflag_search.value = "A";
- // 대분류 코드 콤보 설정.
- rszfLMSComboList("FIX_ALL", "", "", "cmb_lrgcd_search", "", "L", "Y", "Y");
- rszfLMSComboList("FIX_ALL", "ALL", "", "cmb_mdlcd_search", "", "M", "Y", "Y");
- cmb_goodflag_search.dispatch("xforms-value-changed");
-
- //물품구분에 따른 그리드 출력 폼 설정.
- fGridGoodflagCheck();
- //물품구분 설정 (비품)
- model.setValue(cmb_instcd.attribute("ref"), getUserInfo("dutplceinstcd")); // 기관 설정
-
- misfMsterDetailSet(grd_chgnhistlist, null, "TRRFE00201", "Y");
- misfMsterDetailSet(grd_fixasetlist, null, "TRRFC00202", "N");
-
- grd_chgnhistlist.selectionmode = "list";
- grd_fixasetlist.selectionMode = "list";
-
- btn_multi.dispatch("DOMActivate");
- model.refresh();
- }
- function fGridGoodflagCheck()
- {
- if(cmb_goodflag_search.value == 'EQ') {
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflaghngnm")) = true;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflagengnm")) = false;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("forgncurncyamt")) = false;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("curncyunit")) = false;
- } else {
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflaghngnm")) = false;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("goodflagengnm")) = true;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("forgncurncyamt")) = true;
- grd_fixasetlist.colHidden(grd_fixasetlist.colRef("curncyunit")) = true;
- }
- grd_fixasetlist.refresh();
- }
- function fsearch()
- {
- if(!isRequiredControls("cmb_instcd")) return;
-
- model.makeValue("/root/send/fixasetlist/queryflag", " ");
- //misfGridInit(grd_chgnhistlist);
-
- //misfGridInit(grd_fixasetlist);
- misfGridInit(grd_histlist);
-
- if(submit("TRRFC00202",false)) {
-
- var gridNode = instance1.selectNodes(grd_fixasetlist.nodeset);
- var resultNode = instance1.selectNodes("/root/temp/searchresult/fixaset/fixasetlist");
-
- if(model.getValue(chk_addsearch.attribute("ref")) == "Y" && gridNode != null && gridNode.length > 0) {
- if(resultNode != null && resultNode.length > 0) {
- for(var i=0; i<resultNode.length; i++) {
- var selNode = resultNode.item(i);
- var fixasetcd = selNode.selectSingleNode("fixasetcd").text;
- var checkNode = instance1.selectNodes(grd_fixasetlist.nodeset + "[fixasetcd='" + fixasetcd + "']");
- if(checkNode == null || checkNode.length < 1) {
- copyNodesetType(grd_fixasetlist.nodeset, "/root/temp/searchresult/fixaset/fixasetlist[" + (i+1) + "]","after");
- }
- }
- }
- } else {
- misfGridInit(grd_fixasetlist); // 고정자산 List
- if(resultNode != null && resultNode.length > 0) {
- model.makeNode(grd_fixasetlist.nodeset);
- copyNodesetType(grd_fixasetlist.nodeset, "/root/temp/searchresult/fixaset/fixasetlist","replace");
- }
- }
-
- grd_fixasetlist.refresh();
-
- if(grd_fixasetlist.rows != grd_fixasetlist.fixedRows)
- {
- grd_fixasetlist.row = grd_fixasetlist.fixedRows;
- grd_fixasetlist.dispatch("onrowchanged");
- grd_fixasetlist.select(grd_fixasetlist.row, grd_fixasetlist.colRef("goodflaghngnm")) = true;
- }
- }
- }
- function fsearch_excel()
- {
- if(!isRequiredControls("cmb_instcd")) return;
- if(!isRequiredControls("cmb_goodflag_search")) return;
-
- model.makeValue("/root/send/fixasetlist/queryflag", "H");
- misfGridInit(grd_chgnhistlist);
- submit("TRRFC00209");
-
- model.refresh();
- }
- function fSave()
- {
- var updtdata = getGridUpdateData(grd_chgnhistlist);
-
- if (updtdata == "")
- {
- messageBox("변경된 데이터가","I004");
- return;
- }
-
- if(!checkKeyColumn("grd_chgnhistlist")) return;
-
- misfSave("TXRFE00201");
- //btn_search.dispatch("DOMActivate");
- if (model.getValue(gvErrorMsgPath + "/type") != "error" ) btn_search.dispatch("DOMActivate");
- }
- // 부모 윈도우에서 넘겨 받은 값을 컨트롤에 세팅
- function fGetdata()
- {
- var sCheck = "";
- var sInstcd = model.getValue("/root/temp/instcd");
- var sFixasetcd = model.getValue("/root/temp/fixasetcd");
- var sInstallplcecd = model.getValue("/root/temp/installplcecd");
- var sInstallplcenm = model.getValue("/root/temp/installplcenm");
- var sGoodspec = model.getValue("/root/temp/goodspec");
- var sMngtno = model.getValue("/root/temp/mngtno");
- var sCntrdeptcd = model.getValue("/root/temp/cntrdeptcd");
- var sCntrdeptnm = model.getValue("/root/temp/cntrdeptnm");
- var sPossndd = model.getValue("/root/temp/possndd");
- var sPossnamt = model.getValue("/root/temp/possnamt");
-
- if(sInstcd != "")
- cmb_instcd.value = model.getValue("/root/temp/instcd");
-
- if(sFixasetcd != "")
- {
- ipt_fixasetcd.value = model.getValue("/root/temp/fixasetcd");
- model.setValue(cmb_goodflag_search.attribute("ref"), model.getValue("/root/temp/fixasetcd").substr(0,1) );
- ipt_fixasetcd.dispatch("xforms-value-changed");
- }
-
- // if(sInstallplcecd != "")
- // ipt_installplcecd.value = model.getValue("/root/temp/installplcecd");
- //
- // if(sInstallplcenm != "")
- // opt_installplcenm.value = model.getValue("/root/temp/installplcenm");
- //
- // if(sGoodspec != "")
- // ipt_goodspec.value = model.getValue("/root/temp/goodspec");
- //
- // if(sMngtno != "")
- // ipt_mngtno.value = model.getValue("/root/temp/mngtno");
- //
- // if(sCntrdeptcd != "")
- // ipt_cntrdeptcd.value = model.getValue("/root/temp/cntrdeptcd");
- //
- // if(sCntrdeptnm != "")
- // opt_cntrdeptcd.value = model.getValue("/root/temp/cntrdeptnm");
- //
- // if(sPossndd != "")
- // ipt_possndd.value = model.getValue("/root/temp/possndd");
- //
- // if(sPossnamt != "")
- // ipt_possnamt.value = model.getValue("/root/temp/possnamt");
- //
- // if(sMngtno == "")
-
- if(sFixasetcd != "")
- btn_search.dispatch("DOMActivate");
- }
- function fViewListSetting()
- {
- grp_setlist.visible = true;
- }
- function fSetSelectList()
- {
- var updtdd = model.getValue("/root/temp/cron/updtdd");
- var updtflag = model.getValue("/root/temp/cron/updtflag");
- var mngtdeptcd = model.getValue("/root/temp/cron/mngtdeptcd");
- var mngtdeptnm = model.getValue("/root/temp/cron/mngtdeptnm");
- var installplcecd = model.getValue("/root/temp/cron/installplcecd");
- var installplcenm = model.getValue("/root/temp/cron/installplcenm");
-
- for(var idx = 0; idx<grd_chgnhistlist.selectedRows; idx++){
- var sel_row = grd_chgnhistlist.selectedRow(idx);
-
- if(updtdd != "") {
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("updtdd")) = updtdd;
- }
- if(updtflag != "") {
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("updtflag")) = updtflag;
- }
- if(mngtdeptcd != "") {
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("upddeptcd")) = mngtdeptcd;
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("upddeptnm")) = mngtdeptnm;
- }
- if(installplcecd != "") {
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("chnginstallplcecd")) = installplcecd;
- grd_chgnhistlist.valueMatrix(sel_row,grd_chgnhistlist.colRef("installplcenm")) = installplcenm;
- }
- }
- grd_chgnhistlist.disabled = false;
- grd_chgnhistlist.refresh();
- grp_setlist.visible = false;
- }
- function fsetGubun_set(pGubun)
- {
- for (var currow = grd_chgnhistlist.fixedRows ; currow < grd_chgnhistlist.rows; currow++) {
- model.setValue(grd_chgnhistlist.nodeset + "[" + currow + "]/updtflag" ,pGubun);
- }
- }
- /* -------------------------------------------------- */
- //mngtdeptcd
- function fSetMainCustLastInstallplce() {
- model.setValue(opt_popcond.attribute("ref"),"installplce");
- model.setValue(opt_poptitle.attribute("ref"), "설치장소를 선택해 주세요");
- //rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03701" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
- rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRFE00201" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
- model.refresh();
- fSetAllApply_a(grd_fixasetlist,"installplcecd,installplcenm", model.getValue(opt_popinputcd.attribute("ref")));
- }
- function fSetMainCustLastMngtdept() {
- //SPRPZ00200_부서코드HELP.xrw
- //TRRPZ00201
- model.setValue(opt_popcond.attribute("ref"),"mngtdept");
- model.setValue(opt_poptitle.attribute("ref"), "사용부서를 선택해 주세요");
- rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRFE00201" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
- model.refresh();
- fSetAllApply_a(grd_fixasetlist,"mngtdeptcd,mngtdeptnm", model.getValue(opt_popinputcd.attribute("ref")));
- }
- function fSetAllApply_a(f_grid, f_id , f_value) {
- if(f_id == null || f_id.length == 0 || f_value == null || f_value.length == 0 )return;
-
- var f_selid = f_id.split(",");
- var f_selvalue = f_value.split(",");
- for(currow = 0 ; currow < f_grid.selectedRows; currow++)
- {
- for (var k = 0; k < f_selid.length; k++) {
- if(f_grid.colRef(f_selid[k]) != -1)
- {
- if(model.getValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k]) != f_selvalue[k])
- {
- //model.setValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k] ,f_selvalue[k]);
- f_grid.valueMatrix( (f_grid.selectedRow(currow)- f_grid.fixedRows + 1), f_grid.colRef( f_selid[k] ) ) = f_selvalue[k];
- if(f_grid.rowStatus(f_grid.selectedRow(currow)) == "0")f_grid.rowStatus(f_grid.selectedRow(currow)) = "2";
- }
- }
- }
- }
- }
- function fSearchHistory() {
- misfGridInit(grd_histlist);
-
- grd_fixasetlist.dispatch("onmouseup");
- model.copyNode("/root/send/rfchcgmt_send", "/root/main/list/fixaset/fixasetlist["+grd_fixasetlist.row + "]");
- model.makeValue("/root/send/rfchcgmt_send/dsplflag", model.getValue(chk_dsplflag_search.attribute("ref")));
-
- if(submit("TRRFE00202",false)) {
- grd_histlist.refresh();
- }
- }
|