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.

364 lines
13 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>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<link href="../js/mui/css/mui.css" rel="stylesheet" type="text/css" />
<script src="../js/mui/js/mui.min.js" type="text/javascript"></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<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/bootstrap/js/bootstrap.min.js" type="text/javascript" ></script>
<script src="../Scripts/bootstrap/js/jquery.cokie.min.js" type="text/javascript" ></script>
<script type="text/javascript">
var param = {};
$(function () {
var dept = getQueryStringByNameFromUrl("?" + $.cookie('CCS'), "FK_Dept");
if (dept == null || dept == '' || dept == undefined) {
dept = $.cookie('FK_Dept');
}
if (dept == null || dept == '' || dept == undefined) {
var u = new WebUser();
dept = u.FK_Dept;
}
if (dept == undefined) {
dept = "0";
}
var url = "SelectEmps.htm?FK_Dept=" + dept + "&s=" + Math.random();
//为天业集团做的特殊判断.
url = url.replace('=101&', '=10102&');
url += "&WorkID=" + GetQueryString("WorkID") + "&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node")+"&ToNode=" + GetQueryString("ToNode");
$('#Btn_SelectEmps').bind('click', function () {
SetHref(url);
});
//初始化人员
var handler = new HttpHandler("BP.WF.HttpHandler.CCMobile_WorkOpt");
handler.AddUrlData();
var data = handler.DoMethodReturnString("AccepterOfGener_Init");
// alert(data);
if (data.indexOf('err@') == 0) {
mui.alert(data);
return;
}
if (data.indexOf('url@') == 0) {
SetHref( data.replace('url@', ''));
return;
}
var sas = JSON.parse(data);
BindTable(sas);
$("#Send").on("tap",function(){
Send();
});
$("#Back").on("tap",function(){
Back();
});
});
function BindTable(sas) {
var ul = $("#tableView");
for (var i = 1; i <= sas.length; i++) {
var sa = sas[i-1];
var row = "<li class='mui-table-view-cell' id='"+sa.FK_Emp+"'>";
row += "<div>" + sa.EmpName + "</div>";
row += "<div title='" + sa.DeptName + "' >" + sa.DeptName + "</div>";
row += "<div><a href=\"javascript:DeleteIt("+i+",'" + sa.MyPK + "');\" >移除</a></div>";
row += "</li>";
ul.append(row);
}
}
//得到行对象
function ClearTable() {
var ul = $("#tableView");
var liArr = $("#tableView li");
for (var i = 0; i < liArr.length; i++) {
var li = liArr[i];
if (li.id == "title")
continue;
li.remove();
}
}
function DeleteIt(rowIndex, mypk) {
var en = new Entity("BP.WF.Template.SelectAccper", mypk);
//删除行数据
delRow(en.FK_Emp);
en.Delete();
}
//确定 执行下一步接受人员列表操作
function AddEmps(isSend, emps) {
if (isSend == false && emps == "") {
mui.alert('请输入接受人的人员ID,支持拼音查询.');
return;
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddUrlData();
handler.AddPara("AddEmps", emps);
var data = handler.DoMethodReturnString("AccepterOfGener_AddEmps");
if (data.indexOf('err@') == 0) {
mui.alert(data);
return;
}
if (data.indexOf('info@') == 0) {
$(".Msg").show();
$(".Msg").html(data);
return;
}
//是否执行发送?
if (isSend == true) {
Send();
return;
}
ClearTable();
var gwls = JSON.parse(data);
BindTable(gwls);
document.getElementById("TB_Emps").value = "";
return;
}
function Send() {
$("#Send").prop("disabled", true);//禁用按钮
$("#Send").css("color", "#CCCCCC");//按钮置灰
var httphandler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
httphandler.AddUrlData();
var data = httphandler.DoMethodReturnString("AccepterOfGener_Send");
var url = Handler + "?DoType=AccepterOfGener_Send&FK_Flow=" + GetQueryString("FK_Flow") + "&WorkID=" + GetQueryString("WorkID") + "&FK_Node=" + GetQueryString("FK_Node") + "&m=" + Math.random() + "&ToNode=" + GetQueryString("ToNode");
if (data.indexOf('err@') == 0) {
mui.alert(data.replace('err@', ''));
$("#Send").prop("disabled", false);//禁用按钮
$("#Send").css("color", "#000");//按钮置灰
return;
}
if (data.indexOf('TurnUrl@') == 0) { //发送成功时转到指定的URL
var url = data;
url = url.replace('TurnUrl@', '');
SetHref(url);
return;
}
data = data.replace("'MyFlowInfo", "'../MyFlowInfo");
data = data.replace("'MyFlow.htm", "'../MyFlow.htm");
data = data.replace("'MyFlow.htm", "'../MyFlow.htm");
data = data.replace("'WFRpt", "'../WFRpt");
data = data.replace("'WFRpt", "'../WFRpt");
data = data.replace("'UnSend", "'../UnSend");
data = data.replace("'./Img", "'../Img");
data = data.replace("'./Img", "'../Img");
data = data.replace("'./Img", "'../Img");
data = data.replace("'./Img", "'../Img");
data = data.replace("'./Img", "'../Img");
data = data.replace("'./WorkOpt/", "");
data = data.replace("'./WorkOpt/", "");
data = data.replace("'./WorkOpt/", "");
data = data.replace('@', '<br/>@');
data = data.replace(/@/g, '<br/>&nbsp;@');
data = data.replace(/null/g, '');
$(".mui-bar-tab").empty();
$(".mui-bar-tab").append($('<a class="mui-tab-item" href="#" id="BackHome" >返回主页</a>'));
$("#BackHome").on("tap",function(){
Back('Home');
});
$(".mui-bar-tab").append($('<a class="mui-tab-item" href="#" id="BackDB">返回待办</a>'));
$("#BackDB").on("tap",function(){
Back('Todolist');
});
$("#tableView").empty();
$("#tableView").html('<li class="mui-table-view-cell mui-media"><p class="" style="font-size: 18px">' + data + '</p></li>');
$("#TB_Emps").hide();
$("#Btn_SelectEmps").hide();
$("#HelpInfo").hide();
return;
}
function Cancel() {
var handler = new HttpHandler("BP.WF.HttpHandler.CCMobile_WorkOpt");
handler.AddPara("FK_Flow", GetQueryString("FK_Flow"));
handler.AddPara("WorkID", GetQueryString("WorkID"));
handler.AddPara("ToNode", GetQueryString("ToNode"));
var data = handler.DoMethodReturnString("AccepterOfGener_UnSend");
mui.alert(data);
}
//事件
$(function () {
//人员选择
$("#TB_Emps").bind('input propertychange', function () {
if ($("#TB_Emps").val() == null || $("#TB_Emps").val() == "") {
$("#SelectEmp").hide().html("");
return;
}
//回去输入内容,查询数据库
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
handler.AddPara("WorkID", GetQueryString("WorkID"));
handler.AddPara("ToNode", GetQueryString("ToNode"));
handler.AddPara("TB_Emps", $("#TB_Emps").val());
var data = handler.DoMethodReturnString("AccepterOfGener_SelectEmps");
if (data.indexOf('err@') == 0) {
mui.alert(data);
return;
}
data = JSON.parse(data);
var html = "";
for (var i = 0; i < data.length; i++) {
html = html + "<div class='item' onclick='getCon(\"" + data[i].No + "\");' onmouseenter='getFocus(this)'>" + data[i].Name + "</div>";
}
$("#SelectEmp").show().html(html);
});
});
//删除当前行
function delRow(id) {
$("#tableView ").children("#"+id).remove();
}
function selectAdd(No) {
AddEmps(false,No);
}
//鼠标事件
function getFocus(obj) {
$(".item").removeClass("addbg");
$(obj).addClass("addbg");
}
//选择下拉数据
function getCon(no) {
$("#TB_Emps").val('');
AddEmps(false, no);
$("#SelectEmp").hide().html("");
}
function Back(backTo) {
if (backTo == null || backTo=="" || backTo == undefined) {
SetHref( "../MyFlowGener.htm?WorkID=" + GetQueryString("WorkID") + "&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node"));
}
if (backTo == "Todolist") {
SetHref( "../Todolist.htm?WorkID=" + GetQueryString("WorkID") + "&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node"));
}
if(backTo == "Home"){
SetHref('../../CCMobilePortal/Home.htm?UserNo=' + GetQueryString('UserNo') + "&Token=" + GetQueryString("Token"));
}
}
</script>
<style type="text/css">
#SelectEmp {
position: relative;
width:400px;
border-top: 0;
display: none;
margin-top:-7px;
}
.mui-table-view-cell div
{
display:inline;
float:left;
width:33%;
text-align:center;
}
#HelpInfo
{
margin:10px 2px 0px 5px;
}
.mui-bar-tab .mui-tab-item {
color:#000;
}
</style>
</head>
<body>
<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">选择接受人</h1>
</header>
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item" href="#" id="Send">执行发送</a>
<a class="mui-tab-item" href="#" id="Back">返回</a>
</nav>
<div class="mui-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<div id="list" class="mui-indexed-list">
<div class="mui-indexed-list-inner">
<ul id="tableView" class="mui-table-view" style="margin-top:50px">
<li id="title" class="mui-table-view-cell">
<div>名称</div><div>部门</div><div>操作</div>
</li>
</ul>
</div>
<div class="mui-indexed-list-search mui-input-row mui-search" style="margin-top:25px">
<input id="TB_Emps" name="TB_Emps" type="search" class="mui-input-clear mui-indexed-list-search-input" style="background-color:White" placeholder="" >
<div id="SelectEmp"></div>
</div>
<button type="button" id="Btn_SelectEmps" class="mui-btn mui-btn-success mui-icon mui-icon-plus" style="width:100%;background-color:#4cd9647a;border-color:#4cd9647a">增加下一步工作处理人</button>
</div>
<div id="HelpInfo" >
<p><span class="mui-icon mui-icon-paperplane"></span>输入要下一步接受人员可以使用人员名称拼音支持全拼简拼.</p>
<p><span class="mui-icon mui-icon-paperplane"></span>比如:查找耿润华您可以输入: grh 或者 gengrh 或者 gengrunhua </p>
<p><span class="mui-icon mui-icon-paperplane"></span>支持单位名称比如:耿润华/集团信息中心, 可以输入为 grh/jtxxzx </p>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
//初始化单页的区域滚动
mui('.mui-scroll-wrapper').scroll();
</script>
</html>