/* --------------------------------------------------------------------- °¡³³¹°Ç°ÀÔ°í(SMMNP05400.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By kim bo sung : 2007.09.19 2) : Ver.2.00.01 : Create By K. J. M : 2010.07.14 ---------------------------------------------------------------------- */ var xPathDataA = "/root/main/mnphtrininfo/mnphtrinlist"; var xPathDataB = "/root/main/goodprcplist"; var xPathDataC = "/root/main/winqtylist"; var xPathDataD = "/root/main/goodwinlist"; var xSendReqData = "/root/send/reqdata"; //º¸³»´Â°ª var xSendSaveData = "/root/send/savedata"; //¹ÞÀº ¸®½ºÆ® °¹¼ö°ª var xCondData = "/root/main/cond"; //Á¶°ÇÇ׸ñµé var xErrMsg = "/root/properties/error/msg"; var xTempData = "/root/temp"; // -------------------------------------------------- // È­¸é ÃʱâÈ­ // -------------------------------------------------- function fInit() { //È­¸é open ½Ã ÀÏÀÚ ÀÚµ¿ÁöÁ¤ //var Nowdt = getCurrentDate(); // //model.setValue(xCondData+"/opcnfmfrdd",Nowdt); //model.setValue(xCondData+"/opcnfmtodd",Nowdt); // //model.removenode(xPathDataA);//°¡³³ ¹°Ç° ÀÔ°í ±×¸®µå ÃʱâÈ­ //model.removenode(xPathDataB);//°¡³³ ¹°Ç° ó¹æ ³»¿ª ±×¸®µå ÃʱâÈ­ //model.removenode(xPathDataC);//°¡³³ ¹°Ç° ÀÔ°í ÀÔ°í·® ³»¿ª ±×¸®µå ÃʱâÈ­ //model.removenode(xPathDataD);//°¡³³ ¹°Ç° Àϰú ÀÔ°í ±×¸®µå ÃʱâÈ­ //model.removeNodeset(xPathDataA);//°¡³³ ¹°Ç° ÀÔ°í ±×¸®µå ÃʱâÈ­ //model.removeNodeset(xPathDataB);//°¡³³ ¹°Ç° ó¹æ ³»¿ª ±×¸®µå ÃʱâÈ­ //model.removeNodeset(xPathDataC);//°¡³³ ¹°Ç° ÀÔ°í ÀÔ°í·® ³»¿ª ±×¸®µå ÃʱâÈ­ //model.removeNodeset(xPathDataD);//°¡³³ ¹°Ç° Àϰú ÀÔ°í ±×¸®µå ÃʱâÈ­ // // //grd_mnphtrinlist.explorerbar = "sort"; //grd_goodprcplist.explorerbar = "sort"; //grd_winqtylist.explorerbar = "sort"; //grd_goodwinlist.explorerbar = "sort"; //grd_goodwinlist.fixedcellcheckbox(0,15) = true; // //submit("TRMNP03004", false) // ¼ö¼ú½Ç(Rosette) °¡Á®¿À±â // //model.makeValue("/root/send/opcnfmdd", Nowdt); //model.makeValue("/root/send/rosette", model.getValue("/root/main/cond/oprosette")); //submit("TRMNP03002", false); // ¼ö¼ú½ÇÄÚµå °¡Á®¿À±â // //model.removenode("/root/send"); //model.makeNode("/root/send/reqdata"); //model.copyNode("/root/send/reqdata", "/root/main/cond"); //submit("TRMNP04404", false); // //submit("TRMNP05502", false); //°Å·¡Ã³ Á¶È¸ // //model.removenode("/root/send"); //model.makeValue("/root/send/flag" , "X" ); //model.makeValue("/root/send/searchitem", "XX" ); //model.makeValue("/root/send/deptflag" , "011" ); // //submit("TRMNP00107"); // //addComboItem("cmb_rosette", "Àü ü", "", "above" ); //addComboItem("cmb_oproomcd", "Àü ü", "", "above" ); //addComboItem("cmb_perfdeptlist", "Àü ü", "", "above" ); //addComboItem("cmb_drlist", "Àü ü", "", "above" ); //addComboItem("cmb_lrg", "Àü ü", "", "above" ); //È­¸é open ½Ã ÀÏÀÚ ÀÚµ¿ÁöÁ¤ var Nowdt = getCurrentDate(); Nowdt.substr(0, 8); model.toggle("wingood"); model.setValue(xCondData + "/reffromdd",Nowdt); model.setValue(xCondData + "/reftodd",Nowdt); model.setValue(xCondData + "/windd", Nowdt); model.setValue(xCondData + "/batchwindd", Nowdt); model.removeNodeset(xPathDataA);//°¡³³ ¹°Ç° ÀÔ°í ±×¸®µå ÃʱâÈ­ model.removeNodeset(xPathDataB);//°¡³³ ¹°Ç° ó¹æ ³»¿ª ±×¸®µå ÃʱâÈ­ model.removeNodeset(xPathDataC);//°¡³³ ¹°Ç° ÀÔ°í ÀÔ°í·® ³»¿ª ±×¸®µå ÃʱâÈ­ model.removeNodeset(xPathDataD);//°¡³³ ¹°Ç° Àϰú ÀÔ°í ±×¸®µå ÃʱâÈ­ grd_mnphtrinlist.explorerbar = "sort"; grd_goodprcplist.explorerbar = "sort"; grd_winqtylist.explorerbar = "sort"; grd_goodwinlist.explorerbar = "sort"; grd_goodwinlist.fixedcellcheckbox(0,10) = true; model.refresh(); } // -------------------------------------------------- // ±×¸®µå Á¶È¸ // -------------------------------------------------- function fList_Read() { var Nowdt = getCurrentDate(); Nowdt.substr(0, 8); var tabflag = model.getValue(xCondData + "/tabflag"); if( tabflag == "A" ) {//°¡³³ ¹°Ç° ÀÔ°í model.copyNode(xSendReqData, xCondData); submit("TRMNP05401"); }else if( tabflag == "B" ) {//°¡³³ ¹°Ç° ó¹æ ³»¿ª model.copyNode(xSendReqData, xCondData); submit("TRMNP05402"); }else if( tabflag == "C" ) {//°¡³³ ¹°Ç° ÀÔ°í ÀÔ°í·® ³»¿ª model.copyNode(xSendReqData, xCondData); submit("TRMNP05403"); }else if( tabflag == "D" ) {//°¡³³ ¹°Ç° Àϰý ÀÔ°í, ¹Ý³³ model.copyNode(xSendReqData, xCondData); model.makeValue("/root/send/reqdata/windd", model.getValue("/root/main/cond/batchwindd")); submit("TRMNP05404"); } } // -------------------------------------------------- // ÆË¾÷È£Ãâ // -------------------------------------------------- function fPopup() { var refflag = model.getValue(xTempData + "/refflag"); switch (refflag) { case "1": /*¹°Ç°¸íÀ¸·Î °Ë»ö*/ setParameter("refnm", model.getValue(xCondData + "/goodnm")); setParameter("refflag", "1"); break; case "2": /*¹°Ç°ÄÚµåÀ¸·Î °Ë»ö*/ setParameter("refnm", model.getValue(xCondData + "/goodcd")); setParameter("refflag", "2"); break; default: setParameter("refnm", model.getValue(xCondData + "/goodcd")); setParameter("refflag", "2"); break; } setParameter("goodflag", ""); setParameter("openflag", "STOC"); setParameter("menuparam", "S"); setParameter("tabflag", "CCR"); setParameter("cartgubn", model.getValue("/root/main/cond/deptflag")); modal("SMMNP04460" ,"", "100", "100", "SMMNP04460", "", ""); var getData = model.getValue("/root/properties/parameters/SendData/SendDatavalue"); if( getData == "") { return; }else if( model.getValue(xTempData +"/chkcncl") == "C" ) {//ÆË¾÷¿¡¼­ Ãë¼Ò¸¦ ¼±ÅÃÇϰųª âÀ» °­Á¦·Î ´Ý¾ÒÀ» °æ¿ì return; }else { var getDataTemp1 = getData.split("¢Ì"); //¸ðÁ¶°Ç ù¹øÂ°ÀÇ ÀڷḦ °¡Á®¿Â´Ù. var getDataTemp2 = getDataTemp1[0].split("|"); model.setValue(xCondData+ "/goodcd", getDataTemp2[0]); model.setValue(xCondData+ "/goodnm", getDataTemp2[1]); model.setValue(xCondData+ "/allsizespecid", getDataTemp2[2]); model.refresh(); } fList_Read(); } // -------------------------------------------------- // ¹°Ç°ÄÚµå ŰÀÔ·Â // -------------------------------------------------- function fGoodcd_onkeyup() { inputEnterKey("btn_search", "DOMActivate"); } // -------------------------------------------------- // ¹°Ç°¸í ŰÀÔ·Â // -------------------------------------------------- function fGoodnm_onkeyup() { inputEnterKey("btn_search", "DOMActivate"); } // -------------------------------------------------- // ¿¢¼¿ÀúÀå // -------------------------------------------------- function fExcel_Save() { var tabflag = model.getValue("/root/main/cond/tabflag"); var pGrid = ""; switch(tabflag) { case "A" : pGrid = grd_mnphtrinlist; break; case "B" : pGrid = grd_goodprcplist; break; case "C" : pGrid = grd_winqtylist; break; case "D" : pGrid = grd_goodwinlist; break; } var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*"); if (fileName != ""){ pGrid.saveExcel(fileName, "sheetname:sheet1;colhiddenextend:true", false, false, "", "", true); } } // -------------------------------------------------- // ±×¸®µå ÀԷ½à ÀÚµ¿ üũ±â´É // -------------------------------------------------- function fAutoChkflag(pGrid) { //ÀԷ½à ȮÀÎÇÏ¿© üũ¸¦ ÀÚµ¿ ¼³Á¤ÇÑ´Ù. var row = grd_mnphtrinlist.row; if( ( model.getValue(xPathDataA + "[" + row + "]/winqty") == "0" )||( model.getValue(xPathDataA + "[" + row + "]/winqty") == "0.0" ) ) { model.setValue(xPathDataA + "[" + row + "]/chkflag", "false"); }else { model.setValue(xPathDataA + "[" + row + "]/chkflag", "true"); } } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ÀÔ°í·® ÀÚµ¿ ÀÔ·Â */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fEndEdit() { var iRow = -1; var iCol = -1; var iRows = grd_goodwinlist.rows; iRow = grd_goodwinlist.row; iCol = grd_goodwinlist.col; if(event.button==1) { return; } if (grd_goodwinlist.rows <= 1 || grd_goodwinlist.row == 0) { return; } if (grd_goodwinlist.col == 1) { return; } /*if( ( model.getValue("/root/main/goodwinlist[" + iRow + "]/winqty") == "0" )||( model.getValue("/root/main/goodwinlist[" + iRow + "]/winqty") == "0.0" ) ) { messageBox("ÀÔ°í·®Àº 0Àº ÀÔ°í󸮸¦ ÇÒ ¼ö ", "I004"); grd_goodwinlist.editCell(); return; }else { model.setValue("/root/main/goodwinlist[" + iRow + "]/chkflag", "true"); }*/ //for( var i = 2; i < iRows; i++) { //model.setValue("/root/main/goodwinlist[" + i + "]/winqty", model.getValue("/root/main/goodwinlist[" + iRow + "]/winqty")); model.setValue("/root/main/goodwinlist[" + grd_goodwinlist.row + "]/chkflag", "true"); //} model.refresh(); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : °Å·¡Ã³, Á¦Á¶È¸»çº° Àϰý ÀÔ°í */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fBatchWin() { var iRows = -1; var chkflag, goodcd, allsizespecid, windd, winqty, statusValue, deptflag, oldqty, acmlbaseqty; var cnt = 0; //wingubn 1:ÀϹÝÀÔ°í, 2:ÀϰýÀÔ°í, 3:¹Ý³³ var trustlist = "m¢Ëgoodcd¢Ëallsizespecid¢Ëwindd¢Ëwinqty¢Ëwingubn¢Ëoproomcd¢Ëgoodqty¢Ëdeptflag"; iRows = grd_goodwinlist.rows; for( var row = 1; row <= iRows; row++ ) { chkflag = model.getValue( xPathDataD + "[" + row + "]/chkflag"); goodcd = model.getValue( xPathDataD + "[" + row + "]/goodcd"); allsizespecid = model.getValue( xPathDataD + "[" + row + "]/allsizespecid"); statusValue = model.getValue( xPathDataD + "[" + row + "]/status"); winqty = model.getValue( xPathDataD + "[" + row + "]/winqty"); oldqty = model.getValue( xPathDataD + "[" + row + "]/oldqty"); acmlbaseqty = model.getValue( xPathDataD + "[" + row + "]/acmlbaseqty"); windd = model.getValue( xCondData + "/batchwindd"); deptflag = model.getValue( xCondData + "/deptflag"); if( chkflag == "true" ) { if( oldqty < 1 ) { if( ( model.getValue("/root/main/goodwinlist[" + row + "]/winqty") == "0" )||( model.getValue("/root/main/goodwinlist[" + row + "]/winqty") == "0.0" ) ) { messageBox("ÀÔ°í·®Àº 0Àº ÀÔ°í󸮸¦ ÇÒ ¼ö ", "I004"); grd_goodwinlist.editCell(); return; } } //statusValue = "i"; cnt += 1; trustlist = trustlist + "¢Ì" + statusValue + "¢Ë" + goodcd + "¢Ë" + allsizespecid + "¢Ë" + windd + "¢Ë" + parseInt(winqty) + "¢Ë" + "2" + "¢Ë" + "0000" + "¢Ë" + ((parseInt(winqty) - parseInt(oldqty)) * parseInt(acmlbaseqty)) + "¢Ë" + deptflag; } } if( cnt > 0 ) { model.setValue(xSendSaveData, trustlist); submit("TXMNP05401", false); model.removeNodeset(xPathDataD);//°¡³³ ¹°Ç° Àϰú ÀÔ°í ±×¸®µå ÃʱâÈ­ model.setValue("/root/main/cond/goodcd", ""); model.setValue("/root/main/cond/goodnm", ""); model.setValue("/root/main/cond/allsizespecid", ""); model.refresh(); }else { messageBox("¼±ÅÃÇѰÍÀÌ", "I004"); } } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : °Å·¡Ã³, Á¦Á¶È¸»çº° Àϰý ¹Ý³³ */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fBatchRtn() { var iRows = -1; var chkflag, goodcd, allsizespecid, windd, winqty, statusValue, deptflag; var cnt = 0; //wingubn 1:ÀϹÝÀÔ°í, 2:ÀϰýÀÔ°í, 3:¹Ý³³ var trustlist = "m¢Ërownum¢Ëgoodcd¢Ëallsizespecid¢Ëwindd¢Ëwinqty¢Ëwingubn¢Ëdeptflag"; iRows = grd_goodwinlist.rows; for( var row = 1; row <= iRows; row++ ) { chkflag = model.getValue( xPathDataD + "[" + row + "]/chkflag"); goodcd = model.getValue( xPathDataD + "[" + row + "]/goodcd"); allsizespecid = model.getValue( xPathDataD + "[" + row + "]/allsizespecid"); winqty = model.getValue( xPathDataD + "[" + row + "]/winqty"); windd = model.getValue( xCondData + "/batchwindd"); deptflag = model.getValue( xCondData + "/deptflag"); if( chkflag == "true" ) { statusValue = "r"; cnt += 1; trustlist = trustlist + "¢Ì" + statusValue + "¢Ë" + cnt + "¢Ë" + goodcd + "¢Ë" + allsizespecid + "¢Ë" + windd + "¢Ë" + winqty + "¢Ë" + "3" + "¢Ë" + deptflag; } } if( cnt > 0 ) { model.setValue(xSendSaveData, trustlist); submit("TXMNP05401", false); model.removeNodeset(xPathDataD);//°¡³³ ¹°Ç° Àϰú ÀÔ°í ±×¸®µå ÃʱâÈ­ model.setValue("/root/main/cond/goodcd", ""); model.setValue("/root/main/cond/goodnm", ""); model.setValue("/root/main/cond/allsizespecid", ""); model.refresh(); }else { messageBox("¼±ÅÃÇѰÍÀÌ", "I004"); } } /*-------------------------------------------------*/ /*----------------End Of List ---------------------*/ /*-------------------------------------------------*/