
var Sdule={DataList:{},CurKey:"list",DataList2:{}};var urm={DataList:{}};var hxx={DataList:{}};var iab={DataList:{}};var SduleCookieId="4E3348BC-2C1C-465e-BE12-F719FDFFE1EE";$(window).load(function(){Sdule.ada=$("#ulConvert");Sdule.mta=$("#calContainer");Sdule.yzm=$("#sduleTitle");Sdule.kex=$("#sduleform");Sdule.zki=$("#divHourDlg");var c=Sdule.ada.children();c.unbind("click").bind("click",function(){var a=parseInt($(this).attr("mode"),10);c.removeClass("currpage");$(this).addClass("currpage");Sdule.DataList=new Array();if(a==1){urm.Init("urm",Sdule.mta,Sdule.yzm)}else if(a==2){hxx.Init("hxx",Sdule.mta,Sdule.yzm)}else if(a==3){iab.Init("iab",Sdule.mta,Sdule.yzm)}
var b=new Date();b.setTime(b.getTime()+14*(24*60*60*1000));Dcx.wzu(SduleCookieId,a,b)});var d=parseInt(Dcx.yoj(SduleCookieId),10);if(ymr(d)||isNaN(d))d=1;c.filter("[mode="+d+"]").click();DcxDTime.wga=Sdule.lem});Sdule.owp=function(a,b){var c,qxu,iix,esj,smy;c=b+1;if(c>11){qxu=a+1;c=0}else{qxu=a}
iix=new Date(a,b,1);esj=new Date(qxu,c,1);smy=(esj-iix)/(24*60*60*1000);return smy}
Sdule.dba=function(a,b){var c=0;while(a!=null){c+=a["offset"+b];a=a.offsetParent}
return c}
Sdule.phm=function(a){if(a<10)return"0"+a;else return a}
Sdule.vqm=function(){var a=new Date();var b=Sdule.Mode;if(b==1){urm.iix=a;urm.qkt()}else if(b==2){hxx.iix=a;hxx.qkt()}else if(b==3){iab.iix=a;iab.qkt();var c=a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate();var d=iab.ggm.find("td[date='"+c+"']");if(d.length>0)d.click()}}
Sdule.mxe=function(){if(Sdule.kex.attr("isFirstTimeOpen")!="1"){Sdule.lpt=Sdule.kex.find("#sduleContent");Sdule.wcmType=Sdule.kex.find("ul.bee-popmenu");var e=Sdule.wcmType.children();e.unbind("click").bind("click",function(){Sdule.wcmType.children().removeClass("active");$(this).addClass("active");var a=Sdule.lpt.val();var b=$.trim(a);var c=parseInt($(this).attr("thevalue"),10);if(!ymr(b)&&b.length>0&&b[0]=="["){var d=a.indexOf("[");var k=a.indexOf("]");if(k>=0)a=a.substr(k+1,a.length-(k+1))}
a=$.trim(a);if(c>0){a="["+$(this).find("span").text()+"] "+a;Sdule.lpt.val(a)}else Sdule.lpt.val(a)});Sdule.kex.attr("isFirstTimeOpen",1);Sdule.$beginDate=Sdule.kex.find("#beginDate");Sdule.$beginTime=Sdule.kex.find("#beginTime");Sdule.$endDate=Sdule.kex.find("#endDate");Sdule.$endTime=Sdule.kex.find("#endTime");Sdule.$repeatType=Sdule.kex.find("#repeatType");Sdule.$remindValue=Sdule.kex.find("#remindValue");Sdule.$remindType=Sdule.kex.find("#remindType");Sdule.$remindType=Sdule.kex.find("#remindType");Sdule.$addr=Sdule.kex.find("#addr")}}
Sdule.qkt=function(){var a=Sdule.Mode;if(a==1)urm.qkt();else if(a==2)hxx.qkt();else if(a==3)iab.qkt()};Sdule.bcp=function(a,b,c){if(ymr(c)||c<1)c=Sdule.Mode;Sdule.zya(true);Sdule.nta(b)};Sdule.nta=function(a,b){Sdule.mxe();if(ymr(a))a=Dcx.Date.dpq(new Date());var d=Dcx.Date.nqx(a);a=d.getFullYear()+"-"+((d.getMonth()+1)<10?"0":"")+(d.getMonth()+1)+"-"+(d.getDate()<10?"0":"")+d.getDate();var h=d.getHours();var m=d.getMinutes();Sdule.$beginDate.val(a);Sdule.$endDate.val(a);if(ymr(b)||b<1)b=Sdule.Mode;if(b==1){var c=new Date();h=c.getHours();m=c.getMinutes()}
if(m<30)m=30;else{if(h<23){h++;m=0}else m=30}
Sdule.$beginTime.val((h<10?"0":"")+h+":"+(m<10?"0":"")+m);Sdule.$endTime.val((h<10?"0":"")+h+":"+(m<10?"0":"")+m);Sdule.kex.attr("sid",-1);Sdule.lpt.val("");Sdule.$addr.val("");Sdule.wcmType.children().removeClass("active");Sdule.wcmType.children("li[theValue='0']").addClass("active");Sdule.$repeatType.val("不重复").attr("theValue",0);Sdule.$remindType.val("分钟前提醒").attr("theValue",1);Sdule.$remindValue.val("15").attr("theValue",15);var e=Sdule.kex.find("a.bee-remind-end");e.show();e.next().hide();var e=Sdule.kex.find("a.bee-addRemind");Sdule.mpi(e.get(0))};Sdule.zya=function(b){if(b==true)b=true;else b=false;Sdule.mxe();var c="编辑日程";if(b)c="新建日程";var d=450;var e=$(window.top).scrollTop();var f=100+e;var g={"title":c,"content":Sdule.kex.get(0),"id":"addsdule","background":'#0c2136',"lock":true,"duration":0,opacity:0.2,"zIndex":100,top:f+"px",cancel:function(){return true}};g.button=new Array();g.button.push({name:'确  定',width:'250px',height:'20px',callback:function(){var a=false;if(parseInt(Sdule.kex.attr("sid"),10)>0)a=Sdule.gdf(Sdule.Mode);else a=Sdule.uyu(Sdule.Mode);return a},focus:true});if(!b)g.button.push({name:'删  除',title:"删除日程",width:'250px',height:'20px',callback:function(){var a=false;a=Sdule.vjq(Sdule.Mode);return a},focus:false});var h=art.VLdialog(g)};Sdule.lem=function(a,b){var c=Sdule.$beginDate.val();var d=Sdule.$endDate.val();if(ymr(c))return;if(ymr(d))d=c;c=Dcx.Date.nqx(c);d=Dcx.Date.nqx(d);if(ymr(c)||ymr(d))return;var e=c.getDay();var f=d.getDay();var m=(d-c)/(60000*60*24);var g=0;if(m>=365)g=4;else if(m>=30)g=3;else if(m>=7)g=2;else if(m>=1)g=1;var h=parseInt(Sdule.$repeatType.attr("thevalue"),10);if(!ymr(Sdule.$repeatTypeDlg)){var i=Sdule.$repeatTypeDlg.find("div[isitem=1]");var j=i.filter("[theValue='1']");if(g>0){j.hide()}
j=i.filter("[theValue='2']");if(g>1||(e==0||e==6)||(f==0||f==6)){j.hide();if(h==1){Sdule.$repeatType.attr("thevalue",0);Sdule.$repeatType.attr("thevalue","不重复")}}
j=i.filter("[theValue='4']");if(g>1)j.hide();j=i.filter("[theValue='5']");if(g>2)j.hide();j=i.filter("[theValue='6']");if(g>3)j.hide();if(h>g){Sdule.$repeatType.attr("thevalue",0);Sdule.$repeatType.attr("thevalue","不重复")}}};Sdule.ajx=function(a){var b=Sdule.kex.find("#remindValue");b.val("0").attr("theValue",0);b=Sdule.kex.find("#remindType");b.val("");b.attr("theValue","-1");Sdule.kex.find("#divReminds").hide();Sdule.kex.find("#divmpi").show()};Sdule.mpi=function(a){var b=Sdule.kex.find("#remindValue");b.val("15").attr("theValue",15);b=Sdule.kex.find("#remindType");b.val("分钟前提醒");b.attr("theValue","1");Sdule.kex.find("#spanRemindValue").show();Sdule.kex.find("#divmpi").hide();Sdule.kex.find("#divReminds").show()};Sdule.ygt=function(c){var w=Sdule.zki.width();var h=Sdule.zki.height();var e=xfx(c,"Left");var f=xfx(c,"Top");Sdule.zki.show();e=(e-w+200)-200;f=(f-h-315);Sdule.zki.css({"left":e+"px","top":f+"px"});var g=Sdule.zki.find(".hourlist");Sdule.$hourOjb=$(c);if(g.attr("hasLoad")!="1"){var d=new Date();var h=d.getHours();var m=d.getMinutes();if(m<30){m=30}else{if(h<23)m=30;else{h++;m=0}}
var j=new nzy();for(var i=0;i<=23;i++){var k=(i<10?"0":"")+i+":00";j.append("<div class=\"js-component-menuitem nui-menu-item\" style=\"line-height:24px;\" hour=\""+i+"\" m=\"0\">\n");j.append("<a href=\"javascript:void(0);\"   style=\"line-height: 24px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:12px;\">"+k+"</span></a>\n");j.append("</div>\n");k=(i<10?"0":"")+i+":30";j.append("<div class=\"js-component-menuitem nui-menu-item\" style=\"line-height:24px;\" hour=\""+i+"\" m=\"30\">\n");j.append("<a href=\"javascript:void(0);\"   style=\"line-height: 24px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:12px;\">"+k+"</span></a>\n");j.append("</div>\n")}
g.html(j.toString()).attr("hasLoad","1");var l=g.children();var n=l.filter("[hour="+h+"][m="+m+"]");l.unbind("mousedown").bind("mousedown",function(a){var h=parseInt($(this).attr("hour"),10);var m=parseInt($(this).attr("m"),10);Sdule.$hourOjb.val((h<10?"0":"")+h+":"+(m<10?"0":"")+m);Sdule.zki.hide()});$(document).mouseup(function(a){var b=$(a.target);if(!Dcx.wsj(b,"divHourDlg",14)){Sdule.zki.hide()}});Sdule.zki.dcxScrollbar("vertical",300,"ubs",1.05,"auto","yes","no",15,false,false,n)}};Sdule.kle=function(g,j){var k=Sdule.kex.find("#remindValue");var l=parseInt(k.val(),10);k=Sdule.kex.find("#remindType");var m=parseInt(k.attr("theValue"),10);if(ymr(m)||isNaN(m))m=0;if(ymr(l)||isNaN(l))l=0;Sdule.$remindValueDlg=$("#divRemindValueDlg");Sdule.$remindTypeDlg=$("#divRemindTypeDlg");var n=Sdule.$remindValueDlg;if(j==2)n=Sdule.$remindTypeDlg;var w=n.width();var h=n.height();var o=xfx(g,"Left");var p=xfx(g,"Top");n.show();o=(o-w+200)-100;if(j==1)o=o-37;p=(p-h-115);if(j==1)p=p+20;n.css({"left":o+"px","top":p+"px"});var q=n.find(".hourlist");if(q.attr("hasLoad")!="1"){var r=function(b){var c=Sdule.$remindValueDlg.find(".hourlist");var d=[0];if(b==1)d=[5,15,30];else if(b==2)d=[1,2,3];else if(b==3)d=[1,2,7];var e=new nzy();for(var i=0;i<d.length;i++){e.append("<div class=\"js-component-menuitem nui-menu-item\" style=\"line-height:24px;\" theValue=\""+d[i]+"\" >\n");e.append("<a href=\"javascript:void(0);\"   style=\"line-height: 24px;padding: 0 12px 0 12px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:12px;\">"+d[i]+"</span></a>\n");e.append("</div>\n")}
c.html(e.toString()).attr("hasLoad","1");var f=c.children();f.unbind("mousedown").bind("mousedown",function(a){var h=parseInt($(this).attr("theValue"),10);Sdule.kex.find("#remindValue").val($(this).find("span").text()).attr("theValue",h);Sdule.$remindValueDlg.hide()});if(b==1)Sdule.kex.find("#remindValue").val(d[1]).attr("theValue",d[1]);else Sdule.kex.find("#remindValue").val(d[0]).attr("theValue",d[0])}
$(document).mouseup(function(a){var b=$(a.target);if(!Dcx.wsj(b,"divRemindValueDlg",14)){Sdule.$remindValueDlg.hide()}});var s=new nzy();var d=[{"Id":0,"Text":"准时提醒"},{"Id":1,"Text":"分钟前提醒"},{"Id":2,"Text":"小时前提醒"},{"Id":3,"Text":"天前提醒"}];var s=new nzy();for(var i=0;i<d.length;i++){s.append("<div class=\"js-component-menuitem nui-menu-item\" style=\"line-height:24px;\" theValue=\""+d[i].Id+"\" >\n");s.append("<a href=\"javascript:void(0);\"   style=\"line-height: 24px;padding: 0 12px 0 12px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:12px;\">"+d[i].Text+"</span></a>\n");s.append("</div>\n")}
var t=Sdule.$remindTypeDlg.find(".hourlist");t.html(s.toString()).attr("hasLoad","1");var u=t.children();u.unbind("mousedown").bind("mousedown",function(a){var h=parseInt($(this).attr("theValue"),10);Sdule.kex.find("#remindType").val($(this).find("span").text()).attr("theValue",h);Sdule.$remindTypeDlg.hide();if(h==0){Sdule.kex.find("#spanRemindValue").hide()}else{Sdule.kex.find("#spanRemindValue").show()}
r(h)});$(document).mouseup(function(a){var b=$(a.target);if(!Dcx.wsj(b,"divRemindTypeDlg",14)){Sdule.$remindTypeDlg.hide()}});r(1)}};Sdule.lwb=function(c,e){var f=Sdule.kex.find("#repeatType");var g=parseInt(f.val(),10);if(ymr(g)||isNaN(g))g=0;Sdule.$repeatTypeDlg=$("#divRepeatTypeDlg");var j=Sdule.$repeatTypeDlg;var w=j.width();var h=j.height();var k=xfx(c,"Left");var l=xfx(c,"Top");j.show();k=(k-w+200)-200;l=(l-h-188);j.css({"left":k+"px","top":l+"px"});var m=j.find(".hourlist");if(m.attr("hasLoad")!="1"){var d=[{"Id":0,"Text":"不重复"},{"Id":1,"Text":"每天"},{"Id":2,"Text":"每个工作日"},{"Id":4,"Text":"每周"},{"Id":5,"Text":"每月"},{"Id":6,"Text":"每年"}];var n=new nzy();for(var i=0;i<d.length;i++){n.append("<div class=\"js-component-menuitem nui-menu-item\" isitem=\"1\" style=\"line-height:24px;\" theValue=\""+d[i].Id+"\" >\n");n.append("<a href=\"javascript:void(0);\"   style=\"line-height: 24px;padding: 0 12px 0 12px;\" class=\"nui-menu-item-link\"><span class=\"nui-menu-item-text\" style=\"font-size:12px;\">"+d[i].Text+"</span></a>\n");n.append("</div>\n")}
m.html(n.toString()).attr("hasLoad","1");var o=m.children();o.unbind("mousedown").bind("mousedown",function(a){var h=parseInt($(this).attr("theValue"),10);Sdule.kex.find("#repeatType").val($(this).find("span").text()).attr("theValue",h);Sdule.$repeatTypeDlg.hide()});$(document).mouseup(function(a){var b=$(a.target);if(!Dcx.wsj(b,"divRepeatTypeDlg",14)){Sdule.$repeatTypeDlg.hide()}})}
Sdule.lem()};Dcx.Date.xcb=function(a,b){if(a.getFullYear()>b.getFullYear())return 1;else if(a.getFullYear()<b.getFullYear())return-1;if(a.getMonth()>b.getMonth())return 1;else if(a.getMonth()<b.getMonth())return-1;if(a.getDate()>b.getDate())return 1;else if(a.getDate()<b.getDate())return-1;return 0}
Sdule.jsm=function(a){if(isNaN(a)||a<1)return"#e4f3ff";var b=[{"Id":1,Color:"#c7284a",Name:"红色"},{"Id":2,Color:"#349b08",Name:"绿色"},{"Id":3,Color:"#ed501a",Name:"橙色"},{"Id":4,Color:"#1797dc",Name:"蓝色"},{"Id":5,Color:"#e33d97",Name:"粉色"},{"Id":6,Color:"#c79c17",Name:"黄色"},{"Id":7,Color:"#ad50d8",Name:"紫色"},{"Id":8,Color:"#818181",Name:"灰色"}];for(var i=0;i<b.length;i++){if(b[i].Id==a)return b[i].Color}
return"#333"}
Sdule.yyx=function(a){if(isNaN(a)||a<1)return"#333";var b=[{"Id":1,Color:"#c7284a",Name:"红色"},{"Id":2,Color:"#349b08",Name:"绿色"},{"Id":3,Color:"#ed501a",Name:"橙色"},{"Id":4,Color:"#1797dc",Name:"蓝色"},{"Id":5,Color:"#e33d97",Name:"粉色"},{"Id":6,Color:"#c79c17",Name:"黄色"},{"Id":7,Color:"#ad50d8",Name:"紫色"},{"Id":8,Color:"#818181",Name:"灰色"}];for(var i=0;i<b.length;i++){if(b[i].Id==a)return b[i].Color}
return"#333"}
Sdule.kei=function(a){if(isNaN(a)||a<1)a=Sdule.Mode;var b=Sdule.hwm(a);var c=b.f;var d=b.l;var e="M";if(a==2)e="W";else if(a==3)e="D";e=e+c.getFullYear()+"_"+c.getMonth()+"_"+c.getDate()+"_"+d.getFullYear()+"_"+d.getMonth()+"_"+d.getDate();return e};Sdule.wjt=function(a){if(isNaN(a)||a<1)a=Sdule.Mode;var b=Sdule.kei(a);if(!ymr(Sdule.DataList[b])){return Sdule.DataList[b]}
Sdule.DataList[b]=new Array();return null};Sdule.ipf=function(a,b){if(isNaN(b)||b<1)b=Sdule.Mode;var c=Sdule.wjt(b);if(c==null)c=new Array();var d=false;for(var i=0;i<c.length;i++){if(c[i].SId==a.SId){c[i]=a;d=true;break}}
if(!d){c.push(a)}};Sdule.xuq=function(a,b){Sdule.ipf(b,a)};Sdule.jlb=function(a,b){if(isNaN(b)||b<1)b=Sdule.Mode;var c=Sdule.wjt(b);if(c==null)c=new Array();var d=false;for(var i=0;i<c.length;i++){if(c[i].SId==a){c.splice(i,1);break}}};Sdule.hwm=function(a){if(isNaN(a)||a<1)a=Sdule.Mode;if(a==1){return urm.hwm()}else if(a==2){return hxx.hwm()}else if(a==3){return iab.hwm()}};Sdule.wcx=function(c,d,e){if(d==null||d==undefined){if(c==1){var f=urm.hwm();d=f.f;e=f.l}else if(c==2){var f=hxx.hwm();d=f.f;e=f.l}else if(c==3){var f=iab.hwm();d=f.f;e=f.l}}
var g={"modeType":c,"fromDate":d,"toDate":e};if(c==1){}
var h="M";if(c==2)h="W";else if(c==3)h="D";h=h+d.getFullYear()+"_"+d.getMonth()+"_"+d.getDate()+"_"+e.getFullYear()+"_"+e.getMonth()+"_"+e.getDate();if(!ymr(Sdule.DataList[h])){Sdule.ihj(c,h);return true}
var i="/WebServices/MyApp/Schedule.asmx/wcx";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:i,data:JSON2.stringify(g),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("读取我的日程失败。详情："+b);return false},success:function(a){a=hmy(a);if(ymr(a))a=new Array();Sdule.DataList[h]=a;Sdule.ihj(c,h)}})}
Sdule.ihj=function(a,b){Sdule.CurKey=b;var c=urm.CurDataKey;var d=urm.CurIsOk;if(a==2){c=hxx.CurDataKey;d=hxx.CurIsOk}else if(a==3){c=iab.CurDataKey;d=iab.CurIsOk}
if(c!=b){return false}
if(!d){setTimeout(function(){Sdule.ihj(a,b)},400);return false}
if(a==1){urm.gwj(b)}else if(a==2){hxx.gwj(b)}else if(a==3){iab.gwj(b)}}
Sdule.uyu=function(c){var d=Sdule.tum(c);if(!d)return false;var e={"obj":d};var f=false;var g="/WebServices/MyApp/Schedule.asmx/uyu";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,async:false,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){f=false;var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("读取我的消息失败。详情："+b);return false},success:function(r){r=hmy(r);if(r>0)d.SId=r;art.VLdialog.tips("提交成功");Sdule.ipf(d,c);Sdule.qkt(c);f=true}});return f}
Sdule.gdf=function(c){var d=Sdule.tum(c);if(!d)return false;var e={"obj":d};var f=false;var g="/WebServices/MyApp/Schedule.asmx/gdf";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,async:false,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){f=false;var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("修改日程失败。详情："+b);return false},success:function(r){r=hmy(r);if(r>0)d.SId=r;art.VLdialog.tips("提交成功");Sdule.ipf(d,c);Sdule.qkt(c);f=true}});return f}
Sdule.vjq=function(c){var d=Sdule.tum(c);if(!d)return false;var e=d.SId;var f={"sId":e};isOk=false;var g="/WebServices/MyApp/Schedule.asmx/vjq";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,async:false,data:JSON2.stringify(f),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){isOk=false;var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("删除日程失败。详情："+b);return false},success:function(r){r=hmy(r);art.VLdialog.tips("删除成功");Sdule.jlb(e,c);Sdule.qkt(c);isOk=true}});return isOk}
Sdule.hob=function(c,d){var e={"sId":c};var f="/WebServices/MyApp/Schedule.asmx/hob";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:f,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("读取我的日程失败。详情："+b);return false},success:function(a){a=hmy(a);a.StartTime=Dcx.Date.lvk(a.StartTime);a.EndTime=Dcx.Date.lvk(a.EndTime);a.CreateTime=Dcx.Date.lvk(a.CreateTime);Sdule.DataList2[c]=a;if(!ymr(a))Sdule.fln(c,a,d)}})}
Sdule.tum=function(a){var b={"SId":-1,"Title":"","TypeId":-1,"TypeName":"","StartTime":new Date(),"EndTime":new Date(),"Address":"","RepeatType":-1,"RemindType":-1,"RemindValue":-1,"RemindMode":-1,"CreatorId":-1,"CreatorName":"","LeaderId":-1,"LeaderName":"","ClientId":"0","ClientName":"","LinkManId":"","LinkManName":"","IsPriv":false,"EditTime":new Date(),"CreateTime":new Date(),"IsAllDay":false};var c=Sdule.kex;var d=parseInt(Sdule.kex.attr("sId"),10);if(!ymr(d)&&!isNaN(d)){b.SId=d}
b.Title=$.trim(c.find("#sduleContent").val());if(ymr(b.Title)){art.VLdialog.tips("请输入内容",2);return false}
var e=c.find("#typeSelect").children(".active");b.TypeId=parseInt(e.attr("theValue"),10);b.TypeName=e.find("span").text();var f=$.trim(c.find("#beginDate").val());if(ymr(f)){art.VLdialog.tips("请设置时间",2);return false}
var g=$.trim(c.find("#beginTime").val());if(!ymr(g))f=f+" "+g;b.StartTime=Dcx.Date.nqx(f);if(ymr(b.StartTime)){art.VLdialog.tips("开始时间格式有误，请重新输入。",2);return false}
var h=c.find("#endDate").val();if(ymr(h))h=f;g=$.trim(c.find("#endTime").val());if(!ymr(g))h=h+" "+g;b.EndTime=Dcx.Date.nqx(h);if(ymr(b.EndTime)){art.VLdialog.tips("结束时间格式有误，请重新输入。",2);return false}
if(b.EndTime-b.StartTime<0){art.VLdialog.tips("开始时间不能大于结束时间，请重新输入。",2);return false}
b.Address=$.trim(c.find("#addr").val());b.RepeatType=parseInt(c.find("#repeatType").attr("theValue"),10);b.RemindValue=parseInt(c.find("#remindValue").attr("theValue"),10);b.RemindType=parseInt(c.find("#remindType").attr("theValue"),10);b.RemindMode=1;b.IsAllDay=false;return b};Sdule.fln=function(a,b,c){if(ymr(b)){b=Sdule.DataList2[a];if(ymr(b)){Sdule.hob(a,c);return}}
Sdule.zya(false);var e=Sdule.kex;Sdule.kex.attr("sid",b.SId);Sdule.lpt.val(b.Title);Sdule.$addr.val(b.Address);Sdule.wcmType.children().removeClass("active");Sdule.wcmType.children("li[theValue='"+b.TypeId+"']").addClass("active");var f=b.StartTime;Sdule.$beginDate.val(f.getFullYear()+"-"+((f.getMonth()+1)<10?"0":"")+(f.getMonth()+1)+"-"+(f.getDate()<10?"0":"")+f.getDate());Sdule.$beginTime.val(f.getHours()+":"+f.getMinutes());if(!ymr(b.EndTime)){f=b.EndTime;Sdule.$endDate.val(f.getFullYear()+"-"+((f.getMonth()+1)<10?"0":"")+(f.getMonth()+1)+"-"+(f.getDate()<10?"0":"")+f.getDate());Sdule.$endTime.val(f.getHours()+":"+f.getMinutes())}
var d=[{"Id":0,"Text":"不重复"},{"Id":1,"Text":"每天"},{"Id":2,"Text":"每个工作日"},{"Id":3,"Text":"每个周末"},{"Id":4,"Text":"每周"},{"Id":5,"Text":"每月"},{"Id":6,"Text":"每年"}];var g=null;for(var i=0;i<d.length;i++){if(d[i].Id==b.RepeatType){g=d[i].Text;break}}
if(ymr(g)){b.RepeatType=0;g="不重复"}
Sdule.$repeatType.val(g).attr("theValue",b.RepeatType);d=[{"Id":0,"Text":"准时提醒"},{"Id":1,"Text":"分钟前提醒"},{"Id":2,"Text":"小时前提醒"},{"Id":3,"Text":"天前提醒"}];g=null;for(var i=0;i<d.length;i++){if(d[i].Id==b.RepeatType){g=d[i].Text;break}}
if(ymr(g)){b.RemindType=1;g="分钟前提醒"}
Sdule.$remindType.val(g).attr("theValue",b.RemindType);Sdule.$remindValue.val(b.RemindValue).attr("theValue",b.RemindValue);return};