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.

305 lines
13 KiB
Plaintext

11 months ago

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>新建流程向导</title>
<link href="/DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<script src="/WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="/WF/Scripts/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>
<script src="/WF/Scripts/config.js" type="text/javascript"></script>
<script src="/WF/Comm/Gener.js" type="text/javascript"></script>
<link rel="stylesheet" href="/App/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/App/layuiadmin/style/admin.css" media="all">
<script src="../layuiadmin/layui/lay/modules/layer.js"></script>
<script src="/WF/Scripts/layui/layui/layui.js" type="text/javascript"></script>
<style>
body, html {
font-family: "SimHei";
height: 95%
}
table {
border: 0px;
}
.layui-form input[type=checkbox], .layui-form input[type=radio], .layui-form select {
display: inline-block;
}
</style>
<script type="text/javascript">
layui.config({
base: '/App/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index']);
var webUser = new WebUser();
$(function () {
$("#FrmTr").hide();
//类别.
var sorts = new Entities("BP.Cloud.Template.FlowSorts");
sorts.RetrieveAll();
GenerBindDDL("DDL_FlowSort", sorts);
$("#DDL_FlowSort option:last").prop("selected", 'selected');
//单据关联的实体台账
var flows = new Entities("BP.Cloud.Template.Flows");
flows.Retrieve("OrgNo", webUser.OrgNo, "WorkModel", 2);
GenerBindDDL("DDL_Frm", flows, "PTable", "Name");
});
///创建类别.
function NewSort() {
var val = promptGener('请输入类别名称', '');
if (val === "") return;
if (val == "") return;
if (val == null || val == undefined)
return;
var webUser = new WebUser();
var en = new Entity("BP.Cloud.Template.FlowSort");
en.Name = val;
en.OrgNo = webUser.OrgNo;
en.Insert();
var ens = new Entities("BP.Cloud.Template.FlowSorts");
ens.RetrieveAll();
//获得最后一个en.
en = ens[ens.length - 1];
//构造一个Option
var option = $("<option />");
option.html(en.Name);
option.val(en.No);
$("#DDL_FlowSort").append(option);
//把他放入到最后.
$("#DDL_FlowSort option:last").prop("selected", 'selected');
}
//新建流程
function Save() {
try {
//$("#msg").html("<img ../../WF/Img/loading.gif /><font color=green><b>正在创建请稍后...</b></font>");
//设置按钮不可用.
$("#Btn_Save").attr("disabled", true);
//var imgId = $('#iconsIfr').contents().find("#docs").contents().find(".selectedenable").attr("id");
//var iconStyle = $('#iconsIfr').contents().find("#docs").contents().find(".select_csstemp").attr("id");
var img = "Star@color_orange";
//layer.msg('正在创建流程请稍后...', { icon: 16, shade: 0.3 });
var flowSort = $("#DDL_FlowSort").val();
var flowName = $("#TB_FlowName").val();
if (flowSort == null || flowSort == undefined || flowSort === "") {
alert("没有指定创建流程所在的分组");
//layer.close(index);
return;
}
if (flowName === "") {
alert("请填写流程名称");
//layer.close(index);
return;
}
var workModel = $("#DDL_WorkModel").val();
if (workModel == 3) {
//是否关联实体表单‘
var dictFrm = $("#DDL_Frm").val();
if (dictFrm == "") {
alert("请先创建实体台账");
return;
}
}
//创建流程
$("#msg").html("<img src='../../WF/Img/loading.gif' /><font color=green size='6px'><b>正在创建请稍后...</b></font>");
var handler = new HttpHandler("BP.Cloud.HttpHandler.App_FlowDesigner");
handler.AddPara("FlowName", flowName);
handler.AddPara("FlowSort", flowSort);
handler.AddPara("FlowMark", "");
handler.AddPara("FlowICON", img);
handler.AddPara("WorkModel", workModel);
handler.AddPara("DictFrm", $("#DDL_Frm").val());
var data = handler.DoMethodReturnString("NewFlow_Save");
if (data.indexOf('err@') == 0) {
layer.alert(data);
console.log(data);
layer.close(index);
return;
}
//打开表单设计器
if (data.indexOf("dict@") == 0 || data.indexOf("bill@") == 0) {
var frmID = data.replace("dict@", "").replace("bill@", "");
if (top.layui.index) {
parent.layui.index.openTabsPage("/WF/Admin/FoolFormDesigner/Designer.htm?FrmID=" + frmID + "&FK_MapData=" + frmID + "&WorkModel=" + workModel, "设计表单:" + flowName);
//关闭当前Tab页
top.layui.element.tabDelete("layadmin-layout-tabs", "/App/FlowDesigner/NewFlow.htm?s1=s" + "&Token=" + GetQueryString("Token") + "&OrgNo=" + GetQueryString("OrgNo") + "&UserNo=" + GetQueryString("UserNo"));
} else {
SetHref( "/WF/Admin/FoolFormDesigner/Designer.htm?FrmID=" + frmID + "&FK_MapData=" + frmID + "&WorkModel=" + workModel);
}
return;
}
//在左侧流程树上增加新建的流程,并选中.
var flowNo = data;
var urlEnd = "&OrgNo" + GetQueryString("OrgNo") + "&Token=" + GetQueryString("Token") + "&UserNo=" + GetQueryString("UserNo");
if (top.layui.index) {
parent.layui.index.openTabsPage("/App/FlowDesigner/Designer.htm?FK_Flow=" + flowNo + "&RunModel=2" + urlEnd, "设计:" + flowName);
//关闭当前Tab页
top.layui.element.tabDelete("layadmin-layout-tabs", "/App/FlowDesigner/NewFlow.htm?s1=s" + "&Token=" + GetQueryString("Token") + "&OrgNo=" + GetQueryString("OrgNo") + "&UserNo=" + GetQueryString("UserNo"));
} else {
SetHref( "Designer.htm?FK_Flow=" + flowNo + "&RunModel=2&1=2" + urlEnd);
}
} catch (e) {
$("#Btn_Save").attr("disabled", false);
$("#msg").html("<font color=red><b>创建失败:" + e + "</b></font>");
}
}
function ChangeState(val) {
if (val != 3) {
$("#FrmTr").hide();
return;
}
$("#FrmTr").show();
}
//从ftp服务器导入模板
function ImpFlowFromFtp() {
var url = "../Template/Flow.htm?SortNo=" + GetQueryString("sort");
SetHref(url);
}
//从本机导入模板
function ImpFlowFromLocal() {
var url = "../Template/Flow.htm?SortNo=" + GetQueryString("sort");
SetHref(url);
}
function ToFlowDir() {
var url = "/WF/Comm/Search.htm?EnsName=BP.Cloud.Template.FlowExts";
var url = "Flows.htm";
SetHref(url);
}
</script>
</head>
<body>
<!--<div style=" padding:10px; padding-left:30px;">
<button onclick="javascript:NewFlow()"><img src="../../../WF/Img/New.gif" style="width:20px;">新建流程</button>
<button onclick="javascript:ImpFlowFromFtp()"><img src="../../../WF/Img/ftp.png" style="width:20px;">从ftp服务器导入模板</button>
<button onclick="javascript:ImpFlowFromLocal()"><img src="../../../WF/Img/dot.png" style="width:20px;">从本机导入模板</button>
</div>-->
<form id="cc" class="layui-form" style="height:100%">
<!--<h3>
<a href="Flows.htm">
<img src="/App/Img/Home.png" style="width:30px;" />流程模版:
</a>
<img src="/App/Img/New.png" style="width:30px;" />创建模版
</h3>-->
<div class="layui-card" style="margin: 30px 30px;height:100%">
<div class="layui-card-body">
<table style="width: 70%;margin:auto;" id="Table">
<tr>
<td style="width:20%; text-align:right; "><font color=red><b>*</b></font><font size="3">模版名称:</font></td>
<td>
<input type="text" id="TB_FlowName" style="width:90%;" />
</td>
</tr>
<tr>
<td nowarp="true" style="width:20%; text-align:right;">
<font size="3">描述:</font>
</td>
<td colspan="1">
<textarea type="text" id="TB_FlowMark" rows="5" style="width:90%;"></textarea>
</td>
</tr>
<tr>
<td style="width:20%; text-align:right;"><font color=red><b>*</b></font><font size="3">类别:</font></td>
<td>
<select id="DDL_FlowSort"></select>
<a href="javascript:NewSort();" id="Btn_NewSort">新建类别</a>
</td>
</tr>
<tr>
<td style="width:20%; text-align:right;"><font color=red><b>*</b></font><font size="3">工作模式:</font></td>
<td>
<select id="DDL_WorkModel" onchange="ChangeState(this.value)">
<option value="0">内部流程</option>
<option value="1">外部流程</option>
<option value="2">实体台账</option>
<option value="3">业务表单,单据</option>
</select>
</td>
</tr>
<tr id="FrmTr">
<td style="width:20%; text-align:right;"><font color=red><b>*</b></font><font size="3">关联的实体表单:</font></td>
<td>
<select id="DDL_Frm"></select>
</td>
</tr>
<!--<tr>
<td style="width:20%; text-align:right;"><font color=red><b>*</b></font><font size="3">选择图标:</font></td>
<td>
<select id="Choose_Icon"></select>
</td>
</tr>-->
<!--<tr>
<td>流程数据表:</td>
<td>
<input type="text" id="TB_PTable" style="width: 200px" />
</td>
<td> <font color="gray"><a href="http://ccbpm.mydoc.io/?v=5404&t=17897" target=_blank> <img src='../../../WF/Img/Help.png' /></a></font></td>
</tr>
<tr>
<td nowarp="true" style="width:20%;">
流程标记:
</td>
<td>
<input type="text" id="TB_FlowMark" style="width: 200px" />
</td>
<td> <a href="http://ccbpm.mydoc.io/?v=5404&t=16847"><img src='../../../WF/Img/Help.png' /></a></td>
</tr>-->
<tr>
<td class="Idx"></td>
<td colspan="1">
<input type="button" value="创建 - Create" onclick="Save()" id="Btn_Save" />
<div id="msg"></div>
</td>
</tr>
</table>
</div>
</div>
</form>
</body>