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.
257 lines
9.7 KiB
Plaintext
257 lines
9.7 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 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;
|
|
|
|
//先创建好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);
|
|
|
|
var option2 = document.createElement("option");
|
|
$(option2).val('8');
|
|
$(option2).text('开发者表单');
|
|
$('#DDL_FrmType').append(option2);
|
|
|
|
var caption = "";
|
|
var caption = document.getElementById('Table').createCaption();
|
|
|
|
if (entityType == 1) {
|
|
caption.innerHTML = "创建单据: 比如:请假单、出库单、入库单、带有流水性质的数据.";
|
|
}
|
|
|
|
if (entityType == 2) {
|
|
caption.innerHTML = "创建实体台账: 比如:学生台账、供应商、销售网点等,具有编号名称类型的数据.";
|
|
}
|
|
|
|
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;
|
|
}
|
|
return;
|
|
|
|
});
|
|
|
|
|
|
</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" />
|
|
</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_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>
|
|
<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"); // $("#HD_FK_FormTree").val();
|
|
window.parent.AppendFrmToFormTree(sort, no, name);
|
|
}
|
|
|
|
if (typeof window.parent.TabCloseByTitle != "undefined") {
|
|
//需要延时关闭,不可立即关闭。
|
|
setTimeout("window.parent.TabCloseByTitle('新建表单')", 1000);
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
}
|
|
|
|
//切换页面
|
|
SetHref(data);
|
|
return;
|
|
}
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div id="Msg">
|
|
</div>
|
|
<input type="hidden" id="HD_FK_FormTree" name="HD_FK_FormTree" />
|
|
|
|
</form>
|
|
</body>
|
|
</html>
|