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.

188 lines
6.5 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>
<link href="../../DataUser/Style/ccbpm.css" rel="Stylesheet" />
<script type="text/javascript" src="../Scripts/QueryString.js"></script>
<script type="text/javascript" src="../Scripts/jquery-1.7.2.min.js"></script>
<!-- 导入配置文件. -->
<script type="text/javascript" src="../Scripts/config.js"></script>
<script src="../Comm/Gener.js" type="text/javascript"></script>
<link href="../Scripts/layui/layui/css/layui.css" rel="stylesheet" />
<script type="text/javascript">
$(function () {
$('Msg').val('正在加载请稍候....');
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddUrlData();
var data = handler.DoMethodReturnString("DBTemplate_Init");
if (data.indexOf('err@') == 0) {
document.getElementById("Msg").innerHTML = data;
return;
}
data = JSON.parse(data);
DBTemplate_Init(data);
//$('Msg').val('');
//document.getElementById("Msg").innerHTML = html;
});
function Start(workid) {
if (window.confirm('您确定要以次模版发起流程吗?') == false)
return;
var url = '../MyFlow.htm?FK_Flow=' + GetQueryString('FK_Flow') + '&CopyFormWorkID=' + workid + '&CopyFormNode=' + GetQueryString('FK_Flow') + '01&IsDeleteDraft=1';
window.parent.location.href = url;
window.close();
}
function DBTemplate_Init(data) {
var dbTemplate = data['DBTemplate'];
var history = data['History'];
var idx = 0;
var html = "<table style='width:90%;'>";
html += "<tr>";
html += "<th colspan=3 >模版数据</th>";
html += "</tr>";
if (dbTemplate.length == 0) {
html += "<tr>";
html += "<td colspan=3>无</th>";
html += "</tr>";
}
for (var i = 0; i < dbTemplate.length; i++) {
var en = dbTemplate[i];
html += "<tr>";
html += "<td>" + i + "</td>";
html += "<td><a href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
html += "<td><a href=\"javascript:DBTemplate_DeleteDBTemplate('" + en.WorkID + "');\" >删除</a></td>";
html += "</tr>";
}
html += "<tr>";
html += "<th colspan=3 >历史数据</th>";
html += "</tr>";
if (history.length == 0) {
html += "<tr>";
html += "<td colspan=3>无</th>";
html += "</tr>";
}
for (var i = 0; i < history.length; i++) {
var en = history[i];
html += "<tr>";
html += "<td>" + i + "</td>";
html += "<td><a href=\"javascript:Start('" + en.WorkID + "');\" >" + en.Title + "</td>";
html += "<td><a href=\"javascript:AddToTemplate('" + en.WorkID + "','" + en.Title + "');\" >设置模版</a></td>";
html += "</tr>";
}
html += "<table>";
document.getElementById("Msg").innerHTML = html;
}
function DBTemplate_DeleteDBTemplate(workid) {
if (window.confirm('您确定要删除吗?') == false)
return;
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddPara("WorkID", workid);
var data = handler.DoMethodReturnString("DBTemplate_DeleteDBTemplate");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
alert(data);
Reload();
}
function AddToTemplate(workid, title) {
var name = promptGener('请输入模版名称', title);
if (name == null || name == '')
return;
name = encodeURI(name);
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddPara("WorkID", workid);
handler.AddPara("Title", name);
var data = handler.DoMethodReturnString("DBTemplate_SaveAsDBTemplate");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
alert(data);
Reload();
}
//关键字查询模板的Title
function SearchTemplate() {
var searchKey = $("#searchKey").val();
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddPara("SeachType", "1");
handler.AddPara("SearchKey", searchKey);
handler.AddPara("WorkID", GetQueryString("WorkID"));
handler.AddPara("FK_Flow", GetQueryString("FK_Flow"));
var data = handler.DoMethodReturnString("DBTemplate_Init");
data = JSON.parse(data);
DBTemplate_Init(data);
}
</script>
<style type="text/css">
#tb_msg {
height: 72px;
width: 272px;
}
.cc-btn-tab {
height: 30px;
padding: 0 10px;
margin-right: auto;
margin-left: 10px;
line-height: 30px;
font-size: 12px;
/* background: #316ee6 !important;
border-color: #316ee6 !important;*/
border-radius: 2px;
/*color: #fff !important;*/
}
.left-search {
display: flex;
align-items: center;
width: 90%;
margin: 15px;
}
.search-font {
display: flex;
}
</style>
</head>
<body>
<center>
<div class="left-search">
<li class='search-font'><span style='margin-left: 15px;line-height:31px;'>关键字:</span><div style='width: 190px; border-width: 1px; border-style: solid; background-color: #fff; border-color: #eee; '><input id='searchKey' name='searchKey' type='text' style='margin-left: 5px; height: 30px;border:none;outline:none;' /></div></li>
<li class='cc-btn-tab' id='SearchBtn' onclick="SearchTemplate()">搜索</li>
</div>
<div id="Msg">
<img src='../Img/loading.gif' />正在加载请稍候...
</div>
</div>
</center>
</body>
</html>