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.

568 lines
25 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" />
<!-- 引用通用的js文件. -->
<link href="../../Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../../Scripts/bootstrap/css/font-awesome.css" rel="stylesheet" />
<link href="../../Style/skin/css/style.css" rel="stylesheet" type="text/css" />
<link href="../../Style/skin/css/animate.css" rel="stylesheet" type="text/css" />
<link href="../../Style/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script src="../../Scripts/config.js" type="text/javascript"></script>
<script src="../../Comm/Gener.js" type="text/javascript"></script>
<script src="../../Scripts/bootstrap/BootstrapUIDialog.js"></script>
<script type="text/javascript" language="javascript">
//页面启动函数.
$(function () {
InitPage();
});
function InitPage() {
var fk_node = GetQueryString("FK_Node");
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_Batch");
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = handler.DoMethodReturnString("BatchList_Init");
if (data.indexOf("err@") != -1) {
alert(data);
return;
}
data = cceval('(' + data + ')');
var node = data.WF_Node[0];
$("#title").html("流程:" + node.FlowName + " => 节点:" + node.Name);
var thead = ""; //标题字段
var tbody = ""; //内容显示
thead += "<th>序号</th>";
thead += "<th><label><input type='checkbox' onclick='CheckAll(this)'/>选择</label></th>";
thead += "<th>标题</th>";
thead += "<th>发起人</th>";
thead += "<th>接收日期</th>";
//获取新增的标题
var mapAttrs = data.Sys_MapAttr;
if (mapAttrs != null) {
for (var k = 0; k < mapAttrs.length; k++) {
thead += "<th>" + mapAttrs[k].Name + "</th>";
}
}
//判断该节点是否启用审核组件
var FWCSta = node.FWCSta;
if (FWCSta == 1) {//启用审核组件并且可编辑
thead += "<th>审核意见</th>";
}
//处理要显示数据
var batchListCount = node.BatchListCount;
var works = data.WF_Work;
var batchs = data.Batch_List;
for (var i = 0; i < works.length; i++) {
if (i + 1 == batchListCount)
break;
tbody += "<tr>";
tbody += "<td>" + parseInt(i + 1) + "</td>";
for (var k = 0; k < batchs.length; k++) {
if (works[i].OID != batchs[k].WorkID)
continue;
tbody += "<td ><label><input type='checkbox' id='CB_" + batchs[k].WorkID + "' name='CB_" + batchs[k].WorkID + "'/>选择</label></td>";
tbody += "<td><a href=\"javascript:To('../../MyFlow.htm?WorkID=" + batchs[k].WorkID + "&FK_Node=" + node.nodeID + "&FK_Flow=" + node.FK_Flow + "&IsRead=0');\" >" + batchs[k].Title + "</a></td>";
tbody += "<td>" + batchs[k].Starter + "</td>";
tbody += "<td>" + batchs[k].ADT + "</td>";
}
//增加需要编辑字段的列
if (mapAttrs != null) {
for (var idx = 0; idx < mapAttrs.length; idx++) {
tbody += "<td>" + InitMapAttrOfCtrl(mapAttrs[idx], works[i], works[i].OID) + "</td>";
}
}
if (FWCSta == 1) {//启用审核组件并且可编辑
tbody += "<td><textarea class='form-control' style='height:50px;width:240px;' name='TB_" + works[i].OID + "_WorkCheck_Doc' id='TB_" + works[i].OID + "_WorkCheck_Doc' type='text' ></textarea></td>";
}
tbody += "</tr>";
}
$("#Table1").append(thead);
$("#Table2").append(tbody);
//处理按钮权限
var bar = "";
var btnLab = data.Sys_BtnLab[0];
if (node.BatchRole == 1) { //普通的批处理
btnLab.Text = "批量处理:" + btnLab.SendLab;
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Send()">' + btnLab.Text + '</a>';
if (btnLab.ReturnEnable == 1) {
btnLab.Text = "批量处理:" + btnLab.ReturnEnable;
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Btn_Return()">' + btnLab.Text + '</a>';
}
}
if (node.BatchRole == 2) { //分组批量审批
btnLab.Text = "合卷批复";
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Btn_Group()">' + btnLab.Text + '</a>';
}
if (btnLab.ReturnRole == 1) {
btnLab.Text = "批量处理:" + btnLab.ReturnLab;
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Btn_Return()">' + btnLab.Text + '</a>';
}
if (btnLab.DelEnable == 1) {
btnLab.Text = "批量处理:" + btnLab.DelLab;
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Btn_Delete()">' + btnLab.Text + '</a>';
}
bar += '<a href="#"class="btn btn-primary btn-sm" style="margin-left:20px" onclick="Back()">返回</a>';
$("#btnDiv").append(bar);
}
function To(url) {
WinOpen(url);
return;
SetHref(url);
return;
}
//选中/取消所有列表
function CheckAll(obj) {
if (obj.checked == true)
$.each($("input[type='checkbox']"), function (i, o) {
o.checked = true;
});
else
$.each($("input[type='checkbox']"), function (i, o) {
o.checked = false;
});
}
function CheckedWorkIDs() {
var workIDs = [];
//获取所有的复选框
var checks = $("input[type='checkbox']:checked");
if (checks.length == 0)
return workIDs;
if (checks.length == 1) {
//判断是不是表头的选中
var checkID = checks[0].id;
if (checkID == null || checkID == undefined || checkID == "")
return workIDs;
}
checks.each(function (item) {
if (this.id == null || this.id == undefined || this.id == "")
return true;
workIDs.push(this.id.replace("CB_", ""));
});
return workIDs.join(",");
}
function Send(label) {
if (window.confirm('您确定要执行本次批处理发送操作吗?') == false)
return;
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_Batch");
handler.AddFormData();
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = handler.DoMethodReturnString("Batch_Send");
if (data.indexOf("err@") != -1) {
alert(data);
return;
}
$("#batchModal").modal().show();
$("#batchModal").find('.modal-title').text(label);
data = data.replace(/@/g, '<br/>@');
$("#msgContent").html(data);
$('#batchModal').on('hidden.bs.modal', function () {
$("#Table1").html("");
$("#Table2").html("");
$("#btnDiv").html("");
InitPage();
});
$("#batchModal").modal("hidden");
}
function Btn_Group() {
if (window.confirm('您确定要执行本次合卷批复操作吗?') == false)
return;
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_Batch");
handler.AddFormData();
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = handler.DoMethodReturnString("Batch_Group");
}
function Btn_Return() {
// if (window.confirm('您确定要执行本次批处理退回操作吗?') == false)
// return;
var WorkIDs = CheckedWorkIDs();
if (WorkIDs == "") {
alert("没有选择需要处理的工作");
return;
}
var url = "";
var fk_node = GetQueryString("FK_Node");
var isFrameCross = GetHrefUrl().indexOf(basePath) == -1 ? 1 : 0;
if (WorkIDs.indexOf(",") == -1)
url = "../ReturnWork.htm?FK_Node=" + fk_node + "&WorkID=" + WorkIDs + "&s=" + Math.random() + "&isFrameCross=" + isFrameCross;
else {
var workID = WorkIDs.substring(0, WorkIDs.indexOf(","));
url = "../ReturnWork.htm?FK_Node=" + fk_node + "&WorkID=" + workID + "&WorkIDs=" + WorkIDs + "&s=" + Math.random() + "&isFrameCross=" + isFrameCross;
}
OpenBootStrapModal(url, "ReturnModel", "退回", 600, 400, null, null, null, null, function () {
SetHref(GetHrefUrl().replace("#", ""));
});
/**$('#batchModal').attr('src', url);
$("#batchModal .modal-dialog").css("width", "50%");
$("#batchModal .modal-dialog").css("height", "60%");
$("#batchModal").modal().show();
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_Batch");
handler.AddFormData();
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = handler.DoMethodReturnString("Batch_Return");*/
}
function Btn_Delete() {
if (window.confirm('您确定要执行本次批处理删除操作吗?') == false)
return;
var WorkIDs = CheckedWorkIDs();
if (WorkIDs == "") {
alert("没有选择需要处理的工作");
return;
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt_Batch");
handler.AddPara("WorkIDs", WorkIDs)
handler.AddPara("FK_Node", GetQueryString("FK_Node"));
var data = handler.DoMethodReturnString("Batch_Delete");
if (data.indexOf("err@") != -1) {
alert(data);
return;
}
$("#batchModal").modal().show();
$("#batchModal").find('.modal-title').text("批量删除");
data = data.replace(/@/g, '<br/>@');
$("#msgContent").html(data);
$('#batchModal').on('hidden.bs.modal', function () {
SetHref(GetHrefUrl().replace("#", ""));
});
$("#batchModal").modal("hidden");
}
function Back() {
var url = "";
var type = GetQueryString("Type");
SetHref("../../Batch.htm");
return;
if (type == 0) {
url = "../../Batch.htm";
} else {
url = "../../Batch.htm?FK_Node=" + GetQueryString("FK_Node");
}
SetHref(url);
}
function InitMapAttrOfCtrl(mapAttr, dtl, pkval) {
var str = '';
var defValue = ConvertDefVal(mapAttr, dtl);
var isInOneRow = false; //是否占一整行
var islabelIsInEle = false; //
var eleHtml = '';
//外部数据源类型.
if (mapAttr.LGType == "0" && mapAttr.MyDataType == "1" && mapAttr.UIContralType == "1") {
//枚举类型.
if (mapAttr.UIIsEnable == 1)
enableAttr = "";
else
enableAttr = "disabled='disabled'";
return "<select style='width:" + mapAttr.UIWidth * 2 + "px' class='form-control' id='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' name='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' " + (mapAttr.UIIsEnable == 1 ? '' : 'disabled="disabled"') + ">" + InitDDLOperation(frmData, mapAttr, defValue) + "</select>";
}
//外键类型.
if (mapAttr.LGType == "2" && mapAttr.MyDataType == "1") {
//枚举类型.
if (mapAttr.UIIsEnable == 1)
enableAttr = "";
else
enableAttr = "disabled='disabled'";
return "<select style='width:" + mapAttr.UIWidth * 2 + "px' class='form-control' id='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' name='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' " + (mapAttr.UIIsEnable == 1 ? '' : 'disabled="disabled"') + ">" + InitDDLOperation(frmData, mapAttr, defValue) + "</select>";
}
//外部数据类型.
if (mapAttr.LGType == "0" && mapAttr.MyDataType == "1" && mapAttr.UIContral == 1) {
//枚举类型.
if (mapAttr.UIIsEnable == 1)
enableAttr = "";
else
enableAttr = "disabled='disabled'";
return "<select style='width:" + mapAttr.UIWidth * 2 + "px' class='form-control' id='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' name='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' " + (mapAttr.UIIsEnable == 1 ? '' : 'disabled="disabled"') + ">" + InitDDLOperation(frmData, mapAttr, defValue) + "</select>";
}
//添加文本框 ,日期控件等
//AppString
if (mapAttr.MyDataType == "1" && mapAttr.UIContralType == 0) { //不是外键
// alert(mapAttr.UIWidth);
if (mapAttr.UIHeight <= 40) //普通的文本框.
{
var enableAttr = '';
if (mapAttr.UIIsEnable == 0)
enableAttr = "disabled='disabled'";
return "<input class='form-control' maxlength=" + mapAttr.MaxLen + " name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' id='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' value='" + defValue + "' style='width:" + mapAttr.UIWidth + "px;height:23px;' type='text' " + enableAttr + " />";
}
//普通的大块文本.
return "<textarea class='form-control' maxlength=" + mapAttr.MaxLen + " style='height:" + mapAttr.UIHeight + "px;width:" + mapAttr.UIWidth + "px;' name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' id='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' type='text' " + (mapAttr.UIIsEnable == 1 ? '' : ' disabled="disabled"') + " >" + defValue + "</textarea>"
}
//日期类型.
if (mapAttr.MyDataType == 6) {
var enableAttr = '';
if (mapAttr.UIIsEnable == 1)
enableAttr = 'onfocus="WdatePicker({dateFmt:' + "'yyyy-MM-dd'})" + '";';
else
enableAttr = "disabled='disabled'";
return "<input class='form-control' " + enableAttr + " value='" + defValue + "' style='width:105px;' name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' type='text' />";
}
//时期时间类型.
if (mapAttr.MyDataType == 7) {
var enableAttr = '';
if (mapAttr.UIIsEnable == 1)
enableAttr = 'onfocus="WdatePicker({dateFmt:' + "'yyyy-MM-dd HH:mm'})" + '";';
else
enableAttr = "disabled='disabled'";
return "<input class='form-control' type='text' value='" + defValue + "' style='width:120px;' " + enableAttr + " name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "' />";
}
// boolen 类型.
if (mapAttr.MyDataType == 4) { // AppBoolean = 7
if (mapAttr.UIIsEnable == 1)
enableAttr = "";
else
enableAttr = "disabled='disabled'";
//CHECKBOX 默认值
var checkedStr = '';
if (checkedStr != "true" && checkedStr != '1') {
checkedStr = ' checked="checked" ';
}
checkedStr = "";
return "<input " + enableAttr + " value='" + defValue + "' " + (defValue == 1 ? "checked='checked'" : "") + " type='checkbox' id='CB_" + pkval + "_" + mapAttr.KeyOfEn + "' name='CB_" + pkval + "_" + mapAttr.KeyOfEn + "' " + checkedStr + " /><span for='CB_" + pkval + "_" + mapAttr.KeyOfEn + "' >" + mapAttr.Name + "</span>";
}
//枚举类型.
if (mapAttr.MyDataType == 2 && mapAttr.LGType == 1) { //AppInt Enum
if (mapAttr.UIIsEnable == 1)
enableAttr = "";
else
enableAttr = "disabled='disabled'";
return "<select style='width:" + mapAttr.UIWidth * 2 + "px' class='form-control' name='DDL_" + pkval + "_" + mapAttr.KeyOfEn + "' " + (mapAttr.UIIsEnable == 1 ? '' : 'disabled="disabled"') + ">" + InitDDLOperation(frmData, mapAttr, defValue) + "</select>";
}
// AppDouble AppFloat
if (mapAttr.MyDataType == 5 || mapAttr.MyDataType == 3) {
var enableAttr = '';
if (mapAttr.UIIsEnable != 1)
enableAttr = "disabled='disabled'";
// alert(mapAttr.KeyOfEn);
return "<input class='form-control' style='text-align:right;width:80px;' value='" + defValue + "' onkeyup=" + '"' + "if(isNaN(value)) execCommand('undo')" + '"' + " onafterpaste=" + '"' + "if(isNaN(value))execCommand('undo')" + '"' + " maxlength=" + mapAttr.MaxLen / 2 + " type='text'" + enableAttr + " name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "'/>";
}
if ((mapAttr.MyDataType == 2)) { //AppInt
var enableAttr = '';
if (mapAttr.UIIsEnable == 0 || mapAttr.KeyOfEn == "NodeID") {
enableAttr = "disabled='disabled'";
}
return "<input class='form-control' style='text-align:right;width:80px;' value='" + defValue + "' onkeyup=" + '"' + "if(isNaN(value) || (value%1 !== 0))execCommand('undo')" + '"' + " onafterpaste=" + '"' + "if(isNaN(value) || (value%1 !== 0))execCommand('undo')" + '"' + " maxlength=" + mapAttr.MaxLen / 2 + " type='text'" + enableAttr + " name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "'/>";
}
//AppMoney AppRate
if (mapAttr.MyDataType == 8) {
var enableAttr = '';
if (mapAttr.UIIsEnable == 1) {
} else {
enableAttr = "disabled='disabled'";
}
return "<input class='form-control' style='text-align:right;width:80px;' value='" + defValue + "' onkeyup=" + '"' + "if(isNaN(value))execCommand('undo')" + '"' + " onafterpaste=" + '"' + "if(isNaN(value))execCommand('undo')" + '"' + " maxlength=" + mapAttr.MaxLen / 2 + " type='text'" + enableAttr + " name='TB_" + pkval + "_" + mapAttr.KeyOfEn + "'/>";
}
alert(mapAttr.Name + "的类型没有判断.");
return;
}
//填充默认数据
function ConvertDefVal(attr, dtl) {
//通过MAINTABLE返回的参数
for (var ele in dtl) {
if (attr.KeyOfEn == ele && dtl != '') {
result = dtl[ele];
break;
}
}
if (result != undefined && typeof (result) == 'string') {
//result = result.replace(//g, "{").replace(//g, "}").replace(//g, ":").replace(//g, ",").replace(/【/g, "[").replace(/】/g, "]").replace(//g, ";").replace(/~/g, "'").replace(//g, "'").replace(//g, "'");
}
return result = unescape(result);
}
//初始化下拉列表框的OPERATION
function InitDDLOperation(flowData, mapAttr, defVal) {
var operations = '';
var data = flowData[mapAttr.KeyOfEn];
if (data == undefined)
data = flowData[mapAttr.UIBindKey];
if (data != undefined) {
$.each(data, function (i, obj) {
operations += "<option " + (obj.No == defVal ? " selected='selected' " : "") + " value='" + obj.No + "'>" + obj.Name + "</option>";
});
return operations;
}
//外键类型.
if (mapAttr.LGType == 2) {
var data = frmData[mapAttr.KeyOfEn];
if (data == undefined)
data = frmData[mapAttr.UIBindKey];
if (data == undefined) {
alert('没有获得约定的数据源..' + mapAttr.KeyOfEn + " " + mapAttr.UIBindKey);
return;
}
$.each(data, function (i, obj) {
operations += "<option " + (obj.No == defVal ? " selected='selected' " : "") + " value='" + obj.No + "'>" + obj.Name + "</option>";
});
}
//枚举类型.
if (mapAttr.LGType == 1) {
var enums = frmData.Sys_Enum;
enums = $.grep(enums, function (value) {
return value.EnumKey == mapAttr.UIBindKey;
});
$.each(enums, function (i, obj) {
operations += "<option " + (obj.IntKey == defVal ? " selected='selected' " : "") + " value='" + obj.IntKey + "'>" + obj.Lab + "</option>";
});
}
//外部数据源类型 MyFlowGener.js.InitDDLOperation
if (mapAttr.LGType == 0) {
var fn;
try {
if (mapAttr.UIBindKey) {
fn = cceval(mapAttr.UIBindKey);
}
} catch (e) {
}
if (typeof fn == "function") {
$.each(fn.call(), function (i, obj) {
operations += "<option " + (obj.No == defVal ? " selected='selected' " : "") + " value='" + obj.No + "'>" + obj.Name + "</option>";
});
} else if (typeof CommonHandler == "function") {
CommonHandler.call("", mapAttr.UIBindKey, function (data) {
GenerBindDDL("DDL_" + mapAttr.KeyOfEn, data, "No", "Name");
})
} else {
alert('没有获得约定的数据源..' + mapAttr.KeyOfEn + " " + mapAttr.UIBindKey);
//alert('没有获得约定的数据源.');
}
}
return operations;
}
</script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<h3 id="title"> </h3>
<div class="ibox-content">
<form id="divCCForm" method="post">
<table class="table table-striped">
<thead id="Table1"></thead>
<br />
<tbody id="Table2"></tbody>
</table>
</form>
<div class="row">
<div class="col-sm-12">
<span id="btnDiv"></span>
</div>
</div>
</div>
</div>
<div class="modal fade" id="batchModal" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content" style="border-radius:0px;width:700px; height:600px;text-align:center;">
<div class="modal-header">
<button type="button" class="close" id="btnMsgModalOK1" aria-hidden="true" style="color: white; opacity: 1; display: none;"> ×</button>
<h4 class="modal-title" id="modalHeader">批量处理</h4>
</div>
<div class="modal-body" style="text-align: left; word-wrap: break-word;">
<div style="width:100%; border: 0px; height: 500px;overflow-y:scroll" id="msgContent" name="iframePopModalForm">
</div>
<div style="text-align: right;">
<button type="button" id="BatchOK" class="btn" data-dismiss="modal">
确定
</button>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</body>
</html>