/* ÀûÃâ¹°¸®½ºÆ®°ü¸®(SMMNP00310.xfm - JScript ) - Version : 1) : Ver.1.00.01 */ var xExtListPath = "/root/main/extinfo/extlist"; var sFlag = "c"; /** * @group : * @ver : 2008.07.01 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : È­¸éÃʱâÈ­ * @param : * @param : * @return : * @--------------------------------------------------- */ function fInit(){ //ÀνºÅϽºÃʱâÈ­ model.removenode('/root/send'); model.removenode('/root/hidden'); model.removenode('/root/main/extinfo'); model.removenode('/root/cond'); model.makenode('/root/send'); model.makenode('/root/hidden'); model.makenode('/root/main/extinfo'); model.makenode('/root/cond/fromdd'); model.makenode('/root/cond/todd'); model.makenode('/root/cond/rdocond'); //Á¶È¸Á¶°Ç ÃʱâÈ­ model.setValue('/root/cond/fromdd', getCurrentDate()); model.setValue('/root/cond/todd', getCurrentDate()); model.setValue('/root/main/ipt_extinfo/remvdd', getCurrentDate()); model.setValue('/root/main/ipt_extinfo/checknurid', getUserInfo("userid")); model.setValue('/root/cond/rdocond', sFlag); //**°øÅëÄÚµå °¡Á®¿À±â**// zbcfGetCodeList( new Array ( "M0194" // °¨¿°¼º Áúȯ ) , new Array ( "/root/init/M0194list" // °¨¿°¼º Áúȯ ) ); tbGetBscdList( new Array("S02", "S03"), new Array("/root/init/DisplayData", // S02 °£È£»ç "/root/init/DisplayData" // S03 ¼ö¼ú¹æ ) ); //¼ö¼ú½Ç°£È£»ç¸®½ºÆ® Á¶È¸(È®ÀÎÀÚÄÞº¸) fGetOpNrList(); //È­¸é ¹öư ¼³Á¤ fValueChangedInfectRdo(sFlag); grd_extlist.fixedcellcheckbox(0, grd_extlist.colRef("chk")) = true; grd_extlist.fixedcellischeck(0, grd_extlist.colRef("chk")) = true; fSearch(); } /** * @group : * @ver : 2008.07.02 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ¼ö¼ú½Ç°£È£»ç¸®½ºÆ®Á¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fGetOpNrList(){ model.removenode('/root/send'); model.makeValue('/root/send/reqdata/deptflag', '015'); model.makeValue('/root/send/reqdata/searchdd', getCurrentDate()); if(!submit('TRAVT00132')){ messageBox('ÃʱâÈ­¸¦', 'E009'); return; } } /** * @group : * @ver : 2008.07.01 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ȸº¹È¯ÀÚÁ¶È¸ * @param : * @param : * @return : * @--------------------------------------------------- */ function fSearch(){ var fromdd = model.getValue('/root/cond/fromdd'); var todd = model.getValue('/root/cond/todd'); var rdocond = model.getValue('/root/cond/rdocond'); if(fromdd == null || fromdd == ''){ fromdd = getCurrentDate(); } if(todd == null || todd == ''){ todd = getCurrentDate(); } model.setValue('/root/cond/fromdd', fromdd); model.setValue('/root/cond/todd', todd); model.makenode('/root/main/extinfo'); model.setValue("/root/main/totextinfo/totextcrcnt", ""); model.setValue("/root/main/totextinfo/totextcrweig", ""); model.reset('/root/main/ipt_extinfo'); model.removenode('/root/send/reqdata'); model.makeValue('/root/send/reqdata/fromdd', fromdd); model.makeValue('/root/send/reqdata/todd', todd); model.makeValue('/root/send/reqdata/rdocond', rdocond); if(!submit('TRAVT00131', false)){ messageBox('ÀûÃâ¹°¸®½ºÆ®Á¶È¸¸¦', 'E009'); return; } if(getNodesetCount("/root/main/extinfo/extlist") < 1){ btn_print.disabled = true; btn_saveexcel.disabled = true; btn_save.disabled = true; btn_cncl.disabled = true; ipt_remvdd.disabled = true; ipt_remvnm.disabled = true; cmb_checknurid.disabled = true; model.setValue("/root/main/totextinfo/totextcrcnt", 0); model.setValue("/root/main/totextinfo/totextcrweig", 0); }else{ btn_print.disabled = false; btn_saveexcel.disabled = false; btn_save.disabled = false; btn_cncl.disabled = false; ipt_remvdd.disabled = false; ipt_remvnm.disabled = false; cmb_checknurid.disabled = false; totalCnt = 0; totalWeig = 0; for(var i = 1 ; i <= getNodesetCount("/root/main/extinfo/extlist") ; i++){ infectInfo = ""; infectArray = model.getValue("/root/main/extinfo/extlist["+i+"]/infectflag").split(" "); for(var j = 1 ; j <= getNodesetCount("/root/init/M0194list/M0194") ; j++){ for(var k = 0 ; k <= infectArray[k] ; k++){ if(infectArray[k] == model.getValue("/root/init/M0194list/M0194["+j+"]/cdid")){ if(infectInfo == ""){ infectInfo = model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm"); }else{ infectInfo += ", " + model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm"); } } } } //°¨¿°Á¤º¸ ÀÔ·Â model.setValue("/root/main/extinfo/extlist["+i+"]/infectflag", infectInfo); //ÃÑ °³¼ö, ÃÑ Áß·® ÇÕ°è if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){ totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt")); } if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){ totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig")); } } //ÃÑ °³¼ö, ÃÑ Áß·® ÀÔ·Â model.setValue("/root/main/totextinfo/totextcrcnt", totalCnt); model.setValue("/root/main/totextinfo/totextcrweig", totalWeig); } model.refresh(); } /** * @group : * @ver : 2008.07.01 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀûÃâ¹°¸®½ºÆ® ¼ö°ÅÀÏÀÚ, ¼ö°ÅÀÚ, È®ÀÎÀÚ ¼öÁ¤ * @param : * @param : * @return : * @--------------------------------------------------- */ function fSave(){ if(fIsValid()){ model.removenode('/root/send'); model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('i')); if(!submit('TXAVT00131')){ messageBox('ÀûÃâ¹°Á¤º¸ ¼öÁ¤À»', 'E009'); return; }else{ fSearch(); } } } /** * @group : * @ver : 2008.07.01 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ÀûÃâ¹°Á¤º¸ ¼öÁ¤ÇϱâÀü À¯È¿¼ºÃ¼Å© * @param : * @param : * @return : * @--------------------------------------------------- */ function fIsValid(){ if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){ messageBox("¼öÁ¤ ¶Ç´Â ÀúÀåÇÒ ³»¿ªÀ» ¼±ÅÃÇϽʽÿä","I"); return; } //üũÇÑ È¯ÀÚÀÇ ÀûÃâ¹°Àº ÀÔ·ÂµÈ ³»¿ªÀ¸·Î ÇѲ¨¹ø¿¡ ¹Ý¿µÇϵµ·Ï ÇÑ´Ù. //ÀԷ¹޴ ³»¿ª : ¼ö°ÅÀÏÀÚ, ¼ö°ÅÀÚ, È®ÀÎÀÚ var chk; var remvdd = model.getValue('/root/main/ipt_extinfo/remvdd'); //ÀԷ¹ÞÀº ¼ö°ÅÀÏÀÚ var remvnm = model.getValue('/root/main/ipt_extinfo/remvnm'); //ÀԷ¹ÞÀº ¼ö°ÅÀÚ var checknurid = model.getValue('/root/main/ipt_extinfo/checknurid'); //ÀԷ¹ÞÀº È®ÀÎÀÚ if(remvdd == null || remvdd == ''){ messageBox('¼ö°ÅÀÏÀÚ¸¦', 'C001'); return false; } if(remvnm == null || remvnm == ''){ messageBox('¼ö°ÅÀÚ¸¦', 'C001'); return false; } if(checknurid == null || checknurid == ''){ messageBox('È®ÀÎÀÚ¸¦', 'C002'); return; } for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){ chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk'); if(chk == 'Y'){ //üũµÈ ȯÀÚ¿¡°Ô ÀÔ·ÂÇÑ ÀûÃâ¹° ¼ö°Å Á¤º¸¸¦ ¼¼ÆÃÇÑ´Ù. model.setValue('/root/main/extinfo/extlist[' + i + ']/remvdd', remvdd); model.setValue('/root/main/extinfo/extlist[' + i + ']/remvnm', remvnm); model.setValue('/root/main/extinfo/extlist[' + i + ']/checknurid', checknurid); } } //model.refresh(); return true; } /** * @group : * @ver : 2008.07.02 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ExcelÆÄÀÏ·Î ÀúÀå * @param : * @param : * @return : * @--------------------------------------------------- */ function fSaveExcel(){ var exceldd = getCurrentDate(); if(rdo_rdocond.value == "b"){ exceldd = ipt_fromdd.value; } var fileName = window.fileDialog("save", ",", false, "ÀûÃâ¹°¸®½ºÆ®_"+exceldd, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); if (fileName != "") { grd_extlist.saveExcel(fileName, "SheetName", true, true, "", "", false); } } /** * @group : * @ver : 2008.07.02 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ¹Ì¼ö°Å¸®½ºÆ® Ãâ·Â¹° ¹Ì¸®º¸±â ½ÇÇà * @param : * @param : * @return : * @--------------------------------------------------- */ function fPrint(){ if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){ messageBox("Ãâ·ÂÇÒ ³»¿ªÀ» ¼±ÅÃÇϽʽÿä","I"); return; } model.makenode("/root/prnt/extinfo"); model.makenode("/root/prnt/totextinfo"); totalCnt = 0; totalWeig = 0; prntyy = ""; prntmm = ""; prntdd = ""; for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){ chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk'); if(chk == 'Y'){ //üũµÈ Á¤º¸ copy noderow = eval(getNodesetCount("/root/prnt/extinfo/extlist")) + 1; model.makenode("/root/prnt/extinfo/extlist["+noderow+"]"); model.copyNode("/root/prnt/extinfo/extlist["+noderow+"]", "/root/main/extinfo/extlist["+ i +"]"); //ÃÑ °³¼ö, ÃÑ Áß·® ÇÕ°è if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){ totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt")); } if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){ totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig")); } } } if(rdo_rdocond.value == "a"){ prntdd = ipt_fromdd.value.substr(0,4) + "-" + ipt_fromdd.value.substr(4,2) + "-" + ipt_fromdd.value.substr(6,2) + " ~ " + ipt_todd.value.substr(0,4) + "-" + ipt_todd.value.substr(4,2) + "-" + ipt_todd.value.substr(6,2) }else if(rdo_rdocond.value == "b"){ prntyy = ipt_fromdd.value.substr(0,4) + "³â"; prntmm = ipt_fromdd.value.substr(4,2) + "¿ù"; prntdd = ipt_fromdd.value.substr(6,2) + "ÀÏ"; }else if(rdo_rdocond.value == "c"){ prntyy = ipt_remvdd.value.substr(0,4) + "³â"; prntmm = ipt_remvdd.value.substr(4,2) + "¿ù"; prntdd = ipt_remvdd.value.substr(6,2) + "ÀÏ"; } model.makeValue("/root/prnt/totextinfo/prntflag", rdo_rdocond.value); model.makeValue("/root/prnt/totextinfo/prntyy", prntyy); model.makeValue("/root/prnt/totextinfo/prntmm", prntmm); model.makeValue("/root/prnt/totextinfo/prntdd", prntdd); model.makeValue("/root/prnt/totextinfo/totextcrcnt", totalCnt); model.makeValue("/root/prnt/totextinfo/totextcrweig", totalWeig); exeReportPreview("RPAVT00130", "XMLSTR"); //¹Ì¸®º¸±â model.removeNode("/root/prnt"); } /** * @group : * @ver : 2008.07.02 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ¼ö°Å±¸ºÐ Á¶È¸ Á¤º¸ º¯°æ ½Ã À̺¥Æ® * @param : * @param : * @return : * @--------------------------------------------------- */ function fValueChangedInfectRdo(pParam){ switch(pParam){ case "a": caption2.visible = true; //Á¶È¸ÀÏÀÚ caption ipt_fromdd.visible = true; //from ÀÏÀÚ caption7.visible = true; //~ caption ipt_todd.visible = true; //to ÀÏÀÚ btn_print.visible = false; //Ãâ·Â¹öư btn_cncl.visible = false; //¼ö°ÅÃë¼Ò¹öư break; case "b": caption2.visible = true; //Á¶È¸ÀÏÀÚ caption ipt_fromdd.visible = true; //from ÀÏÀÚ caption7.visible = false; //~ caption ipt_todd.visible = false; //to ÀÏÀÚ btn_print.visible = true; //Ãâ·Â¹öư btn_cncl.visible = true; //¼ö°ÅÃë¼Ò¹öư break; case "c": caption2.visible = false; //Á¶È¸ÀÏÀÚ caption ipt_fromdd.visible = false; //from ÀÏÀÚ caption7.visible = false; //~ caption ipt_todd.visible = false; //to ÀÏÀÚ btn_print.visible = true; //Ãâ·Â¹öư btn_cncl.visible = false; //¼ö°ÅÃë¼Ò¹öư break; } } /** * @group : * @ver : 2009.01.29 * @by : dhkim * @--------------------------------------------------- * @type : function * @access : public * @desc : ¼ö°ÅÃë¼Ò ¹öư À̺¥Æ® * @param : * @param : * @return : * @--------------------------------------------------- */ function fCncl(){ if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){ messageBox("¼ö°Å Ãë¼ÒÇÒ ³»¿ªÀ» ¼±ÅÃÇϽʽÿä.","I"); return; } model.removenode('/root/send'); model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('u')); if(!submit('TXAVT00131')){ messageBox('ÀûÃâ¹°Á¤º¸ ¼öÁ¤À»', 'E009'); return; }else{ fSearch(); } }