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.

255 lines
10 KiB
Plaintext

11 months ago
<!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>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<link href="../css/index2.css" rel="stylesheet" type="text/css" />
<link href="../js/mui/css/mui.css" rel="stylesheet" type="text/css" />
<script src="../js/mui/js/mui.min.js" type="text/javascript"></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../Scripts/config.js" type="text/javascript"></script>
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
<script src="../Comm/Gener.js" type="text/javascript"></script>
<script src="../Scripts/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../Scripts/bootstrap/js/jquery.cokie.min.js" type="text/javascript"></script>
<script type="text/javascript">
var param = {};
if (typeof FrmSubFlowSta == "undefined") {
var FrmSubFlowSta = {}
// 不可用
FrmSubFlowSta.Disable = 0,
// 可用
FrmSubFlowSta.Enable = 1,
// 只读
FrmSubFlowSta.Readonly = 2
}
if (typeof SFShowCtrl == "undefined") {
var SFShowCtrl = {}
// 所有的子线程都可以看到
SFShowCtrl.All = 0,
// 仅仅查看我自己的
SFShowCtrl.MySelf = 1
}
var isReadonly = GetQueryString("IsReadonly");
isReadonly = isReadonly == null || isReadonly == undefined || isReadonly == "0" ? false : true;
var subFlows = null;
$(function () {
var sf = new Entity("BP.WF.Template.SFlow.FrmSubFlow", GetQueryString("FK_Node"));
subFlows = new Entities("BP.WF.Template.SFlow.SubFlows");
subFlows.Retrieve("FK_Flow", GetQueryString("FK_Flow"), "FK_Node", sf.NodeID);
if (subFlows.length == 0) {
$("#SubFlowInfo").html("没有启动子流程的配置信息,请联系管理员");
return;
}
//该流程的子流程信息.
var gwfs = new Entities("BP.WF.GenerWorkFlows");
if (sf.SFShowCtrl == SFShowCtrl.All)
gwfs.Retrieve("PWorkID", GetQueryString("WorkID")); //流程.
else
gwfs.Retrieve("PWorkID", GetQueryString("WorkID"), "Starter", webUser.No); //流程.
//显示子流程信息
var _html = "";
$.each(subFlows, function (i, subFlow) {
_html += "<div class=\"mui-table-view-divider\">";
_html += "<h5 style='color:black;'><div style='margin-bottom: 6px;height: 14px; '>";
_html += "<div style='float:left'>" + subFlow.SubFlowName + "</div>";
//启用状态
if (isReadonly == false && sf.SFSta == 1)
_html += "<div style='float:right;margin-right:15px'><a href='javaScript:AddSubFlow(\"" + subFlow.MyPK + "\")'>新增</a></div>";
_html += "</div></h5>";
_html += "</div>";
//列表显示改子流程启动的子流程实例
var isHave = false;
$.each(gwfs, function (k, gwf) {
if (gwf.FK_Flow != subFlow.SubFlowNo)
return true;
isHave = true;
_html += "<div class='box' id='" + gwf.WorkID + "_" + gwf.FK_Flow + "_" + gwf.FK_Node + "_" + gwf.FID+"_"+gwf.WFState + "'><div class='box-item'>";
_html += "<div class='flex'><span class='dot'></span>";
_html += "<div class='flex-1 au-m-l-8 au-text-33 au-font-12 au-font-bold overline-1'>";
_html += gwf.Title + "</div><div class='list-but'>";
_html += "</div></div>";
_html += "<div class='au-font-11 au-text-66 date-m'>";
_html += "<div>发起人:<span>" + gwf.StarterName + "</span></div>";
_html += "<div>发起时间:" + gwf.RDT + "</div>";
_html += "<div>当前节点:<span>" + gwf.NodeName + "</span></div>";
_html += "<div>处理人:<span>" + gwf.TodoEmps + "</span></div>";
_html += "<div>状态:<span>" + GetState(gwf.WFState) + "</span></div></div></div>";
_html += "</div></div>";
});
if (isHave == false) {
_html += "<div class='au-prompt au-mg-top' style='text-align:center;background-color:white'>";
_html += "<img src='../image/prompt1.png' style='width: 8rem;'>";
_html += "<span class='au-text-99 au-font-12'>暂无数据</span>";
_html += "</div>";
}
});
$("#SubFlowInfo").html(_html);
//绑定点击事件
var boxs = $(".box");
$.each(boxs, function (i, box) {
var divId = $(box).attr("id");
//将ID值进行分解
var vals = divId.split('_');
//WorkID
var oid = vals[0];
//流程编号
var fk_flow = vals[1];
//节点编号
var fk_node = vals[2];
//fid
var fid = vals[3];
var wfState = vals[4];
if (wfState == 0) {//草稿状态
$("#" + divId).on("tap", function () {
var url = "../MyFlow.htm?FK_Flow=" + fk_flow + "&WorkID=" + oid + "&FID=" + fid + "&MyFlowFrom=SubFlow" + "&m=" + Math.random() + "&From=" + GetQueryString("From");
SetHref(url);
});
}
else {
$("#" + divId).on("tap", function () {
var url = "../MyView.htm?FK_Flow=" + fk_flow + "&WorkID=" + oid + "&FK_Node=" + fk_node + "&FID=" + fid + "&MyViewFrom=SubFlow" + "&m=" + Math.random() + "&From=" + GetQueryString("From");
SetHref(url);
});
}
});
return;
});
/**
* 发起子流程
*/
function AddSubFlow(subFlowMyPK) {
var subFlow = $.grep(subFlows, function (item) {
return item.MyPK = subFlowMyPK;
})[0];
var workID = GetQueryString("WorkID");
var fk_flow = GetQueryString("FK_Flow");
var fk_node = GetQueryString("Fk_Node");
var fid = GetQueryString("FID");
var url = "";
//是不是批量发起
if (subFlow.SubFlowStartModel == 0) {
//单条启动模式
//下级子流程
if (subFlow.SubFlowModel == 0 || subFlow.SubFlowModel == null) {
url = "../MyFlow.htm?IsStartSameLevelFlow=0&FK_Flow=" + subFlow.SubFlowNo + "&PWorkID=" + workID + "&PNodeID=" + fk_node + "&PFlowNo=" + fk_flow + "&PFID=" + fid;
}
//平级子流程
if (subFlow.SubFlowModel == 1) {
var gwf = new Entity("BP.WF.GenerWorkFlow", workID);
url = "../MyFlow.htm?FK_Flow="+subFlow.SubFlowNo+"&PWorkID="+gwf.PWorkID+"&PNodeID="+gwf.PNodeID+"&PFlowNo="+gwf.PFlowNo+"&PFID="+gwf.PFID + "&IsStartSameLevelFlow=1&SLWorkID=" + workID + "&SLNodeID=" + fk_node + "&SLFlowNo=" + fk_flow;
}
SetHref( url + "&MyFlowFrom=SubFlow");
return;
}
if (subFlow.SubFlowStartModel == 1 || subFlow.SubFlowStartModel == 2) {
//分组数据源多条启动
var url = "./SubFlowGuid.htm?SubFlowMyPK=" + subFlowMyPK + "&WorkID=" + workID + "&FK_Flow=" + fk_flow + "&FK_Node=" + fk_node + "&From=" + GetQueryString("From");
SetHref(url);
return;
}
}
function GetState(wfState) {
switch (parseInt(wfState)) {
case 1:
return "<font color=#bc65e0>草稿</font>";
case 2:
return "<font color=green>运行中</font>";
break;
case 3:
return "已完成";
break;
case 4:
return "挂起";
case 5:
return "<font color=red>退回</font>";
case 6:
return "转发";
case 7:
return "删除";
case 8:
return "加签";
case 11:
return "加签回复";
default:
return "其它";
}
}
function Back() {
var from = GetQueryString("From");
if (from == null || from == undefined || from == "null" || from == "")
from = "MyView";
SetHref( "../" +from+".htm?WorkID=" + GetQueryString("WorkID") + "&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node"));
}
</script>
<style type="text/css">
.mui-table-view-cell div {
display: inline;
float: left;
width: 33%;
text-align: center;
}
.mui-bar-tab .mui-tab-item {
color: #000;
}
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:Back();"></a>
<h1 class="mui-title">启用的子流程</h1>
</header>
<div class="mui-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll" id="SubFlowInfo" style="top:46px">
</div>
</div>
</div>
<div data-role="panel" data-position-fixed="true" data-display="push" id="nav-panel">
</div>
</body>
<script type="text/javascript">
//初始化单页的区域滚动
mui('.mui-scroll-wrapper').scroll();
</script>
</html>