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.

216 lines
7.9 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 language="JavaScript" src="../../../Comm/JScript.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>
<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">
//页面启动函数.
$(function () {
$("#Msg").html("");
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
var data = handler.DoMethodReturnString("AutoFullDtlField_Init");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
data = JSON.parse(data);
var dtls = data["Dtls"];
var mapExt = data['Sys_MapExt'];
var mianAttrs = data["main_Attr"];
var mapExt = mapExt[0];
// 根据这个格式对下拉框设置默认值. "ND101Dtl1.JinE.Sum";
var doc = mapExt.Doc;
var docs = doc.split('\.');
if (doc == "") {
document.getElementById("Btn_Delete").disabled = true;
}
var selectID = docs[0];
var field = docs[1];
var jsfs = docs[2];
GenerBindDDL("DDL_Dtl", dtls, "No", "Name", selectID);
GenerBindDDL("DDL_Fileds", mianAttrs, "No", "Name", mapExt.Tag4);
$("#DDL_Dtl").on("change", function () {
GenerBindDDL("DDL_Field", data[$(this).val()], "No", "Name");
});
if (typeof data[selectID] != "undefined") {
GenerBindDDL("DDL_Field", data[selectID], "No", "Name", field);
} else {
GenerBindDDL("DDL_Field", data[dtls[0].No], "No", "Name", field);
}
//设置计算方式.
$("#DDL_JSFS").val(jsfs);
var tag = mapExt.Tag;
if (tag == "1")
$("#CB_Tag").attr("checked", 'true');
var tag3 = mapExt.Tag3;
if (tag3 == "1")
$("#CB_Tag3").attr("checked", 'true');
$("#TB_Tag1").val(mapExt.Tag1);
$("#TB_Tag2").val(mapExt.Tag2);
$("#Msg").html("");
return;
});
function Save() {
$("#Msg").html("正在保存,请稍后......");
if ($("#CB_Tag").attr("checked") == "checked") {
if ($("#TB_Tag1").val == "" || $("#TB_Tag2").val == "") {
alert("函数名和备注不能为空");
return false;
}
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
handler.AddFormData();
var data = handler.DoMethodReturnString("AutoFullDtlField_Save");
if (data.indexOf('err@') != -1) {
$("#Msg").html("<font color=red>" + data + "</font>");
return;
}
document.getElementById("Btn_Delete").disabled = false;
$("#Msg").html("<font color=green>" + data + "</font>");
return;
}
function Delete() {
if (window.confirm('您确定要删除吗?') == false)
return false;
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
var data = handler.DoMethodReturnString("AutoFullDtlField_Delete");
alert(data);
Reload();
return;
}
</script>
</head>
<body>
<form id="cc">
<div style="right:10px; position:absolute; z-index:100; top:-3px">
<input type="button" value="保存" onclick="Save()" id="Btn_Save" />
<input type="button" value="删除" onclick="Delete()" id="Btn_Delete" />
</div>
<table id="table" style="width: 100%;">
<caption>
对从表数值列自动计算
<a href="javascript:ShowHidden('sqlexp')"><img src="../../../Img/Btn/Help.gif" />帮助:</a>
</caption>
<tr>
<td colspan="3" style="width: 100%;">
选择从表:<select id="DDL_Dtl" name="DDL_Dtl"></select>
选择列:<select id="DDL_Field" name="DDL_Field"></select>
选择计算方式:<select id="DDL_JSFS" name="DDL_JSFS">
<option value="Sum">求和</option>
<option value="Avg">求平均</option>
<option value="Max">求最大</option>
<option value="Min">求最小</option>
</select>
</td>
</tr>
<tr>
<td colspan="3">
<label>
<input type="checkbox" id="CB_Tag" name="CB_Tag" />
计算后要触发的脚本函数(比如:求和以后要激活的function),该脚本要求写入到:\DataUser\JSLab\MyFromID_Self.js
</label>
</td>
</tr>
<tr>
<td>函数名称 </td>
<td>
<input type="text" id="TB_Tag1" name="TB_Tag1" style="width:99%" />
</td>
<td>比如: MyFunc() </td>
</tr>
<tr>
<td>备注 </td>
<td>
<input type="text" id="TB_Tag2" name="TB_Tag2" style="width:99%" />
</td>
<td>对该函数的说明</td>
</tr>
<tr>
<td colspan="1">
<label>
<input type="checkbox" id="CB_Tag3" name="CB_Tag3" />
对其它<font color="red">只读</font>string字段进行大写转换
</label>
</td>
<td colspan="2"> 字段名:<select id="DDL_Fileds" name="DDL_Fileds" /> </td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td colspan="3">
<div id='sqlexp' style='color: Gray; display: none'>
<ul>
<li>1.对从表的里,进行求和,求平均计算。 </li>
<li>2.当从表的对应列发生变化的时候,就调用这个规则把数据数据存储到主表里去。</li>
<li>3.比如:在报销表单里,费用合计是对从表的小计列求和。</li>
<li>4.配置信息存储格式为:Sys_MapExt的Doc 字段 ND101Dtl1.XiaoJi.Sum </li>
<li>
<a href="javascript:WinOpen('./Img/AutoFullDtlField.png');"> <img src='./Img/AutoFullDtlField.png' alt="yangshi" /></a>
</li>
</ul>
</div>
</td>
</tr>
</table>
<div id="Msg">
</div>
</form>
</body>
</html>