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.

219 lines
8.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>
<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="../js/mui/css/mui.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/mui/js/mui.min.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>
<style>
.mui-bar-tab .mui-tab-item {
color:#000;
}
</style>
<script type="text/javascript">
var doType = GetQueryString("DoType");
var subFlowGuid;
$(function () {
var subFlowMyPK = GetQueryString("SubFlowMyPK");
subFlowGuid = new Entity("BP.WF.Template.SFlow.SubFlowHandGuide", subFlowMyPK);
if (subFlowGuid.SubFlowGuideSQL == null || subFlowGuid.SubFlowGuideSQL == "") {
alert("请配置批量启动子流程的实体数据源");
return;
}
if (subFlowGuid.SubFlowStartModel == 1) {
$("#treeDiv").hide();
//列表批量启动模式
ListSubFlowGuid(subFlowGuid);
}
if (subFlowGuid.SubFlowStartModel == 2) {
$("#treeDiv").hide();
//分组批量启动模式
if (subFlowGuid.SubFlowGuideGroup == null || subFlowGuid.SubFlowGuideGroup == "") {
alert("请配置批量启动子流程的分组数据源")
}
}
if (subFlowGuid.SubFlowStartModel == 3) {
$("#listDiv").hide();
//树结构启动模式
if (subFlowGuid.SubFlowGuideSQL.indexOf("ParentNo") == -1) {
alert("配置批量启动子流程的SQL语句不包含ParentNo,请联系管理员");
return;
}
}
$("#Btn_OK").on("tap", function () {
Btn_OK();
});
$("#Back").on("tap", function () {
Back();
});
});
/**
* 列表结构的解析
* @param subFlowGuid
*/
function ListSubFlowGuid(subFlowGuid) {
var sql = subFlowGuid.SubFlowGuideSQL;
sql = DealExp(sql);
var dt = DBAccess.RunSQLReturnTable(sql);
ShowList(dt, null);
}
/**
* 分组结构的解析
* @param subFlowGuid
*/
function GroupSubFlowGuid(subFlowGuid) {
//分组
var sql = subFlowGuid.SubFlowGuideGroup;
sql = DealExp(sql);
var groupdt = DBAccess.RunSQLReturnTable(sql);
//数据源
sql = subFlowGuid.SubFlowGuideSQL;
sql = DealExp(sql);
var dt = DBAccess.RunSQLReturnTable(sql);
var html = "";
//获取分组字段
var fieldFK = "", groupPK = "";
if (groupdt.length != 0 && dt.length != 0) {
var idx = 0;
for (var obj in groupdt[0]) {
if (idx == 0) {
groupPK = obj;
break;
}
idx++;
}
idx = 0;
for (var obj in dt[0]) {
if (idx == 2) {
fieldFK = obj;
break;
}
idx++;
}
}
ShowList(dt, groupdt, groupPK,fieldFK);
}
function ShowList(dt,groupdt,groupPK,enFK) {
var ul = $("#tableView");
if (groupdt == null) {
$.each(dt, function (i, item) {
var _html = "<li data-value='" + item.No + "' data-tags='" + item.Name + "' class='mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left'>";
_html += "<input type='checkbox' id='" + item.No + "' value='" + item.Name + "' /> " + item.Name + "</li>";
ul.append(_html);
});
return;
}
$.each(groupdt, function (i, obj) {
ul.append("<li data-group='" + obj.No + "' class='mui-table-view-divider mui-indexed-list-group'>" + obj.Name + "</li>");
$.each(dt, function (k, item) {
if (item[fieldFK] != dt[groupPK])
return true;
var _html = "";
_html += "<li data-value='" + item.No + "' data-tags='" + item.Name + "' class='mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left'>";
_html += "<input type='checkbox' id='" + item.No + "' value='" + item.Name + "' /> " + item.Name + "</li>";
ul.append(_html);
});
});
}
//确定【选择接收人并发送】 / 保存. Accepter_Save Accepter_Send
function Btn_OK() {
$("#Btn_OK").prop("disabled", true);//禁用按钮
$("#Btn_OK").css("color","#CCCCCC");
//生成选择的人员.
var checked = $('input:checked');
var selectNos = "";
for (var i = 0; i < checked.length; i++) {
var ctrl = checked[i];
//录制人员名称.
selectNos += ctrl.id + "@" + ctrl.value + ',';
}
if (selectNos == "" || selectNos == null) {
mui.alert('请选择人员...');
$("#Btn_OK").prop("disabled", false);//解禁按钮
$("#Btn_OK").css("color","#000");
return;
}
//处理发起的流程
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddPara("WorkID", GetQueryString("WorkID")); //当前流程的WorkID.
handler.AddPara("FK_Node", GetQueryString("FK_Node")); //当前节点的
handler.AddPara("FK_Flow", GetQueryString("FK_Flow")); // 当前流程.
handler.AddPara("FID", GetQueryString("FID"));
handler.AddPara("SelectNos", selectNos); //选择的实体编号,名称.
handler.AddPara("SubFlowMyPK", GetQueryString("SubFlowMyPK"));
var data = handler.DoMethodReturnString("SubFlowGuid_Send");
if (data.indexOf("err@") != -1) {
mui.alert(data);
return false;
}
mui.alert(data);
Back();
}
function Back() {
window.location.href = "./SubFlow.htm?WorkID=" + GetQueryString("WorkID") + "&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node") + "&FID=" + GetQueryString("FID") == null ? 0 : +GetQueryString("FID");
}
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">选择接受人</h1>
</header>
<div class="mui-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<div id="list" class="mui-indexed-list">
<div class="mui-indexed-list-inner">
<ul id="tableView" class="mui-table-view" style="margin-top:50px;margin-bottom:50px"></ul>
</div>
</div>
</div>
</div>
</div>
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item" href="#" id="Btn_OK">发送</a>
<a class="mui-tab-item" href="#" id="Back">取消</a>
</nav>
<script type="text/javascript">
//初始化单页的区域滚动
mui('.mui-scroll-wrapper').scroll();
</script>
</body>
</html>