apps/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple.js

2509 lines
82 KiB
JavaScript
Raw Normal View History

2022-06-28 01:22:45 +08:00
var sid;
var teamId;
var wsId;
var processInstId;
var initTree;
var editPerm = false;
var closeFormPage = false;
var searchType;
var pageLimit = 10;
// 数据记录
var newTemp;
var changeTemp;
var stopTemp;
// 树结构选择数据记录
var treeCheckedNewArr = [];
var treeCheckedChangeArr = [];
var treeCheckedStopArr = [];
// 统一中文变量
var varDutyDept = "责任部门";
var varDutyUser = "责任人";
// 页码记录
var newPageSetting = {
2022-07-27 18:25:35 +08:00
pageNum:1,
start:1
2022-06-28 01:22:45 +08:00
}
var changePageSetting = {
2022-07-27 18:25:35 +08:00
pageNum:1,
start:1
2022-06-28 01:22:45 +08:00
}
var stopPageSetting = {
2022-07-27 18:25:35 +08:00
pageNum:1,
start:1
2022-06-28 01:22:45 +08:00
}
var isHighSecurity;
$(document).ready(function(){
getWsId();
2022-06-28 01:22:45 +08:00
$('td,th').css('padding-top','0px');
$('td,th').css('padding-bottom','0px');
// $('#alertMsg').css('background', '#fff');
$('#OPTIONTYPE_0').closest('td').width('10%');
$('#OPTIONTYPE_1').closest('td').width('10%');
initParam();// 初始化公共参数
initHtml();// 初始化页面
initCheckAll();// 初始化表头多选框
initContentData();// 初始化内容数据
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
// 初始化表格宽度
initTableWidth();
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
initPagination();// 初始化页码
initOptButton();
// listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉
})
//获取wsid
function getWsId() {
var param = {
sid : $("#sid").val(),
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_getWsId"
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
async: false,
success : function(r) {
if (r.result == 'ok') {
var wsId=$("#WSID").val();
if(wsId==""){
$("#WSID").val(r.data.wsId);
}
}
}
});
}
2022-06-28 01:22:45 +08:00
var paginationSetting = {
pageLimit: pageLimit,
showItem: 10,
currentPage: 0,
ellipseCount: 1,
linkTo: "#",
prevText: "上一页",
nextText: "下一页",
ellipseText: "...",
prevShowAlways: true,
nextShowAlways: true,
showIfSinglePage: true,
loadFirstPage: false,
showDisplay: true,
display: "显示 {0} 到 {1} 条, 共 {2} 条"
};
// 初始化全选
function initCheckAll() {
$("input[name=checkAll]").on("ifChanged",function(){
2022-07-27 18:25:35 +08:00
var checkId = $(this).attr("id");
2022-06-28 01:22:45 +08:00
if($(this).prop("checked")){
2022-07-27 18:25:35 +08:00
// 设置当前页被选中
if (checkId == 'new_check_all') {
$('#publish_new_tbody').find('input[name="check"]').check("option", "checked", true);
}
2022-06-28 01:22:45 +08:00
if (checkId == 'change_check_all') {
$('#publish_change_tbody').find('input[name="check"]').check("option", "checked", true);
}
if (checkId == 'stop_check_all') {
$('#publish_stop_tbody').find('input[name="check"]').check("option", "checked", true);
}
2022-07-27 18:25:35 +08:00
} else {
// 设置当前页取消选中
if (checkId == 'new_check_all') {
$('#publish_new_tbody').find('input[name="check"]').check("option", "checked", false);
}
2022-06-28 01:22:45 +08:00
if (checkId == 'change_check_all') {
$('#publish_change_tbody').find('input[name="check"]').check("option", "checked", false);
}
if (checkId == 'stop_check_all') {
$('#publish_stop_tbody').find('input[name="check"]').check("option", "checked", false);
}
2022-07-27 18:25:35 +08:00
}
2022-06-28 01:22:45 +08:00
});
}
// 初始化表格宽度
function initTableWidth() {
$(".data-table [class*=width_]").each(function(){
var className = $(this).attr("class");
var percent = parseInt(className.substr(6, 2));
$(this).css({"width" : percent + '%'});
});
}
// 初始化页数
function initPagination() {
initNewPagination(0);
initChangePagination(0);
initStopPagination(0);
}
function initNewPagination(currentPage) {
var copy1 = $.extend(true, {}, paginationSetting);
copy1.currentPage = currentPage;
copy1.callback = function (pageNum, start, dom) {
newPageSetting.pageNum = pageNum;
newPageSetting.start = start;
initPublishData(newTemp, 'new', pageNum, start);
return false;
}
$("#new_pagination").pagination(newTemp.length, copy1);
}
function initChangePagination(currentPage) {
var copy2 = $.extend(true, {}, paginationSetting);
copy2.currentPage = currentPage;
copy2.callback = function (pageNum, start, dom) {
changePageSetting.pageNum = pageNum;
changePageSetting.start = start;
initPublishData(changeTemp, 'change', pageNum, start);
return false;
}
$("#change_pagination").pagination(changeTemp.length, copy2);
}
function initStopPagination(currentPage) {
var copy3 = $.extend(true, {}, paginationSetting);
copy3.currentPage = currentPage;
copy3.callback = function (pageNum, start, dom) {
stopPageSetting.pageNum = pageNum;
stopPageSetting.start = start;
initPublishData(stopTemp, 'stop', pageNum, start);
return false;
}
$("#stop_pagination").pagination(stopTemp.length, copy3);
}
function initOptButton() {
if (!editPerm) {
$('#publish_new_button, #publish_change_button, #publish_stop_button').remove();
$('#new_check_all, #change_check_all, #change_stop_all').check("disable");
}
}
// 初始化自定义内容不能写到html 文件中,表单会被平台自动调整的不成样子
function initHtml() {
var dialogHtml = '';
2022-07-27 18:25:35 +08:00
dialogHtml += '<!-- 新增模态窗 -->';
dialogHtml += '<div class="awsui-size-x-large awsui-hide" id="publisher_dialog">';
dialogHtml += '<div style="padding:20px;">';
dialogHtml += '<div id="dialogMain" class="awsui-container-fluid">';
dialogHtml += '<div class="awsui-row">';
dialogHtml += '<div class="awsui-col-xs-1 awsui-col-sm-1 awsui-col-md-1 awsui-col-lg-1 awsui-text">文件名</div>';
dialogHtml += '<div class="awsui-col-xs-10 awsui-col-sm-10 awsui-col-md-10 awsui-col-lg-10 awsui-form-parent">';
dialogHtml += '<span class="awsui-input-wrapper" style="cursor:pointer;" onclick="queryTree();">';
dialogHtml += '<input id="publisher_dialog_name" type="text" placeholder="请选择..." readonly value="" class="awsui-input" style="cursor:pointer;"/>';
dialogHtml += '<span class="awsui-input-suffix">';
dialogHtml += '<i class="awsui-iconfont awsui-cursor">&#59113;</i>';
dialogHtml += '</span>';
dialogHtml += '</span>';
dialogHtml += '</div>';
dialogHtml += '</div>';
dialogHtml += '<div class="awsui-row">';
dialogHtml += '<div id="descCol" class="awsui-col-xs-1 awsui-col-sm-1 awsui-col-md-1 awsui-col-lg-1 awsui-textar">说明</div>';
dialogHtml += '<div class="awsui-col-xs-10 awsui-col-sm-10 awsui-col-md-10 awsui-col-lg-10 awsui-form-parent">';
dialogHtml += '<textarea id="publisher_dialog_desc" type="text" placeholder="请输入文本..." rows="4" class="awsui-input"></textarea>';
dialogHtml += '</div>';
dialogHtml += '</div>';
//非三员管理显示创建
if (!isHighSecurity){
dialogHtml += '<div id="reportType" class="awsui-row">';
dialogHtml += '<div class="awsui-col-xs-2 awsui-col-sm-2 awsui-col-md-2 awsui-col-lg-2 awsui-text required">创建手册</div>';
dialogHtml += '<div style="position: relative;left: -40px;" class="awsui-col-xs-9 awsui-col-sm-9 awsui-col-md-9 awsui-col-lg-9 awsui-form-parent">';
dialogHtml += '<input class="awsui-radio" name="radiox1" id="radio1" value="newReport" type="radio" >';
dialogHtml += '<label class="awsui-radio-label" for="radio1">立即</label>';
dialogHtml += '<input class="awsui-radio" name="radiox1" id="radio2" value="oldreport" type="radio">';
dialogHtml += '<label class="awsui-radio-label" for="radio2">提交(办理)时</label>';
dialogHtml += '</div>';
dialogHtml += '</div>';
dialogHtml += '</div>';
dialogHtml += '<div id="reportTypeAlert" class="awsui-row">';
dialogHtml += '<div class="awsui-col-xs-1 awsui-col-sm-1 awsui-col-md-1 awsui-col-lg-1 awsui-text"></div>';
dialogHtml += '<div style="position: relative;left: 12px;" class="awsui-col-xs-10 awsui-col-sm-10 awsui-col-md-10 awsui-col-lg-10 awsui-form-parent">';
dialogHtml += '<div style="height: 57px;line-height:15px; width: 486px;border: 1px solid rgb(243, 143, 14);box-shadow: 0 1px 5px 0 rgba(0,0,0,0.2);border-radius: 3px;background-color: #FCFDD9;opacity: 0.5; padding: 5px;">';
dialogHtml += '<b>立即</b>:点击确定后需等待创建流程手册完成后才可以进行下一步操作,一次性选择的流程数量较多时耗费时间长;<br><b>提交(办理)时</b>:表单进行提交时进行流程手册的创建,<b>若一次性选择流程数量较多,建议选择此项</b>';
dialogHtml += '</div>';
dialogHtml += '</div>';
dialogHtml += '</div>';
}
dialogHtml += '<div id="loadingImg" style="width:100px;height:100px;text-align:center;vertical-align: middle;margin: auto;display:none;" class="awsui-code-demo"></div>';
dialogHtml += '</div>';
dialogHtml += '</div>';
dialogHtml += '<!-- 树结构模态窗 -->';
dialogHtml += '<div id="treeDialog" border="0" style="width: 700px; display: none;" title="流程资产库">';
dialogHtml += '<div id="searchData" class="awsui-form-input">';
dialogHtml += '</div>';
dialogHtml += '<div id="autoSearchProcessDiv" style="z-index: 999;position:absolute; background-color:white;min-width: 208px; max-height: 340px; overflow: auto; top: 80px; left: 16px; border: 1px solid #c5c5c5; display: none;">';
dialogHtml += '</div>';
dialogHtml += '<div id="treeDataDiv" border="0" style="margin: 8px; height: 350px;">';
dialogHtml += '</div>';
dialogHtml += '</div>';
$('body').append(dialogHtml);
$('input[name=radiox1]').check({radioClass:'iradio_minimal-grey'});
2022-06-28 01:22:45 +08:00
$('#publisher_new_td').html('<div id="contentDiv1" class="aws-form-ux-grid" border="0"></div>');
$('#publisher_change_td').html('<div id="contentDiv2" class="aws-form-ux-grid" border="0"></div>');
$('#publisher_stop_td').html('<div id="contentDiv3" class="aws-form-ux-grid" border="0"></div>');
var newHtml = '';
newHtml += '<!-- 发布流程 -->';
newHtml += '<div id="publisher_new" border="1">';
newHtml += '<!-- 操作按钮 -->';
newHtml += '<div id="publish_new_button" style="padding:5px 10px 5px 10px;">';
2022-08-29 23:37:47 +08:00
if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
2022-09-02 09:55:44 +08:00
newHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'new\');">新增</button>';
// newHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'new\');">保存</button>';
newHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'new\');">删除</button>';
}
//newHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'new\');">新增</button>';
// newHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'new\');">保存</button>';
//newHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'new\');">删除</button>';
2022-06-28 01:22:45 +08:00
newHtml += '</div>';
newHtml += '<div id="publish_new_content">';
newHtml += '<table class="awsui-table awsui-table-thin awsui-table-hover data-table">';
newHtml += '<thead>';
newHtml += '<tr>';
newHtml += '<th style="background-color:#fff;" class="width_5"><input name="checkAll" id="new_check_all" type="checkbox" class="awsui-checkbox"></th>';
newHtml += '<th style="background-color:#fff;" class="width_5">序号</th>';
2022-09-20 17:47:38 +08:00
newHtml += '<th style="background-color:#fff;" class="width_30">流程制度模型</th>';
newHtml += '<th style="background-color:#fff;" class="width_35">文件预览</th>';
newHtml += '<th style="background-color:#fff;" class="width_25">文件编号</th>';
2022-06-28 01:22:45 +08:00
newHtml += '</tr>';
newHtml += '</thead>';
newHtml += '<tbody id="publish_new_tbody"></tbody>';
newHtml += '</table>';
newHtml += '<div id="new_pagination" style="display:none;"></div>';
newHtml += '</div>';
newHtml += '</div>';
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
var changeHtml = '';
changeHtml += '<!-- 变更流程 -->';
changeHtml += '<div id="publisher_change" border="1">';
changeHtml += '<!-- 操作按钮 -->';
changeHtml += '<div id="publish_change_button" style="padding:5px 10px 5px 10px;">';
2022-08-29 23:37:47 +08:00
if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
2022-09-02 09:55:44 +08:00
changeHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'change\');">新增</button>';
2022-06-28 01:22:45 +08:00
// changeHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'change\');">保存</button>';
changeHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'change\');">删除</button>';
2022-09-02 09:55:44 +08:00
}
//changeHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'change\');">新增</button>';
// changeHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'change\');">保存</button>';
//changeHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'change\');">删除</button>';
if(!$("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
editPerm=false;
}
2022-06-28 01:22:45 +08:00
changeHtml += '</div>';
changeHtml += '<div id="publish_change_content">';
changeHtml += '<table class="awsui-table awsui-table-thin awsui-table-hover data-table">';
changeHtml += '<thead>';
changeHtml += '<tr>';
2022-09-20 17:47:38 +08:00
changeHtml += '<th style="background-color:#fff;" class="width_2"><input name="checkAll" id="change_check_all" type="checkbox" class="awsui-checkbox"></th>';
changeHtml += '<th style="background-color:#fff;" class="width_2">序号</th>';
changeHtml += '<th style="background-color:#fff;" class="width_20">流程制度模型</th>';
changeHtml += '<th style="background-color:#fff;" class="width_20">变更后流程制度模型</th>';
changeHtml += '<th style="background-color:#fff;" class="width_35">文件预览</th>';
changeHtml += '<th style="background-color:#fff;" class="width_20">文件编号</th>';
2022-06-28 01:22:45 +08:00
changeHtml += '</tr>';
changeHtml += '</thead>';
changeHtml += '<tbody id="publish_change_tbody"></tbody>';
changeHtml += '</table>';
changeHtml += '<div id="change_pagination" style="display:none;"></div>';
changeHtml += '</div>';
changeHtml += '</div>';
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
var stopHtml = '';
stopHtml += '';
stopHtml += '<!-- 停用流程 -->';
stopHtml += '<div id="publisher_stop" border="1">';
stopHtml += '<!-- 操作按钮 -->';
stopHtml += '<div id="publish_stop_button" style="padding:5px 10px 5px 10px;">';
2022-09-02 09:55:44 +08:00
if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
stopHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'stop\');">新增</button>';
// stopHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'stop\');">保存</button>';
stopHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'stop\');">删除</button>';
}
//stopHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'stop\');">新增</button>';
// stopHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'stop\');">保存</button>';
//stopHtml += '<button name="delete" type="button" class="awsui-btn awsui-btn-danger" onclick="deleteFile(\'stop\');">删除</button>';
2022-06-28 01:22:45 +08:00
stopHtml += '</div>';
stopHtml += '<div id="publish_stop_content">';
stopHtml += '<table class="awsui-table awsui-table-thin awsui-table-hover data-table">';
stopHtml += '<thead>';
stopHtml += '<tr>';
stopHtml += '<th style="background-color:#fff;" class="width_5"><input name="checkAll" id="stop_check_all" type="checkbox" class="awsui-checkbox"></th>';
stopHtml += '<th style="background-color:#fff;" class="width_5">序号</th>';
2022-09-20 17:47:38 +08:00
stopHtml += '<th style="background-color:#fff;" class="width_30">流程制度模型</th>';
stopHtml += '<th style="background-color:#fff;" class="width_25">文件预览</th>';
2022-07-29 21:07:33 +08:00
stopHtml += '<th style="background-color:#fff;" class="width_35">文件编号</th>';
2022-06-28 01:22:45 +08:00
stopHtml += '</tr>';
stopHtml += '</thead>';
stopHtml += '<tbody id="publish_stop_tbody"></tbody>';
stopHtml += '</table>';
stopHtml += '<div id="stop_pagination" style="display:none;"></div>';
stopHtml += '</div>';
stopHtml += '</div>';
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
$('#contentDiv1').append(newHtml);
$('#contentDiv2').append(changeHtml);
$('#contentDiv3').append(stopHtml);
$("#contentDiv1 .awsui-checkbox,#contentDiv2 .awsui-checkbox,#contentDiv3 .awsui-checkbox").check();
}
// 初始化参数
function initParam() {
teamId = $("#TEAMID").val();
sid = $("#sid").val();
wsId = $("#WSID").val();
processInstId = $("#processInstId").val();
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_high_security_mode_query"
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
async: false,
success : function(r) {
if (r.result == 'ok') {
isHighSecurity = r.data.isHighSecurity;
}
}
});
}
// 初始化内容数据
function initContentData() {
var param = {
2022-07-27 18:25:35 +08:00
cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query',
processInstId: processInstId,
wsId : wsId,
sid: sid
};
2022-06-28 01:22:45 +08:00
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
var isEnd = r.data.isEnd;
var proNumber = r.data.proNumber;
if (proNumber) {
editPerm = proNumber;
}
closeFormPage = r.data.closeFormPage;
var newData = r.data.newData;
newTemp = newData;
var changeData = r.data.changeData;
changeTemp = changeData;
var stopData = r.data.stopData;
stopTemp = stopData;
var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
if (!$.isEmptyObject(newData)) {
$('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'new');// 显示
// 更新数据
$("#OPTIONTYPE_0").check("option","checked", true);
initPublishData(newData, 'new', 1, 1);
} else {
$("#OPTIONTYPE_0").check("option","checked", false);
$('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg);
}
if (!$.isEmptyObject(changeData)) {
$('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'change');
$("#OPTIONTYPE_1").check("option","checked", true);
initPublishData(changeData, 'change', 1, 1);
} else {
$("#OPTIONTYPE_1").check("option","checked", false);
$('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg);
}
if (!$.isEmptyObject(stopData)) {
$('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'stop');
$("#OPTIONTYPE_2").check("option","checked", true);
initPublishData(stopData, 'stop', 1, 1);
} else {
$("#OPTIONTYPE_2").check("option","checked", false);
$('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg);
}
}
});
}
var changedId = '';
2022-07-12 15:42:49 +08:00
function initPublishData(data, type, pageNumber, start){
2022-07-27 18:25:35 +08:00
showlist(data, type, pageNumber, start);
2022-07-12 15:42:49 +08:00
}
2022-06-28 01:22:45 +08:00
// 初始化数据
2022-07-12 15:42:49 +08:00
function selectPublishData(data, type, pageNumber, start) {
2022-08-19 13:41:53 +08:00
//渲染到前台的流程架构L1L2L3
2022-07-27 18:25:35 +08:00
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
processInstId: processInstId,
wsId : wsId,
sid: sid,
datas:JSON.stringify(data)
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : true,
data : param,
success : function(r) {
var info = r.data.info;
var L1 = r.data.data.Process_Architecture_L1;
var L2 = r.data.data.Process_Architecture_L2;
var L3 = r.data.data.Process_Architecture_L3;
var L1old = ui("LEVEL_1_PROCESS_NAME");
var L2old = ui("LEVEL_2_PROCESS_NAME");
var L3old = ui("LEVEL_3_PROCESS_NAME");
2022-09-20 17:47:38 +08:00
ui("LEVEL_1_PROCESS_NAME",L1);
ui("LEVEL_2_PROCESS_NAME",L2);
ui("LEVEL_3_PROCESS_NAME",L3);
showlist(data, type, pageNumber, start);
2022-07-27 18:25:35 +08:00
//发起请求把审批人查询出来~
2022-09-20 17:47:38 +08:00
queryapprove();
ui("ADAPT_NAME_THE_COMPANY",""),
ui("ADAPT_REGION_NAME",""),
ui("APPLICABLE_PRODUCT",""),
$("#publisher_dialog").dialog("close");
2022-07-27 18:25:35 +08:00
//展示未发布过的流程
//data = r.data.is_not_publish_data;
}
});
2022-07-12 15:42:49 +08:00
}
//by bzp
function queryapprove(){
2022-07-27 18:25:35 +08:00
var level1 =ui("LEVEL_1_PROCESS_NAME");
var level2 = ui("LEVEL_2_PROCESS_NAME");
var level3 = ui("LEVEL_3_PROCESS_NAME");
var company = ui("ADAPT_NAME_THE_COMPANY");
var region = ui("ADAPT_REGION_NAME");
var product = ui("APPLICABLE_PRODUCT");
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_getApproveInfos',
sid: sid,
level1 :ui("LEVEL_1_PROCESS_NAME"),
level2 :ui("LEVEL_2_PROCESS_NAME"),
level3 :ui("LEVEL_3_PROCESS_NAME"),
company :ui("ADAPT_NAME_THE_COMPANY"),
region :ui("ADAPT_REGION_NAME"),
product :ui("APPLICABLE_PRODUCT"),
bindid : processInstId
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : true,
data : param,
success : function(r) {
var info = r.data.data;
if(info != ''){
ui("PERSON_THREE_LEVEL_PROCESS_NO",info.AUDITOR_NO_3);
ui("PROCESS_RESPONSIBLE_PERSON_NO",info.AUDITOR_NO_2);
ui("RESPONSIBLE_PERSON1_NO",info.AUDITOR_NO_1);
ui("PERSON_THREE_LEVEL_PROCESS",info.AUDITOR3);
ui("PROCESS_RESPONSIBLE_PERSON",info.AUDITOR2);
ui("RESPONSIBLE_PERSON1",info.AUDITOR1);
2022-07-27 18:25:35 +08:00
ui("LEVEL_AUDIT_REQUIRED",info.L3_SP);
ui("SECONDARY_AUDIT_REQUIRED",info.L2_SP);
ui("LEVEL_1_AUDIT_REQUIRED",info.L1_SP);
}
}
});
2022-07-12 15:42:49 +08:00
}
//预览下载附件
function openUrl(url) {
//$.simpleAlert("文件正在处理", "loading");
window.open(url);
}
2022-07-12 15:42:49 +08:00
//by bzp
function showlist(data, type, pageNumber, start){
2022-06-28 01:22:45 +08:00
var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
if (type == 'new') {
$('#new_check_all').check("option", "checked", false);
if (data.length > pageLimit) {// 显示分页
$('#new_pagination').show();
}
// 加载数据
var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fName = '';
var upFileId = curr.upfileId;
if(upFileId!=''&&upFileId!=undefined){
for(var i = 0; i < upFileId.length; i++){
var upFileJson = upFileId[i]
var json=JSON.parse(upFileJson);
var upId = json.upfileId;
var upName = json.upFileName;
var openUrl = json.openUrl;
var downUrl = json.downUrl;
fName += '</p><a href="javascript:void(0);" onclick="openUrl(\'' + openUrl + '\')">' + upName + '&nbsp</a><span id="download_output_' + upId + '" style="cursor: pointer;" onclick="openUrl(\'' + downUrl + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span></p>';
}
}
2022-07-27 18:25:35 +08:00
var fileName = curr.publishFileName + ' V' + curr.fileVersion;
var outputName = getOutputName(curr.category, curr.methodId);
2022-09-02 09:55:44 +08:00
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>';
2022-06-28 01:22:45 +08:00
var quickCreate = "<a href='javascript:void(0);' onclick='quickCreateReport(" + JSON.stringify(curr) + ", $(this), \"new\")'>立即创建</a>";
2022-07-15 19:15:15 +08:00
var processNumber = '';
if(curr.processNumber != undefined){
2022-07-27 18:25:35 +08:00
processNumber = curr.processNumber;
2022-07-15 19:15:15 +08:00
}
2022-06-28 01:22:45 +08:00
reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
// 三员管理taskId为new标识未创建手册
if (isHighSecurity){
reportName = curr.taskId == 'new' ? quickCreate : reportName;
}
var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
var textareaPerm = editPerm ? '' : 'readonly';
html += '<tr>';
html += '<td ' + tableTdCss + '><input name="check" ' + checkboxPerm + ' class="awsui-checkbox" data-id="' + curr.publishFileId + '" type="checkbox" type="awsui-checkbox"></td>';
html += '<td ' + tableTdCss + '>' + s + '</td>';
html += '<td ' + tableTdCss + '><a href="javascript:void(0);" onclick="openPortalPage(\'' + curr.publishFileId + '\', \'' + curr.taskId + '\')">' + fileName + '</a></td>';
2022-09-20 17:47:38 +08:00
html += '<td ' + tableTdCss + '></p>' + reportName + fName+'</td>';
//html += '<td ' + tableTdCss + '>' + fName + '</td>';
2022-07-15 19:15:15 +08:00
//html += '<td style="padding:1px;"><textarea onblur="changeDesc(\'new\',\'' + curr.publishFileId + '\', this)" style="width:100%;height:30px;" ' + textareaPerm + ' class="awsui-input">' + curr.publishDesc + '</textarea></td>';
html += '<td style="padding:1px;"><span>'+ processNumber +'</span></td>';
2022-06-28 01:22:45 +08:00
html += '</tr>';
}
}
$('#publish_new_tbody').empty().html(html);
$("#publish_new_tbody .awsui-checkbox").check();
}
if (type == 'change') {
2022-07-27 18:25:35 +08:00
var createButtonObj = {};
2022-06-28 01:22:45 +08:00
$('#change_check_all').check("option", "checked", false);
if (data.length > pageLimit) {// 显示分页
$('#change_pagination').show();
}
// 加载数据
var html = '';
var tempSelect = [];
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fName = '';
var upFileId = curr.upfileId;
2022-09-21 19:50:55 +08:00
var changNumer = '';
if(curr.changedNumber != undefined){
changNumer = curr.changedNumber;
}
if(upFileId!=''&&upFileId!=undefined){
for(var i = 0; i < upFileId.length; i++){
var upFileJson = upFileId[i]
var json=JSON.parse(upFileJson);
var upId = json.upfileId;
var upName = json.upFileName;
var openUrl = json.openUrl;
var downUrl = json.downUrl;
fName += '</p><a href="javascript:void(0);" onclick="openUrl(\'' + openUrl + '\')">' + upName + '&nbsp</a><span id="download_output_' + upId + '" style="cursor: pointer;" onclick="openUrl(\'' + downUrl + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span></p>';
}
}
2022-07-27 18:25:35 +08:00
var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
2022-06-28 01:22:45 +08:00
// 变更目标文件处理
var targetFileName = "";
if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
2022-07-27 18:25:35 +08:00
targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
2022-06-28 01:22:45 +08:00
}
var targetId = "";
if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
targetId = curr.changedFileIdNew;
}
var outputName = getOutputName(curr.category, curr.methodId);
2022-07-27 18:25:35 +08:00
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>';
2022-06-28 01:22:45 +08:00
var quickCreate = "<a href='javascript:void(0);' onclick='quickCreateReport(" + JSON.stringify(curr) + ", $(this), \"change\")'>立即创建</a>";
2022-07-27 18:25:35 +08:00
createButtonObj[curr.changeFileId] = quickCreate;
reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
2022-06-28 01:22:45 +08:00
// 三员管理taskId为change标识未创建手册
if (isHighSecurity){
reportName = curr.taskId == 'change' ? quickCreate : reportName;
}
if($("#userTaskDefId").val()=='obj_c9e93c345010000148211f97f9c07f00'){
editPerm=false;
}
if($("#userTaskDefId").val()=='obj_c9e5a2e6a2c00001891c127ce9309250'){
editPerm=false;
2022-09-16 14:01:53 +08:00
}
2022-06-28 01:22:45 +08:00
var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
var textareaPerm = editPerm ? '' : 'readonly';
2022-07-27 18:25:35 +08:00
html += '<tr>';
html += '<td ' + tableTdCss + '><input name="check" ' + checkboxPerm + ' class="awsui-checkbox" data-id="' + curr.changeFileId + '" type="checkbox" type="awsui-checkbox"></td>';
html += '<td ' + tableTdCss + '>' + s + '</td>';
html += '<td ' + tableTdCss + '>' + sourceFileName + '</td>';
var selectPerm = editPerm ? '<select id="change_' + curr.changeFileId + '"></select>' : '<a href="javascript:void(0);" onclick="openPortalPage(\'' + targetId + '\', \'' + curr.taskId + '\')">' + targetFileName + '</a>';
html += '<td ' + tableTdCss + '>' + selectPerm + '</td>';
html += '<td ' + tableTdCss + '></p>' + reportName + fName +'</td>';
2022-09-20 17:47:38 +08:00
//html += '<td ' + tableTdCss + ' id="report_' + curr.changeFileId + '">' + reportName + '</td>';
//html += '<td ' + tableTdCss + '>' + fName + '</td>';
2022-09-21 19:50:55 +08:00
html += '<td ' + tableTdCss + '>' + changNumer + '</td>';
//html += '<td style="padding:1px;"><textarea onblur="changeDesc(\'change\',\'' + curr.changeFileId + '\', this)" style="width:100%;height:30px;" ' + textareaPerm + ' class="awsui-input">' + curr.changedDesc + '</textarea></td>';
2022-07-27 18:25:35 +08:00
html += '</tr>';
// select2下拉框处理
var opt1 = {
data : []
2022-06-28 01:22:45 +08:00
};
2022-07-27 18:25:35 +08:00
var flag = false;
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;
2022-06-28 01:22:45 +08:00
var obj = {id:temp.id, text:name, name:temp.text, version:temp.version};
opt1.data.push(obj);
if (targetId == temp.id) {
flag = true;
}
2022-07-27 18:25:35 +08:00
}
var tempObj = {};
tempObj.opt = opt1;
tempObj.flag = flag;
tempObj.targetId = targetId;
tempObj.selectId = 'change_' + curr.changeFileId;
tempObj.taskId = curr.taskId;
tempObj.id = curr.changeFileId;
tempObj.category = curr.category;
tempObj.methodId = curr.methodId;
2022-07-27 18:25:35 +08:00
tempSelect.push(tempObj);
2022-06-28 01:22:45 +08:00
}
}
$('#publish_change_tbody').empty().html(html);
// 初始化select2
for(var k = 0; k < tempSelect.length; k++) {
var tempObj = tempSelect[k];
$("#" + tempObj.selectId).select2(tempObj.opt);
$('.select2').width('100%');
if (tempObj.flag) {// 已选择版本
$("#" + tempObj.selectId).val(tempObj.targetId).trigger("change");// 变更
// 流程手册界面更新
if (tempObj.taskId != undefined && tempObj.taskId != '') {
// 三员管理taskId为change标识未创建手册
2022-07-27 18:25:35 +08:00
if (tempObj.taskId == 'submit_create' || tempObj.taskId == 'change') {
// $('#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 outputName = getOutputName(tempObj.category, tempObj.methodId);
2022-07-27 18:25:35 +08:00
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;
}
}
}
2022-06-28 01:22:45 +08:00
} else {
$('#report_' + tempObj.id).html('无');
}
} else {// 默认第一个版本
2022-07-27 18:25:35 +08:00
if (tempObj.opt.data.length > 0) {
2022-06-28 01:22:45 +08:00
// 获取选中的版本,获取流程手册,更新数据
initChangedData(tempObj.id);
}
}
// select改变事件
$("#" + tempObj.selectId).on("change", function (e) {
initChangedData($(this).attr('id').slice(7));
});
}
$("#publish_change_tbody .awsui-checkbox").check();
}
if (type == 'stop') {
$('#stop_check_all').check("option", "checked", false);
if (data.length > pageLimit) {// 显示分页
$('#stop_pagination').show();
}
// 加载数据
var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
2022-07-27 18:25:35 +08:00
var fileName = curr.stopFileName + ' V' + curr.fileVersion;
var outputName = getOutputName(curr.category, curr.methodId);
var reportName = '<a href="javascript:void(0);" onclick="openReportFile(\'' + curr.taskId + '\')">' + fileName + "-" + outputName + '</a><span id="download_output_' + curr.stopFileId + '" style="cursor: pointer;" onclick="downloadReport(\'' + curr.stopFileId + '\',\'' + curr.taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;">&#xe653;</i></span>';
2022-06-28 01:22:45 +08:00
reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName;
var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
var textareaPerm = editPerm ? '' : 'readonly';
html += '<tr>';
html += '<td ' + tableTdCss + '><input name="check" ' + checkboxPerm + ' class="awsui-checkbox" data-id="' + curr.stopFileId + '" type="checkbox" type="awsui-checkbox"></td>';
html += '<td ' + tableTdCss + '>' + s + '</td>';
html += '<td ' + tableTdCss + '><a href="javascript:void(0);" onclick="openPortalPage(\'' + curr.stopFileId + '\', \'' + curr.taskId + '\')">' + fileName + '</a></td>';
html += '<td ' + tableTdCss + '>' + reportName + '</td>';
html += '<td style="padding:1px;"><textarea onblur="changeDesc(\'stop\',\'' + curr.stopFileId + '\', this)" style="width:100%;height:30px;" ' + textareaPerm + ' class="awsui-input">' + curr.stopDesc + '</textarea></td>';
html += '</tr>';
}
}
$('#publish_stop_tbody').empty().html(html);
$("#publish_stop_tbody .awsui-checkbox").check();
}
}
function disabledButton() {
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', 'disabled');
}
function checkCreateReportTime() {
var isRadio1 = $('#radio1').closest('div').hasClass('checked');
var isRadio2 = $('#radio2').closest('div').hasClass('checked');
if (!isRadio1 && !isRadio2) {
return false;
} else {
return true;
}
}
// 获取报告生成时机
function getReportCreateTime() {
var createTime = 'now_create';
var isRadio1 = $('#radio1').closest('div').hasClass('checked');
if (isRadio1) {// 立即
} else {
createTime = 'submit_create';
}
return createTime;
}
// 新增
function addProcess(type) {
treeCheckedNewArr = [];
treeCheckedChangeArr = [];
treeCheckedStopArr = [];
$('#publisher_dialog_name').val('');
$('#publisher_dialog_desc').val('');
var title = type == 'new' ? '发布流程' : type == 'change' ? '变更流程' : '停用流程';
var height = 380;
2022-07-27 18:25:35 +08:00
$("#radio1").check("uncheck");
$("#radio2").check("uncheck");
if (type == 'stop') {
$('#reportType').hide();
$('#reportTypeAlert').hide();
} else {
$('#reportType').show();
$('#reportTypeAlert').show();
height = 600;
}
2022-06-28 01:22:45 +08:00
searchType = type;
$("#publisher_dialog").dialog({
width:650,
title: title,
height:height,
buttons:[
{text:'确定',cls:"blue",handler:function(){
2022-09-20 17:47:38 +08:00
debugger;
2022-07-27 18:25:35 +08:00
window.$.simpleAlert("请稍等...", "loading");
if (type == 'new') {
if (treeCheckedNewArr.length == 0) {
$.simpleAlert('发布流程不能为空');
return;
} else {
//三员管理隐藏手册创建时间
if (!checkCreateReportTime() && !isHighSecurity) {
$.simpleAlert('请选择创建流程手册的时间', 'info');
return;
}
disabledButton();
setTimeout(function() {
// 获取说明内容
var desc = $('#publisher_dialog_desc').val();
// 赋值到数据列表,更新页码
var temps = [];
for (var i = 0; i < treeCheckedNewArr.length; i++) {
var flag = true;
for (var j = 0; j < newTemp.length; j++) {
if (treeCheckedNewArr[i].id == newTemp[j].publishFileId) {
flag = false;
break;
}
}
if (flag) {
temps.push(treeCheckedNewArr[i]);
}
}
// 生成流程手册taskId
if (temps.length > 0) {
temps = createBatchReport(temps, getReportCreateTime());
// 更新到最新数据中
for (var i = 0; i < temps.length; i++) {
temps[i].publishDesc = desc;
newTemp.push(temps[i]);
}
2022-09-20 17:47:38 +08:00
//校验支持文件是否上传
2022-08-19 14:12:59 +08:00
publishFlowCheck(newTemp);
2022-07-27 18:25:35 +08:00
// 初始化页数及当前页
initNewPagination(newPageSetting.pageNum - 1);
// 初始化当前页的数据
//initPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
selectPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
}
//$("#publisher_dialog").dialog("close");
$.simpleAlert('close');
}, 200);
}
2022-06-28 01:22:45 +08:00
}
2022-07-27 18:25:35 +08:00
if (type == 'change') {
if (treeCheckedChangeArr.length == 0) {
$.simpleAlert('变更流程不能为空');
return;
} else {
//三员管理隐藏手册创建时间
if (!checkCreateReportTime() && !isHighSecurity) {
$.simpleAlert('请选择创建流程手册的时间', 'info');
return;
}
disabledButton();
setTimeout(function() {
// 获取说明内容
var desc = $('#publisher_dialog_desc').val();
// 赋值到数据列表,更新页码
var temps = [];
for (var i = 0; i < treeCheckedChangeArr.length; i++) {
var flag = true;
for (var j = 0; j < changeTemp.length; j++) {
if (treeCheckedChangeArr[i].id == changeTemp[j].changeFileId) {
flag = false;
break;
}
}
if (flag) {
temps.push(treeCheckedChangeArr[i]);
}
}
// 查询其他版本并生成流程手册taskId
if (temps.length > 0) {
temps = getVersionsAndCreateReport(temps, getReportCreateTime());
// 更新到最新数据中
for (var i = 0; i < temps.length; i++) {
temps[i].changedDesc = desc;
changeTemp.push(temps[i]);
}
// 初始化页数及当前页
initChangePagination(changePageSetting.pageNum - 1);
// 初始化当前页的数据
//initPublishData(changeTemp, type, changePageSetting.pageNumber, changePageSetting.start);
selectPublishData(changeTemp, type, changePageSetting.pageNumber, changePageSetting.start);
}
$("#publisher_dialog").dialog("close");
$.simpleAlert('close');
}, 200);
}
2022-06-28 01:22:45 +08:00
}
2022-07-27 18:25:35 +08:00
if (type == 'stop' ) {
if (treeCheckedStopArr.length == 0) {
$.simpleAlert('停用流程不能为空');
return;
} else {
disabledButton();
setTimeout(function() {
// 获取说明内容
var desc = $('#publisher_dialog_desc').val();
// 赋值到数据列表,更新页码
var temps = [];
for (var i = 0; i < treeCheckedStopArr.length; i++) {
var flag = true;
for (var j = 0; j < stopTemp.length; j++) {
if (treeCheckedStopArr[i].id == stopTemp[j].stopFileId) {
flag = false;
break;
}
}
if (flag) {
temps.push(treeCheckedStopArr[i]);
}
}
// 查询流程手册taskId
if (temps.length > 0) {
temps = queryBatchReport(temps);
// 更新到最新数据中
for (var i = 0; i < temps.length; i++) {
temps[i].stopDesc = desc;
stopTemp.push(temps[i]);
}
// 初始化页数及当前页
initStopPagination(stopPageSetting.pageNum - 1);
// 初始化当前页的数据
//initPublishData(stopTemp, type, stopPageSetting.pageNumber, stopPageSetting.start);
selectPublishData(stopTemp, type, stopPageSetting.pageNumber, stopPageSetting.start);
}
$("#publisher_dialog").dialog("close");
$.simpleAlert('close');
}, 200);
}
2022-06-28 01:22:45 +08:00
}
2022-07-27 18:25:35 +08:00
}},
2022-06-28 01:22:45 +08:00
{text:'关闭',handler:function(){$("#publisher_dialog").dialog("close");}}
2022-07-27 18:25:35 +08:00
],
2022-06-28 01:22:45 +08:00
onClose:function() {
if ($("#treeDialog").css('display') != 'none') {
2022-07-27 18:25:35 +08:00
$("#treeDialog").dialog("close");
2022-06-28 01:22:45 +08:00
}
}
});
}
// 打开流程树选择窗口
function queryTree() {
if ($("#treeDialog").css('display') == 'none') {// 防止多次打开
openQueryDataDialog(searchType);
}
}
2022-08-19 14:12:59 +08:00
2022-08-19 18:18:25 +08:00
//校验模型中支持文件附件是否上传
2022-08-19 14:12:59 +08:00
function publishFlowCheck(data) {
var ids = [];
for (var i = 0; i < data.length; i++) {
var temp = data[i];
if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
ids.push(temp.publishFileId);
}
}
2022-09-02 09:55:44 +08:00
2022-08-19 14:12:59 +08:00
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_get_publishFlow_files",
wsId: wsId,
uuids: JSON.stringify(ids)
}
$.ajax({
url : "./jd",
type : "POST",
data : param,
success : function(r) {
if (r.result == 'ok') {
if(r.data.result=='error'){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert(r.data.sb,"error",3000);
return;
}
}
}
});
}
2022-06-28 01:22:45 +08:00
// select2改变事件
function initChangedData(changeFileId) {
var selectedId = $("#change_" + changeFileId).val();// 切换后的版本id
for(var i = 0; i < changeTemp.length; i++) {
if (changeTemp[i].changeFileId == changeFileId) {
for(var j = 0; j < changeTemp[i].targetFiles.length; j++) {
if (changeTemp[i].targetFiles[j].id == selectedId) {// 当前选中
// 获取流程手册
var selectedTaskId = "";
selectedTaskId = createReport(changeTemp[i].category, changeTemp[i].methodId, selectedId, selectedTaskId);
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
// 更新数据
changeTemp[i].changedFileIdNew = selectedId;
changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text;
changeTemp[i].taskId = selectedTaskId;
changeTemp[i].targetFileVersion = changeTemp[i].targetFiles[j].version;
changeTemp[i].targetMethodId = changeTemp[i].methodId;
changeTemp[i].targetCategory = changeTemp[i].category;
2022-07-27 18:25:35 +08:00
// 更新界面手册
if (selectedTaskId != '') {
var outputName = getOutputName(changeTemp[i].category, changeTemp[i].methodId);
2022-07-27 18:25:35 +08:00
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('无');
}
2022-06-28 01:22:45 +08:00
break;
}
2022-07-27 18:25:35 +08:00
}
2022-06-28 01:22:45 +08:00
break;
}
}
}
2022-08-19 14:12:59 +08:00
2022-06-28 01:22:45 +08:00
// 打开流程文件查看页面
function openPortalPage(uuid, taskId) {
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
uuid : uuid
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
success : function(r) {
if (r.result == 'ok') {
2022-07-27 18:25:35 +08:00
window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows
2022-06-28 01:22:45 +08:00
} else {
$.simpleAlert(r.msg);
}
}
});
}
// 打开流程选择dialog
function openQueryDataDialog(type) {
$('#treeDataDiv').html('<div id="loadImg" style="width:100%;height:100%;text-align:center;vertical-align: middle;margin: auto;"></div>');
$('#searchData').html('<input id="processName" style="width:700px;" type="text" class="awsui-txt" placeholder="快速查询">');
$("#loadImg").loading({
2022-07-27 18:25:35 +08:00
description:"加载中",
size:'large',
color:'#000'
2022-06-28 01:22:45 +08:00
});
$('.awsui-loading').css('position', 'relative');
$('.awsui-loading').css('top', '60px');
$("#loading-demo-basic").loading();
$("#treeDialog").dialog({
2022-07-27 18:25:35 +08:00
buttons:[
{text:'确定',cls:"blue",handler:function(){
if (type == 'new') {
2022-09-20 17:47:38 +08:00
debugger;
2022-07-27 18:25:35 +08:00
getNewPublishBatchResult(type);
// 数据写入主dialog
var names = '';
for (var i = 0; i < treeCheckedNewArr.length; i++) {
names += treeCheckedNewArr[i].publishFileName;
if (i < treeCheckedNewArr.length - 1) {
names += ','
}
}
$('#publisher_dialog_name').val(names);
closeDialog();// 关闭窗口
} else if( type == 'change'){
getChangeBatchResult(type);
// 数据写入主dialog
var names = '';
for (var i = 0; i < treeCheckedChangeArr.length; i++) {
names += treeCheckedChangeArr[i].changeFileName;
if (i < treeCheckedChangeArr.length - 1) {
names += ','
}
}
$('#publisher_dialog_name').val(names);
closeDialog();// 关闭窗口
} else {// stop
getStopBatchResult(type);
// 数据写入主dialog
var names = '';
for (var i = 0; i < treeCheckedStopArr.length; i++) {
names += treeCheckedStopArr[i].stopFileName;
if (i < treeCheckedStopArr.length - 1) {
names += ','
}
}
$('#publisher_dialog_name').val(names);
closeDialog();// 关闭窗口
}
}},
{text:'关闭',handler:function(){
closeDialog();// 关闭窗口
}}
],
onClose:function(){
$('#autoSearchProcessDiv').empty();
$('#autoSearchProcessDiv').hide();
$('#treeDataDiv').empty();
$('#searchData').empty();
}
});
2022-06-28 01:22:45 +08:00
if (type == 'new') {
2022-07-27 18:25:35 +08:00
initPublishSearch(type);// 绑定搜索事件
2022-06-28 01:22:45 +08:00
getNotPublishTreeData(type);
} else {// stop
2022-07-27 18:25:35 +08:00
initPublishSearch(type);// 绑定搜索事件
2022-06-28 01:22:45 +08:00
getPublishedTreeData(type);
}
}
// 获取未发布文件数据结构
function getNotPublishTreeData(type) {
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag: true
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
success : function(r) {
var data = r.data.data;
2022-07-27 18:25:35 +08:00
var setting = {
checkbox: true,
checkInherit: r.data.checkInherit,
event : {
beforeExpand : loadNewData
},
dataModel : {
data: data
}
};
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
2022-06-28 01:22:45 +08:00
}
});
}
//加载type为new的树节点
function loadNewData(treeNode) {
// 如果是父节点并且存在子节点执行加载
if (treeNode) {
2022-07-27 18:25:35 +08:00
var pid;
if (typeof(treeNode) == "string") {
pid = treeNode
} else {
pid = treeNode.id;
}
2022-06-28 01:22:45 +08:00
var dataModel = {
url : "./w?sid=" + jQuery("#sid").val()
2022-07-27 18:25:35 +08:00
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid
+ "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId,
2022-06-28 01:22:45 +08:00
method : "POST",
dataType : "json"
}
initTree.refreshNode({
id : pid,
dataModel : dataModel
});
var data = initTree.getChildrenByPid(pid);
var newData = [];
for (var i=0;i<data.length;i++){
2022-07-27 18:25:35 +08:00
if (data[i].pid != pid) {
continue;
}
var v = data[i].nocheck;
if (v && data[i].id.length <= 36 && !data[i].isFolder && data[i].isPublish){
data[i].name = data[i].name + ' (已发布)';
}
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
newData.push(data[i]);
//initTree.refreshNodeById(data[i]);
}
initTree.refreshNode({
id : pid,
data : newData
});
2022-06-28 01:22:45 +08:00
}
}
// 发布类型批量结果数据回填主dialog
function getNewPublishBatchResult(type) {
2022-09-20 17:47:38 +08:00
debugger;
2022-06-28 01:22:45 +08:00
var nodes = initTree.getCheckedNodes();
treeCheckedNewArr = [];
2022-09-20 17:47:38 +08:00
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
processInstId: processInstId,
wsId : wsId,
sid: sid,
datas:JSON.stringify(nodes)
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
var info = r.data.info;
var L1 = r.data.data.Process_Architecture_L1;
var L2 = r.data.data.Process_Architecture_L2;
var L3 = r.data.data.Process_Architecture_L3;
var L1old = ui("LEVEL_1_PROCESS_NAME");
var L2old = ui("LEVEL_2_PROCESS_NAME");
var L3old = ui("LEVEL_3_PROCESS_NAME");
if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else if(info == true){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else{
//treeCheckedNewArr = nodes;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.id.length > 36) continue;
//by bzp
if(node.method == "process.framework"){
continue;
}
var obj = {};
obj.fileVersion = node.version;
obj.publishFileId = node.id;
obj.id = node.id;
// obj.publishFileName = node.name;
obj.publishFileName = node.tempName;
obj.methodId = node.method;
obj.category = node.category;
obj.taskId = "";// 后续生成流程手册
treeCheckedNewArr.push(obj);
}
}
2022-07-15 19:15:15 +08:00
}
2022-09-20 17:47:38 +08:00
});
2022-06-28 01:22:45 +08:00
}
//获取已发布文件数据结构
function getPublishedTreeData(type) {
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag: true
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
success : function(r) {
var data = r.data.data;
var setting = {
2022-07-27 18:25:35 +08:00
checkbox: true,
checkInherit: r.data.checkInherit,
dataModel : {
data: data
}
};
2022-06-28 01:22:45 +08:00
for (var i=0;i<data.length;i++){
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
}
2022-07-27 18:25:35 +08:00
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
2022-06-28 01:22:45 +08:00
}
});
}
//变更类型批量结果数据回填主dialog
function getChangeBatchResult(type) {
2022-09-20 17:47:38 +08:00
debugger;
2022-06-28 01:22:45 +08:00
var nodes = initTree.getCheckedNodes();
treeCheckedChangeArr = [];
2022-09-20 17:47:38 +08:00
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
processInstId: processInstId,
wsId : wsId,
sid: sid,
datas:JSON.stringify(nodes)
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
var info = r.data.info;
var L1 = r.data.data.Process_Architecture_L1;
var L2 = r.data.data.Process_Architecture_L2;
var L3 = r.data.data.Process_Architecture_L3;
var L1old = ui("LEVEL_1_PROCESS_NAME");
var L2old = ui("LEVEL_2_PROCESS_NAME");
var L3old = ui("LEVEL_3_PROCESS_NAME");
if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else if(info == true){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else{
//treeCheckedNewArr = nodes;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.id.length > 36) continue;
var obj = {};
// obj.changeFileName = node.name;
obj.changeFileName = node.tempName;
obj.changeFileId = node.id;
obj.fileVersion = node.version;
obj.methodId = node.method;
obj.category = node.category;
obj.id = node.id;
obj.targetFiles = [];// 后续生成
obj.changedFileIdNew = "";// 后续生成
obj.changedFileNameNew = "";// 后续生成
obj.taskId = "";// 后续生成
obj.targetFileVersion = "";// 后续生成
obj.targetMethodId = node.method
obj.targetCategory = node.category
treeCheckedChangeArr.push(obj);
}
}
}
});
2022-06-28 01:22:45 +08:00
}
// 停用类型批量结果数据回填主dialog
function getStopBatchResult(type) {
var nodes = initTree.getCheckedNodes();
treeCheckedStopArr = [];
2022-09-20 17:47:38 +08:00
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
processInstId: processInstId,
wsId : wsId,
sid: sid,
datas:JSON.stringify(nodes)
};
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
var info = r.data.info;
var L1 = r.data.data.Process_Architecture_L1;
var L2 = r.data.data.Process_Architecture_L2;
var L3 = r.data.data.Process_Architecture_L3;
var L1old = ui("LEVEL_1_PROCESS_NAME");
var L2old = ui("LEVEL_2_PROCESS_NAME");
var L3old = ui("LEVEL_3_PROCESS_NAME");
if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else if(info == true){
$('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
$.simpleAlert("只能选择同一级别下的流程,请重新选择");
return;
}else{
//treeCheckedNewArr = nodes;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.id.length > 36) continue;
var obj = {};
// obj.stopFileName = node.name;
obj.stopFileName = node.tempName;
obj.stopFileId = node.id;
obj.fileVersion = node.version;
obj.id = node.id;
obj.methodId = node.method;
obj.category = node.category;
obj.taskId = "";// 后续查询已经存在的流程手册
treeCheckedStopArr.push(obj);
}
}
}
});
2022-06-28 01:22:45 +08:00
}
// 获取已有的流程手册
function queryBatchReport(data) {
debugger;
2022-06-28 01:22:45 +08:00
var ids = [];
for (var i = 0; i < data.length; i++) {
var temp = data[i];
if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
2022-06-28 01:22:45 +08:00
ids.push(temp.stopFileId);
}
}
if (ids.length == 0) return data;
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_batch_output_pr_report_query",
teamId: teamId,
wsId: wsId,
uuids: JSON.stringify(ids)
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
var result = r.data.data;
for (var i = 0; i < data.length; i++) {
if (result[data[i].id] != undefined) {
data[i].taskId = result[data[i].id];
}
}
}
});
return data;
}
// 创建流程手册
function createReport(category, method, uuid, taskId) {
if ((method == 'control.policy' || method == 'data.form' || method.indexOf('process.') > -1) && method != 'default') {
2022-06-28 01:22:45 +08:00
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
teamId: teamId,
wsId: wsId,
uuid: uuid
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
if (r.result == 'ok') {
taskId = r.data.taskId;
}
}
});
2022-07-27 18:25:35 +08:00
} else {
$.simpleAlert('不支持创建手册');
2022-06-28 01:22:45 +08:00
}
return taskId;
}
// 批量创建流程手册
function createBatchReport(data, createTime) {
var ids = [];
for (var i = 0; i < data.length; i++) {
var temp = data[i];
if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
2022-06-28 01:22:45 +08:00
ids.push(temp.publishFileId);
}
}
if (ids.length == 0) return data;
if (createTime == 'submit_create') {// 提交时创建手册
2022-07-27 18:25:35 +08:00
for (var i = 0; i < data.length; i++) {
if(jQuery.inArray(data[i].publishFileId, ids) != -1) {
data[i].taskId = 'submit_create';
};
}
return data;
}
2022-06-28 01:22:45 +08:00
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create",
teamId: teamId,
wsId: wsId,
uuids: JSON.stringify(ids)
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
if (r.result == 'ok') {
var result = r.data.data;
for (var i = 0; i < data.length; i++) {
if (result[data[i].id] != undefined) {
data[i].taskId = result[data[i].id];
}
2022-07-27 18:25:35 +08:00
}
2022-06-28 01:22:45 +08:00
}
}
});
return data;
}
// 查询流程的其他版本并生成流程手册
function getVersionsAndCreateReport(data, createTime) {
if (data.length == 0) return data;
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_versions_query_output_pr_reports_create",
teamId: teamId,
wsId: wsId,
data: JSON.stringify(data),
createTime : createTime
2022-06-28 01:22:45 +08:00
}
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
data = r.data.data;
}
});
return data;
}
2022-07-27 18:25:35 +08:00
// 获取手册专属名称
function getOutputName(category, method) {
if (method == 'control.policy') {
return '制度手册';
}
if (method == 'data.form') {
2022-09-20 17:47:38 +08:00
return '表单封面'
}
if (method.indexOf('process.') > -1) {
2022-08-04 11:53:56 +08:00
return '流程手册';
}
return '手册';
2022-07-27 18:25:35 +08:00
}
2022-06-28 01:22:45 +08:00
//单个流程立即创建流程手册
function quickCreateReport(obj, object, type) {
2022-07-27 18:25:35 +08:00
var taskId;
var category = obj.category;
var method = obj.methodId;
var uuid = '';
if (type == 'new') {
uuid = obj.publishFileId;
} else if (type == 'change') {
uuid = obj.changedFileIdNew;
2022-06-28 01:22:45 +08:00
}
2022-07-27 18:25:35 +08:00
$.simpleAlert("正在创建", "loading");
taskId = createReport(category, method, uuid, taskId);
$.simpleAlert("close");
//打开流程手册
$(object).attr('onclick', "openReportFile(\'" + taskId + "\')");
2022-06-28 01:22:45 +08:00
2022-07-27 18:25:35 +08:00
//三员管理下,立即创建
2022-06-28 01:22:45 +08:00
if(isHighSecurity){
//更新数据记录
if (type == 'new') {
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
2022-06-28 01:22:45 +08:00
$(object).text(fileName);
} else if (type == 'change') {
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
2022-06-28 01:22:45 +08:00
$(object).text(targetFileName);
}
}else{
//更新数据记录
if (type == 'new') {
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
2022-06-28 01:22:45 +08:00
$(object).text(fileName);
for (var i = 0; i < newTemp.length; i++) {
2022-07-27 18:25:35 +08:00
if (newTemp[i].publishFileId == uuid) {
2022-06-28 01:22:45 +08:00
newTemp[i].taskId = taskId;
}
}
} else if (type == 'change') {
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
2022-06-28 01:22:45 +08:00
$(object).text(targetFileName);
for (var i = 0; i < changeTemp.length; i++) {
2022-07-27 18:25:35 +08:00
if (changeTemp[i].changedFileIdNew == uuid) {
2022-06-28 01:22:45 +08:00
changeTemp[i].taskId = taskId;
}
}
}
}
2022-07-27 18:25:35 +08:00
$(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>');
2022-06-28 01:22:45 +08:00
}
// 清空树结构
function clearTreeData() {
initTree = {};
}
// 禁用按钮
function disabledAll() {
$('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled":"disabled"});
}
// 关闭模态窗
function closeDialog() {
$("#treeDialog").dialog("close");
}
// 打开流程手册
function openReportFile(taskId) {
$.simpleAlert("文件正在处理", "loading");
awsui.ajax.request({
2022-07-27 18:25:35 +08:00
type: "POST",
url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_output_file_open",
data: {taskId: taskId},
ok: function(msg) {
$.simpleAlert("close");
var url = msg.data.url;
if (msg.data.noSupport) {
window.location.href = url;
} else {
window.open(url);
}
},
err: function(msg) {
$.simpleAlert("close");
}
});
2022-06-28 01:22:45 +08:00
}
// 删除
function deleteFile(type) {
if ($('#publish_' + type + '_tbody').find('tr').length > 0) {
var flag = true;
$('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
if ($(this).closest('div').hasClass('checked')) {
flag = false;
}
});
if (flag) {
$.simpleAlert('请选择列表中数据');
return;
} else {
2022-07-27 18:25:35 +08:00
var options = {
title : "提示",
content:"确定删除?",
onConfirm: function(){
// 删除并重载数据刷新页码
if (type == 'new') {
// 获取所有选中的数据
var tempIds = [];
$('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
if ($(this).closest('div').hasClass('checked')) {
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');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < newTemp.length; m++) {
if (tempIds[j] == newTemp[m].publishFileId) {
// 删除
newTemp.splice(m,1);
break;
2022-07-27 10:59:09 +08:00
}
2022-07-27 18:25:35 +08:00
}
}
if (newTemp.length == 0) {
// 无数据
$('#publish_' + type + '_tbody').empty();
} else if (newTemp.length > newPageSetting.start - 1) {
// 初始化页数及当前页
initNewPagination(newPageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
} else {
// 刷新到最后一页
var curr = 1;
if(newTemp.length % pageLimit == 0) {
curr = parseInt(newTemp.length / pageLimit);
} else {
curr = parseInt(newTemp.length / pageLimit) + 1;
}
newPageSetting = {
pageNum:curr,
start:(curr - 1) * pageLimit + 1
}
// 初始化页数及当前页
initNewPagination(newPageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
}
if (newTemp.length <= pageLimit) {
$('#new_pagination').hide();
}
$('#publish_' + type + '_content').find('input[name=checkAll]').check("option","checked", false);
}
if (type == 'change') {
// 获取所有选中的数据
var tempIds = [];
$('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
if ($(this).closest('div').hasClass('checked')) {
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');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < changeTemp.length; m++) {
if (tempIds[j] == changeTemp[m].changeFileId) {
// 删除
changeTemp.splice(m,1);
break;
2022-07-27 10:59:09 +08:00
}
2022-07-27 18:25:35 +08:00
}
}
if (changeTemp.length == 0) {
// 无数据
$('#publish_' + type + '_tbody').empty();
} else if (changeTemp.length > changePageSetting.start - 1) {
// 初始化页数及当前页
initChangePagination(changePageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(changeTemp, type, changePageSetting.pageNumber, changePageSetting.start);
} else {
// 刷新到最后一页
var curr = 1;
if(changeTemp.length % pageLimit == 0) {
curr = parseInt(changeTemp.length / pageLimit);
} else {
curr = parseInt(changeTemp.length / pageLimit) + 1;
}
changePageSetting = {
pageNum:curr,
start:(curr - 1) * pageLimit + 1
}
// 初始化页数及当前页
initChangePagination(changePageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(changeTemp, type, changePageSetting.pageNumber, changePageSetting.start);
}
if (changeTemp.length <= pageLimit) {
$('#change_pagination').hide();
}
$('#publish_' + type + '_content').find('input[name=checkAll]').check("option","checked", false);
}
if (type == 'stop') {
// 获取所有选中的数据
var tempIds = [];
$('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
if ($(this).closest('div').hasClass('checked')) {
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');
// }
// });
for (var j = 0; j < tempIds.length; j++) {
for (var m = 0; m < stopTemp.length; m++) {
if (tempIds[j] == stopTemp[m].stopFileId) {
// 删除
stopTemp.splice(m,1);
break;
2022-07-27 10:59:09 +08:00
}
2022-07-27 18:25:35 +08:00
}
}
if (stopTemp.length == 0) {
// 无数据
$('#publish_' + type + '_tbody').empty();
} else if (stopTemp.length > stopPageSetting.start - 1) {
// 初始化页数及当前页
initStopPagination(stopPageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(stopTemp, type, stopPageSetting.pageNumber, stopPageSetting.start);
} else {
// 刷新到最后一页
var curr = 1;
if(stopTemp.length % pageLimit == 0) {
curr = parseInt(stopTemp.length / pageLimit);
} else {
curr = parseInt(stopTemp.length / pageLimit) + 1;
}
stopPageSetting = {
pageNum:curr,
start:(curr - 1) * pageLimit + 1
}
// 初始化页数及当前页
initStopPagination(stopPageSetting.pageNum - 1);
// 初始化当前页的数据
initPublishData(stopTemp, type, stopPageSetting.pageNumber, stopPageSetting.start);
}
if (stopTemp.length <= pageLimit) {
$('#stop_pagination').hide();
}
$('#publish_' + type + '_content').find('input[name=checkAll]').check("option","checked", false);
}
//by bzp 清空 流程级别信息 和审批人信息
if(stopTemp.length == 0 && changeTemp.length == 0 && newTemp.length == 0){
clearLevelAndApproveInfo();
}
},
onClose : function(){
}
};
$.confirm(options);
2022-06-28 01:22:45 +08:00
}
} else {
$.simpleAlert('列表中无数据');
}
}
2022-07-12 15:42:49 +08:00
//by bzp 清空流程级别信息和审批人信息
function clearLevelAndApproveInfo(){
2022-07-27 18:25:35 +08:00
//审批人信息
ui("PERSON_THREE_LEVEL_PROCESS",'');
ui("PROCESS_RESPONSIBLE_PERSON",'');
ui("RESPONSIBLE_PERSON1",'');
ui("LEVEL_AUDIT_REQUIRED",'0');
ui("SECONDARY_AUDIT_REQUIRED",'0');
ui("LEVEL_1_AUDIT_REQUIRED",'0');
//流程级别信息
ui("LEVEL_1_PROCESS_NAME",'');
ui("LEVEL_2_PROCESS_NAME",'');
ui("LEVEL_3_PROCESS_NAME",'');
//看是否需要清空后台数据~~
queryapprove();
2022-07-12 15:42:49 +08:00
}
2022-06-28 01:22:45 +08:00
// 变更说明内容时处理
function changeDesc(type, id, obj) {
var desc = $(obj).val();
if (type == 'new') {
for (var i = 0; i < newTemp.length; i++ ) {
if (newTemp[i].publishFileId == id) {
newTemp[i].publishDesc = desc;
break;
}
}
}
if (type == 'change') {
for (var i = 0; i < changeTemp.length; i++ ) {
if (changeTemp[i].changeFileId == id) {
changeTemp[i].changedDesc = desc;
break;
}
}
}
if (type == 'stop') {
for (var i = 0; i < stopTemp.length; i++ ) {
if (stopTemp[i].stopFileId == id) {
stopTemp[i].stopDesc = desc;
break;
}
}
}
}
// 点击checkbox
function onCheckboxClickEvent(boItemName, $checkbox, val) {
var isCheck = !$checkbox.closest('div').hasClass('checked');
if (val == '流程制度发布') {
2022-06-28 01:22:45 +08:00
dealPublishCheck(isCheck, 'new');
} else if (val == '流程制度版本更新') {
2022-06-28 01:22:45 +08:00
dealPublishCheck(isCheck, 'change');
} else if (val == '流程制度废止') {
2022-06-28 01:22:45 +08:00
dealPublishCheck(isCheck, 'stop');
}
}
// 主体内容显示与隐藏
function dealPublishCheck(isCheck, type) {
if (type == 'new') {
2022-07-27 18:25:35 +08:00
isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide();
2022-06-28 01:22:45 +08:00
} else if (type == 'change') {
isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide();
} else if (type == 'stop') {
isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide();
}
}
// 单独保存子表操作
function saveFormData(type) {
$.simpleAlert('正在保存', 'loading');
var saveData = [];
if (type == 'new') {
saveData = newTemp;
}
if (type == 'change') {
saveData = changeTemp;
}
if (type == 'stop') {
saveData = stopTemp;
}
var param = {
2022-07-27 18:25:35 +08:00
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_batch_save",
teamId: teamId,
wsId: wsId,
processInstId : processInstId,
type : type,
data: JSON.stringify(saveData)
2022-06-28 01:22:45 +08:00
}
var flag = false;
var tempData;
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
if (r.result == 'error') {
flag = true;
tempData = r.data.data;
}
2022-07-27 18:25:35 +08:00
},
2022-06-28 01:22:45 +08:00
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("表单信息错误,请联系管理员!", 'error');
}
});
$.simpleAlert('close');
if (flag) {
2022-07-27 18:25:35 +08:00
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
2022-06-28 01:22:45 +08:00
if (tempData.length > 0) {
2022-07-27 18:25:35 +08:00
for (var i = 0; i < tempData.length; i++) {
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version;
}
}
2022-06-28 01:22:45 +08:00
var options = {
2022-07-27 18:25:35 +08:00
title : "提示",
content:msg,
type:"alert",
onConfirm: function(){
}
};
$.confirm(options);
2022-06-28 01:22:45 +08:00
} else {
$.simpleAlert('保存成功', 'ok');
}
}
2022-09-02 09:55:44 +08:00
// 点击办理时的校验+保存字表
function formSave(isTransact){
if (!editPerm) {// 只读状态不处理
return true;
}
$.simpleAlert('正在保存', 'loading');
if(isTransact) {// 点击办理进行校验
// 判断页面是否有数据
if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none'){
$.simpleAlert('close');
$.simpleAlert('发布内容不能为空', 'info');
return false;
}
debugger;
2022-09-02 09:55:44 +08:00
var index = 0;
if (!($("#publisher_new_tr").css('display') == 'none') && newTemp.length > 0) {
index++;
}
if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
index++;
}
if (!($("#publisher_stop_tr").css('display') == 'none') && stopTemp.length > 0) {
index++;
}
if (index == 0) {
$.simpleAlert('close');
$.simpleAlert('发布内容不能为空', 'info');
return false;
}
2022-07-27 18:25:35 +08:00
2022-09-02 09:55:44 +08:00
// 校验变更文件是否全部都有变更后文件
if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
var flag = false;
var msg = '以下文件没有选择变更后的文件,不允许办理';
for (var i = 0; i < changeTemp.length; i++) {
if (changeTemp[i].changedFileIdNew == "") {
flag = true;
msg += '<br>' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion;
}
}
if (flag) {
var options = {
title : "提示",
content:msg,
type:"alert",
onConfirm: function(){
}
};
$.simpleAlert('close');
$.confirm(options);
return false;
}
}
}
// 保存校验
// 1.不显示的数据默认删除
var newTempData = newTemp;
var changeTempData = changeTemp;
var stopTempData = stopTemp;
if (($("#publisher_new_tr").css('display') == 'none')) {
newTempData = [];
}
if (($("#publisher_change_tr").css('display') == 'none')) {
changeTempData = [];
}
if (($("#publisher_stop_tr").css('display') == 'none')) {
stopTempData = [];
}
// 2.校验变更的数据与停用的数据是否有重叠
if(isTransact) {
if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) {
for (var i = 0; i < changeTempData.length; i ++) {
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 + "<br>在变更流程和停用流程中同时存在,不允许办理", 'error');
return false;
}
}
}
}
}
//三员管理,提交后不生成手册,更改taskId
if (isHighSecurity){
for (let i=0;i<newTempData.length;i++){
let data= newTempData[i];
if ((data.methodId == 'control.policy' || data.methodId == 'data.form' || data.methodId.indexOf('process.') > -1) && data.methodId != 'default') {
data.taskId = "new";
}
}
for (let j=0; j<changeTempData.length;j++){
let changeData = changeTempData[j];
changeData.taskId = "change";
}
}
// 保存
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_batch_save_before",
teamId: teamId,
wsId: wsId,
processInstId : processInstId,
newData: JSON.stringify(newTempData),
changeData: JSON.stringify(changeTempData),
stopData: JSON.stringify(stopTempData),
isTransact : isTransact
};
var flag = false;
var tempData;
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
async : false,
data : param,
success : function(r) {
if (r.result == 'error') {
flag = true;
tempData = r.data.data;
}
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("表单信息错误,请联系管理员!", 'error');
}
});
$.simpleAlert('close');
if (flag) {
var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
if (tempData.length > 0) {
for (var i = 0; i < tempData.length; i++) {
msg += '<br>' + tempData[i].name + ' V' + tempData[i].version;
}
}
var options = {
title : "提示",
content:msg,
type:"alert",
onConfirm: function(){
}
};
$.confirm(options);
return false;
} else {
newTemp = newTempData;
if (newTemp.length == 0) {
newPageSetting = {
pageNum:1,
start:1
};
$('#new_pagination').hide();
initPublishData(newTemp, 'new', 1, 1);
}
changeTemp = changeTempData;
if (changeTemp.length == 0) {
changePageSetting = {
pageNum:1,
start:1
};
$('#change_pagination').hide();
initPublishData(changeTemp, 'change', 1, 1);
}
stopTemp = stopTempData;
if (stopTemp.length == 0) {
stopPageSetting = {
pageNum:1,
start:1
};
$('#stop_pagination').hide();
initPublishData(stopTemp, 'stop', 1, 1);
}
$.simpleAlert('保存成功', 'ok');
}
}
2022-06-28 01:22:45 +08:00
//办理完成后关闭页面
AWSFormMainAPI.customCloseFormPage(function(){
if (closeFormPage) {
window.close();
} else {
AWSFormUtil.refreshPage();
}
// 父页面刷新
opener.refreshTab();
return true;//最后返回true
});
/********************************快速搜索start***************************************/
// 绑定事件
function initPublishSearch(type) {
$("#processName").buttonedit({
onClick: function(e){
searchProcess(type);
}
});
$("#processName").bind("keypress",function(event){
if(event.keyCode == "13"){
searchProcess(type);
}
});
2022-07-27 18:25:35 +08:00
$("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
$('#autoSearchProcessDiv').show();
}).off("autoSearchProcessDiv").on("mouseleave", function () {
$('#autoSearchProcessDiv').hide();
});
2022-06-28 01:22:45 +08:00
}
// 搜索
function searchProcess(type) {
$("#autoSearchProcessDiv").empty().hide();
if ($("#processName").val() == "" || $("#processName").val().trim() == "") {
return;
}
var name = $("#processName").val().trim().toLowerCase();
var html = '';
2022-07-27 18:25:35 +08:00
//先向后台请求完整tree数据
if (type == 'new') {
var data = getAllTreeData();
for (var i = 0; i < data.length; i++) {
var text = data[i].name;
if (text.indexOf(name) > -1) {
var id = data[i].id;
var path = getSearchTreeNodePath(data[i], text, data, 1);
var pids = getSearchTreeNodePath(data[i], text, data, 2);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" data-type="' + type +'" data-pids="' + pids + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
} else {
$('span.tree-items-title').each(function() {
var text = $(this).text().toLowerCase();
if (text.indexOf(name) > -1) {// found
var id = $(this).attr('id').substring(10);
if (id.length <= 36) {
var node = initTree.getNodeById(id);
var path = getFilePath(node, text);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
});
}
2022-06-28 01:22:45 +08:00
if (html.length > 0) {
2022-07-27 18:25:35 +08:00
$("#autoSearchProcessDiv").html(html).show();
2022-06-28 01:22:45 +08:00
// $("#processName").val('');
}
}
function getAllTreeData() {
2022-07-27 18:25:35 +08:00
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query_search",
teamId: teamId,
wsId: wsId
}
var data;
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
async : false,
success : function(d) {
data = d;
}
});
return data;
2022-06-28 01:22:45 +08:00
}
function getSearchTreeNodePath(node, text, data, isPid) {
2022-07-27 18:25:35 +08:00
var name = text;
var pids = node.pid;
do {
var p = undefined;
for (var i = 0; i < data.length; i++) {
if (data[i].id == node.pid) {
p = data[i];
break;
}
}
if (p == undefined) {
if (node.pid == "process") {
name = "流程>" + name;
}
if (node.pid == "org") {
name = "组织>" + name;
}
if (node.pid == "data") {
name = "数据>" + name;
}
if (node.pid == "itsystem") {
name = "IT系统>" + name;
}
if (node.pid == "control") {
name = "控制>" + name;
}
break;
}
name = p.name + ">" + name;
pids = p.pid + "." + pids;
node = p;
} while(true);
if (isPid == 2) {
return pids;
} else {
return name;
}
2022-06-28 01:22:45 +08:00
}
function getFilePath(node, text) {
var name = text;
do {
var p = initTree.getParentNodeById(node.id);
if (p == undefined) {
break;
}
name = p.name + ">" + name;
node = p;
} while(true);
return name;
}
function auto_move(obj) {
obj.css({"color": "white", "background-image" : "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"});
}
function auto_out(obj) {
obj.css({"color": "black", "background-image" : "none"});
}
function auto_click(obj, type) {
var plId = obj.find("span").attr("plId");
var type = obj.find("span").data("type");
2022-07-27 18:25:35 +08:00
var dom = initTree.getNodeDomById(plId)
if (type == 'new') {
//预先去加载initTree
var pids = obj.find("span").data("pids");
var pidList = pids.split('.');
for (var i = 0; i < pidList.length; i++) {
loadNewData(pidList[i]);
dom = initTree.getNodeDomById(pidList[i]);
initTree.expandNodes(dom, true, true, true);
}
} else {
initTree.expandNodes(dom, true, true, true);
}
2022-06-28 01:22:45 +08:00
initTree.expandNodes(dom, true, true, true);
// 偏移至可见区域
var ele = document.getElementById('tree_span_' + plId);
$('#tree').scrollTop(ele.offsetTop);
initTree.cancelSelectNode()
initTree.selectNode(plId);
$("#autoSearchProcessDiv").empty().hide();
}
/********************************快速搜索end***************************************/
function listenCloseEvent() {
window.onbeforeunload = function(){
// 查询bo表数据是否保存过未保存过离开页面则删除该实例
awsui.ajax.request({
type: "POST",
url: "./jd",
async: false,
data: {
sid: sid,
cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
processInstId: processInstId
},
success : function(r) {
if (r.result == "ok") {
if (r.data.saveStatus == '1') {
return "未保存,关闭之后不会保存该表单!";
}
}
}
});
}
2022-07-27 18:25:35 +08:00
2022-06-28 01:22:45 +08:00
//在弹出“是否离开”的提示框后选择离开则触发onunload事件
window.onunload = function(){
// 查询bo表数据是否保存过未保存过离开页面则删除该实例
awsui.ajax.request({
type: "POST",
url: "./jd",
async: false,
data: {
sid: sid,
cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
processInstId: processInstId
},
success : function(r) {
if (r.result == "ok") {
if (r.data.saveStatus == '1') {
// 删除该流程实例,并刷新主页面
awsui.ajax.request({
type: "POST",
url: "./jd",
async: false,
data: {
sid: sid,
cmd: "com.actionsoft.apps.coe.pal.publisher_remove",
processInstIds: processInstId
},
success : function(r) {
if (r.result == "ok") {
// 父页面刷新
opener.refreshTab();
}
}
});
}
}
}
});
}
2022-07-27 18:25:35 +08:00
}
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;
2022-07-27 18:25:35 +08:00
if (r.result == "ok") {
debugger;
2022-07-27 18:25:35 +08:00
window.open (r.data.url);
} else {
}
}
});
2022-06-28 01:22:45 +08:00
}