LR-20210131IOQH\Administrator
2021-08-10 d4a6d65f5e449c3e5464aa18ae97bf8953987217
zhengcaioa/zhengcaioa/Views/Signin/AskLeave.cshtml
@@ -3,6 +3,7 @@
@using zhengcaioa.Models;
@{
    Layout = null;
    ResultDataEntity<SysAttachmentDTO> attachment = ViewBag.attachment as ResultDataEntity<SysAttachmentDTO>; //问题类型
    List<SysAttachmentDTO> attachmentsssss = attachment.DataList;
@@ -10,8 +11,14 @@
    {
        attachmentsssss = new List<SysAttachmentDTO>();
    }
    List<SysCodeDtl> Lavetype = ViewData["Lavetype"] as List<SysCodeDtl>; //拜访方式
    //流程相关
    string shifoubiaoji = ViewBag.shifoubiaoji as string;
    string sifoudangqian = ViewBag.sifoudangqian as string;
    string dangqianbuzhou = ViewBag.dangqianbuzhou as string;
    List<WfHistoryDTO> lishiyijian = ViewData["lishiyijian"] as List<WfHistoryDTO>; //审批进度
}
<!DOCTYPE html>
<html>
@@ -78,21 +85,21 @@
            <tbody>
                <tr>
                    <td class="title">单据名称</td>
                    <td>
                        <input type="text" class="form-control" value="@Model.Tittle" name="Tittle" id="Tittle" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    <td colspan="4">
                        <input type="text" class="form-control" value="@Model.Tittle" name="Tittle" id="Tittle" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">申请人</td>
                    <td>
                    <td colspan="4">
                        <input type="text" class="form-control" value="@Model.CreaterName" name="CreaterName" id="CreaterName" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">请假时间</td>
                    <td>
                    <td colspan="4">
                        <input type="text" class="layui-input  layer-date  ldate form-control" value="@Model.StratTimeName" name="StratTime" id="StratTime" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">-  <input type="text" class="layui-input  layer-date ldate form-control" value="@Model.EndTimeName" name="EndTime" id="EndTime" style="width:150px;margin-right: 4px;" validate="RequiredField" autocomplete="off" readonly="readonly">
                    </td>
@@ -100,7 +107,7 @@
                <tr>
                    <td class="title">请假类型</td>
                    <td>
                    <td colspan="4">
                        <select class="leaveType form-control data" name="Lavetype" id="Lavetype" style="margin-right: 4px;">
                            <option value="" hassubinfo="true">请选择</option>
                            @foreach (var item in Lavetype)
@@ -136,38 +143,88 @@
                </tr>
                <tr>
                    <td class="title">请假时长</td>
                    <td>
                    <td colspan="4">
                        <input class="layui-input data" style="width:100px !important;float: left;" type="number" value="@Model.LaveDay" name="LaveDay" id="LaveDay" min="0" step="1" readonly="readonly">天
                        <input class="layui-input data" style="width:100px !important;" type="number" value="@Model.LavehHour" name="LavehHour" id="LavehHour" min="0" step="1" readonly="readonly">小时
                    </td>
                </tr>
                <tr>
                    <td class="title">备&nbsp;&nbsp;注</td>
                    <td>
                    <td colspan="4">
                        <textarea class="form-control data" name="Remark" style="width:374px; vertical-align: top;height:100px" maxlength="500">@Model.Remark</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="title">上传附件</td>
                    <td>
                    <td colspan="4">
                        <input type="file" name="file" id="fileUp" multiple>
                    </td>
                </tr>
                <tr>
                    <td colspan="10" style="text-align: center">
                        <a class="btn btn-success" href="javascript:void(0)" onclick="Save();" style="margin-left:4px; border-radius:4px;">
                            <span class="bold">提交</span>
                        </a>
                <tr id="shenpiyijian">
                    <td class="title">审批意见</td>
                    <td colspan="4">
                        <textarea class="form-control data" id="Content" name="Content" style="width:374px; vertical-align: top;height:100px" maxlength="500"></textarea>
                    </td>
                </tr>
                <tr>
                    <td class="title">审批进度</td>
                    <td colspan="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="10">  <table>
    @if (lishiyijian.Count > 0)
    {
        <tr>
            <td style="border:1px solid #ccc;width:150px;">步骤 </td>
            <td style="border:1px solid #ccc;width:150px;"> 批复状态</td>
            <td style="border:1px solid #ccc;width:150px;">批复时间</td>
            <td style="border:1px solid #ccc;width:300px;"> 审批意见</td>
            <td style="border:1px solid #ccc;width:100px;"> 批复人</td>
        </tr>
    }
    @foreach (var wfHistory in lishiyijian)
    {
        <tr>
            <td style="border:1px solid #ccc;width:150px;">@wfHistory.Step</td>
            <td style="border:1px solid #ccc;width:150px;">@wfHistory.ChuliStatusName</td>
            <td style="border:1px solid #ccc;width:150px;">@wfHistory.ModifytimeName</td>
            <td style="border:1px solid #ccc;width:300px;">@wfHistory.Content</td>
            <td style="border:1px solid #ccc;width:100px;">@wfHistory.DeelUserIdName</td>
        </tr>
    }
