Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/report/rptCreateAudit.jsp

440 lines
20 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ page import="com.sipai.entity.report.RptSpSet" %>
<% request.setAttribute("RptSpSet_Type_Cal", RptSpSet.RptSpSet_Type_Cal); %>
<% request.setAttribute("RptSpSet_Type_Insuser", RptSpSet.RptSpSet_Type_Insuser); %>
<% request.setAttribute("RptSpSet_Type_Confirm", RptSpSet.RptSpSet_Type_Confirm); %>
<% request.setAttribute("RptSpSet_Type_Checkuser", RptSpSet.RptSpSet_Type_Checkuser); %>
<% request.setAttribute("RptSpSet_Type_Rptdt", RptSpSet.RptSpSet_Type_Rptdt); %>
<style type="text/css">
.select2-container .select2-selection--single {
height: 34px;
line-height: 34px;
}
.select2-selection__arrow {
margin-top: 3px;
}
</style>
<script type="text/javascript">
//流程审核文件上传所需参数
var masterId_process = '${scrapApply.id}';//业务Id
var tbName_process = 'TB_Process_UploadFile'; //数据表
var nameSpace_process = 'ProcessUploadFile';//保存文件夹
var status = 'delete';//有删除权限
function doSubmit() {
$('#subForm').data('bootstrapValidator')
.updateStatus('targetUsersName', 'NOT_VALIDATED', null)
.validateField('targetUsersName');
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/report/rptCreate/doAuditProcess.do", $("#subForm").serialize(), function (data) {
if (data.res == 1) {
closeModal('subModalAudit')
// $("#table2").bootstrapTable('refresh');
$("#table").bootstrapTable('refresh');
} else if (data.res == 0) {
showAlert('d', '操作执行失败,请重试');
} else {
showAlert('d', data.res);
}
}, 'json');
}
}
var showUser4SelectsFun = function () {
var userIds = $("#targetusers").val();
var jobIds = $("#targetjobs").val();
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
formId: "subForm",
hiddenId: "targetusers",
textId: "targetUsersName",
userIds: userIds,
jobIds: jobIds
}, function (data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
};
//$(function () {
//初始化选择框方法在workflow.js里
processSelectNode("${businessUnitAudit.taskid}");
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
targetUsersName: {
validators: {
notEmpty: {
message: '提交人员不能为空'
}
}
},
}
});
//显示流程详情
var id = '${entity.id}';
$.post(ext.contextPath + '/report/rptCreate/showProcessView.do', {
id: id,
inModal: 'inModal'
}, function (data) {
$("#showView").html(data);
});
// });
//后台解析报表渲染到前端
function onlineExcel4minio(id) {
var layerType = 'view';
window.parent.window.onlineExcel4minio(id, layerType);
/* var sheetName = '';
//获取该excel的所有sheet 默认加载第一个sheet
$.post(ext.contextPath + '/report/rptCreate/getSheet.do', {id: id}, function (data) {
var datastr = eval('(' + data + ')');
if (datastr.code == 1) {
var msg = datastr.msg;
var arr = msg.split(",");
var sheetstr = '';
//循环sheet
for (var i = 0; i < arr.length; i++) {
sheetstr += '<div style="border:1px solid #696969;font-weight: bold;float: left; margin-left: 5px;cursor: pointer;" onclick="viewFile(\'' + id + '\',\'' + arr[i] + '\');">' + arr[i] + '</div>';
}
$('#viewFile_top').html(sheetstr);
//获取excel数据前端渲染
sheetName = arr[0];
viewFile_open(id, sheetName);
}
});*/
}
//赋值并打开页面
function viewFile_open(id, sheetName) {
//sheet赋值
$('#sheet').val(sheetName);
//creatId赋值
$('#creatId').val(id);
$.post(ext.contextPath + '/report/rptCreate/viewFile.do', {
id: id,
sheetName: sheetName,
layerType: 'edit'
}, function (data) {
var end = data.replace(RegExp('${RptSpSet_Type_Confirm}', 'g'), '<button type="button" style="pointer-events:none;">确认</button>');
$('#viewFile_bottom').html(end);
//$('#viewFile_bottom').html(data);
});
layer.open({
type: 1,
title: false,
area: '90%',
skin: 'bgfff', //没有背景色
maxmin: true,
content: $('#viewFile'),
cancel: function () {//获取右上角关闭事件
// $.post(ext.contextPath + '/report/rptCreate/dosaveAgain.do', {createId: id}, function (data) {
//
// });
}
});
}
//仅赋值---切换sheet
function viewFile(id, sheetName) {
//给sheet赋值
$('#sheet').val(sheetName);
$.post(ext.contextPath + '/report/rptCreate/viewFile.do', {id: id, sheetName: sheetName}, function (data) {
$('#viewFile_bottom').html(data);
});
}
//渲染后的table 右键事件
function tabClickRight() {
var td = event.srcElement; // 通过event.srcElement 获取激活事件的对象 td
if (td.parentElement.rowIndex != 'undefined' && td.parentElement.rowIndex != undefined && td.cellIndex != 'undefined' && td.cellIndex != undefined) {
var posx = td.cellIndex;
var posy = td.parentElement.rowIndex;
$('#tableLog').bootstrapTable('destroy');
$("#tableLog").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/report/rptLog/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [200], // 设置页面可以显示的数据条数
pageSize: 200, // 页面数据条数
pageNumber: 1, // 首页页码
paginationDetailHAlign: ' hidden',//去除分页的显示
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
createId: $('#creatId').val(),
posx: posx,
posy: posy
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: '', // 返回json数据中的name
title: '修订前值', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '25%',
formatter: function (value, row, index) {
return row.beforeValue;
}
},
{
field: '', // 返回json数据中的name
title: '修订值', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '25%',
formatter: function (value, row, index) {
return row.afterValue;
}
},
{
field: '', // 返回json数据中的name
title: '修订人', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '25%',
formatter: function (value, row, index) {
if (row.user != null && row.user != '') {
return row.user.caption;
}
}
},
{
field: '', // 返回json数据中的name
title: '修订时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '25%',
formatter: function (value, row, index) {
return row.insdt.substring(0, 19);
}
}
],
onLoadSuccess: function (data) { //加载成功时执行
adjustBootstrapTableView("tableLog");
if (data.total > 0) {
layer.open({
type: 1,
title: false,
area: '50%',
skin: 'bgfff', //没有背景色
maxmin: false,
content: $('#viewHis'),
cancel: function () {//获取右上角关闭事件
//无
}
});
}
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
}
}
//渲染后的table 左键事件
function tabClickLeft() {
var td = event.srcElement; // 通过event.srcElement 获取激活事件的对象 td
if (td.parentElement.rowIndex != 'undefined' && td.parentElement.rowIndex != undefined && td.cellIndex != 'undefined' && td.cellIndex != undefined) {
var str = td.innerHTML;
var reg = RegExp(/button/);
//如果包含button则为有事件的单元格 不参与修改值
if (str.match(reg)) {
//if (str.match('确认区域')) {
layer.confirm("是否确认该时间段内数据?", {icon: 3, title: '提示'},
function (index) {//确认
var sheet = $('#sheet').val();
var creatId = $('#creatId').val();
var type = '${RptSpSet_Type_Confirm}';
var posx = td.cellIndex;
var posy = td.parentElement.rowIndex;
var userId = '${userId}';
$.post(ext.contextPath + '/report/rptLog/doupdate.do', {
sheet: sheet,
creatId: creatId,
type: type,
posx: posx,
posy: posy,
userId: userId,
val: 0
}, function (data) {
//
});
td.innerHTML = '${userName}';
layer.close(index);
},
function (index) {//取消
layer.close(index);
});
} else {
layer.prompt({value: str},
function (val, index) {
td.innerHTML = val;//设置单击单元格的值
var sheet = $('#sheet').val();
var creatId = $('#creatId').val();
var type = '${RptSpSet_Type_Cal}';
var posx = td.cellIndex;
var posy = td.parentElement.rowIndex;
$.post(ext.contextPath + '/report/rptLog/dosave.do', {
sheet: sheet,
creatId: creatId,
type: type,
posx: posx,
posy: posy,
beforeValue: str,//修改前的值
afterValue: val //修改后的值
}, function (data) {
});
layer.close(index);
});
}
}
}
//渲染后的table 单击事件
$("#viewFile_bottom").unbind("mousedown").bind("mousedown", function (event) {
if (event.which == 1) {//左键事件
tabClickLeft();
} else if (event.which == 2) {//中键事件
} else if (event.which == 3) {//右键事件
document.oncontextmenu = function (ev) {
return false;
}
tabClickRight();
}
});
</script>
<div class="modal fade" id="subModalAudit">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">报表审核(${taskName})</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-7 col-xs-12">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm" enctype="multipart/form-data">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">日期</label>
<div class="col-sm-4">
<p class="form-control-static">${entity.rptdt}</p>
</div>
<label class="col-sm-2 control-label">负责人</label>
<div class="col-sm-4">
<p class="form-control-static">${entity.inputusername}</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">备注</label>
<div class="col-sm-10">
<p class="form-control-static">${entity.memo}</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">查看报表</label>
<div class="col-sm-10">
<p class="form-control-static"><span style="color: #0AB1DF"
onclick="onlineExcel4minio('${entity.id}');">点击查看</span>
</p>
</div>
</div>
<input type="hidden" class="form-control" name="id" value="${businessUnitAudit.id}">
<input type="hidden" class="form-control" name="processid"
value="${businessUnitAudit.processid}">
<input type="hidden" class="form-control" name="taskid" value="${businessUnitAudit.taskid}">
<input type="hidden" class="form-control" name="businessid"
value="${businessUnitAudit.businessid}">
<input type="hidden" class="form-control" name=unitid value="${param.unitId}">
<input type="hidden" class="form-control" name="taskdefinitionkey"
value="${businessUnitAudit.taskdefinitionkey}">
<div class="form-group">
<label class="col-sm-2 control-label">*审核结果</label>
<div class="col-sm-6">
<select class="form-control select2" id="passstatus" name="passstatus"
style="width: 270px;">
<option value=true>通过</option>
<option value=false>驳回</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*下一节点</label>
<div class="col-sm-6">
<select class="form-control select2" id="routeNum" name="routeNum"
style="width: 270px;">
</select>
</div>
</div>
<div id="reject" class="form-group">
<label class="col-sm-2 control-label">*审核意见</label>
<div class="col-sm-10">
<textarea class="form-control" rows="2" id="auditopinion" name="auditopinion"
placeholder="处理意见"></textarea>
</div>
</div>
<div id="selectUsers" class="form-group">
<label class="col-sm-2 control-label">提交至:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName"
placeholder="下一级人员" onclick="showUser4SelectsFun();">
<input id="targetusers" name="targetusers" type="hidden" value=""/>
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden"
value=""/>
</div>
</div>
<!-- 文件上传,显示 -->
<!-- <div class="form-group" style="margin:8px">
<label class="col-sm-2 control-label"></label>
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i
class="fa fa-paperclip"></i>上传文件</button>
</div> -->
<%-- <div id="fileArea">--%>
<%-- </div>--%>
</form>
</div>
<div class="col-md-5 col-xs-12" id="showView"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">提交</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>