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.

340 lines
13 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 name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../Portal/icons/font-icons.min.css" rel="stylesheet" />
<link href="../Portal/icons/icons.css" rel="stylesheet" />
<link href="../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<link href="../CCForm/JS/mselector.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" />
<script src="../Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<link href="../Comm/JS/Calendar/skin/WdatePicker.css" rel="stylesheet" type="text/css" />
<script src="../Comm/JS/Calendar/WdatePicker.js" type="text/javascript"></script>
<!-- 引用通用的js文件. -->
<script type="text/javascript" src="../Scripts/config.js"></script>
<script type="text/javascript" src="../Comm/Gener.js"></script>
<script type="text/javascript" src="../Scripts/QueryString.js"></script>
<link href="../Scripts/bootstrap/css/font-awesome.css" rel="Stylesheet" />
<script type="text/javascript" src="../Scripts/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../Scripts/bootstrap/js/jquery.cokie.min.js"></script>
<script src="../Scripts/bootstrap/BootstrapUIDialog.js" type="text/javascript"></script>
<script src="../CCForm/JS/mtags.js" type="text/javascript"></script>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
#cc{
margin-top:20px;
}
.ccflow-input-span-container {
border: 0;
}
th {
border-width: 1px;
border-color: #C2D5E3;
border-style: solid;
line-height: 25px;
color: #0a0a0a;
white-space: nowrap;
padding: 5px 2px;
background-color: #f6f6f6;
font-size: 14px;
text-align: left;
font-size: 12px;
font-weight: bolder;
}
.vertical {
display: table-cell;
vertical-align: middle !important;
}
.small_distance {
margin: 0 10px;
font-size: 16px;
}
</style>
<script type="text/javascript" language="javascript">
var currSelectNode = "";
$(function () {
var html = "<table class='table table-hover table-bordered' style='width:100%;' >";
html += "<tr>";
html += "<th width='10%'>步骤</th>";
html += "<th width='*'>节点</th>";
html += "<th width='50%'>处理人</th>";
//html += "<th width='15%'>应完成时间</th>";
html += "<th width='150px'>操作</th>";
html += "</tr>";
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddUrlData();
var data = handler.DoMethodReturnJSON("TransferCustom_Init");
var nds = data["WF_Node"]; //节点.
var tcs = data["WF_TransferCustoms"]; //选择的接受人.
var gwls = data["WF_GenerWorkerlist"]; //选择的接受人.
//输出已经走过的节点.
html += "<tr><th colspan=5>已经运行的节点</tr>";
for (var i = 0; i < gwls.length; i++) {
var gwl = gwls[i];
html += "<tr>";
html += "<td class='vertical'>" + gwl.FK_Node + " </td>";
html += "<td class='vertical' >" + gwl.NodeName + " </td>";
html += "<td class='vertical' >" + gwl.EmpName + " </td>";
html += "<td class='vertical'>无</td>";
html += "</tr>";
}
//要排列的节点.
var IsShowSave = false;
html += "<tr><th colspan=5>可以动态组合的节点</tr>";
for (var i = 0; i < tcs.length; i++) {
var tc = tcs[i];
if (tc.IsEnable == 0)
continue;
html += "<tr>";
html += "<td class='vertical'>" + tc.FK_Node + " </td>";
html += "<td class='vertical'>" + tc.NodeName + " </td>";
html += "<td class='vertical'>";
//处理接收人的事件
html += "<div id='" + tc.FK_Node + "_mtags' style='width:99%' class='mtags'></div>";
html += " </td>";
//if (tc.PlanDT != null && tc.PlanDT != "") {
// IsShowSave = true;
// html += "<td><input type='text' id='"+tc.MyPK+"' name='CHTime' value='" + tc.PlanDT + "' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd HH:mm\"})' class='form-control Wdate' style='width:150px;display:inline'/></td>";
//} else {
// html += "<td></td>";
//}
html += "<td style='padding:3px;' class='vertical'>";
html += " <a class='small_distance' href=\"javascript:DoUp('" + tc.MyPK + "');\"><i class=icon-arrow-up-circle></i></a>";
html += " <a class='small_distance' href=\"javascript:DoDown('" + tc.MyPK + "');\"><i class=icon-arrow-down-circle></i></a>";
html += " <a class='small_distance' href=\"javascript:Remove('" + tc.MyPK + "');\"><i class=icon-close></i></a>";
html += "</tr>";
}
//可选步骤.
html += "<tr><th colspan=5>可选节点</tr>";
for (var i = 0; i < tcs.length; i++) {
var tc = tcs[i];
if (tc.IsEnable == 1)
continue;
html += "<tr>";
html += "<td class='vertical'>" + tc.FK_Node + " </td>";
html += "<td class='vertical'>" + tc.NodeName + " </td>";
html += "<td class='vertical'>" + tc.WorkerName + " </td>";
html += "<td class='vertical'>[<a href=\"javascript:Add('" + tc.MyPK + "');\">增加</a>]</td>";
html += "</tr>";
}
$("#docs").html(html);
var u = new WebUser();
var initJsonData = [];
var dept = getQueryStringByNameFromUrl("?" + $.cookie('CCS'), "FK_Dept");
if (dept == null || dept == '' || dept == undefined) {
dept = $.cookie('FK_Dept');
}
if (dept == null || dept == '' || dept == undefined) {
dept = u.FK_Dept;
}
if (dept == undefined) {
dept = "0";
}
for (var i = 0; i < tcs.length; i++) {
initJsonData = [];
var tc = tcs[i];
if (tc.Worker == null) tc.Worker = "";
if (tc.WorkerName == null) tc.WorkerName = "";
var workers = tc.Worker.split(',');
var workerNames = tc.WorkerName.split(',');
$.each(workers, function (k, o) {
if (o != null && o != "")
initJsonData.push({
"No": o,
"Name": workerNames[k],
"MyPK": tc.MyPK
});
});
var mtags = $("#" + tc.FK_Node + "_mtags");
mtags.mtags({
"fit": true,
"onUnselect": function (record) {
RemoveEmp(record.MyPK, record.No, record.Name);
}
});
if (initJsonData.length != 0)
mtags.mtags("loadData", initJsonData);
}
$.each($(".mtags"), function (i, mtags) {
var w = window.parent.document.body.clientWidth - 300;
var h = window.parent.document.body.clientHeight - 40;
$(mtags).bind("click", function () {
currSelectNode = $(mtags).attr("id").replace("_mtags", "");
var url = "./SelectEmps.htm?FK_Dept=" + dept + "&FK_Node=" + currSelectNode + "&s=" + Math.random();
$('#iframeSelectEmpsForm').attr('src', url);
$('#SelectEmpsModal').modal().show();
});
});
if (IsShowSave == true)
$("#IsShowSave").show();
})
//设置选中的人员
function selectEmpsWindowClose(data) {
$('#SelectEmpsModal').modal('hide');
if (data == '取消') {
return;
}
var val = frames["iframeSelectEmpsForm"].window.returnVal;
var mypk = currSelectNode + "_" + GetQueryString("WorkID");
var en = new Entity("BP.WF.TransferCustom", mypk);
en.Worker = en.Worker + "," + val.No + ",";
en.WorkerName = en.WorkerName + "," + val.Name + ",";
en.Update();
InitMtags($("#" + en.FK_Node + "_mtags"), en.MyPK, en.Worker, en.WorkerName);
}
//初始化接收人员列表
function InitMtags(mtags, MyPK, worker, workerName) {
var workers = worker.split(',');
var workerNames = workerName.split(',');
var initJsonData = [];
$.each(workers, function (k, o) {
if (o != null && o != "")
initJsonData.push({
"No": o,
"Name": workerNames[k],
"MyPK": MyPK
});
});
mtags.mtags("loadData", initJsonData);
}
//删除人员
function RemoveEmp(mypk, empNo, empName) {
var en = new Entity("BP.WF.TransferCustom", mypk);
en.Worker = en.Worker.replace(empNo + ",", "");
en.WorkerName = en.WorkerName.replace(empName + ",", "");
en.Update();
InitMtags($("#" + en.FK_Node + "_mtags"), mypk, en.Worker, en.WorkerName);
}
function DoUp(myPK) {
var en = new Entity("BP.WF.TransferCustom", myPK);
en.DoMethodReturnString("DoUp");
Reload();
}
function DoDown(myPK) {
var en = new Entity("BP.WF.TransferCustom", myPK);
en.DoMethodReturnString("DoDown");
Reload();
}
function Add(myPK) {
var en = new Entity("BP.WF.TransferCustom", myPK);
en.IsEnable = 1;
en.Update();
Reload();
}
function Remove(myPK) {
var ens = new Entities("BP.WF.TransferCustoms");
ens.Retrieve("WorkID", GetQueryString("WorkID"), "IsEnable", 1);
if (ens.length == 1) {
alert("流转自定义必须选择一个游离态节点,当前只有一个游离态节点不能移除");
return;
}
var en = new Entity("BP.WF.TransferCustom", myPK);
en.IsEnable = 0;
en.Update();
Reload();
}
function Save() {
//获取需要保存时间的数据
var tfs = $('input[name=CHTime]');
if (tfs.length == 0)
return;
var workId = GetQueryString("WorkID");
$.each(tfs, function (i, obj) {
var id = obj.id;
if (obj.value == "") {
alert("节点" + id.replace("_" + workId, "") + "不能为空");
return;
}
var en = new Entity("BP.WF.TransferCustom");
en.SetPKVal(id);
en.RetrieveFromDBSources();
en.MyPK = id;
en.PlanDT = obj.value;
en.Save();
});
}
</script>
</head>
<body>
<form id="cc">
<center>
<table style="width: 90%;">
<tr style="margin-top:20px;">
<td>
<div id="docs" name="docs" style="width: 100%">
</div>
</td>
</tr>
</table>
</center>
</form>
<div class="modal fade" id="SelectEmpsModal">
<div class="modal-dialog">
<div class="modal-content" style="border-radius: 0px; width:100%;">
<div class="modal-header">
<button type="button" class="close" style="color: #000; opacity: 1;" data-dismiss="modal"
aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
接受人
</h4>
</div>
<div class="modal-body" style="padding-top: 0px;margin-top: 0px;">
<iframe style="width: 100%; border: 0px; height: 400px;" id="iframeSelectEmpsForm"
name="iframeSelectEmpsForm"></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</body>
</html>