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.
454 lines
18 KiB
Plaintext
454 lines
18 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>
|
|
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
|
|
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
|
|
<link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
|
|
<!-- 引用通用的js文件. -->
|
|
<script type="text/javascript" src="../../Scripts/config.js"></script>
|
|
<script type="text/javascript" src="../../Comm/Gener.js"></script>
|
|
<script src="../../Scripts/layui/LayuiDialog.js"></script>
|
|
<script src="/WF/Scripts/config.js"></script>
|
|
<script type="text/javascript" src="../../Scripts/layui/layui/layui.js"></script>
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
var entityType = 0;
|
|
//页面启动函数.
|
|
$(function () {
|
|
|
|
$("#Msg").html("<img src=../../Img/loading.gif /> 正在加载,请稍后......");
|
|
|
|
var frmType = GetQueryString("FrmType");
|
|
if (frmType == null || frmType == "")
|
|
frmType = 0;
|
|
|
|
//实体类型.
|
|
entityType = GetQueryString("EntityType");
|
|
if (entityType == null || entityType == undefined)
|
|
entityType = 0;
|
|
|
|
//if (entityType == 1 || entityType == 2) {
|
|
//var option2 = document.createElement("option");
|
|
//$(option2).val('8');
|
|
//$(option2).text('开发者表单');
|
|
//$('#DDL_FrmType').append(option2);
|
|
|
|
|
|
////先创建好select里面的option元素
|
|
//var option = document.createElement("option");
|
|
//$(option).val('0');
|
|
//$(option).text('傻瓜表单');
|
|
//$('#DDL_FrmType').append(option);
|
|
|
|
//var option1 = document.createElement("option");
|
|
//$(option1).val('1');
|
|
//$(option1).text('自由表单');
|
|
//$('#DDL_FrmType').append(option1);
|
|
|
|
//$("#DDL_FrmType").it;
|
|
// }
|
|
|
|
var webUser = new WebUser();
|
|
|
|
var dd = webUser.CCBPMRunModel;
|
|
|
|
//创建表单类型.
|
|
if (entityType == 0 && webUser.CCBPMRunModel != 2) {
|
|
// GenerBindEnumKey("DDL_FrmType", "FrmType", frmType);
|
|
}
|
|
|
|
var caption = "";
|
|
var caption = document.getElementById('Table').createCaption();
|
|
|
|
if (entityType == 1) {
|
|
caption.innerHTML = "创建单据: 比如:请假单、出库单、入库单、带有流水性质的数据.";
|
|
}
|
|
|
|
if (entityType == 2) {
|
|
caption.innerHTML = "创建实体台账: 比如:学生台账、供应商、销售网点等,具有编号名称类型的数据.";
|
|
}
|
|
|
|
//创建数据源.
|
|
// GenerBindEntities("DDL_DBSrc", "BP.Sys.SFDBSrcs", "local");
|
|
// var sort = GetQueryString("FK_FrmSort");
|
|
// $("#HD_FK_FormTree").val(sort);
|
|
//创建表单树.
|
|
// GenerBindEntities("DDL_FrmTree", "BP.WF.Template.SysFormTrees", sort);
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_CCFormDesigner");
|
|
var data = handler.DoMethodReturnString("NewFrmGuide_Init");
|
|
$("#Msg").html("");
|
|
|
|
if (data.indexOf('err@') >= 0) {
|
|
$("#Msg").html("<font color=red>" + data + "</font>");
|
|
return;
|
|
}
|
|
|
|
data = JSON.parse(data);
|
|
|
|
var tables = data["Tables"];
|
|
for (var i = 0; i < tables.length; i++) {
|
|
|
|
}
|
|
GenerBindDDL("DDL_PTable", tables, "No", "Name", null);
|
|
return;
|
|
|
|
});
|
|
|
|
function FrmTypeChange() {
|
|
|
|
var frmType = $("#DDL_FrmType").val();
|
|
|
|
$("#DDL_PTableModel").show();
|
|
$("#Idx_6").show();
|
|
$("#Idx_8").show();
|
|
$("#idx_td_7").html("7");
|
|
$("#OtherTd").html("9");
|
|
|
|
document.getElementById("PTableName").innerHTML = "存储表";
|
|
document.getElementById("PTableDesc").innerHTML = "数据要存储到那个表里?<br>默认与表单编号一致,指定的表名,必须是下划线或者字母开头,不能包含特殊字符,否则创建表失败。";
|
|
|
|
if (frmType == "7") {
|
|
document.getElementById("PTableName").innerHTML = "请输入实体类名";
|
|
document.getElementById("PTableDesc").innerHTML = "该实体必须是以BP.开头的并且从实体BP.En.Entities上继承下来的. <br>比如:BP.Demo.Resumes";
|
|
$("#Idx_6").hide();
|
|
$("#Idx_8").hide();
|
|
$("#idx_td_7").html("6");
|
|
$("#OtherTd").html("7");
|
|
}
|
|
|
|
if (frmType == "3") {
|
|
document.getElementById("PTableName").innerHTML = "请输入URL";
|
|
document.getElementById("PTableDesc").innerHTML = "请输入嵌入式表单的URL.";
|
|
$("#Idx_6").hide();
|
|
$("#Idx_8").hide();
|
|
$("#idx_td_7").html("6");
|
|
$("#OtherTd").html("7");
|
|
|
|
//隐藏TR
|
|
}
|
|
}
|
|
|
|
//选择一个表.
|
|
function DDL_PTable_Change(ddl) {
|
|
var aa = document.getElementById(ddl);
|
|
document.getElementById("TB_PTable").value = aa.value;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form id="cc">
|
|
<table style="width: 95%;" id="Table">
|
|
<caption>
|
|
创建独立表单
|
|
</caption>
|
|
<tr>
|
|
<td class="Idx">
|
|
1
|
|
</td>
|
|
<td>
|
|
创建的表单类型
|
|
</td>
|
|
<td>
|
|
|
|
<select name="DDL_FrmType" id="DDL_FrmType" onchange="FrmTypeChange()">
|
|
<option value=null disabled='disabled'>+驰骋ccform内置表单</option>
|
|
<option value=0> 傻瓜表单</option>
|
|
<option value=8> 开发者表单</option>
|
|
<option value=1 disabled='disabled'> 自由表单(暂停支持)</option>
|
|
<option value=10> 章节表单</option>
|
|
<option value=null>+文件(插件)表单(部分支持)</option>
|
|
|
|
<option value=9> Wps表单</option>
|
|
<!--<option value=5 disabled='disabled'> 在线编辑模式Excel表单(暂停支持)</option>-->
|
|
<option value=6> VSTO模式Excel表单</option>
|
|
<option value=19> VSTO模式Word表单</option>
|
|
|
|
<option value=null disabled='disabled'>+其他表单</option>
|
|
<option value=3> 嵌入式表单</option>
|
|
<option value=7> 实体类组件</option>
|
|
|
|
</select>
|
|
|
|
<!--<select name="DDL_FrmType" id="DDL_FrmType" onchange="FrmTypeChange()" />-->
|
|
|
|
</td>
|
|
<td>
|
|
根据自己的业务场景需要选择相应的表单类型.
|
|
</td>
|
|
</tr>
|
|
<!--
|
|
<tr>
|
|
<td class="Idx" > 2 </td>
|
|
<td > 数据源类型</td>
|
|
<td> <select name="DDL_DBSrc" id="DDL_DBSrc" /> </td>
|
|
<td>该表单要创建到那个数据源上?</td>
|
|
</tr>
|
|
-->
|
|
<!--
|
|
<tr>
|
|
<td class="Idx" > 3 </td>
|
|
<td > 节点位置</td>
|
|
<td> <select name="DDL_FrmTree" id="DDL_FrmTree" /> </td>
|
|
<td>保存到表单树的位置。</td>
|
|
</tr>-->
|
|
<tr>
|
|
<td class="Idx">
|
|
4
|
|
</td>
|
|
<td>
|
|
表单名称
|
|
</td>
|
|
<td>
|
|
<input type="text" id="TB_Name" name="TB_Name" onblur="GenerPinYin()" style="width: 100%;" />
|
|
</td>
|
|
<td>
|
|
表单的名称,允许重复,允许多个表单映射到一张表上。
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="Idx">
|
|
5
|
|
</td>
|
|
<td>
|
|
表单编号(必须是字母或者下划线组合)
|
|
</td>
|
|
<td>
|
|
<input type="text" id="TB_No" name="TB_No" style="width: 100%;" />
|
|
</td>
|
|
<td>
|
|
<input id="RB_ZZMM_0" type="radio" name="RB_ZZMM" value="0" checked="true" onclick="GenerPinYin()" /><label for="RB_ZZMM_0" onclick="GenerPinYin()">全拼</label>
|
|
<input id="RB_ZZMM_1" type="radio" name="RB_ZZMM" value="1" onclick="GenerPinYin()" /><label for="RB_ZZMM_1" onclick="GenerPinYin()">简拼</label>
|
|
</td>
|
|
</tr>
|
|
<tr id="Idx_6">
|
|
<td class="Idx">
|
|
6
|
|
</td>
|
|
<td>
|
|
<div>
|
|
数据表存储类型
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<select id="DDL_PTableModel" name="DDL_PTableModel">
|
|
<option value="0">自定存储表 </option>
|
|
<option value="1">从数据库中指定,可以修改数据库结构。 </option>
|
|
<option value="2">从数据库中指定,不允许修改数据库结构。 </option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
确定后,不允许修改。
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="Idx_7">
|
|
<td class="Idx" id="idx_td_7">
|
|
7
|
|
</td>
|
|
<td>
|
|
<div id="PTableName">
|
|
自定义存储表
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<input type="text" id="TB_PTable" name="TB_PTable" style="width: 100%;" />
|
|
</td>
|
|
<td>
|
|
<div id="PTableDesc">
|
|
数据要存储到那个表里?
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="Idx_8">
|
|
<td class="Idx">
|
|
8
|
|
</td>
|
|
<td>
|
|
<div id="Div1">
|
|
本机已存在的表
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<select id="DDL_PTable" name="DDL_PTable" onchange="DDL_PTable_Change(this.id)">
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<div id="Div2">
|
|
请选择系统存在的表,对后两项有效?
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="Idx" id="OtherTd">
|
|
9
|
|
</td>
|
|
<td>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="button" value="创建 - Create" onclick="Save()" id="Btn_Save" />
|
|
<script type="text/javascript">
|
|
|
|
function GenerPinYin() {
|
|
|
|
//是否是全拼.
|
|
var isQuanPin = 0;
|
|
if (document.getElementById("RB_ZZMM_0").checked == true)
|
|
isQuanPin = 1;
|
|
|
|
// var name = $('#TB_Nam').val();
|
|
var name = document.getElementById("TB_Name").value;
|
|
if (name == "")
|
|
return;
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_CCFormDesigner");
|
|
handler.AddPara("IsQuanPin", isQuanPin);
|
|
handler.AddPara("EntityType", entityType);
|
|
handler.AddPara("TB_Name", encodeURIComponent(name));
|
|
var data = handler.DoMethodReturnString("NewFrmGuide_GenerPinYin");
|
|
|
|
$("#Msg").html("");
|
|
|
|
if (data.indexOf('err@') >= 0) {
|
|
$("#Msg").html("<font color=red>" + data + "</font>");
|
|
return;
|
|
}
|
|
|
|
var key = "CCFrm_" + data;
|
|
|
|
var frmType = $("#DDL_FrmType").val();
|
|
if (frmType != "3" && frmType != "7") {
|
|
|
|
if (entityType == 0)
|
|
key = "Frm_" + data;
|
|
|
|
if (entityType == 1)
|
|
key = "Bill_" + data;
|
|
|
|
if (entityType == 2)
|
|
key = "Dict_" + data;
|
|
}
|
|
|
|
$('#TB_No').val(key);
|
|
$('#TB_PTable').val(key);
|
|
return;
|
|
}
|
|
|
|
function Save() {
|
|
|
|
$("#Msg").html("正在创建,请稍后......");
|
|
|
|
var name = document.getElementById("TB_Name").value;
|
|
var no = document.getElementById("TB_No").value;
|
|
var pTable = document.getElementById("TB_PTable").value;
|
|
|
|
if (name == "" || no == "" || pTable == "") {
|
|
$("#Msg").html("");
|
|
alert('@请输入必填的字段.');
|
|
return;
|
|
}
|
|
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_CCFormDesigner");
|
|
handler.AddFormData();
|
|
handler.AddUrlData();
|
|
var data = handler.DoMethodReturnString("NewFrmGuide_Create");
|
|
|
|
if (data.indexOf('err@') >= 0) {
|
|
$("#Msg").html("<font color=red>" + data + "</font>");
|
|
return;
|
|
}
|
|
$("#Msg").html("<font color=green>" + data + "</font>");
|
|
data = data.replace('url@', '');
|
|
|
|
try {
|
|
//表单库增加表单节点
|
|
if (typeof window.parent.AppendFrmToFormTree != "undefined") {
|
|
// var sort = $("#HD_FK_FormTree").val();
|
|
var sort = GetQueryString("FK_FrmSort");
|
|
var webUser = new WebUser()
|
|
if (webUser.CCBPMRunModel == 2)
|
|
no = no + "_" + webUser.OrgNo;
|
|
window.parent.AppendFrmToFormTree(sort, no, name);
|
|
}
|
|
|
|
if (typeof window.parent.TabCloseByTitle != "undefined") {
|
|
//需要延时关闭,不可立即关闭。
|
|
setTimeout("window.parent.TabCloseByTitle('新建表单')", 1000);
|
|
}
|
|
} catch (e) {
|
|
|
|
}
|
|
|
|
//切换页面
|
|
SetHref(data);
|
|
if (window.parent && window.parent.layer)
|
|
window.parent.layer.close(window.parent.layer.index);
|
|
WinOpenFull(data);
|
|
//debugger;
|
|
//var W = document.body.clientWidth - 80;
|
|
////var url = basePath + data;
|
|
//var url = basePath + "/WF/Admin" + data.slice(2);
|
|
|
|
//window.location.href = url
|
|
////OpenLayuiDialog(url, '', W, 100, "r", false);
|
|
return;
|
|
}
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div id="Msg">
|
|
</div>
|
|
<input type="hidden" id="HD_FK_FormTree" name="HD_FK_FormTree" />
|
|
<!--
|
|
<fieldset>
|
|
<legend> 帮助</legend>
|
|
|
|
1. 如果普通类型的字段:身高(float),年龄(int),地址(string),电话(string),就不用配置。
|
|
2. 金额类型 费用@DType=Money
|
|
3, 枚举类型. 性别@0=女@1=男
|
|
4, 外键类型. 岗位@Table=Port_Station@No=BianHao@Name=MingCheng
|
|
5, Boolen. 是否符合要求@DType=Boolen
|
|
6. 日期类型: 出生日期@DType=Date 2017-11-12
|
|
7. 日期时间类型: 发生时间@DType=DateTime 2017-11-12 12:01
|
|
4, 外键扩展类型. 人员$SELECT No,Name from mytable where xxx='@WebUser.FK_Dept' and myfiel='@MainTableField'
|
|
|
|
|
|
自由表单的数据存储格式:
|
|
|
|
<br />
|
|
枚举值:
|
|
性别@XB;@0=女@1=男
|
|
<br />
|
|
|
|
外键:
|
|
岗位@Table=Port_Station@No=BianHao@Name=MingCheng
|
|
<br />
|
|
|
|
|
|
日期:
|
|
出生日期@DType=Date
|
|
|
|
<br />
|
|
|
|
日期时间:
|
|
发生时间@DType=DateTime
|
|
|
|
<br />
|
|
|
|
金额:
|
|
费用@DType=Money
|
|
|
|
<br />
|
|
|
|
Boolen类型:
|
|
是否符合要求@DType=Boolen
|
|
|
|
</fieldset>-->
|
|
</form>
|
|
</body>
|
|
</html>
|