From 6e2b929cf381e2320ba6e7dec56c0371124d2b51 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期六, 27 八月 2022 15:03:00 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/zhengcaioa/Views/Signin/AttendanceRule.cshtml |  507 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 372 insertions(+), 135 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Views/Signin/AttendanceRule.cshtml b/zhengcaioa/zhengcaioa/Views/Signin/AttendanceRule.cshtml
index a3e30fc..f83425e 100644
--- a/zhengcaioa/zhengcaioa/Views/Signin/AttendanceRule.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/Signin/AttendanceRule.cshtml
@@ -1,5 +1,20 @@
-锘緻{
+锘緻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();
+
+    var jiabanri = admAttendanceRulesDtlDTOs.Where(x => x.Name == "jiabanri").ToList();
+
+    List<PageEntity> ActionInfo2 = ViewData["ActionInfo2"] as List<PageEntity>;
+
+    string Creater = ViewData["Creater"] as string;
+
 }
 <!DOCTYPE html>
 <html>
@@ -55,8 +70,8 @@
             padding-bottom: 15px !important;
         }
 
-        .addBtn{
-            top:10px;
+        .addBtn {
+            top: 10px;
         }
     </style>
 
@@ -99,8 +114,9 @@
                                 <h5 style="color:cornflowerblue;">宸ヤ綔鏃�:</h5>
                                 <div class="clearfix layer-area" style="padding-bottom:15px;">
                                     <div class="col-sm-6 col-md-6">
-                                        鍛� &nbsp;<input type="number" value="1" name="WeekStart" id="WeekStart" style="width:100px;">&nbsp;-
-                                        鍛� &nbsp;<input type="number" value="5" name="WeekEnd" id="WeekEnd" style="width:100px;">
+                                        鍛� &nbsp;<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})?/)">&nbsp;-
+                                        鍛� &nbsp;<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>
 
@@ -108,8 +124,8 @@
                                 <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 class="layui-input  layer-date  ldate form-control" type="text" value="09:00" name="WorkingStart" id="WorkingStart" placeholder="HH:mm:ss" style="width:100px;">-
-                                        <input type="text" value="12:00" class="layui-input  layer-date  ldate form-control" name="WorkingEnd" id="WorkingEnd" placeholder="HH:mm:ss" style="width:100px;">
+                                        <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>
@@ -117,26 +133,26 @@
 
                                 <div class="clearfix layer-area" style="padding-bottom:15px;">
                                     <div class="col-sm-6 col-md-6">
-                                        <span>涓嬪崍锛�</span><input type="text" class="layui-input  layer-date  ldate form-control" value="13:00" name="OffworkStart" id="OffworkStart" style="width:100px;">-
-                                        <input type="text" class="layui-input  layer-date  ldate form-control" value="18:00" name="OffworkEnd" id="OffworkEnd" style="width:100px;">
+                                        <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="200.00" name="FullAttendance" id="FullAttendance" style="width:150px">鍏�
-                                    </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;">杩熷埌鎵f:</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="10.00" name="LatePayment1">鍏�
-                                        <span>30鍒嗛挓</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="10.00" name="LatePayment2">鍏�
-                                        <span>1灏忔椂</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="50.00" name="LatePayment3">鍏�
-                                        <span>2灏忔椂</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="100.00" name="LatePayment4">鍏�
+                                        <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>
@@ -144,53 +160,149 @@
                                 <h5 style="color:cornflowerblue;">鏃峰伐鎵f:</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="120" name="Absenteeism">鍒嗛挓璁颁负鏃峰伐
