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.

473 lines
19 KiB
Plaintext

11 months ago
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>流程应完成日期计算规则</title>
<!--SQL编辑器-->
<link href="../../Scripts/CodeMirror/lib/codemirror.css" rel="stylesheet" />
<link href="../../Scripts/CodeMirror/addon/hint/show-hint.css" rel="stylesheet" />
<script src="../../Scripts/CodeMirror/lib/codemirror.js"></script>
<script src="../../Scripts/CodeMirror/addon/edit/matchbrackets.js"></script>
<script src="../../Scripts/CodeMirror/mode/sql/sql.js"></script>
<script src="../../Scripts/CodeMirror/addon/hint/show-hint.js"></script>
<script src="../../Scripts/CodeMirror/addon/hint/sql-hint.js"></script>
<script src="../../Scripts/LoadSql.js"></script>
<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" />
<style type="text/css">
.input {
width: 95%;
height: 20px;
}
#Btn_Save {
background-image: url(../../Img/Btn/Save.png) !important;
}
</style>
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../Scripts/QueryString.js"></script>
<!-- ccbpm -->
<script type="text/javascript" src="../../Scripts/config.js"></script>
<script type="text/javascript" src="../../Comm/Gener.js"></script>
<base target="_self" />
<script src="../Admin.js"></script>
<script type="text/javascript">
////全局变量
//var FK_Flow; //流程id
//页面启动函数.
$(function () {
$("#Msg").html("<img src=../../Img/loading.gif />&nbsp;正在加载,请稍后......");
InitPage();
$("#Msg").html("");
});
function InitPage() {
var fk_flow = GetQueryString("FK_Flow");
var data = new Entity("BP.WF.Flow", fk_flow);
fk_flow = fk_flow.replace(/^0+/, "");
var FK_MapData = "ND" + fk_flow + "Rpt";
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", FK_MapData);
//按照时间点的考核方式
var SDTOfFlowRole = data.SDTOfFlowRole;
if (SDTOfFlowRole == null || SDTOfFlowRole == undefined || SDTOfFlowRole == '') {
$("input[name='RB_SDTOfFlowRole'][value='0']").attr("checked", true);
} else {
$("input[name='RB_SDTOfFlowRole'][value=" + SDTOfFlowRole + "]").attr("checked", true);
}
//查询日期字段下拉框所有值
var options = "";
for (var i = 0; i < mapAttrs.length; i++) {
if (mapAttrs[i].MyDataType != 6 && mapAttrs[i].MyDataType != 7)
continue;
if (mapAttrs[i].KeyOfEn == "RDT" || mapAttrs[i].KeyOfEn == "CDT" || mapAttrs[i].KeyOfEn == "FlowEnderRDT" || mapAttrs[i].KeyOfEn == "FlowStartRDT")
continue;
options += "<option value=" + mapAttrs[i].KeyOfEn + ">" + mapAttrs[i].Name + "</option>";
}
//日期字段下拉框赋值
$("#DDL_StartFields").append(options);
$("#DDL_Fields").append(options);
//计划开始时间
var SDTOfFlowRole_StartDateField = data.GetPara("SDTOfFlowRole_StartDateField");
if (SDTOfFlowRole_StartDateField == null || SDTOfFlowRole_StartDateField == undefined || SDTOfFlowRole_StartDateField == '') {
$("#DDL_StartFields").val(0);
} else {
$("#DDL_StartFields").val(SDTOfFlowRole_StartDateField);
}
//流程计划完成时间
var SDTOfFlowRole_DateField = data.GetPara("SDTOfFlowRole_DateField");
if (SDTOfFlowRole_DateField == null || SDTOfFlowRole_DateField == undefined || SDTOfFlowRole_DateField == '') {
$("#DDL_Fields").val(0);
} else {
$("#DDL_Fields").val(SDTOfFlowRole_DateField);
}
//sql语句赋值
$("#TB_SQL").val(data.SDTOfFlowRoleSQL);
//天数赋值
var SDTOfFlowRole_Days = data.GetPara("SDTOfFlowRole_Days");
$("#TB_Days").val(SDTOfFlowRole_Days);
//限制规则的部分
var fk_flow = GetQueryString("FK_Flow");
//var data = new Entity("BP.WF.Flow", fk_flow);
var _StartLimitRole = data.StartLimitRole;
//批量赋值.
GenerFullAllCtrlsVal(data);
if (_StartLimitRole == 1) {
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(data.StartLimitPara);
$("#DDL_ByTime").val(0);
}
var dat = data;
$("#TB_Alert").val(dat.StartLimitAlert); //限制提示信息
switch (parseInt(dat.StartLimitRole)) {
case 0: //不限制 None
break;
case 1: //天
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(dat.StartLimitPara);
$("#DDL_ByTime").val(0);
break;
case 2: //周
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(dat.StartLimitPara);
$("#DDL_ByTime").val(1);
break;
case 3: //月份
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(dat.StartLimitPara);
$("#DDL_ByTime").val(2);
break;
case 4: //月份?
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(dat.StartLimitPara);
$("#DDL_ByTime").val(3);
break;
case 5: //年度
$("#RB_ByTime").attr("checked", true);
$("#TB_ByTimePara").val(dat.StartLimitPara);
$("#DDL_ByTime").val(4);
break;
case 6: //发起的列不能重复,(多个列可以用逗号分开)
$("#RB_ColNotExit").attr("checked", true);
$("#TB_ColNotExit_Fields").val(dat.StartLimitPara);
break;
case 7: //<=0
$("#RB_SQL").attr("checked", true);
$("#RB_SQL").val(dat.StartLimitPara);
$("#DDL_SQL").val(0);
break;
case 8: //>0
$("#RB_SQL").attr("checked", true);
$("#RB_SQL").val(dat.StartLimitPara);
$("#DDL_SQL").val(1);
break;
case 9: //为子流程时仅仅只能被调用1此
$("#RB_OnlyOneSubFlow").attr("checked", true);
break;
default:
alert('没有判断的类型.');
break;
}
$("#Msg").html("");
}
function Save() {
//流程应完成日期计算规则保存.
var flow = new Entity("BP.WF.Flow", GetQueryString("FK_Flow"));
var SDTOfFlowRole = $('input:radio[name="RB_SDTOfFlowRole"]:checked').val();
flow.SDTOfFlowRole = SDTOfFlowRole
var SDTOfFlowRole_DateField = $("#DDL_Fields").val();
flow.SetPara("SDTOfFlowRole_DateField", SDTOfFlowRole_DateField); //按表单字段的字段
var SDTOfFlowRole_StartDateField = $("#DDL_StartFields").val();
flow.SetPara("SDTOfFlowRole_StartDateField", SDTOfFlowRole_StartDateField);
var SDTOfFlowRole_Days = $("#TB_Days").val();
flow.SetPara("SDTOfFlowRole_Days", SDTOfFlowRole_Days); //按规定的天数
flow.SDTOfFlowRoleSQL = editor.getValue();//按sql
//发起限制规则的部分
//获取控件值
var startLimitRole = "";
var startLimitPara = "";
var xzgz = $("input[name=RB_SDTOfFlowRole]:checked")[0].id; //$("input[type=radio][name=xzgz]:checked")[0].id
alert(xzgz)
switch (xzgz) {
case "RB_ByTime":
var DDL_ByTime = parseInt($("#DDL_ByTime").val());
switch (DDL_ByTime) {
case 0:
startLimitRole = "1";
break;
case 1:
startLimitRole = "2";
break;
case 2:
startLimitRole = "3";
break;
case 3:
startLimitRole = "4";
break;
case 4:
startLimitRole = "5";
break;
}
startLimitPara = $("#TB_ByTimePara").val();
break;
case "RB_OnlyOneSubFlow":
startLimitRole = "9";
break;
case "RB_ColNotExit":
startLimitRole = "6";
startLimitPara = $("#TB_ColNotExit_Fields").val();
break;
case "RB_SQL":
var DDL_SQL = $("#RB_SQL").val();
startLimitRole = DDL_SQL == 0 ? "7" : "8";
startLimitPara = editor.getValue();
break;
default:
break;
}
//var flow = new Entity("BP.WF.Flow", GetQueryString("FK_Flow"));
flow.StartLimitRole = startLimitRole;
flow.StartLimitPara = startLimitPara;
flow.StartLimitAlert = $("#TB_Alert").val();
flow.Update();
Reload();
}
function Help() {
var url = "http://doc.ccbpm.cn";
window.open(url);
}
</script>
</head>
<body>
<div id="bar" class="cs-tr cs-bar">
<label style="float:left;font-size:15px;font-weight:bolder;padding-top:10px;">流程计划时间计算</label>
<input type="button" id="Btn_Save" value="保存" onclick="Save()" />
</div>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_None" value="0">
<!-- checked="checked"> -->
<label for="RB_None">
不使用(默认)
</label>
</legend>
<ul style="color: Gray">
<li>不使用规则。</li>
</ul>
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_BySpecDateField" value="1">
<label for="RB_BySpecDateField">
按照节点表单的日期字段计算。
</label>
<br />
<br />
</legend>
请选择计划开始日期的字段.
<select id="DDL_StartFields">
<option value="0">--请选择--</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
请选择计划完成日期的字段.
<select id="DDL_Fields">
<option value="0">--请选择--</option>
</select>
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_BySQL" value="2">
<label for="RB_BySQL">
按sql计算.
</label>
<br />
<br />
</legend>
<textarea type="text" value="" id="TB_SQL" name="TB_SQL" style="width: 90%;"></textarea>
<br />
例如: SELECT myfield FROM xxxx WHERE OID=@WorkID 返回值是一行一列的string类型的数据比如: 2019-09-09
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_ByAllNodes" value="3">
<label for="RB_ByAllNodes">按照所有节点设置的时间之和计算。</label>
</legend>
<ul>
<li>一个流程有多个节点,每个节点都设置了应该完成天数。</li>
<li>一个流程应该完成的天数,是所有节点的时效考核的数据之和。</li>
</ul>
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_ByDays" value="4">
<label for="RB_ByDays">按照规定的天数计算。</label>
</legend>
<ul>
<li>输入流程应该完成的天数:<input type="text" value="" id="TB_Days" name="TB_Days" /></li>
<li>设置多少天,就按照这个流程的天数来计算,该流程的应该完成日期。</li>
</ul>
</fieldset>
<!--发起限制规则的部分-->
<fieldset>
<legend>
<br />
<input type="radio" name="RB_SDTOfFlowRole" id="RB_ByTime">
<label for="RB_ByTime">
按时间规则计算
</label>
<br />
<br />
</legend>
<table style="width: 100%">
<tr>
<td style="width: 80px;">
规则模式:
</td>
<td>
<br />
<select id="DDL_ByTime">
<option value="0">每人每天一次</option>
<option value="1">每人每周一次</option>
<option value="2">每人每月一次</option>
<option value="3">每人每季一次</option>
<option value="4">每人每年一次</option>
</select>
<br />
</td>
</tr>
<tr>
<td colspan="3">
<a href="javascript:ShowHidden('FQGZ')">发起时间段限制参数设置:</a>
<br>
<div id="FQGZ" style="display: none; color: Gray">
<ul>
<li>该设置,可以为空。</li>
<li>用来限制该流程可以在什么时间段内发起。</li>
<li>例如:按照每人每天一次设置时间范围,规则参数:@08:30-09:00@18:00-18:30解释该流程只能在08:30-09:00与18:00-18:30两个时间段发起且只能发起一次。</li>
</ul>
</div>
<input type="text" class="input" id="TB_ByTimePara">
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_OnlyOneSubFlow">
<label for="RB_OnlyOneSubFlow">
为子流程时的规则.
</label>
</legend>
<ul>
<li><label> <input type="checkbox" id="" /> 如果当前为子流程仅仅只能被调用1次不能被重复调用。</label></li>
<li><label> <input type="checkbox" /> 如果当前为子流程,需要等到指定的子流程结束以后才能启动该流程。</label></li>
<li>指定的流程编号:<input type=text />多个子流程用逗号分开.比如:001,003</li>
<br />
</ul>
</fieldset>
<fieldset>
<legend>
<input type="radio" name="RB_SDTOfFlowRole" id="RB_ColNotExit">
<label for="RB_ColNotExit">
按照发起字段不能重复规则
</label>
<br />
<br />
</legend><a href="javascript:ShowHidden('fields')">填写设置字段</a>
<div id="fields" style="display: none; color: Gray">
<ul>
<li>设置一个列允许重复比如NSRBH</li>
<li>设置多个列的时候需要用逗号分开比如field1,field2</li>
<li>流程在发起的时候如果发现,该列是重复的,就抛出异常,阻止流程发起。</li>
<li>比如:纳税人注销流程,一个纳税人只能发起一次注销,就要配置纳税人字段,让其不能重复。</li>
</ul>
</div>
<input type="text" class="input" id="TB_ColNotExit_Fields">
</fieldset>
<!--<fieldset>
<legend>
<br />
<input type="radio" name="RB_SDTOfFlowRole" id="RB_SQL">
<label for="RB_SQL">
按SQL规则
</label>
<br />
<br />
</legend>
&nbsp;&nbsp;
<span>规则模式:</span>
<br>
<select name="规则模式" id="DDL_SQL">
<option value="0">设置的SQL数据为空或者返回结果为零时可以启动</option>
<option value="1">设置的SQL数据为空或者返回结果为零时不可以启动</option>
</select>
<br>
<a href="javascript:ShowHidden('Div2')">SQL规则参数:</a>
<br>
<div id="Div2" style="display: none; color: Gray">
<ul>
<li>例如SELECT COUNT(*) AS Num FROM TABLE1 WHERE NAME='@MyFieldName'</li>
<li>解释编写一个sql语句返回一行一列如果信息是0就是可以启动非0就不可以启动。</li>
<li>该参数支持ccbpm的表达式。比如:@WebUser.No,@WebUser.Name,@WebUser.FK_Dept,@WebUser.OrgNo</li>
</ul>
</div>
<textarea class="input" id="TB_SQL" name="TB_SQL" rows="3" style="height: 45px;"></textarea>
</fieldset>-->
<fieldset>
<legend><a href="javascript:ShowHidden('msgAlert')">限制提示信息:</a></legend>
<div id="msgAlert" style="display: none; color: Gray">
<ul>
<li>例如:您的发起的流程违反了xxx限制规则不能发起该流程。</li>
<li>当限制规则起作用的时候,应该提示给用户什么信息。</li>
<li>该信息在创建工作失败的时候提示。</li>
</ul>
</div>
<br>
<input type="text" class="input" id="TB_Alert">
</fieldset>
<fieldset>
<legend>帮助</legend>
<ul>
<li>流程实例表 WF_GenerWorkFlow 的 SDTOfFlow 的字段是用于标识该流程的实例应该(计划)在什么时间完成。</li>
<li>该功能用于设置一个流程的应用完成日期,设置到 WF_GenerWorkFlow 的SDTOfFlow 的字段里。</li>
<li>整体流程的应完成日期也可以称为他的计划完成日期。</li>
<li>
如果要更改该计划完成日期可以调用事件UPDATE WF_GenerWorkFlow SET SDTOfFlow=(SELECT MYFILE FROM XXX
WHERE OID=@WorkID ) WHERE WorkID=@WorkID
</li>
</ul>
</fieldset>
<div id="Msg">
</div>
</body>
</html>