|
|
<!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>
|
|
|
<meta charset="UTF-8" />
|
|
|
<title></title>
|
|
|
<link href="../../Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" />
|
|
|
<link href="../../Scripts/easyUI145/themes/color.css" rel="stylesheet" />
|
|
|
<link href="../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
|
|
<link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
|
|
|
<script src="../../Scripts/jquery-1.11.0.min.js" type="text/javascript">></script>
|
|
|
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
|
|
|
<script src="../../Scripts/QueryString.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 src="../Admin.js"></script>
|
|
|
<style type="text/css">
|
|
|
caption {
|
|
|
text-align: left;
|
|
|
font-family: 'Microsoft YaHei';
|
|
|
font-weight: bolder;
|
|
|
border-bottom: none;
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
|
|
|
legend {
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
//页面启动函数.
|
|
|
$(function () {
|
|
|
|
|
|
$("#Msg").html("正在加载,请稍后......");
|
|
|
|
|
|
|
|
|
|
|
|
//初始化groupID.
|
|
|
var fk_flow = GetQueryString("FK_Flow");
|
|
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrFlow");
|
|
|
handler.AddPara("FK_Flow", fk_flow);
|
|
|
var data = handler.DoMethodReturnString("DTSBTable_Init");
|
|
|
|
|
|
if (data.indexOf('err@') == 0) {
|
|
|
alert(data);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
data = JSON.parse(data);
|
|
|
|
|
|
//获取三个对象.
|
|
|
var flow = data["Flow"][0];
|
|
|
var nodes = data["Nodes"];
|
|
|
var tables = data["Tables"];
|
|
|
|
|
|
//赋值.
|
|
|
$("#P1").val(flow.PTable);
|
|
|
$("#P2").val(flow.PTable);
|
|
|
$("#P3").val(flow.PTable);
|
|
|
|
|
|
$("#RB_DTSWay_" + flow.DataDTSWay).attr("Checked", true);
|
|
|
$("#RB_DTSField_" + flow.DTSFields).attr("Checked", true);
|
|
|
$("#RB_DTSTime_" + flow.DTSTime).attr("Checked", true);
|
|
|
|
|
|
//绑定数据源.
|
|
|
GenerBindEntities("DDL_DBSrc", "BP.Sys.SFDBSrcs", flow.DTSDBSrc);
|
|
|
//绑定表.
|
|
|
GenerBindDDL("DDL_Table", tables, "No", "Name", flow.DTSBTable);
|
|
|
|
|
|
var newRow;
|
|
|
for (var i in nodes) {
|
|
|
|
|
|
var node = nodes[i];
|
|
|
newRow = "<tr >";
|
|
|
newRow += "<td class=Idx>" + i + "</td>";
|
|
|
if (flow.DTSSpecNodes.indexOf(node.NodeID) >= 0)
|
|
|
newRow += "<td><input type='checkbox' checked='checked' id='" + node.NodeID + "' name='CB_" + node.NodeID + "' />" + node.Name + "</td>";
|
|
|
else
|
|
|
newRow += "<td><input type='checkbox' id='" + node.NodeID + "' name='CB_" + node.NodeID + "' />" + node.Name + "</td>";
|
|
|
newRow += "<td>" + node.NodeID + "</td>";
|
|
|
|
|
|
newRow += "<td>" + node.Step + "</td>";
|
|
|
newRow += "</tr>";
|
|
|
|
|
|
$("#Table1 tr:last").after(newRow);
|
|
|
}
|
|
|
|
|
|
$("#Msg").html("");
|
|
|
//绑定select事件
|
|
|
$("#DDL_DBSrc").change(function () {
|
|
|
DTSBTable_DBSrcChange();
|
|
|
});
|
|
|
|
|
|
//绑定同步时间事件
|
|
|
if (flow.DTSTime == 1)
|
|
|
document.getElementById("nodeSelect").style.display = "block";
|
|
|
else
|
|
|
document.getElementById("nodeSelect").style.display = "none";
|
|
|
|
|
|
$("input:radio[name='RB_DTSTime']").bind("click",function(){
|
|
|
var val = $(this).val();
|
|
|
if(val=='1'){
|
|
|
DTSTimeChange(1);
|
|
|
}
|
|
|
if(val=='2'){
|
|
|
DTSTimeChange(2);
|
|
|
}
|
|
|
if(val=='0'){
|
|
|
DTSTimeChange(0);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
//设置字段匹配
|
|
|
function OpenFields() {
|
|
|
|
|
|
var dllSrc = $("#DDL_DBSrc").val();
|
|
|
//var src = $("#DDL_DBSrc option:selected").text();//获取当前选择项.
|
|
|
|
|
|
|
|
|
var dllTable = $("#DDL_Table").val();
|
|
|
|
|
|
//var tableName = $("#DDL_Table option:selected").text();
|
|
|
var fk_flow = GetQueryString("FK_Flow");
|
|
|
var url = '../../Admin/AttrFlow/DTSBTableExt.htm?FK_Flow=' + fk_flow + '&FK_DBSrc=' + dllSrc + '&TableName=' + dllTable;
|
|
|
if (window.parent && window.parent.addTab) {
|
|
|
window.parent.addTab('dtsbTable', '设置字段匹配', url, '');
|
|
|
} else {
|
|
|
window.open(url, '_blank');
|
|
|
}
|
|
|
}
|
|
|
function OpenDTSNodes() {
|
|
|
var toggleStyle = document.getElementById("nodeSelect").style.display;
|
|
|
if (toggleStyle == "none") {
|
|
|
document.getElementById("nodeSelect").style.display = "block";
|
|
|
} else {
|
|
|
document.getElementById("nodeSelect").style.display = "none";
|
|
|
}
|
|
|
}
|
|
|
function WinOpen(url, winName) {
|
|
|
var newWindow = window.open(url, winName, 'width=700,height=400,top=100,left=300,scrollbars=yes,resizable=yes,toolbar=false,location=false,center=yes,center: yes;');
|
|
|
newWindow.focus();
|
|
|
return;
|
|
|
}
|
|
|
//必须初始化
|
|
|
window.onload = function () {
|
|
|
checkNodes();
|
|
|
};
|
|
|
//cb选择事件
|
|
|
function checkNodes() {
|
|
|
var input = document.getElementsByTagName("input");
|
|
|
var value = '';
|
|
|
for (var i = 0; i < input.length; i++) {
|
|
|
if (input[i].type == "checkbox") {
|
|
|
if (input[i].checked) {
|
|
|
value += input[i].id + ",";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return value;
|
|
|
// document.all.<%= HiddenField.ClientID %>.value=value;
|
|
|
}
|
|
|
//保存
|
|
|
function Save() {
|
|
|
|
|
|
$("#Msg").html("正在保存,请稍后......");
|
|
|
|
|
|
var fk_flow = GetQueryString("FK_Flow");
|
|
|
|
|
|
var checkBoxIDs = checkNodes(); //获得所有的 checkBox ID传入到后台去,用于解决checkbox控件,在没有被选择的时候,没有值的问题。
|
|
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrFlow");
|
|
|
handler.AddUrlData();
|
|
|
handler.AddFormData();
|
|
|
handler.AddPara("CheckBoxIDs", checkBoxIDs);
|
|
|
|
|
|
var data = handler.DoMethodReturnString("DTSBTable_Save");
|
|
|
if (data.indexOf('err@') >= 0) {
|
|
|
$("#Msg").html("<font color=red>" + data + "</font>");
|
|
|
return;
|
|
|
}
|
|
|
alert("保存成功")
|
|
|
Reload();
|
|
|
return;
|
|
|
}
|
|
|
//选择事件
|
|
|
function DTSBTable_DBSrcChange() {
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrFlow");
|
|
|
handler.AddFormData();
|
|
|
var data = handler.DoMethodReturnString("DTSBTable_DBSrcChange");
|
|
|
data = JSON.parse(data);
|
|
|
|
|
|
var dllSrc = $("#DDL_DBSrc").val();
|
|
|
//绑定表.
|
|
|
GenerBindDDL("DDL_Table", data, "No", "Name", dllSrc);
|
|
|
}
|
|
|
function DTSTimeChange(DTSTime) {
|
|
|
if (DTSTime == 1) {
|
|
|
document.getElementById("nodeSelect").style.display = "block";
|
|
|
}
|
|
|
else {
|
|
|
document.getElementById("nodeSelect").style.display = "none";
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="container-full">
|
|
|
<div id="titleH4" class="attrnode-bar-header">
|
|
|
<div class="pull-right">
|
|
|
<div id="bar">
|
|
|
<button id="Btn_Save" type="button" value="保存" onclick="Save();" class="cc-btn-tab btn-save">保存</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<strong>与业务表数据同步 </strong>
|
|
|
</div>
|
|
|
|
|
|
<form id="cc">
|
|
|
|
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
<legend>
|
|
|
<input type="radio" value="0" id="RB_DTSWay_0" name="RB_DTSWay" />
|
|
|
<label for="RB_DTSWay_0">
|
|
|
不执行同步
|
|
|
</label>
|
|
|
</legend>
|
|
|
<ul style="color: Gray">
|
|
|
<li>流程运行的数据存储到,不与其他系统交换数据。</li>
|
|
|
<li>其他系统可以读写这个表的数据,完成相关的业务操作。</li>
|
|
|
<li>该表名是可以在流程属性配置。</li>
|
|
|
</ul>
|
|
|
</fieldset>
|
|
|
<fieldset>
|
|
|
<legend>
|
|
|
<input type="radio" value="1" id="RB_DTSWay_1" name="RB_DTSWay" />
|
|
|
<label for="RB_DTSWay_1">
|
|
|
执行同步
|
|
|
</label>
|
|
|
</legend>
|
|
|
<div class="pd10">
|
|
|
<table class="table table-hover" style="text-align: center;margin-top:20px">
|
|
|
<tr>
|
|
|
<td>
|
|
|
请选择要导出的数据源
|
|
|
</td>
|
|
|
<td>
|
|
|
<select id="DDL_DBSrc" name="DDL_DBSrc">
|
|
|
</select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>
|
|
|
指定的表
|
|
|
</td>
|
|
|
<td>
|
|
|
<select id="DDL_Table" name="DDL_Table">
|
|
|
</select>
|
|
|
<br /> 要把数据同步到那个数据表里去?
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>
|
|
|
同步的计算方式
|
|
|
</td>
|
|
|
<td>
|
|
|
<a class="btn btn-default btn-sm" href="javascript:OpenFields()">设置字段匹配</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td style="border-bottom: none;">
|
|
|
同步的时间
|
|
|
</td>
|
|
|
<td style="border-bottom: none;">
|
|
|
<input id="RB_DTSTime_0" type="radio" name="RB_DTSTime" value="0" /><span for="RB_DTSTime_0">所有的节点发送后</span>
|
|
|
<br />
|
|
|
<input id="RB_DTSTime_2" type="radio" name="RB_DTSTime" value="2" /><span for="RB_DTSTime_2">流程结束时</span>
|
|
|
<br />
|
|
|
<input id="RB_DTSTime_1" type="radio" name="RB_DTSTime" value="1" /><span for="RB_DTSTime_1">指定的节点发送后</span>
|
|
|
[<a href="javascript:void(0)" onclick="OpenDTSNodes()">设置同步的节点</a>]
|
|
|
<div id="dis" style="display: none;">
|
|
|
</div>
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
</fieldset>
|
|
|
<fieldset id="nodeSelect" style="display:none;">
|
|
|
<div id="" style="margin-top:10px;margin-bottom:10px">
|
|
|
<table id="Table1" class="table">
|
|
|
<caption>设置同步的节点</caption>
|
|
|
<tr>
|
|
|
<th>#</th>
|
|
|
<th>名称</th>
|
|
|
<th>节点ID</th>
|
|
|
<th>步骤</th>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
</fieldset>
|
|
|
<fieldset>
|
|
|
<legend>应用场景</legend>
|
|
|
<ol>
|
|
|
<li>在稍大的应用中,流程系统与业务系统的数据库是分开的。比如:业务流程系统、固定资产系统、客户关系管理系统、财务系统。</li>
|
|
|
<li>在固定资产管理系统中,流程审批数据库与固定资产数据库是分开的,一个固定资产的采购申请走完后,需要把该固定资产采购的信息同步到固定资产系统中去,或者一个固定资产的报废需要把该审批结果需要更新固定资产状态。</li>
|
|
|
<li>流程走完一个订单审批后,需要把订单的信息同步到仓库管理系统中去。</li>
|
|
|
</ol>
|
|
|
</fieldset>
|
|
|
<fieldset>
|
|
|
<legend>帮助</legend>
|
|
|
<ol>
|
|
|
<li>
|
|
|
ccbpm在运转的过程中会把节点表单的数据存储到ccbpm数据库的数据表 <span style="color: Blue;">
|
|
|
[<%=fl.PTable%>]
|
|
|
</span>里,这个表的名称可以在流程属性里定义。
|
|
|
</li>
|
|
|
<li>流程数据存储表可以自定义,定义路径:流程属性=》 基本属性=》流程数据表。</li>
|
|
|
<li>有的应用场景下,会把该表的业务数据同步到其他系统中去,ccbpm提供了事件可以使用编程的方式实现这样的需求。</li>
|
|
|
<li>为了更好的适应开发者的需求,我们提供了界面化的定义工具。 </li>
|
|
|
<li>该功能可以把流程数据转出到指定的数据库上,指定的数据表里。</li>
|
|
|
</ol>
|
|
|
</fieldset>
|
|
|
|
|
|
</form>
|
|
|
</div>
|
|
|
</body>
|
|
|
</html>
|