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.

269 lines
11 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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>
<meta charset="UTF-8">
<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 str = location.href; //取得整个地址栏
var num = str.indexOf("?");
str = str.substr(num + 1);
//流程编号
var FK_Flow = GetQueryString("FK_Flow");
//工作ID
var WorkID = GetQueryString("WorkID");
//节点编号
var FK_Node = parseInt(GetQueryString("FK_Flow") + "01");
//前置导航的模式
var StartGuideWay = GetQueryString("StartGuideWay");
$(function () {
//执行查询.
var handler = new HttpHandler("BP.WF.HttpHandler.WF_MyFlow");
handler.AddUrlData();
var data = handler.DoMethodReturnJSON("StartGuide_Init");
//显示数据.
StartGuide_Init(data);
var fl = new Entity("BP.WF.Flow", FK_Flow);
var html = "<a href=\"javascript:WinOpen('" + fl.StartGuideLink + "')\" >" + fl.StartGuideLab + "</a>";
$("#leftBar").html(html);
});
document.onkeydown = function (e) { // 回车提交表单
// 兼容FF和IE和Opera
var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
KeyOfSearch();
return false;
}
}
//关键字查询
function KeyOfSearch() {
//获取要查询的关键字
var key = document.getElementById('TB_Key').value;
//执行查询.
var handler = new HttpHandler("BP.WF.HttpHandler.WF_MyFlow");
handler.AddUrlData();
handler.AddPara("Keys", key); //增加参数.
var data = handler.DoMethodReturnJSON("StartGuide_Init");
//显示数据.
StartGuide_Init(data);
}
//发起
function SendMulit() {
//获取选中的checkbox
var rdVal = "";
var cbVal = "";
//循环取值
$("input[name='BySQLMulti']:checked").each(function () {
cbVal = "'" + $(this).val() + "'," + cbVal + "";
});
rdVal = cbVal;
//替换潜在的错误
rdVal = rdVal.replace("undefined", "");
// var url = MyFlow + "?DoType=StartGuide_MulitSend&" + str + "&Keys=" + rdVal + "&m=" + Math.random();
var handler = new HttpHandler("BP.WF.HttpHandler.WF_MyFlow");
handler.AddUrlData();
handler.AddPara("Keys", rdVal);
var data = handler.DoMethodReturnString("StartGuide_MulitSend");
//出现异常,提示错误
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
//跳转
var href = "MyFlow.htm?FK_Flow=" + FK_Flow + "&FK_Node=" + FK_Node + "&WorkID=" + WorkID + "&Nos=" + data + "&IsCheckGuide=1";
//获取URL参数
if (location.search.indexOf("PrjNo") != -1)
href = href + "&PrjNo=" + GetQueryString("PrjNo") + "&PrjName=" + GetQueryString("PrjName");
SetHref(href);
}
//加载方法
function StartGuide_Init(data) {
//判断是否出现异常
if (data.indexOf('err@') == 0) {
_Html += "<tr><td>";
_Html += "" + data + "";
_Html += "</td></tr>";
$('#dataList').html([_Html].join(''));
return;
}
//选中的超链接及参数
var href = "MyFlow.htm?FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + FK_Node + "&WorkID=" + GetQueryString("WorkID") + "&IsCheckGuide=1";
//获取URL参数
if (location.search.indexOf("PrjNo") != -1)
href = href + "&PrjNo=" + GetQueryString("PrjNo") + "&PrjName=" + GetQueryString("PrjName");
var _Html = "";
//循环取出来的数据
for (var i in data) {
var key="No";
var Name = "Name";
var thHtml = "<tr><th>Idx</th>";
//如果是第一行先生成table列名
if (i < 1) {
for (var k in data[i]) {
if (k == "NO" || k == "No") { //No这一列不显示
key = data[i][k];
}
else if (k == "NAME" || k == "Name") {
Name = data[i][k];
thHtml += "<th>NAME</th>";
}
else {
thHtml += "<th>" + k + "</th>";
}
}
_Html += thHtml + "</tr>";
}
//添加要显示的数据
_Html += "<tr>";
var extParas = "";
//如果是SQL多条模式增加勾选框
if (StartGuideWay == "BySQLMulti") {
if (data[i]["NO"] == null || data[i]["NO"] == '' || data[i]["NO"] == undefined || data[i]["NO"] == "undefined")
_Html += "<td class='Idx' nowrap><input type='checkbox' name='BySQLMulti' value='" + data[i]["No"] + "' id='" + data[i]["No"] + "' />" + (parseInt(i) + parseInt(1)) + "</td>";
else
_Html += "<td class='Idx' nowrap><input type='checkbox' name='BySQLMulti' value='" + data[i]["NO"] + "' id='" + data[i]["NO"] + "' />" + (parseInt(i) + parseInt(1)) + "</td>";
}
else {
_Html += "<td class='Idx' nowrap>" + (parseInt(i) + parseInt(1)) + "</td>";
//把扩展的paras 求出来.
for (var v in data[i]) {
if (v == "NO" || v == "No" || v == "Name" || v == "NAME") { //此处No列不显示 why?
continue; //此处被zhoupeng注释掉. 如果name 有 #特殊字符就不行了,目前通过底部传值了.
}
//判断参数值里边是否包含特殊字符,包含则替换
var val = data[i][v];
if (val == null || val ==undefined)
continue;
val = val + "";
if (val.indexOf("#") != -1) {
val = val.replace(/\#/g, "%23");
}
if (val.indexOf("%") != -1) {
val = val.replace(/\%/g, "%25");
}
if (val.indexOf("&") != -1) {
val = val.replace(/\&/g, "%26");
}
// extParas += "&" + v + "=" + val;
}
}
//根据sql查询的列名依次显示并对应列名.
for (var v in data[i]) {
if (v == "NO" || v == "No") {//此处No列不显示
key = data[i][v];
if (key == null)
key = "";
}
else if (v == "NAME" || v == "Name") {
if (key.length < 0)//如果No没有在Name列之前就去读josn中指定的对象值
key = data[i]["NO"];
if (key == null || key == '' || key == undefined || key == "undefined")
key = data[i]["No"];
_Html += "<td nowrap>";
//如果是SQL多条模式去掉超链接
if (StartGuideWay == "BySQLMulti") {
_Html += "" + key + "-" + data[i][v] + ""; //No,Name一起显示在Name列中
}
else {
_Html += " <a href='" + href + extParas + "&KeyNo=" + key + "' target='_self'>";
_Html += "" + key + "-" + data[i][v] + ""; //No,Name一起显示在Name列中
_Html += "</a>";
}
_Html += "</td>";
}
else {
_Html += "<td nowrap> " + data[i][v] + "</td>"; //显示其他列
}
}
_Html += "</tr>";
}
//在容器中显示
$('#dataList').html([
_Html
].join(''));
//如果是SQL多条模式增加发送按钮
if (StartGuideWay == "BySQLMulti") {
var sendMultiHtml = "<tr><td><input type='button' name='pub_Send' value='发起' id='Btn_Send' onclick='SendMulit()'/></td></tr>";
$("#mainTable tr:last").after(sendMultiHtml);
}
}
</script>
</head>
<body>
<form id="cc">
<div id="mainPanel" region="center" border="true" class="mainPanel">
<table id="mainTable" style="width: 100%;">
<caption id="cap_Title">
提示:请点击连接发起流程</caption>
<tbody>
<tr>
<td>
<div style="float: left">
输入关键字:
<input name="TB_Key" type="text" id="TB_Key" />
<input type="button" name="pub_Btn" value="查询" id="Btn_Search" onclick="KeyOfSearch()" />
</div>
<div id='leftBar' style="float: right" />
</td>
</tr>
<tr>
<td>
<table id="dataList" style="width: 100%;">
</table>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>