diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple.js index dc10be80..acb589a4 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple.js @@ -20,16 +20,16 @@ var varDutyDept = "责任部门"; var varDutyUser = "责任人"; // 页码记录 var newPageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 } var changePageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 } var stopPageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 } var isHighSecurity; $(document).ready(function(){ @@ -42,10 +42,10 @@ $(document).ready(function(){ initHtml();// 初始化页面 initCheckAll();// 初始化表头多选框 initContentData();// 初始化内容数据 - + // 初始化表格宽度 initTableWidth(); - + initPagination();// 初始化页码 initOptButton(); // listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉 @@ -71,30 +71,30 @@ var paginationSetting = { // 初始化全选 function initCheckAll() { $("input[name=checkAll]").on("ifChanged",function(){ - var checkId = $(this).attr("id"); + var checkId = $(this).attr("id"); if($(this).prop("checked")){ - // 设置当前页被选中 - if (checkId == 'new_check_all') { - $('#publish_new_tbody').find('input[name="check"]').check("option", "checked", true); - } + // 设置当前页被选中 + if (checkId == 'new_check_all') { + $('#publish_new_tbody').find('input[name="check"]').check("option", "checked", true); + } 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); } - } else { - // 设置当前页取消选中 - if (checkId == 'new_check_all') { - $('#publish_new_tbody').find('input[name="check"]').check("option", "checked", false); - } + } else { + // 设置当前页取消选中 + if (checkId == 'new_check_all') { + $('#publish_new_tbody').find('input[name="check"]').check("option", "checked", false); + } 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); } - } + } }); } @@ -160,66 +160,66 @@ function initOptButton() { // 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子 function initHtml() { var dialogHtml = ''; - dialogHtml += ''; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
文件名
'; - dialogHtml += '
'; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
说明
'; - dialogHtml += '
'; - dialogHtml += ''; - dialogHtml += '
'; - dialogHtml += '
'; + dialogHtml += ''; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
文件名
'; + dialogHtml += '
'; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
说明
'; + dialogHtml += '
'; + dialogHtml += ''; + dialogHtml += '
'; + dialogHtml += '
'; - //非三员管理显示创建 - if (!isHighSecurity){ - dialogHtml += '
'; - dialogHtml += '
创建手册
'; - dialogHtml += '
'; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += ''; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; + //非三员管理显示创建 + if (!isHighSecurity){ + dialogHtml += '
'; + dialogHtml += '
创建手册
'; + dialogHtml += '
'; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += ''; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '立即:点击确定后需等待创建流程手册完成后才可以进行下一步操作,一次性选择的流程数量较多时耗费时间长;
提交(办理)时:表单进行提交时进行流程手册的创建,若一次性选择流程数量较多,建议选择此项'; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += '
'; - } + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '立即:点击确定后需等待创建流程手册完成后才可以进行下一步操作,一次性选择的流程数量较多时耗费时间长;
提交(办理)时:表单进行提交时进行流程手册的创建,若一次性选择流程数量较多,建议选择此项'; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += '
'; + } + + dialogHtml += ''; + dialogHtml += '
'; + dialogHtml += '
'; + dialogHtml += ''; + dialogHtml += ''; + $('body').append(dialogHtml); + $('input[name=radiox1]').check({radioClass:'iradio_minimal-grey'}); - dialogHtml += ''; - dialogHtml += '
'; - dialogHtml += '
'; - dialogHtml += ''; - dialogHtml += ''; - $('body').append(dialogHtml); - $('input[name=radiox1]').check({radioClass:'iradio_minimal-grey'}); - $('#publisher_new_td').html('
'); $('#publisher_change_td').html('
'); $('#publisher_stop_td').html('
'); @@ -248,7 +248,7 @@ function initHtml() { newHtml += ''; newHtml += ''; newHtml += ''; - + var changeHtml = ''; changeHtml += ''; changeHtml += '
'; @@ -275,7 +275,7 @@ function initHtml() { changeHtml += ''; changeHtml += '
'; changeHtml += ''; - + var stopHtml = ''; stopHtml += ''; stopHtml += ''; @@ -302,7 +302,7 @@ function initHtml() { stopHtml += ''; stopHtml += ''; stopHtml += ''; - + $('#contentDiv1').append(newHtml); $('#contentDiv2').append(changeHtml); $('#contentDiv3').append(stopHtml); @@ -337,11 +337,11 @@ function initParam() { // 初始化内容数据 function initContentData() { var param = { - cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query', - processInstId: processInstId, - wsId : wsId, - sid: sid - }; + cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query', + processInstId: processInstId, + wsId : wsId, + sid: sid + }; $.ajax({ url : "./jd", type : "POST", @@ -398,7 +398,7 @@ function initContentData() { var changedId = ''; function initPublishData(data, type, pageNumber, start){ - showlist(data, type, pageNumber, start); + showlist(data, type, pageNumber, start); } // 初始化数据 @@ -406,103 +406,102 @@ function selectPublishData(data, type, pageNumber, start) { debugger; - //渲染到前台的流程架构L1,L2,L3 + //渲染到前台的流程架构L1,L2,L3 - 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) { - debugger; - 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; - } - //不属于同一L3 所以直接提示 - if(info == true){ - $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', ''); - $.simpleAlert("只能选择同一级别下的流程,请重新选择"); - return; - }else{ - if(ui("LEVEL_1_PROCESS_NAME").length > 0){ - return; - } - ui("LEVEL_1_PROCESS_NAME",L1); - ui("LEVEL_2_PROCESS_NAME",L2); - ui("LEVEL_3_PROCESS_NAME",L3); - showlist(data, type, pageNumber, start); - //发起请求把审批人查询出来~ - queryapprove(); - ui("ADAPT_NAME_THE_COMPANY",""), - ui("ADAPT_REGION_NAME",""), - ui("APPLICABLE_PRODUCT",""), - $("#publisher_dialog").dialog("close"); - } - //展示未发布过的流程 - //data = r.data.is_not_publish_data; - } - }); + 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) { + debugger; + 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; + } + //不属于同一L3 所以直接提示 + if(info == true){ + $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', ''); + $.simpleAlert("只能选择同一级别下的流程,请重新选择"); + return; + }else{ + if(ui("LEVEL_1_PROCESS_NAME").length > 0){ + return; + } + ui("LEVEL_1_PROCESS_NAME",L1); + ui("LEVEL_2_PROCESS_NAME",L2); + ui("LEVEL_3_PROCESS_NAME",L3); + showlist(data, type, pageNumber, start); + //发起请求把审批人查询出来~ + queryapprove(); + ui("ADAPT_NAME_THE_COMPANY",""), + ui("ADAPT_REGION_NAME",""), + ui("APPLICABLE_PRODUCT",""), + $("#publisher_dialog").dialog("close"); + } + //展示未发布过的流程 + //data = r.data.is_not_publish_data; + } + }); } //by bzp function queryapprove(){ - 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) { - debugger; - var info = r.data.data; - if(info != ''){ - ui("PERSON_THREE_LEVEL_PROCESS",info.AUDITOR_NO_3); - ui("PROCESS_RESPONSIBLE_PERSON",info.AUDITOR_NO_2); - ui("RESPONSIBLE_PERSON1",info.AUDITOR_NO_1); - ui("LEVEL_AUDIT_REQUIRED",info.L3_SP); - ui("SECONDARY_AUDIT_REQUIRED",info.L2_SP); - ui("LEVEL_1_AUDIT_REQUIRED",info.L1_SP); - - } - } - }); + 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",info.AUDITOR_NO_3); + ui("PROCESS_RESPONSIBLE_PERSON",info.AUDITOR_NO_2); + ui("RESPONSIBLE_PERSON1",info.AUDITOR_NO_1); + 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,12 +513,13 @@ 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 = '' + fileName + "-流程手册" + ''; + var fileName = curr.publishFileName + ' V' + curr.fileVersion; + var outputName = (curr.category == 'process' ? '流程' : curr.category == 'data' ? '表单' : curr.category == 'control' ? '制度' : '') + '手册'; + var reportName = '' + fileName + "-" + outputName + ''; var quickCreate = "立即创建"; var processNumber = ''; if(curr.processNumber != undefined){ - processNumber = curr.processNumber; + processNumber = curr.processNumber; } reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName; // 三员管理,taskId为new标识未创建手册 @@ -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,21 +551,25 @@ 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 = '' + targetFileName + "-流程手册" + ''; + debugger; + var outputName = (curr.category == 'process' ? '流程' : curr.category == 'data' ? '表单' : curr.category == 'control' ? '制度' : '') + '手册'; + var reportName = '' + targetFileName + "-" + outputName + ''; var quickCreate = "立即创建"; - reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName; + createButtonObj[curr.changeFileId] = quickCreate; + reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName; // 三员管理,taskId为change标识未创建手册 if (isHighSecurity){ @@ -572,38 +577,39 @@ function showlist(data, type, pageNumber, start){ } var checkboxPerm = editPerm ? '' : 'disabled="disabled"'; var textareaPerm = editPerm ? '' : 'readonly'; - html += ''; - html += ''; - html += '' + s + ''; - html += '' + sourceFileName + ''; - var selectPerm = editPerm ? '' : '' + targetFileName + ''; - html += '' + selectPerm + ''; - html += '' + reportName + ''; - html += ''; - html += ''; - // select2下拉框处理 - var opt1 = { - data : [] + html += ''; + html += ''; + html += '' + s + ''; + html += '' + sourceFileName + ''; + var selectPerm = editPerm ? '' : '' + targetFileName + ''; + html += '' + selectPerm + ''; + html += '' + reportName + ''; + html += ''; + html += ''; + // select2下拉框处理 + var opt1 = { + data : [] }; - 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 + '.0'; + 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; var obj = {id:temp.id, text:name, name:temp.text, version:temp.version}; opt1.data.push(obj); if (targetId == temp.id) { flag = true; } - } - var tempObj = {}; - tempObj.opt = opt1; - tempObj.flag = flag; - tempObj.targetId = targetId; - tempObj.selectId = 'change_' + curr.changeFileId; - tempObj.taskId = curr.taskId; - tempObj.id = curr.changeFileId; - tempSelect.push(tempObj); + } + 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; + tempSelect.push(tempObj); } } $('#publish_change_tbody').empty().html(html); @@ -617,22 +623,24 @@ 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); - } 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' + '-流程手册'; - $('#report_' + tempObj.id).html('' + targetFileName2 + ''); - break; - } - } - } + 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 = (tempObj.category == 'process' ? '流程' : tempObj.category == 'data' ? '表单' : tempObj.category == 'control' ? '制度' : '') + '手册'; + var targetFileName2 = tempObj.opt.data[m].name + ' V' + tempObj.opt.data[m].version + '-' + outputName + ''; + $('#report_' + tempObj.id).html('' + targetFileName2 + ''); + break; + } + } + } } else { $('#report_' + tempObj.id).html('无'); } } else {// 默认第一个版本 - if (tempObj.opt.data.length > 0) { + if (tempObj.opt.data.length > 0) { // 获取选中的版本,获取流程手册,更新数据 initChangedData(tempObj.id); } @@ -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 = '' + fileName + "-流程手册" + ''; reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName; var checkboxPerm = editPerm ? '' : 'disabled="disabled"'; @@ -708,16 +716,16 @@ function addProcess(type) { $('#publisher_dialog_desc').val(''); var title = type == 'new' ? '发布流程' : type == 'change' ? '变更流程' : '停用流程'; var height = 380; - $("#radio1").check("uncheck"); - $("#radio2").check("uncheck"); - if (type == 'stop') { - $('#reportType').hide(); - $('#reportTypeAlert').hide(); - } else { - $('#reportType').show(); - $('#reportTypeAlert').show(); - height = 600; - } + $("#radio1").check("uncheck"); + $("#radio2").check("uncheck"); + if (type == 'stop') { + $('#reportType').hide(); + $('#reportTypeAlert').hide(); + } else { + $('#reportType').show(); + $('#reportTypeAlert').show(); + height = 600; + } searchType = type; $("#publisher_dialog").dialog({ width:650, @@ -725,149 +733,150 @@ function addProcess(type) { height:height, buttons:[ {text:'确定',cls:"blue",handler:function(){ - 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]); - } - // 初始化页数及当前页 - 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); + 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]); + } + // 初始化页数及当前页 + 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); + } } - } - 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); + if (type == 'change') { + if (treeCheckedChangeArr.length == 0) { + $.simpleAlert('变更流程不能为空'); + return; + } else { + //三员管理隐藏手册创建时间 + if (!checkCreateReportTime() && !isHighSecurity) { + $.simpleAlert('请选择创建流程手册的时间', 'info'); + return; + } + disabledButton(); + debugger; + 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); + } } - } - 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); + 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); + } } - } - }}, + }}, {text:'关闭',handler:function(){$("#publisher_dialog").dialog("close");}} - ], + ], onClose:function() { if ($("#treeDialog").css('display') != 'none') { - $("#treeDialog").dialog("close"); + $("#treeDialog").dialog("close"); } } }); @@ -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('' + targetFileName2 + ''); - } else { - $('#report_' + changeFileId).html('无'); - } + // 更新数据 changeTemp[i].changedFileIdNew = selectedId; changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text; @@ -904,9 +907,20 @@ 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 + ''; + $('#report_' + changeFileId).html('' + targetFileName2 + ''); + } else { + $('#report_' + changeFileId).html('无'); + } + break; } - } + } break; } } @@ -915,9 +929,9 @@ function initChangedData(changeFileId) { // 打开流程文件查看页面 function openPortalPage(uuid, taskId) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", - uuid : uuid + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", + uuid : uuid } $.ajax({ url : "./jd", @@ -926,7 +940,7 @@ function openPortalPage(uuid, taskId) { data : param, success : function(r) { if (r.result == 'ok') { - window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows + window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows } else { $.simpleAlert(r.msg); } @@ -939,70 +953,70 @@ function openQueryDataDialog(type) { $('#treeDataDiv').html('
'); $('#searchData').html(''); $("#loadImg").loading({ - description:"加载中", - size:'large', - color:'#000' + description:"加载中", + size:'large', + color:'#000' }); $('.awsui-loading').css('position', 'relative'); $('.awsui-loading').css('top', '60px'); $("#loading-demo-basic").loading(); $("#treeDialog").dialog({ - buttons:[ - {text:'确定',cls:"blue",handler:function(){ - if (type == 'new') { - 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(); - } - }); + buttons:[ + {text:'确定',cls:"blue",handler:function(){ + if (type == 'new') { + 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(); + } + }); if (type == 'new') { - initPublishSearch(type);// 绑定搜索事件 + initPublishSearch(type);// 绑定搜索事件 getNotPublishTreeData(type); } else {// stop - initPublishSearch(type);// 绑定搜索事件 + initPublishSearch(type);// 绑定搜索事件 getPublishedTreeData(type); } } @@ -1010,12 +1024,12 @@ function openQueryDataDialog(type) { // 获取未发布文件数据结构 function getNotPublishTreeData(type) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag: true + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag: true } $.ajax({ url : "./jd", @@ -1024,19 +1038,19 @@ function getNotPublishTreeData(type) { data : param, success : function(r) { var data = r.data.data; - var setting = { - checkbox: true, - checkInherit: r.data.checkInherit, - event : { - beforeExpand : loadNewData - }, - dataModel : { - data: data - } - }; - $("#treeDataDiv").empty(); - $('#treeDataDiv').html(''); - initTree = awsui.tree.init($("#tree"), setting); + var setting = { + checkbox: true, + checkInherit: r.data.checkInherit, + event : { + beforeExpand : loadNewData + }, + dataModel : { + data: data + } + }; + $("#treeDataDiv").empty(); + $('#treeDataDiv').html(''); + initTree = awsui.tree.init($("#tree"), setting); } }); } @@ -1044,16 +1058,16 @@ function getNotPublishTreeData(type) { function loadNewData(treeNode) { // 如果是父节点并且存在子节点执行加载 if (treeNode) { - var pid; - if (typeof(treeNode) == "string") { - pid = treeNode - } else { - pid = treeNode.id; - } + var pid; + if (typeof(treeNode) == "string") { + pid = treeNode + } else { + pid = treeNode.id; + } var dataModel = { url : "./w?sid=" + jQuery("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid - + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, + + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid + + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, method : "POST", dataType : "json" } @@ -1064,40 +1078,40 @@ function loadNewData(treeNode) { var data = initTree.getChildrenByPid(pid); var newData = []; for (var i=0;i'; - } else if (hasDutyDept) { - var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; - data[i].name += '   ' + tempText + ''; - } else if (hasDutyUser) { - var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; - data[i].name += '   ' + tempText + ''; - } - newData.push(data[i]); - //initTree.refreshNodeById(data[i]); - } - initTree.refreshNode({ - id : pid, - data : newData - }); + 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 += '   ' + tempText + ''; + } else if (hasDutyDept) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyUser) { + var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } + newData.push(data[i]); + //initTree.refreshNodeById(data[i]); + } + initTree.refreshNode({ + id : pid, + data : newData + }); } } @@ -1110,7 +1124,7 @@ function getNewPublishBatchResult(type) { if (node.id.length > 36) continue; //by bzp if(node.method == "process.framework"){ - continue; + continue; } var obj = {}; obj.fileVersion = node.version; @@ -1128,12 +1142,12 @@ function getNewPublishBatchResult(type) { //获取已发布文件数据结构 function getPublishedTreeData(type) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag: true + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag: true } $.ajax({ url : "./jd", @@ -1143,12 +1157,12 @@ function getPublishedTreeData(type) { success : function(r) { var data = r.data.data; var setting = { - checkbox: true, - checkInherit: r.data.checkInherit, - dataModel : { - data: data - } - }; + checkbox: true, + checkInherit: r.data.checkInherit, + dataModel : { + data: data + } + }; for (var i=0;i'; } } - $("#treeDataDiv").empty(); - $('#treeDataDiv').html(''); - initTree = awsui.tree.init($("#tree"), setting); + $("#treeDataDiv").empty(); + $('#treeDataDiv').html(''); + initTree = awsui.tree.init($("#tree"), setting); } }); } @@ -1235,11 +1249,11 @@ function queryBatchReport(data) { } if (ids.length == 0) return data; var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_batch_output_pr_report_query", - teamId: teamId, - wsId: wsId, - uuids: JSON.stringify(ids) + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_batch_output_pr_report_query", + teamId: teamId, + wsId: wsId, + uuids: JSON.stringify(ids) } $.ajax({ url : "./jd", @@ -1261,13 +1275,14 @@ 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", - teamId: teamId, - wsId: wsId, - uuid: uuid + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create", + teamId: teamId, + wsId: wsId, + uuid: uuid } $.ajax({ url : "./jd", @@ -1281,6 +1296,8 @@ function createReport(category, method, uuid, taskId) { } } }); + } else { + $.simpleAlert('不支持创建手册'); } return taskId; } @@ -1290,25 +1307,25 @@ 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); } } if (ids.length == 0) return data; if (createTime == 'submit_create') {// 提交时创建手册 - for (var i = 0; i < data.length; i++) { - if(jQuery.inArray(data[i].publishFileId, ids) != -1) { - data[i].taskId = 'submit_create'; - }; - } - return data; - } + for (var i = 0; i < data.length; i++) { + if(jQuery.inArray(data[i].publishFileId, ids) != -1) { + data[i].taskId = 'submit_create'; + }; + } + return data; + } var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create", - teamId: teamId, - wsId: wsId, - uuids: JSON.stringify(ids) + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create", + teamId: teamId, + wsId: wsId, + uuids: JSON.stringify(ids) } $.ajax({ url : "./jd", @@ -1323,7 +1340,7 @@ function createBatchReport(data, createTime) { if (result[data[i].id] != undefined) { data[i].taskId = result[data[i].id]; } - } + } } } }); @@ -1334,12 +1351,12 @@ function createBatchReport(data, createTime) { function getVersionsAndCreateReport(data, createTime) { if (data.length == 0) return data; var param = { - 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 + 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 } $.ajax({ url : "./jd", @@ -1354,51 +1371,61 @@ function getVersionsAndCreateReport(data, createTime) { return data; } +// 获取手册专属名称 +function getOutputName(category) { + return (category == 'process' ? '流程' : category == 'data' ? '表单' : category == 'control' ? '制度' : '') + '手册'; +} + //单个流程立即创建流程手册 function quickCreateReport(obj, object, type) { - 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; + debugger; + 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; } - $.simpleAlert("正在创建", "loading"); - taskId = createReport(category, method, uuid, taskId); - $.simpleAlert("close"); - //打开流程手册 - $(object).attr('onclick', "openReportFile(\'" + taskId + "\')"); + $.simpleAlert("正在创建", "loading"); + taskId = createReport(category, method, uuid, taskId); + $.simpleAlert("close"); + //打开流程手册 + $(object).attr('onclick', "openReportFile(\'" + taskId + "\')"); - //三员管理下,立即创建 + //三员管理下,立即创建 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(''); } // 清空树结构 @@ -1420,22 +1447,22 @@ function closeDialog() { function openReportFile(taskId) { $.simpleAlert("文件正在处理", "loading"); awsui.ajax.request({ - 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"); - } - }); + 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"); + } + }); } // 删除 @@ -1451,215 +1478,215 @@ function deleteFile(type) { $.simpleAlert('请选择列表中数据'); return; } else { - 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'); + 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; } - }); - 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; - } - } - } - 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'); + } + } + 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; } - }); - 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; - } - } - } - 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'); + } + } + 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; } - }); - 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; - } - } - } - 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); + } + } + 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); } } else { $.simpleAlert('列表中无数据'); @@ -1668,19 +1695,19 @@ function deleteFile(type) { //by bzp 清空流程级别信息和审批人信息 function clearLevelAndApproveInfo(){ - //审批人信息 - 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(); + //审批人信息 + 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(); } // 变更说明内容时处理 @@ -1727,7 +1754,7 @@ function onCheckboxClickEvent(boItemName, $checkbox, val) { // 主体内容显示与隐藏 function dealPublishCheck(isCheck, type) { if (type == 'new') { - isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); + isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); } else if (type == 'change') { isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide(); } else if (type == 'stop') { @@ -1749,13 +1776,13 @@ function saveFormData(type) { saveData = stopTemp; } var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_batch_save", - teamId: teamId, - wsId: wsId, - processInstId : processInstId, - type : type, - data: JSON.stringify(saveData) + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_batch_save", + teamId: teamId, + wsId: wsId, + processInstId : processInstId, + type : type, + data: JSON.stringify(saveData) } var flag = false; var tempData; @@ -1770,27 +1797,27 @@ function saveFormData(type) { flag = true; tempData = r.data.data; } - }, + }, error : function(XMLHttpRequest, textStatus, errorThrown) { $.simpleAlert("表单信息错误,请联系管理员!", 'error'); } }); $.simpleAlert('close'); if (flag) { - var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理'; + var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理'; if (tempData.length > 0) { - for (var i = 0; i < tempData.length; i++) { - msg += '
' + tempData[i].name + ' V' + tempData[i].version + '.0'; - } - } + for (var i = 0; i < tempData.length; i++) { + msg += '
' + tempData[i].name + ' V' + tempData[i].version; + } + } var options = { - title : "提示", - content:msg, - type:"alert", - onConfirm: function(){ - } - }; - $.confirm(options); + title : "提示", + content:msg, + type:"alert", + onConfirm: function(){ + } + }; + $.confirm(options); } else { $.simpleAlert('保存成功', 'ok'); } @@ -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++; @@ -1824,7 +1852,7 @@ function formSave(isTransact){ $.simpleAlert('发布内容不能为空', 'info'); return false; } - + // 校验变更文件是否全部都有变更后文件 if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) { var flag = false; @@ -1832,20 +1860,20 @@ function formSave(isTransact){ for (var i = 0; i < changeTemp.length; i++) { if (changeTemp[i].changedFileIdNew == "") { flag = true; - msg += '
' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion + '.0'; + msg += '
' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion; } } if (flag) { var options = { - title : "提示", - content:msg, - type:"alert", - onConfirm: function(){ - } - }; + title : "提示", + content:msg, + type:"alert", + onConfirm: function(){ + } + }; $.simpleAlert('close'); - $.confirm(options); - return false; + $.confirm(options); + return false; } } } @@ -1870,12 +1898,12 @@ 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' + "
在变更流程和停用流程中同时存在,不允许办理", 'error'); + $.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + "
在变更流程和停用流程中同时存在,不允许办理", 'error'); return false; } } } - } + } } //三员管理,提交后不生成手册,更改taskId if (isHighSecurity){ @@ -1892,15 +1920,15 @@ function formSave(isTransact){ } // 保存 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 + 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; @@ -1915,34 +1943,34 @@ function formSave(isTransact){ flag = true; tempData = r.data.data; } - }, + }, error : function(XMLHttpRequest, textStatus, errorThrown) { $.simpleAlert("表单信息错误,请联系管理员!", 'error'); } }); $.simpleAlert('close'); if (flag) { - var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理'; + var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理'; if (tempData.length > 0) { - for (var i = 0; i < tempData.length; i++) { - msg += '
' + tempData[i].name + ' V' + tempData[i].version + '.0'; - } - } + for (var i = 0; i < tempData.length; i++) { + msg += '
' + tempData[i].name + ' V' + tempData[i].version; + } + } var options = { - title : "提示", - content:msg, - type:"alert", - onConfirm: function(){ - } - }; - $.confirm(options); - return false; + title : "提示", + content:msg, + type:"alert", + onConfirm: function(){ + } + }; + $.confirm(options); + return false; } else { newTemp = newTempData; if (newTemp.length == 0) { newPageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 }; $('#new_pagination').hide(); initPublishData(newTemp, 'new', 1, 1); @@ -1950,8 +1978,8 @@ function formSave(isTransact){ changeTemp = changeTempData; if (changeTemp.length == 0) { changePageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 }; $('#change_pagination').hide(); initPublishData(changeTemp, 'change', 1, 1); @@ -1959,8 +1987,8 @@ function formSave(isTransact){ stopTemp = stopTempData; if (stopTemp.length == 0) { stopPageSetting = { - pageNum:1, - start:1 + pageNum:1, + start:1 }; $('#stop_pagination').hide(); initPublishData(stopTemp, 'stop', 1, 1); @@ -1995,11 +2023,11 @@ function initPublishSearch(type) { searchProcess(type); } }); - $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () { - $('#autoSearchProcessDiv').show(); - }).off("autoSearchProcessDiv").on("mouseleave", function () { - $('#autoSearchProcessDiv').hide(); - }); + $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () { + $('#autoSearchProcessDiv').show(); + }).off("autoSearchProcessDiv").on("mouseleave", function () { + $('#autoSearchProcessDiv').hide(); + }); } // 搜索 @@ -2010,106 +2038,106 @@ function searchProcess(type) { } var name = $("#processName").val().trim().toLowerCase(); var html = ''; - //先向后台请求完整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 += '
'; - html += ''; - html += '
' + path + '
'; - html += '
'; - html += '
'; - html += '
'; - } - } - } 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 += '
'; - html += ''; - html += '
' + path + '
'; - html += '
'; - html += '
'; - html += '
'; - } - } - }); - } + //先向后台请求完整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 += '
'; + html += ''; + html += '
' + path + '
'; + html += '
'; + html += '
'; + html += '
'; + } + } + } 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 += '
'; + html += ''; + html += '
' + path + '
'; + html += '
'; + html += '
'; + html += '
'; + } + } + }); + } if (html.length > 0) { - $("#autoSearchProcessDiv").html(html).show(); + $("#autoSearchProcessDiv").html(html).show(); // $("#processName").val(''); } } function getAllTreeData() { - 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; + 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; } function getSearchTreeNodePath(node, text, data, isPid) { - 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; - } + 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; + } } function getFilePath(node, text) { @@ -2136,19 +2164,19 @@ function auto_out(obj) { function auto_click(obj, type) { var plId = obj.find("span").attr("plId"); var type = obj.find("span").data("type"); - 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); - } + 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); + } initTree.expandNodes(dom, true, true, true); // 偏移至可见区域 var ele = document.getElementById('tree_span_' + plId); @@ -2180,7 +2208,7 @@ function listenCloseEvent() { } }); } - + //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件 window.onunload = function(){ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例 @@ -2218,4 +2246,27 @@ 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 { + + } + } + }); } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js index 9c12492a..c1cb12d4 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js @@ -22,20 +22,20 @@ $(document).ready(function(){ var resizeWaiter = false; $(window).resize(function() { if(!resizeWaiter){ - setTimeout(function(){ - resizeWaiter = true; - if (!$("#publisher_new_tr").is(':hidden')) { - initWidth(true, 'new'); - } + setTimeout(function(){ + resizeWaiter = true; + if (!$("#publisher_new_tr").is(':hidden')) { + initWidth(true, 'new'); + } if (!$("#publisher_change_tr").is(':hidden')) { initWidth(true, 'change'); } if (!$("#publisher_stop_tr").is(':hidden')) { initWidth(true, 'stop'); } - resizeWaiter = false; - }, 500); - } + resizeWaiter = false; + }, 500); + } }); // 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子 @@ -50,11 +50,11 @@ function initHtml() { dialogHtml += ''; dialogHtml += ''; $('body').append(dialogHtml); - + $('#publisher_new_div').html('
'); $('#publisher_change_div').html('
'); $('#publisher_stop_div').html('
'); - + var newHtml = ''; newHtml += ''; newHtml += '
'; @@ -83,7 +83,7 @@ function initHtml() { newHtml += ''; newHtml += ''; newHtml += '
'; - + var changeHtml = ''; changeHtml += ''; changeHtml += '
'; @@ -115,7 +115,7 @@ function initHtml() { changeHtml += ''; changeHtml += ''; changeHtml += '
'; - + var stopHtml = ''; stopHtml += ''; stopHtml += '
'; @@ -144,7 +144,7 @@ function initHtml() { stopHtml += ''; stopHtml += ''; stopHtml += '
'; - + $('#contentDiv1').append(newHtml); $('#contentDiv2').append(changeHtml); $('#contentDiv3').append(stopHtml); @@ -161,11 +161,11 @@ function initParam() { // 初始化内容数据 function initContentData() { var param = { - cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query', - processInstId: processInstId, - wsId : wsId, - sid: sid - }; + cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query', + processInstId: processInstId, + wsId : wsId, + sid: sid + }; $.ajax({ url : "./jd", type : "POST", @@ -212,7 +212,7 @@ function initContentData() { $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg); } } - + }); } @@ -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 = '' + fileName + ''; $('#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 != '') { @@ -274,7 +274,7 @@ function initPublishData(data, type, isEnd, proNumber) { $('#publisher_change_report_name').html('无流程手册'); } $('#publisher_change_report_id').text(data.taskId); - + // 下选框处理 if (!proNumber) { var tempHtml = '' + targetFileName + ''; @@ -283,12 +283,12 @@ function initPublishData(data, type, isEnd, proNumber) { $('#select').html(''); if (data.targetFiles.length > 0) { var opt1 = { - data : [] + data : [] }; 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 = '' + fileName + ''; $('#publisher_stop_file_name').children('span.file_name').html(aHtml); $('#publisher_stop_file_id').val(data.stopFileId); @@ -366,15 +366,15 @@ function initChangedData(data, opt1) { $('#publisher_change_report_name').html('无流程手册'); } $('#publisher_change_report_id').text(selectedTaskId); - + } // 打开流程文件查看页面 function openPortalPage(uuid, taskId) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", - uuid : uuid + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", + uuid : uuid } $.ajax({ url : "./jd", @@ -383,7 +383,7 @@ function openPortalPage(uuid, taskId) { data : param, success : function(r) { if (r.result == 'ok') { - window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows + window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows } else { $.simpleAlert(r.msg); } @@ -397,40 +397,40 @@ function openQueryDataDialog(type) { $('#treeDataDiv').html('
'); $('#searchData').html(''); $("#loadImg").loading({ - description:"加载中", - size:'large', - color:'#000' + description:"加载中", + size:'large', + color:'#000' }); $('.awsui-loading').css('position', 'relative'); $('.awsui-loading').css('top', '60px'); $("#loading-demo-basic").loading(); $("#treeDialog").dialog({ - buttons:[ - {text:'确定',cls:"blue",handler:function(){ - if (type == 'new') { - getNewPublishResult(type); - } else if( type == 'change'){ - getChangeResult(type); - } else {// stop - getStopResult(type); - } - }}, - {text:'关闭',handler:function(){ - closeDialog();// 关闭窗口 - }} - ], - onClose:function(){ - $('#autoSearchProcessDiv').empty(); - $('#autoSearchProcessDiv').hide(); - $('#treeDataDiv').empty(); - $('#searchData').empty(); - } - }); + buttons:[ + {text:'确定',cls:"blue",handler:function(){ + if (type == 'new') { + getNewPublishResult(type); + } else if( type == 'change'){ + getChangeResult(type); + } else {// stop + getStopResult(type); + } + }}, + {text:'关闭',handler:function(){ + closeDialog();// 关闭窗口 + }} + ], + onClose:function(){ + $('#autoSearchProcessDiv').empty(); + $('#autoSearchProcessDiv').hide(); + $('#treeDataDiv').empty(); + $('#searchData').empty(); + } + }); if (type == 'new') { - initPublishSearch(type);// 绑定搜索事件 + initPublishSearch(type);// 绑定搜索事件 getNotPublishTreeData(type); } else {// stop - initPublishSearch(type);// 绑定搜索事件 + initPublishSearch(type);// 绑定搜索事件 getPublishedTreeData(type); } } @@ -438,12 +438,12 @@ function openQueryDataDialog(type) { // 获取未发布文件数据结构 function getNotPublishTreeData(type) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag : true + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag : true } $.ajax({ url : "./jd", @@ -452,19 +452,19 @@ function getNotPublishTreeData(type) { data : param, success : function(r) { var data = r.data.data; - var setting = { - checkbox: false, - checkInherit: false, - event : { - beforeExpand : loadNewData - }, - dataModel : { - data: data - } - }; - $("#treeDataDiv").empty(); - $('#treeDataDiv').html(''); - initTree = awsui.tree.init($("#tree"), setting); + var setting = { + checkbox: false, + checkInherit: false, + event : { + beforeExpand : loadNewData + }, + dataModel : { + data: data + } + }; + $("#treeDataDiv").empty(); + $('#treeDataDiv').html(''); + initTree = awsui.tree.init($("#tree"), setting); } }); } @@ -472,16 +472,16 @@ function getNotPublishTreeData(type) { function loadNewData(treeNode) { // 如果是父节点并且存在子节点执行加载 if (treeNode) { - var pid; - if (typeof(treeNode) == "string") { - pid = treeNode; - } else { - pid = treeNode.id; - } + var pid; + if (typeof(treeNode) == "string") { + pid = treeNode; + } else { + pid = treeNode.id; + } var dataModel = { url : "./w?sid=" + jQuery("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid - + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, + + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid + + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, method : "POST", dataType : "json" } @@ -492,40 +492,40 @@ function loadNewData(treeNode) { var data = initTree.getChildrenByPid(pid); var newData = []; for (var i=0;i'; - } else if (hasDutyDept) { - var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; - data[i].name += '   ' + tempText + ''; - } else if (hasDutyUser) { - var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; - data[i].name += '   ' + tempText + ''; - } - newData.push(data[i]); - //initTree.refreshNodeById(data[i]); - } - initTree.refreshNode({ - id : pid, - data : newData - }); + if (data[i].pid != pid) { + continue; + } + var v = data[i].nocheck; + if (v && data[i].id.length <= 36){ + 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 += '   ' + tempText + ''; + } else if (hasDutyDept) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyUser) { + var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } + newData.push(data[i]); + //initTree.refreshNodeById(data[i]); + } + initTree.refreshNode({ + id : pid, + data : newData + }); } } @@ -548,14 +548,14 @@ function getNewPublishResult(type) { // 创建流程手册 taskId = createReport(node.category, node.method, node.id, taskId); var data = { - category : node.category, - fileVersion : node.version, - methodId : node.method, - publishDesc : "", - publishFileId : node.id, - // publishFileName : node.name, - publishFileName : node.tempName, - taskId : taskId + category : node.category, + fileVersion : node.version, + methodId : node.method, + publishDesc : "", + publishFileId : node.id, + // publishFileName : node.name, + publishFileName : node.tempName, + taskId : taskId } clearData(type);// 清空 closeDialog();// 关闭窗口 @@ -565,12 +565,12 @@ function getNewPublishResult(type) { //获取已发布文件数据结构 function getPublishedTreeData(type) { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag : true + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag : true } $.ajax({ url : "./jd", @@ -580,37 +580,37 @@ function getPublishedTreeData(type) { success : function(r) { var data = r.data.data; var setting = { - checkbox: false, - checkInherit: false, - dataModel : { - data: data - } - }; - for (var i=0;i'; - } else if (hasDutyDept) { - var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; - data[i].name += '   ' + tempText + ''; - } else if (hasDutyUser) { - var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; - data[i].name += '   ' + tempText + ''; - } - } - $("#treeDataDiv").empty(); - $('#treeDataDiv').html('
    '); - initTree = awsui.tree.init($("#tree"), setting); + checkbox: false, + checkInherit: false, + dataModel : { + data: data + } + }; + for (var i=0;i'; + } else if (hasDutyDept) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyUser) { + var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } + } + $("#treeDataDiv").empty(); + $('#treeDataDiv').html('
      '); + initTree = awsui.tree.init($("#tree"), setting); } }); } @@ -637,11 +637,11 @@ function getChangeResult(type) { var notPublishData = []; // 查询其他未版本 var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query", - teamId: teamId, - wsId: wsId, - uuid: node.id + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query", + teamId: teamId, + wsId: wsId, + uuid: node.id } $.ajax({ url : "./jd", @@ -657,19 +657,19 @@ function getChangeResult(type) { var changeFileNewName = ""; var changeFileNewVersion = 1; var data = { - category : node.category, - changeFileId : node.id, - // changeFileName : node.name, - changeFileName : node.tempName, - changedDesc : "", - changedFileIdNew : changeFileNewId, - changedFileNameNew : changeFileNewName, - fileVersion : node.version, - methodId : node.method, - targetCategory: node.category, - targetFileVersion: changeFileNewVersion, - targetFiles: notPublishData, - targetMethodId: node.method + category : node.category, + changeFileId : node.id, + // changeFileName : node.name, + changeFileName : node.tempName, + changedDesc : "", + changedFileIdNew : changeFileNewId, + changedFileNameNew : changeFileNewName, + fileVersion : node.version, + methodId : node.method, + targetCategory: node.category, + targetFileVersion: changeFileNewVersion, + targetFiles: notPublishData, + targetMethodId: node.method } clearData(type);// 清空 closeDialog();// 关闭窗口 @@ -695,11 +695,11 @@ function getStopResult(type) { if (node.category == 'process' && node.method != "process.evc" && node.method != 'default') { // 获取流程手册id var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query", - teamId: teamId, - wsId: wsId, - uuid: node.id + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query", + teamId: teamId, + wsId: wsId, + uuid: node.id } $.ajax({ url : "./jd", @@ -713,14 +713,14 @@ function getStopResult(type) { }); } var data = { - category : node.category, - fileVersion : node.version, - methodId : node.method, - stopDesc : "", - stopFileId : node.id, - // stopFileName : node.name, - stopFileName : node.tempName, - taskId : taskId + category : node.category, + fileVersion : node.version, + methodId : node.method, + stopDesc : "", + stopFileId : node.id, + // stopFileName : node.name, + stopFileName : node.tempName, + taskId : taskId } clearData(type);// 清空 closeDialog();// 关闭窗口 @@ -731,11 +731,11 @@ function getStopResult(type) { function createReport(category, method, uuid, taskId) { if (category == 'process' && method != "process.evc" && method != 'default') { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create", - teamId: teamId, - wsId: wsId, - uuid: uuid + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create", + teamId: teamId, + wsId: wsId, + uuid: uuid } $.ajax({ url : "./jd", @@ -745,7 +745,7 @@ function createReport(category, method, uuid, taskId) { data : param, success : function(r) { if (r.result == 'ok') { - taskId = r.data.taskId; + taskId = r.data.taskId; } } }); @@ -772,41 +772,41 @@ function closeDialog() { function openReportFile(taskId) { $.simpleAlert("文件正在处理", "loading"); awsui.ajax.request({ - 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"); - } - }); + 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"); + } + }); } // 点击checkbox function onCheckboxClickEvent(boItemName, $checkbox, val) { - var isCheck = !$checkbox.closest('div').hasClass('checked'); - if (val == '流程文件发布') { - dealPublishCheck(isCheck, 'new'); - } else if (val == '流程文件版本更新') { - dealPublishCheck(isCheck, 'change'); - } else if (val == '流程文件废止') { - dealPublishCheck(isCheck, 'stop'); - } + var isCheck = !$checkbox.closest('div').hasClass('checked'); + if (val == '流程文件发布') { + dealPublishCheck(isCheck, 'new'); + } else if (val == '流程文件版本更新') { + dealPublishCheck(isCheck, 'change'); + } else if (val == '流程文件废止') { + dealPublishCheck(isCheck, 'stop'); + } } // 主体内容显示与隐藏 function dealPublishCheck(isCheck, type) { if (type == 'new') { clearData(type); //清空 - isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); + isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); } else if (type == 'change') { clearData(type); isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide(); @@ -821,9 +821,9 @@ function dealPublishCheck(isCheck, type) { // 初始化宽度 function initWidth(isCheck, type) { if (type == 'new' && isCheck) { - $('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width()); - $('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20); - $('#publisher_new_desc').width('86%'); + $('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width()); + $('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20); + $('#publisher_new_desc').width('86%'); } if (type == 'change' && isCheck) { $('#publisher_change_source_file_name').width($('#publisher_change_source_file_name').closest('td').width()); @@ -833,7 +833,7 @@ function initWidth(isCheck, type) { } if (type == 'stop' && isCheck) { $('#publisher_stop_file_name').width($('#publisher_stop_file_name').closest('td').width()); - $('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20); + $('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20); $('#publisher_stop_desc').width('86%'); } } @@ -915,34 +915,34 @@ function formSave(isTransact){ var publishStopFileId = $('#publisher_stop_file_id').val(); var publishStopTaskId = $('#publisher_stop_report_id').text(); var publishStopDesc = $('#publisher_stop_desc').val(); - + var saveData = {}; var newObj = { - uuid : publishNewFileId, - taskId : publishNewTaskId, - desc : publishNewDesc + uuid : publishNewFileId, + taskId : publishNewTaskId, + desc : publishNewDesc }; var changeObj = { - uuid : publishChangeFileId, - targetId : publishChangeTargetFileId, - taskId : publishChangeTaskId, - desc : publishChangeDesc + uuid : publishChangeFileId, + targetId : publishChangeTargetFileId, + taskId : publishChangeTaskId, + desc : publishChangeDesc }; var stopObj = { - uuid : publishStopFileId, - taskId : publishStopTaskId, - desc : publishStopDesc + uuid : publishStopFileId, + taskId : publishStopTaskId, + desc : publishStopDesc }; saveData.newObj = newObj; saveData.changeObj = changeObj; saveData.stopObj = stopObj; var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_save_before", - teamId: teamId, - wsId: wsId, - processInstId : processInstId, - data: JSON.stringify(saveData) + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_save_before", + teamId: teamId, + wsId: wsId, + processInstId : processInstId, + data: JSON.stringify(saveData) } var flag = false; @@ -957,11 +957,11 @@ 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; } - }, + }, error : function(XMLHttpRequest, textStatus, errorThrown) { $.simpleAlert("表单信息错误,请联系管理员!", 'error'); } @@ -998,11 +998,11 @@ function initPublishSearch(type) { searchProcess(type); } }); - $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () { - $('#autoSearchProcessDiv').show(); - }).off("autoSearchProcessDiv").on("mouseleave", function () { - $('#autoSearchProcessDiv').hide(); - }); + $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () { + $('#autoSearchProcessDiv').show(); + }).off("autoSearchProcessDiv").on("mouseleave", function () { + $('#autoSearchProcessDiv').hide(); + }); } // 搜索 @@ -1012,107 +1012,107 @@ function searchProcess(type) { return; } var name = $("#processName").val().trim().toLowerCase(); - var html = ''; + var html = ''; //先向后台请求完整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 += '
      '; - html += ''; - html += '
      ' + path + '
      '; - html += '
      '; - html += '
      '; - html += '
      '; - } - } + 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 += '
      '; + html += ''; + html += '
      ' + path + '
      '; + html += '
      '; + html += '
      '; + html += '
      '; + } + } } 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 += '
      '; - html += ''; - html += '
      ' + path + '
      '; - html += '
      '; - html += '
      '; - html += '
      '; - } - } - }); + $('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 += '
      '; + html += ''; + html += '
      ' + path + '
      '; + html += '
      '; + html += '
      '; + html += '
      '; + } + } + }); } if (html.length > 0) { - $("#autoSearchProcessDiv").html(html).show(); + $("#autoSearchProcessDiv").html(html).show(); // $("#processName").val(''); } } function getAllTreeData() { - 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; + 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; } function getSearchTreeNodePath(node, text, data, isPid) { - 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; - } + 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; + } } function getFilePath(node, text) { @@ -1141,16 +1141,16 @@ function auto_click(obj, type) { var type = obj.find("span").data("type"); 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); - } + //预先去加载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); + initTree.expandNodes(dom, true, true, true); } // 偏移至可见区域 var ele = document.getElementById('tree_span_' + plId); @@ -1182,7 +1182,7 @@ function listenCloseEvent() { } }); } - + //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件 window.onunload = function(){ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例