被覆盖文件还原

This commit is contained in:
446052889@qq.com 2022-07-27 18:25:35 +08:00
parent 2e1f6cb992
commit d8b5450ad8
2 changed files with 1371 additions and 1320 deletions

View File

@ -487,7 +487,6 @@ function queryapprove(){
async : true,
data : param,
success : function(r) {
debugger;
var info = r.data.data;
if(info != ''){
ui("PERSON_THREE_LEVEL_PROCESS",info.AUDITOR_NO_3);
@ -496,13 +495,13 @@ function queryapprove(){
ui("LEVEL_AUDIT_REQUIRED",info.L3_SP);
ui("SECONDARY_AUDIT_REQUIRED",info.L2_SP);
ui("LEVEL_1_AUDIT_REQUIRED",info.L1_SP);
}
}
});
}
//by bzp
function showlist(data, type, pageNumber, start){
debugger;
var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
if (type == 'new') {
$('#new_check_all').check("option", "checked", false);
@ -514,8 +513,9 @@ function showlist(data, type, pageNumber, start){
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fileName = curr.publishFileName + ' V' + curr.fileVersion + '.0';
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + fileName + "-流程手册" + '</a>';
var fileName = curr.publishFileName + ' V' + curr.fileVersion;
var outputName = (curr.category == 'process' ? '流程' : curr.category == 'data' ? '表单' : curr.category == 'control' ? '制度' : '') + '手册';
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + fileName + "-" + outputName + '</a><span id="download_output_' + curr.publishFileId + '" style="cursor: pointer;" onclick="downloadReport(\'' + curr.publishFileId + '\',\'' + curr.taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>';
var quickCreate = "<a href='javascript:void(0);' onclick='quickCreateReport(" + JSON.stringify(curr) + ", $(this), \"new\")'>立即创建</a>";
var processNumber = '';
if(curr.processNumber != undefined){
@ -542,6 +542,7 @@ function showlist(data, type, pageNumber, start){
$("#publish_new_tbody .awsui-checkbox").check();
}
if (type == 'change') {
var createButtonObj = {};
$('#change_check_all').check("option", "checked", false);
if (data.length > pageLimit) {// 显示分页
$('#change_pagination').show();
@ -550,20 +551,24 @@ function showlist(data, type, pageNumber, start){
var html = '';
var tempSelect = [];
for (var i = 0, s = start; i < pageLimit; i++, s++) {
debugger;
var curr;
if ((curr = data[s - 1]) != undefined) {
var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion + '.0';
var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
// 变更目标文件处理
var targetFileName = "";
if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion + '.0';
targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
}
var targetId = "";
if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
targetId = curr.changedFileIdNew;
}
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + targetFileName + "-流程手册" + '</a>';
debugger;
var outputName = (curr.category == 'process' ? '流程' : curr.category == 'data' ? '表单' : curr.category == 'control' ? '制度' : '') + '手册';
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + targetFileName + "-" + outputName + '</a><span id="download_output_' + curr.changeFileId + '" style="cursor: pointer;" onclick="downloadReport(\'' + curr.changeFileId + '\',\'' + curr.taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>';
var quickCreate = "<a href='javascript:void(0);' onclick='quickCreateReport(" + JSON.stringify(curr) + ", $(this), \"change\")'>立即创建</a>";
createButtonObj[curr.changeFileId] = quickCreate;
reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
// 三员管理taskId为change标识未创建手册
@ -589,7 +594,7 @@ function showlist(data, type, pageNumber, start){
var targetFiles = $.extend(true, [], curr.targetFiles);
for (var j = 0; j < targetFiles.length; j++) {
var temp = targetFiles[j];
var name = temp.text + ' V' + temp.version + '.0';
var name = temp.text + ' V' + temp.version;
var obj = {id:temp.id, text:name, name:temp.text, version:temp.version};
opt1.data.push(obj);
if (targetId == temp.id) {
@ -603,6 +608,7 @@ function showlist(data, type, pageNumber, start){
tempObj.selectId = 'change_' + curr.changeFileId;
tempObj.taskId = curr.taskId;
tempObj.id = curr.changeFileId;
tempObj.category = curr.category;
tempSelect.push(tempObj);
}
}
@ -618,11 +624,13 @@ function showlist(data, type, pageNumber, start){
if (tempObj.taskId != undefined && tempObj.taskId != '') {
// 三员管理taskId为change标识未创建手册
if (tempObj.taskId == 'submit_create' || tempObj.taskId == 'change') {
$('#report_' + tempObj.id).html(quickCreate);
// $('#report_' + tempObj.id).html(quickCreate);
$('#report_' + tempObj.id).html(createButtonObj[tempObj.id]);
} else {
for (var m = 0; m < tempObj.opt.data.length; m++) {
if (tempObj.opt.data[m].id == tempObj.targetId) {
var targetFileName2 = tempObj.opt.data[m].name + ' V' + tempObj.opt.data[m].version + '.0' + '-流程手册';
var outputName = (tempObj.category == 'process' ? '流程' : tempObj.category == 'data' ? '表单' : tempObj.category == 'control' ? '制度' : '') + '手册';
var targetFileName2 = tempObj.opt.data[m].name + ' V' + tempObj.opt.data[m].version + '-' + outputName + '</a><span id="download_output_' + tempObj.targetId + '" style="cursor: pointer;" onclick="downloadReport(\'' + tempObj.targetId + '\',\'' + tempObj.taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>';
$('#report_' + tempObj.id).html('<a href="javascript:void(0);" onclick="openReportFile(\'' + tempObj.taskId + '\')">' + targetFileName2 + '</a>');
break;
}
@ -654,7 +662,7 @@ function showlist(data, type, pageNumber, start){
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fileName = curr.stopFileName + ' V' + curr.fileVersion + '.0';
var fileName = curr.stopFileName + ' V' + curr.fileVersion;
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + fileName + "-流程手册" + '</a>';
reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName;
var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
@ -784,6 +792,7 @@ function addProcess(type) {
return;
}
disabledButton();
debugger;
setTimeout(function() {
// 获取说明内容
var desc = $('#publisher_dialog_desc').val();
@ -890,13 +899,7 @@ function initChangedData(changeFileId) {
// 获取流程手册
var selectedTaskId = "";
selectedTaskId = createReport(changeTemp[i].category, changeTemp[i].methodId, selectedId, selectedTaskId);
// 更新界面手册
if (selectedTaskId != '') {
var targetFileName2 = changeTemp[i].targetFiles[j].text + ' V' + changeTemp[i].targetFiles[j].version + '.0' + '-流程手册';
$('#report_' + changeFileId).html('<a href="javascript:void(0);" onclick="openReportFile(\'' + selectedTaskId + '\')">' + targetFileName2 + '</a>');
} else {
$('#report_' + changeFileId).html('无');
}
// 更新数据
changeTemp[i].changedFileIdNew = selectedId;
changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text;
@ -904,6 +907,17 @@ function initChangedData(changeFileId) {
changeTemp[i].targetFileVersion = changeTemp[i].targetFiles[j].version;
changeTemp[i].targetMethodId = changeTemp[i].methodId;
changeTemp[i].targetCategory = changeTemp[i].category;
// 更新界面手册
if (selectedTaskId != '') {
var outputName = (changeTemp[i].category == 'process' ? '流程' : changeTemp[i].category == 'data' ? '表单' : changeTemp[i].category == 'control' ? '制度' : '') + '手册';
var targetFileName2 = changeTemp[i].targetFiles[j].text + ' V' + changeTemp[i].targetFiles[j].version + '-' + outputName + '</a><span id="download_output_' + changeTemp[i].changeFileId + '" style="cursor: pointer;" onclick="downloadReport(\'' + changeTemp[i].changeFileId + '\',\'' + changeTemp[i].taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>';
$('#report_' + changeFileId).html('<a href="javascript:void(0);" onclick="openReportFile(\'' + selectedTaskId + '\')">' + targetFileName2 + '</a>');
} else {
$('#report_' + changeFileId).html('无');
}
break;
}
}
@ -1261,7 +1275,8 @@ function queryBatchReport(data) {
// 创建流程手册
function createReport(category, method, uuid, taskId) {
if (category == 'process' && method != "process.evc" && method != 'default') {
debugger;
if ((category == 'process' || category == 'control' || category == 'data') && method != 'default') {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
@ -1281,6 +1296,8 @@ function createReport(category, method, uuid, taskId) {
}
}
});
} else {
$.simpleAlert('不支持创建手册');
}
return taskId;
}
@ -1290,7 +1307,7 @@ function createBatchReport(data, createTime) {
var ids = [];
for (var i = 0; i < data.length; i++) {
var temp = data[i];
if (temp.category == 'process' && temp.methodId != "process.evc" && temp.methodId != 'default') {
if ((temp.category == 'process' || temp.category == 'control' || temp.category == 'data') && temp.methodId != 'default') {
ids.push(temp.publishFileId);
}
}
@ -1354,14 +1371,22 @@ function getVersionsAndCreateReport(data, createTime) {
return data;
}
// 获取手册专属名称
function getOutputName(category) {
return (category == 'process' ? '流程' : category == 'data' ? '表单' : category == 'control' ? '制度' : '') + '手册';
}
//单个流程立即创建流程手册
function quickCreateReport(obj, object, type) {
debugger;
var taskId;
var category = obj.category;
var method = obj.methodId;
var uuid = obj.id === undefined ? obj.publishFileId: obj.id;
if (isHighSecurity){
uuid = uuid == undefined ? obj.changedFileIdNew : uuid;
var uuid = '';
if (type == 'new') {
uuid = obj.publishFileId;
} else if (type == 'change') {
uuid = obj.changedFileIdNew;
}
$.simpleAlert("正在创建", "loading");
taskId = createReport(category, method, uuid, taskId);
@ -1373,32 +1398,34 @@ function quickCreateReport(obj, object, type) {
if(isHighSecurity){
//更新数据记录
if (type == 'new') {
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '.0-流程手册';
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category);
$(object).text(fileName);
} else if (type == 'change') {
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '.0-流程手册';
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category);
$(object).text(targetFileName);
}
}else{
debugger;
//更新数据记录
if (type == 'new') {
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '.0-流程手册';
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category);
$(object).text(fileName);
for (var i = 0; i < newTemp.length; i++) {
if (newTemp[i].id == uuid) {
if (newTemp[i].publishFileId == uuid) {
newTemp[i].taskId = taskId;
}
}
} else if (type == 'change') {
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '.0-流程手册';
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category);
$(object).text(targetFileName);
for (var i = 0; i < changeTemp.length; i++) {
if (changeTemp[i].id == uuid) {
if (changeTemp[i].changedFileIdNew == uuid) {
changeTemp[i].taskId = taskId;
}
}
}
}
$(object).parent().append('<span id="download_output_' + uuid + '" style="cursor: pointer;" onclick="downloadReport(\'' + uuid + '\',\'' + taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>');
}
// 清空树结构
@ -1464,24 +1491,24 @@ function deleteFile(type) {
tempIds.push($(this).attr('data-id'));
}
});
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
repositoryIds: JSON.stringify(tempIds),
wsId : wsId,
sid: sid,
isApproval: 0
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : true,
data : param,
success : function(r) {},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("", 'error');
}
});
// var param = {
// cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
// repositoryIds: JSON.stringify(tempIds),
// wsId : wsId,
// sid: sid,
// isApproval: 0
// };
// $.ajax({
// url : "./jd",
// type : "POST",
// dataType : "JSON",
// async : true,
// data : param,
// success : function(r) {},
// error : function(XMLHttpRequest, textStatus, errorThrown) {
// $.simpleAlert("", 'error');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < newTemp.length; m++) {
if (tempIds[j] == newTemp[m].publishFileId) {
@ -1529,24 +1556,24 @@ function deleteFile(type) {
tempIds.push($(this).attr('data-id'));
}
});
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
repositoryIds: JSON.stringify(tempIds),
wsId : wsId,
sid: sid,
isApproval: 0
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : true,
data : param,
success : function(r) {},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("", 'error');
}
});
// var param = {
// cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
// repositoryIds: JSON.stringify(tempIds),
// wsId : wsId,
// sid: sid,
// isApproval: 0
// };
// $.ajax({
// url : "./jd",
// type : "POST",
// dataType : "JSON",
// async : true,
// data : param,
// success : function(r) {},
// error : function(XMLHttpRequest, textStatus, errorThrown) {
// $.simpleAlert("", 'error');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < changeTemp.length; m++) {
if (tempIds[j] == changeTemp[m].changeFileId) {
@ -1594,24 +1621,24 @@ function deleteFile(type) {
tempIds.push($(this).attr('data-id'));
}
});
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
repositoryIds: JSON.stringify(tempIds),
wsId : wsId,
sid: sid,
isApproval: 0
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : true,
data : param,
success : function(r) {},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("", 'error');
}
});
// var param = {
// cmd: 'com.actionsoft.apps.coe.pal.publisher_update_isApproval_status',
// repositoryIds: JSON.stringify(tempIds),
// wsId : wsId,
// sid: sid,
// isApproval: 0
// };
// $.ajax({
// url : "./jd",
// type : "POST",
// dataType : "JSON",
// async : true,
// data : param,
// success : function(r) {},
// error : function(XMLHttpRequest, textStatus, errorThrown) {
// $.simpleAlert("", 'error');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < stopTemp.length; m++) {
if (tempIds[j] == stopTemp[m].stopFileId) {
@ -1780,7 +1807,7 @@ function saveFormData(type) {
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
if (tempData.length > 0) {
for (var i = 0; i < tempData.length; i++) {
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version + '.0';
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version;
}
}
var options = {
@ -1809,6 +1836,7 @@ function formSave(isTransact){
$.simpleAlert('发布内容不能为空', 'info');
return false;
}
debugger;
var index = 0;
if (!($("#publisher_new_tr").css('display') == 'none') && newTemp.length > 0) {
index++;
@ -1832,7 +1860,7 @@ function formSave(isTransact){
for (var i = 0; i < changeTemp.length; i++) {
if (changeTemp[i].changedFileIdNew == "") {
flag = true;
msg += '<br>' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion + '.0';
msg += '<br>' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion;
}
}
if (flag) {
@ -1870,7 +1898,7 @@ function formSave(isTransact){
for (var j = 0; j < stopTempData.length; j++) {
if (changeTempData[i].changeFileId == stopTempData[j].stopFileId) {
$.simpleAlert('close');
$.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + '.0' + "<br>在变更流程和停用流程中同时存在,不允许办理", 'error');
$.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + "<br>在变更流程和停用流程中同时存在,不允许办理", 'error');
return false;
}
}
@ -1925,7 +1953,7 @@ function formSave(isTransact){
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
if (tempData.length > 0) {
for (var i = 0; i < tempData.length; i++) {
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version + '.0';
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version;
}
}
var options = {
@ -2219,3 +2247,26 @@ function listenCloseEvent() {
});
}
}
function downloadReport(uuid, taskId) {
awsui.ajax.request({
type: "POST",
url: "./jd",
async: false,
data: {
sid: sid,
cmd: "com.actionsoft.apps.coe.pal.publisher_output_download",
taskId: taskId,
uuid: uuid
},
success : function(r) {
debugger;
if (r.result == "ok") {
debugger;
window.open (r.data.url);
} else {
}
}
});
}

View File

@ -228,7 +228,7 @@ var changeOption;
*/
function initPublishData(data, type, isEnd, proNumber) {
if (type == 'new') {
var fileName = data.publishFileName + ' V' + data.fileVersion + '.0';
var fileName = data.publishFileName + ' V' + data.fileVersion;
var aHtml = '<a class="link" href="javascript:void(0);" onclick="openPortalPage(\'' + data.publishFileId + '\', \'' + data.taskId + '\')">' + fileName + '</a>';
$('#publisher_new_file_name').children('span.file_name').html(aHtml);
$('#publisher_new_file_id').val(data.publishFileId);
@ -250,14 +250,14 @@ function initPublishData(data, type, isEnd, proNumber) {
if (type == 'change') {
changeData = data;
// 变更文件处理
var sourceFileName = data.changeFileName + ' V' + data.fileVersion + '.0';
var sourceFileName = data.changeFileName + ' V' + data.fileVersion;
$('#publisher_change_source_file_name').children('span.file_name').html(sourceFileName);
$('#publisher_change_source_file_id').val(data.changeFileId);
// 变更目标文件处理
var targetFileName = "";
if (data.changedFileNameNew != undefined && data.changedFileNameNew != '') {
targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion + '.0';
targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion;
}
var targetId = "";
if (data.changedFileIdNew != undefined && data.changedFileIdNew != '') {
@ -288,7 +288,7 @@ function initPublishData(data, type, isEnd, proNumber) {
var flag = false;
for (var i = 0; i < data.targetFiles.length; i++) {
var temp = data.targetFiles[i];
var name = temp.text + ' V' + temp.version + '.0';
var name = temp.text + ' V' + temp.version;
var obj = {id:temp.id, text:name};
opt1.data.push(obj);
if (targetId == temp.id) {
@ -324,7 +324,7 @@ function initPublishData(data, type, isEnd, proNumber) {
}
}
if (type == 'stop') {
var fileName = data.stopFileName + ' V' + data.fileVersion + '.0';
var fileName = data.stopFileName + ' V' + data.fileVersion;
var aHtml = '<a class="link" href="javascript:void(0);" onclick="openPortalPage(\'' + data.stopFileId + '\', \'' + data.taskId + '\')">' + fileName + '</a>';
$('#publisher_stop_file_name').children('span.file_name').html(aHtml);
$('#publisher_stop_file_id').val(data.stopFileId);
@ -957,7 +957,7 @@ function formSave(isTransact){
if (r.result == 'error') {
flag = true;
var data = r.data.data;
var name = data.name + ' V' + data.version + '.0';
var name = data.name + ' V' + data.version;
console.log(data);
tempName = name;
}