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.

324 lines
12 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkAddList.aspx.cs" Inherits="TradeManage.SysManage.WorkAddList" %>
<!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/fancybox/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var PageIndex = 1;
var PageSize = 20;
var UserId = '<%= Session["UserId"]%>';
var WindowLoadModel = new WindowLoad();
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
$('.combo-panel').bgiframe();
$('#fancybox-overlay').bgiframe();
CreateDataGrid();
$("#btn_sch").bind("click", function() {
ReadData();
});
$("#rad_type0,#rad_type1,#rad_type2").bind("click", function() {
ReadData();
});
$("#select_state").bind("change", function() {
ReadData();
});
$("#btn_add").bind("click", function() {
window.location.href = "WorkAddApply.aspx";
});
$('#select_LeaveType').bind("change", function() {
ReadData();
});
$("#" + datagrid1.TableID + " input[CommandName='cmdView']").live("click", function() {
RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
var Id = model.Id;
window.location.href = "WorkAddLook.aspx?Id=" + Id;
});
// $("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function() {
// RowIndex = $(this).parentsUntil("tr").parent().attr("index");
// var model = datagrid1.Get_Model(RowIndex);
// workmodel = model;
// var Id = model.Id;
// var CustomEndDate = "无";
// if (model.CustomEndDate != null)
// CustomEndDate = model.CustomEndDate.localeFormat("yyyy年MM月dd日")
// GetWorkStepList(Id, CustomEndDate);
// });
ReadData();
});
function ReadData() {
var param = new Object();
param.State = $('#select_state').val();
//param.LeaveType = $('#select_LeaveType').val();
param.Title = $('#txt_title').val();
param.PageIndex = datagrid1.Get_PageIndex();
param.PageSize = datagrid1.Get_PageSize();
param.Sdate = null;
param.Edate = null;
param.Type =0;
if($("#rad_type1").is(":checked")==true)
{
param.Type =1;
}
if ($("#rad_type2").is(":checked") == true)
{
param.Type =2;
}
if ($("#txt_SDate").val() != "")
param.Sdate = $("#txt_SDate").val();
if ($("#txt_EDate").val() != "")
param.Edate = $("#txt_EDate").val();
WindowLoadModel.Show();
$.ajax({
url: "OA_Manage.asmx/GetListOA_WorkAdd",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function(data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
// $("#DataGrid1 a[CommandName=cmdLook]").fancybox({
// 'width': '40%',
// 'height': '40%',
// 'autoScale': false,
// 'transitionIn': 'elastic',
// 'transitionOut': 'elastic',
// 'href': '#test',
// 'onStart': function() {
// }
// });
//
}
});
}
function DelCol(obj) {
var rowindex = $(obj).parent().parent().attr("index");
var model = datagrid1.Get_Model(rowindex);
var state = model.State;
if (state > 0) {
var flg = false;
if (model.CompanyUserId != null && UserId== model.CompanyUserId) {
flg = true;
}
else
if (model.CompanyUserId==null&&model.DeptUserId != null && UserId == model.CompanyUserId) {
flg = true;
}
if (flg == false) {
alert("该申请单已经审批,不能删除,如需删除请联系开发");
return;
}
}
if (window.confirm('确定要删除吗?') == false) return;
var rowindex = $(obj).parent().parent().attr("index");
var model = datagrid1.Get_Model(rowindex);
var id = model.Id;
if (id > 0) {
$.ajax({
url: "OA_Manage.asmx/DeleteWorkAdd",
data: "{'Id':" + id + "}",
dataType: "json",
success: function() {
alert("删除成功");
}
});
}
datagrid1.Del_Row(rowindex);
}
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "加班人";
col.Width = "120px";
col.CreateFieldSpan("InName", "");
Array.add(datagrid1.Columns, col);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "加班假起止时间";
col.CellTemplate = "<a>{Bind SDate,yyyy年MM月dd日HH时mm分}--{Bind EDate,yyyy年MM月dd日HH时mm分}</a>";
Array.add(datagrid1.Columns, col);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "加班时长";
// col.Width = "100px";
col.CellTemplate = "<a>{Bind Days}小时</a>";
Array.add(datagrid1.Columns, col);
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "当前审批状态";
// col.Width = "100px";
col.CellTemplate = "<a>{Bind StateName}{Bind CheckState}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "160px";
col.CellTemplate = "<input CommandName='cmdView' class='btnClass dgbtnView' type='button' value='{Bind DoState}'></input>&nbsp;&nbsp;<input onclick='DelCol(this);' class='btnClass dgbtnDel' type='button' value='删除'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.DataPager.PageSize = 20;
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
//datagrid1.Height = "260px";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function() { ReadData(); });
}
</script>
</head>
<body>
<div class="title_ico">
加班管理
</div>
<table width="100%">
<tr>
<td align="center">
<table border="2" cellpadding="0" cellspacing="0" style="width: 99%;" class="tableAll">
<tr>
<td colspan="7">
<input id="rad_type0" checked="true" name="mail" type="radio" /><label for="rad_type0"
style="font-size: 12px;">我的全部加班申请</label>
<input id="rad_type1" name="mail" type="radio" /><label for="rad_type1" style="font-size: 12px;">我提交的加班申请</label>
<input id="rad_type2" name="mail" type="radio" /><label for="rad_type2" style="font-size: 12px;">我审批的加班申请</label>
</td>
</tr>
<tr>
<td width="12%" class="f1">
加班申请状态:
</td>
<td>
<select id="select_state" name="D4" style="width: 120">
<option value="-1">全部</option>
<option value="0">未审批</option>
<option value="1">审批中</option>
<option value="2">审批完成</option>
</select>
</td>
<td width="12%" class="f1">
申请人/申请事由: </td>
<td>
<input id="txt_title" type="text" /></td>
<td>
</td>
</tr>
<tr>
<td width="12%" class="f1">
&nbsp;</td>
<td>
&nbsp;</td>
<td width="12%" class="f1">
加班日期:
</td>
<td>
<input id="txt_SDate" type="text" onfocus="WdatePicker()" />-<input id="txt_EDate"
type="text" onfocus="WdatePicker()" />
</td>
<td>
<input id="btn_sch" type="button" class="btnClass btnClassFind" value="查询" />
</td>
</tr>
<tr>
<td colspan="7" align="left"> <input id="btn_add" class="btnClass btnClassAdd" type="button" value="加班申请" />
</td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle" style="width: 100%;">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>