/* --------------------------------------------------------------------- SMRSI00400_ÀÔ°í³»¿ªÁ¶È¸.xrw (SMRSI00400.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By Francis Choi : 2015.05.02 ---------------------------------------------------------------------- */ var xAuth = !(checkAuth("X")); var pAuth = !(checkAuth("P")); var vPurcAuth = "1"; // -------------------------------------------------- // È­¸é ControlÀ» ÃʱâÈ­ÇÑ´Ù // -------------------------------------------------- function fInit() { fInitialize(); return; } // -------------------------------------------------------------- // È­¸é open½Ã¿Í ÃʱâÈ­ ¹öư Ŭ¸¯½Ã È­¸é ÃʱâÈ­ ±â´ÉÀ» ¼öÇàÇÑ´Ù. // -------------------------------------------------------------- function fInitialize() { model.resetInstanceNode("/root/send"); //rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"),"Y"); rszfGoodFlagListByPgmGubn(cmb_goodflag,"1","Y"); rszfUserInstList(cmb_instcd,getUserInfo("userid"),"N"); misfComboComCdList("R0111",cmb_purcflag,"Y"); //misfComboComCdListMulti("Z0007,R0025","cmb_instcd,cmb_goodflag" ); //rszfComboAppendBlankChild("cmb_instcd,cmb_goodflag"); model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd")); model.setValue(ipt_windeptcd.attribute("ref") , getUserInfo("dutplcecd")); model.setValue(ipt_windeptnm.attribute("ref") , getUserInfo("dutplcenm")); model.setValue(ipt_winfrdd.attribute("ref") , getCurrentDate()); model.setValue(ipt_wintodd.attribute("ref") , getCurrentDate()); misfGridInit(grd_goodwin); misfMsterDetailSet(grd_goodwin ,null , "TRRSI00401" ,"N", "byrow"); misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSI00403" ,"N", "byrow"); // misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSD00403" ,"N", "byrow"); //È­¸é¿¡¼­ GridÀÇ ¸¶½ºÅÍ Detail°ü°è ¼³Á¤ /* pGrid_name : Grid id¸í pMaster_Grid : pGrid_nameÀÇ ¸¶½ºÅÍ Grid id¸í pSubmit_Id : pGrid_nameÀ» Á¶È¸ÇÒ Submit id pSave_Yn : pGrid_name ÀúÀå¿©ºÎ("Y","N") pSelectionMode : pGrid_name ÀÇ ¼±Åøðµå "free", "byrow", "bycol".. function misfMsterDetailSet(pGrid_name, pMaster_Grid, pSubmit_Id, pSave_Yn, pSelectionMode) */ // grd_goodwin.fixedcellcheckbox(0,grd_goodwin.colRef("chkyn")) = true; model.refresh(); } // --------------------------------------- // û±¸ Ãâ°í ³»¿ªÀ» Á¶È¸ÇÑ´Ù // --------------------------------------- function fAfterRetrieveDetail() { var SumDeliveQty = 0; for (var currow = grd_gooddmndreq.fixedRows ; currow < grd_gooddmndreq.rows ; currow++) { SumDeliveQty += parseFloat(grd_gooddmndreq.valueMatrix(currow , grd_gooddmndreq.colRef("deliveqty"))); } model.setValue(opt_sumdeliveqty.attribute("ref"), SumDeliveQty); model.refresh(); } // --------------------------------------- // ÀÔ°í³»¿ª Sumó¸® ÇÑ´Ù // --------------------------------------- function fAfterGoodwin() { var SumWinQty = 0; var SumWinAmt = 0; for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) { SumWinQty += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winqty"))); SumWinAmt += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winamt"))); if(grd_goodwin.valueMatrix(fRow, grd_goodwin.colRef("chkyn")) == "Y") { grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = true; } else { grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = false; } } model.setValue(opt_winqty.attribute("ref"),SumWinQty); model.setValue(opt_winamt.attribute("ref"),SumWinAmt); model.refresh(); } //----------------------------------- // ÀÔ°í °Ë¼ö È®ÀÎ ÀúÀå //----------------------------------- function fCheckPersonSave(){ var vCnt = 0 ; var cPath = "/root/init/winchecklist"; var sPath = "/root/main/list/goodwin/goodwinlist"; var tPath = "/root/send/winchecklists"; var tPath2 = "/root/send/winchecklists/winchecklist"; var Winchecklist = "instcd" + "¢Ë" // 01 ±â°üÄÚµå + "goodflag" + "¢Ë" // 02 ¹°Ç°±¸ºÐ + "windd" + "¢Ë" // 03 ÀÔ°íÀÏÀÚ + "winno" + "¢Ë" // 04 ÀÔ°í¹øÈ£ + "winseqno" + "¢Ë" // 05 ÀÔ°íÀϷùøÈ£ + "windeptcd" + "¢Ë" // 06 ÀÔ°íºÎ¼­ÄÚµå + "chkdd" + "¢Ë" // 07 °Ë¼öÀÏÀÚ + "chkpsn" + "¢Ë" // 08 °Ë¼öÀÚid + "chkyn" + "¢Ì" ; // 09 °Ë¼öÀ¯¹« for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) { if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") && (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){ Winchecklist += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "¢Ë"; // 01 ±â°üÄÚµå Winchecklist += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "¢Ë"; // 02 ¹°Ç°±¸ºÐ Winchecklist += model.getValue(sPath + "[" + fRow + "]/windd" ) + "¢Ë"; // 03 ÀÔ°íÀÏÀÚ Winchecklist += model.getValue(sPath + "[" + fRow + "]/winno" ) + "¢Ë"; // 04 ÀÔ°í¹øÈ£ Winchecklist += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "¢Ë"; // 05 ÀÔ°íÀϷùøÈ£ Winchecklist += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "¢Ë"; // 06 ÀÔ°íºÎ¼­ÄÚµå Winchecklist += getCurrentDate() + "¢Ë"; // 07 °Ë¼öÀÏÀÚ Winchecklist += getUserInfo("userid") + "¢Ë"; // 08 °Ë¼öÀÚid Winchecklist += model.getValue(sPath + "[" + fRow + "]/chkyn" ) + "¢Ì"; // 09 °Ë¼öÀ¯¹« vCnt++; } else { if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") { model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y"); } } } if (vCnt > 0) { model.removenode(tPath); model.makeValue(tPath2, Winchecklist); submit("TXRSI00103"); btn_search.dispatch("DOMActivate"); } } //----------------------------------- // ÀÔ°í °Ë¼ö È®ÀÎ ÀúÀå //----------------------------------- function fCheckPersonSave2(){ var vCnt = 0 ; var cPath = "/root/init/winchecklist"; var sPath = "/root/main/list/goodwin/goodwinlist"; var tPath = "/root/send/winchecklists"; var tPath2 = "/root/send/winchecklists/winchecklist"; model.removenode(tPath); for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) { if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") && (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){ model.setValue(cPath + "/instcd" , model.getValue(sPath + "[" + fRow + "]/instcd" )) ; // 01 ±â°üÄÚµå model.setValue(cPath + "/goodflag" , model.getValue(sPath + "[" + fRow + "]/goodflag" )) ; // 02 ¹°Ç°±¸ºÐ model.setValue(cPath + "/windd" , model.getValue(sPath + "[" + fRow + "]/windd" )) ; // 03 ÀÔ°íÀÏÀÚ model.setValue(cPath + "/winno" , model.getValue(sPath + "[" + fRow + "]/winno" )) ; // 04 ÀÔ°í¹øÈ£ model.setValue(cPath + "/winseqno" , model.getValue(sPath + "[" + fRow + "]/winseqno" )) ; // 05 ÀÔ°íÀϷùøÈ£ model.setValue(cPath + "/windeptcd", model.getValue(sPath + "[" + fRow + "]/windeptcd")) ; // 06 ÀÔ°íºÎ¼­ÄÚµå model.setValue(cPath + "/chkdd" , getCurrentDate() ) ; // 07 °Ë¼öÀÏÀÚ model.setValue(cPath + "/chkpsn" , getUserInfo("userid") ) ; // 08 °Ë¼öÀÚid model.setValue(cPath + "/chkyn" , model.getValue(sPath + "[" + fRow + "]/chkyn" )) ; // 09 °Ë¼öÀ¯¹« xNode = instance1.selectSingleNode(tPath); if (vCnt == 0) { model.makeNode(tPath2 ); model.copyNode(tPath2 , cPath); } else { model.duplicate(tPath , cPath); } vCnt++; } else { if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") { model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y"); } } } if (vCnt > 0) { submit("TXRSI00103"); } //if (submit("TXRSI00103")) { // btn_search.dispatch("DOMActivate"); //} // alert(vCnt); } function fWinAllSelect() { var sPath = "/root/main/list/goodwin/goodwinlist"; for(var liRow = grd_goodwin.fixedRows; liRow < grd_goodwin.rows ; liRow++) { if (model.getValue(sPath+"[" + liRow + "]/oldchkyn") =="N") { if (model.getValue(sPath+"[" + liRow + "]/chkyn" ) =="Y") model.setValue(sPath+"[" + liRow + "]/chkyn", "N" ); else model.setValue(sPath+"[" + liRow + "]/chkyn", "Y" ); } } } //----------------------------------- // ÀÔ°í Àüü ¼±Åà / Ãë¼Ò //----------------------------------- /* ------------------------------------------------- */ /* ------End Of List ------------------------------- */ /* -------------------------------------------------- */