@{
    ViewBag.Title = "";
    Layout = "~/Views/Shared/_LayoutTable.cshtml";
}
<body>
    <div class="wrapper wrapper-content">
        <div class="ibox float-e-margins">

            <div class="ibox-content" style="text-align: center">
                <table id="configurationTable" class="table table-bordered table-striped table-hover">
                    <tr>
                        <td style="text-align:right">节假日类型：</td>
                        <td>
                            <select id="selHoliday" style="width: 200px">
                                <option value="2">节假日</option>
                                <option value="1">特殊工作日</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right">日期：</td>
                        <td><input type="text" style="padding: 5px; margin-top: 15px;" onfocus="WdatePicker({isShowClear:false,readOnly:true})" name="date" id="date" value="" /></td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align:center"><button class="btn btn-default" style="padding: 5px; margin-top: 10px;" id="btnSave">提 交</button></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>

    <script type="text/javascript">
    $(document).ready(function () {
        //提交按钮
        $("#btnSave").click(function () {
            if ($("#date").val().trim() == '') {
                layer.msg("请选择日期！", { time: 2000 });
                return;
            }
            var type = $("#selHoliday").val();//parent.$("#hidtype").val();
            var zq = parent.$("#hidZQ").val();  //考勤周期
            $.ajax({
                url: "../WLTManage/SaveHoliday",
                dataType: "text",
                data: {
                    date: $("#date").val(),
                    type: type,
                    zq: zq
                },
                type: "post",
                success: function (data) {

                    parent.layer.msg(data, { icon: 1, time: 2000 });
                    if (type == "2") {
                        parent.$('#HolidayTable').bootstrapTable("refresh");
                    }
                    else if (type == "1") {
                        parent.$('#HolidayTable').bootstrapTable("refresh");
                    }
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                },
                error: function (data) {
                    layer.msg(data, { icon: 1, time: 2000 });
                }
            })
        })
    })
    </script>
</body>
