|
|
|
|
<!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 runat="server">
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<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">
|
|
|
|
|
<title>前置导航</title>
|
|
|
|
|
<!-- 引入MUI -->
|
|
|
|
|
<link href="js/mui/css/mui.min.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
<script src="js/mui/js/mui.min.js" type="text/javascript" ></script>
|
|
|
|
|
<script src="js/mui/js/mui.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="js/jquery.js" type="text/javascript"></script>
|
|
|
|
|
<script src="js/jquery.form.js" type="text/javascript"></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="./Comm/JScript.js" type="text/javascript" ></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);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//关键字查询
|
|
|
|
|
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; var 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];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Back() {
|
|
|
|
|
SetHref('Home.htm?s=' + Math.random());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div id="page_Runing" data-role="page" data-theme="d">
|
|
|
|
|
<header class="mui-bar mui-bar-nav">
|
|
|
|
|
<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:Back();"></a>
|
|
|
|
|
<h1 class="mui-title">前置导航</h1>
|
|
|
|
|
</header>
|
|
|
|
|
<div class="mui-content">
|
|
|
|
|
<div id='list' class="mui-indexed-list">
|
|
|
|
|
<div class="mui-indexed-list-search mui-input-row mui-search">
|
|
|
|
|
<input id="TB_Key" type="search" class="mui-input-clear mui-indexed-list-search-input" placeholder="输入关键字">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mui-indexed-list-inner">
|
|
|
|
|
<table id="dataList" style="width: 100%;">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|