-                                        <span>鍗婂ぉ</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="50.00" name="AbsenteeismPayment1">鍏�
-                                        <span>1澶�</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="200.00" name="AbsenteeismPayment2">鍏�
+                                        <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>鏃峰伐鎵f</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;">浜嬪亣鎵f:</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="10.00" name="PersonalPayment1">鍏�
-                                        <span>2灏忔椂</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="10.00" name="PersonalPayment2">鍏�
-                                        <span>鍗婂ぉ</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="10.00"  name="PersonalPayment3">鍏�
-                                        <span>1澶�</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="50.00"   name="PersonalPayment4">鍏�
+                                        <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;">鐥呭亣鎵f:</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="10.00" name="SickPayment1">鍏�
-                                        <span>2灏忔椂</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="10.00" name="SickPayment2">鍏�
-                                        <span>鍗婂ぉ</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="10.00"  name="SickPayment3">鍏�
-                                        <span>1澶�</span><input style="width:150px" type="number" min="0.01" step="0.01" max="999999" value="100.00"  name="SickPayment4">鍏�
+                                        <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">
-                                        <div class="setSelect">                                             
-                                            <input type="text" value="" class="layui-input  layer-date  ldate form-control " name="holiday_s[]" style="width:150px;"> -
-                                            <input type="text" value="" class="layui-input  layer-date  ldate form-control" name="holiday_e[]" style="width:150px;">
-                                            <button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addBtn(this)" data-type="1">+</button>
-                                        </div>
+                                        @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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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">
-                                        <div class="setSelect">
-                                            <input type="text" value="" class="layui-input  layer-date  ldate form-control "  name="rest_s[]" style="width:150px;"> -
-                                            <input type="text" value="" class="layui-input  layer-date  ldate form-control " name="rest_e[]" style="width:150px;">
-                                            <button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addRestBtn(this)" data-type="1">+</button>
-                                        </div>
+                                        @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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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.ToString("yyyy-MM-dd")" 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:red;">鍔犵彮鏃�:</h5>
+                                <div class="clearfix layer-area" style="padding-bottom:15px;">
+                                    <div class="col-sm-3 col-md-3">
+                                        @if (jiabanri == null || jiabanri.Count == 0)
+                                        {
+                                            <div class="setSelect">
+                                                <input type="text" value="" class="layui-input  layer-date  ldate form-control jiaban_s" id="jiaban_s1" name="jiaban_s" style="width:150px;" onfocus='laydate({elem:"#jiaban_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
+                                                <input type="text" value="" class="layui-input  layer-date  ldate form-control jiaban_e" id="jiaban_e1" name="jiaban_e" style="width:150px;" onfocus='laydate({elem:"#jiaban_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
+                                                <button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addjiabanBtn(this)" data-type="1">+</button>
+                                            </div>
+                                        }
+                                        else
+                                        {
+                                            for (int i = 0; i < jiabanri.Count; i++)
+                                            {
+                                                if (i == 0)
+                                                {
+                                                    <div class="setSelect">
+                                                        <input type="text" value="@jiabanri[i].ValueStart.ToString("yyyy-MM-dd")" class="layui-input  layer-date  ldate form-control jiaban_s" id="@("jiaban_s"+(i+1))" name="jiaban_s" style="width:150px;" onfocus='laydate({elem:"#jiaban_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
+                                                        <input type="text" value="@jiabanri[i].ValueEnd.ToString("yyyy-MM-dd")" class="layui-input  layer-date  ldate form-control jiaban_e" id="@("jiaban_e"+(i+1))" name="jiaban_e" style="width:150px;" onfocus='laydate({elem:"#jiaban_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
+                                                        <button type="button" class="addBtn" style="padding-bottom:10px;" onclick="addjiabanBtn(this)" data-type="1">+</button>
+                                                    </div>
+                                                }
+                                                else
+                                                {
+                                                    <div class="setSelect">
+                                                        <input type="text" value="@jiabanri[i].ValueStart.ToString("yyyy-MM-dd")" class="layui-input  layer-date  ldate form-control jiaban_s" id="@("jiaban_s"+(i+1))" name="jiaban_s" style="width:150px;" onfocus='laydate({elem:"#jiaban_s1",format:"YYYY-MM-DD",theme:"#fdd5004"})' /> -
+                                                        <input type="text" value="@jiabanri[i].ValueEnd.ToString("yyyy-MM-dd")" class="layui-input  layer-date  ldate form-control jiaban_e" id="@("jiaban_e"+(i+1))" name="jiaban_e" style="width:150px;" onfocus='laydate({elem:"#jiaban_e1",format:"YYYY-MM-DD",theme:"#fdd5004"})' />
+                                                        <button type="button" class="addBtn" onclick="delBtn(this,0,'jiaban')" data-type="1">-</button>
+                                                    </div>
+                                                }
+
+                                            }
+                                        }
+
+                                    </div>
+                                </div>
+
+                                
 
                                 <h5 style="color:cornflowerblue;">鍔犵彮琛ュ姪:</h5>
                                 <div class="clearfix layer-area" style="padding-bottom:15px;height:45px;">
@@ -198,17 +310,42 @@
                                         <span>鑺傚亣鏃�</span>
                                         <label>
                                             1鍊�
-                                            <input name="Gala" type="radio" checked="" value="1" class="type_b">
+                                            @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>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <label>
                                             2鍊�
-                                            <input name="Gala" type="radio" value="2" class="type_b">
+                                            @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>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <label>
                                             3鍊�
-                                            <input name="Gala" type="radio" value="3" class="type_b">
+                                            @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>
@@ -216,10 +353,34 @@
                                 <div class="clearfix layer-area" style="padding-bottom:15px; height:45px;">
                                     <div class="col-sm-6 col-md-6">
                                         <span>鍛ㄦ湯</span>
-                                        <label>1鍊� <input name="Weekend1" type="radio" checked="" value="1" class="type_b"></label>
+                                        <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>
 
                                         &nbsp;&nbsp;&nbsp;&nbsp;
-                                        <label>2鍊�<input name="Weekend1" type="radio" value="2" 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>
@@ -227,16 +388,38 @@
                                 <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鍊�/灏忔椂<input id="p1" name="usually" type="radio" checked="" value="1" class="type_b"></label>
+                                        <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>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
-                                        <label for="p2">2鍊�/灏忔椂<input id="p2" name="usually" type="radio" value="2" 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">
+                                        @*<input name="holiday" value="" type="hidden" id="holiday">
+                <input name="rest" value="" type="hidden" id="rest">*@
                                     </div>
                                 </div>
                             </div>
@@ -248,8 +431,8 @@
         <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;">
