@model DTO.AdmAttendanceRuleDTO
|
@using DTO;
|
@using zhengcaioa.Models;
|
@{
|
Layout = null;
|
List< AdmAttendanceRulesDtlDTO > admAttendanceRulesDtlDTOs = Model.admAttendanceRulesDtlDTOs;
|
|
var jiejiari = admAttendanceRulesDtlDTOs.Where(x=>x.Name=="jiejiari").ToList();
|
|
var tiaoxiuri = admAttendanceRulesDtlDTOs.Where(x => x.Name == "tiaoxiuri").ToList();
|
|
|
}
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
<meta name="description" content="">
|
<meta name="author" content="ThemeBucket">
|
<title>@(SiteConfig.SiteName)</title>
|
<link href="~/css/bootstrap.min.css" rel="stylesheet">
|
<link href="~/css/font-awesome.min.css" rel="stylesheet">
|
<link href="~/css/animate.min.css" rel="stylesheet">
|
|
<link href="~/css/plugins/iCheck/custom.css" rel="stylesheet">
|
<link href="~/css/style.min.css" rel="stylesheet">
|
<link href="~/css/plugins/chosen/chosen.css" rel="stylesheet">
|
<link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet">
|
<link href="~/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
|
<link href="~/css/style.min.css" rel="stylesheet">
|
<link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" />
|
<link href="~/css/plugins/webuploader/webuploader.css" rel="stylesheet" />
|
|
<style type="text/css">
|
.webuploader-pick {
|
position: relative;
|
display: inline-block;
|
cursor: pointer;
|
background: #00b7ee;
|
padding: 8px 14px 7px 14px;
|
color: #fff;
|
text-align: center;
|
border-radius: 3px;
|
overflow: hidden;
|
}
|
|
div.clearfix > label {
|
padding-top: 8px;
|
}
|
|
.chosen-container {
|
border-radius: 1px;
|
border: 1px solid #e5e6e7;
|
}
|
|
.col-md-1.control-label {
|
padding-right: 0px;
|
font-weight: 400;
|
}
|
|
.type_b {
|
width: 15px;
|
height: 15px;
|
padding-bottom: 15px !important;
|
}
|
|
.addBtn {
|
top: 10px;
|
}
|
</style>
|
|
<!-- jqgrid-->
|
<script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script>
|
<script src="~/js/bootstrap.min.js"></script>
|
|
<!--容器-->
|
@*<script language="javascript" src="~/js/datehelper.js" type="text/javascript"></script>*@
|
@*<script language="javascript" src="~/js/plugins/query/jquery.query-object.js" type="text/javascript"></script>*@
|
@*<script language="javascript" src="~/js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>*@
|
<script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script>
|
<script language="javascript" src="~/js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript"></script>
|
<script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script>
|
@*<script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>*@
|
@*<script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js" type="text/javascript"></script>*@
|
<script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script>
|
<script src="~/js/plugins/webuploader/webuploader.min.js"></script>
|
|
<script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script>
|
<script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script>
|
<script src="~/js/imgUpload.js"></script>
|
@*<script src="~/js/plugins/iTexbox/itextbox.js" type="text/javascript"></script>*@
|
@*<script src="~/js/plugins/iuploader/iuploader.js"></script>*@
|
<script src="~/js/TUJS.js"></script>
|
</head>
|
|
|
<body class="gray-bg" style="overflow:auto">
|
<form id="formtest">
|
<div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;">
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="ibox float-e-margins">
|
@*<div class="ibox-title">
|
<h5> <i class="fa fa-list"></i> 考勤规则</h5>
|
</div>*@
|
<div id="div_content" class="ibox-content" style="background-color:white;">
|
<div class="row">
|
<h5 style="color:cornflowerblue;">工作日:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-6 col-md-6">
|
周 <input type="number" value="@Model.WeekStart" name="WeekStart" id="WeekStart" style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" > -
|
周 <input type="number" value="@Model.WeekEnd" name="WeekEnd" id="WeekEnd" style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" >
|
<input type="hidden" value="@Model.Id" id="Id" name="Id" >
|
</div>
|
</div>
|
|
|
<h5 style="color:cornflowerblue;">上班时间:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-6 col-md-6">
|
<span>上午:</span><input type="number" value="@Model.WorkingStart" name="WorkingStart" id="WorkingStart"style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">-
|
<input type="number" value="@Model.WorkingEnd" name="WorkingEnd" id="WorkingEnd" style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
|
</div>
|
|
</div>
|
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-6 col-md-6">
|
<span>下午:</span><input type="number" value="@Model.OffworkStart" name="OffworkStart" id="OffworkStart" style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">-
|
<input type="number" value="@Model.OffworkEnd" name="OffworkEnd" id="OffworkEnd" style="width:100px;" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
|
</div>
|
</div>
|
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-6 col-md-6">
|
<span>全勤奖</span>
|
<input type="number" value="@Model.FullAttendance" name="FullAttendance" id="FullAttendance" style="width:150px" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
</div>
|
</div>
|
|
<h5 style="color:cornflowerblue;">迟到扣款:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-8 col-md-8">
|
<span>15分钟</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.LatePayment1" name="LatePayment1" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>30分钟</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.LatePayment2" name="LatePayment2" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>1小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.LatePayment3" name="LatePayment3" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>2小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.LatePayment4" name="LatePayment4" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
|
</div>
|
</div>
|
|
<h5 style="color:cornflowerblue;">旷工扣款:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-6 col-md-6">
|
<span>迟到</span><input style="width:150px" type="number" min="0" step="1" max="999999" value="@Model.Absenteeism" name="Absenteeism" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">分钟记为旷工
|
<span>半天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.AbsenteeismPayment1" name="AbsenteeismPayment1" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>1天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.AbsenteeismPayment2" name="AbsenteeismPayment2" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
</div>
|
</div>
|
|
<h5 style="color:cornflowerblue;">事假扣款:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-8 col-md-8">
|
<span>1小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.PersonalPayment1" name="PersonalPayment1" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>2小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.PersonalPayment2" name="PersonalPayment2" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> 元
|
<span>半天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.PersonalPayment3" name="PersonalPayment3" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>1天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.PersonalPayment4" name="PersonalPayment4" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
</div>
|
</div>
|
|
<h5 style="color:cornflowerblue;">病假扣款:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-8 col-md-8">
|
<span>1小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.SickPayment1" name="SickPayment1" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>2小时</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.SickPayment2" name="SickPayment2" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>半天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.SickPayment3" name="SickPayment3" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
<span>1天</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="@Model.SickPayment4" name="SickPayment4" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">元
|
</div>
|
</div>
|
|
<h5 style="color:red;">节假日:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-3 col-md-3">
|
@if (jiejiari == null || jiejiari.Count == 0)
|
{
|
<div class="setSelect">
|
<input type="text" value="" class="layui-input layer-date ldate form-control holiday_s" id="holiday_s1" name="holiday_s" style="width:150px;" onfocus='laydate({elem:"#holiday_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="" class="layui-input layer-date ldate form-control holiday_e" id="holiday_e1" name="holiday_e" style="width:150px;" onfocus='laydate({elem:"#holiday_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addBtn(this)" data-type="1">+</button>
|
</div>
|
}
|
else
|
{
|
for (int i = 0; i < jiejiari.Count; i++)
|
{
|
if (i == 0)
|
{
|
<div class="setSelect">
|
<input type="text" value="@jiejiari[i].ValueStart" class="layui-input layer-date ldate form-control holiday_s" id="@("holiday_s"+(i+1))" name="holiday_s" style="width:150px;" onfocus='laydate({elem:"#holiday_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="@jiejiari[i].ValueEnd" class="layui-input layer-date ldate form-control holiday_e" id="@("holiday_e"+(i+1))" name="holiday_e" style="width:150px;" onfocus='laydate({elem:"#holiday_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addBtn(this)" data-type="1">+</button>
|
</div>
|
}
|
else
|
{
|
<div class="setSelect">
|
<input type="text" value="@jiejiari[i].ValueStart" class="layui-input layer-date ldate form-control holiday_s" id="@("holiday_s"+(i+1))" name="holiday_s" style="width:150px;" onfocus='laydate({elem:"#holiday_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="@jiejiari[i].ValueEnd" class="layui-input layer-date ldate form-control holiday_e" id="@("holiday_e"+(i+1))" name="holiday_e" style="width:150px;" onfocus='laydate({elem:"#holiday_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" onclick="delBtn(this,0,'holiday')" data-type="1">-</button>
|
</div>
|
}
|
|
|
}
|
|
}
|
|
</div>
|
</div>
|
|
<h5 style="color:red;">调休日:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<div class="col-sm-3 col-md-3">
|
@if (tiaoxiuri == null || tiaoxiuri.Count == 0)
|
{
|
<div class="setSelect">
|
<input type="text" value="" class="layui-input layer-date ldate form-control rest_s" id="rest_s1" name="rest_s" style="width:150px;" onfocus='laydate({elem:"#rest_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="" class="layui-input layer-date ldate form-control rest_e" id="rest_e1" name="rest_e" style="width:150px;" onfocus='laydate({elem:"#rest_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addRestBtn(this)" data-type="1">+</button>
|
</div>
|
}
|
else
|
{
|
for (int i = 0; i < tiaoxiuri.Count; i++)
|
{
|
if (i == 0)
|
{
|
<div class="setSelect">
|
<input type="text" value="@tiaoxiuri[i].ValueStart" class="layui-input layer-date ldate form-control rest_s" id="@("rest_s"+(i+1))" name="rest_s" style="width:150px;" onfocus='laydate({elem:"#rest_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="@tiaoxiuri[i].ValueEnd" class="layui-input layer-date ldate form-control rest_e" id="@("rest_e"+(i+1))" name="rest_e" style="width:150px;" onfocus='laydate({elem:"#rest_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addRestBtn(this)" data-type="1">+</button>
|
</div>
|
}
|
else
|
{
|
<div class="setSelect">
|
<input type="text" value="@tiaoxiuri[i].ValueStart" class="layui-input layer-date ldate form-control rest_s" id="@("rest_s"+(i+1))" name="rest_s" style="width:150px;" onfocus='laydate({elem:"#rest_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
|
<input type="text" value="@tiaoxiuri[i].ValueEnd" class="layui-input layer-date ldate form-control rest_e" id="@("rest_e"+(i+1))" name="rest_e" style="width:150px;" onfocus='laydate({elem:"#rest_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
|
<button type="button" class="addBtn" onclick="delBtn(this,0,'rest')" data-type="1">-</button>
|
</div>
|
}
|
|
}
|
}
|
|
</div>
|
</div>
|
|
<h5 style="color:cornflowerblue;">加班补助:</h5>
|
<div class="clearfix layer-area" style="padding-bottom:15px;height:45px;">
|
<div class="col-sm-6 col-md-6">
|
<span>节假日</span>
|
<label>
|
1倍
|
@if (Model.Gala == 1)
|
{
|
<input name="Gala" type="radio" value="1" class="type_b" checked="checked">
|
}
|
else
|
{
|
<input name="Gala" type="radio" value="1" class="type_b" >
|
|
}
|
|
</label>
|
|
<label>
|
2倍
|
@if (Model.Gala == 2)
|
{
|
<input name="Gala" type="radio" value="2" class="type_b" checked="checked">
|
}
|
else
|
{
|
<input name="Gala" type="radio" value="2" class="type_b">
|
|
}
|
</label>
|
|
<label>
|
3倍
|
@if (Model.Gala == 3)
|
{
|
<input name="Gala" type="radio" value="3" class="type_b" checked="checked">
|
}
|
else
|
{
|
<input name="Gala" type="radio" value="3" class="type_b">
|
|
}
|
</label>
|
|
</div>
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px; height:45px;">
|
<div class="col-sm-6 col-md-6">
|
<span>周末</span>
|
<label>
|
1倍
|
@if (Model.Weekend1 == 1)
|
{
|
<input name="Weekend1" type="radio" checked="checked" value="1" class="type_b">
|
}
|
else
|
{
|
<input name="Weekend1" type="radio" value="1" class="type_b">
|
|
}
|
|
|
</label>
|
|
|
<label>
|
2倍
|
@if (Model.Weekend1 == 2)
|
{
|
<input name="Weekend1" type="radio" checked="checked" value="2" class="type_b">
|
}
|
else
|
{
|
<input name="Weekend1" type="radio" value="2" class="type_b">
|
|
}
|
</label>
|
|
</div>
|
</div>
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;height:45px;">
|
<div class="col-sm-6 col-md-6">
|
<span>平时</span>
|
<label for="p1">
|
1倍/小时
|
@if (Model.Usually == 1)
|
{
|
<input name="Usually" type="radio" checked="checked" value="1" class="type_b">
|
}
|
else
|
{
|
<input name="Usually" type="radio" value="1" class="type_b">
|
|
}
|
</label>
|
|
<label for="Usually">
|
2倍/小时
|
@if (Model.Usually == 2)
|
{
|
<input name="Usually" type="radio" checked="checked" value="2" class="type_b">
|
}
|
else
|
{
|
<input name="Usually" type="radio" value="2" class="type_b">
|
|
}
|
</label>
|
</div>
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;height:45px;">
|
<div class="col-sm-6 col-md-6">
|
<span></span>
|
@*<input name="holiday" value="" type="hidden" id="holiday">
|
<input name="rest" value="" type="hidden" id="rest">*@
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="wrapper wrapper-content" style="margin-top:0px"></div>
|
<div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px ">
|
<div class="" style="float:right;" data-bootstro-width="500px" data-bootstro-content="功能按钮:“保存”,“删除”">
|
|
<a class="btn btn-success" href="javascript:void(0)" onclick="SaveAttendanceRule();" style="margin-left:4px; border-radius:4px;">
|
<i class="glyphicon glyphicon-ok"></i> <span class="bold">提交</span>
|
</a>
|
</div>
|
</div>
|
|
</form>
|
|
|
|
|
|
<script type="text/javascript">
|
var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95;
|
$("#div_content").height(hh);
|
|
toastr.options = {
|
"closeButton": true,
|
"debug": false,
|
"progressBar": true,
|
"positionClass": "toast-bottom-right",
|
"onclick": null,
|
"showDuration": "300",
|
"hideDuration": "600",
|
"timeOut": "4500",
|
"extendedTimeOut": "600",
|
"showEasing": "swing",
|
"hideEasing": "linear",
|
"showMethod": "fadeIn",
|
"hideMethod": "fadeOut"
|
};
|
|
|
var record;
|
$(function () {
|
//$.ajax({
|
// type: "GET",
|
// url: "/Signin/GetTodaySignin",
|
// async: false,
|
// dataType: "json",
|
// success: function (data) {
|
// record = data;
|
// console.log(record);
|
// // alert("打卡成功")
|
// },
|
// error: function () {
|
// //alert("错误");
|
// }
|
//})
|
//$(".ldate").each(function (el) {
|
// laydate({
|
// elem: "#" + $(this).attr('id'), //对应id
|
// format: 'hh:mm', //日期格式 // 分隔符可以任意定义,该例子表示只显示年月
|
// min: '00:00:00', //设定最小日期为当前日期
|
// max: '23:59:59', //最大日期
|
// type: 'datetime',
|
// isInitValue: true,
|
// festival: false, //显示节日
|
// istime: true, //是否显示时分秒
|
// istoday: true, //是否是今天
|
// choose: function (datas) { //选择日期完毕的回调
|
// // console.log(this);
|
// // end.min = datas; //开始日选好后,重置结束日的最小日期
|
// // end.start = datas //将结束日的初始值设定为开始日
|
// }
|
// });
|
|
//});
|
|
//laydate({ elem: "#holiday_e1", format: 'YYYY/MM/DD', istime: true, event: "focus" });
|
//laydate({ elem: "#holiday_s1", format: 'YYYY/MM/DD', istime: true, event: "focus" });
|
//laydate({ elem: "#rest_s1", format: 'YYYY/MM/DD', istime: true, event: "focus" });
|
//laydate({ elem: "#rest_e1", format: 'YYYY/MM/DD', istime: true, event: "focus" });
|
|
});
|
|
var _SigninList = function () {
|
OpenWindow("我的考勤记录", "100%", "100%", "/Signin/Signin");///?userId=" + record.Id);
|
}
|
// 保存打卡信息
|
function SaveAttendanceRule(signinType) {
|
|
|
$.ajax({
|
type: "POST",
|
url: "/Signin/SaveAttendanceRule",
|
dataType: "json",
|
global: false,
|
data: $('form').serializeArray(),
|
success: function (data) {
|
toastr.success("保存成功");
|
},
|
error: function () {
|
toastr.error("保存失败");
|
}
|
});
|
}
|
|
function _pageAutoClose() {
|
parent.window._reloadPageData();
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.isRefresh = true;
|
parent.layer.closeAll('loading');
|
parent.layer.close(index);
|
return false;
|
}
|
|
|
//提交请求
|
var SaveAttendanceRule = function () {
|
|
|
$.ajax({
|
type: "POST",
|
url: "/Signin/SaveAttendanceRule",
|
dataType: "json",
|
global: false,
|
data: $('form').serializeArray(),
|
success: function (data) {
|
|
|
|
if (data.Result) {
|
// parent._afterSave(true);
|
parent.layer.msg('成功保存', { icon: 6 });
|
window.location = "/Signin/AttendanceRule";
|
|
|
//try {
|
// _pageAutoClose();//自动关闭页面方法
|
//}
|
//catch (err) {
|
// parent._CloseTab1("/Signin/SaveAttendanceRule/");
|
//}
|
|
}
|
else {
|
// toastr.error("失败");
|
parent.layer.msg(data.Message, { icon: 5 });
|
}
|
|
},
|
error: function () {
|
|
|
parent.layer.msg('失败', { icon: 5 });
|
}
|
});
|
} ;
|
//本月节假日设置
|
function addBtn(obj) {
|
|
var int = $('.holiday_s').length - 1;
|
var id = $('.holiday_s').eq(int).attr('id');
|
var holiday_ss = parseInt(id.replace("holiday_s", "")) + 1;
|
|
var int1 = $('.holiday_e').length - 1
|
var id1 = $('.holiday_e').eq(int1).attr('id');
|
var holiday_es = parseInt(id1.replace("holiday_e", "")) + 1;
|
|
var html = ' <div class="setSelect">\n' +
|
' <span></span>\n' +
|
' <input type="text" value="" class="layui-input layer-date ldate form-control holiday_s" id="holiday_s' + holiday_ss + '" name="holiday_s" style="width:150px;" onfocus=\'laydate({elem:"#holiday_s' + holiday_ss + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' /> -\n' +
|
' <input type="text" value="" class="layui-input layer-date ldate form-control holiday_e" id="holiday_e' + holiday_es + '" name="holiday_e" style="width:150px;" onfocus=\'laydate({elem:"#holiday_e' + holiday_es + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' />\n' +
|
' <button type="button" class="addBtn" onclick="delBtn(this,0,\'holida\')" data-type="1">-</button>\n' +
|
' </div>'
|
|
$(obj).parent('div').parent('div').append(html);
|
|
|
|
|
|
|
|
|
};
|
function addRestBtn(obj) {
|
var int = $('.rest_s').length - 1;
|
var id = $('.rest_s').eq(int).attr('id');
|
var rest_ss = parseInt(id.replace("rest_s", "")) + 1;
|
|
var int1 = $('.rest_e').length - 1
|
var id1 = $('.rest_e').eq(int1).attr('id');
|
var rest_ee = parseInt(id1.replace("rest_e", "")) + 1;
|
|
var html = ' <div class="setSelect">\n' +
|
' <span></span>\n' +
|
' <input type="text" value="" class="layui-input layer-date ldate form-control rest_s" id="rest_s' + rest_ss + '" name="rest_s" style="width:150px;" onfocus=\'laydate({elem:"#rest_s' + rest_ss + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' /> -\n' +
|
' <input type="text" value="" class="layui-input layer-date ldate form-control rest_e" id="rest_e' + rest_ee + '" name="rest_e" style="width:150px;" onfocus=\'laydate({elem:"#rest_e' + rest_ee + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' />\n' +
|
' <button type="button" class="addBtn" onclick="delBtn(this,0,\'rest\')" data-type="1">-</button>\n' +
|
' </div>'
|
|
$(obj).parent('div').parent('div').append(html);
|
|
|
};
|
function delBtn(obj, id, tb) {
|
//if (id > 0) {
|
// var url = "/index.php/home/white/del.html"
|
// $.post(url, { id: id, tb: tb }, function (res) {
|
// if (res.status == 1) {
|
// $(obj).parent().remove();
|
// } else {
|
// layer.alert(res.msg)
|
// }
|
// })
|
//}
|
$(obj).parent().remove();
|
}
|
|
|
</script>
|
</body>
|
</html>
|