username@email.com
2021-06-03 904fb460b9359fe92e00ce25804d96c8a52bb513
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
@model DTO.AdmAskLeaveOffDTO;
@using DTO;
@using zhengcaioa.Models;
 
@{
    Layout = null;
   
      ResultDataEntity<SysAttachmentDTO> attachment = ViewBag.attachment as  ResultDataEntity<SysAttachmentDTO>; //问题类型
      List<SysAttachmentDTO>  attachmentsssss =  attachment.DataList;
}
 
<!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" />
 
    <!-- 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">
    <style>
        .title {
            width: 80px !important;
            text-align: right;
            padding-right: 10px;
        }
 
        table td {
            padding-top: 8px !important;
        }
 
        .img-box {
            height: 120px;
            width: 120px;
            padding-left: 0px !important;
            padding-right: 20px;
            /*border:1px solid #c3cbe5;*/
        }
 
            .img-box img {
                height: 80px;
                width: 80px;
            }
 
            .img-box p {
                width: 80px;
                text-align: center;
            }
 
        .img-row {
            height: 80px !important;
            padding-right: 2px !important;
        }
 
            .img-row label {
                height: 30px;
                line-height: 80px;
            }
    </style>
    <form method="post" onsubmit="return check();">
        <input type="text" id="SigninId" name="SigninId" hidden="hidden">
        <input type="text" value="@Model.Id" id="Id" name="Id" hidden="hidden">
        <table style="width: 100%;text-align: left; background-color:white">
            <tbody>
                <tr>
                    <td class="title">销假时间</td>
                    <td>
                        <input type="text" class="layui-input  layer-date  ldate form-control" value="@Model.StratTime.ToString("yyyy-MM-dd HH:mm:ss")" name="StratTime" id="StratTime" style="width:150px;margin-right: 4px;" autocomplete="off" readonly="readonly">-
                        <input type="text" class="layui-input  layer-date ldate form-control" value="@Model.EndTime.ToString("yyyy-MM-dd HH:mm:ss")" name="EndTime" id="EndTime" style="width:150px;margin-right: 4px;" autocomplete="off" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td class="title">销假类型</td>
                    <td>
                        <select class="leaveType form-control" name="Lavetype" id="Lavetype" style="width:150px;margin-right: 4px;">
                            <option value="">请选择</option>
                            <option value="1">出差</option>
                            <option value="2">病假</option>
                            <option value="3">忘打卡</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="title">申请理由</td>
                    <td>
                        <textarea name="Remark" style="width:374px; vertical-align: top;height:100px">@Model.Remark</textarea>
                    </td>
                </tr>
 
 
                <tr style="height:120px;">
                    <td class="title">上传病历</td>
                    <td>
                        <div class="img-box">
                            <div id="ImgMedicalRecord" class="ImgMedicalRecord"></div>
                            <input type="hidden" id="MedicalRecord" name="MedicalRecord" value="@Model.MedicalRecord" />
                            <p>单击上传病历</p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="10" style="text-align: center;font-size:8px;color:red;">
                        <p>请在72小时内进行销假处理,超过72小时无法提交</p>
                    </td>
                </tr>
                <tr>
                    <td class="title">上传附件</td>
                    <td>
                        <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>
                    </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>
                    <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" />
 
 
                </div>
            }
 
 
 
            }
 
        </div>
    </form>
    <script src="~/js/imgUpload.js"></script>
    <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 imgPath = "@Url.Content("~/UploadFile/")";
        $(function () {
            $(".ldate").each(function (el) {
                laydate({
                    elem: "#" + $(this).attr('id'), //对应id
                    format: 'YYYY-MM-DD hh:mm:ss', //日期格式 // 分隔符可以任意定义,该例子表示只显示年月
                    min: '2021-01-01', //设定最小日期为当前日期
                    max: '2099-06-16', //最大日期
                    type: 'datetime',
                    festival: false, //显示节日
                    istime: true,   //是否显示时分秒
                    istoday: true, //是否是今天
                    choose: function (datas) { //选择日期完毕的回调
                        // end.min = datas; //开始日选好后,重置结束日的最小日期
                        // end.start = datas //将结束日的初始值设定为开始日
                    }
                });
 
            });
 
            new DragImgUpload("#ImgMedicalRecord", {
                callback: function (files) {
                    let img = imgUploadCallback(files);
                    if (img !== "") {
                        $("#MedicalRecord").val(imgPath + img);
                    }
 
                }
            });
 
            let img = "@Model.MedicalRecord";
            if ($.trim(img) !== "")
            {
                $("#ImgMedicalRecord img").each(function (i) {
                    $(this).attr("src", img);
                });
            }
           $("#Lavetype").val("@Model.Lavetype");
           $("#SigninId").val("@ViewBag.SigninId");
 
        })
 
         function imgUploadCallback(files) {
                var fileName = "";
                var file = files[0];
                var sendData = new FormData();
                sendData.append('img', files[0]);
                $.ajax({
                    type: "post",
                    url: "@Url.Content("~/Expert/UploadImage")",
                    data: sendData,
                    async:false,
                    contentType: false,
                    processData: false,
                    success: function (res) {
                        fileName = res;// FilePath + file.name;
                         //parent.layer.msg("修改成功!");
                     },
                     error: function (data) {
                         fileName = "";
                     }
            });
 
            return fileName;
        };
 
        function Save() {
            if ($("#StratTime").val() == '') {
                toastr.warning("开始时间不能为空");
                return;
            }
 
            if ($("#EndTime").val() == '') {
                toastr.warning("结束时间不能为空");
                return;
            }
 
            if ($("#Lavetype").val() == '') {
                toastr.warning("销假类型不能为空");
                return;
            }
 
 
          
            //var data = { id: $("#Id").val(), StartTime:$("#StartTime").val(), Sheng: $("#Sheng").val(), job_level: $("#Job_level").val().toString(), ExistsAttachment: fileId != "" }
            $.ajax({
                type: "POST",
                url: "/Signin/SaveAskLeaveOff",
                dataType: "json",
                global: false,
                async: false,
                data: $('form').serializeArray(),
                success: function (data) {
                  
 
                    if (data.Result) {
                        //  parent._afterSave(true);
                        parent.layer.msg('成功保存', { icon: 6 });
                        //window.location = "/Project/add?id=" + data.ReturnID;
                        try {
 
                            _pageAutoClose();//自动关闭页面方法
                        }
                        catch (err) {
                            parent._CloseTab1("/Signin/AskLeave/");
                        }
 
                    }
                    else {
                        // toastr.error("失败");
                        parent.layer.msg(data.Message, { icon: 5 });
                    }
 
                },
                error: function () {
 
                    parent.layer.msg('失败', { icon: 5 });
                }
            });
        }
 
 
        $("#fileUp").on("change", function () {
 
 
            var fileM = document.querySelector("#fileUp");
            //获取文件对象,files是文件选取控件的属性,存储的是文件选取控件选取的文件对象,类型是一个数组
            var fileList = fileM.files;
            if (!fileList || fileList.length == 0) {
                toastr.warning(  "请选择文件!");
                return
            }
 
              //创建formdata对象,formData用来存储表单的数据,表单数据时以键值对形式存储的。
            var formData = new FormData();
            for (var i = 0; i < fileList.length;i++) {
                var file = fileList[i];
 
                var filePath = file.value;    //js中无法获取文件的真是路径
 
                var fileSize = file.size
                var isLt10M = fileSize / 1024 / 1024 < 10
                if (!isLt10M) {
 
                    toastr.warning(file.name + " 上传文件大小不能超过10M");
                    file = ''
                    return
                }
                formData.append('files', file, file.name);
            }
 
 
 
 
            $.ajax({
                url: "/Systemsetting/fileUpTongYong/",
                type: "post",
                dataType: "json",
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (data) {
                    if (data.Result) {
                        parent.layer.msg('上传成功', { icon: 6 });
                        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> "
                                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 + '" />  ';
                                
                                aaa += "</div>";
                                fileListDisplay.append(aaa);
                            }
                        }
 
 
                        //$("#Logo1").attr("src", data.Message);
                        //$("#Logo").val(data.Message);
                    }
                    else {
                        toastr.error("上传失败");
 
                    }
                },
            });
        });
 
        function js_method(obj, id) {
 
 
 
 
            if (id && id != "") {
 
                $.ajax({
                    url: "/Systemsetting/fileUpremove?id=" + id,
                    type: "post",
                    dataType: "json",
                    data: "",
                    async: false,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (data) {
                        if (data.Result) {
                            $(obj).parent().remove();
                            toastr.error("删除成功");
                        }
                        else {
                            toastr.error("删除失败");
 
                        }
                    },
                });
            } else {
                $(obj).parent().remove();
            }
 
 
 
        }
 
        function _pageAutoClose() {
 
            parent.window._reloadPageData();
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.isRefresh = true;
            parent.layer.closeAll('loading');
            //layer.closeAll();
            parent.layer.close(index);
            $(".layui-layer-close").click();
            return false;
        }
    </script>
</body>
</html>