var $date=undefined;var $year=undefined;var $data=undefined;$(function(){date=new Date();$year=date.getFullYear();$("#delayShowYear").numberspinner("setValue",$year);$(".year").hide();$(".date").hide();$("#type").combobox({onChange:function(b,a){if(b=="0"){$(".week-table").show();$(".year").hide();$(".date").hide()}else{if(b=="1"){$(".week-table").hide();$(".year").show();$(".date").hide()}else{if(b=="2"){$(".week-table").hide();$(".year").hide();$(".date").show()}}}}});setShowDelayGridHeight()});function loadGridData(){if(datagrid_selector.length==0){return}var a=datagrid_selector.datagrid("options");var c="list.do";if(a.pagination){c="page.do"}var b=0;var d=datagrid_selector.datagrid("getSelected");if(d){b=datagrid_selector.datagrid("getRowIndex",d)}datagrid_selector.datagrid({url:controller_url+c+datagrid_param,onLoadSuccess:function(e){datagrid_selector.datagrid("selectRow",b);$data=e;setDelayFormatShow()},method:"post"})}function onOpenDialog(){setValue("libcode",vLibcode)}function setShowDelayGridHeight(){var a=$(window).height();var b=40;var c=a-340;$(".show-delay-date").css("height",c+"px");$("#showDelayGridData").datagrid("resize");$(".easyui-panel").panel("resize")}function setDelayFormatShow(){var d=[];for(var c=1;c<=12;c++){var a={};a.month=c;for(var b=1;b<=31;b++){a["day"+b]=b}d.push(a)}$("#showDelayGridData").datagrid("loadData",d)}function onShowFormatDelay(c,e,a){var d=$("#delayShowYear").numberspinner("getValue");var b=getDaysInMonth(d,e.month);if(c<=b){return showDelayGridDataHandler(c,e,a)}return""}function stylerFormatDelay(c,e,a){var d=$("#delayShowYear").numberspinner("getValue");var b=getDaysInMonth(d,e.month);if(c<=b){return}return"background-color:#aaa;"}function showDelayGridDataHandler(n,o,h){var e="";if($data){var l=$("#delayShowYear").numberspinner("getValue");var b=parseInt(h+1);var d=$data;var p=d.rows;for(var c=0;c-1||p[c].delay.indexOf(j[g]+",")>-1){return""}}else{if(p[c].type=="1"){if(p[c].delay==b+"."+n){return""}}else{if(p[c].type=="2"){var a=p[c].delay.split("-");var m=parseInt(l+""+(b<10?("0"+b):b)+""+(n<10?("0"+n):n));var k=parseInt(a[0]);var f=parseInt(a[1]);if(k<=m&&f>=m){return""}}}}}}return e}function onShowFormatDelayMonth(b,d,a){var c=$("#delayShowYear").numberspinner("getValue");return c+"年"+(b<10?("0"+b):b)+"月"}function onChangeYearValue(a){setDelayFormatShow()}function getDaysInMonth(b,c){var a=new Date(b,c,1);return new Date(a.getTime()-86400000).getDate()}function cleanSpeFields(){setValue("delay-month","");setValue("delay-day","");setValue("delay-start-date","");setValue("delay-end-date","");setValue("delay-week-grid","")}function setSpeFields(c){var b=getValue("type");if(b=="0"){setValue("delay-week-grid",c)}else{if(b=="1"){var a=c.split(".");setValue("delay-month",a[0]);setValue("delay-day",a[1])}else{if(b=="2"){var a=c.split("-");setValue("delay-start-date",a[0]);setValue("delay-end-date",a[1])}}}}function getSpeFields(){var a=getValue("type");if(a=="0"){return getValue("delay-week-grid")}else{if(a=="1"){return getValue("delay-month")+"."+getValue("delay-day")}else{if(a=="2"){return getValue("delay-start-date")+"-"+getValue("delay-end-date")}}}}function myFormatter(a,b){return onGridShowTextBycode("type",a)};