|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeaveApply.aspx.cs" Inherits="TradeManage.SysManage.LeaveApply" %>
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
<head id="Head1" runat="server">
|
|
|
<title>请假申请单</title>
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css" />
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/fancybox/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
var UserName = '<%= Session["Name"].ToString() %>';
|
|
|
var UserId = '<%= Session["UserId"]%>';
|
|
|
|
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
GetHour();
|
|
|
$("#a_name").html(UserName);
|
|
|
GetDeptCharge();
|
|
|
|
|
|
|
|
|
$("#btn_Back2").bind("click", function () {
|
|
|
|
|
|
window.location.href = "LeaveList.aspx";
|
|
|
});
|
|
|
$("#btn_Back").bind("click", function() {
|
|
|
|
|
|
window.location.href = "LeaveList.aspx";
|
|
|
});
|
|
|
$("#select_lx").bind("change", function () {
|
|
|
if ($(this).val() == "运动(生理假)") {
|
|
|
$("#tr_yd").show();
|
|
|
$("#tr_pt").hide();
|
|
|
$("#tr_tx").hide();
|
|
|
$("#txt_desc").val("运动(生理假)");
|
|
|
// $("#tr_check").hide();
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if ($(this).val() == "调休") {
|
|
|
$("#tr_yd").hide();
|
|
|
$("#tr_tx").show();
|
|
|
$("#tr_pt").show();
|
|
|
$("#txt_desc").val("调休");
|
|
|
// $("#tr_check").hide();
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
$("#tr_tx").hide();
|
|
|
$("#tr_yd").hide();
|
|
|
$("#tr_pt").show();
|
|
|
}
|
|
|
//$("#tr_check").show();
|
|
|
}
|
|
|
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function GetHour()
|
|
|
{
|
|
|
for(var i=0;i<24;i++)
|
|
|
{
|
|
|
if(i==8)
|
|
|
$("#select_shour").append("<option value='"+i+"' selected='selected'>"+i.toString()+"时</option>");
|
|
|
else
|
|
|
$("#select_shour").append("<option value='"+i+"'>"+i.toString()+"时</option>");
|
|
|
if(i==17)
|
|
|
$("#select_ehour").append("<option value='"+i+"' selected='selected'>"+i.toString()+"时</option>");
|
|
|
else
|
|
|
$("#select_ehour").append("<option value='"+i+"'>"+i.toString()+"时</option>");
|
|
|
|
|
|
}
|
|
|
for (var i = 0; i < 60; i++) {
|
|
|
if (i == 30)
|
|
|
$("#select_smin").append("<option value='" + i + "' selected='selected'>" + i.toString() + "分</option>");
|
|
|
else
|
|
|
$("#select_smin").append("<option value='" + i + "'>" + i.toString() + "分</option>");
|
|
|
if (i == 30)
|
|
|
$("#select_emin").append("<option value='" + i + "' selected='selected'>" + i.toString() + "分</option>");
|
|
|
else
|
|
|
$("#select_emin").append("<option value='" + i + "'>" + i.toString() + "分</option>");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function GetDeptCharge() {
|
|
|
//if (UserId == 39 || UserId == 26) {
|
|
|
// $("#tr_check").hide();
|
|
|
// return;
|
|
|
//}
|
|
|
|
|
|
var param = new Object();
|
|
|
param.UserId = UserId;
|
|
|
$.ajax({
|
|
|
url: "OA_Manage.asmx/GetLeaveCharge",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
success: function(data) {
|
|
|
if (data.d != null) {
|
|
|
|
|
|
if(data.d.length > 1)
|
|
|
$("#select_check").append("<option value='0'>-选择-</option>");
|
|
|
|
|
|
$(data.d).each(function () {
|
|
|
$("#select_check").append("<option value='" + this.UserId + "' duty='"+this.Duty+"'>" + this.Name + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
else
|
|
|
$("#select_check").append("<option value='0'>-选择-</option>");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
var WorkTableModel = null;
|
|
|
//Model
|
|
|
function GetModel() {
|
|
|
if(Id==0)return;
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
async: false,
|
|
|
type: "POST",
|
|
|
contentType: "application/json",
|
|
|
url: "OA_Manage.asmx/GetWorkTableModel",
|
|
|
data: "{'Id':" + Id + "}",
|
|
|
dataType: "json",
|
|
|
cache: false,
|
|
|
success: function(data) {
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
|
WorkTableModel = data.d;
|
|
|
$("#select_oper").val(WorkTableModel.WorkType);
|
|
|
$("#select_jj").val(WorkTableModel.Emergent);
|
|
|
$("#select_customer").val(WorkTableModel.CustomId);
|
|
|
GetDevelopSubjectList();
|
|
|
$("#select_subject").val(WorkTableModel.SubjectId);
|
|
|
if(WorkTableModel.CustomEndDate!=null)
|
|
|
$("#txt_cedate").val(WorkTableModel.CustomEndDate.localeFormat("yyyy-MM-dd"));
|
|
|
$("#txt_submitperson").val(WorkTableModel.SubmitName);
|
|
|
$("#txt_contact").val(WorkTableModel.ContactPerson);
|
|
|
$("#txt_phone").val(WorkTableModel.ContactPhone);
|
|
|
$("#txt_desc").val(WorkTableModel.WorkDesc);
|
|
|
|
|
|
if (WorkTableModel.AffixIds != null && WorkTableModel.AffixIds != "") {
|
|
|
GetFiles(WorkTableModel.AffixIds);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
error: function(xhr, status) {
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function ReadGetModel() {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.UserId = UserId;
|
|
|
$.ajax({
|
|
|
url: "BaseData.asmx/GetStudentModel",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
success: function(data) {
|
|
|
|
|
|
if (data.d != null) {
|
|
|
StdModel = data.d;
|
|
|
$("#txt_Name").val(data.d.Name);
|
|
|
if (data.d.Sex == '女')
|
|
|
$("#rad_sex2").attr("checked", "checked");
|
|
|
// $("#txt_UserName").val(data.d.UserName);
|
|
|
// $("#txt_PassWord").val(data.d.Password);
|
|
|
// $("#txt_PassWordSure").val(data.d.Password);
|
|
|
// if(data.d.IsUse ==0)
|
|
|
// $("#chk_IsLogin").removeAttr("checked");
|
|
|
// if(data.d.Station!=null&&data.d.Station!='')
|
|
|
|
|
|
$("#txt_StudentNo").val(data.d.StudentNo);
|
|
|
$("#select_Classes").val(data.d.ClassId);
|
|
|
if (data.d.StudentType != null && data.d.StudentType != '')
|
|
|
$("#select_studenttype").val(data.d.StudentType);
|
|
|
if (data.d.Photo != null && data.d.Photo != '') {
|
|
|
ModelImg = data.d.Photo;
|
|
|
|
|
|
$("#StudentImg").attr("src", "../" + ModelImg).css("display", "");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function save() {
|
|
|
//if ($("#select_lx").val() == "运动(生理假)") {
|
|
|
|
|
|
// if ($("#txt_ydsdate").val() == "") {
|
|
|
// alert("请填写请假时间");
|
|
|
// return;
|
|
|
// }
|
|
|
//}
|
|
|
//else
|
|
|
//{
|
|
|
if ($("#select_lx").val() != "运动(生理假)") {
|
|
|
if ($("#txt_sdate").val() == "") {
|
|
|
alert("请填写请假开始时间");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ($("#txt_edate").val() == "") {
|
|
|
alert("请填写请假结束时间");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ($("#txt_days").val() == "") {
|
|
|
alert("请填写请假天数");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($("#txt_desc").val() == "") {
|
|
|
alert("请填写请假事由");
|
|
|
$("#txt_submitperson").focus();
|
|
|
return;
|
|
|
}
|
|
|
if (UserId != 39 && UserId != 26 && UserId != 439 && UserId != 425) {
|
|
|
if ($("#select_check").find("option").length == 0 || $("#select_check").val() == "0") {
|
|
|
alert("请选择审批人");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
var param = new Object();
|
|
|
var model = new Object();
|
|
|
model.Id = 0;
|
|
|
model.InName =UserName;
|
|
|
model.DaysUint = $("#select_dw").val();
|
|
|
model.InUserId = UserId;
|
|
|
if ($("#select_lx").val() == "运动(生理假)") {
|
|
|
model.AMPM = $("#select_ampm").val();
|
|
|
if (model.AMPM == "上午") {
|
|
|
model.SDate = $("#txt_ydsdate").val() + " 8:30:00";
|
|
|
model.EDate = $("#txt_ydsdate").val() + " 11:45:00";
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
model.SDate = $("#txt_ydsdate").val() + " 11:45:00";
|
|
|
model.EDate = $("#txt_ydsdate").val() + " 17:30:00";
|
|
|
|
|
|
|
|
|
}
|
|
|
model.Days = 0.5;
|
|
|
model.DaysUint ="天";
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
if ($("#select_lx").val() == "调休") {
|
|
|
model.SDate = $("#txt_sdate").val() + " " + $("#select_shour").val() + ":" + $("#select_smin").val() + ":00";
|
|
|
model.EDate = $("#txt_edate").val() + " " + $("#select_ehour").val() + ":" + $("#select_emin").val() + ":00";
|
|
|
model.Days = 0;
|
|
|
model.PDays = $("#txt_days").val();
|
|
|
model.PSDate = $("#txt_txsdate").val()
|
|
|
model.PEDate = $("#txt_txedate").val()
|
|
|
}
|
|
|
else {
|
|
|
model.SDate = $("#txt_sdate").val() + " " + $("#select_shour").val() + ":" + $("#select_smin").val() + ":00";
|
|
|
model.EDate = $("#txt_edate").val() + " " + $("#select_ehour").val() + ":" + $("#select_emin").val() + ":00";
|
|
|
model.Days = $("#txt_days").val();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if ($("#select_check").find("option:selected").attr("duty") == "经理") {
|
|
|
model.DeptUserId = $("#select_check").val();
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
model.DeptUserId = 0;
|
|
|
model.DeptAgree = 1;
|
|
|
model.CompanyUserId = $("#select_check").val();
|
|
|
}
|
|
|
model.State = 0;
|
|
|
if (UserId == 39 || UserId == 26 || UserId == 425 || UserId == 439) {
|
|
|
model.DeptUserId = 0;
|
|
|
model.DeptAgree = 1;
|
|
|
model.CompanyUserId = 0;
|
|
|
model.CompanyAgree = 1;
|
|
|
model.ManageUserId = $("#select_check").val();
|
|
|
model.State = 1;
|
|
|
}
|
|
|
model.Reason = $("#txt_desc").val();
|
|
|
model.LeaveType = $("#select_lx").val();
|
|
|
|
|
|
|
|
|
|
|
|
param.model = model;
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
contentType: "application/json",
|
|
|
url: "OA_Manage.asmx/SaveLeave",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
cache: false,
|
|
|
success: function(data) {
|
|
|
|
|
|
if (data.d == "提交成功") {
|
|
|
|
|
|
|
|
|
|
|
|
alert("提交成功,请等待审批");
|
|
|
window.location.href = "LeaveList.aspx";
|
|
|
}
|
|
|
else {
|
|
|
alert(data.d);
|
|
|
if (data.d == "提交成功,以后请假请注意必须提早一天请假")
|
|
|
window.location.href = "LeaveList.aspx";
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
// document.location.href = "SoftWorkTableList.aspx";
|
|
|
},
|
|
|
error: function(xhr, status) {
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
|
|
|
<div class="title_ico">
|
|
|
请假单
|
|
|
</div>
|
|
|
<table border="0" cellpadding="0" cellspacing="0" style="width: 99%;">
|
|
|
<tr>
|
|
|
<td align="center">
|
|
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 80%;" class="tableAll">
|
|
|
<tr>
|
|
|
<td colspan="4" align="center" style="font-weight: bolder; font-size: 24px">
|
|
|
请假申请单
|
|
|
<input id="btn_Back2" class="btnClass btnClassEdit" type="button" value="请假管理" /></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label1" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
请假人:
|
|
|
</td>
|
|
|
<td style="width: 30%">
|
|
|
<a id='a_name'></a></td>
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label2" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
请假类型:
|
|
|
</td>
|
|
|
<td width="30%">
|
|
|
<select id="select_lx" name="D2" style="width:120px">
|
|
|
<option value="年假">年假</option>
|
|
|
<option value="运动(生理假)">运动(生理假)</option>
|
|
|
<option value="心情假">心情假</option>
|
|
|
<option value="事假">事假</option>
|
|
|
<option value="病假">病假</option>
|
|
|
<option value="旅游假">旅游假</option>
|
|
|
<option value="婚假">婚假</option>
|
|
|
<option value="产假">产假</option>
|
|
|
<option value="调休">调休</option>
|
|
|
</select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr id="tr_pt">
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label3" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
请假起止时间/天数:
|
|
|
</td>
|
|
|
<td colspan="3">
|
|
|
<input id="txt_sdate" type="text" onfocus="WdatePicker()" style="width:90px" class="editTextbox"/><select id="select_shour" style="width:50px" class="selectClass">
|
|
|
|
|
|
</select><select id="select_smin" style="width:50px" class="selectClass">
|
|
|
|
|
|
</select>--<input id="txt_edate" type="text"
|
|
|
onfocus="WdatePicker()" style="width:90px" class="editTextbox"/><select id="select_ehour" class="selectClass" style="width:50px">
|
|
|
|
|
|
</select><select id="select_emin" style="width:50px" class="selectClass">
|
|
|
|
|
|
</select>
|
|
|
请<input id="txt_days"
|
|
|
class="easyui-numberbox" max="10000" min="0.5" precision="1" style="width: 50px"
|
|
|
value="" /><select id="select_dw" style="width:50px" class="selectClass" name="D5">
|
|
|
<option value="天">天</option>
|
|
|
<option value="小时">小时</option>
|
|
|
</select>
|
|
|
<br /><font color="red">注:中间遇节假日请假天数请自己计算减除,半天请假填0.5</font></td>
|
|
|
|
|
|
</tr>
|
|
|
<tr style="display:none" id="tr_yd">
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label6" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
请假时间</td>
|
|
|
<td colspan="3">
|
|
|
<input id="txt_ydsdate" type="text" onfocus="WdatePicker()" /><select id="select_ampm" style="width:50px" name="D4">
|
|
|
<option value="上午">上午</option>
|
|
|
<option value="下午">下午</option>
|
|
|
</select><a id="a_days">0.5</a>天 </td>
|
|
|
|
|
|
</tr>
|
|
|
<tr style="display:none" id="tr_tx">
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label4" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
调休起止时间</td>
|
|
|
<td colspan="3">
|
|
|
<input id="txt_txsdate" type="text" onfocus="WdatePicker()" />--
|
|
|
<input id="txt_txedate" type="text" onfocus="WdatePicker()" />
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="f1" style="width: 20%">
|
|
|
<asp:Label ID="Label5" runat="server" Text="*" ForeColor="Red" Font-Bold="True"></asp:Label>
|
|
|
请假事由:<br />
|
|
|
(及工作移交)
|
|
|
</td>
|
|
|
<td colspan="3">
|
|
|
<textarea id="txt_desc" cols="20" rows="15" style="width: 100%"></textarea>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr id="tr_check">
|
|
|
<td class="f1" style="width: 20%">
|
|
|
下一步审批人:
|
|
|
</td>
|
|
|
<td colspan="3">
|
|
|
|
|
|
<select id="select_check" style="width:100px" name="D3">
|
|
|
|
|
|
</select></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td colspan="4" align="center">
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="提交" onclick="save();" />
|
|
|
<input id="btn_Back" class="btnClass btnClassBack" type="button" value="返回" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td colspan="4" style="color: Red">
|
|
|
注:请假单流转过程:
|
|
|
<br />
|
|
|
a.(2天以内请假)普通员工请假(提交)---->部门经理审批(签字)--->副总经理审批(签字)--->行政备案<br />
|
|
|
b.(2天及以上请假)普通员工请假(提交)---->部门经理审批(签字)--->副总经理审批(签字)---->总经理审批(签字)--->行政备案<br /> c.部门经理请假(提交)---->副总经理审批(签字)--->行政备案<br />
|
|
|
d.副总经理请假(提交)---->总经理审批(签字)--->行政备案<br />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|