</table></td>
                    </tr>
            </tbody>
                    <tr>
                        <td colspan="10" style="text-align: center">
                            <a class="btn btn-success" id="tijiao" href="javascript:void(0)" onclick="Save('');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">提交</span>
                            </a>
                            <a class="btn btn-success" id="tongyi" href="javascript:void(0)" onclick="Save('A');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">同意</span>
                            </a>
                            <a class="btn btn-success" id="jujue" href="javascript:void(0)" onclick="Save('D');" style="margin-left:4px; border-radius:4px;">
                                <span class="bold">拒绝</span>
                            </a>
                            <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                            <input type="hidden" id="Tongguojujue" name="Tongguojujue" value="" />
                            <input type="hidden" id="Step" name="Step" value="@dangqianbuzhou" />
                        </td>
                    </tr>
                </tbody>
        </table>
        <div id='file-list-display' style="width: 100%;text-align: left; background-color:white">
            @{ for (int i = 0; i < attachmentsssss.Count; i++)
                {
                    <div>
                        <a download href='@attachmentsssss[i].Filepath'>@attachmentsssss[i].Filefullname  </a> &nbsp;  <a href='javascript: void (0);' onclick='js_method(this,"@attachmentsssss[i].Id")'><i class='glyphicon glyphicon-remove'></i> </a>
                        <a download href='@attachmentsssss[i].Filepath'>@attachmentsssss[i].Filefullname  </a> &nbsp;  <a href='javascript: void (0);' class = 'fujianshanchu'  onclick='js_method(this,"@attachmentsssss[i].Id")'><i class='glyphicon glyphicon-remove'></i> </a>
                        <input type="hidden" name="attachmentid" value="@attachmentsssss[i].Id" />
                        <input type="hidden" name="Filepath" value="@attachmentsssss[i].Filepath" />
                        <input type="hidden" name="Filefullname" value="@attachmentsssss[i].Filefullname" />
@@ -184,6 +241,8 @@
    </form>
    <script type="text/javascript">
        var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95;
        $("#div_content").height(hh);
@@ -207,33 +266,74 @@
        $(function () {
            $(".ldate").each(function (el) {
                laydate({
                    elem: "#" + $(this).attr('id'), //对应id
                    format: 'YYYY-MM-DD hh:mm', //日期格式 // 分隔符可以任意定义,该例子表示只显示年月
                    min: '2021-01-01', //设定最小日期为当前日期
                    max: '2099-06-16', //最大日期
                    type: 'datetime',
                    festival: false, //显示节日
                    istime: true,   //是否显示时分秒
                    istoday: true, //是否是今天
                    choose: function (datas) { //选择日期完毕的回调
                         // console.log("234234234234324");
                        // end.min = datas; //开始日选好后,重置结束日的最小日期
                        // end.start = datas //将结束日的初始值设定为开始日
                        checktime();
                    }
                });
            });
            $("#Lavetype").val("@Model.Lavetype");
             if ("@shifoubiaoji" != "A") {
                $("input").attr('readonly', true);
                $("textarea").attr('readonly', true);
                $(':radio').attr('disabled', true);
                $(':checkbox').attr('disabled', true);
                $(':button').attr('disabled', true);
                //$('a').removeAttr('onclick');
                 $('select').attr('disabled', true);
                 $("#fileUp").attr('disabled', true);
                 $('.fujianshanchu').removeAttr('onclick');
                 if ("@sifoudangqian" == "A") {
                     $("#Content").attr('readonly', false);
                      $('#tijiao').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                     $('#tijiao').hide();
                     $('#shenpiyijian').hide();
                 }
            } else {
                  //审批相关
                 $('#shenpiyijian').hide();
                 if ("@sifoudangqian" == "A") {
                     $('#tongyi').hide();
                     $('#jujue').hide();
                 } else {
                     $('#tongyi').hide();
                      $('#jujue').hide();
                      $('#tijiao').hide();
                 }
                 $(".ldate").each(function (el) {
                     laydate({
                         elem: "#" + $(this).attr('id'), //对应id
                         format: 'YYYY-MM-DD hh:mm', //日期格式 // 分隔符可以任意定义,该例子表示只显示年月
                         min: '2021-01-01', //设定最小日期为当前日期
                         max: '2099-06-16', //最大日期
                         type: 'datetime',
                         festival: false, //显示节日
                         istime: true,   //是否显示时分秒
                         istoday: true, //是否是今天
                         choose: function (datas) { //选择日期完毕的回调
                             // console.log("234234234234324");
                             // end.min = datas; //开始日选好后,重置结束日的最小日期
                             // end.start = datas //将结束日的初始值设定为开始日
                             checktime();
                         }
                     });
                 });
            }
        })
        function Save() {
        function Save(tongyi) {
            if ($("#StratTime").val() == '') {
                toastr.warning("开始日期不能为空");
                return;
@@ -262,9 +362,9 @@
                return;
            }
            
            $("#Tongguojujue").val(tongyi);
            //var data = { id: $("#Id").val(), StartTime:$("#StartTime").val(), Sheng: $("#Sheng").val(), job_level: $("#Job_level").val().toString(), ExistsAttachment: fileId != "" }
            $.ajax({
                type: "POST",
@@ -285,7 +385,9 @@
                            _pageAutoClose();//自动关闭页面方法
                        }
                        catch (err) {
                            parent._CloseTab1("/Signin/AskLeave/");
                            var pathname = window.location.pathname;
                            var search = window.location.search;
                            parent._CloseTab1(pathname + search);
                        }
                    }
@@ -351,7 +453,7 @@
                        var fileListDisplay = $("#file-list-display");
                        if (data.DataList && data.DataList.length > 0) {
                            for (var i = 0; i < data.DataList.length; i++) {
                                var aaa = "<div><a download href ='" + data.DataList[i].Filepath + "'>" + data.DataList[i].Filefullname + " </a> &nbsp;  <a   href='javascript: void (0);' onclick='js_method(this,\"\")' ><i class='glyphicon glyphicon-remove'></i> </a> "
                                var aaa = "<div><a download href ='" + data.DataList[i].Filepath + "'>" + data.DataList[i].Filefullname + " </a> &nbsp;  <a   href='javascript: void (0);' class = 'fujianshanchu' onclick='js_method(this,\"\")' ><i class='glyphicon glyphicon-remove'></i> </a> "
                                aaa += ' <input type="hidden"  name="attachmentid" value="" />   ';
                                aaa += ' <input type="hidden"  name="Filepath" value="' + data.DataList[i].Filepath + '" />  ';
                                aaa += '  <input type="hidden"  name="Filefullname" value="' + data.DataList[i].Filefullname + '" />  ';
@@ -407,7 +509,7 @@
        }
        function checktime() {
            if ($("#StratTime").val() == '') {
@@ -422,8 +524,8 @@
                return;
            }
@@ -438,14 +540,14 @@
                success: function (data) {
                    if (data.Result) {
                        $("#LaveDay").val(data.DataInfo.LaveDay);
                        $("#LavehHour").val(data.DataInfo.LavehHour);
                        $("#LavehHour").val(data.DataInfo.LavehHour);
                    }
                    else {
                        toastr.error(data.Message);
                    }
                },
                error: function () {