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.

251 lines
9.9 KiB
Plaintext

11 months ago
<!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/jquery.js" type="text/javascript"></script>
<script src="../js/mui/js/mui.min.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>
<style>
.mui-bar-tab .mui-tab-item {
color:#000;
}
</style>
<script type="text/javascript">
var doType = GetQueryString("DoType");
$(function () {
var handler = new HttpHandler("BP.WF.HttpHandler.CCMobile_WorkOpt");
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
handler.AddPara("ToNode", GetQueryString("ToNode"));
handler.AddPara("FK_Flow", GetQueryString("FK_Flow"));
handler.AddPara("WorkID", GetQueryString("WorkID"));
var data = handler.DoMethodReturnString("Accepter_Init");
if (data.indexOf('info@') == 0) {
mui.alert(data, '', function () { mui.back(); });
}
if (data.indexOf('err@') == 0) {
mui.alert(data);
SetHref('../Todolist.htm');
return;
}
if (data.indexOf('url@') == 0) {
var url = data.replace('url@', '');
SetHref( url + "&ToNode=" + GetQueryString("ToNode"));
return;
}
try {
data = cceval('(' + data + ')');
}
catch (err) {
mui.alert("转换JSON 失败", '', function () { mui.back(); });
}
//获得三个数据源.
var depts = data.Depts;
var emps = data.Emps;
var selected = data.Selected;
if (emps.length == 0) {
mui.alert('当前节点设置的接收人范围为空,请联系管理员配置接收人范围.', '', function () { mui.back(); });
// mui.back();
}
//是否是单选?
var isSimplate = data.Selector[0].IsSimpleSelector;
var ul = $("#tableView");
$.each(depts, function (i, dept) {
ul.append("<li data-group='" + dept.No + "' class='mui-table-view-divider mui-indexed-list-group'>" + dept.Name + "</li>");
$.each(emps, function (i, emp) {
if (emp.FK_Dept != dept.No)
return true;
//检查该人员是否被选择.
var isSele = false;
$.each(selected, function (idx, sele) {
if (sele.No == emp.No)
isSele = true;
});
var empStrs = "";
//多选.
if (isSimplate == "0") {
empStrs += "<li data-value='" + emp.No + "' data-tags='" + emp.Name + "' class='mui-table-view-cell mui-indexed-list-item mui-checkbox mui-left'>";
if (isSele == true)
empStrs += "<input type='checkbox' checked=true id='" + emp.No + "' value='" + emp.Name + "' /> " + emp.Name + "</li>";
else
empStrs += "<input type='checkbox' id='" + emp.No + "' value='" + emp.Name + "' /> " + emp.Name + "</li>";
}
//单选.
if (isSimplate == "1") {
empStrs += "<li data-value='" + emp.No + "' data-tags='" + emp.Name + "' class='mui-table-view-cell mui-indexed-list-item mui-radio mui-left'>";
if (isSele == true)
empStrs += "<input name='emps' type='radio' checked=true id='" + emp.No + "' value='" + emp.Name + "' /> " + emp.Name + "</li>";
else
empStrs += "<input name='emps' type='radio' id='" + emp.No + "' value='" + emp.Name + "' /> " + emp.Name + "</li>";
}
ul.append(empStrs);
});
});
$("#SendNode").on("tap", function () {
SendNode();
});
$("#Back").on("tap", function () {
Back();
});
});
//确定【选择接收人并发送】 / 保存. Accepter_Save Accepter_Send
function SendNode() {
$("#SendNode").prop("disabled", true);//禁用按钮
$("#SendNode").css("color","#CCCCCC");
//生成选择的人员.
var checked = $('input:checked');
var selectedEmps = [];
var selectedEmpLab = "";
for (var i = 0; i < checked.length; i++) {
selectedEmps.push(checked[i].id);
var ctrl = checked[i];
//录制人员名称.
selectedEmpLab += ctrl.id + "," + ctrl.value + ';';
}
selectedEmps = selectedEmps.join(';');
if (selectedEmps == '' || selectedEmps == null) {
mui.alert('请选择人员...');
$("#SendNode").prop("disabled", false);//解禁按钮
$("#SendNode").css("color","#000");
return;
}
var handler = new HttpHandler("BP.WF.HttpHandler.CCMobile_WorkOpt");
handler.AddPara("SelectEmps", encodeURI(selectedEmps));
handler.AddPara("ToNode", GetQueryString("ToNode"));
handler.AddPara("FK_Flow", GetQueryString("FK_Flow"));
handler.AddPara("WorkID", GetQueryString("WorkID"));
var data = handler.DoMethodReturnString("Accepter_Send");
if (data.indexOf('err@') == 0) {
mui.alert(data);
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('@', '');
data = data.replace(/@null/g, '');
data = data.replace(/@/g, '<br/><br/>');
// 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>');
return;
}
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>
</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>
<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;margin-bottom:50px"></ul>
</div>
</div>
</div>
</div>
</div>
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item" href="#" id="SendNode">发送</a>
<a class="mui-tab-item" href="#" id="Back">取消</a>
</nav>
<script type="text/javascript">
//初始化单页的区域滚动
mui('.mui-scroll-wrapper').scroll();
</script>
</body>
</html>