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.

279 lines
9.4 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JC_UserWork.aspx.cs" Inherits="TradeManage.SysManage.JC_UserWork" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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/WindowLoad.js" type="text/javascript"></script>
<script src="../Scripts/fancybox/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
<script src="../Scripts/ajaxfileupload.js" type="text/javascript"></script>
<script type="text/javascript">
var Model = null;
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var UId = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
//为表格平均分配剩下的宽度
//TableAveColWidth("tbmain");
TableAveColWidth("tb2222");
//$("#WindowAdd").hide();
$("#btn_work").bind("click", function () {
window.location.href = "../UserWork.aspx";
});
CreateDataGrid();
BindDept();
$("#cmdGet").bind("click", function () {
ReadData();
});
ReadData();
$("#" + datagrid1.TableID + " input[CommandName='cmdEdit']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
UId = model.UserId;
$("#a_name").html(model.Name);
$("#txt_workdesc").val(model.WorkDesc);
fopen();
});
});
function fopen() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onComplete': function () {
}
});
}
//#region 读取部门
function BindDept() {
$.ajax({
url: "../UserService.asmx/GetMyListDept",
//data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
$(data.d).each(function () {
$('#select_listDept').append("<option value='" + this.DeptId + "'>" + this.DeptName + "</option>");
});
}
});
}
//#endregion
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "姓名";
col.width = "700px";
col.CellTemplate = "<span>{Bind Name}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "工作内容";
col.width = "700px";
col.CellTemplate = "<span>{Bind WorkDesc}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "100px";
col.CellTemplate = "<input CommandName='cmdEdit' class='btnClass dgbtnEdit' type='button' value='工作分工'></input>";
Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(50);
datagrid1.SetPageIndex(1);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = true;
datagrid1.Width = "100%";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
datagrid1.add_PageIndexChanged(function () { ReadData(); });
}
//#endregion
//#region 初始化DataGrid2
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.CompanyID = 0;
//if (param.CompanyID == null) return;
param.DeptID = $("#select_listDept").val();
if (param.DeptID == null) return;
param.Name = $("#select_txtName").val();
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
WindowLoadModel.Show();
$.ajax({
url: "SysManageService.asmx/GetListJC_UserWorkForTM",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
}
});
}
//#endregion
//#region 保存
function save() {
if ($("#txt_workdesc").val() == "")
{
alert("请输入工作内容");
$("#txt_workdesc").focus();
return;
}
var param = new Object();
param.UserId = UId;
param.WorkDesc = $("#txt_workdesc").val();
WindowLoadModel.Show();
$.ajax({
url: "SysManageService.asmx/SaveUserWork",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
ReadData();//刷新DataGrid
alert("保存成功");
$.fancybox.close();
}
});
}
//#endregion
</script>
</head>
<body class="headbody">
<div class="title_ico">
用户信息
</div>
<div style="display: none">
<div id="test" title="工作" style="width:550px; height:320px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td class="f1">
姓名:
</td>
<td align="left">
<a id="a_name"></a>
</td>
</tr>
<tr>
<td style="width: 100px;" class="f1">
<font color="red" style="font-weight:bolder">*</font> 工作描述:
</td>
<td align="left"> <textarea id="txt_workdesc" cols="100" rows="8" style="width: 98%"></textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保存" onclick="save();"/>
</td>
</tr>
</table>
</div>
</div>
<table id="tb1" class="tableAll" style="width: 100%;">
<colgroup>
<col style="width: 80px;" />
<col style="width: 205px;" />
<col style="width: 80px;" />
<col style="width: 125px;"/>
<col style="width: 80px;" />
<col />
<col />
</colgroup>
<tr>
<td class="f1">部门
</td>
<td>
<select id="select_listDept" class="selectClass" style="width: 200px;"></select>
</td>
<td class="f1">姓名
</td>
<td>
<input id="select_txtName" type="text" class="editTextbox" style="width: 120px;" />
</td>
<td>
<input id="cmdGet" type="button" class="btnClass btnClassFind" value="查询" />
<input id="btn_work" type="button" class="btnClass btnClassEdit" value="返回查看工作" /></td>
</tr>
<tr>
<td valign="top" colspan="5">
<div id="DataGrid1" class="DataGridStyle">
</div>
</td>
</tr>
</table>
</body>
</html>