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.

397 lines
15 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>在途</title>
<link href="/WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/WF/Scripts/bootstrap/css/font-awesome.css" rel="stylesheet">
<link href="/WF/Style/skin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/WF/Style/skin/css/animate.css" rel="stylesheet" type="text/css" />
<link href="/WF/Style/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox-content">
<table class="table table-striped">
<thead>
<tr>
<th width="40">
#
</th>
<th width="350"> 标题 </th>
<!-- <th>流程</th>-->
<th width="120">
发起人
</th>
<th width="100">
发起部门
</th>
<!--<th>申请时间</th>-->
<th width="200">
当前节点
</th>
<th width="180">
到达时间
</th>
<th width="120">
当前处理人
</th>
<!--<th width="120">
操作
</th>-->
</tr>
</thead>
<tbody id="Table1">
</tbody>
</table>
<div class="row">
<div class="col-sm-12">
<span id="Table2"></span>
</div>
</div>
</div>
</div>
<script language="JavaScript" src="/WF/Comm/JScript.js" type="text/javascript"></script>
<script type="text/javascript" src="/WF/Scripts/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="/WF/Scripts/bootstrap/js/bootstrap.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 src="/WF/Scripts/layui/layui/lay/modules/layer.js" type="text/javascript"></script>
<script src="/WF/DataUser/JSLibData/CommonShowConfig.js"></script>
<script language="javascript" type="text/javascript">
var RunModel = { "Ordinary": 0, "HL": 1, "FL": 2, "FHL": 3, "SubThread": 4 };
var isContainFuture = GetQueryString("IsContainFuture");
if (isContainFuture == null || isContainFuture == undefined || isContainFuture == "")
isContainFuture = "0";
//Hide_HastenWork:是否隐藏该条信息,CommonShowConfig.js中定义
if ("undefined" == typeof Hide_HastenWork) {
var Hide_HastenWork = true;
}
//页面启动函数.
$(function () {
InitPage();
});
function GroupBarClick(groupName) {
var alt = document.getElementById('Img' + groupName).alert;
var sta = 'block';
if (alt == 'Max') {
sta = 'block';
alt = 'Min';
classname = 'fa fa-minus-square';
} else {
sta = 'none';
alt = 'Max';
classname = 'fa fa-plus-square';
}
document.getElementById('Img' + groupName).className = classname;
document.getElementById('Img' + groupName).alert = alt;
var i = 0;
for (i = 0; i <= 600; i++) {
var row = document.getElementById(groupName + i);
if (row == null || row == undefined || row.style == null)
continue;
if (sta == 'block') {
row.style.display = '';
} else {
row.style.display = sta;
}
}
}
// 撤销。
function UnSend(fk_flow, workid, fid, unSendToNode) {
if (window.confirm('您确定要撤销本次发送吗?') == false)
return;
var handler = new HttpHandler("BP.Cloud.HttpHandler.App");
handler.AddPara("FK_Flow", fk_flow);
handler.AddPara("WorkID", workid);
handler.AddPara("FID", fid);
handler.AddPara("UnSendToNode", unSendToNode);
var data = handler.DoMethodReturnString("Runing_UnSend");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
$("#Msg").html(data + " <br> @点击这里<a href='javascript:Reload();' >刷新</a>");
alert(data);
var url = 'MyFlow.htm?FK_Flow=' + fk_flow + '&WorkID=' + workid + '&FID=' + fid;
window.open(url);
Reload();
return;
}
//催办.
function Press(fk_flow, workid, fid) {
var msg = promptGener('请输入催办信息', '该工作因为xxx原因需要您优先处理.');
if (msg == null)
return;
var handler = new HttpHandler("BP.WF.HttpHandler.WF");
handler.AddPara("FK_Flow", fk_flow);
handler.AddPara("WorkID", workid);
handler.AddPara("FID", fid);
handler.AddPara("Msg", msg);
var data = handler.DoMethodReturnString("Runing_Press");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
alert(data);
return;
}
function WinOpenIt(workid, nodeID, flowNo, fid, currNodeId) {
//但前节点所处的位置
var nowNode = new Entity("BP.WF.Node", nodeID);
//如果是树形表单,则显示当前人所处节点的数据
if (nowNode.FormType == 5) {
//获取人员所处的流程节点
var currNode = new Entity("BP.WF.Node", currNodeId);
if (currNode.HisToNDs.indexOf(nodeID) == -1) {
if ((currNode.RunModel == RunModel.HL || currNode.RunModel == RunModel.FHL || currNode.RunModel == RunModel.FL) && (fid != 0)) {
workID = fid;
fid = 0;
nodeID = currNodeId;
}
} else {
//判断当前节点的运行模式
if ((currNode.RunModel == RunModel.HL || currNode.RunModel == RunModel.FHL || currNode.RunModel == RunModel.FL) && nowNode.RunModel == RunModel.SubThread) {
workID = fid;
fid = 0;
nodeID = currNodeId;
} else if (currNode.RunModel == RunModel.SubThread) {
nodeID = currNodeId;
}
}
}
var url = "WFRpt.htm?FK_Flow=" + flowNo + "&WorkID=" + workid + "&FK_Node=" + nodeID + "&FID=" + fid + "&IsRead=0";
layer.open({
skin: 'layer-class',
type: 2,
title: '在途',
area: ['96%', '90%'],
content: url
});
}
/* ESC Key Down */
function Esc() {
if (event.keyCode == 27)
window.close();
return true;
}
/* 打开表单. */
function OpenFrm(workid, nodeID, flowNo, fid, currNodeId) {
//但前节点所处的位置
var nowNode = new Entity("BP.WF.Node", nodeID);
//如果是树形表单,则显示当前人所处节点的数据
if (nowNode.FormType == 5) {
//获取人员所处的流程节点
var currNode = new Entity("BP.WF.Node", currNodeId);
if (currNode.HisToNDs.indexOf(nodeID) == -1) {
if ((currNode.RunModel == RunModel.HL || currNode.RunModel == RunModel.FHL || currNode.RunModel == RunModel.FL) && (fid != 0)) {
workID = fid;
fid = 0;
nodeID = currNodeId;
}
} else {
//判断当前节点的运行模式
if ((currNode.RunModel == RunModel.HL || currNode.RunModel == RunModel.FHL || currNode.RunModel == RunModel.FL) && nowNode.RunModel == RunModel.SubThread) {
workID = fid;
fid = 0;
nodeID = currNodeId;
} else if (currNode.RunModel == RunModel.SubThread) {
nodeID = currNodeId;
}
}
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF");
// 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");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
//SDK表单或者是嵌入式表单
if (data.indexOf('urlForm@') == 0) {
data = data.replace('urlForm@', '');
if (data.indexOf("http") == -1)
data = basePath + data;
if (data.indexOf('FromWorkOpt') == -1)
data = data + "&FromWorkOpt=1";
window.open(data);
return;
}
//自由/傻瓜/树形表单
if (data.indexOf('url@') == 0) {
data = data.replace('url@', '');
if (data.indexOf('FromWorkOpt') == -1)
data = data + "&FromWorkOpt=1";
window.open(data);
return;
}
alert(data);
}
//初始化数据.
function InitPage() {
//获取参数FlowNos为空时显示所有的待办否则显示参数中的流程
var flowNos = GetQueryString("FlowNos");
//随机串.
var timeKey = Math.random();
var handler = new HttpHandler("BP.Cloud.HttpHandler.App");
handler.AddPara("IsContainFuture", isContainFuture);
var data = handler.DoMethodReturnString("Runing_Init");
if (data.indexOf('err@') == 0) {
alert(data);
}
data = JSON.parse(data);
//生成分组的字符串.
var str = "";
for (var i = 0; i < data.length; i++) {
if (str.indexOf('@' + data[i].FlowName) == -1) {
if (flowNos == null || (flowNos != null && flowNos.indexOf(data[i].FK_Flow) != -1))
str += "@" + data[i].FlowName;
}
}
var strs = str.split("@"); //生成数组.
var num = 0;
var is1 = false;
var listbox = '';
//循环数组.
for (var idx = 0; idx < strs.length; idx++) {
var groupName = strs[idx];
if (groupName == "" || groupName == null)
continue;
listbox += "<tr onclick=\"GroupBarClick('" + groupName + "')\" > <th colspan=8 class='table-title'> <i class='fa fa-minus-square' alert='Min' id='Img" + groupName + "'></i><span>" + groupName + "</span></th> </tr>";
//增加处理.
for (var i = 0; i < data.length; i++) {
var work = data[i];
if (work.FlowName != groupName)
continue;
num++;
if (is1 == true) {
listbox += "<tr id='" + groupName + num + "' >";
is1 = false;
} else {
listbox += "<tr id='" + groupName + num + "' >";
is1 = true;
}
listbox += "<td>" + num + "</td>";
var currNodeId = work.CurrNode;
var currNodeName = work.CurrNodeName;
if (currNodeName == "")
currNodeName = work.NodeName
listbox += "<td><a href=\"javascript:OpenFrm('" + work.WorkID + "','" + work.FK_Node + "','" + work.FK_Flow + "','" + work.FID + "','" + currNodeId + "')\" >" + work.Title + "</a></td>";
// newRow += "<td>" + work.FlowName + "</td>";
listbox += "<td>" + work.StarterName + "</td>";
listbox += "<td>" + work.DeptName + "</td>";
// newRow += "<td>" + work.FlowStartRDT + "</td>";
listbox += "<td>" + work.NodeName + "</td>";
listbox += "<td>" + work.RDT + "</td>";
var todoEmps = work.TodoEmps;
var emp = "";
var todoEmp = todoEmps.split(";");
for (j = 0; j < todoEmp.length; j++) {
if (todoEmp[j] == '' || todoEmp[j] == null || todoEmp[j] == undefined)
continue;
if (todoEmp[j].indexOf(',') != -1) {
var aa = todoEmp[j].split(",")[1] + "、";
emp += aa;
} else {
emp += todoEmp[j] + "、";
}
}
emp = emp.substring(0, emp.lastIndexOf("、"));
listbox += "<td>" + emp + "</td>";
//listbox += "<td>";
////listbox += "[<a href=\"javascript:WinOpenIt('WFRpt.htm?FK_Flow=" + work.FK_Flow + "&FID=0&WorkID=" + work.WorkID + "&FK_Node=" + nodeID + "&FID=" + work.FID + "&IsRead=0&T=" + timeKey + "');\" >轨迹</a>][<a href=\"javascript:UnSend('" + work.FK_Flow + "','" + work.WorkID + "','" + work.FID + "','"+currNodeId+"')\">撤销</a>]";
//listbox += "<a href=\"javascript:WinOpenIt('" + work.WorkID + "','" + work.FK_Node + "','" + work.FK_Flow + "','" + work.FID + "','" + currNodeId + "');\" >轨迹</a>";
//if (work.RunType == 0 || work.RunType == undefined) {
// listbox += "&nbsp;&nbsp;&nbsp; <a href =\"javascript:UnSend('" + work.FK_Flow + "','" + work.WorkID + "','" + work.FID + "','" + currNodeId + "')\">撤销</a>";
// //判断是否隐藏
// if (Hide_HastenWork == true) {
// listbox += "&nbsp;&nbsp;&nbsp;<a href=\"javascript:Press('" + work.FK_Flow + "','" + work.WorkID + "','" + work.FID + "')\">催办</a>";
// }
//}
//listbox += "</td>";
listbox += "</tr>";
}
}
$('#Table1').html(listbox);
$("#Table2").html("合计:" + data.length + "条");
}
</script>
</body>
</html>