var delayTime = ""; var saveCnt = ""; var saveState = ""; function fInitialize(){ saveCnt = "0"; model.resetInstanceNode("/root/main/grthlist/list/grth"); model.removeNodeset("/root/main/grthlist/list/grth"); model.resetInstanceNode("/root/main/laborlist/list/labor"); model.removeNodeset("/root/main/laborlist/list/labor"); model.removeNodeset("/root/main/paminfo/pamlist"); //20110808 fGetHardCDList("N", 5555, 0 , "/root/init/dept/item"); //¼ºÀå°î¼±°ü·Ã Áø·á°ú //20110808 combo4.select(0); var sPamInfo = getGlobalVariable("paminfo"); setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist"); //ȯÀÚÁ¤º¸³»¸®±â var sPID = model.getValue("/root/main/paminfo/pamlist/pid"); var hngnm = model.getValue("/root/main/paminfo/pamlist/hngnm"); var brthdd = model.getValue("/root/main/paminfo/pamlist/brthdd"); var rrgstno1 = model.getValue("/root/main/paminfo/pamlist/rrgstno1"); if(brthdd == ""){ if(sPID != ""){ var temp = rrgstno1.substr(0,2); if(parseInt(temp) > 50){ brthdd = "19"+rrgstno1; } else{ brthdd = "20"+rrgstno1; } } } var sex = model.getValue("/root/main/paminfo/pamlist/sex"); var orddeptcd = model.getValue("/root/main/paminfo/pamlist/orddeptcd"); model.setValue("/root/send/pid", sPID); model.setValue("/root/main/cond/hngnm", hngnm); model.setValue("/root/main/cond/sex", sex); if(sPID != ""){ model.setValue("/root/main/cond/rrgstno1", rrgstno1+"-*******"); } model.setValue("/root/send/orgbrthdd", brthdd); var userid = getUserInfo("userid"); var userDept = getUserInfo("dutplcecd"); //2012/02/20 Start Ä¥°î ³»ºÐºñ´ë»ç¼¾ÅÍ¿¡¼­ ¼Ò¾ÆÃ»¼Ò³â°úÀÇ ¼ºÀå°î¼±À» ¿ÀÇ½à °úÄڵ带 º¯°æ if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2363400000"){ //<-- Ä¥°îÀ̸鼭 ³»ºÐºñ´ë»ç¼¾ÅÍ·Î ·Î±×Àνà userDept="2110000000"; //<-- ¼Ò¾ÆÃ»¼Ò³â°ú } //2012/02/20 End //2013/05/13 Start Ä¥°î ¾î¸°À̺´¿ø ¿Ü·¡¼¾ÅÍ¿¡¼­ ¼Ò¾ÆÃ»¼Ò³â°úÀÇ ¼ºÀå°î¼±À» ¿ÀÇ½à °úÄڵ带 º¯°æ if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2880000000"){ //<-- Ä¥°îÀ̸鼭 ¾î¸°À̺´¿ø¿Ü·¡¼¾ÅÍ·Î ·Î±×Àνà userDept="2110000000"; //<-- ¼Ò¾ÆÃ»¼Ò³â°ú } //2013/05/13 End //2014/03/06 Start Ä¥°î ¹ß´ÞÀçȰ¼¾ÅÍ¿¡¼­ ·Î±×Àνà °úÄڵ带 º¯°æ if(getUserInfo("dutplceinstcd")=="032" && getUserInfo("dutplcecd")=="2990000000"){ //<-- Ä¥°îÀ̸鼭 ¾î¸°À̺´¿ø¿Ü·¡¼¾ÅÍ·Î ·Î±×Àνà userDept="2110000000"; //<-- ¼Ò¾ÆÃ»¼Ò³â°ú } //2014/04/01 Start /* ¼Ò¾ÆÃ»¼Ò³â ³»ºÐºñ 2112300000 ¼Ò¾ÆÃ»¼Ò³â ¼ÒÈ­±â¿µ¾ç 2112400000 ¼Ò¾ÆÃ»¼Ò³â ½Å°æ 2112500000 ½Å»ý¾Æ 2110500000 ¼Ò¾ÆÃ»¼Ò³â ½ÅÀå 2112600000 ¼Ò¾ÆÃ»¼Ò³â ½ÉÀå 2112700000 ¼Ò¾Æ ¾Ë·¹¸£±â È£Èí±â 2112800000 ¼Ò¾ÆÃ»¼Ò³â Ç÷¾×Á¾¾ç 2112900000 */ if(getUserInfo("dutplceinstcd")=="032" && (getUserInfo("dutplcecd")=="2112300000" || getUserInfo("dutplcecd")=="2112400000" || getUserInfo("dutplcecd")=="2112500000" || getUserInfo("dutplcecd")=="2110500000" || getUserInfo("dutplcecd")=="2112600000" || getUserInfo("dutplcecd")=="2112700000" || getUserInfo("dutplcecd")=="2112800000" || getUserInfo("dutplcecd")=="2112900000")){ userDept="2110000000"; //<-- ¼Ò¾ÆÃ»¼Ò³â°ú } //2014/04/01 End //2013/05/13 End //2012/06/13 ÁÖ¼®Ã³¸® Start /* if(userid == "DEVB08"){ userDept = "2100000000"; model.setValue("/root/send/orddeptcd", "2100000000"); } */ //2012/06/13 ÁÖ¼®Ã³¸® End // ÀúÀå ¹öư ±ÇÇѰü¸® switch(userDept){ case "2110000000": case "2030000000": case "2070000000": case "3050146000": button7.disabled = false; button8.disabled = false; btn_gr.visible = true; break; case "2100000000": button13.disabled = false; button15.disabled = false; btn_lb.visible = true; break; case "2120000000": btn_ht.visible = true; break; } if(userDept=="3050146000"){ model.setValue("/root/send/orddeptcd", "2030000000"); }else if(userDept=="2070000000"){ model.setValue("/root/send/orddeptcd", "2070000000"); }else{ model.setValue("/root/send/orddeptcd", userDept); } /*if(userid == "EMR" || userid == "DEVB08"){ model.setValue("/root/send/orddeptcd", "2110000000"); }*/ // ¹Ìºñ Popup½Ã È­¸é ¼³Á¤ var unprepflag = opener.javascript.getParameter("unprepflag"); if(unprepflag == "Y"){ model.setValue("/root/send/orddeptcd", "2100000000"); } // ¼ºÀ嵵ǥ, Labor note, 100 Hue test ¼±Åà orddeptcd = model.getValue("/root/send/orddeptcd"); switch(orddeptcd){ case "2110000000": case "2030000000": case "2070000000": model.setValue("/root/send/flag", "1"); group2.visible = true; group3.visible = false; break; case "2100000000": model.setValue("/root/labor/send/flag", "2"); group2.visible = false; group3.visible = true; break; } model.setValue("/root/rec/send/formflag", model.getValue("/root/send/flag")); if(sPID == "" && userid == "DEVB08"){ model.setValue("/root/send/pid", "18942082"); //model.setValue("/root/main/cond/hngnm", "À̾ÆÀÌ"); //model.setValue("/root/main/cond/sex", "F"); //model.setValue("/root/main/cond/rrgstno1", "030301-3******"); //model.setValue("/root/send/orgbrthdd", "20030301"); } model.setValue("/root/rec/send/fromdd", getDateAddc(getCurrentDate(), -365)); model.setValue("/root/rec/send/todd", getCurrentDate()); model.removeNodeset("/root/init/orddd"); submit("TRMRF05201"); var nodeCnt = getNodesetCount("/root/init/orddd"); // »ó´ÜÁ¤º¸ ¹Þ¾ÒÀ»¶§ Áø·áÀÏÀÚ ¼±Åà ºÎºÐ if(nodeCnt > 0){ var ioflag = model.getValue("/root/main/paminfo/pamlist/ioflag"); var orddd; if(ioflag == "I"){ orddd = model.getValue("/root/main/paminfo/pamlist/indd"); } else if(ioflag == "O"){ orddd = model.getValue("/root/main/paminfo/pamlist/orddd"); } var rowcnt = ""; for( i = 1; i <= nodeCnt; i++ ){ var ordtype = model.getValue("/root/init/orddd["+i+"]/ordtype"); var dd = model.getValue("/root/init/orddd["+i+"]/orddd"); if( ioflag == ordtype && orddd == dd){ rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt"); } } if(rowcnt != ""){ model.setValue("/root/send/ordd", rowcnt); } else if(rowcnt == "") { combo2.select(0); } } fCalcAge(); // ±×·¡ÇÁ ¼±Åà fSelectGraph(); if(orddeptcd == "2110000000" || orddeptcd == "2030000000" || orddeptcd == "2070000000"){ fGetGrphData(); // ÇàÃß°¡ grd_grth.addRow(); var cur_row = grd_grth.row-1; var curDate = getCurrentDate(); var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd", maskDate); //20110811 var time=getCurrentTime(); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/rectime", time.substring(0, 4)); //20110811 model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/seq", grd_grth.row-1); fCalcGrid(); model.refresh(); // Ãâ»ý ¿¹Á¤ÀÏ var saveflag = ""; saveflag = model.getValue("/root/send/saveflag"); var year = model.getValue("/root/main/cond/year"); var month = model.getValue("/root/main/cond/month"); var result = saveflag.indexOf("7"); if(result == "-1"){ model.setValue("/root/send/brthschedd", ""); input21.disabled = true; } else { input21.disabled = false; } if(saveflag == ""){ // 25°³¿ù ÀÌ»ó À̸é 2~18¼¼ ±×·¡ÇÁ ¼±Åà var sMonth = parseInt(year)*12 + parseInt(month); if(sMonth >24){ model.setValue("/root/main/cond/chart", "2"); model.setValue("/root/send/saveflag", "2"); button1.selected = true; } else{ model.setValue("/root/main/cond/chart", "1"); model.setValue("/root/send/saveflag", "1"); button2.selected = true; } } else{ var vResult = saveflag.indexOf("1"); var rslt = saveflag.indexOf("2"); if(vResult != "-1"){ model.setValue("/root/main/cond/chart", "1"); button2.selected = true; } if(rslt != "-1"){ model.setValue("/root/main/cond/chart", "2"); button1.selected = true; } } model.refresh(); var index = combo2.value; if(sPID != "" && nodeCnt > 0){ var orddd = model.getValue("/root/init/orddd["+index+"]/orddd"); var cretno = model.getValue("/root/init/orddd["+index+"]/cretno"); var orddeptcd = model.getValue("/root/init/orddd["+index+"]/orddeptcd"); var orddrid = model.getValue("/root/init/orddd["+index+"]/orddrid"); var ordtype = model.getValue("/root/init/orddd["+index+"]/ordtype"); model.setValue("/root/send/orddd", orddd); model.setValue("/root/send/cretno", cretno); model.setValue("/root/send/orddeptcd", orddeptcd); model.setValue("/root/send/orddrid", orddrid); model.setValue("/root/send/signgenrflag", ordtype); } fMakeChart(); }else if(orddeptcd == "2100000000"){ fGetLaborData(); fMakeLaborGraph(); } //2014/04/01 Start /* ¼Ò¾ÆÃ»¼Ò³â ³»ºÐºñ 2112300000 ¼Ò¾ÆÃ»¼Ò³â ¼ÒÈ­±â¿µ¾ç 2112400000 ¼Ò¾ÆÃ»¼Ò³â ½Å°æ 2112500000 ½Å»ý¾Æ 2110500000 ¼Ò¾ÆÃ»¼Ò³â ½ÅÀå 2112600000 ¼Ò¾ÆÃ»¼Ò³â ½ÉÀå 2112700000 ¼Ò¾Æ ¾Ë·¹¸£±â È£Èí±â 2112800000 ¼Ò¾ÆÃ»¼Ò³â Ç÷¾×Á¾¾ç 2112900000 */ if(getUserInfo("dutplceinstcd")=="032" && (getUserInfo("dutplcecd")=="2112300000" || getUserInfo("dutplcecd")=="2112400000" || getUserInfo("dutplcecd")=="2112500000" || getUserInfo("dutplcecd")=="2110500000" || getUserInfo("dutplcecd")=="2112600000" || getUserInfo("dutplcecd")=="2112700000" || getUserInfo("dutplcecd")=="2112800000" || getUserInfo("dutplcecd")=="2112900000")){ model.setValue("/root/send/orddeptcd", getUserInfo("dutplcecd")); combo1.refresh(); } //2014/04/01 End } function fMakeChart(){ TChart1.ClearChart(); TChart1.RemoveAllSeries(); TChart1.Axis.RemoveAllCustom(); //TChart1.ClearChart(); var graph = model.getValue("/root/main/cond/chart"); var sex = model.getValue("/root/main/cond/sex"); //margin °ª Á¤Çϱâ TChart1.Panel.MarginTop = 2; TChart1.Panel.MarginLeft = 5; TChart1.Panel.MarginRight = 7; TChart1.Panel.MarginBottom = 3; // TChart1.Axis.Bottom.TickLength = 1010; //20110711 ÀÌÁ¤Åà ¼öÁ¤ if(graph=="3" && sex=="M"){ TChart1.Panel.MarginTop = 2.8; TChart1.Panel.MarginLeft = 6; TChart1.Panel.MarginRight = 7; TChart1.Panel.MarginBottom = 7.5; }else if(graph=="3" && sex=="F"){ TChart1.Panel.MarginTop = 2.5; TChart1.Panel.MarginLeft = 6; TChart1.Panel.MarginRight = 7.2; TChart1.Panel.MarginBottom = 10; }else if(graph=="3" && sex==""){ TChart1.Panel.MarginTop = 2.5; TChart1.Panel.MarginLeft = 6; TChart1.Panel.MarginRight = 7.2; TChart1.Panel.MarginBottom = 10; } if(graph=="4" && sex=="M"){ TChart1.Panel.MarginTop = 2.8; TChart1.Panel.MarginLeft = 6; TChart1.Panel.MarginRight = 10.6; TChart1.Panel.MarginBottom = 7; }else if(graph=="4" && sex=="F"){ TChart1.Panel.MarginTop = 2.5; TChart1.Panel.MarginLeft = 5.9; TChart1.Panel.MarginRight = 10.6; TChart1.Panel.MarginBottom = 8; }else if(graph=="4" && sex==""){ TChart1.Panel.MarginTop = 2.5; TChart1.Panel.MarginLeft = 5.9; TChart1.Panel.MarginRight = 10.6; TChart1.Panel.MarginBottom = 8; } /* 20110808 if(graph=="5" && sex=="M"){ // TChart1.Panel.MarginTop = 2.8; // TChart1.Panel.MarginLeft = 6; TChart1.Panel.MarginRight = 9; TChart1.Panel.MarginBottom = 7.5; // TChart1.Panel.BevelInner = 0; // TChart1.Panel.BevelOuter = 0; } else if(graph=="5" && sex=="F"){ TChart1.Panel.MarginTop = 2.5; TChart1.Panel.MarginLeft = 5.9; TChart1.Panel.MarginRight = 10.6; TChart1.Panel.MarginBottom = 8; } */ //20110711 ÀÌÁ¤Åà ¼öÁ¤ //ÇÏ´ÜÃà Ä­ ¼ö Á¤Çϱâ¿Í ´«±Ý ¾ø¾Ö±â //TChart1.Axis.Bottom.SetMinMax (0, MinTimeConst * 60 * 24 * 7 - 1); //7ÀÏ µ¿¾È ÁÂÇ¥¸¦ Ç¥Çö if(graph == "2" || graph == "3" || graph == "5"){ TChart1.Axis.Bottom.SetMinMax (2, 18.5); //7ÀÏ µ¿¾È ÁÂÇ¥¸¦ Ç¥Çö (ÇÏ·ç´Â DivPerDay¸¸Å­ ³ª´²Áü) TChart1.Axis.Bottom.Increment = 1; } else if (graph == "1" || graph == "4"){ TChart1.Axis.Bottom.SetMinMax (0, 36); //7ÀÏ µ¿¾È ÁÂÇ¥¸¦ Ç¥Çö (ÇÏ·ç´Â DivPerDay¸¸Å­ ³ª´²Áü) TChart1.Axis.Bottom.Increment = 3; } TChart1.Axis.Bottom.MinorTickCount = 1; //TChart1.Axis.Bottom.Title.Caption = "°³¿ù"; TChart1.Axis.Bottom.AxisPen.Color = 0x000000; //TChart1.Axis.Bottom.GridPen.Color = 0x000000; //Ãà Á¡¼±ÀÇ »ö ¼³Á¤ TChart1.Axis.Bottom.Labels.Font.Color = 0x000000; //ÇÏ´Ü Ãà ´«±Ý ¸íĪ »ö TChart1.Header.Visible = false; //TChart1.Header.Text(0)="¼ºÀ嵵ǥ"; //Çì´õÁ¦¸ñ³Ö±â TChart1.Header.Font.Bold = true; //Çì´õ ±½°Ô TChart1.Header.Font.Size = 5; //Çì´õ »çÀÌÁî TChart1.Aspect.View3D = 0; //2d ·Î Ç¥ÇöÇϱâ //TChart1.Aspect.Chart3DPercent = 2; TChart1.Zoom.enable = false; // zoom »ç¿ëÇÏÁö ¾Ê±â TChart1.Scroll.Enable = false; // scroll »ç¿ëÇÏÁö ¾Ê±â TChart1.Legend.Visible = false; // ±×·¡ÇÁ ÂüÁ¶ ¹Ú½º ¶ç¿ìÁö ¾Ê±â TChart1.Environment.MouseWheelScroll = false; //TChart1.Panel.Gradient.Visible = true; // Æä³Î¿¡ ±×¶óµð¾ðÆ® Àû¿ë var cus_axis1 = TChart1.Axis.AddCustom(false); // ½ÅÀåÃà(2-18) TChart1.Axis.Custom(0).Visible = false; TChart1.Axis.Custom(0).AxisPen.Color = 0x147814; TChart1.Axis.Custom(0).Title.Visible = false TChart1.Axis.Custom(0).Title.Caption = "½ÅÀå" TChart1.Axis.Custom(0).Title.Font.Size = 8; // TChart1.Axis.Custom(0).Title.Font.Bold = true; TChart1.Axis.Custom(0).Title.Angle = 90; TChart1.Axis.Custom(0).PositionPercent = 0; TChart1.Axis.Custom(0).StartPosition = 0; TChart1.Axis.Custom(0).EndPosition = 100; TChart1.Axis.Custom(0).Automatic = false; TChart1.Axis.Custom(0).Maximum = 190; TChart1.Axis.Custom(0).Minimum = 60; TChart1.Axis.Custom(0).Increment = 5; var cus_axis2 = TChart1.Axis.AddCustom(false); // üÁßÃà(2-18) TChart1.Axis.Custom(1).Visible = false; TChart1.Axis.Custom(1).AxisPen.Color = 0x00ff00; TChart1.Axis.Custom(1).Title.Visible = false TChart1.Axis.Custom(1).Title.Caption = "üÁß"; TChart1.Axis.Custom(1).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(1).Title.Angle = 90; TChart1.Axis.Custom(1).PositionPercent = 106; TChart1.Axis.Custom(1).Automatic = false; TChart1.Axis.Custom(1).Maximum = 135; TChart1.Axis.Custom(1).Minimum = 5; TChart1.Axis.Custom(1).Increment = 5; var cus_axis3 = TChart1.Axis.AddCustom(false); // ½ÅÀåÃà(0-36) TChart1.Axis.Custom(2).Visible = false; TChart1.Axis.Custom(2).AxisPen.Color = 0x147814; TChart1.Axis.Custom(2).Title.Visible = false TChart1.Axis.Custom(2).Title.Caption = "½ÅÀå"; TChart1.Axis.Custom(2).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(2).Title.Angle = 90; TChart1.Axis.Custom(2).PositionPercent = 0; TChart1.Axis.Custom(2).Automatic = false; TChart1.Axis.Custom(2).Maximum = 105; TChart1.Axis.Custom(2).Minimum = -10; TChart1.Axis.Custom(2).Increment = 5; var cus_axis4 = TChart1.Axis.AddCustom(false); // üÁßÃà(0-36) TChart1.Axis.Custom(3).Visible = false; TChart1.Axis.Custom(3).AxisPen.Color = 0x00ff00; TChart1.Axis.Custom(3).Title.Visible = false TChart1.Axis.Custom(3).Title.Caption = "üÁß"; TChart1.Axis.Custom(3).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(3).Title.Angle = 90; TChart1.Axis.Custom(3).PositionPercent = 100; TChart1.Axis.Custom(3).Automatic = false; TChart1.Axis.Custom(3).Maximum = 25; TChart1.Axis.Custom(3).Minimum = 2; TChart1.Axis.Custom(3).Increment = 1; var cus_axis5 = TChart1.Axis.AddCustom(false); // üÁú·®Ãà(2-18) TChart1.Axis.Custom(4).AxisPen.Color = 0x00ff00; TChart1.Axis.Custom(4).Title.Visible = false TChart1.Axis.Custom(4).Title.Caption = "üÁú·®"; TChart1.Axis.Custom(4).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(4).Title.Angle = 90; TChart1.Axis.Custom(4).PositionPercent = 0; TChart1.Axis.Custom(4).Automatic = false; TChart1.Axis.Custom(4).Maximum = 32; TChart1.Axis.Custom(4).Minimum = 10; TChart1.Axis.Custom(4).Increment = 2; var cus_axis6 = TChart1.Axis.AddCustom(false); // ¸Ó¸®µÑ·¹Ãà(0-36) TChart1.Axis.Custom(5).AxisPen.Color = 0x00ff00; TChart1.Axis.Custom(5).Title.Visible = false TChart1.Axis.Custom(5).Title.Caption = "¸Ó¸®µÑ·¹"; TChart1.Axis.Custom(5).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(5).Title.Angle = 90; TChart1.Axis.Custom(5).PositionPercent = 0; TChart1.Axis.Custom(5).Automatic = false; TChart1.Axis.Custom(5).Maximum = 58; TChart1.Axis.Custom(5).Minimum = 30; TChart1.Axis.Custom(5).Increment = 2; var cus_axis7 = TChart1.Axis.AddCustom(false); // ÈäºÎµÑ·¹Ãà TChart1.Axis.Custom(6).AxisPen.Color = 0x00ff00; TChart1.Axis.Custom(6).Title.Visible = false TChart1.Axis.Custom(6).Title.Caption = "¸Ó¸®µÑ·¹"; TChart1.Axis.Custom(6).Title.Font.Size = 8; // TChart1.Axis.Custom(1).Title.Font.Bold = true; TChart1.Axis.Custom(6).Title.Angle = 90; TChart1.Axis.Custom(6).PositionPercent = 0; TChart1.Axis.Custom(6).Automatic = false; TChart1.Axis.Custom(6).Maximum = 66; TChart1.Axis.Custom(6).Minimum = 25; TChart1.Axis.Custom(6).Increment = 1; TChart1.AddSeries (4); if(graph == "1"){ TChart1.AddSeries (4); } else if(graph == "2"){ TChart1.AddSeries (4); TChart1.AddSeries (4); TChart1.AddSeries (4); TChart1.AddSeries (4); } if(graph == "1"){ TChart1.Series(0).VerticalAxisCustom = cus_axis3; TChart1.Series(1).VerticalAxisCustom = cus_axis4; } else if(graph == "2"){ TChart1.Series(0).VerticalAxisCustom = cus_axis1; TChart1.Series(1).VerticalAxisCustom = cus_axis2; TChart1.Series(2).VerticalAxisCustom = cus_axis1; TChart1.Series(3).VerticalAxisCustom = cus_axis1; TChart1.Series(4).VerticalAxisCustom = cus_axis1; } else if(graph == "3"){ TChart1.Series(0).VerticalAxisCustom = cus_axis5; } else if(graph == "4" || graph == "5"){ TChart1.Series(0).VerticalAxisCustom = cus_axis6; } else if(graph == "6"){ TChart1.Series(0).VerticalAxisCustom = cus_axis7; } //¶óÀÎÀÇ ±½±â¸¦ Á¤ÇØÁØ´Ù. if(graph == "1"){ TChart1.Series(0).Color = 0x147814; TChart1.Series(1).Color = 0x00ff00; } else if(graph == "2"){ TChart1.Series(0).Color = 0x147814; TChart1.Series(1).Color = 0x00ff00; TChart1.Series(2).Color = 0x0000ff; TChart1.Series(3).Color = 0xff0000; TChart1.Series(4).Color = 0x000000; } TChart1.Series(0).asPoint.Pointer.Visible = true; TChart1.Series(0).asPoint.Pointer.Style = 1; TChart1.Series(0).asPoint.Pointer.VerticalSize = 3; TChart1.Series(0).asPoint.Pointer.HorizontalSize = 3; TChart1.Series(0).Marks.visible = false; TChart1.Series(0).Marks.Style = 0; TChart1.Series(0).Marks.ArrowLength = 10; TChart1.Series(0).Marks.Arrow.Style = 0; TChart1.Series(0).Marks.Arrow.Color = 0x147814; if(graph == "1"){ TChart1.Series(1).asPoint.Pointer.Visible = true; TChart1.Series(1).asPoint.Pointer.Style = 1; TChart1.Series(1).asPoint.Pointer.VerticalSize = 3; TChart1.Series(1).asPoint.Pointer.HorizontalSize = 3; TChart1.Series(1).Marks.visible = false; TChart1.Series(1).Marks.Style = 0; TChart1.Series(1).Marks.ArrowLength = 10; TChart1.Series(1).Marks.Arrow.Style = 0; TChart1.Series(1).Marks.Arrow.Color = 0x00ff00; } else if(graph == "2"){ TChart1.Series(1).asPoint.Pointer.Visible = true; TChart1.Series(1).asPoint.Pointer.Style = 1; TChart1.Series(1).asPoint.Pointer.VerticalSize = 3; TChart1.Series(1).asPoint.Pointer.HorizontalSize = 3; TChart1.Series(1).Marks.visible = false; TChart1.Series(1).Marks.Style = 0; TChart1.Series(1).Marks.ArrowLength = 10; TChart1.Series(1).Marks.Arrow.Style = 0; TChart1.Series(1).Marks.Arrow.Color = 0x00ff00; TChart1.Series(2).asPoint.Pointer.Visible = true; TChart1.Series(2).asPoint.Pointer.Style = 10; TChart1.Series(2).asPoint.Pointer.VerticalSize = 5; TChart1.Series(2).asPoint.Pointer.HorizontalSize = 5; TChart1.Series(2).Marks.visible = false; TChart1.Series(2).Marks.Style = 0; TChart1.Series(2).Marks.ArrowLength = -40; TChart1.Series(2).Marks.Arrow.Style = 0; TChart1.Series(2).Marks.Arrow.Color = 0xff0000; TChart1.Series(3).asPoint.Pointer.Visible = true; TChart1.Series(3).asPoint.Pointer.Style = 10; TChart1.Series(3).asPoint.Pointer.VerticalSize = 5; TChart1.Series(3).asPoint.Pointer.HorizontalSize = 5; TChart1.Series(3).Marks.visible = false; TChart1.Series(3).Marks.Style = 0; TChart1.Series(3).Marks.ArrowLength = 40; TChart1.Series(3).Marks.Arrow.Style = 0; TChart1.Series(3).Marks.Arrow.Color = 0xff0000; TChart1.Series(4).asPoint.Pointer.Visible = true; TChart1.Series(4).asPoint.Pointer.Style = 10; TChart1.Series(4).asPoint.Pointer.VerticalSize = 5; TChart1.Series(4).asPoint.Pointer.HorizontalSize = 5; TChart1.Series(4).Marks.visible = false; TChart1.Series(4).Marks.Style = 0; TChart1.Series(4).Marks.ArrowLength = 20; TChart1.Series(4).Marks.Arrow.Style = 0; TChart1.Series(4).Marks.Arrow.Color = 0xff0000; } //var imgCd = "D:\\CMCOracle\\application\\webapps\\emr\\formmngtweb\\images\\filemenu_bg.jpg"; switch(graph){ case "1": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boyheight1"); } else{ var imgCd = getTChartBackgroundImage("girlheight1"); } break; case "2": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boyheight2"); } else{ var imgCd = getTChartBackgroundImage("girlheight2"); } break; case "3": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boybmi"); } else{ var imgCd = getTChartBackgroundImage("girlbmi"); } break; case "4": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boyhead1"); } else{ var imgCd = getTChartBackgroundImage("girlhead1"); } break; case "5": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boyhead2"); } else{ var imgCd = getTChartBackgroundImage("girlhead2"); } break; case "6": if(sex == "M"){ var imgCd = getTChartBackgroundImage("boychst"); } else{ var imgCd = getTChartBackgroundImage("girlchst"); } break; } //setBackImageLoad(TChart1, imgCd); TChart1.Panel.BackImageLoad(imgCd); //TChart1.Export.SaveToBitmapFile(getTChartBackgroundImage("boyheight1")); var x,y1,y2, y3, y4, y5, y6, temp; // ºÎ¸ð´Ô½ÅÀå Ç¥½Ã if(graph == "2"){ model.refresh(); var mh = model.getValue("/root/send/mht"); var fh = model.getValue("/root/send/fht"); var mph = model.getValue("/root/send/mpht"); if(sex == "M"){ mh = parseInt(parseFloat(mh) + 13); } else if(sex == "F"){ fh = parseInt(parseFloat(fh) - 13); } if(mh != ""){ TChart1.Series(2).AddXY (18, mh, "", TChart1.Series(2).Color); } if(fh != ""){ TChart1.Series(3).AddXY (18, fh, "", TChart1.Series(3).Color); } if(mph != ""){ TChart1.Series(4).AddXY (18, mph, "", TChart1.Series(4).Color); TChart1.Tools.Add(10); TChart1.Tools.Items(0).asAnnotation.Text = mph; TChart1.Tools.Items(0).asAnnotation.Shape.Top = 953-5*mph; TChart1.Tools.Items(0).asAnnotation.Shape.Left = 517; var textRow = 1; }else if(mph == ""){ var textRow = 0; } } var nodeCnt = getNodesetCount("/root/main/grthlist/list/grth"); for( i = 2; i <= nodeCnt+1; i++){ if(graph == "1"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("month")); //¿ù·É y1 = grd_grth.valueMatrix(i, grd_grth.colRef("bdht")); // ½ÅÀå y2 = grd_grth.valueMatrix(i, grd_grth.colRef("bdwt")); // üÁß if(x == 0){ x = 0.3 } if(x != "" && y1 != ""){ if(i==2){ var f1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(0).AddXY (parseFloat(f1/(365*3)*36), y1, "", TChart1.Series(0).Color); }else{ var f1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(0).AddXY (parseFloat(f1/(365*3)*36), y1, "", TChart1.Series(0).Color); } } if(x != "" && y2 != ""){ if(i==2){ var f2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(1).AddXY (parseFloat(f2/(365*3)*36), y2, "", TChart1.Series(1).Color); }else{ var f2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(1).AddXY (parseFloat(f2/(365*3)*36), y2, "", TChart1.Series(1).Color); } } } else if(graph == "2"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); // ¿¬·É temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // ¿ù·É temp = parseInt((temp % 12)/12*10); x = x+"."+temp; y1 = grd_grth.valueMatrix(i, grd_grth.colRef("bdht")); // ½ÅÀå y2 = grd_grth.valueMatrix(i, grd_grth.colRef("bdwt")); // üÁß var text = grd_grth.valueMatrix(i, grd_grth.colRef("remark")); // ºñ°í if(x != "" && y1 != ""){ var s1=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(0).AddXY (parseFloat(s1/(18*365)*18), y1, "", TChart1.Series(0).Color); } if(x != "" && y2 != ""){ var s2=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); TChart1.Series(1).AddXY (parseFloat(s2/(18*365)*18), y2, "", TChart1.Series(1).Color); } if(text != "" && x>=2){ TChart1.Tools.Add(10); TChart1.Tools.Items(textRow).asAnnotation.Text = text; TChart1.Tools.Items(textRow).asAnnotation.Shape.Top = 900-y1*4; TChart1.Tools.Items(textRow).asAnnotation.Shape.Left = x*29.2 -30; textRow++; } } //20110804 if(graph == "3"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //¿¬·É temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // ¿ù·É temp = parseInt((temp % 12)/12*10); x = x+"."+temp; y3 = grd_grth.valueMatrix(i, grd_grth.colRef("bmi")); // üÁú·® var f3=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); if(x != "" && y3 != ""){ TChart1.Series(0).AddXY (parseFloat(f3/(18*365)*18), y3, "", TChart1.Series(0).Color); } } //20110804 if(graph == "4"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("month")); //¿ù·É y4 = grd_grth.valueMatrix(i, grd_grth.colRef("headgirth")); // ¸Ó¸®µÑ·¹(0-36) var f4=getDateInterval(model.getValue("/root/send/orgbrthdd"),grd_grth.valueMatrix(i, grd_grth.colRef("recdd")), "dd"); if(x != "" && y4 != ""){ TChart1.Series(0).AddXY (parseFloat(f4/(365*3)*36), y4, "", TChart1.Series(0).Color); } } if(graph == "5"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //¿¬·É temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // ¿ù·É temp = parseInt((temp % 12)/12*10); x = x+"."+temp; y5 = grd_grth.valueMatrix(i, grd_grth.colRef("headgirth")); // ¸Ó¸®µÑ·¹() if(x != "" && y5 != ""){ TChart1.Series(0).AddXY (x, y5, "", TChart1.Series(0).Color); } } if(graph == "6"){ x = grd_grth.valueMatrix(i, grd_grth.colRef("year")); //¿¬·É temp = grd_grth.valueMatrix(i, grd_grth.colRef("month")); // ¿ù·É temp = parseInt((temp % 12)/12*10); x = x+"."+temp; y6 = grd_grth.valueMatrix(i, grd_grth.colRef("chstgirth")); // ÈäºÎµÑ·¹ if(x != "" && y6 != ""){ TChart1.Series(0).AddXY (x, y6, "", TChart1.Series(0).Color); } } } //TChart1.Export.SaveToBitmapFile(getTChartBackgroundImage("boyheight2")); } function fCalcAge(){ var orgdd = model.getValue("/root/send/orgbrthdd"); var maskDate = orgdd.substr(0, 4) + "-" + orgdd.substr(4, 2) + "-" + orgdd.substr(6, 2); model.setValue("/root/send/maskbrth", maskDate); var schedd = model.getValue("/root/send/brthschedd"); var diff = getDateInterval(orgdd, getCurrentDate()); var diffSche = getDateInterval(getCurrentDate(), schedd); diffSche = 280 - parseInt(diffSche); var year = parseInt(parseInt(diff) / 365); var month = parseInt(diff) % 365; var week = parseInt(parseInt(diffSche) / 7); var day = parseInt(diffSche) % 7; if(month > 334){ month = 11; } else if(month > 304){ month = 10; } else if(month > 273){ month = 9; } else if(month > 243){ month = 8; } else if(month > 212){ month = 7; } else if(month > 181){ month = 6; } else if(month > 151){ month = 5; } else if(month > 120){ month = 4; } else if(month > 90){ month = 3; } else if(month > 59){ month = 2; } else if(month > 31){ month = 1; } else{ month=0; } if(orgdd != ""){ model.setValue("/root/main/cond/year", year); model.setValue("/root/main/cond/month", month); if(year>0){ var age = year+"³â "+month+"°³¿ù"; }else{ var age = month+"°³¿ù"; } model.setValue("/root/send/age", age); } if(schedd != ""){ model.setValue("/root/main/cond/week", week); model.setValue("/root/main/cond/day", day); } model.refresh(); var year = model.getValue("/root/main/cond/year"); var month = model.getValue("/root/main/cond/month"); var saveflag = ""; saveflag = model.getValue("/root/send/saveflag"); if(saveflag == ""){ // 24°³¿ù ÀÌ»ó À̸é 2~18¼¼ ±×·¡ÇÁ ¼±Åà if((year >= 2 && month >=1) || year >2){ model.setValue("/root/main/cond/chart", "2"); model.setValue("/root/send/saveflag", "2"); button1.selected = true; } else{ model.setValue("/root/main/cond/chart", "1"); model.setValue("/root/send/saveflag", "1"); button2.selected = true; } } else{ var result = saveflag.indexOf("1"); var rslt = saveflag.indexOf("2"); if(result != "-1"){ model.setValue("/root/main/cond/chart", "1"); button2.selected = true; } if(rslt != "-1"){ model.setValue("/root/main/cond/chart", "2"); button1.selected = true; } } model.refresh(); } function fSelectGraph(){ model.removeNodeset("/root/init/orddd"); submit("TRMRF05201"); var rowcnt = ""; var nodeCnt = getNodesetCount("/root/init/orddd"); if(nodeCnt > 0){ for( i = 1; i <= nodeCnt+1; i++ ){ var ordtype = model.getValue("/root/init/orddd["+i+"]/dschdd"); var dschdd = model.getValue("/root/init/orddd["+i+"]/dschdd"); if( dschdd == "Àç¿øÁß"){ rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt"); } } if(rowcnt != ""){ model.setValue("/root/send/ordd", rowcnt); model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+rowcnt+"]/orddd")); model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+rowcnt+"]/cretno")); model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+rowcnt+"]/orddrid")); model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+rowcnt+"]/ordtype")); } else if(rowcnt == "") { //combo2.select(0); } } var dept = model.getValue("/root/send/orddeptcd"); if(dept == "2110000000" || dept == "2030000000" || dept == "2070000000"){ model.toggle("case_grth"); model.toggle("case1"); btn_gr.selected = true; btn_gr.visible = true; btn_lb.visible = false; btn_ht.visible = false; btn_rec.visible = false; var graph = model.getValue("/root/main/cond/chart"); switch(graph){ case "1": button2.selected=true; break; case "2": button1.selected=true; break; case "3": button3.selected=true; break; case "4": button4.selected=true; break; case "5": button12.selected=true; break; case "6": button6.selected=true; break; } fMakeChart(); model.setValue("/root/send/flag", "1"); group2.visible = true; group3.visible = false; } else if(dept == "2100000000"){ model.toggle("case_labor"); model.toggle("case2"); btn_lb.selected = true; btn_gr.visible = false; btn_lb.visible = true; btn_ht.visible = false; btn_rec.visible = false; button14.selected = true; model.setValue("/root/labor/send/flag", "2"); group2.visible = false; group3.visible = true; } else if(dept == "2120000000"){ model.toggle("case_hue"); model.toggle("case3"); btn_ht.selected = true; btn_gr.visible = false; btn_lb.visible = false; btn_ht.visible = true; btn_rec.visible = false; model.setValue("/root/send/flag", "3"); group2.visible = false; } model.refresh(); } function fGetGrphData(){ submit("TRMRF05202"); model.copyNode("/root/main/sign", "/root/main/grthlist/list"); model.removeNodeset("/root/main/grthlist/list/sign"); var mh = model.getValue("/root/main/grthlist/list/grth[1]/mht"); var fh = model.getValue("/root/main/grthlist/list/grth[1]/fht"); var mph = model.getValue("/root/main/grthlist/list/grth[1]/mpht"); var orgbrth = model.getValue("/root/main/grthlist/list/grth[1]/orgbrthdd"); var brthschedd = model.getValue("/root/main/grthlist/list/grth[1]/brthschedd"); var saveflag = model.getValue("/root/main/grthlist/list/grth[1]/saveflag"); var fstrgstrnm = model.getValue("/root/main/grthlist/list/grth[1]/fstrgstrnm"); var lastupdtrnm = model.getValue("/root/main/grthlist/list/grth[1]/lastupdtrnm"); var signSave = model.getValue("/root/main/grthlist/list/grth[1]/signyn"); saveState = signSave; if(signSave == "Y"){ output1.value = "ÇöÀç´Â ÀÎÁõÀúÀå »óÅÂÀÔ´Ï´Ù"; }else if(saveflag != ""){ output1.value = "ÇöÀç´Â ÀÓ½ÃÀúÀå »óÅÂÀÔ´Ï´Ù"; } model.setValue("/root/send/mht", mh); model.setValue("/root/send/fht", fh); model.setValue("/root/send/mpht", mph); model.setValue("/root/send/fstrgstrnm", fstrgstrnm); model.setValue("/root/send/lastupdtrnm", lastupdtrnm); if(orgbrth != ""){ model.setValue("/root/send/orgbrthdd", orgbrth); var maskDate = orgbrth.substr(0, 4) + "-" + orgbrth.substr(4, 2) + "-" + orgbrth.substr(6, 2); model.setValue("/root/send/maskbrth", maskDate); var diff = getDateInterval(orgbrth, getCurrentDate()); var year = parseInt(parseInt(diff) / 365); var month = parseInt(diff) % 365; if(month > 334){ month = 11; } else if(month > 304){ month = 10; } else if(month > 273){ month = 9; } else if(month > 243){ month = 8; } else if(month > 212){ month = 7; } else if(month > 181){ month = 6; } else if(month > 151){ month = 5; } else if(month > 120){ month = 4; } else if(month > 90){ month = 3; } else if(month > 59){ month = 2; } else if(month > 31){ month = 1; } else{ month=0; } model.setValue("/root/main/cond/year", year); model.setValue("/root/main/cond/month", month); if(year>0){ var age = year+"³â "+month+"°³¿ù"; }else{ var age = month+"°³¿ù"; } model.setValue("/root/send/age", age); } if(brthschedd != ""){ model.setValue("/root/send/brthschedd", brthschedd); } //if(saveflag != ""){ model.setValue("/root/send/saveflag", saveflag); //} } function fSetPopupPat(){ model.setValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid")); model.setValue("/root/main/cond/hngnm", model.getValue("/root/main/patinfo/patinfolist/hngnm")); var rrgstno1 = model.getValue("/root/main/patinfo/patinfolist/rrgstno1"); var rrgstno2 = model.getValue("/root/main/patinfo/patinfolist/rrgstno2"); rrgstno1 = rrgstno1 +"-"+ rrgstno2.substr(0, 1) +"******"; model.setValue("/root/main/cond/rrgstno1", rrgstno1); model.setValue("/root/main/cond/sex", model.getValue("/root/main/patinfo/patinfolist/sex")); model.setValue("/root/send/orgbrthdd", model.getValue("/root/main/patinfo/patinfolist/brthdd")); //model.setValue("/root/send/orddeptcd", model.getValue("/root/main/patinfo/patinfolist/lastorddeptcd")); } function fSetPopGraph(){ fSetPopupPat(); saveCnt = "0"; model.removeNodeset("/root/init/orddd"); submit("TRMRF05201"); var rowcnt = "", cnt=""; var nodeCnt = getNodesetCount("/root/init/orddd"); if(nodeCnt > 0){ for( i = 1; i <= nodeCnt+1; i++ ){ var ordtype = model.getValue("/root/init/orddd["+i+"]/dschdd"); var dschdd = model.getValue("/root/init/orddd["+i+"]/dschdd"); if( dschdd == "Àç¿øÁß"){ rowcnt = model.getValue("/root/init/orddd["+i+"]/rowcnt"); } } if(rowcnt != ""){ model.setValue("/root/send/ordd", rowcnt); model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+rowcnt+"]/orddd")); model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+rowcnt+"]/cretno")); //model.setValue("/root/send/orddeptcd", model.getValue("/root/init/orddd["+rowcnt+"]/orddeptcd")); model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+rowcnt+"]/orddrid")); model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+rowcnt+"]/ordtype")); } else if(rowcnt == "") { var lastdd = model.getValue("/root/main/patinfo/patinfolist/lastorddd") var lastdept = model.getValue("/root/main/patinfo/patinfolist/lastorddeptcd") var orddept = model.getValue("/root/send/orddeptcd") for( i = 1; i <= nodeCnt+1; i++ ){ var torddd = model.getValue("/root/init/orddd["+i+"]/orddd"); if( torddd == lastdd && lastdept == orddept){ cnt = model.getValue("/root/init/orddd["+i+"]/rowcnt"); } } if( cnt != ""){ model.setValue("/root/send/ordd", cnt); model.setValue("/root/send/orddd", model.getValue("/root/init/orddd["+cnt+"]/orddd")); model.setValue("/root/send/cretno", model.getValue("/root/init/orddd["+cnt+"]/cretno")); model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd["+cnt+"]/orddrid")); model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd["+cnt+"]/ordtype")); } else if ( cnt == ""){ combo2.select(0); model.setValue("/root/send/ordd", 1); model.setValue("/root/send/orddd", model.getValue("/root/init/orddd[1]/orddd")); model.setValue("/root/send/cretno", model.getValue("/root/init/orddd[1]/cretno")); model.setValue("/root/send/orddrid", model.getValue("/root/init/orddd[1]/orddrid")); model.setValue("/root/send/signgenrflag", model.getValue("/root/init/orddd[1]/ordtype")); } } } model.refresh(); var tDept = model.getValue("/root/send/orddeptcd"); if(tDept == "2110000000" || tDept == "2030000000" || tDept == "2070000000"){ fGetGrphData(); fSelectGraph(); fCalcAge(); // ÇàÃß°¡ grd_grth.addRow(); var cur_row = grd_grth.row-1; var curDate = getCurrentDate(); var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd", maskDate); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/seq", grd_grth.row-1); fCalcGrid(); model.refresh(); fMakeChart(); } else if(tDept == "2100000000"){ fGetLaborData(); fMakeLaborGraph(); } } function fCalcGrid(){ var cur_row = grd_grth.row-1; var recdd = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/recdd"); //recdd = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + recdd.substr(6, 2); var ht = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/bdht"); var wt = model.getValue("/root/main/grthlist/list/grth["+cur_row+"]/bdwt"); var orgdd = model.getValue("/root/send/orgbrthdd"); var schedd = model.getValue("/root/send/brthschedd"); var diff = getDateInterval(orgdd, recdd); var diffSche = getDateInterval(getCurrentDate(), schedd); var year = parseInt(parseInt(diff) / 365); var month = parseInt(diff) % 365; var week = parseInt(parseInt(diffSche) / 7); var day = parseInt(diffSche) % 7; if(month > 334){ month = 11; } else if(month > 304){ month = 10; } else if(month > 273){ month = 9; } else if(month > 243){ month = 8; } else if(month > 212){ month = 7; } else if(month > 181){ month = 6; } else if(month > 151){ month = 5; } else if(month > 120){ month = 4; } else if(month > 90){ month = 3; } else if(month > 59){ month = 2; } else if(month > 31){ month = 1; } else{ month=0; } var temp = parseFloat(wt)/((parseFloat(ht)*(parseFloat(ht)*0.0001))); var temp2 = Math.pow(( parseFloat(wt) * parseFloat(ht)) / 3600, 0.5 ); if(ht!="" && wt!=""){ model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/bmi", parseFloat(temp).toFixed(2)); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/bsa", parseFloat(temp2).toFixed(2)); } model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/year", year); model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/month", parseInt(year)*12+parseInt(month)); if(year>0){ year = year+"³â "+month+"°³¿ù"; }else{ year = month+"°³¿ù"; } model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/yearmonth", year); if(schedd != ""){ model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/week", week); var gatext = week + "ÁÖ" + day + "ÀÏ"; model.setValue("/root/main/grthlist/list/grth["+cur_row+"]/gatext", gatext); } model.refresh(); } function fCalcMph(){ var mh = parseInt(model.getValue("/root/send/mht")); var fh = parseInt(model.getValue("/root/send/fht")); var sex = model.getValue("/root/main/cond/sex"); if(mh != mh || fh != fh){ }else{ if(sex == "M"){ model.setValue("/root/send/mpht", (mh+fh+13)/2); } if(sex == "F"){ model.setValue("/root/send/mpht", (mh+fh-13)/2); } } model.refresh(); } function getDateAddc(inputday,addend){ var backDate =""; var rt = 0; var yyyy = inputday.substring(0,4) +""; var mm = inputday.substring(4,6) +""; var dd = inputday.substring(6,8) +""; var startDate = new Date(yyyy,(eval(mm)-1),dd); startDate.setTime(startDate.getTime()+(86400000*addend)); NowYear = startDate.getYear();// ³â NowMonth = startDate.getMonth()+1;// ¿ù NowDay = startDate.getDate(); // ÀÏ backDate += NowYear ; //³âµµ if (NowMonth < 10 ) backDate += "0" + NowMonth ; else backDate += (startDate.getMonth() + 1); if (NowDay < 10 ) backDate += "0" + NowDay ; else backDate += (startDate.getDate()); return backDate ; } function fCalcGa(){ var edc = model.getValue("/root/labor/send/edc"); var admission = model.getValue("/root/labor/send/admission"); admission = admission.substr(0,4) + admission.substr(5,2) + admission.substr(8,2); var index = combo2.value; if(index != "" && edc != ""){ if(admission != ""){ var orddd = admission; }else if(admission == ""){ var orddd = model.getValue("/root/init/orddd["+index+"]/orddd"); } var tempGa = 280 - getDateInterval(orddd, edc); var week = parseInt(tempGa / 7); var day = tempGa % 7; var ga = week + "+" + day; if(week > 43){ model.setValue("/root/labor/send/ga", ""); } else{ model.setValue("/root/labor/send/ga", ga); } } model.refresh(); } function fMakeLaborGraph(){ TChart2.ClearChart(); TChart2.RemoveAllSeries(); TChart2.Axis.RemoveAllCustom(); //margin °ª Á¤Çϱâ TChart2.Panel.MarginTop = 10; TChart2.Panel.MarginLeft = 5; TChart2.Panel.MarginRight = 5; TChart2.Panel.MarginBottom = 10; TChart2.Panel.Color = 0xffffff; //ÇÏ´ÜÃà Ä­ ¼ö Á¤Çϱâ¿Í ´«±Ý ¾ø¾Ö±â TChart2.Axis.Bottom.SetMinMax (0, 15); TChart2.Axis.Bottom.Increment = 1; TChart2.Axis.Bottom.MinorTickCount = 0.5; TChart2.Axis.Bottom.Title.Caption = "Time"; TChart2.Axis.Bottom.Title.Font.bold = true; TChart2.Axis.Bottom.AxisPen.Color = 0x000000; //TChart2.Axis.Bottom.GridPen.Color = 0x000000; //Ãà Á¡¼±ÀÇ »ö ¼³Á¤ TChart2.Axis.Bottom.Labels.Font.Color = 0xffffff; //ÇÏ´Ü Ãà ´«±Ý ¸íĪ »ö TChart2.Header.Visible = false; //TChart2.Header.Text(0)="¼ºÀ嵵ǥ"; //Çì´õÁ¦¸ñ³Ö±â TChart2.Header.Font.Bold = true; //Çì´õ ±½°Ô TChart2.Header.Font.Size = 5; //Çì´õ »çÀÌÁî TChart2.Aspect.View3D = 0; //2d ·Î Ç¥ÇöÇϱâ //TChart2.Aspect.Chart3DPercent = 2; TChart2.Zoom.enable = false; // zoom »ç¿ëÇÏÁö ¾Ê±â TChart2.Scroll.Enable = false; // scroll »ç¿ëÇÏÁö ¾Ê±â TChart2.Legend.Visible = false; // ±×·¡ÇÁ ÂüÁ¶ ¹Ú½º ¶ç¿ìÁö ¾Ê±â TChart2.Environment.MouseWheelScroll = false; //TChart2.Panel.Gradient.Visible = true; // Æä³Î¿¡ ±×¶óµð¾ðÆ® Àû¿ë var cus_axis1 = TChart2.Axis.AddCustom(false); // CxDilat TChart2.Axis.Custom(0).Visible = true; TChart2.Axis.Custom(0).AxisPen.Color = 0xff0000; TChart2.Axis.Custom(0).Title.Visible = false; TChart2.Axis.Custom(0).Title.Caption = "CxDilat" TChart2.Axis.Custom(0).Title.Font.Size = 9; TChart2.Axis.Custom(0).Title.Font.Bold = true; TChart2.Axis.Custom(0).Title.Angle = 270; TChart2.Axis.Custom(0).PositionPercent = 0; TChart2.Axis.Custom(0).StartPosition = 0; TChart2.Axis.Custom(0).EndPosition = 100; TChart2.Axis.Custom(0).Automatic = false; TChart2.Axis.Custom(0).Maximum = 10; TChart2.Axis.Custom(0).Minimum = 0; TChart2.Axis.Custom(0).Increment = 1; var cus_axis2 = TChart2.Axis.AddCustom(false); // Station TChart2.Axis.Custom(1).Visible = false; TChart2.Axis.Custom(1).AxisPen.Color = 0x00ff00; TChart2.Axis.Custom(1).Title.Visible = false TChart2.Axis.Custom(1).Title.Caption = "Station"; TChart2.Axis.Custom(1).Title.Font.Size = 9; //TChart2.Axis.Custom(1).Title.Font.Bold = true; TChart2.Axis.Custom(1).Title.Angle = 270; TChart2.Axis.Custom(1).PositionPercent = 100; TChart2.Axis.Custom(1).Automatic = false; TChart2.Axis.Custom(1).Maximum = 2.5; TChart2.Axis.Custom(1).Minimum = -2.5; TChart2.Axis.Custom(1).Increment = 1; TChart2.AddSeries (0); TChart2.AddSeries (0); TChart2.Series(0).VerticalAxisCustom = cus_axis1; TChart2.Series(1).VerticalAxisCustom = cus_axis2; //¶óÀÎÀÇ ±½±â¸¦ Á¤ÇØÁØ´Ù. TChart2.Series(0).Color = 0xff0000; TChart2.Series(1).Color = 0x00ff00; TChart2.Series(0).asLine.Pointer.Visible = true; TChart2.Series(0).asLine.Pointer.Style = 5; TChart2.Series(0).asLine.Pointer.VerticalSize = 5; TChart2.Series(0).asLine.Pointer.HorizontalSize = 5; TChart2.Series(0).asLine.LinePen.width = 2; TChart2.Series(0).Marks.visible = false; TChart2.Series(1).asLine.Pointer.Visible = true; TChart2.Series(1).asLine.Pointer.Style = 7; TChart2.Series(1).asLine.Pointer.VerticalSize = 5; TChart2.Series(1).asLine.Pointer.HorizontalSize = 5; TChart2.Series(1).asLine.LinePen.width = 2; TChart2.Series(1).Marks.visible = false; var imgCd = getTChartBackgroundImage("labor"); TChart2.Panel.BackImageLoad(imgCd); var laborNodeCnt = getNodesetCount("/root/main/laborlist/list/labor"); var x, y1, y2, stage; var textRow = 0; if(laborNodeCnt <= 15){ btn_labor1.visible = false; btn_labor2.visible = false; btn_labor3.visible = false; btn_labor4.visible = false; btn_labor5.visible = false; } else if(laborNodeCnt > 15 && laborNodeCnt <= 30){ btn_labor1.visible = true; btn_labor2.visible = true; btn_labor3.visible = false; btn_labor4.visible = false; btn_labor5.visible = false; } else if(laborNodeCnt > 30 && laborNodeCnt <= 45){ btn_labor1.visible = true; btn_labor2.visible = true; btn_labor3.visible = true; btn_labor4.visible = false; btn_labor5.visible = false; } else if(laborNodeCnt > 45 && laborNodeCnt <= 60){ btn_labor1.visible = true; btn_labor2.visible = true; btn_labor3.visible = true; btn_labor4.visible = true; btn_labor5.visible = false; } else if(laborNodeCnt > 60 && laborNodeCnt <= 75){ btn_labor1.visible = true; btn_labor2.visible = true; btn_labor3.visible = true; btn_labor4.visible = true; btn_labor5.visible = true; } var startRow = model.getValue("/root/labor/send/startRow"); var tempX = 2; for( i = startRow; i <= parseInt(laborNodeCnt)+1; i++ ){ x = grd_labor.valueMatrix(i, 9); y1 = grd_labor.valueMatrix(i, 3); // OS y2 = grd_labor.valueMatrix(i, 6); // Station stage = grd_labor.valueMatrix(i, 7); // Stage var text = grd_labor.valueMatrix(i, 1); // time if(y2 == 3){ y2 = 2.5; } if(y2 == -3){ y2 = -2.5; } if(y2 != 0){ y2 = -y2; } if(y1 != ""){ TChart2.Series(0).AddXY (tempX-1, y1, "", TChart2.Series(0).Color); } if(y2 != ""){ TChart2.Series(1).AddXY (tempX-1, y2, "", TChart2.Series(1).Color); } if(text != ""){ TChart2.Tools.Add(10); TChart2.Tools.Items(textRow).asAnnotation.Text = text.substr(0,5); TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true; TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 330; TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-22; textRow++; } if(stage != ""){ if(stage == "1" || stage == "2"){ TChart2.Tools.Add(10); if(stage == "1"){ TChart2.Tools.Items(textRow).asAnnotation.Text = "1st start"; } if(stage == "2"){ TChart2.Tools.Items(textRow).asAnnotation.Text = "2nd start"; } //TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true; TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 340 - y1*29; TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-22; textRow++; } if(stage == "3" || stage == "4"){ TChart2.AddSeries (1); TChart2.Series(2).VerticalAxisCustom = cus_axis1; //TChart2.Series(2).asCandle.CandleStyle = 2; TChart2.Series(2).asBar.BarWidth = 3; var margin = TChart2.Series(2).asBar.BarMargin; TChart2.Series(2).Marks.visible = false; TChart2.Series(2).Color = 0x0000ff; TChart2.Series(2).AddXY (tempX-1, 10, "", TChart2.Series(2).Color); TChart2.Tools.Add(10); if(stage == "3"){ TChart2.Tools.Items(textRow).asAnnotation.Text = "End"; } if(stage == "4"){ TChart2.Tools.Items(textRow).asAnnotation.Text = "Delivery"; } TChart2.Tools.Items(textRow).asAnnotation.Shape.Transparent = true; TChart2.Tools.Items(textRow).asAnnotation.Shape.Top = 350; TChart2.Tools.Items(textRow).asAnnotation.Shape.Left = tempX*39.7-17; textRow++; } } tempX++; } } function fGetLaborData(){ if(combo2.value != ""){ var ordIndex = combo2.value; var orddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd"); var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno"); var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype"); var pid = model.getValue("/root/send/pid"); } model.setValue("/root/labor/send/orddd", orddd); model.setValue("/root/labor/send/cretno", cretno); model.setValue("/root/labor/send/signgenrflag", ordtype); model.setValue("/root/labor/send/pid", pid); submit("TRMRF05206"); model.copyNode("/root/main/laborsign", "/root/main/laborlist/list"); model.removeNodeset("/root/main/laborlist/list/sign"); var labrCnt = getNodesetCount("/root/main/laborlist/list/labor"); if(labrCnt == 0){ var parity = model.getValue("/root/main/laborlist/list/base/parity"); var nsd = model.getValue("/root/main/laborlist/list/base/nsd"); var cs = model.getValue("/root/main/laborlist/list/base/cs"); var edc = model.getValue("/root/main/laborlist/list/base/edc"); var admission = model.getValue("/root/main/laborlist/list/base/admission"); model.setValue("/root/labor/send/parity", parity); model.setValue("/root/labor/send/nsd", nsd); model.setValue("/root/labor/send/cs", cs); model.setValue("/root/labor/send/edc", edc); model.setValue("/root/labor/send/admission", admission); }else{ var parity = model.getValue("/root/main/laborlist/list/labor[1]/parity"); var nsd = model.getValue("/root/main/laborlist/list/labor[1]/nsd"); var cs = model.getValue("/root/main/laborlist/list/labor[1]/cs"); var edc = model.getValue("/root/main/laborlist/list/labor[1]/edc"); var ga = model.getValue("/root/main/laborlist/list/labor[1]/ga"); var admission = model.getValue("/root/main/laborlist/list/labor[1]/admission"); var cc = model.getValue("/root/main/laborlist/list/labor[1]/cc"); var pain = model.getValue("/root/main/laborlist/list/labor[1]/pain"); var prom = model.getValue("/root/main/laborlist/list/labor[1]/prom"); var afl = model.getValue("/root/main/laborlist/list/labor[1]/afl"); var induction = model.getValue("/root/main/laborlist/list/labor[1]/induction"); var oc = model.getValue("/root/main/laborlist/list/labor[1]/oc"); var cd = model.getValue("/root/main/laborlist/list/labor[1]/cd"); var fststage = model.getValue("/root/main/laborlist/list/labor[1]/fststage"); var scndstage = model.getValue("/root/main/laborlist/list/labor[1]/scndstage"); var total = model.getValue("/root/main/laborlist/list/labor[1]/total"); var delivery = model.getValue("/root/main/laborlist/list/labor[1]/delivery"); var other = model.getValue("/root/main/laborlist/list/labor[1]/other"); var fstrgstrnm = model.getValue("/root/main/laborlist/list/labor[1]/fstrgstrnm"); var lastupdtrnm = model.getValue("/root/main/laborlist/list/labor[1]/lastupdtrnm"); var signSave = model.getValue("/root/main/laborlist/list/labor[1]/signyn"); saveState = signSave; if(signSave == "Y"){ output2.value = "ÇöÀç´Â ÀÎÁõÀúÀå »óÅÂÀÔ´Ï´Ù"; }else if(fstrgstrnm != ""){ output2.value = "ÇöÀç´Â ÀÓ½ÃÀúÀå »óÅÂÀÔ´Ï´Ù"; } model.setValue("/root/labor/send/parity", parity); model.setValue("/root/labor/send/nsd", nsd); model.setValue("/root/labor/send/cs", cs); model.setValue("/root/labor/send/edc", edc); model.setValue("/root/labor/send/ga", ga); model.setValue("/root/labor/send/admission", admission); model.setValue("/root/labor/send/cc", cc); model.setValue("/root/labor/send/pain", pain); model.setValue("/root/labor/send/prom", prom); model.setValue("/root/labor/send/afl", afl); model.setValue("/root/labor/send/induction", induction); model.setValue("/root/labor/send/oc", oc); model.setValue("/root/labor/send/cd", cd); model.setValue("/root/labor/send/other", other); model.setValue("/root/labor/send/fststage", fststage); model.setValue("/root/labor/send/scndstage", scndstage); model.setValue("/root/labor/send/total", total); model.setValue("/root/labor/send/delivery", delivery); model.setValue("/root/labor/send/fstrgstrnm", fstrgstrnm); model.setValue("/root/labor/send/lastupdtrnm", lastupdtrnm); } fCalcGa(); model.refresh(); } function fSentence(){ setParameter("comn_chosflag", "C") // C : »ó¿ë±¸ setParameter("comn_formprogflag", "B") // A: Summary, B : ÁÖÈ£¼Ò setParameter("openmode", "select"); modal("SPMRF04900"); var rtn = getParameter("comncnts"); //³»¿ë setParameter("comncnts", ""); var mouseRow = grd_labor.mouseRow; model.setValue("/root/main/laborlist/list/labor["+(mouseRow-1)+"]/remark", rtn); model.refresh(); } function fLaborAddRow(){ grd_labor.addRow(); var cur_row = grd_labor.row-1; var chkCC = model.getValue("/root/labor/send/cc"); var rslt = chkCC.indexOf("2"); // Membrane °ª - ù°ÁÙÀ̸é C/C ÀÇ PROM üũ¿©ºÎ¿¡ µû¶ó µÑ°ÁÙºÎÅÍ´Â À­ÁÙ °ªÀ» ¼±Åà if(cur_row == "1"){ if(rslt == "-1"){ model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", "+"); }else{ model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", "-"); } }else { model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/memb", model.getValue("/root/main/laborlist/list/labor["+(cur_row-1)+"]/memb")); } var curDate = getCurrentDate(); var curTime = getCurrentTime(); var maskDate = curDate.substr(0, 4) + "-" + curDate.substr(4, 2) + "-" + curDate.substr(6, 2); var maskTime = curTime.substr(0, 2) + ":" + curTime.substr(2, 4); model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/recdd", maskDate); model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/rectm", maskTime); model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/seq", grd_labor.row-1); model.setValue("/root/main/laborlist/list/labor["+cur_row+"]/position", model.getValue("/root/main/laborlist/list/labor["+(cur_row-1)+"]/position")); model.refresh(); } function fTempMessage(){ /* body.createChild("xforms:iviewer", "id:ivr_progress; src:../../../com/commonweb/xrw/SPZZZ00400_·ÎµùÁßÈ­¸é.xrw; left:435px; top:339px; width:330px; height:120px;"); var ivrObjt = document.all("ivr_progress"); var msg = "ÀÓ½ÃÀúÀåÇϼ̳׿䤾¤¾¤¾"; ivrObjt.model.setValue("/root/main/msg", msg); ivrObjt.model.refresh(); event.preventDefault(); delayTime = window.setInterval("window.close()", 3000); */ if(saveState == "Y"){ }else if(saveCnt > 0){ var closeYn = messageBox("ÀÓ½ÃÀúÀå »óÅÂÀÔ´Ï´Ù. Á¾·á", "S003", "ÀÎÁõÀúÀå"); if(closeYn == 6){ }else if(closeYn == 7){ var selectedDept = model.getValue("/root/send/orddeptcd"); if(selectedDept == "2110000000" || selectedDept == "2030000000" || selectedDept == "2070000000"){ fGrthSignSave(); }else if(selectedDept == "2100000000"){ fLaborSignSave(); } }else{ event.preventDefault(); } } } function fGrthSignSave(){ saveCnt = parseInt(saveCnt) + 1; // ÀÎÁõÀúÀå µ¥ÀÌÅÍ ÀνºÅϽº Á¤¸® var ordIndex = combo2.value; var tempOrddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd"); var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno"); var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype"); model.setValue("/root/send/orddd", tempOrddd); model.setValue("/root/send/cretno", cretno); model.setValue("/root/send/signgenrflag", ordtype); model.setValue("/root/send/deptnm", combo1.label); // Áø·á°ú ÀÎÁõµ¥ÀÌÅÍ ³Ñ±è var tOrddd = model.getValue("/root/send/orddd"); var maskord = tOrddd.substr(0, 4) + "-" + tOrddd.substr(4, 2) + "-" + tOrddd.substr(6, 2); model.setValue("/root/send/orddate", maskord); // Áø·áÀÏÀÚ ÀÎÁõµ¥ÀÌÅÍ ³Ñ±è var tempY = model.getValue("/root/main/cond/year"); var tempM = model.getValue("/root/main/cond/month"); var tempMonth = parseInt(tempY)*12 + parseInt(tempM); tempMonth = tempMonth + "°³¿ù"; model.setValue("/root/send/age2", tempMonth); var fstnm = model.getValue("/root/send/fstrgstrnm"); if(fstnm == ""){ model.setValue("/root/send/fstrgstrnm", getUserInfo("usernm")); } model.setValue("/root/send/lastupdtrnm", getUserInfo("usernm")); var wrtedd = getCurrentDate(); var wrtetm = getCurrentTime(); model.setValue("/root/send/wrtedd", wrtedd); model.setValue("/root/send/wrtetm", wrtetm); model.setValue("/root/send/recdd", wrtedd); model.setValue("/root/send/rectm", wrtetm); var ht="", wt="", hd="", chst=""; for (i=grd_grth.fixedRows; i= getCurrentDateTime().toDate("YYYYMMDD hhmmss").getAddDate(ll_emrinptsavetime, "m").getDateFormat("YYYYMMDD hhmmss")) { var signedrecinfo = zesfSignData(signrecinfo, sUserID, false); //¿Ü·¡È¯ÀÚÀϰæ¿ì Çѹø¸¸ ÀÎÁõ¼­ ¶ç¿ò } else{ var signedrecinfo = zesfSignData(signrecinfo, sUserID, true); } //var signedrecinfo = zesfSignData(signrecinfo, sUserID, true); if (signedrecinfo != ""){ model.makeValue("/root/send/signaftcnts", signedrecinfo); model.makeValue("/root/send/signbfcnts", signrecinfo); model.setValue("/root/send/status", "U"); /*var graph = model.getValue("/root/main/cond/chart"); if(graph == "1"){ var formcd = "0000001766"; }else if(graph == "2"){ var formcd = "0000001651"; } var nodeCnt = getNodesetCount("/root/main/sign/sign"); var signno = ""; var orddd = model.getValue("/root/send/orddd"); for( i = 1; i <= nodeCnt; i++ ){ var code = model.getValue("/root/main/sign/sign["+i+"]/formcd"); var signOrddd = model.getValue("/root/main/sign/sign["+i+"]/orddd"); if( formcd == code && signOrddd == orddd){ signno = model.getValue("/root/main/sign/sign["+i+"]/signno"); } } if(signno != ""){ model.setValue("/root/send/signno", signno); model.setValue("/root/send/recsaveflag", "Y"); }else{ model.setValue("/root/send/signno", "0"); model.setValue("/root/send/recsaveflag", "N"); }*/ if(submit("TXMRF05202")){ for(var i=1; i<8; i++){ model.removenode("/root/send/imgdata"+i); } model.removenode("/root/send/signaftcnts"); model.removenode("/root/send/signbfcnts"); model.removenode("/root/send/cond"); model.setValue("/root/send/wrtedd", ""); model.setValue("/root/send/wrtetm", ""); // ÀÔ¿ø ¶Ç´Â ÀÀ±ÞÀÏ °æ¿ì // 20111201 knuh ÃÖ¿øµ· // ±â·Ï/ó¹æ Á÷Àü ÀÎÁõÀúÀåÀÌ Á¤ÇØÁø ½Ã°£(ºÐ ´ÜÀ§, ÇϵåÄÚµå 401) À̳»À̸é ÀÎÁõ¼­¸¦ ¶ç¿ìÁö ¾ÊÀ½(3/3) // SMMMO00100.js, MMR01300.js, MMR00100.js, SPMRF05200.js // ÀÎÁõÀúÀåµÈ ½Ã°£À» ÀúÀå. if (ordtype == "I" || ordtype == "E") { setGlobalVariable("emrinptsavetime", getCurrentDateTime()); } } }else if (signedrecinfo == ""){ for(var i=1; i<8; i++){ model.removenode("/root/send/imgdata"+i); } model.removenode("/root/send/signaftcnts"); model.removenode("/root/send/signbfcnts"); model.removenode("/root/send/cond"); model.setValue("/root/send/wrtedd", ""); model.setValue("/root/send/wrtetm", ""); } } function fLaborSignSave(){ saveCnt = parseInt(saveCnt) + 1; var ordIndex = combo2.value; var orddd = model.getValue("/root/init/orddd["+ordIndex+"]/orddd"); var cretno = model.getValue("/root/init/orddd["+ordIndex+"]/cretno"); var ordtype = model.getValue("/root/init/orddd["+ordIndex+"]/ordtype"); var pid = model.getValue("/root/send/pid"); model.setValue("/root/labor/send/orddd", orddd); model.setValue("/root/labor/send/cretno", cretno); model.setValue("/root/labor/send/signgenrflag", ordtype); model.setValue("/root/labor/send/pid", pid); model.setValue("/root/labor/send/formcd", "0900004436"); model.setValue("/root/labor/send/deptnm", combo1.label); // Áø·á°ú ÀÎÁõµ¥ÀÌÅÍ ³Ñ±è var tOrddd = model.getValue("/root/labor/send/orddd"); var maskord = tOrddd.substr(0, 4) + "-" + tOrddd.substr(4, 2) + "-" + tOrddd.substr(6, 2); model.setValue("/root/labor/send/orddate", maskord); // Áø·áÀÏÀÚ ÀÎÁõµ¥ÀÌÅÍ ³Ñ±è var fstnm = model.getValue("/root/labor/send/fstrgstrnm"); if(fstnm == ""){ model.setValue("/root/labor/send/fstrgstrnm", getUserInfo("usernm")); } model.setValue("/root/labor/send/lastupdtrnm", getUserInfo("usernm")); var wrtedd = getCurrentDate(); var wrtetm = getCurrentTime(); model.setValue("/root/labor/send/wrtedd", wrtedd); model.setValue("/root/labor/send/wrtetm", wrtetm); model.setValue("/root/labor/send/recdd", wrtedd); model.setValue("/root/labor/send/rectm", wrtetm); model.setValue("/root/labor/send/flag", "2"); grd_labor.gridToInstance(); var os="", st=""; for (i=grd_labor.fixedRows; i 15 && laborNodeCnt <= 30){ var imgCnt = 2; model.setValue("/root/labor/send/imgcnt", "2"); } else if(laborNodeCnt > 30 && laborNodeCnt <= 45){ var imgCnt = 3; model.setValue("/root/labor/send/imgcnt", "3"); } else if(laborNodeCnt > 45 && laborNodeCnt <= 60){ var imgCnt = 4; model.setValue("/root/labor/send/imgcnt", "4"); } else if(laborNodeCnt > 60 && laborNodeCnt <= 75){ var imgCnt = 5; model.setValue("/root/labor/send/imgcnt", "5"); } for(i=1; i<= imgCnt; i++){ model.makeValue("/root/labor/send/imginfo["+i+"]/seqno", i); } var chkCC = model.getValue("/root/labor/send/cc"); var rdInd = model.getValue("/root/labor/send/induction"); var chkCD = model.getValue("/root/labor/send/cd"); if(chkCC.indexOf("1") != "-1"){ model.setValue("/root/labor/send/chpa", "1"); }else{ model.setValue("/root/labor/send/chpa", ""); } if(chkCC.indexOf("2") != "-1"){ model.setValue("/root/labor/send/chpr", "1"); }else{ model.setValue("/root/labor/send/chpr", ""); } if(chkCC.indexOf("3") != "-1"){ model.setValue("/root/labor/send/chaf", "1"); }else{ model.setValue("/root/labor/send/chaf", ""); } if(chkCC.indexOf("4") != "-1"){ model.setValue("/root/labor/send/chfo", "1"); }else{ model.setValue("/root/labor/send/chfo", ""); } if(rdInd.indexOf("1") != "-1"){ model.setValue("/root/labor/send/rdpo", "1"); }else{ model.setValue("/root/labor/send/rdpo", ""); } if(rdInd.indexOf("2") != "-1"){ model.setValue("/root/labor/send/rdob", "1"); }else{ model.setValue("/root/labor/send/rdob", ""); } if(chkCD.indexOf("1") != "-1"){ model.setValue("/root/labor/send/chpi", "1"); }else{ model.setValue("/root/labor/send/chpi", ""); } if(chkCD.indexOf("2") != "-1"){ model.setValue("/root/labor/send/chpr", "1"); }else{ model.setValue("/root/labor/send/chpr", ""); } if(chkCD.indexOf("3") != "-1"){ model.setValue("/root/labor/send/chol", "1"); }else{ model.setValue("/root/labor/send/chol", ""); } if(chkCD.indexOf("4") != "-1"){ model.setValue("/root/labor/send/chiu", "1"); }else{ model.setValue("/root/labor/send/chiu", ""); } if(chkCD.indexOf("5") != "-1"){ model.setValue("/root/labor/send/chof", "1"); }else{ model.setValue("/root/labor/send/chof", ""); } var signrecinfo = model.instances(0).selectSingleNode("/root/labor/send").xml; //var signrecinfo = "test"; model.removeNodeset("/root/labor/send/list"); model.makeValue("/root/labor/send/list",csvLabor); model.removeNodeset("/root/labor/send/grid"); model.makeNode("/root/labor/send/grid"); for(i=1; i<= imgCnt; i++){ model.setValue("/root/labor/send/startRow", i*15-13); fMakeLaborGraph(); //±×·¡ÇÁ À̹ÌÁö ƯÁ¤ Æú´õ¿¡ ÀúÀå var fso, fldr; fladr = "C:/Program Files/himed/laborimage"; fso = new ActiveXObject("Scripting.FileSystemObject"); if (fso.FolderExists(fladr)) { TChart2.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 658, 400 ); //sChartNum++; } else { fldr = fso.CreateFolder(fladr); TChart2.Export.SaveToJPEGFile(fladr+"/tchart.jpeg", false, 0, 100, 658, 400 ); //sChartNum++; } var file = fladr+"/tchart.jpeg"; var pos = file.lastIndexOf("\\"); var localFileName= file.substring(pos+1, file.length); img_tmp.src = ""; img_tmp.src = file; var ldata = img_tmp.getbase64data(); model.makeValue("/root/labor/send/imgdata"+i, ldata); } var nodeCnt = getNodesetCount("/root/main/laborsign/sign"); var signno = ""; var orddd = model.getValue("/root/labor/send/orddd"); var code = model.getValue("root/labor/send/formcd"); for( i = 1; i <= nodeCnt; i++ ){ var formcd = model.getValue("/root/main/laborsign/sign["+i+"]/formcd"); var signOrddd = model.getValue("/root/main/laborsign/sign["+i+"]/orddd"); if( formcd == code && signOrddd == orddd){ signno = model.getValue("/root/main/laborsign/sign["+i+"]/signno"); } } if(signno != ""){ model.setValue("/root/labor/send/signno", signno); model.setValue("/root/labor/send/recsaveflag", "Y"); }else{ model.setValue("/root/labor/send/signno", "0"); model.setValue("/root/labor/send/recsaveflag", "N"); } var sUserID = getUserInfo("userid"); var rowcnt = combo2.value; var ordtype = model.getValue("/root/init/orddd["+rowcnt+"]/ordtype"); // ÀÎÁõ¼­ ¸Å¹ø ¶ç¿ì±â À§ÇØ ÁÖ¼® if(ordtype == "O"){ var signedrecinfo = zesfSignData(signrecinfo, sUserID, false); //¿Ü·¡È¯ÀÚÀϰæ¿ì Çѹø¸¸ ÀÎÁõ¼­ ¶ç¿ò } else{ var signedrecinfo = zesfSignData(signrecinfo, sUserID, true); } //var signedrecinfo = zesfSignData(signrecinfo, sUserID, true); if (signedrecinfo != ""){ model.makeValue("/root/labor/send/signaftcnts", signedrecinfo); model.makeValue("/root/labor/send/signbfcnts", signrecinfo); model.setValue("/root/labor/send/status", "U"); if(submit("TXMRF05204")){ for(var i=1; i<8; i++){ model.removenode("/root/labor/send/imgdata"+i); } model.removenode("/root/labor/send/signaftcnts"); model.removenode("/root/labor/send/signbfcnts"); model.removenode("/root/labor/send/list"); model.removeNodeset("/root/labor/send/imginfo"); model.setValue("/root/labor/send/wrtedd", ""); model.setValue("/root/labor/send/wrtetm", ""); } }else if (signedrecinfo == ""){ for(var i=1; i<8; i++){ model.removenode("/root/labor/send/imgdata"+i); } model.removenode("/root/labor/send/signaftcnts"); model.removenode("/root/labor/send/signbfcnts"); model.removenode("/root/labor/send/cond"); model.removeNodeset("/root/labor/send/imginfo"); model.setValue("/root/labor/send/wrtedd", ""); model.setValue("/root/labor/send/wrtetm", ""); } } /** * ±â·ÏÁö¿¡¼­ ¿£ÅÍŰ ÃÆÀ»½Ã¿¡ ¿À¸¥ÂÊÀ¸·Î À̵¿ÇÏ´Â À̺¥Æ® */ function fMoveFocus(){ grd_grth.col=grd_grth.col+1; if(grd_grth.col==4){ grd_grth.col=grd_grth.col+1; } grd_grth.editCell(); model.refresh(); } /** * ÀÓ½ÃÀúÀå / ÀÎÁõÀúÀå½Ã ȯÀÚÀÇ °úÄڵ带 ´Ù½Ã È®ÀÎ * @return */ function fDeptCheck(){ var patorddeptcd1 = model.getValue("/root/send/orddeptcd"); var patorddeptcd2 = model.getValue("/root/main/paminfo/pamlist/orddeptcd"); if(patorddeptcd1!=patorddeptcd2){ messageBox("ȯÀÚÀÇ Áø·á°ú¿Í Áø·áÀÏÀÚ¸¦ Á¤È®ÇÏ°Ô ¼±ÅÃÇÏ¿© Áֽñ⠹ٶø´Ï´Ù.", "E"); return false; }else{ return true; } }