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.
157 lines
5.2 KiB
Plaintext
157 lines
5.2 KiB
Plaintext
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>人员-部门列表</title>
|
|
<script type="text/javascript" src="../WF/Scripts/jquery-1.7.2.min.js"></script>
|
|
<script type="text/javascript" src="../WF/Scripts/jquery/jquery.easyui.min.js"></script>
|
|
<script src="../WF/Scripts/QueryString.js" type="text/javascript"></script>
|
|
<!-- 引入新版本的类库. -->
|
|
<script src="../WF/Scripts/config.js" type="text/javascript"></script>
|
|
<script src="../WF/Comm/Gener.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
var webUser = new WebUser();
|
|
$(function () {
|
|
|
|
$("#Msg").html("正在加载请稍候...");
|
|
var empNo = GetQueryString("FK_Emp");
|
|
var deptNo = GetQueryString("FK_Dept");
|
|
|
|
var emp = new Entity("BP.Port.Emp", empNo);
|
|
|
|
var orgNo = emp.OrgNo;
|
|
//该人员在当前部门下的所有岗位集合.
|
|
var ens = new Entities("BP.Port.DeptEmpStations");
|
|
ens.Retrieve("FK_Emp", empNo, "FK_Dept", deptNo);
|
|
|
|
//所有的岗位类别.
|
|
var stationTypes = new Entities("BP.Port.StationTypes");
|
|
|
|
if (webUser.CCBPMRunModel == 2)
|
|
stationTypes.Retrieve("OrgNo", emp.OrgNo);
|
|
else
|
|
stationTypes.RetrieveAll();
|
|
|
|
//所有的岗位s
|
|
var stations = new Entities("BP.Port.Stations");
|
|
|
|
if (webUser.CCBPMRunModel == 2)
|
|
stations.Retrieve("OrgNo", emp.OrgNo);
|
|
else
|
|
stations.RetrieveAll();
|
|
|
|
|
|
var html = "<table border=0 style='width:100%;'>";
|
|
html += "<caption >姓名:<font color=green>" + emp.Name + "</font>, <a href='javascript:Back()'>返回</a></caption>";
|
|
|
|
for (var i = 0; i < stationTypes.length; i++) {
|
|
|
|
//输出类别.
|
|
var type = stationTypes[i];
|
|
html += "<tr>";
|
|
html += "<th colspan=4>" + type.Name + "</th>";
|
|
html += "</tr>";
|
|
|
|
//输出岗位.
|
|
var ii = -1;
|
|
for (var idx = 0; idx < stations.length; idx++) {
|
|
|
|
var sta = stations[idx];
|
|
if (sta.FK_StationType != type.No)
|
|
continue;
|
|
|
|
ii++;
|
|
|
|
if (ii == 0)
|
|
html += "<tr>";
|
|
|
|
//是否存在?
|
|
var isHave = false;
|
|
for (var ddd = 0; ddd < ens.length; ddd++) {
|
|
|
|
var myEn = ens[ddd];
|
|
if (myEn.FK_Station == sta.No) {
|
|
isHave = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (isHave == true)
|
|
html += "<td ><label><input type=checkbox checked=checked onclick=\"SaveStation('" + sta.No + "','" + orgNo + "')\" id='" + sta.No + "' ><font color=green>" + sta.Name + "</font></label></td>";
|
|
else
|
|
html += "<td ><label><input type=checkbox onclick=\"SaveStation('" + sta.No + "','" + orgNo + "')\" id='" + sta.No + "' >" + sta.Name + "</label></td>";
|
|
|
|
if (ii == 3) {
|
|
ii = -1;
|
|
html += "</tr>";
|
|
}
|
|
}
|
|
}
|
|
|
|
html += "</table>";
|
|
|
|
$("#Msg").html(html);
|
|
|
|
});
|
|
|
|
//保存
|
|
function SaveStation(staNo, orgNo) {
|
|
|
|
var empNo = GetQueryString("FK_Emp");
|
|
var deptNo = GetQueryString("FK_Dept");
|
|
|
|
//该人员在当前部门下的所有岗位集合.
|
|
var ens = new Entities("BP.Port.DeptEmpStations");
|
|
ens.Retrieve("FK_Emp", empNo, "FK_Dept", deptNo, "FK_Station", staNo);
|
|
|
|
var en = new Entity("BP.Port.DeptEmpStation");
|
|
|
|
if (ens.length == 0) {
|
|
en.FK_Dept = deptNo;
|
|
en.FK_Emp = empNo;
|
|
en.FK_Station = staNo;
|
|
|
|
if (orgNo != undefined && orgNo != null && orgNo != "") {
|
|
en.OrgNo = orgNo;
|
|
}
|
|
en.Insert();
|
|
return;
|
|
}
|
|
|
|
var mypk = deptNo + '_' + empNo + '_' + staNo;
|
|
if (webUser.CCBPMRunModel == 2) {
|
|
mypk = deptNo + "_" + empNo.replace(webUser.OrgNo + "_", "") + "_" + staNo;
|
|
}
|
|
en.SetPKVal(mypk);
|
|
en.Delete();
|
|
}
|
|
|
|
function Back() {
|
|
|
|
var empNo = GetQueryString("FK_Emp");
|
|
var url = "EmpDepts.htm?FK_Emp=" + empNo;
|
|
SetHref(url);
|
|
}
|
|
|
|
function Del(mypk) {
|
|
|
|
if (window.confirm('您确定要删除吗?') == false)
|
|
return;
|
|
|
|
var dept = new Entity("BP.Port.DeptEmp", mypk);
|
|
dept.Delete();
|
|
|
|
Reload();
|
|
}
|
|
</script>
|
|
|
|
<link href="../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<div id="Msg" style=" padding:10px;"></div>
|
|
|
|
</body>
|
|
</html>
|