|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<title>流程应用</title>
|
|
|
|
|
<meta name="renderer" content="webkit" />
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
|
|
|
|
<script src="../../WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
|
|
|
|
|
<!--layui-->
|
|
|
|
|
<link href="../../WF/Scripts/layui/layui/css/modules/layer/default/layer.css" rel="stylesheet" />
|
|
|
|
|
<link href="../../WF/Scripts/layui/layui/css/layui.css" rel="stylesheet" />
|
|
|
|
|
<script src="../../WF/Scripts/layui/layui/layui.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../WF/Scripts/layui/layui/lay/modules/layer.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
<!--通用的JS-->
|
|
|
|
|
<script src="../../WF/Scripts/config.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../../WF/Scripts/layui/LayuiDialog.js"></script>
|
|
|
|
|
<script src="bar.js"></script>
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
var flowNo = GetQueryString("FK_Flow");
|
|
|
|
|
var pageIdx = 1;
|
|
|
|
|
var pageSize = 10;
|
|
|
|
|
layui.use(['table', 'laytpl', 'form', 'laydate'], function () {
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
// 数据.
|
|
|
|
|
var ens = new Entities("BP.WF.Template.FlowTabs");
|
|
|
|
|
var data = ens.DoMethodReturnString("Default_Init", flowNo);
|
|
|
|
|
if (data.indexOf("err@") != -1) {
|
|
|
|
|
layer.alert(data);
|
|
|
|
|
console.log(data);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
data = JSON.parse(data);
|
|
|
|
|
//获取列
|
|
|
|
|
var cols = GetTableCols(data);
|
|
|
|
|
//渲染table
|
|
|
|
|
//主页面数据
|
|
|
|
|
var vtable = table.render({
|
|
|
|
|
elem: '#lay_table',
|
|
|
|
|
id: 'lay_table',
|
|
|
|
|
data: data["DT"],
|
|
|
|
|
toolbar: '#toolBarDemo', //开启头部工具栏,并为其绑定左侧模板
|
|
|
|
|
defaultToolbar: ['filter'],
|
|
|
|
|
title: '数据表',
|
|
|
|
|
height: $(document).height()- $("#toolbar").height() - 130,
|
|
|
|
|
cellMinWidth: 120,
|
|
|
|
|
size: 'lg',
|
|
|
|
|
cols: [cols],
|
|
|
|
|
page: false,
|
|
|
|
|
limits: [5, 10, 15, 20, 25]
|
|
|
|
|
});
|
|
|
|
|
// renderLaypage(data["DT"].length);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置显示的列
|
|
|
|
|
* @return Cols的集合
|
|
|
|
|
*/
|
|
|
|
|
function GetTableCols(data) {
|
|
|
|
|
var columns = new Array();;
|
|
|
|
|
//系统字段
|
|
|
|
|
var mapAttrOfSys = data["Sys_MapAttrOfSystem"];
|
|
|
|
|
//流程所有字段
|
|
|
|
|
var mapAttrOfAll = data["Sys_MapAttr"];
|
|
|
|
|
|
|
|
|
|
//表单字段
|
|
|
|
|
var mapAttrOfFrm = $.grep(mapAttrOfAll, function (item) {
|
|
|
|
|
if (item.UIContralType != 0 && item.UIContralType != 1 && item.UIContralType != 2 && item.UIContralType != 3)
|
|
|
|
|
return true;
|
|
|
|
|
if (sysFiels.indexOf("," + item.KeyOfEn + ",") != -1)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
|
|
//用户选择显示的字段
|
|
|
|
|
var selectFields = "";
|
|
|
|
|
//生成表格的Cols数组
|
|
|
|
|
columns.push({
|
|
|
|
|
title: '序',
|
|
|
|
|
field: '',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 50,
|
|
|
|
|
templet: function (d) {
|
|
|
|
|
return d.LAY_INDEX;//pageSize * (pageIdx - 1) + d.LAY_TABLE_INDEX + 1; // 返回每条的序号: 每页条数 *(当前页 - 1 )+ 序号
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
var keyOfEn = "";
|
|
|
|
|
for (var i = 0; i < mapAttrOfSys.length; i++) {
|
|
|
|
|
keyOfEn = mapAttrOfSys[i].KeyOfEn;
|
|
|
|
|
if (keyOfEn == "WFState")
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
columns.push(GenerColumn(mapAttrOfSys[i], false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < mapAttrOfFrm.length; i++) {
|
|
|
|
|
keyOfEn = mapAttrOfFrm[i].KeyOfEn;
|
|
|
|
|
if (selectFields.indexOf("," + keyOfEn + ",") != -1 || selectFields.indexOf("," + keyOfEn + "T" + ",") != -1 || selectFields.indexOf("," + keyOfEn + "Text" + ",") != -1)
|
|
|
|
|
columns.push(GenerColumn(mapAttrOfFrm[i], false));
|
|
|
|
|
else
|
|
|
|
|
columns.push(GenerColumn(mapAttrOfFrm[i], true));
|
|
|
|
|
}
|
|
|
|
|
//流程状态
|
|
|
|
|
columns.push({
|
|
|
|
|
field: "WFState",
|
|
|
|
|
title: "状态",
|
|
|
|
|
minWidth: "100",
|
|
|
|
|
sort: true,
|
|
|
|
|
templet: function (data) {
|
|
|
|
|
return data["WFStateText"];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return columns;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 根据字段属性生成列属性
|
|
|
|
|
* @param attr
|
|
|
|
|
*/
|
|
|
|
|
function GenerColumn(attr, isHide) {
|
|
|
|
|
var field = attr.KeyOfEn;
|
|
|
|
|
var title = attr.Name;
|
|
|
|
|
var width = attr.Width;
|
|
|
|
|
|
|
|
|
|
if (field == "Title") {
|
|
|
|
|
width = 230;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (attr.UIContralType == 1) {
|
|
|
|
|
if (width == null || width == "" || width == undefined)
|
|
|
|
|
width = 180;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
field: field, //字段名
|
|
|
|
|
title: title, //标题名称
|
|
|
|
|
minWidth: width, //宽度
|
|
|
|
|
hide: isHide, //是否隐藏
|
|
|
|
|
sort: true,
|
|
|
|
|
templet: function (data) {
|
|
|
|
|
var val = data[this.field + "Text"];
|
|
|
|
|
if (val == null && val == undefined)
|
|
|
|
|
val = data[this.field + "T"];
|
|
|
|
|
if (val == null && val == undefined)
|
|
|
|
|
val = data[this.field];
|
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (attr.UIContralType == 2) {
|
|
|
|
|
if (width == null || width == "" || width == undefined) {
|
|
|
|
|
width = 60;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
field: field,
|
|
|
|
|
title: title,
|
|
|
|
|
minWidth: width,
|
|
|
|
|
hide: isHide, //是否隐藏
|
|
|
|
|
sort: true,
|
|
|
|
|
templet: function (data) {
|
|
|
|
|
if (data[this.field] == "0") return "否";
|
|
|
|
|
if (data[this.field] == "1") return "是";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (width == null || width == "" || width == undefined)
|
|
|
|
|
width = 100;
|
|
|
|
|
if (field == "FlowStartRDT")
|
|
|
|
|
width = 160;
|
|
|
|
|
return {
|
|
|
|
|
field: field,
|
|
|
|
|
title: title,
|
|
|
|
|
minWidth: width,
|
|
|
|
|
hide: isHide, //是否隐藏
|
|
|
|
|
sort: true,
|
|
|
|
|
templet: function (data) {
|
|
|
|
|
if (this.field == "Title") {
|
|
|
|
|
return "<a style='color:#1e9fff' href='javaScript:void(0)' onclick='OpenForm(\"" + GetQueryString("FK_Flow") + "\"," + data.FlowEndNode + "," + data.OID + "," + data.FID + ")'>" + data[this.field] + "</a>";
|
|
|
|
|
}
|
|
|
|
|
return data[this.field];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.toolber a {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div class="layui-header" id="toolbar"></div>
|
|
|
|
|
<div class="layui-fluid">
|
|
|
|
|
<div class="layui-row layui-col-space15">
|
|
|
|
|
<!-- 内容主体区域 -->
|
|
|
|
|
<div class="layui-col-md12">
|
|
|
|
|
<div class="layui-card">
|
|
|
|
|
<div class="layui-card-body">
|
|
|
|
|
<table class="layui-hide" id="lay_table" lay-filter="default"></table>
|
|
|
|
|
<div id="page"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
</html>
|