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.
554 lines
18 KiB
Plaintext
554 lines
18 KiB
Plaintext
1 month ago
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LeaveResq.aspx.cs" Inherits="TradeManage.SysManage.LeaveResq" %>
|
||
|
|
||
|
|
||
|
<!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 datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
||
|
var datagrid2 = new nblf.ui.DataGrid("DataGrid2");
|
||
|
var TeaId = 0;
|
||
|
var WindowLoadModel = new WindowLoad();
|
||
|
$(document).ready(function () {
|
||
|
WindowLoadModel.ApplicationPath = "../";
|
||
|
WindowLoadModel.ControlID = "WindowLoad";
|
||
|
WindowLoadModel.Isbgiframe = true;
|
||
|
WindowLoadModel.Load();
|
||
|
ajaxInit(WindowLoadModel);
|
||
|
|
||
|
CreateDataGrid();
|
||
|
CreateDataGrid2();
|
||
|
$("#btnCancel").bind("click", $.fancybox.close);
|
||
|
$("#" + datagrid1.TableID + " a[CommandName='cmdView']").live("click", function () {
|
||
|
RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
||
|
var model = datagrid1.Get_Model(RowIndex);
|
||
|
TeaId = model.InUserId;
|
||
|
ReadDataDetail();
|
||
|
|
||
|
});
|
||
|
ReadData();
|
||
|
|
||
|
$("#btn_Sch").bind("click", function () {
|
||
|
|
||
|
ReadData();
|
||
|
});
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
function GetWeeks() {
|
||
|
var myDate = new Date();
|
||
|
var month = myDate.getMonth() + 1;
|
||
|
for (var i = 1; i < 13; i++) {
|
||
|
if (month == i)
|
||
|
$("#select_week").append("<option value=" + i + " selected='selected'>" + i.toString() + "月</option>");
|
||
|
else
|
||
|
|
||
|
$("#select_week").append("<option value=" + i + ">" + i.toString() + "月</option>");
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function GetYear() {
|
||
|
var myDate = new Date();
|
||
|
var year = myDate.getFullYear();
|
||
|
for (var i = 2013; i < 2050; i++) {
|
||
|
if (i == year)
|
||
|
$("#select_year").append("<option value=" + i + " selected='selected'>" + i.toString() + "年</option>");
|
||
|
else
|
||
|
$("#select_year").append("<option value=" + i + ">" + i.toString() + "年</option>");
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
function GetNowWeek() {
|
||
|
|
||
|
|
||
|
var param = new Object();
|
||
|
param.ReportId = 0;
|
||
|
param.WeekNo = WeekNo;
|
||
|
param.Year = $("#select_year").val();
|
||
|
$.ajax({
|
||
|
async: false,
|
||
|
type: "POST",
|
||
|
contentType: "application/json",
|
||
|
url: "OA_Manage.asmx/GetNowWeek",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
cache: false,
|
||
|
success: function (data) {
|
||
|
|
||
|
if (data.d != null) {
|
||
|
|
||
|
WeekNo = data.d.WeekNo;
|
||
|
|
||
|
|
||
|
if (data.d.StartDate != null)
|
||
|
$("#a_sdate").html(data.d.StartDate.localeFormat("yyyy年MM月dd日"));
|
||
|
if (data.d.EndDate != null)
|
||
|
$("#a_edate").html(data.d.EndDate.localeFormat("yyyy年MM月dd日"));
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
},
|
||
|
error: function (xhr, status) {
|
||
|
if (status != "success") alert(xhr.responseText);
|
||
|
}
|
||
|
});
|
||
|
$("#" + datagrid1.TableID + " a[CommandName='cmdView']").live("click", function () {
|
||
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
||
|
var model = datagrid1.Get_Model(RowIndex);
|
||
|
|
||
|
|
||
|
|
||
|
var ReportId = model.Id;
|
||
|
if (model.Id != null)
|
||
|
document.location.href = "WorkWeekLook.aspx?Look=Look&ReportId=" + ReportId;
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
var ListMenu = new Array();
|
||
|
// var Shtm = new Sys.StringBuilder();
|
||
|
|
||
|
//#region 读取部门
|
||
|
function ReadDeptList() {
|
||
|
// var cudata = new Date();
|
||
|
|
||
|
ListMenu = new Array();
|
||
|
// Shtm = new Sys.StringBuilder();
|
||
|
var CompanyId = 0;
|
||
|
|
||
|
$.ajax({
|
||
|
type: "POST",
|
||
|
contentType: "application/json",
|
||
|
url: "../SysManage/Sys_Manage.asmx/SelectDeptNew",
|
||
|
data: "{'CompanyId':" + CompanyId + "}",
|
||
|
dataType: "json",
|
||
|
cache: false,
|
||
|
async: false,
|
||
|
success: function (data) {
|
||
|
ListMenu = data.d;
|
||
|
|
||
|
BindTreeView();
|
||
|
|
||
|
|
||
|
|
||
|
},
|
||
|
error: function (xhr, status) {
|
||
|
if (status != "success") alert(xhr.responseText);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
|
||
|
//#region 绑定树菜单
|
||
|
var Treehtml;
|
||
|
|
||
|
function BindTreeView() {
|
||
|
TreeSource = new Array();
|
||
|
Treehtml = new Sys.StringBuilder();
|
||
|
var ListMenus = GetLists(null);
|
||
|
$(ListMenus).each(function () {
|
||
|
|
||
|
|
||
|
Treehtml.append("<option value=" + this.DeptId + ">" + this.DeptName + "</option>");
|
||
|
blank = "";
|
||
|
BindTreeChildNode(this.DeptId);
|
||
|
|
||
|
});
|
||
|
|
||
|
$("#Select_depts").empty();
|
||
|
|
||
|
$("#Select_depts").append("<option value='0'>全部</option>");
|
||
|
$("#Select_depts").append(Treehtml.toString());
|
||
|
|
||
|
|
||
|
|
||
|
// $("#Select_Item.tree-node").css("font-size", "14px").css("padding-top", "5px").css("padding-bottom", "5px");
|
||
|
|
||
|
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 绑定子菜单
|
||
|
var blank = "";
|
||
|
function BindTreeChildNode(ParentItemId) {
|
||
|
|
||
|
var ListMenus = GetLists(ParentItemId);
|
||
|
|
||
|
if (ListMenus.length > 0)
|
||
|
blank = blank + " ";
|
||
|
$(ListMenus).each(function () {
|
||
|
|
||
|
Treehtml.append("<option value=" + this.DeptId + ">" + blank + this.DeptName + "</option>");
|
||
|
BindTreeChildNode(this.DeptId);
|
||
|
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
//#region 返回指定级菜单
|
||
|
function GetLists(ParentItemId) {
|
||
|
var ListMenus = new Array();
|
||
|
$(ListMenu).each(function () {
|
||
|
if (this.ParentDeptId == ParentItemId) {
|
||
|
var model = new Object();
|
||
|
model.DeptId = this.DeptId;
|
||
|
model.ParentDeptId = this.ParentDeptId;
|
||
|
model.DeptName = this.DeptName;
|
||
|
|
||
|
Array.add(ListMenus, model);
|
||
|
}
|
||
|
});
|
||
|
return ListMenus;
|
||
|
}
|
||
|
//#region 读取部门
|
||
|
function ReadMyDeptList() {
|
||
|
// var cudata = new Date();
|
||
|
|
||
|
// ListMenu = new Array();
|
||
|
// Shtm = new Sys.StringBuilder();
|
||
|
// var CompanyId = 0;
|
||
|
|
||
|
$.ajax({
|
||
|
type: "POST",
|
||
|
contentType: "application/json",
|
||
|
url: "OA_Manage.asmx/GetDeptList",
|
||
|
//data: "{'CompanyId':" + CompanyId + "}",
|
||
|
dataType: "json",
|
||
|
cache: false,
|
||
|
async: false,
|
||
|
success: function (data) {
|
||
|
if (data.d != null) {
|
||
|
$(data.d).each(function () {
|
||
|
|
||
|
|
||
|
$("#Select_depts").append("<option value=" + this.DeptId + ">" + this.DeptName + "</option>");
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
},
|
||
|
error: function (xhr, status) {
|
||
|
if (status != "success") alert(xhr.responseText);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
//#endregion
|
||
|
|
||
|
function ReadData() {
|
||
|
var param = new Object();
|
||
|
|
||
|
if($('#txt_SDate').val()=="")
|
||
|
param.SDate = null;
|
||
|
else
|
||
|
param.SDate = $('#txt_SDate').val();
|
||
|
if ($('#txt_EDate').val() == "")
|
||
|
param.EDate = null;
|
||
|
else
|
||
|
param.EDate = $('#txt_EDate').val();
|
||
|
param.LeaveType = $('#select_LeaveType').val();
|
||
|
param.CheckState = 0;
|
||
|
$.ajax({
|
||
|
url: "OA_Manage.asmx/GetNoLeaveCount",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
success: function (data) {
|
||
|
|
||
|
|
||
|
datagrid1.DataBind(data.d);
|
||
|
$("#DataGrid1 a[CommandName='cmdView']").fancybox({
|
||
|
'width': '40%',
|
||
|
'height': '40%',
|
||
|
'autoScale': false,
|
||
|
'transitionIn': 'elastic',
|
||
|
'transitionOut': 'elastic',
|
||
|
'href': '#test',
|
||
|
'onStart': function () {
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
function ReadDataDetail() {
|
||
|
var param = new Object();
|
||
|
param.UserId = TeaId;
|
||
|
|
||
|
if ($('#txt_SDate').val() == "")
|
||
|
param.SDate = null;
|
||
|
else
|
||
|
param.SDate = $('#txt_SDate').val();
|
||
|
if ($('#txt_EDate').val() == "")
|
||
|
param.EDate = null;
|
||
|
else
|
||
|
param.EDate = $('#txt_EDate').val();
|
||
|
param.LeaveType = $('#select_LeaveType').val();
|
||
|
param.CheckState = 0;
|
||
|
|
||
|
$.ajax({
|
||
|
url: "OA_Manage.asmx/GetNoReLeave",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
success: function (data) {
|
||
|
|
||
|
|
||
|
datagrid2.DataBind(data.d);
|
||
|
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
//#region 初始化DataGrid
|
||
|
function CreateDataGrid() {
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "请假员工";
|
||
|
col.Width = "100px";
|
||
|
col.CreateFieldSpan("InName", "");
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "请假天数合计";
|
||
|
col.Width = "100px";
|
||
|
|
||
|
col.CellTemplate = "<a title='' >{Bind Days}天{Bind Hours}小时</a>";
|
||
|
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "操作";
|
||
|
|
||
|
col.CellTemplate = "<a title='' CommandName='cmdView' style='color:Blue;cursor:pointer;text-decoration: underline;'>查看详细记录</a>";
|
||
|
|
||
|
Array.add(datagrid1.Columns, col);
|
||
|
|
||
|
|
||
|
|
||
|
datagrid1.DataPager.PageSize = 20;
|
||
|
datagrid1.IsFixHeader = false;
|
||
|
datagrid1.ShowIndexColumn = false;
|
||
|
datagrid1.AllowPaging = false;
|
||
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
||
|
datagrid1.Init();
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
//#region 初始化DataGrid
|
||
|
function CreateDataGrid2() {
|
||
|
|
||
|
var col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "请假员工";
|
||
|
col.Width = "100px";
|
||
|
col.CreateFieldSpan("InName", "");
|
||
|
Array.add(datagrid2.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "请假时间【天数】";
|
||
|
|
||
|
col.CellTemplate = "<a title='' >{Bind SDate,yyyy-MM-dd日HH点}--{Bind EDate,yyyy-MM-dd日HH点}【{Bind Days}{Bind DaysUint}】</a>";
|
||
|
|
||
|
|
||
|
Array.add(datagrid2.Columns, col);
|
||
|
|
||
|
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "请假类型";
|
||
|
|
||
|
col.CreateFieldSpan("LeaveType","");
|
||
|
|
||
|
|
||
|
Array.add(datagrid2.Columns, col);
|
||
|
|
||
|
col = new nblf.ui.DataGridColumn();
|
||
|
col.HeaderText = "操作";
|
||
|
col.Width = "80px";
|
||
|
|
||
|
col.CellTemplate = "<input onclick='DelCol(this);' class='btnClass dgbtnDel' type='button' value='审批'></input>";
|
||
|
Array.add(datagrid2.Columns, col);
|
||
|
datagrid2.DataPager.PageSize = 20;
|
||
|
datagrid2.IsFixHeader = false;
|
||
|
datagrid2.ShowIndexColumn = false;
|
||
|
datagrid2.AllowPaging = false;
|
||
|
datagrid2.SelectMode = nblf.ui.SelectMode.None;
|
||
|
datagrid2.Init();
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
function DelCol(obj) {
|
||
|
var param = new Object();
|
||
|
var rowindex = $(obj).parent().parent().attr("index");
|
||
|
var model = datagrid2.Get_Model(rowindex);
|
||
|
var dd = new Date();
|
||
|
model.CompanyOption = "<font color='Red'>" + "准假" + "</font><br/><br/><br/><br/>签名:" + UserName + " 日期:" + dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate();
|
||
|
model.CompanyAgree = 1;
|
||
|
|
||
|
param.model = model;
|
||
|
|
||
|
|
||
|
$.ajax({
|
||
|
type: "POST",
|
||
|
contentType: "application/json",
|
||
|
url: "OA_Manage.asmx/SaveLeaveCompanyCheck",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
cache: false,
|
||
|
success: function (data) {
|
||
|
alert("提交成功");
|
||
|
ReadDataDetail();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function save2() {
|
||
|
var SelectListModels = datagrid1.GetSelectListModel();
|
||
|
if (SelectListModels == null || $(SelectListModels).length == 0) {
|
||
|
alert("请选择要审批的人");
|
||
|
}
|
||
|
var userlist = "";
|
||
|
var error = "";
|
||
|
$(SelectListModels).each(function () {
|
||
|
userlist += this.InUserId + ",";
|
||
|
});
|
||
|
if (error != "") {
|
||
|
alert(error);
|
||
|
return;
|
||
|
}
|
||
|
if (window.confirm('确定要审批吗?') == false) return;
|
||
|
var param = new Object();
|
||
|
|
||
|
param.userlist = userlist;
|
||
|
$.ajax({
|
||
|
type: "POST",
|
||
|
contentType: "application/json",
|
||
|
url: "OA_Manage.asmx/SaveLeaveCompanyCheckList",
|
||
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
||
|
dataType: "json",
|
||
|
cache: false,
|
||
|
success: function (data) {
|
||
|
alert("提交成功");
|
||
|
ReadData();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<div style="display: none">
|
||
|
|
||
|
<div id="test" title="请假详情" style="width: 520px; height: 400px;">
|
||
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
||
|
<tr>
|
||
|
|
||
|
<td >
|
||
|
<div id="DataGrid2" class="DataGridStyle" style="width: 100%;">
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="center" >
|
||
|
<input
|
||
|
id="btnCancel" type="button" value="取消" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="title_ico">
|
||
|
请假统计
|
||
|
</div>
|
||
|
|
||
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 99%;" align="center" class="tableAll">
|
||
|
<tr><td width="15%" class="f1">请假日期范围:</td><td >
|
||
|
<input id="txt_SDate" type="text" onfocus="WdatePicker()" style="width:90px"/>-<input id="txt_EDate"
|
||
|
type="text" onfocus="WdatePicker()" style="width:90px"/>
|
||
|
|
||
|
</td> <td width="12%" class="f1">
|
||
|
请假类型:
|
||
|
</td>
|
||
|
<td>
|
||
|
<select id="select_LeaveType" name="D3" style="width: 120">
|
||
|
<option value="0">全部</option>
|
||
|
<option value="年假">年假</option>
|
||
|
<option value="运动(生理假)">运动(生理假)</option>
|
||
|
<option value="事假">事假</option>
|
||
|
<option value="病假">病假</option>
|
||
|
<option value="旅游假">旅游假</option>
|
||
|
<option value="婚假">婚假</option>
|
||
|
<option value="产假">产假</option>
|
||
|
</select>
|
||
|
</td> <td width="12%" class="f1">
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
</td> <td> <input id="btn_Sch" type="button" value="查询" class="btnClass btnClassFind"/></td></tr>
|
||
|
<tr>
|
||
|
|
||
|
<td valign="top" colspan="7">
|
||
|
<div id="DataGrid1" class="DataGridStyle" style="width: 100%;">
|
||
|
<input id="btn_Save2" class="btnClass btnClassSave" onclick="save2();" type="button" value="批量审批" /></div>
|
||
|
</td>
|
||
|
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|