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.

170 lines
5.8 KiB
Plaintext

11 months ago
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>选择岗位</title>
<link href="../Comm/Style/CommStyle.css" rel="stylesheet" type="text/css" />
<link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/config.js"></script>
<script type="text/javascript" src="../Comm/Gener.js"></script>
<script src="../Scripts/EasyUIUtility.js" type="text/javascript"></script>
<link href="../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
<link href="../Style/skin/css/Default.css" rel="stylesheet" />
<link href="../Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<base target="_self" />
<script type="text/javascript">
//页面启动函数.
var Data;
$(function () {
$("#Msg").html("<br/><br/><br/><center><img src=../Img/loading.gif />&nbsp;正在加载,请稍后......</center>");
//求出来已经设置的延续子流程.
var nodeID = GetQueryString("FK_Node");
var orgNo = GetQueryString("OrgNo");
if (orgNo == null || orgNo == undefined)
orgNo = 0;
//获得该组织的岗位.
var stas = new Entities("BP.Port.Stations");
stas.RetrieveAll();
var data = new Entities("BP.Port.StationTypes");
data.RetrieveAll();
Data = data;
//data = stationTypes.DoMethodReturnString("GetStationTypes", orgNo);
// data = JSON.parse(data);
BindGroupModel(data, stas);
});
function BindGroupModel(groups, stas) {
AttrOfMInMM = "FK_Station";
var html = "<table class='table' >";
html += "<tr>";
html += "<th colspan=3>";
html += "<div style='float:left'>";
html += "<input type=button value='确定' class='cc-btn-tab' onclick='SelectStas();' id='save' />";
html += "<input type=button value='取消' class='cc-btn-tab' onclick='Close();' id='save' />";
html += "</div>";
html += "</th>";
html += "</tr>";
for (var i = 0; i < groups.length; i++) {
var group = groups[i];
html += "<tr>";
html += "<th colspan=3>";
html += "<label for='Group_" + group.No + "'><input type='checkbox' onclick='CheckAll(this.checked, \"" + group.No + "\");' id='Group_" + group.No + "' /> " + group.Name + "</label>";
html += "</th>";
html += "</tr>";
var myNum = -1;
for (var idx = 0; idx < stas.length; idx++) {
en = stas[idx];
var myidx = 0;
var oOfEn;
for (var obj in en) {
if (myidx == 2) {
oOfEn = obj;
break;
}
myidx++;
}
myidx = 0;
var oOfGroup;
for (var obj in en) {
if (myidx == 0) {
oOfGroup = obj;
break;
}
myidx++;
}
if (en[oOfEn] != group[oOfGroup])
continue;
var lab = en.Name;
myNum++;
if (myNum == 0)
html += "<TR>";
html += "<td><label for='CB_" + en.No + "'><input type='checkbox' name='" + group.No + "' id='CB_" + en.No + "' value='" + en.No + "' /> " + lab + "</label></td>";
if (myNum == 2) {
html += "</tr>";
myNum = -1;
}
}
if (idx == 1) {
html += "<td colspan=2></td>";
html += "</tr>";
}
if (idx == 2) {
html += "<td></td>";
html += "</tr>";
}
}
html += "</table>";
$("#Msg").html("");
$("#Msg").html(html);
}
//选择与取消选择.
function CheckAll(checked, no) {
$("input[name='" + no + "']").each(function () {
this.checked = checked;
});
}
//取消岗位选择
function Close() {
if (window.parent != null && window.parent.selectEmpsWindowClose != null) {
window.parent.selectStasWindowClose("取消");
}
}
//保存.
var returnVal = []
function SelectStas() {
//获取选择的岗位
for (var i = 0; i < Data.length; i++) {
$.each($('input:checkbox[name=' + Data[i].No + ']:checked'), function (i, obj) {
returnVal.push({ "No": obj.value, "Name": $(obj).parent().text() });
});
}
//No 是返回到别的页面的值
if (returnVal.length == 0) {
alert("未选择人员");
} else {
window.parent.selectStasWindowClose("确定");
}
}
</script>
</head>
<body>
<div id="Msg"></div>
</body>
</html>