/* --------------------------------------------------------------------- SMRSC0100_»ç¿ëÀÚº°°ü¸®¹°Ç°±ÇÇÑ.xrw (SMRSC0100.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By Francis Choi : 2015.05.02 ---------------------------------------------------------------------- */ var xAuth = !(checkAuth("X")); var pAuth = !(checkAuth("P")); var DataPath = "/root/main/RscmggbnEmpData"; var MainPath = "/root/main/RscmggbnLists/rscmggbnlist"; var ListsPath = "/root/main/RscmggbnEmpLists"; var ListPath = "/root/main/RscmggbnEmpLists/rscmggbnemplist"; var HidePath = "/root/WorkData/HideData"; var TreePath = "/root/main/RscmgubnLists/TreeList"; var WorkPath = "/root/init/WorkInit"; var CompPath = "/root/init/CompareInit"; var MIS_ADM1 = "20902001"; // MIS ´ã´çÀÚ[CHR] var MIS_ADM2 = "10109410"; // MIS ´ã´çÀÚ[LHM] // -------------------------------------------------- // TreeÁ¤º¸ °¡Á®¿À±â // -------------------------------------------------- function fInit() { fInitialize(); // grp_lag.disabled = true; // grp_dept.disabled = true; // grp_mdl.disabled = true; // grp_sml.disabled = true; // grp_anct.disabled = true; // btn_save.disabled = !(checkAuth("X")); // btn_cdclssysrgst.disabled = !(checkAuth("P")); var vInstCd = getUserInfo("dutplceinstcd"); // ±â°üÄÚµå model.setValue(HidePath + "/instcd" , vInstCd ); // ±â°üÄÚµå model.setValue(HidePath + "/deptcd" , getUserInfo("dutplcecd") ); // ºÎ¼­ÄÚµå model.setValue(HidePath + "/deptnm" , getUserInfo("dutplcenm") ); // ºÎ¼­¸í var vUserId = getUserInfo("userid"); // ±â°üÄÚµå if ( (vUserId == MIS_ADM1) ||(vUserId == MIS_ADM2) ) cmb_instcd.disabled = false; model.removenode("/root/send"); model.makeValue("/root/send/goodflag","" ); // ¸Þ½ÃÁöÁ¾·ù model.makeValue("/root/send/treeflag","A" ); // Æ®¸®±¸ºÐ T: TREE, L: LARGE // model.makeValue("/root/send/emplno" ,getUserInfo("userid")); // »ç¿ø¹øÈ£ submit("TRRSC05104"); // Tree Data Á¤º¸¸¦ °¡Á®¿Â´Ù. fRscmggbnTree(); model.refresh(); } // -------------------------------------------------- // »ç¿ëÀÚº°°ü¸®¹°Ç°±ÇÇѸ¦ TREE Á¶È¸ // -------------------------------------------------- function fRscmggbnTree() { model.removenode("/root/send"); model.makeValue("/root/send/viewcls",model.getValue(HidePath + "/viewcls")); // Æ®¸®±¸¼º±¸ºÐ E:»ç¹ø,G:¹°Ç°±¸ºÐ if( model.getValue( cmb_instcd.attribute("ref") ) != null && model.getValue( cmb_instcd.attribute("ref") ) != "" ) model.makeValue("/root/send/instcd" ,model.getValue( cmb_instcd.attribute("ref") ) ); // ±â°üÄÚµå else model.makeValue("/root/send/instcd" ,getUserInfo("dutplceinstcd") ); // ±â°üÄÚµå if( model.getValue( ipt_deptcd.attribute("ref") ) != null && model.getValue( ipt_deptcd.attribute("ref") ) != "" ) model.makeValue("/root/send/deptcd" ,model.getValue( ipt_deptcd.attribute("ref") ) ); // ºÎ¼­ÄÚµå else model.makeValue("/root/send/deptcd" ,getUserInfo("dutplcecd" ) ); // ºÎ¼­ÄÚµå submit("TRRSC01005"); // Tree Data Á¤º¸¸¦ °¡Á®¿Â´Ù. trv_setcode.refresh(); } // -------------------------------------------------- // Tree Click // -------------------------------------------------- function fTreeClick(pIdx) { var OpCode = ""; var OpDepth = ""; var vDepth = ""; var vGoodflag = ""; var vGoodflagnm = ""; var vLrgcd = ""; var vLrgnm = ""; var vMdlcd = ""; var vMdlnm = ""; var vSmlcd = ""; var vSmlnm = ""; var vMainmngtdeptcd = ""; var vMainmngtdeptnm = ""; var vWinacnt = ""; var vWinacntnm = ""; var vAmtacnt = ""; var vAmtacntnm = ""; var Idx = pIdx + 1; bbt_append.disabled = false; bbt_delete.disabled = false; model.setValue(DataPath + "/jobcls" , "I"); model.setValue(DataPath + "/updateyn" , "N"); var sDepth = model.getValue(MainPath +"["+Idx+"]/depth"); var vCodeCd = model.getValue(MainPath +"["+Idx+"]/codecd"); var vCodeNm = model.getValue(MainPath +"["+Idx+"]/codenm"); var vBaseCd = model.getValue(MainPath +"["+Idx+"]/basecd"); btn_save.disabled = true; bbt_delete.disabled = true; // cmb_instcd.disabled = true; cmb_emplno.disabled = true; btn_winpsn.disabled = true; model.setValue(DataPath + "/depth" , sDepth); if (sDepth == "1") { model.setValue(DataPath + "/instcd" , vCodeCd); bbt_append.disabled = false; cmb_emplno.disabled = false; btn_winpsn.disabled = false; return; } // model.setValue(DataPath + "/jobcls" , "U"); model.setValue(DataPath + "/depth" , sDepth); if (sDepth == "2") { model.setValue(DataPath + "/emplno" , vCodeCd); model.setValue(DataPath + "/emplnm" , vCodeNm); } // if (sDepth == "3") { model.setValue(DataPath + "/emplno" , model.getValue(MainPath +"["+Idx+"]/emplno")); model.setValue(DataPath + "/emplnm" , model.getValue(MainPath +"["+Idx+"]/usernm")); } model.removenode("/root/send"); model.makeValue("/root/send/instcd" ,model.getValue(HidePath+"/instcd" )); // "±â°üÄÚµå model.makeValue("/root/send/emplno" ,model.getValue(DataPath+"/emplno" )); // "»ç¿ø¹øÈ£ submit("TRRSC01006"); // Tree Data Á¤º¸¸¦ °¡Á®¿Â´Ù. // btn_save.disabled = false; // bbt_delete.disabled = false; trv_empdata.rebuild(); // grp_disp.refresh(); } // -------------------------------------------------- // Append Data // -------------------------------------------------- function fAppendData() { var sDepth = model.getValue(DataPath + "/depth"); bbt_append.disabled = true; if (sDepth == "") { alert("»óÀ§ ºÐ·ù¸¦ ¼±Åà ÇϽʽÿä!! "); return; } // if (model.getValue(DataPath + "/updateyn")){ if (messageBox("µ¥ÀÌÅͰ¡ º¯°æ µÇ¾ú½À´Ï´Ù. ", "Q003") == "2") return; } // model.removeNode(ListsPath); model.setValue(DataPath + "/emplno" , "" ); model.setValue(DataPath + "/emplnm" , "" ); model.setValue(DataPath + "/updateyn" , "Y"); btn_save.disabled = false; bbt_delete.disabled = true; cmb_emplno.disabled = false; grp_disp.refresh(); } // // º¯°æ¿©ºÎ Check // function fCheckEdit(){ var EditChk = true; if ( model.getValue(WorkPath + "/depth" ) != model.getValue(CompPath + "/depth" )) return EditChk; if ( model.getValue(WorkPath + "/goodflag" ) != model.getValue(CompPath + "/goodflag" )) return EditChk; if ( model.getValue(WorkPath + "/goodflagnm" ) != model.getValue(CompPath + "/goodflagnm" )) return EditChk; if ( model.getValue(WorkPath + "/lrgcd" ) != model.getValue(CompPath + "/lrgcd" )) return EditChk; if ( model.getValue(WorkPath + "/lrgnm" ) != model.getValue(CompPath + "/lrgnm" )) return EditChk; if ( model.getValue(WorkPath + "/mdlcd" ) != model.getValue(CompPath + "/mdlcd" )) return EditChk; if ( model.getValue(WorkPath + "/mdlnm" ) != model.getValue(CompPath + "/mdlnm" )) return EditChk; if ( model.getValue(WorkPath + "/smlcd" ) != model.getValue(CompPath + "/smlcd" )) return EditChk; if ( model.getValue(WorkPath + "/smlnm" ) != model.getValue(CompPath + "/smlnm" )) return EditChk; if ( model.getValue(WorkPath + "/mainmngtdeptcd") != model.getValue(CompPath + "/mainmngtdeptcd")) return EditChk; if ( model.getValue(WorkPath + "/mainmngtdeptnm") != model.getValue(CompPath + "/mainmngtdeptnm")) return EditChk; if ( model.getValue(WorkPath + "/winacnt" ) != model.getValue(CompPath + "/winacnt" )) return EditChk; if ( model.getValue(WorkPath + "/winacntnm" ) != model.getValue(CompPath + "/winacntnm" )) return EditChk; if ( model.getValue(WorkPath + "/amtacnt" ) != model.getValue(CompPath + "/amtacnt" )) return EditChk; if ( model.getValue(WorkPath + "/amtacntnm" ) != model.getValue(CompPath + "/amtacntnm" )) return EditChk; EditChk = false; return EditChk; } // // º¯°æ¿©ºÎ Check // function fCompare2Work(){ model.setValue(WorkPath + "/depth" , model.getValue(CompPath + "/depth" )); model.setValue(WorkPath + "/goodflag" , model.getValue(CompPath + "/goodflag" )); model.setValue(WorkPath + "/goodflagnm" , model.getValue(CompPath + "/goodflagnm" )); model.setValue(WorkPath + "/lrgcd" , model.getValue(CompPath + "/lrgcd" )); model.setValue(WorkPath + "/lrgnm" , model.getValue(CompPath + "/lrgnm" )); model.setValue(WorkPath + "/mdlcd" , model.getValue(CompPath + "/mdlcd" )); model.setValue(WorkPath + "/mdlnm" , model.getValue(CompPath + "/mdlnm" )); model.setValue(WorkPath + "/smlcd" , model.getValue(CompPath + "/smlcd" )); model.setValue(WorkPath + "/smlnm" , model.getValue(CompPath + "/smlnm" )); model.setValue(WorkPath + "/mainmngtdeptcd", model.getValue(CompPath + "/mainmngtdeptcd")); model.setValue(WorkPath + "/mainmngtdeptnm", model.getValue(CompPath + "/mainmngtdeptnm")); model.setValue(WorkPath + "/winacnt" , model.getValue(CompPath + "/winacnt" )); model.setValue(WorkPath + "/winacntnm" , model.getValue(CompPath + "/winacntnm" )); model.setValue(WorkPath + "/amtacnt" , model.getValue(CompPath + "/amtacnt" )); model.setValue(WorkPath + "/amtacntnm" , model.getValue(CompPath + "/amtacntnm" )); } // ------------------------------ // °ü¸®¹°Ç°¼±Åà Tab Click // ------------------------------ function fChoisClick(){ var vPcode = ""; var vIdx = -1; for (var i=0; i 0) { trv_gubn.item(vIdx).checked = 1; } } } trv_gubn.refresh(); } // -------------------------------------------------- // ÀÎÀÚ·Î ³Ñ¾î¿Â °ªÀ» label ·Î °°Àº ¾ÆÀÌÅÛÀÇ À妽º¸¦ ¹Ýȯ // -------------------------------------------------- function fLabelToIndex(pValue, pTree) { for (var i=0; i < pTree.length; i++) { if (pTree.item(i).value == pValue) return i; } return -1; } // -------------------------------------------------- // GUBUN Tree Click // -------------------------------------------------- function fGubnTreeClick(fTree, fIdx) { var Idx = fIdx + 1; var pIdx = 0; var sDepth = model.getValue(TreePath +"["+Idx+"]/depth"); var Tree1 = fTree.item(fIdx); if (sDepth == 1) { return; } // fTree.item(Tree1.parentindex).checked = 0; // if (sDepth == "3") { Tree2 = fTree.item(Tree1.parentindex); Tree3 = fTree.item(Tree2.parentindex); fTree.item(Tree3.index).checked = 0; } //---- if (sDepth == "4") { Tree2 = fTree.item(Tree1.parentindex); Tree3 = fTree.item(Tree2.parentindex); fTree.item(Tree3.index).checked = 0; Tree4 = fTree.item(Tree3.parentindex); fTree.item(Tree4.index).checked = 0; } //---- if (sDepth == "5") { Tree2 = fTree.item(Tree1.parentindex); Tree3 = fTree.item(Tree2.parentindex); fTree.item(Tree3.index).checked = 0; Tree4 = fTree.item(Tree3.parentindex); fTree.item(Tree4.index).checked = 0; Tree5 = fTree.item(Tree4.parentindex); fTree.item(Tree5.index).checked = 0; } // pTree.refresh(); } // ------------------------------ // °ü¸®¹°Ç°¼±Åà // ------------------------------ function fChoisData(){ var ii = 1; var OpCode = ""; var CodeCd = ""; var AppnPath = "/root/WorkData/workinst/AppendLists"; var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist"; var ApndPath = AppnPath+"/rscmggbnemplist"; model.removenode(AppnPath); CodeCd = model.getValue(ApndPath +"[pcode='0000']/pcode"); //alert(CodeCd); for(var i=0; i < trv_gubn.length; i++) { if (trv_gubn.item(i).checked == 1){ sDepth = model.getValue(TreePath +"["+(i+1)+"]/depth"); OpCode = model.getValue(TreePath +"["+(i+1)+"]/basecd"); CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode"); // if (sDepth == "3") { if (CodeCd == "") { Tree2 = trv_gubn.item(i); ii = fChoisSetData(Tree2.parentindex + 1, ii, "Y"); } } //---- if (sDepth == "4") { if (CodeCd == "") { Tree2 = trv_gubn.item(i); Tree3 = trv_gubn.item(Tree2.parentindex); pIdx2 = Tree3.parentindex + 1; pIdx3 = Tree2.parentindex + 1; OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode"); if (model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode") == "") { ii = fChoisSetData(pIdx2, ii, "Y"); } ii = fChoisSetData(pIdx3, ii, "Y"); } } //---- if (sDepth == "5") { if (CodeCd == "") { Tree2 = trv_gubn.item(i); // ÀڽŠTree3 = trv_gubn.item(Tree2.parentindex); Tree4 = trv_gubn.item(Tree3.parentindex); pIdx1 = Tree4.parentindex + 1; pIdx2 = Tree3.parentindex + 1; pIdx3 = Tree2.parentindex + 1; // bbb ="Level3===>>"+pIdx3+":-"+OpCode+"-::-"+CodeCd; OpCode = model.getValue(TreePath +"["+pIdx1+"]/pcode"); CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode"); // aaa ="Level1===>>"+pIdx1+":-"+OpCode+"-::-"+CodeCd; // if (CodeCd == "") { ii = fChoisSetData(pIdx1, ii, "Y"); } OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode"); CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode"); // aaa +="Level2===>>"+pIdx2+":-"+OpCode+"-::-"+CodeCd; // if (CodeCd == "") { ii = fChoisSetData(pIdx2, ii, "Y"); } ii = fChoisSetData(pIdx3, ii, "Y"); // alert(aaa+bbb); } } ii = fChoisSetData(i+1, ii, "A"); } } pNode = instance1.selectSingleNode(ApndPath); if (pNode != null) { model.removeNode(ListPath); model.makeNode(ListPath); // model.setValue(DataPath + "/updateyn" , "Y" ); model.copyNode("/root/main/RscmggbnEmpLists", AppnPath); bbt_emp.selected="true"; bbt_emp.dispatch("DOMActivate"); // model.removeNode(AppnPath); btn_save.disabled = false; trv_empdata.rebuild(); } } // ------------------------------ // °ü¸®¹°Ç°¼±Åà // ------------------------------ function fChoisSetData(pIdx, pRow, pCheckYN){ var AppnPath = "/root/WorkData/workinst/AppendLists"; var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist"; var ApndPath = AppnPath+"/rscmggbnemplist"; model.setValue(CopyPath+"/depth" , model.getValue(TreePath +"["+pIdx+"]/depth" )); model.setValue(CopyPath+"/pcode" , model.getValue(TreePath +"["+pIdx+"]/pcode" )); model.setValue(CopyPath+"/codecd" , model.getValue(TreePath +"["+pIdx+"]/codecd" )); model.setValue(CopyPath+"/codenm" , model.getValue(TreePath +"["+pIdx+"]/codenm" )); model.setValue(CopyPath+"/basecd" , model.getValue(TreePath +"["+pIdx+"]/basecd" )); model.setValue(CopyPath+"/dispnm" , model.getValue(TreePath +"["+pIdx+"]/dispnm" )+ ((pCheckYN == "A") ? "(Àüü)" : "") ); model.setValue(CopyPath+"/checkyn", pCheckYN); if (pRow == 1) { model.makeNode(ApndPath+"["+pRow+"]" ); model.copyNode(ApndPath+"["+pRow+"]", "/root/WorkData/workinst/defaultggbn"); pRow++; } model.makeNode(ApndPath+"["+pRow+"]" ); model.copyNode(ApndPath+"["+pRow+"]", CopyPath); pRow++; return pRow; } // ---------------------------------------------------------------- // »ç¿ëÀÚº°°ü¸®¹°Ç°±ÇÇÑ ÀÚ·á ÀúÀå // ---------------------------------------------------------------- function fRscmggbnDataSubmit(pCls) { if ((model.getValue(DataPath + "/emplno") =="") || (model.getValue(DataPath + "/emplnm") =="") ) { messageBox("ÇØ´ç »ç¿ø¹øÈ£¸¦ ", "C001"); return; } var pNode = instance1.selectSingleNode(ListPath); if (pNode == null) { messageBox("¼öÁ¤(ÀÔ·Â)µÈ ÀÚ·á°¡ ", "I004"); return; } var RscmggbnsList = "status" + "¢Ë" // 1 »óÅ + "instcd" + "¢Ë" // 2 ±â°ü¹øÈ£ + "emplno" + "¢Ë" // 3 »ç¿ø¹øÈ£ + "goodflag" + "¢Ë" // 4 ¹°Ç°±¸ºÐ + "lrgcd" + "¢Ë" // 5 ´ëºÐ·ùÄÚµå + "mdlcd" + "¢Ë" // 6 ÁߺзùÄÚµå + "smlcd" + "¢Ë" // 7 ¼ÒºÐ·ùÄÚµå + "cmt" + "¢Ì"; // 8 ºñ°í var vEmpData2 = "" var vEmpData1 = pCls + "¢Ë" // 1 »óÅ + model.getValue(HidePath+"/instcd" )+ "¢Ë" // 2 ±â°ü¹øÈ£ + model.getValue(DataPath+"/emplno" )+ "¢Ë"; // 3 »ç¿ø¹øÈ£ //ÀÔ·Â if (pCls == "D") { vEmpData2 += vEmpData1 + "" + "¢Ë" // 4 ¹°Ç°±¸ºÐ + "" + "¢Ë" // 5 ´ëºÐ·ùÄÚµå + "" + "¢Ë" // 6 ÁߺзùÄÚµå + "" + "¢Ë" // 7 ¼ÒºÐ·ùÄÚµå + "" + "¢Ì"; // 8 ºñ°í } else { for(var i=0; i < trv_empdata.length; i++) { sDepth = model.getValue(ListPath +"["+(i+1)+"]/depth"); switch(sDepth) { case "2" : vGoodflag = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 4 ¹°Ç°±¸ºÐ vLrgcd = "%"; // 5 ´ëºÐ·ùÄÚµå vMdlcd = "%"; // 6 ÁߺзùÄÚµå vSmlcd = "%"; // 7 ¼ÒºÐ·ùÄÚµå break; case "3" : vLrgcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 5 ´ëºÐ·ùÄÚµå vMdlcd = "%"; // 6 ÁߺзùÄÚµå vSmlcd = "%"; // 7 ¼ÒºÐ·ùÄÚµå break; case "4" : vMdlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 6 ÁߺзùÄÚµå vSmlcd = "%"; // 7 ¼ÒºÐ·ùÄÚµå break; case "5" : vSmlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 7 ¼ÒºÐ·ùÄÚµå } //--- if (model.getValue(ListPath +"["+(i+1)+"]/checkyn") == "A") { vEmpData2 += vEmpData1 + vGoodflag + "¢Ë" // 4 ¹°Ç°±¸ºÐ + vLrgcd + "¢Ë" // 5 ´ëºÐ·ùÄÚµå + vMdlcd + "¢Ë" // 6 ÁߺзùÄÚµå + vSmlcd + "¢Ë" // 7 ¼ÒºÐ·ùÄÚµå + "" + "¢Ì"; // 8 ºñ°í } } } //---- RscmggbnsList += vEmpData2; model.removenode("/root/send"); model.makeValue("/root/send/rscmggbnlist", RscmggbnsList); // if (submit("TXRSC01001", false)) { // Á¤º¸ÀúÀå messageBox("ÀÚ·á ÀúÀå ", "I002"); // fRscmggbnTree(); } } // ---------------------------------------------------------------- // È­¸é open½Ã¿Í ÃʱâÈ­ ¹öư Ŭ¸¯½Ã È­¸é ÃʱâÈ­ ±â´ÉÀ» ¼öÇàÇÑ´Ù. // ---------------------------------------------------------------- function fInitialize() { // grid reset //misfGridInit(grd_rscmggbn); //misfGridInit(grd_rscmregb); //misfGridInit(grd_rscmreus); //misfGridInit(grd_rscmsude); //misfGridInit(grd_gooddmnd); /////////////////////////////////////////////////////////////////////////////////////////////// // tab1 ±â°üÄÚµå combo setting //rszfUserInstList(cmb_instcd,getUserInfo("userid")); //»ç¿ëÀÚ¼Ò¼Ó±â°ü /////////////////////////////////////////////////////////////////////////////////////////////// misfComboComCdList("Z0007", cmb_instcd); //Àüü±â°üÄÚµå /////////////////////////////////////////////////////////////////////////////////////////////// //¹°Ç°±¸ºÐ //misfComboComCdList("R0025", goodflag); //¹°Ç°±¸ºÐ /////////////////////////////////////////////////////////////////////////////////////////////// //misfGridComboComCdList("R0025",grd_rscmggbn,"goodflag"); // ½ºÀ§Ä¡ ¿ÀÇ ¼³Á¤. cse_ggbn.selected=true; // ¸·À½.Ȳ //rszfGridComboLrgcdList("P", grd_rscmggbn, "lrgcd") // tab1 .master ,detail set //misfMsterDetailSet(grd_rscmggbn,null, "TRRSC01001" ,"Y"); // tab2 .master ,detail set //misfMsterDetailSet(grd_rscmregb,null, "TRRSC01002" ,"Y"); // tab2 master, detail set û±¸Ã³¸®±ÇÇÑ ¼³Á¤ //misfMsterDetailSet(grd_rscmreus, grd_rscmregb, "TRRSC01003", "Y"); // tab2 master, detail set ÃëÇպμ­ ¼³Á¤ //misfMsterDetailSet(grd_rscmsude, grd_rscmregb, "TRRSC01004", "Y"); //model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd")); //model.setValue(opt_purcdmnddeptcd.attribute("ref") , getUserInfo("dutplcecd")); //model.setValue(opt_purcdmnddeptnm.attribute("ref") , getUserInfo("dutplcenm")); model.refresh(); } // ---------------------------------------------------------------- function fCheckRetrieveData(pmsg) { if(model.getValue(cmb_instcd.attribute("ref")).length== 0 ) { if(pmsg == true) { messageBox("±â°üÄڵ带 " ,"C002"); model.setFocus("cmb_instcd"); } return false; } return true; } // ---------------------------------------------------------------- function fDefaultSetting(prow) { model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcreqflag",model.getValue("/root/send/gooddmnd/purcreqflag")); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/instcd" ,model.getValue("/root/send/gooddmnd/instcd") ); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/goodflag" ,model.getValue("/root/send/gooddmnd/goodflag") ); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmnddd" ,model.getValue("/root/send/gooddmnd/purcdmnddd") ); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqdeptcd" ,model.getValue("/root/send/gooddmnd/reqdeptcd") ); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqpsn" ,model.getValue("/root/send/gooddmnd/reqpsn") ); model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmndseq",prow); } // ---------------------------------------------------------------- function fSettingGoodList(pnode, nodename, userqtynm){ var codynode = instance1.selectNodes(pnode + "/*"); var addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows; if(model.getValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd").length > 0)addRow = addRow + 1; for (var j = 1; j <= codynode.length ; j++) { if(addRow > grd_gooddmnd.rows - grd_gooddmnd.fixedRows) { misfGridIUD(grd_gooddmnd,"A"); addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows; fDefaultSetting(addRow ); } model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcnt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm)); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/requnit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit")); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm)); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcntperunit" ,1); model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost")); addRow = addRow + 1; } model.recalculate(); model.refresh(); } // ---------------------------------------------------------------- function fCheckSaveData() { for(var currow = grd_rscmggbn.fixedRows ; currow < grd_rscmggbn.rows ; currow++) { // if (grd_rscmggbn.rowStatus(currow) != '4') if (grd_rscmggbn.rowStatus(currow) == '1' || grd_rscmggbn.rowStatus(currow) == '2'|| grd_rscmggbn.rowStatus(currow) == '3') { if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("emplno")).length == 0) { messageBox((currow )+ " ¹øÂ° »ç¿ø¹øÈ£¸¦ " ,"C001"); grd_rscmggbn.row = currow; grd_rscmggbn.col= grd_rscmggbn.colRef("emplno"); grd_rscmggbn.editCell(); return false; } if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("goodflag")).length == 0) { messageBox((currow)+ " ¹øÂ° ¹°Ç°±¸ºÐÀ» " ,"C001"); grd_rscmggbn.row = currow; grd_rscmggbn.col= grd_rscmggbn.colRef("goodflag"); grd_rscmggbn.editCell(); return false; } if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("lrgcd")).length == 0) { messageBox((currow)+ " ¹øÂ° ´ëºÐ·ùÄڵ带 " ,"C001"); grd_rscmggbn.row = currow; grd_rscmggbn.col= grd_rscmggbn.colRef("lrgcd"); grd_rscmggbn.editCell(); return false; } } } return true; } // trv_base.select(i); À§Ä¡... // trv_base.rebuild(); // if ( btn_trvzoom.attribute("text") == "´ÝÈû" ) { // trv_base.expandDepth = 0; // btn_trvzoom.attribute("text") = "Æîħ"; // // } else { // trv_base.expandDepth = -1; // btn_trvzoom.attribute("text") = "´ÝÈû"; // } /* ------------------------------------------------- */ /* ------End Of List ------------------------------- */ /* -------------------------------------------------- */