{% extends "data_list.html" %} {% load i18n %} {% block content %}
{% endblock %} {% block getdatalist %} {% endblock %} {% block op_for_tab %} {% endblock %} {% block export %} {% endblock %} {% block addjs %} var lClass; $(function(){ fun_attparam(); }); function fun_attparam(){ $("#id_newrec").remove(); $("#id_clearrec").remove(); $("#content").html(""); $.ajax({ type: "POST", url:"{{dbapp_url}}../att/AttParamSetting/", dataType:"json", success:function(json){ var arr=json lClass=arr.LeaveClass; chk_TwoDay=arr.TwoDay; chk_OTCheckRecType=arr.OTCheckRecType; chk_OutCheckRecType=arr.OutCheckRecType; chk_NoInAbsent=arr.NoInAbsent; chk_NoOutAbsent=arr.NoOutAbsent; chk_EarlyAbsent=arr.EarlyAbsent; chk_LateAbsent=arr.LateAbsent; chk_OutOverTime=arr.OutOverTime; $("#content").html("" +"
" +"" +"" +'' +"" +"
" +"

{%trans '基础设置'%}

" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"
{%trans '分钟'%}
{%trans '分钟'%}
{%trans '分钟'%}

{%trans '考勤计算'%}

" +"" +" " +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"
{%trans '分钟时记为旷工.'%}
{%trans '分钟时记为旷工.'%}
  " +"
" +"  
{%trans '分钟后签退记加班'%}

{%trans '计算项目'%}

" +"" +"" +"" +"" +"
" +"{%trans '最小单位:'%}
  " +"
" +"
{%trans '舍入控制:'%}
{%trans '向下(舍弃) '%}  " +"{%trans '四舍五入'%}  " +"{%trans '向上(进位)'%} " +"
{%trans '按次计算'%}  " +"{%trans '累计后再进行舍入'%}
" +"
{%trans '报表中的表示符号:'%}
" +"
" +"" +"" +"" +"
" ); //$("#content").css("padding-left",100) $("#id_Out"+chk_OutCheckRecType).click(); $("#id_OT"+chk_OTCheckRecType).click(); $("#id_TwoDay"+chk_TwoDay).click(); if(chk_EarlyAbsent==1){ $("#id_EarlyAbsent").attr("checked","checked"); } if(chk_LateAbsent==1) { $("#id_LateAbsent").attr("checked","checked"); } if(chk_OutOverTime==1) { $("#id_OutOverTime").attr("checked","checked"); } if(chk_NoInAbsent>0) { $("#id_NoInAbsent").attr("checked","checked"); $("#id_type_in").val(chk_NoInAbsent); if(chk_NoInAbsent==1) $("#is_show_in").css("display","inline"); } if(chk_NoOutAbsent>0) { $("#id_NoOutAbsent").attr("checked","checked"); $("#id_type_Out").val(chk_NoOutAbsent); if(chk_NoOutAbsent==1) $("#is_show_out").css("display","inline"); } $("#id_NoInAbsent").click(function(){ if(!$("#id_NoInAbsent").attr("checked")) { $("#id_type_in").val(0); $("#is_show_in").css("display","none"); } }); $("#id_NoOutAbsent").click(function(){ if(!$("#id_NoOutAbsent").attr("checked")) { $("#id_type_Out").val(0); $("#is_show_out").css("display","none"); } }); $("#id_items").click(function(){//计算项 item_id=$("#id_items").val(); lClass=getChange_lClass(lClass); $("#id_LeaveClass").val(get_lClass_String(lClass)); $("#hidden_LeaveId").val(item_id); $("#id_validate_Min").css("display","none"); for(i=0;i{%trans ' 请选择单位' %} "); $("#id_validate_Min").css("visibility","visible"); } }); if(lClass.length>0) { $("#id_items").val(lClass[0].LeaveId); $("#id_items").click() //show_selected_item(lClass[0]); } //表单验证MinSMinRecordInterval $('#id_edit_form').validate({ rules: { "MaxShiftInterval": {required:true,digits:true,min:240,max:1200}, "MinShiftInterval": {required:true,digits:true,min:10,max:240}, "MinRecordInterval": {required:true,"digits":true,"min":0,"max":240}, "MinsWorkDay": {required:true,"digits":true}, "MinsLate": {required:true,"digits":true,"min":0,"max":240}, "MinsEarly": {required:true,"digits":true,"min":0,"max":240}, "MinsNoIn": {required:true,"digits":true,"min":0,"max":480}, "MinsNoOut": {required:true,"digits":true,"min":0,"max":480}, "MinsLateAbsent": {required:true,"digits":true,"min":1,"max":480}, "MinsOutOverTime": {required:true,"digits":true,"min":10,"max":240}, "MinsEarlyAbsent": {required:true,"digits":true,"min":1,"max":480}, "MinUnit": {required:true,"min":0.1,"max":60}, "ReportSymbol": {"maxlength":2} } }); $("#id_submit").click(function(){ $("#id_error").css("display","none");; var bln_submit=true try { $('#id_edit_form').find("input").each(function(){ if($(this).valid()=="0") { bln_submit=false; } }); } catch(e) { } if (bln_submit) { getLastLclass(lClass); var queryStr=$("#id_edit_form").formSerialize(); $.ajax({ type: "POST", url:"{{dbapp_url}}../att/SaveAttParamSetting/", data:queryStr, dataType:"text", success:function(retdata){ if(retdata.indexOf("result=0")==0){ $("#id_error").css("display","block"); $("#id_error").html(""); } } }); } }); var w=$("#tbl1>tbody>tr>th").eq(2).width(); $("#tbl2>tbody>tr>th").eq(0).css({width:w}); }}); } var week=[ "{% trans '星期日' %}", "{% trans '星期一' %}", "{% trans '星期二' %}", "{% trans '星期三' %}", "{% trans '星期四' %}", "{% trans '星期五' %}", "{% trans '星期六' %}" ]; function getLastLclass(lClass){ //取得最后一个页面的最新值并更新lClass为最新 lClass=getChange_lClass(lClass); $("#id_LeaveClass").val(get_lClass_String(lClass)); return true; } function show_selected_item(sdata){ //显示选中项的各个参数的值 $("#id_MinUnit").val(sdata.MinUnit); $("#id_Unit").val(sdata.Unit); $("#id_RemaindProc"+sdata.RemaindProc).click(); $("#id_ReportSymbol").val(sdata.ReportSymbol); if(sdata.RemaindCount) $("#id_RemaindCount").attr("checked","checked"); is_by_times(sdata.Unit); } function get_lClass_String(lc) //构造字典字符串 { var result = "[" if(lc.length>0){ for(var i=0; i "+(lcData[i].LeaveName)+""; else options_html+=""; return options_html; } function remove_MinsNoIn(obj) { if($(obj).val()=="1"){ $("#id_NoInAbsent").attr("checked","checked"); $("#is_show_in").css("display","inline"); } else if($(obj).val()=="2") { $("#id_NoInAbsent").attr("checked","checked"); $("#is_show_in").css("display","none"); } else{ $("#is_show_in").css("display","none"); $("#id_NoInAbsent").attr("checked",""); } } function remove_MinsNoOut(obj) { if($(obj).val()=="1"){ $("#id_NoOutAbsent").attr("checked","checked"); $("#is_show_out").css("display","inline"); } else if($(obj).val()=="2") { $("#id_NoOutAbsent").attr("checked","checked"); $("#is_show_out").css("display","none"); } else{ $("#is_show_out").css("display","none"); $("#id_NoOutAbsent").attr("checked",""); } } function getWeek(selected_id){ var options_html=""; for(i=0;i<7;i++) if(i==selected_id) options_html+=""; else options_html+=""; return options_html; } function getDay(selected_id) { var options_html=""; for(i=1;i<=28;i++) if(i==selected_id) options_html+=""; else options_html+=""; return options_html; } var unit=[ "{% trans '小时' %}", "{% trans '分钟' %}", "{% trans '工作日' %}" ]; function get_Unit() { var options_html=""; for(i=1;i<=unit.length;i++) options_html+=""; return options_html; } {% endblock %}