+
+                <a class="btn btn-success Update"  href="javascript:void(0)" onclick="SaveAttendanceRule();" style="margin-left:4px; border-radius:4px;display:none;">
                     <i class="glyphicon glyphicon-ok"></i>&nbsp;&nbsp;<span class="bold">鎻愪氦</span>
                 </a>
             </div>
@@ -298,25 +481,30 @@
             //        //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 //灏嗙粨鏉熸棩鐨勫垵濮嬪�艰瀹氫负寮�濮嬫棩
-                    }
-                });
+            //$(".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" });
 
         });
 
@@ -325,19 +513,19 @@
         }
         // 淇濆瓨鎵撳崱淇℃伅
         function SaveAttendanceRule(signinType) {
-           
+
 
             $.ajax({
                 type: "POST",
                 url: "/Signin/SaveAttendanceRule",
                 dataType: "json",
                 global: false,
-                data:  $('form').serializeArray(),
+                data: $('form').serializeArray(),
                 success: function (data) {
-                    toastr.success("鎵撳崱鎴愬姛");
+                    toastr.success("淇濆瓨鎴愬姛");
                 },
                 error: function () {
-                    toastr.error("鎵撳崱澶辫触");
+                    toastr.error("淇濆瓨澶辫触");
                 }
             });
         }
@@ -353,92 +541,141 @@
 
 
         //鎻愪氦璇锋眰
-        $('#searchBtn').on('click', function () {
-            var holiday = '';
-            $('.holiday_s').each(function () {
-                var holiday_s = $(this).val();
-                var holiday_e = $(this).next('.holiday_e').val();
-                if (holiday_s != '' && holiday_e != '') {
-                    holiday += ',' + holiday_s + '+' + holiday_e;
-                }
+        var SaveAttendanceRule =    function () {
 
-            })
-            holiday = holiday.substring(1)
-            if (holiday) {
-                $('#holiday').val(holiday);
-            }
-            var rest = '';
-            $('.rest_s').each(function () {
-                var rest_s = $(this).val();
-                var rest_e = $(this).next('.rest_e').val();
-                if (rest_s != '' && rest_e != '') {
-                    rest += ',' + rest_s + '+' + rest_e;
-                }
-
-            })
-            rest = rest.substring(1)
-            if (rest) {
-                $('#rest').val(rest);
-            }
-            formFile = new FormData($('#form')[0]);
 
             $.ajax({
-                url: "/index.php/home/index/attendance.html",
-                type: 'POST',
-                data: formFile,
-                async: true,
-                cache: false,
-                contentType: false,
-                processData: false,
-                // traditional:true,
-                // dataType:'json',
-                success: function (res) {
-                    console.log(res);
-                    if (res.status == 1) {
-                        layer.alert(res.msg)
-                    } else {
-                        layer.alert(res.msg)
+                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" name="holiday_s[]" class="Wdate holiday_s" style="width:150px;"> -\n' +
-                '                <input type="text" value="" class="layui-input  layer-date  ldate form-control" name="holiday_e[]" class="Wdate holiday_e" style="width:150px;">\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').after(html);
+            $(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" name="rest_s[]" class="Wdate rest_s" style="width:150px;"> -\n' +
-                '                <input type="text" value=""  class="layui-input  layer-date  ldate form-control" name="rest_e[]" class="Wdate rest_e" style="width:150px;">\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').after(html);
-        }
+            $(obj).parent('div').parent('div').append(html);
+
+
+        };
+
+
+        function addjiabanBtn(obj) {
+            var int = $('.jiaban_s').length - 1;
+            var id = $('.jiaban_s').eq(int).attr('id');
+            var jiaban_ss = parseInt(id.replace("jiaban_s", "")) + 1;
+
+            var int1 = $('.jiaban_e').length - 1
+            var id1 = $('.jiaban_e').eq(int1).attr('id');
+            var jiaban_ee = parseInt(id1.replace("jiaban_e", "")) + 1;
+
+            var html = ' <div class="setSelect">\n' +
+                '                <span></span>\n' +
+                '                <input type="text" value="" class="layui-input  layer-date  ldate form-control jiaban_s"  id="jiaban_s' + jiaban_ss + '" name="jiaban_s" style="width:150px;" onfocus=\'laydate({elem:"#jiaban_s' + jiaban_ss + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' /> -\n' +
+                '                <input type="text" value=""  class="layui-input  layer-date  ldate form-control jiaban_e"  id="jiaban_e' + jiaban_ee + '" name="jiaban_e"   style="width:150px;" onfocus=\'laydate({elem:"#jiaban_e' + jiaban_ee + '",format:"YYYY-MM-DD",theme:"#fdd5004"})\' />\n' +
+                '                <button type="button" class="addBtn" onclick="delBtn(this,0,\'jiaban\')" 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)
-                    }
-                })
-            }
+            //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();
         }
+         var ActionInfo22 = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ActionInfo2))';
 
 
+
+        $(function () {
+            var data = JSON.parse(ActionInfo22);
+            for (var o in data) {
+                $("." + data[o].PageShortcut).show();
+
+            }
+        });
     </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1