@model DTO.AdmAskLeaveDTO;
|
@using DTO;
|
@using zhengcaioa.Models;
|
@{
|
Layout = null;
|
|
ResultDataEntity<SysAttachmentDTO> attachment = ViewBag.attachment as ResultDataEntity<SysAttachmentDTO>; //问题类型
|
List<SysAttachmentDTO> attachmentsssss = attachment.DataList;
|
|
if (attachmentsssss == null)
|
{
|
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>
|
<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/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;
|
}
|
.data {
|
width: 400px !important;
|
}
|
</style>
|
<form method="post" onsubmit="return check();">
|
<input type="text" value="" id="SigninId" name="SigninId" hidden="hidden">
|
<table style="width: 100%;text-align: left; background-color:white">
|
<tbody>
|
<tr>
|
<td class="title">单据名称</td>
|
<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 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 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>
|
|
</tr>
|
|
<tr>
|
<td class="title">请假类型</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)
|
{
|
@if (!item.CodeSn.Equals(Model.Lavetype))
|
{
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeSn" hassubinfo="true" selected="selected">
|
@item.Comments
|
</option>
|
}
|
|
}
|
|
@*<option value="1">事假</option>
|
<option value="2">病假</option>
|
<option value="3">调休</option>
|
<option value="4">年假</option>
|
<option value="5">产假</option>
|
<option value="6">陪产假</option>
|
<option value="7">婚假</option>
|
<option value="8">例假</option>
|
<option value="9">丧假</option>
|
<option value="10">哺乳假</option>*@
|
|
</select>
|
</td>
|
</tr>
|
<tr>
|
<td class="title">请假时长</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">备 注</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 colspan="4">
|
<input type="file" name="file" id="fileUp" multiple>
|
</td>
|
</tr>
|
<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>
|
|
<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> <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" />
|
|
|
</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"
|
};
|
|
|
|
|
$(function () {
|
|
$("#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(tongyi) {
|
if ($("#StratTime").val() == '') {
|
toastr.warning("开始日期不能为空");
|
return;
|
}
|
|
if ($("#EndTime").val() == '') {
|
toastr.warning("结束日期不能为空");
|
return;
|
}
|
if ($("#EndTime").val() <= $("#StratTime").val()) {
|
toastr.warning("结束日期不能小于开始日期");
|
return;
|
}
|
if ($("#Lavetype").val() == '') {
|
toastr.warning("请假类型不能为空");
|
return;
|
}
|
|
if ($("#LaveDay").val() == '') {
|
toastr.warning("请假天数不能为空");
|
return;
|
}
|
|
if ($("#LavehHour").val() == '') {
|
toastr.warning("请假小时不能为空");
|
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",
|
url: "/Signin/SaveAskLeave",
|
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) {
|
var pathname = window.location.pathname;
|
var search = window.location.search;
|
parent._CloseTab1(pathname + search);
|
}
|
|
}
|
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> <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 + '" /> ';
|
|
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 checktime() {
|
if ($("#StratTime").val() == '') {
|
$("#LaveDay").val(0);
|
$("#LavehHour").val(0);
|
return;
|
}
|
|
if ($("#EndTime").val() == '') {
|
$("#LaveDay").val(0);
|
$("#LavehHour").val(0);
|
return;
|
}
|
|
|
|
|
|
|
var data = { StratTime: $("#StratTime").val(), EndTime: $("#EndTime").val()}
|
$.ajax({
|
type: "POST",
|
url: "/Signin/Checktime",
|
dataType: "json",
|
global: false,
|
async: false,
|
data: data,
|
success: function (data) {
|
if (data.Result) {
|
$("#LaveDay").val(data.DataInfo.LaveDay);
|
$("#LavehHour").val(data.DataInfo.LavehHour);
|
}
|
else {
|
toastr.error(data.Message);
|
|
}
|
|
|
|
},
|
error: function () {
|
|
parent.layer.msg('失败', { icon: 5 });
|
}
|
});
|
}
|
|
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>
|