|
|
<!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>
|
|
|
<!-- 引用通用的js文件. -->
|
|
|
<script language="JavaScript" src="../Comm/JS/Calendar/WdatePicker.js" defer="defer"
|
|
|
type="text/javascript"></script>
|
|
|
<link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
|
|
|
<link rel="shortcut icon" href="../Img/ccbpm.ico" type="image/x-icon" />
|
|
|
<script type="text/javascript" src="../Scripts/jquery-1.7.2.min.js"></script>
|
|
|
<script language="JavaScript" src="../Comm/JScript.js" type="text/javascript"></script>
|
|
|
<script type="text/javascript" src="../Scripts/QueryString.js"></script>
|
|
|
<!-- 导入配置文件. -->
|
|
|
<script type="text/javascript" src="../Scripts/config.js"></script>
|
|
|
<script type="text/javascript" src="../Comm/Gener.js"></script>
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
|
var node = null; //公共变量.
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
// alert(html);
|
|
|
$("#Msg").html('正在加载,请稍候...');
|
|
|
|
|
|
var nodeID = GetQueryString("FK_Node");
|
|
|
var workID = GetQueryString("WorkID");
|
|
|
|
|
|
var fid = GetQueryString("FID");
|
|
|
fid = fid == null || fid == undefined || fid == "" ? 0 : fid;
|
|
|
|
|
|
node = new Entity("BP.WF.Node", nodeID);
|
|
|
|
|
|
//子线程流程引擎注册表.
|
|
|
if (workID == null || workID == undefined)
|
|
|
workID = 0;
|
|
|
var gwfs = new Entities("BP.WF.GenerWorkFlows");
|
|
|
gwfs.Retrieve("FID", workID);
|
|
|
|
|
|
//工作人员表.
|
|
|
var gwls = new Entities("BP.WF.GenerWorkerLists");
|
|
|
gwls.Retrieve("FID", workID);
|
|
|
|
|
|
//获得子线节点的数量,如果1个,就用单独列表的模式展现,多个就用多列表模式展现.
|
|
|
var numOfSubNods = 0;
|
|
|
var numOfSubNodsStrs = "";
|
|
|
for (var i = 0; i < gwls.length; i++) {
|
|
|
|
|
|
var gwl = gwls[i];
|
|
|
if (gwl.IsPass == -2)
|
|
|
continue; //这个节点是干流程发起的人员.
|
|
|
|
|
|
if (numOfSubNodsStrs.indexOf(gwl.FK_Node) == -1) {
|
|
|
numOfSubNodsStrs += gwl.FK_Node + ",";
|
|
|
numOfSubNods++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//只有一个子线程,就是用列表模式.
|
|
|
if (numOfSubNods == 1 && 1 == 2) {
|
|
|
BindModelOne(gwfs, gwls, fid == 0 ? false : true);
|
|
|
} else {
|
|
|
//使用分组列表的模式.
|
|
|
BindModelMore(gwfs, gwls, fid == 0 ? false : true);
|
|
|
}
|
|
|
|
|
|
if (fid == 0)
|
|
|
$("#addEmp").html("<center><a href='javascript:AddEmp()'><img src='./../Img/Auth.png' />增加人员(线程)</a></center>");
|
|
|
})
|
|
|
|
|
|
function AddEmp() {
|
|
|
|
|
|
if (node.RunModel == 2 || node.RunModel == 1) {
|
|
|
|
|
|
var msg = "说明:";
|
|
|
msg += "\t\n 1. 新增加的人员,从分流节点的下一个节点开始执行.";
|
|
|
msg += "\t\n 2. 输入人员账号,点击确定后,系统就会自动为该人员分配一个任务.";
|
|
|
|
|
|
var empNo = window.prompt(msg + ' 请输入要增加的人员账号,多个人员用逗号分开(比如:zhangsan,lisi):');
|
|
|
if (empNo == null || empNo == '')
|
|
|
return;
|
|
|
// var empNo = 'zhoupeng';
|
|
|
|
|
|
var workid = GetQueryString("WorkID");
|
|
|
var en = new Entity("BP.WF.GenerWorkFlow", workid);
|
|
|
var data = en.DoMethodReturnString("DoSubFlowAddEmps", empNo);
|
|
|
alert(data);
|
|
|
Reload();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
alert('您没有权限增加人员.');
|
|
|
}
|
|
|
|
|
|
var webUser = new WebUser();
|
|
|
function BindModelOne(gwfs, gwls, isThread) {
|
|
|
|
|
|
var strs = "<table style='width:100%;'>";
|
|
|
strs += "<tr>";
|
|
|
strs += "<th>序</th>";
|
|
|
strs += "<th>节点</th>";
|
|
|
strs += "<th>处理人</th>";
|
|
|
strs += "<th>状态</th>";
|
|
|
strs += "<th>应完成日期</th>";
|
|
|
strs += "<th>实际完成日期</th>";
|
|
|
strs += "<th>表单</th>";
|
|
|
if (node.ThreadKillRole == 1)
|
|
|
strs += "<th>终止</th>";
|
|
|
if (isThread == false)
|
|
|
strs += "<th>操作</th>";
|
|
|
strs += "</tr>";
|
|
|
|
|
|
var idx = 0;
|
|
|
for (var i = 0; i < gwls.length; i++) {
|
|
|
|
|
|
var gwl = gwls[i];
|
|
|
if (gwl.IsPass == -2)
|
|
|
continue; //这个节点是干流程发起的人员.
|
|
|
//是当前人员
|
|
|
if (isThread == true && gwl.FK_Emp == webUser.No)
|
|
|
continue;
|
|
|
idx++;
|
|
|
strs += "<tr>";
|
|
|
strs += "<td class=Idx >" + idx + "</td>";
|
|
|
strs += "<td>" + gwl.FK_NodeText + "</td>";
|
|
|
strs += "<td>" + gwl.FK_Emp + " " + gwl.FK_EmpText + "</td>";
|
|
|
var openStr = "";
|
|
|
if (gwl.IsPass == 1) {
|
|
|
|
|
|
strs += "<td>已完成</td>";
|
|
|
strs += "<td>" + gwl.SDT + "</td>";
|
|
|
strs += "<td>" + gwl.RDT + "</td>";
|
|
|
openStr += "<a href='ReturnWork.htm?WorkID=" + gwl.WorkID + "&FID=" + gwl.FID + "&FK_Flow=" + gwl.FK_Flow + "&FK_Node=" + GetQueryString("FK_Node") + "' >退回</a>";
|
|
|
|
|
|
} else {
|
|
|
if (gwl.IsRead == 0)
|
|
|
strs += "<td> 未读 </td>";
|
|
|
else
|
|
|
strs += "<td> 已读,未处理 </td>";
|
|
|
strs += "<td>" + gwl.SDT + "</td>";
|
|
|
strs += "<td>无</td>";
|
|
|
}
|
|
|
|
|
|
strs += "<td><a href=\"javascript:OpenFrm('" + gwl.WorkID + "','" + gwl.FID + "','" + gwl.FK_Flow + "','" + gwl.FK_Node + "')\">表单</a></td>";
|
|
|
|
|
|
if (node.ThreadKillRole == 1)
|
|
|
strs += "<td><a href=\"javascript:DoDelSubFlow('" + gwl.FK_Flow + "','" + gwl.WorkID + "')\"><img src='../Img/Btn/Delete.gif' border=0/>终止</a></td>";
|
|
|
if (isThread == false)
|
|
|
strs += "<td>" + openStr + "</td>";
|
|
|
strs += "<tr>";
|
|
|
}
|
|
|
|
|
|
strs += "</table>";
|
|
|
$("#Msg").html(strs);
|
|
|
}
|
|
|
|
|
|
function BindModelMore(gwfs, gwls, isThread) {
|
|
|
|
|
|
//判断有几个子子线程ID, 如果只有一个,就用列表模式展现.
|
|
|
var html = "<table style='width:100%;' >";
|
|
|
// html += "<tr>";
|
|
|
// html += "<th >标题</th>";
|
|
|
// html += "<th>停留节点</th>";
|
|
|
//// html += "<th>状态</th>";
|
|
|
// html += "<th>处理人</th>";
|
|
|
// html += "<th>发起日期</th>";
|
|
|
// html += "</tr>";
|
|
|
|
|
|
for (var i = 0; i < gwfs.length; i++) {
|
|
|
|
|
|
var gwf = gwfs[i];
|
|
|
|
|
|
html += "<tr class=Sum >";
|
|
|
html += "<td> <img src='./../Img/Auth.png' style='width:20px;' /> <font color=green>#" + (i + 1) + ",标题:" + gwf.Title + "</font></td>";
|
|
|
// html += "<td>" + gwf.NodeName + "</td>";
|
|
|
// html += "<td>sss</td>";
|
|
|
html += "<td>" + gwf.TodoEmps + "</td>";
|
|
|
html += "<td>" + gwf.RDT + "</td>";
|
|
|
html += "</tr>";
|
|
|
|
|
|
html += "<tr>";
|
|
|
html += "<td colspan=4 > " + GenerHtml(gwf, gwls, isThread) + " </td>";
|
|
|
html += "</tr>";
|
|
|
}
|
|
|
|
|
|
$("#Msg").html(html);
|
|
|
}
|
|
|
|
|
|
function GenerHtml(gwf, gwls, isThread) {
|
|
|
|
|
|
var strs = "<table style='width:100%;'>";
|
|
|
|
|
|
strs += "<tr>";
|
|
|
strs += "<th>节点</th>";
|
|
|
strs += "<th>处理人</th>";
|
|
|
// strs += "<td>名称</td>";
|
|
|
strs += "<th>状态</th>";
|
|
|
strs += "<th>应完成日期</th>";
|
|
|
strs += "<th>实际完成日期</th>";
|
|
|
strs += "<th>操作</th>";
|
|
|
strs += "</tr>";
|
|
|
|
|
|
for (var i = 0; i < gwls.length; i++) {
|
|
|
|
|
|
var gwl = gwls[i];
|
|
|
|
|
|
if (gwl.WorkID != gwf.WorkID)
|
|
|
continue;
|
|
|
|
|
|
if (gwl.IsPass == -2)
|
|
|
continue; //这个节点是干流程发起的人员.
|
|
|
|
|
|
//是当前人员
|
|
|
if (isThread == true && gwl.FK_Emp == webUser.No)
|
|
|
continue;
|
|
|
|
|
|
strs += "<tr>";
|
|
|
strs += "<td>" + gwl.FK_NodeText + "</td>";
|
|
|
strs += "<td>" + gwl.FK_Emp + " " + gwl.FK_EmpText + "</td>";
|
|
|
|
|
|
var openStr = "";
|
|
|
openStr += "<a href=\"javascript:OpenFrm('" + gwl.WorkID + "','" + gwl.FID + "','" + gwl.FK_Flow + "','" + gwl.FK_Node + "')\">表单</a>";
|
|
|
|
|
|
if (gwl.IsPass == 1) {
|
|
|
|
|
|
strs += "<td>已完成</td>";
|
|
|
strs += "<td>" + gwl.SDT + "</td>";
|
|
|
strs += "<td>" + gwl.RDT + "</td>";
|
|
|
if (isThread == false)
|
|
|
openStr += "-<a href='ReturnWork.htm?WorkID=" + gwl.WorkID + "&FID=" + gwl.FID + "&FK_Flow=" + gwl.FK_Flow + "&FK_Node=" + GetQueryString("FK_Node") + "' >退回</a>";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (gwl.IsRead == 0)
|
|
|
strs += "<td> 未读 </td>";
|
|
|
else
|
|
|
strs += "<td> 已读,未处理 </td>";
|
|
|
strs += "<td>" + gwl.SDT + "</td>";
|
|
|
strs += "<td>无</td>";
|
|
|
}
|
|
|
|
|
|
if (node.ThreadKillRole == 1)
|
|
|
openStr += "-<a href=\"javascript:DoDelSubFlow('" + gwl.FK_Flow + "','" + gwl.WorkID + "')\"><img src='../Img/Btn/Delete.gif' border=0/>终止</a>";
|
|
|
|
|
|
strs += "<td>" + openStr + "</td>";
|
|
|
|
|
|
strs += "<tr>";
|
|
|
}
|
|
|
|
|
|
strs += "</table>";
|
|
|
return strs;
|
|
|
}
|
|
|
|
|
|
function OpenFrm(workID, fid, flowNo, nodeID) {
|
|
|
|
|
|
var url = "../MyView.htm?FK_Flow=" + flowNo + "&WorkID=" + workID + "&FK_Node=" + nodeID + "&FID=" + fid;
|
|
|
window.open(url);
|
|
|
return;
|
|
|
|
|
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_OneWork");
|
|
|
handler.AddUrlData();
|
|
|
|
|
|
handler.AddPara("FromWorkOpt", "1");
|
|
|
handler.AddPara("WorkID", workID);
|
|
|
handler.AddPara("FK_Node", nodeID);
|
|
|
handler.AddPara("FK_Flow", flowNo);
|
|
|
handler.AddPara("FID", fid);
|
|
|
|
|
|
var data = handler.DoMethodReturnString("Runing_OpenFrm");
|
|
|
|
|
|
data = data.replace('url@./CCForm', 'url@../CCForm');
|
|
|
|
|
|
if (data.indexOf('err@') == 0) {
|
|
|
alert(data);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (data.indexOf('url@') == 0) {
|
|
|
data = data.replace('url@', '');
|
|
|
|
|
|
if (data.indexOf('FromWorkOpt') == -1)
|
|
|
data = data + "&FromWorkOpt=1";
|
|
|
|
|
|
//window.location.href = filterXSS(data);
|
|
|
window.open(data);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
alert(data);
|
|
|
}
|
|
|
|
|
|
//删除子线城.
|
|
|
function DoDelSubFlow(flowNo, workID) {
|
|
|
|
|
|
if (confirm('您缺少要终止该子线程吗?') == false)
|
|
|
return;
|
|
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
|
|
|
handler.AddPara("FK_Flow", flowNo);
|
|
|
handler.AddPara("WorkID", workID);
|
|
|
|
|
|
var data = handler.DoMethodReturnString("ThreadDtl_DelSubThread");
|
|
|
Reload();
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<form id="cc">
|
|
|
<center>
|
|
|
<div id="Msg">
|
|
|
<img src='../Img/loading.gif' alt="" />正在加载,请稍后。。。
|
|
|
</div>
|
|
|
</center>
|
|
|
|
|
|
<div id="addEmp"></div>
|
|
|
</form>
|
|
|
</body>
|
|
|
</html>
|