You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

344 lines
13 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkAddApply.aspx.cs" Inherits="TradeManage.SysManage.WorkAddApply" %>
<!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);
var dd = new Date();
$("#txt_sdate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
$("#txt_edate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate());
$("#btn_Back2").bind("click", function () {
window.location.href = "WorkAddList.aspx";
});
GetHour();
$("#a_name").html(UserName);
GetDeptCharge();
$("#btn_Back").bind("click", function() {
window.location.href = "WorkAddList.aspx";
});
});
function GetHour()
{
for(var i=0;i<24;i++)
{
if(i==17)
$("#select_shour").append("<option value='"+i+"' selected='selected'>"+i.toString()+"时</option>");
else
$("#select_shour").append("<option value='"+i+"'>"+i.toString()+"时</option>");
if(i==20)
$("#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>");
}
});
}
function save() {
//if ($("#select_lx").val() == "运动(生理假)") {
// if ($("#txt_ydsdate").val() == "") {
// alert("请填写请假时间");
// return;
// }
//}
//else
//{
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) {
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.InUserId = UserId;
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) {
model.DeptUserId = 0;
model.DeptAgree = 1;
model.CompanyUserId = 0;
model.CompanyAgree = 1;
model.State = 2;
}
model.Reason = $("#txt_desc").val();
// model.LeaveType = $("#select_lx").val();
param.model = model;
$.ajax({
type: "POST",
contentType: "application/json",
url: "OA_Manage.asmx/SaveWorkAdd",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
cache: false,
success: function(data) {
alert("提交成功,请等待审批");
window.location.href = "WorkAddList.aspx";
// 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%">
&nbsp;</td>
<td width="30%">
&nbsp;</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="" />小时</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>
<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">
&nbsp;&nbsp; <input id="btn_Save" type="button" value="提交" onclick="save();" />&nbsp;
<input id="btn_Back" type="button" value="返回" />
</td>
</tr>
<tr>
<td colspan="4" style="color: Red">
注:加班申请流程:
<br />
a.普通员工申请(提交)---->部门负责人审批(签字)---&gt;行政备案<br />
c.部门经理申请(提交)---->副总经理审批(签字)---&gt;行政备案<br />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>