/* --------------------------------------------------------------------- ¼ö¼ú¸í´ÜList Á¶È¸ (SMMCT00202.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By taebum : 2009-09-23 ¿ÀÈÄ 2:39:33 ---------------------------------------------------------------------- */ /** * @group : * @ver : 2009-09-15 ¿ÀÈÄ 6:45:47 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : ÃʱâÈ­ * @param : * @return : * @--------------------------------------------------- */ function fInit(){ var currDate = getCurrentDate(); model.setValue("/root/main/condition/fromdd" , fCalcDate(currDate,-1)); model.setValue("/root/main/condition/todd" , currDate); model.refresh(); model.removeNodeSet("/root/main/opreflistinfo/opreflist"); grd_opreflst.refresh(); var instcd = getUserInfo("dutplceinstcd"); var rslt_ref = "/root/init/orddeptlist"; //model.setValue("/root/main/cond/orddeptcd", "%"); model.setValue("/root/main/condition/orddrid", ""); //zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate); submit("TRMCT00208"); //¼ö¼ú¹æ Á¤º¸ Á¶È¸ by ¹Ú¿µ¿ì 20091229 fGetOproomList(); addComboItem("cmb_subdept"); fValueChangedSchCombo(); } /* * 1´ÞÀ» ÀÚµ¿ ¼¼ÆÃµÇ°Ô ÇÏ´Â ÇÔ¼ö * sDate : ÀÏÀÚ(string) * iFlag : int 1/-1 (1´Þ ÀÌÀü/ÀÌÈÄÀÇ ³¯Â¥ °è»ê¿ëµµ) */ function fCalcDate(sDt,iFlag){ var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D") //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- ÇØ´ç¿äÀÏ rtnDate = sDate.getFullYear(); rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1)); rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ; return rtnDate; } /** * @group : * @ver : 2009-09-15 ¿ÀÈÄ 6:45:47 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : Á¶È¸ * @param : * @return : * @--------------------------------------------------- */ function fClickSearchBtn(){ model.resetInstanceNode("/root/send"); var todd = model.getValue("/root/main/condition/todd"); var fromdd = model.getValue("/root/main/condition/fromdd"); var subdeptcd = model.getValue("/root/main/condition/subdeptcd"); var orddrid = model.getValue("/root/main/condition/orddrid"); var tab = model.getValue("/root/main/condition/tab"); //¹æº°, °úº° ¼±Åà ÅÇ by ¹Ú¿µ¿ì 20091229 var oproomcd = model.getValue("/root/main/condition/oproomcd"); var oppatflagcd = model.getValue("/root/main/condition/oppatflagcd"); //º´µ¿,¿Ü·¡±¸ºÐ by ¹Ú¿µ¿ì 20091229 var opscale = model.getValue("/root/main/condition/opscale"); //´ëÁß¼Ò ±¸ºÐ by ¹Ú¿µ¿ì 20091229 if(fromdd == "" || fromdd == "undefined" || fromdd == null){ model.alert("½ÃÀÛÀÏÀÚ´Â Çʼö ÀÔ·Â Ç׸ñÀÔ´Ï´Ù."); return; } if(todd == "" || todd == "undefined" || todd == null){ model.alert("Á¾·áÀÏÀÚ´Â Çʼö ÀÔ·Â Ç׸ñÀÔ´Ï´Ù."); return; } //ÇöÀç½Ã°£À» ºñ±³ÇÏ¿© ±Ù¹«½Ã°£ ÀÌÈÄÀÏ °æ¿ì 6°³¿ùÀÌ»ó Á¶È¸°¡´É Çϵµ·Ï ¼³Á¤ var sCurrentTm = getCurrentTime().substr(0,4); var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K"); if(sCurrentDay == "¿ù" || sCurrentDay == "È­" || sCurrentDay == "¼ö" || sCurrentDay == "¸ñ" || sCurrentDay == "±Ý"){ //¿ÀÈÄ 5½Ã ÀÌÀüÀÏ °æ¿ì Á¶È¸ Á¶°ÇÀº 1´ÞÀÌ»ó Á¶È¸µÇÁö ¾Êµµ·Ï ÇÔ. if(sCurrentTm < "1700"){ var sSearchTerm = getDateInterval(fromdd, todd); if(sSearchTerm > 30){ model.alert("±Ù¹«½Ã°£¿¡´Â 1´Þ ÀÌ»ó Á¶È¸ÇÒ ¼ö ¾ø½À´Ï´Ù."); return; } } } model.setValue("/root/send/todd" , todd ); model.setValue("/root/send/fromdd" , fromdd ); model.setValue("/root/send/tab" , tab ); // ¹æº°, °úº°, Àǻ纰 ±¸ºÐ Ãß°¡ by ¹Ú¿µ¿ì 20091229 model.setValue("/root/send/subdeptcd", subdeptcd); model.setValue("/root/send/orddrid" , orddrid ); model.setValue("/root/send/oproomcd" , oproomcd ); model.setValue("/root/send/oppatflagcd", oppatflagcd); //º´µ¿,¿Ü·¡±¸ºÐ by ¹Ú¿µ¿ì 20091229 model.setValue("/root/send/opscale" , opscale); //´ëÁß¼Ò ±¸ºÐ by ¹Ú¿µ¿ì 20091229 model.removeNodeSet("/root/main/opreflistinfo/opreflist"); grd_opreflst.refresh(); if(submit("TRMCT00202")){ }else{ model.alert("¼ö¼ú¸í´Ü Á¶È¸ ½Ã ¼­¹ö ¿À·ù°¡ ¹ß»ýµÇ¾ú½À´Ï´Ù."); return; } } /** * @group : * @ver : 2009-09-15 ¿ÀÈÄ 6:45:47 * @by : * @--------------------------------------------------- * @type : function * @access : public * @desc : Áø·á°ú º¯°æ½Ã ÀÇ»ç Á¶È¸ À̺¥Æ® * @param : * @return : * @--------------------------------------------------- */ function fValueChangedOrddrCombo(){ var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // ´ëÇ¥/ºÐ°ú/¼­ºê ±¸ºÐ var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // ¼¾ÅÍ/´ëÇ¥ ±¸ºÐ var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // »óÀ§ºÎ¼­ÄÚµå var tab = model.getValue("/root/main/condition/tab"); //¹æº°, °úº° ¼±Åà ÅÇ by ¹Ú¿µ¿ì 20091229 var sorddeptflag = ""; if (sorddeptkind == "C") { // ¼¾ÅÍÀ̸é sorddeptflag = "C"; } else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // ¼¾ÅͰ¡ ¾Æ´Ï¸é¼­ ºÐ°úÀ̸é sorddeptflag = "A"; } else { // ±×¿Ü¿¡ ±âŸ°ú sorddeptflag = "etc"; } if(model.getValue("/root/main/condition/subdeptcd") == ""){ model.setValue("/root/main/condition/orddrid",""); cmb_orddrid.refresh(); } model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag); model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd); model.makeValue("/root/send/reqdata/prcpspecflag", "Y"); model.makeValue("/root/send/reqdata/orddd", getCurrentDate()); model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/condition/subdeptcd")); if(tab=="D") { //°ú,Àǻ纰ÀÏ °æ¿ì¿¡¸¸ Àǻ縮½ºÆ® Á¶È¸ by ¹Ú¿µ¿ì 20091229 submit("TRMNO00104"); // Àǻ縮½ºÆ® Á¶È¸ addComboItem("cmb_orddrid"); } } /** * @group : * @ver : 2009-12-29 ¿ÀÈÄ 3:17:47 * @by : ¹Ú¿µ¿ì * @--------------------------------------------------- * @type : function * @access : public * @desc : °Ë»ö combo º¯°æ½Ã À̺¥Æ® * @param : * @return : * @--------------------------------------------------- */ function fValueChangedSchCombo(){ var sTab = model.getValue("/root/main/condition/tab"); if(sTab == "R"){ //¹æº° //comboº¯°æ½Ã ½Ã°£ ÀçÁ¶Á¤ by ¹Ú¿µ¿ì 20091229 model.removenodeset("/root/main/opreflistinfo"); model.setValue("/root/main/condition/oproomcd", ""); model.setValue("/root/main/condition/subdeptcd", ""); model.setValue("/root/main/condition/orddrid", ""); model.setValue("/root/main/condition/oppatflagcd", ""); model.setValue("/root/main/condition/opscale", ""); caption4.visible = true; cmb_oproom.visible = true; caption7.visible = false; cmb_subdept.visible = false; caption2.visible = false; cmb_orddrid.visible = false; grd_opreflst.colhidden(grd_opreflst.colref("oproomnm"))=false; grd_opreflst.colhidden(grd_opreflst.colref("deptengabbr"))=true; grd_opreflst.colhidden(grd_opreflst.colref("perfdrnm"))=true; model.refresh(); }else if(sTab == "E"){ //°úº° Ãß°¡ by ¹Ú¿µ¿ì 20091219 model.removenodeset("/root/main/opreflistinfo"); model.setValue("/root/main/condition/oproomcd", ""); model.setValue("/root/main/condition/subdeptcd", ""); model.setValue("/root/main/condition/orddrid", ""); model.setValue("/root/main/condition/oppatflagcd", ""); model.setValue("/root/main/condition/opscale", ""); caption4.visible = false; cmb_oproom.visible = false; caption7.visible = true; cmb_subdept.visible = true; caption2.visible = false; cmb_orddrid.visible = false; grd_opreflst.colhidden(grd_opreflst.colref("oproomnm"))=true; grd_opreflst.colhidden(grd_opreflst.colref("deptengabbr"))=false; grd_opreflst.colhidden(grd_opreflst.colref("perfdrnm"))=true; model.refresh(); }else if(sTab == "D"){ //comboº¯°æ½Ã ±×¸®µå, °úº°, Àǻ纰, ½Ã°£ ÀçÁ¶Á¤ by ¹Ú¿µ¿ì 20091229 model.removenodeset("/root/main/opreflistinfo"); model.setValue("/root/main/condition/oproomcd", ""); model.setValue("/root/main/condition/subdeptcd", ""); model.setValue("/root/main/condition/orddrid", ""); model.setValue("/root/main/condition/oppatflagcd", ""); model.setValue("/root/main/condition/opscale", ""); caption4.visible = false; cmb_oproom.visible = false; caption7.visible = true; cmb_subdept.visible = true; caption2.visible = true; cmb_orddrid.visible = true; grd_opreflst.colhidden(grd_opreflst.colref("oproomnm"))=true; grd_opreflst.colhidden(grd_opreflst.colref("deptengabbr"))=false; grd_opreflst.colhidden(grd_opreflst.colref("perfdrnm"))=false; model.refresh(); } } /** * @group : * @ver : 2009-12-29 ¿ÀÈÄ 2:40:39 * @by : ¹Ú¿µ¿ì * @--------------------------------------------------- * @type : function * @access : public * @desc : Excel ÀúÀå ¹öư Ŭ¸¯ ½Ã * @param : * @return : * @--------------------------------------------------- */ function fOnClickExcelBtn(){ var tab = model.getValue("/root/main/condition/tab"); var title = ""; var fileName = ""; if(tab == "R") { title = "¼ö¼ú¸í´Ü(¹æº°)_"+getCurrentDate(); fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); } else if(tab == "E") { title = "¼ö¼ú¸í´Ü(°úº°)_"+getCurrentDate(); fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); } else { title = "¼ö¼ú¸í´Ü(Àǻ纰)_"+getCurrentDate(); fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls"); } if (fileName != "" && fileName != null){ grd_opreflst.saveExcel(fileName, "sheetname: "+title+"; colhiddenextend: false; rowhiddenextend: true;"); var s = fileName.lastIndexOf("\\"); var fileName=fileName.substring(s+1); var rmsg = messageBox("ÀúÀåµÈ ExcelÀ»", "Q004"); if( rmsg == 6 ){ window.exec("excel.exe", fileName); } } } /** * @group : * @ver : 2009-12-29 ¿ÀÈÄ 3:00:47 * @by : ¹Ú¿µ¿ì * @--------------------------------------------------- * @type : function * @access : public * @desc : ¼ö¼ú¹æ Á¤º¸ Á¶È¸ * @param : * @return : * @--------------------------------------------------- */ function fGetOproomList(){ model.setValue("/root/send/fromdd" , getCurrentDate() ); //ÇöÀçÀÏÀÚ¿¡ À¯È¿ÇÑ ¼ö¼ú¹æÀ» Á¶È¸ÇÑ´Ù. submit("TRMCT00207"); addComboItem("cmb_oproom"); }