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.

149 lines
5.8 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!--标准mui.css-->
<link href="../../js/mui/css/mui.min.css" rel="stylesheet" type="text/css" />
<link href="../../js/mui/css/mui.picker.min.css" rel="stylesheet" type="text/css" />
<link href="../../js/mui/css/mui.dtpicker.css" rel="stylesheet" />
<link href="../../js/mui/css/mui.indexedlist.css" rel="stylesheet" type="text/css" />
<script src="../../js/jquery.js" type="text/javascript"></script>
<script src="../../js/mui/js/mui.min.js" type="text/javascript"></script>
<script src="../../js/mui/js/mui.view.js" type="text/javascript"></script>
<script src="../../js/mui/js/mui.picker.min.js" type="text/javascript"></script>
<script src="../../js/mui/js/mui.dtpicker.js"></script>
<!-- 引入通用基础JS -->
<script src="../../Scripts/config.js" type="text/javascript"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script src="../../Comm/Gener.js" type="text/javascript"></script>
<script src="../../Scripts/commonYangYH.js" type="text/javascript"></script>
<script src="../../Comm/JScript.js" type="text/javascript"></script>
<script src="Dtl.js" type="text/javascript"></script>
<style type="text/css">
input[type=color], input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], select, textarea {
padding: 5px 10px !important;
}
.mui-input-row label {
padding: 5px 15px !important;
}
.mui-content > .mui-card:first-child {
margin-top: -15px !important;
}
</style>
<script type="text/javascript">
var mapData = null;//从表对应类的属性
var frmData = null;
var newRowIdx = -1;//新增行数
var ensName = GetQueryString("EnsName");
var enName = ensName.substring(0, ensName.length - 1);
$(function () {
InitPage("dtlSearch");
//初始工具栏.
InitToolbar();
$("#headTitle").html(mapData.Name);
});
function InitPage() {
newRowIdx = -1;
//初始化标题和表单数据
var httpHandler = new HttpHandler("BP.WF.HttpHandler.WF_CommEntity");
httpHandler.AddUrlData(); //增加参数属性.
var data = httpHandler.DoMethodReturnString("Dtl_Init");
if (data.indexOf('err@') == 0) {
mui.alert(data);
return;
}
frmData = JSON.parse(data);
mapData = frmData["Sys_MapData"][0];
mapData = new Entity("BP.Sys.MapData", mapData); //把他转化成entity.
//绑定数据.
BindDtls();
//删除事件
$(".dtl_deleterow").on("click", function () {
var target = $(this);
var oid = target.attr("id");
Delete(oid);
});
}
function BindDtls() {
var mapAttrs = frmData.Sys_MapAttr; //从表字段属性
var dtls = frmData.Dtls;//从表数据
var _Html = "";
//判断是否有数据
if (dtls.length == 0) {
_Html = "<div class='mui-indexed-list-inner empty'>";
_Html += " <div class='mui-indexed-list-empty-alert'>没有数据</div>";
_Html += "</div>";
$('#DtlContent').append(_Html);
return;
}
//加载表单元素\数据
var dtl_Idx = 1;
for (var j = 0; j < dtls.length; j++) {
_Html += "<ul class='mui-table-view'>";
_Html += " <li class='mui-table-view-divider'>序号:" + dtl_Idx;
if (mapData.GetPara("IsDelete") == "1") {
_Html += " <div style='float: right;margin-right: 20px;' class='dtl_deleterow' id='" + dtls[j].OID + "'>删除</div>";
}
_Html += " </li>";
_Html += ShowDtlByMapAttr(mapAttrs, dtls[j]);
_Html += "</ul>";
dtl_Idx++;
}
$('#DtlContent').html("").append(_Html);
}
/**
* 删除
* @param pkval
*/
function Delete(pkval) {
if (window.confirm('您确定要删除吗?') == false)
return;
//执行删除.
var en = new Entity(enName);
en.SetPKVal(pkval);
en.Delete();
var div = $("#" + pkval).parent().parent();
if (div.hasClass("mui-table-view") == true)
div.remove();
}
//新增
function NewEn() {
window.location.href = "./En.htm?EnName=" + enName + "&PKVal=&RefPK=" + GetQueryString("RefPK") + "&RefPKVal=" + GetQueryString("RefVal");
}
</script>
</head>
<body>
<form id="cc" class="mui-input-group">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title" id="headTitle">基础信息</h1>
</header>
<div class="mui-content">
<div class="mui-card" id="DtlContent">
</div>
</div>
<nav id="bottomToolBar" class="mui-bar mui-bar-tab"></nav>
</form>
</body>
</html>