diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar
index f25c969a..833a89bd 100644
Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ
diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java
index 30146862..ad8ff04a 100644
--- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java
+++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/ProcesNumberUtil.java
@@ -1,30 +1,14 @@
package com.actionsoft.apps.coe.pal.publisher.client.util;
-import java.sql.Timestamp;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishHistory;
-import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishHistoryModel;
-import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
-import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
-import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
-import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
-import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryPropertyDao;
-import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
-import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
-import com.actionsoft.apps.coe.pal.publisher.constant.PublisherConstant;
import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
-import com.actionsoft.bpms.util.UtilDate;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK;
-import com.alibaba.fastjson.JSONObject;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.sym;
+
+import java.util.List;
/**
* @author baizp
@@ -39,12 +23,12 @@ public class ProcesNumberUtil {
* @param regionCode
* @return
*/
- public String getProcessNum(String levelCode, String regionCode,String plcategory) {
-
- int nowNum = 1;
- //流程编号
- if (plcategory.contains("process")) {
- String querySql = "select ID,PROCESS_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
+ public String getProcessNum(String levelCode, String regionCode, String plcategory) {
+
+ int nowNum = 1;
+ //流程编号
+ if (plcategory.contains("process")) {
+ String querySql = "select ID,PROCESS_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
//如果没有就新增
if (result == null) {
@@ -58,13 +42,13 @@ public class ProcesNumberUtil {
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
if (nowNum < 10) {
return "00" + nowNum;
- }else if(nowNum >=10&&nowNum < 100){
- return "0" + nowNum;
+ } else if (nowNum >= 10 && nowNum < 100) {
+ return "0" + nowNum;
}
-
- } else if (plcategory.contains("control")) {
- //制度编号
- String querySql = "select ID,SYSTEM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
+
+ } else if (plcategory.contains("control")) {
+ //制度编号
+ String querySql = "select ID,SYSTEM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
//如果没有就新增
if (result == null) {
@@ -78,13 +62,13 @@ public class ProcesNumberUtil {
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
if (nowNum < 10) {
return "00" + nowNum;
- }else if(nowNum >=10&&nowNum < 100){
- return "0" + nowNum;
+ } else if (nowNum >= 10 && nowNum < 100) {
+ return "0" + nowNum;
}
-
- } else if (plcategory.contains("form")) {
- //表单编号
- String querySql = "select ID,FORM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
+
+ } else if (plcategory.contains("form")) {
+ //表单编号
+ String querySql = "select ID,FORM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
//如果没有就新增
if (result == null) {
@@ -98,314 +82,313 @@ public class ProcesNumberUtil {
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
if (nowNum < 10) {
return "00" + nowNum;
- }else if(nowNum >=10&&nowNum < 100){
- return "0" + nowNum;
+ } else if (nowNum >= 10 && nowNum < 100) {
+ return "0" + nowNum;
}
- }
-
-
-
+ }
+
+
return nowNum + "";
}
- /**
- * 生成编号并写入数据库
- *
- * @param bindId
- * @return
- */
- public String getNumber(String bindId) {
+ /**
+ * 生成编号并写入数据库
+ *
+ * @param bindId
+ * @return
+ */
+ public String getNumber(String bindId) {
- // 查询出所有的发布流程
- List dataList = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").addQuery("BINDID=", bindId).orderByCreated().asc().list();
- // 查询出所有的变更流程
- List changList = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").addQuery("BINDID=", bindId).orderByCreated().asc().list();
- if (changList.size() != 0) {
- for (BO changData : changList) {
- String change_numner = changData.getString("CHANGE_NUMBER");
- String changFileId = changData.getString("CHANGEFILEID");
- String changAfterFileId = changData.getString("CHANGEDFILEIDNEW");
- if(UtilString.isEmpty(change_numner)) {
- RowMap rowMap = DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='" + changAfterFileId + "'");
- String Vsion1Id = DBSql.getString("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLRID='"
- + rowMap.getString("PLRID") + "' AND" + " PLVER = 1 ");
- String publish_number = DBSql.getString(
- "SELECT PUBLISH_NUMBER FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID ='" + Vsion1Id + "'");
+ // 查询出所有的发布流程
+ List dataList = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").addQuery("BINDID=", bindId).orderByCreated().asc().list();
+ // 查询出所有的变更流程
+ List changList = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").addQuery("BINDID=", bindId).orderByCreated().asc().list();
+ if (changList.size() != 0) {
+ for (BO changData : changList) {
+ String change_numner = changData.getString("CHANGE_NUMBER");
+ String changFileId = changData.getString("CHANGEFILEID");
+ String changAfterFileId = changData.getString("CHANGEDFILEIDNEW");
+ if (UtilString.isEmpty(change_numner)) {
+ RowMap rowMap = DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='" + changAfterFileId + "'");
+ String Vsion1Id = DBSql.getString("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLRID='"
+ + rowMap.getString("PLRID") + "' AND" + " PLVER = 1 ");
+ String publish_number = DBSql.getString(
+ "SELECT PUBLISH_NUMBER FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID ='" + Vsion1Id + "'");
- System.out.println("获取编号为======================="+publish_number);
- if (UtilString.isNotEmpty(publish_number)) {
- // 设置模型ID
- String plver = "2.0";
- String plvers = rowMap.getString("PLVER");
- if (!"".equals(plvers)) {
- if (plvers.length() > 1) {
- plver = plvers.substring(0, 1) + "."
- + plvers.substring(plvers.length() - 1, plvers.length());
- } else {
- plver = plvers.substring(0, 1) + ".0";
- }
- }
-
- String new_number = publish_number.replaceAll("V1.0", "V"+plver);
- String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where CHANGEDFILEIDNEW = '%s'";
- //更新子表文件编码属性
- int update = DBSql.update(String.format(updateSql, new_number, changAfterFileId));
- System.out.println("更新子表文件编号:" + update + "--->" + new_number);
- String fileName = "file_number";
- if (rowMap != null) {
- String plcategory = rowMap.getString("PLMETHODID");
- if (plcategory.contains("form")) {
- fileName = "form_number";
- }
-
- }
- //更新模型文件编码属性
- String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
- int update2 = DBSql.update(String.format(updateAttrsql, new_number, fileName, changAfterFileId));
- System.out.println("更新模型文件编号:" + update2 + "--->" + new_number);
- }else {
- // 查询出主表数据
- BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
+ System.out.println("获取编号为=======================" + publish_number);
+ if (UtilString.isNotEmpty(publish_number)) {
+ // 设置模型ID
+ String plver = "2.0";
+ String plvers = rowMap.getString("PLVER");
+ if (!"".equals(plvers)) {
+ if (plvers.length() > 1) {
+ plver = plvers.substring(0, 1) + "."
+ + plvers.substring(plvers.length() - 1, plvers.length());
+ } else {
+ plver = plvers.substring(0, 1) + ".0";
+ }
+ }
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(bindId);
- String levelnum=null;
- String orgCode=null;
- String regionCode=null;
- String productCode=null;
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
- // 根据主表数据查询出权限的编码
- String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' "
- + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
- RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
- mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
- mainData.getString("LEVEL_3_PROCESS_NAME"),
- mainData.getString("ADAPT_REGION_NAME"),
- mainData.getString("APPLICABLE_PRODUCT")));
- // 获取所有的流程编码 如果为空则为00
- orgCode = authData.getString("ORGCODE");
- String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
- String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
- String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
- regionCode = authData.getString("ADAPT_REGION_CODE");
- productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
- // 依次生成编号~并回填 修改
- if (UtilString.isNotEmpty(levelTwo)) {
- levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
- } else {
- levelTwo = "00";
- }
- if (UtilString.isNotEmpty(levelThree)) {
- levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
- } else {
- levelThree = "00";
- }
+ String new_number = publish_number.replaceAll("V1.0", "V" + plver);
+ String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where CHANGEDFILEIDNEW = '%s'";
+ //更新子表文件编码属性
+ int update = DBSql.update(String.format(updateSql, new_number, changAfterFileId));
+ System.out.println("更新子表文件编号:" + update + "--->" + new_number);
+ String fileName = "file_number";
+ if (rowMap != null) {
+ String plcategory = rowMap.getString("PLMETHODID");
+ if (plcategory.contains("form")) {
+ fileName = "form_number";
+ }
- levelnum = levelOne + "." + levelTwo + "." + levelThree;
- }else{
- // 根据主表数据查询出权限的编码
- String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' "
- + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
- RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
- mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
- mainData.getString("LEVEL_3_PROCESS_NAME"),
- mainData.getString("LEVEL_4_PROCESS_NAME"),
- mainData.getString("ADAPT_REGION_NAME"),
- mainData.getString("APPLICABLE_PRODUCT")));
- // 获取所有的流程编码 如果为空则为00
- orgCode = authData.getString("ORGCODE");
- String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
- String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
- String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
- String levelFour = authData.getString("LEVEL_4_PROCESS_ID");
- regionCode = authData.getString("ADAPT_REGION_CODE");
- productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
- // 依次生成编号~并回填 修改
- if (UtilString.isNotEmpty(levelTwo)) {
- levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
- } else {
- levelTwo = "00";
- }
- if (UtilString.isNotEmpty(levelThree)) {
- levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
- } else {
- levelThree = "00";
- }
- if (UtilString.isNotEmpty(levelFour)) {
- levelFour = levelFour.substring(levelFour.lastIndexOf(".") + 1, levelFour.length());
- } else {
- levelFour = "00";
- }
+ }
+ //更新模型文件编码属性
+ String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
+ int update2 = DBSql.update(String.format(updateAttrsql, new_number, fileName, changAfterFileId));
+ System.out.println("更新模型文件编号:" + update2 + "--->" + new_number);
+ } else {
+ // 查询出主表数据
+ BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
- levelnum = levelOne + "." + levelTwo + "." + levelThree +"."+levelFour;
- }
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(bindId);
+ String levelnum = null;
+ String orgCode = null;
+ String regionCode = null;
+ String productCode = null;
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
+ // 根据主表数据查询出权限的编码
+ String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' "
+ + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
+ RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
+ mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
+ mainData.getString("LEVEL_3_PROCESS_NAME"),
+ mainData.getString("ADAPT_REGION_NAME"),
+ mainData.getString("APPLICABLE_PRODUCT")));
+ // 获取所有的流程编码 如果为空则为00
+ orgCode = authData.getString("ORGCODE");
+ String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
+ String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
+ String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
+ regionCode = authData.getString("ADAPT_REGION_CODE");
+ productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+ // 依次生成编号~并回填 修改
+ if (UtilString.isNotEmpty(levelTwo)) {
+ levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
+ } else {
+ levelTwo = "00";
+ }
+ if (UtilString.isNotEmpty(levelThree)) {
+ levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
+ } else {
+ levelThree = "00";
+ }
- String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where ID = '%s'";
- rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
- + changAfterFileId + "' AND" + " ISUSE = 1 ");
- String name = "";
- String fileName = "file_number";
- String plver = "2.0";
- if (rowMap != null) {
- String plcategory = rowMap.getString("PLMETHODID");
- String plvers = rowMap.getString("PLVER");
- String number = getProcessNum(levelnum, orgCode,plcategory);
- if (plcategory.contains("process")) {
-
- name = "/P" + number;
- } else if (plcategory.contains("control")) {
- name = "/R" + number;
- } else if (plcategory.contains("form")) {
- fileName = "form_number";
- name = "/T" + number;
- }
- if (!"".equals(plvers)) {
- if (plvers.length() > 1) {
- plver = plvers.substring(0, 1) + "."
- + plvers.substring(plvers.length() - 1, plvers.length());
- } else {
- plver = plvers.substring(0, 1) + ".0";
- }
- }
- }
-
- String processNum = levelnum + name + "V" + plver +"-"+ orgCode + regionCode + productCode;
- String s = changData.getId();
- int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
- System.out.println("更新表单文件编号回填:" + update + "--->" + processNum+" 文件id"+s);
- String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
- int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, changAfterFileId));
- System.out.println("更新模型文件编号回填:" + update2 + "--->" + processNum +" 文件id"+changAfterFileId);
- }
-
- }
- }
- }
+ levelnum = levelOne + "." + levelTwo + "." + levelThree;
+ } else {
+ // 根据主表数据查询出权限的编码
+ String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' "
+ + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
+ RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
+ mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
+ mainData.getString("LEVEL_3_PROCESS_NAME"),
+ mainData.getString("LEVEL_4_PROCESS_NAME"),
+ mainData.getString("ADAPT_REGION_NAME"),
+ mainData.getString("APPLICABLE_PRODUCT")));
+ // 获取所有的流程编码 如果为空则为00
+ orgCode = authData.getString("ORGCODE");
+ String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
+ String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
+ String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
+ String levelFour = authData.getString("LEVEL_4_PROCESS_ID");
+ regionCode = authData.getString("ADAPT_REGION_CODE");
+ productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+ // 依次生成编号~并回填 修改
+ if (UtilString.isNotEmpty(levelTwo)) {
+ levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
+ } else {
+ levelTwo = "00";
+ }
+ if (UtilString.isNotEmpty(levelThree)) {
+ levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
+ } else {
+ levelThree = "00";
+ }
+ if (UtilString.isNotEmpty(levelFour)) {
+ levelFour = levelFour.substring(levelFour.lastIndexOf(".") + 1, levelFour.length());
+ } else {
+ levelFour = "00";
+ }
- if (dataList.size() != 0) {
- // 查询出主表数据
- BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
+ levelnum = levelOne + "." + levelTwo + "." + levelThree + "." + levelFour;
+ }
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(bindId);
- String levelnum=null;
- String orgCode=null;
- String regionCode=null;
- String productCode=null;
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
- // 根据主表数据查询出权限的编码
- String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' "
- + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
- RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
- mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
- mainData.getString("LEVEL_3_PROCESS_NAME"),
- mainData.getString("ADAPT_REGION_NAME"),
- mainData.getString("APPLICABLE_PRODUCT")));
- // 获取所有的流程编码 如果为空则为00
- orgCode = authData.getString("ORGCODE");
- String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
- String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
- String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
- regionCode = authData.getString("ADAPT_REGION_CODE");
- productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+ String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where ID = '%s'";
+ rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
+ + changAfterFileId + "' AND" + " ISUSE = 1 ");
+ String name = "";
+ String fileName = "file_number";
+ String plver = "2.0";
+ if (rowMap != null) {
+ String plcategory = rowMap.getString("PLMETHODID");
+ String plvers = rowMap.getString("PLVER");
+ String number = getProcessNum(levelnum, orgCode, plcategory);
+ if (plcategory.contains("process")) {
- // 依次生成编号~并回填 修改
- if (UtilString.isNotEmpty(levelTwo)) {
- levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
- } else {
- levelTwo = "00";
- }
- if (UtilString.isNotEmpty(levelThree)) {
- levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
- } else {
- levelThree = "00";
- }
- levelnum = levelOne + "." + levelTwo + "." + levelThree ;
- }else{
- // 根据主表数据查询出权限的编码
- String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' "
- + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
- RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
- mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
- mainData.getString("LEVEL_3_PROCESS_NAME"),
- mainData.getString("LEVEL_4_PROCESS_NAME"),
- mainData.getString("ADAPT_REGION_NAME"),
- mainData.getString("APPLICABLE_PRODUCT")));
- // 获取所有的流程编码 如果为空则为00
- orgCode = authData.getString("ORGCODE");
- String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
- String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
- String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
- String levelFour = authData.getString("LEVEL_4_PROCESS_ID");
- regionCode = authData.getString("ADAPT_REGION_CODE");
- productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+ name = "/P" + number;
+ } else if (plcategory.contains("control")) {
+ name = "/R" + number;
+ } else if (plcategory.contains("form")) {
+ fileName = "form_number";
+ name = "/T" + number;
+ }
+ if (!"".equals(plvers)) {
+ if (plvers.length() > 1) {
+ plver = plvers.substring(0, 1) + "."
+ + plvers.substring(plvers.length() - 1, plvers.length());
+ } else {
+ plver = plvers.substring(0, 1) + ".0";
+ }
+ }
+ }
- // 依次生成编号~并回填 修改
- if (UtilString.isNotEmpty(levelTwo)) {
- levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
- } else {
- levelTwo = "00";
- }
- if (UtilString.isNotEmpty(levelThree)) {
- levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
- } else {
- levelThree = "00";
- }
+ String processNum = levelnum + name + "V" + plver + "-" + orgCode + regionCode + productCode;
+ String s = changData.getId();
+ int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
+ System.out.println("更新表单文件编号回填:" + update + "--->" + processNum + " 文件id" + s);
+ String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
+ int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, changAfterFileId));
+ System.out.println("更新模型文件编号回填:" + update2 + "--->" + processNum + " 文件id" + changAfterFileId);
+ }
- if (UtilString.isNotEmpty(levelFour)) {
- levelFour = levelFour.substring(levelFour.lastIndexOf(".") + 1, levelFour.length());
- } else {
- levelFour = "00";
- }
+ }
+ }
+ }
- levelnum = levelOne + "." + levelTwo + "." + levelThree +"."+levelFour;
- }
+ if (dataList.size() != 0) {
+ // 查询出主表数据
+ BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
+
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(bindId);
+ String levelnum = null;
+ String orgCode = null;
+ String regionCode = null;
+ String productCode = null;
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
+ // 根据主表数据查询出权限的编码
+ String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' "
+ + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
+ RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
+ mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
+ mainData.getString("LEVEL_3_PROCESS_NAME"),
+ mainData.getString("ADAPT_REGION_NAME"),
+ mainData.getString("APPLICABLE_PRODUCT")));
+ // 获取所有的流程编码 如果为空则为00
+ orgCode = authData.getString("ORGCODE");
+ String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
+ String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
+ String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
+ regionCode = authData.getString("ADAPT_REGION_CODE");
+ productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+
+ // 依次生成编号~并回填 修改
+ if (UtilString.isNotEmpty(levelTwo)) {
+ levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
+ } else {
+ levelTwo = "00";
+ }
+ if (UtilString.isNotEmpty(levelThree)) {
+ levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
+ } else {
+ levelThree = "00";
+ }
+ levelnum = levelOne + "." + levelTwo + "." + levelThree;
+ } else {
+ // 根据主表数据查询出权限的编码
+ String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' "
+ + " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
+ RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
+ mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
+ mainData.getString("LEVEL_3_PROCESS_NAME"),
+ mainData.getString("LEVEL_4_PROCESS_NAME"),
+ mainData.getString("ADAPT_REGION_NAME"),
+ mainData.getString("APPLICABLE_PRODUCT")));
+ // 获取所有的流程编码 如果为空则为00
+ orgCode = authData.getString("ORGCODE");
+ String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
+ String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
+ String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
+ String levelFour = authData.getString("LEVEL_4_PROCESS_ID");
+ regionCode = authData.getString("ADAPT_REGION_CODE");
+ productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
+
+ // 依次生成编号~并回填 修改
+ if (UtilString.isNotEmpty(levelTwo)) {
+ levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
+ } else {
+ levelTwo = "00";
+ }
+ if (UtilString.isNotEmpty(levelThree)) {
+ levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
+ } else {
+ levelThree = "00";
+ }
+
+ if (UtilString.isNotEmpty(levelFour)) {
+ levelFour = levelFour.substring(levelFour.lastIndexOf(".") + 1, levelFour.length());
+ } else {
+ levelFour = "00";
+ }
+
+ levelnum = levelOne + "." + levelTwo + "." + levelThree + "." + levelFour;
+ }
- String updateSql = "update BO_ACT_COE_PUBLISH_N set PUBLISH_NUMBER='%s' where ID = '%s'";
- for (BO nowData : dataList) {
- String publish_numner = nowData.getString("PUBLISH_NUMBER");
- if(UtilString.isEmpty(publish_numner)) {
- String publishfileid = nowData.getString("PUBLISHFILEID");
- RowMap rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
- + publishfileid + "' AND" + " ISUSE = 1 ");
- String name = "00R00";
- String fileName = "file_number";
- String plver = "1.0";
- if (rowMap != null) {
- String plcategory = rowMap.getString("PLMETHODID");
- String plvers = rowMap.getString("PLVER");
- String number = getProcessNum(levelnum, orgCode,plcategory);
-
- if (plcategory.contains("process")) {
- name = "/P" + number;
- } else if (plcategory.contains("control")) {
- name = "/R" + number;
- } else if (plcategory.contains("form")) {
- fileName = "form_number";
- name = "/T" + number;
- }
- if (!"".equals(plvers)) {
- if (plvers.length() > 1) {
- plver = plvers.substring(0, 1) + "."
- + plvers.substring(plvers.length() - 1, plvers.length());
- } else {
- plver = plvers.substring(0, 1) + ".0";
- }
- }
- }
-
- String processNum = levelnum + name + "V" + plver +"-"+orgCode + regionCode + productCode;
- String s = nowData.getId();
- int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
- System.out.println("表单文件编号回填:" + update + "--->" + processNum);
- String publishFileId = nowData.getString("PUBLISHFILEID");
- String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
- int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, publishFileId));
- System.out.println("模型文件编号回填:" + update2 + "--->" + processNum);
- // 更新流程绩效的编号----规则没看懂
- }
- }
- }
- return "OK";
- }
+ String updateSql = "update BO_ACT_COE_PUBLISH_N set PUBLISH_NUMBER='%s' where ID = '%s'";
+ for (BO nowData : dataList) {
+ String publish_numner = nowData.getString("PUBLISH_NUMBER");
+ if (UtilString.isEmpty(publish_numner)) {
+ String publishfileid = nowData.getString("PUBLISHFILEID");
+ RowMap rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
+ + publishfileid + "' AND" + " ISUSE = 1 ");
+ String name = "00R00";
+ String fileName = "file_number";
+ String plver = "1.0";
+ if (rowMap != null) {
+ String plcategory = rowMap.getString("PLMETHODID");
+ String plvers = rowMap.getString("PLVER");
+ String number = getProcessNum(levelnum, orgCode, plcategory);
+
+ if (plcategory.contains("process")) {
+ name = "/P" + number;
+ } else if (plcategory.contains("control")) {
+ name = "/R" + number;
+ } else if (plcategory.contains("form")) {
+ fileName = "form_number";
+ name = "/T" + number;
+ }
+ if (!"".equals(plvers)) {
+ if (plvers.length() > 1) {
+ plver = plvers.substring(0, 1) + "."
+ + plvers.substring(plvers.length() - 1, plvers.length());
+ } else {
+ plver = plvers.substring(0, 1) + ".0";
+ }
+ }
+ }
+
+ String processNum = levelnum + name + "V" + plver + "-" + orgCode + regionCode + productCode;
+ String s = nowData.getId();
+ int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
+ System.out.println("表单文件编号回填:" + update + "--->" + processNum);
+ String publishFileId = nowData.getString("PUBLISHFILEID");
+ String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
+ int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, publishFileId));
+ System.out.println("模型文件编号回填:" + update2 + "--->" + processNum);
+ // 更新流程绩效的编号----规则没看懂
+ }
+ }
+ }
+ return "OK";
+ }
}
diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java
index 12fa93d0..fe986ab4 100644
--- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java
+++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java
@@ -1,31 +1,5 @@
package com.actionsoft.apps.coe.pal.publisher.client.web;
-import java.io.File;
-import java.sql.Timestamp;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager;
-import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel;
-import com.actionsoft.exception.AWSDataAccessException;
-import com.actionsoft.sdk.local.api.BOQueryAPI;
-import org.apache.commons.lang.StringUtils;
-
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
@@ -47,6 +21,8 @@ import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryPropertyDao;
+import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager;
+import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel;
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelAutoBean;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
@@ -86,16 +62,14 @@ import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.server.fs.dc.DCUtil;
import com.actionsoft.bpms.util.Base64;
-import com.actionsoft.bpms.util.DBSql;
-import com.actionsoft.bpms.util.UUIDGener;
-import com.actionsoft.bpms.util.UtilDate;
-import com.actionsoft.bpms.util.UtilFile;
-import com.actionsoft.bpms.util.UtilString;
+import com.actionsoft.bpms.util.*;
+import com.actionsoft.exception.AWSDataAccessException;
import com.actionsoft.exception.AWSException;
import com.actionsoft.exception.AWSQuotaException;
import com.actionsoft.i18n.I18nRes;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.AppAPI;
+import com.actionsoft.sdk.local.api.BOQueryAPI;
import com.actionsoft.sdk.local.api.ProcessExecuteQuery;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -104,6 +78,15 @@ import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.commons.lang.StringUtils;
+
+import java.io.File;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.stream.Collectors;
/**
* 流程发布App
@@ -1914,7 +1897,7 @@ public class ProcessPublishWeb extends ActionWeb {
if (stopBo != null) {
- String stopId=stopBo.getString("STOPFILEID");
+ String stopId = stopBo.getString("STOPFILEID");
/******************** 附件 **********************/
// 文件或节点自身附件
JSONArray js = new JSONArray();
@@ -3409,9 +3392,9 @@ public class ProcessPublishWeb extends ActionWeb {
PALRepositoryModel stopmodel = PALRepositoryCache.getCache().get(stopBo.getString("STOPFILEID"));
- String stopId=stopBo.getString("STOPFILEID");
+ String stopId = stopBo.getString("STOPFILEID");
- String methodId=stopmodel.getMethodId();
+ String methodId = stopmodel.getMethodId();
/******************** 附件 ************************/
// 文件或节点自身附件
@@ -3524,7 +3507,6 @@ public class ProcessPublishWeb extends ActionWeb {
obj.put("upfileId", js);
-
}
}
}
@@ -4339,7 +4321,7 @@ public class ProcessPublishWeb extends ActionWeb {
* @param datas
* @return
*/
- public String getLevelByData(UserContext me, String wsId, String type, String datas,String processInstId) {
+ public String getLevelByData(UserContext me, String wsId, String type, String datas, String processInstId) {
ResponseObject ro = ResponseObject.newOkResponse();
JSONArray palarr = JSON.parseArray(datas);
JSONObject result = new JSONObject();
@@ -4366,9 +4348,9 @@ public class ProcessPublishWeb extends ActionWeb {
String methodId = paljb.getString("methodId");
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(processInstId);
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
- //ID获取L1 L2 L3 的值
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(processInstId);
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
+ //ID获取L1 L2 L3 的值
List resulttmp = DBSql.getMaps(String.format("select PROPERTYID,PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYID in ('Process_Architecture_L1','Process_Architecture_L2','Process_Architecture_L3') AND PLID='%s'", id));
for (RowMap tmp : resulttmp) {
String key = tmp.getString("PROPERTYID");
@@ -4389,7 +4371,7 @@ public class ProcessPublishWeb extends ActionWeb {
}
result.put(key, value);
}
- }else{
+ } else {
//ID获取L1 L2 L3 L4 的值
List resulttmp = DBSql.getMaps(String.format("select PROPERTYID,PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYID in ('Process_Architecture_L1','Process_Architecture_L2','Process_Architecture_L3','Process_Architecture_L4') AND PLID='%s'", id));
for (RowMap tmp : resulttmp) {
@@ -4435,22 +4417,22 @@ public class ProcessPublishWeb extends ActionWeb {
* @param product
* @return
*/
- public String getApproveInfos(UserContext me, String level1, String level2, String level3,String level4, String company, String region, String product, String bindid) {
+ public String getApproveInfos(UserContext me, String level1, String level2, String level3, String level4, String company, String region, String product, String bindid) {
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(bindid);
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(bindid);
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
//l1 l2 l3 l4 保存到表里
DBSql.update(String.format("update BO_ACT_COE_PUBLISH set LEVEL_1_PROCESS_NAME='%s',LEVEL_2_PROCESS_NAME='%s',LEVEL_3_PROCESS_NAME='%s' where BINDID='%s'", level1, level2, level3, bindid));
String sql = "select AUDITOR1,AUDITOR_NO_1,L1_SP,AUDITOR2,AUDITOR_NO_2,L2_SP,AUDITOR3,AUDITOR_NO_3,L3_SP from BO_ACT_AUTH_INFO where LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and ORGNAME='%s' and ADAPT_REGION_NAME='%s' and APPLICABLE_PRODUCT='%s'";
- RowMap result = DBSql.getMap(String.format(sql, level1, level2, level3,company, region, product));
+ RowMap result = DBSql.getMap(String.format(sql, level1, level2, level3, company, region, product));
ResponseObject ro = ResponseObject.newOkResponse();
ro.put("data", result == null ? "" : result);
return ro.toString();
- }else{
+ } else {
//l1 l2 l3 l4 保存到表里
- DBSql.update(String.format("update BO_ACT_COE_PUBLISH set LEVEL_1_PROCESS_NAME='%s',LEVEL_2_PROCESS_NAME='%s',LEVEL_3_PROCESS_NAME='%s',LEVEL_4_PROCESS_NAME='%s' where BINDID='%s'", level1, level2, level3,level4, bindid));
- String sql = "select AUDITOR1,AUDITOR_NO_1,L1_SP,AUDITOR2,AUDITOR_NO_2,L2_SP,AUDITOR3,AUDITOR_NO_3,L3_SP from BO_ACT_AUTH_INFO where LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' and ORGNAME='%s' and ADAPT_REGION_NAME='%s' and APPLICABLE_PRODUCT='%s'";
- RowMap result = DBSql.getMap(String.format(sql, level1, level2, level3, level4,company, region, product));
+ DBSql.update(String.format("update BO_ACT_COE_PUBLISH set LEVEL_1_PROCESS_NAME='%s',LEVEL_2_PROCESS_NAME='%s',LEVEL_3_PROCESS_NAME='%s',LEVEL_4_PROCESS_NAME='%s' where BINDID='%s'", level1, level2, level3, level4, bindid));
+ String sql = "select AUDITOR1,AUDITOR_NO_1,L1_SP,AUDITOR2,AUDITOR_NO_2,L2_SP,AUDITOR3,AUDITOR_NO_3,L3_SP,AUDITOR4,AUDITOR_NO_4,L4_SP from BO_ACT_AUTH_INFO where LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s' and LEVEL_4_PROCESS_NAME='%s' and ORGNAME='%s' and ADAPT_REGION_NAME='%s' and APPLICABLE_PRODUCT='%s'";
+ RowMap result = DBSql.getMap(String.format(sql, level1, level2, level3, level4, company, region, product));
ResponseObject ro = ResponseObject.newOkResponse();
ro.put("data", result == null ? "" : result);
return ro.toString();
@@ -4570,8 +4552,8 @@ public class ProcessPublishWeb extends ActionWeb {
*/
public String getProcessManifest(String publishFileId, String fileName) {
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(publishFileId, 0);
- if(defineModel==null){
- return ResponseObject.newErrResponse("当前模型名称:【"+fileName+"】当前不存在活动节点 请配置活动节点后再进行查看活动清单操作!").toString();
+ if (defineModel == null) {
+ return ResponseObject.newErrResponse("当前模型名称:【" + fileName + "】当前不存在活动节点 请配置活动节点后再进行查看活动清单操作!").toString();
}
String definition = defineModel.getDefinition();
JSONObject definitionJo = JSONObject.parseObject(definition);
@@ -4605,7 +4587,7 @@ public class ProcessPublishWeb extends ActionWeb {
* @param shape 形状
* @param fileName 文件名称
*/
- private void setShapeAttr(ArrayList bos, String publishFileId, JSONObject shape, String fileName , List processLevel) {
+ private void setShapeAttr(ArrayList bos, String publishFileId, JSONObject shape, String fileName, List processLevel) {
//只需要活动节点
if (shape.containsKey("category") && !shape.getString("title").equals("开始/结束")) {
BO bo = new BO();
@@ -4666,7 +4648,7 @@ public class ProcessPublishWeb extends ActionWeb {
if (publishNBO.size() > 0) {
for (BO onePublishN : publishNBO) {
- if(onePublishN.getString("TASKID").equals("submit_create")){
+ if (onePublishN.getString("TASKID").equals("submit_create")) {
return ResponseObject.newWarnResponse("请先创建手册!!").toString();
}
String plId = onePublishN.getString("PUBLISHFILEID");
@@ -4694,7 +4676,7 @@ public class ProcessPublishWeb extends ActionWeb {
}
}
- } else if(type.equals("2")) {
+ } else if (type.equals("2")) {
//发布变更文件
List publishCBO = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C").bindId(processInstId).list();
@@ -4702,7 +4684,7 @@ public class ProcessPublishWeb extends ActionWeb {
for (BO onePublishC : publishCBO) {
- if(onePublishC.getString("TASKID")=="submit_create"){
+ if (onePublishC.getString("TASKID") == "submit_create") {
return ResponseObject.newWarnResponse("请先创建手册!!").toString();
}
@@ -4731,7 +4713,7 @@ public class ProcessPublishWeb extends ActionWeb {
}
}
- }else if(type.equals("3")) {
+ } else if (type.equals("3")) {
//发布变更文件
List publishSBO = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S").bindId(processInstId).list();
@@ -4769,7 +4751,7 @@ public class ProcessPublishWeb extends ActionWeb {
}
}
} catch (AWSDataAccessException e) {
- ro.put("result","创建手册失败!!!");
+ ro.put("result", "创建手册失败!!!");
e.printStackTrace();
}
return ro.toString();
@@ -4789,8 +4771,8 @@ public class ProcessPublishWeb extends ActionWeb {
}
ResponseObject ro = ResponseObject.newOkResponse();
try {
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(processInstId);
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(processInstId);
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
//ID获取L1 L2 L3 的值
List resulttmp = DBSql.getMaps(String.format("select PROPERTYID,PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYID in ('Process_Architecture_L1','Process_Architecture_L2','Process_Architecture_L3') AND PLID='%s'", uuid));
for (RowMap tmp : resulttmp) {
@@ -4800,7 +4782,7 @@ public class ProcessPublishWeb extends ActionWeb {
}
ro.put("data", result);
ro.put("info", iswrong);
- }else{
+ } else {
//ID获取L1 L2 L3 L4 的值
List resulttmp = DBSql.getMaps(String.format("select PROPERTYID,PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYID in ('Process_Architecture_L1','Process_Architecture_L2','Process_Architecture_L3','Process_Architecture_L4') AND PLID='%s'", uuid));
for (RowMap tmp : resulttmp) {
@@ -4821,6 +4803,7 @@ public class ProcessPublishWeb extends ActionWeb {
/**
* 中断任务操作
+ *
* @param uuid
* @param processInstId
* @return
@@ -4831,10 +4814,10 @@ public class ProcessPublishWeb extends ActionWeb {
return ResponseObject.newErrResponse("流程实例未找到").toString();
}
int count = DBSql.update("UPDATE BO_ACT_EXECUTIVE_TASK SET TASKSTATUS='2' WHERE TASKID ='" + taskId + "'");
- if(count>0){
- ro.put("result","ok");
- }else{
- ro.put("result","error");
+ if (count > 0) {
+ ro.put("result", "ok");
+ } else {
+ ro.put("result", "error");
}
return ro.toString();
}
diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java
index 8d1f07b0..9ecc9627 100644
--- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java
+++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java
@@ -22,7 +22,6 @@ import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener;
import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface;
-import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.util.DBSql;
@@ -51,7 +50,6 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
/**
- *
* @param param
* @return
* @throws Exception
@@ -60,36 +58,34 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
public boolean execute(ProcessExecutionContext param) throws Exception {
-
- List gridNData=SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(param.getProcessInstance().getId()).list();
- String bindid=param.getProcessInstance().getId();
- StringBuffer sb=new StringBuffer();
- StringBuffer sb1=new StringBuffer();
+ List gridNData = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(param.getProcessInstance().getId()).list();
+ String bindid = param.getProcessInstance().getId();
+ StringBuffer sb = new StringBuffer();
+ StringBuffer sb1 = new StringBuffer();
if (gridNData.size() > 0) {
for (BO rowData : gridNData) {
//下面一行示例代码,可以获取Ajax子表的每行记录的新建状态
String publishfileid = String.valueOf(rowData.getString("PUBLISHFILEID"));//注意:isCreate并不是BO的一个字段,该字段是有接口上层赋值的
- verifyPublish(publishfileid,rowData,bindid,sb,sb1,"1");
+ verifyPublish(publishfileid, rowData, bindid, sb, sb1, "1");
}
}
//发布变更
- List gridCData=SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(param.getProcessInstance().getId()).list();
+ List gridCData = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(param.getProcessInstance().getId()).list();
if (gridCData.size() > 0) {
for (BO rowData : gridCData) {
//下面一行示例代码,可以获取Ajax子表的每行记录的新建状态
String publishfileid = String.valueOf(rowData.getString("CHANGEDFILEIDNEW"));//注意:isCreate并不是BO的一个字段,该字段是有接口上层赋值的
- verifyPublish(publishfileid,rowData,bindid,sb,sb1,"2");
- }
+ verifyPublish(publishfileid, rowData, bindid, sb, sb1, "2");
}
+ }
return true;
}
-
- public void verifyPublish(String publishfileid,BO rowData,String bindid,StringBuffer sb,StringBuffer sb1,String type){
+ public void verifyPublish(String publishfileid, BO rowData, String bindid, StringBuffer sb, StringBuffer sb1, String type) {
defineQualityCheck(publishfileid);
// 校验
PALRepositoryModel model = PALRepositoryCache.getCache().get(publishfileid);
@@ -102,135 +98,132 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
for (PALRepositoryPropertyModel propertyModel : oldPropertyList) {
//获取文件属性中支持文件
- if(propertyModel.getPropertyId().equals("support_files")){
+ if (propertyModel.getPropertyId().equals("support_files")) {
//获取关联模型id
- String relationFileId= null;
+ String relationFileId = null;
try {
- String propertyValue = propertyModel.getPropertyValue();
- System.err.println("propertyValue========>"+propertyValue);
- if(UtilString.isNotEmpty(propertyValue)&&propertyValue.contains("{")) {
- relationFileId = JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
- }
+ String propertyValue = propertyModel.getPropertyValue();
+ System.err.println("propertyValue========>" + propertyValue);
+ if (UtilString.isNotEmpty(propertyValue) && propertyValue.contains("{")) {
+ relationFileId = JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
+ }
} catch (Exception e) {
- // e.printStackTrace();
+ // e.printStackTrace();
throw new BPMNError("0313", sb.append("模型名称:").append(model.getName()).append("关联支持文件异常,请联系管理员!!!").append("").toString());
}
//获取关联表单模型id
- List> fileElements ;
- if(UtilString.isNotEmpty(relationFileId)){
+ List> fileElements;
+ if (UtilString.isNotEmpty(relationFileId)) {
- int len=relationFileId.split(",").length;
+ int len = relationFileId.split(",").length;
- String[] splitRelationFileId=relationFileId.split(",");
+ String[] splitRelationFileId = relationFileId.split(",");
- //如果当前使用中并且已发布给与通过
- if(splitRelationFileId.length>0){
+ //如果当前使用中并且已发布给与通过
+ if (splitRelationFileId.length > 0) {
- for(int i=0;i");
- }
- //如果当前不是使用中查找使用中版本
- }else if(isUse==false && publish==true){
-
- List versions = PALRepositoryCache.getByVersionId(model.getVersionId());
- if(versions.size()>0) {
- for(int k=0;k");
- }
- }
- }
- }
- }else if(isUse==false && publish==false) {
-
- List versions = PALRepositoryCache.getByVersionId(model.getVersionId());
- if(versions.size()>0) {
- for(int k=0;k");
- }
- }
- }
- }
-
+ if (publishNrowMap == null && publishCrowMap == null) {
+ sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("");
}
- if(onemodel.getMethodId().equals("data.form")){
- fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[i]);
+ //如果当前不是使用中查找使用中版本
+ } else if (isUse == false && publish == true) {
- for (Map shape : fileElements) {
- String tempShapeId = shape.get("id").toString();
+ List versions = PALRepositoryCache.getByVersionId(model.getVersionId());
+ if (versions.size() > 0) {
+ for (int k = 0; k < versions.size(); k++) {
- UpFileDao dao = new UpFileDao();
- // 文件:根据relationFileId 和 文件类型 查询
- List list2;
+ boolean isUseV = versions.get(k).isUse();
+ boolean isPublishV = versions.get(k).isPublish();
- list2= dao.search(splitRelationFileId[i], tempShapeId, "s");
+ if (isUseV == true && isPublishV == false) {
- if(list2.size()==0){
- String name="";
- if (type == "1") {
- name=rowData.getString("PUBLISHFILENAME");
- } else {
- name=rowData.getString("CHANGEFILENAME");
+ fileElements = CoeDesignerUtil.getShapeMessageJson4(onemodel.getId());
+
+ RowMap publishCrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[0]);
+
+
+ RowMap publishNrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_N T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.PUBLISHFILEID=T2.ID WHERE T1.BINDID=? AND T1.PUBLISHFILEID=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[0]);
+
+ if (publishNrowMap == null && publishCrowMap == null) {
+ sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("");
}
- sb.append(name).append("关联模型名称:").append("").append("【").append(shape.get("plName")).append("】").append("节点名称:").append("【"+shape.get("name")+"】").append("未上传附件,请检查!!!").append("").append(",");
}
-
}
}
+ } else if (isUse == false && publish == false) {
+
+ List versions = PALRepositoryCache.getByVersionId(model.getVersionId());
+ if (versions.size() > 0) {
+ for (int k = 0; k < versions.size(); k++) {
+
+ boolean isUseV = versions.get(k).isUse();
+ boolean isPublishV = versions.get(k).isPublish();
+
+ if (isUseV == true && isPublishV == false) {
+
+ fileElements = CoeDesignerUtil.getShapeMessageJson4(onemodel.getId());
+ RowMap publishCrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[0]);
+ RowMap publishNrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_N T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.PUBLISHFILEID=T2.ID WHERE T1.BINDID=? AND T1.PUBLISHFILEID=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[0]);
-
+ if (publishNrowMap == null && publishCrowMap == null) {
+ sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("");
+ }
+ }
+ }
+ }
}
+ if (onemodel.getMethodId().equals("data.form")) {
+ fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[i]);
+
+ for (Map shape : fileElements) {
+ String tempShapeId = shape.get("id").toString();
+
+ UpFileDao dao = new UpFileDao();
+ // 文件:根据relationFileId 和 文件类型 查询
+ List list2;
+
+ list2 = dao.search(splitRelationFileId[i], tempShapeId, "s");
+
+ if (list2.size() == 0) {
+ String name = "";
+ if (type == "1") {
+ name = rowData.getString("PUBLISHFILENAME");
+ } else {
+ name = rowData.getString("CHANGEFILENAME");
+ }
+ sb.append(name).append("关联模型名称:").append("").append("【").append(shape.get("plName")).append("】").append("节点名称:").append("【" + shape.get("name") + "】").append("未上传附件,请检查!!!").append("").append(",");
+ }
+
+ }
+ }
+
}
}
+ }
+
}
}
@@ -244,18 +237,18 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
}
-
/**
* 判断文件属性、数据属性校验
+ *
* @param uuid
* @return
*/
- public void defineQualityCheck(String uuid){
+ public void defineQualityCheck(String uuid) {
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
- String vison = getVison(uuid);
+ String vison = getVison(uuid);
List elements_fei = getShapeJsonToJsonObject2(vison);
- StringBuffer sb6= new StringBuffer();
+ StringBuffer sb6 = new StringBuffer();
StringBuilder sbs = new StringBuilder();
List list_linker = new LinkedList<>();
//连线数据增加
@@ -267,7 +260,7 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
String title = o.getString("title");
if (!shapeName.equals("linker")) {
list_linker.add(shapeId);
- json.put(shapeId,title);
+ json.put(shapeId, title);
}
}
@@ -283,23 +276,23 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
String to_id = to.getString("id");
if (UtilString.isNotEmpty(from_id)) {
list_linker.remove(from_id);
- }else {
+ } else {
JSONObject definition = JSONObject.parseObject(vison);
JSONObject elements = definition.getJSONObject("elements");
JSONObject string = elements.getJSONObject(to_id);
String title = string.getString("title");
- sb6.append("\""+title+"\"").append("连线没有入线");
- list_linker.add("\""+title+"\""+"连线没有入线");
+ sb6.append("\"" + title + "\"").append("连线没有入线");
+ list_linker.add("\"" + title + "\"" + "连线没有入线");
}
if (UtilString.isNotEmpty(to_id)) {
list_linker.remove(to_id);
- }else {
+ } else {
JSONObject definition = JSONObject.parseObject(vison);
JSONObject elements = definition.getJSONObject("elements");
JSONObject string = elements.getJSONObject(from_id);
String title = string.getString("title");
- sb6.append("\""+title+"\"").append("连线没有出线");
- list_linker.add("\""+title+"\""+"连线没有出线");
+ sb6.append("\"" + title + "\"").append("连线没有出线");
+ list_linker.add("\"" + title + "\"" + "连线没有出线");
}
}
//System.out.println("m的值>>>>>>>>>>>" + ms);
@@ -316,9 +309,9 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
sb6.append("校验未通过,请检查模型是否都已连线!");
sbs.append(sb6);
}
- if (sbs.length()>0){
+ /*if (sbs.length()>0){
throw new BPMNError("0313", sbs.toString());
- }
+ }*/
/************************************文件属性校验************************************/
ResponseObject ro = ResponseObject.newOkResponse();
@@ -338,13 +331,14 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
List propertys = dao.getPropertysByPlid(uuid, null);
- Boolean flag1=true;
- Boolean flag2=true;
+ Boolean flag1 = true;
+ Boolean flag2 = true;
StringBuffer sb = new StringBuffer();
- StringBuffer sb1=new StringBuffer();
- StringBuffer sb2=new StringBuffer();
- StringBuffer sb3=new StringBuffer();
- StringBuffer sb4 = new StringBuffer();;
+ StringBuffer sb1 = new StringBuffer();
+ StringBuffer sb2 = new StringBuffer();
+ StringBuffer sb3 = new StringBuffer();
+ StringBuffer sb4 = new StringBuffer();
+ ;
sb.append("质量校验 ");
@@ -370,16 +364,16 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
flag1 = UtilString.isNotEmpty(property.getPropertyValue());
}
if (!flag1) {// 校验不通过
- sb1.append("''"+attributeModel.getTitle()+"''").append(",");
+ sb1.append("''" + attributeModel.getTitle() + "''").append(",");
flag1 = false;
}
}
- if(sb1.length()>0){
- sb.append("模型名称:【"+model.getName()+"】 ");
+ if (sb1.length() > 0) {
+ sb.append("模型名称:【" + model.getName() + "】 ");
sb.append("文件属性: ");
- sb.append(sb1.substring(0, sb1.length()-1));
+ sb.append(sb1.substring(0, sb1.length() - 1));
sb.append("未填写,请检查!").append("");
}
@@ -430,27 +424,26 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
flag2 = UtilString.isNotEmpty(value);
}
if (!flag2) {
- sb2.append("节点名称:"+"【"+text+"】").append("''"+attrModel.getNewTitle()+"''").append("");
+ sb2.append("节点名称:" + "【" + text + "】").append("''" + attrModel.getNewTitle() + "''").append("");
}
}
}
}
- if(sb2.length()>0){
+ if (sb2.length() > 0) {
sb.append("数据属性: ");
- sb.append(sb2.substring(0, sb2.length()-1));
+ sb.append(sb2.substring(0, sb2.length() - 1));
sb.append("未填写,请检查!");
}
- int index=sb.indexOf("未填写");
- if(index!=-1){
- ro.put("result","error");
+ int index = sb.indexOf("未填写");
+ if (index != -1) {
+ ro.put("result", "error");
sb1 = sb.deleteCharAt(sb.length() - 1);
throw new BPMNError("0313", sb1.toString());
}
-
}
public static List getShapeJsonToJsonObject2(String messageJson) {
@@ -462,7 +455,7 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
String key = ite.next();
JSONObject shape = elements.getJSONObject(key);
String name = shape.getString("name");
- if ("linker".equals(name)){
+ if ("linker".equals(name)) {
JSONObject jsonObj = new JSONObject();
jsonObj.put("id", key);
jsonObj.put("name", shape.getString("name"));
@@ -529,10 +522,11 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
/**
* 根据uuid寻找对应的json文件即图形文件
+ *
* @param uuid 文件id
* @return json文件
*/
- public String getVison(String uuid) {
+ public String getVison(String uuid) {
List> fileElements = CoeDesignerUtil.getShapeMessageJson4(uuid);
JSONObject definition = new JSONObject(new LinkedHashMap<>());
if (fileElements.size() > 0) {
@@ -541,7 +535,7 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(uuid, 0);
String define = defineModel.getDefinition();
- definition = JSONObject.parseObject(define);
+ definition = JSONObject.parseObject(define);
}
}
diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java
index 809ad534..377b05b1 100644
--- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java
+++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormAfterSave.java
@@ -1,8 +1,5 @@
package com.actionsoft.apps.coe.pal.publisher.event;
-import java.util.ArrayList;
-import java.util.List;
-
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.publisher.constant.PublisherConstant;
@@ -18,11 +15,13 @@ import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.BOQueryAPI;
import org.apache.commons.lang.StringUtils;
-import org.docx4j.wml.P;
+
+import java.util.ArrayList;
+import java.util.List;
public class SubFormAfterSave extends ExecuteListener {
-
- public String getDescription() {
+
+ public String getDescription() {
return "子表单保存后,拆分成多条数据保存到数据库中";
}
@@ -35,7 +34,7 @@ public class SubFormAfterSave extends ExecuteListener {
}
public void execute(ProcessExecutionContext param) throws Exception {
- String processInstId = param.getProcessInstance().getId();
+ String processInstId = param.getProcessInstance().getId();
//记录ID
String boId = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
//表单ID
@@ -47,85 +46,85 @@ public class SubFormAfterSave extends ExecuteListener {
String bindId = formData.getBindId();
String uid = formData.getCreateUser();
if (boName.equals("BO_ACT_COE_PUBLISH_N")) {
- // 保存前的表单数据,注意:该参数针对不同场景获取内容会有所不同
+ // 保存前的表单数据,注意:该参数针对不同场景获取内容会有所不同
// 主表场景获取主表数据;子表场景获取子表数据;获取不同的数据请使用BOQueryAPI获取
String publishFileId = formData.getString("PUBLISHFILEID");
String publishDesc = formData.getString("PUBLISHDESC");
-
+
BOQueryAPI boQueryAPI = SDK.getBOAPI().query(boName);
boQueryAPI = boQueryAPI.bindId(bindId);
List list = boQueryAPI.list();
StringBuilder boFileIds = new StringBuilder();
for (BO bo : list) {
- if (!bo.getId().equals(formData.getId())) {
- boFileIds.append(bo.get("PUBLISHFILEID"));
- }
+ if (!bo.getId().equals(formData.getId())) {
+ boFileIds.append(bo.get("PUBLISHFILEID"));
+ }
}
String existedBoFileIds = boFileIds.toString();
if (publishFileId != null && publishFileId.length() > 0) {
- String[] publishFileIds = publishFileId.split(",");
- List boList = new ArrayList();
- for (String fileId : publishFileIds) {
- if (!existedBoFileIds.contains(fileId)) {
- PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(fileId);
- if (repositoryModel != null) {
- BO newBO = new BO();
- newBO.setId(UUIDGener.getUUID());
- newBO.set("PUBLISTHTYPE", "N");
- newBO.set("PUBLISHFILEID", fileId);
- newBO.set("PUBLISHFILENAME", repositoryModel.getName());
- newBO.set("PUBLISHDESC", publishDesc);
- boList.add(newBO);
- }
- }
- }
- SDK.getBOAPI().create(boName, boList, bindId, uid);
- // 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态
+ String[] publishFileIds = publishFileId.split(",");
+ List boList = new ArrayList();
+ for (String fileId : publishFileIds) {
+ if (!existedBoFileIds.contains(fileId)) {
+ PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(fileId);
+ if (repositoryModel != null) {
+ BO newBO = new BO();
+ newBO.setId(UUIDGener.getUUID());
+ newBO.set("PUBLISTHTYPE", "N");
+ newBO.set("PUBLISHFILEID", fileId);
+ newBO.set("PUBLISHFILENAME", repositoryModel.getName());
+ newBO.set("PUBLISHDESC", publishDesc);
+ boList.add(newBO);
+ }
+ }
+ }
+ SDK.getBOAPI().create(boName, boList, bindId, uid);
+ // 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态
boolean isCreate = param.getParameterOfBoolean(ListenerConst.FORM_EVENT_PARAM_ISCREATE);
if (isCreate) {
- SDK.getBOAPI().remove(boName, boId);
+ SDK.getBOAPI().remove(boName, boId);
}
}
} else if (boName.equals("BO_ACT_COE_PUBLISH_S")) {
- BOQueryAPI boQueryAPI = SDK.getBOAPI().query(boName);
+ BOQueryAPI boQueryAPI = SDK.getBOAPI().query(boName);
boQueryAPI = boQueryAPI.bindId(bindId);
List list = boQueryAPI.list();
StringBuilder boFileIds = new StringBuilder();
for (BO bo : list) {
- if (!bo.getId().equals(formData.getId())) {
- boFileIds.append(bo.get("STOPFILEID"));
- }
+ if (!bo.getId().equals(formData.getId())) {
+ boFileIds.append(bo.get("STOPFILEID"));
+ }
}
String existedBoFileIds = boFileIds.toString();
-
+
String stopFileId = formData.getString("STOPFILEID");
String stopDesc = formData.getString("STOPDESC");
if (stopFileId != null && stopFileId.length() > 0) {
- String[] publishFileIds = stopFileId.split(",");
- List boList = new ArrayList();
- for (String fileId : publishFileIds) {
- if (!existedBoFileIds.contains(fileId)) {
- PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(fileId);
- if (repositoryModel != null) {
- BO newBO = new BO();
- newBO.setId(UUIDGener.getUUID());
- newBO.set("STOPTYPE", "S");
- newBO.set("STOPFILEID", fileId);
- newBO.set("STOPFILENAME", repositoryModel.getName());
- newBO.set("STOPDESC", stopDesc);
- boList.add(newBO);
- }
- }
- }
-
-
- SDK.getBOAPI().create(boName, boList, bindId, uid);
- // 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态
+ String[] publishFileIds = stopFileId.split(",");
+ List boList = new ArrayList();
+ for (String fileId : publishFileIds) {
+ if (!existedBoFileIds.contains(fileId)) {
+ PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(fileId);
+ if (repositoryModel != null) {
+ BO newBO = new BO();
+ newBO.setId(UUIDGener.getUUID());
+ newBO.set("STOPTYPE", "S");
+ newBO.set("STOPFILEID", fileId);
+ newBO.set("STOPFILENAME", repositoryModel.getName());
+ newBO.set("STOPDESC", stopDesc);
+ boList.add(newBO);
+ }
+ }
+ }
+
+
+ SDK.getBOAPI().create(boName, boList, bindId, uid);
+ // 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态
boolean isCreate = param.getParameterOfBoolean(ListenerConst.FORM_EVENT_PARAM_ISCREATE);
if (isCreate) {
- SDK.getBOAPI().remove(boName, boId);
+ SDK.getBOAPI().remove(boName, boId);
}
-
+
//保存文件类型到主表
saveFileType(processInstId);
}
@@ -133,101 +132,102 @@ public class SubFormAfterSave extends ExecuteListener {
//保存文件类型到主表
saveFileType(processInstId);
- System.out.println(formData.getString("ADAPT_NAME_THE_COMPANY"));
- System.out.println(formData.getString("ADAPT_REGION_NAME"));
- System.out.println(formData.getString("APPLICABLE_PRODUCT"));
+ System.out.println(formData.getString("ADAPT_NAME_THE_COMPANY"));
+ System.out.println(formData.getString("ADAPT_REGION_NAME"));
+ System.out.println(formData.getString("APPLICABLE_PRODUCT"));
/*
根据L1、L2、L3、L4查询权限矩阵所属分部数据
*/
- ProcessInstance processInstance=SDK.getProcessAPI().getInstanceById(processInstId);
- if(processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362")){
- String sql = "SELECT SSFB FROM BO_ACT_AUTH_INFO WHERE LEVEL_1_PROCESS_NAME=? AND LEVEL_2_PROCESS_NAME=? AND LEVEL_3_PROCESS_NAME=? AND ORGNAME=? AND ADAPT_REGION_NAME=? AND APPLICABLE_PRODUCT=?";
- String ssfb = DBSql.getString(sql, new Object[] { formData.getString("LEVEL_1_PROCESS_NAME"),formData.getString("LEVEL_2_PROCESS_NAME"),formData.getString("LEVEL_3_PROCESS_NAME"),formData.getString("LEVEL_4_PROCESS_NAME"),formData.getString("ADAPT_NAME_THE_COMPANY"),formData.getString("ADAPT_REGION_NAME"),formData.getString("APPLICABLE_PRODUCT") });
+ ProcessInstance processInstance = SDK.getProcessAPI().getInstanceById(processInstId);
+ if (processInstance.getProcessDefId().equals("obj_fb1c7a54b98b412187388c8bab407362") || processInstance.getProcessDefId().equals("obj_5609e1d265dc4e7094c617f20be353dd") || processInstance.getProcessDefId().equals("obj_114e76f691c14beb902e9904f4be26f8")) {
+ String sql = "SELECT SSFB FROM BO_ACT_AUTH_INFO WHERE LEVEL_1_PROCESS_NAME=? AND LEVEL_2_PROCESS_NAME=? AND LEVEL_3_PROCESS_NAME=? AND ORGNAME=? AND ADAPT_REGION_NAME=? AND APPLICABLE_PRODUCT=?";
+ String ssfb = DBSql.getString(sql, new Object[]{formData.getString("LEVEL_1_PROCESS_NAME"), formData.getString("LEVEL_2_PROCESS_NAME"), formData.getString("LEVEL_3_PROCESS_NAME"), formData.getString("ADAPT_NAME_THE_COMPANY"), formData.getString("ADAPT_REGION_NAME"), formData.getString("APPLICABLE_PRODUCT")});
- if(StringUtils.isNotEmpty(ssfb)){
- int r1 = DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET SSFB='" + ssfb + "'WHERE BINDID ='" + processInstId + "'");
- }
- }else{
- String sql = "SELECT SSFB FROM BO_ACT_AUTH_INFO WHERE LEVEL_1_PROCESS_NAME=? AND LEVEL_2_PROCESS_NAME=? AND LEVEL_3_PROCESS_NAME=? AND LEVEL_4_PROCESS_NAME=? AND ORGNAME=? AND ADAPT_REGION_NAME=? AND APPLICABLE_PRODUCT=?";
- String ssfb = DBSql.getString(sql, new Object[] { formData.getString("LEVEL_1_PROCESS_NAME"),formData.getString("LEVEL_2_PROCESS_NAME"),formData.getString("LEVEL_3_PROCESS_NAME"),formData.getString("LEVEL_4_PROCESS_NAME"),formData.getString("ADAPT_NAME_THE_COMPANY"),formData.getString("ADAPT_REGION_NAME"),formData.getString("APPLICABLE_PRODUCT") });
-
- if(StringUtils.isNotEmpty(ssfb)){
- int r1 = DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET SSFB='" + ssfb + "'WHERE BINDID ='" + processInstId + "'");
- }
- }
+ if (StringUtils.isNotEmpty(ssfb)) {
+ int r1 = DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET SSFB='" + ssfb + "'WHERE BINDID ='" + processInstId + "'");
+ }
+ } else {
+ String sql = "SELECT SSFB FROM BO_ACT_AUTH_INFO WHERE LEVEL_1_PROCESS_NAME=? AND LEVEL_2_PROCESS_NAME=? AND LEVEL_3_PROCESS_NAME=? AND LEVEL_4_PROCESS_NAME=? AND ORGNAME=? AND ADAPT_REGION_NAME=? AND APPLICABLE_PRODUCT=?";
+ String ssfb = DBSql.getString(sql, new Object[]{formData.getString("LEVEL_1_PROCESS_NAME"), formData.getString("LEVEL_2_PROCESS_NAME"), formData.getString("LEVEL_3_PROCESS_NAME"), formData.getString("LEVEL_4_PROCESS_NAME"), formData.getString("ADAPT_NAME_THE_COMPANY"), formData.getString("ADAPT_REGION_NAME"), formData.getString("APPLICABLE_PRODUCT")});
+ if (StringUtils.isNotEmpty(ssfb)) {
+ int r1 = DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET SSFB='" + ssfb + "'WHERE BINDID ='" + processInstId + "'");
+ }
+ }
}
+
public String saveFileType(String processInstId) {
- List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list();
- ArrayList arr = new ArrayList();
- if(bolistN.size()>0) {
- for (BO bo : bolistN) {
- try {
- typeList(arr, bo.getString("PUBLISHFILEID"));
- } catch (Exception e) {
- // TODO: handle exception
- }
- }
- }
- List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list();
- if(bolistC.size()>0) {
- for (BO bo : bolistC) {
- try {
- typeList(arr, bo.getString("CHANGEDFILEIDNEW"));
- } catch (Exception e) {
- // TODO: handle exception
- }
- }
-
- }
-
- List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list();
- if(bolistS.size()>0) {
- for (BO bo : bolistS) {
- try {
- typeList(arr, bo.getString("STOPFILEID"));
- } catch (Exception e) {
- // TODO: handle exception
- }
- }
- }
- //保存发布文件的类型到主表
- if((arr.contains("表单模板")||arr.contains("操作指导"))&&!arr.contains("制度模型")&&!arr.contains("EPC模型")&&!arr.contains("泳道图")) {
- DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '操作指导/表单模板',SECONDARY_AUDIT_REQUIRED = 'N',LEVEL_1_AUDIT_REQUIRED = 'N' WHERE BINDID = '"+processInstId+"'");
- //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板");
- }else {
- DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '制度模型/EPC模型/泳道图' WHERE BINDID = '"+processInstId+"'");
- //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图");
- }
- return processInstId;
+ List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list();
+ ArrayList arr = new ArrayList();
+ if (bolistN.size() > 0) {
+ for (BO bo : bolistN) {
+ try {
+ typeList(arr, bo.getString("PUBLISHFILEID"));
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+ }
+ List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list();
+ if (bolistC.size() > 0) {
+ for (BO bo : bolistC) {
+ try {
+ typeList(arr, bo.getString("CHANGEDFILEIDNEW"));
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ }
+
+ List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list();
+ if (bolistS.size() > 0) {
+ for (BO bo : bolistS) {
+ try {
+ typeList(arr, bo.getString("STOPFILEID"));
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+ }
+ //保存发布文件的类型到主表
+ if ((arr.contains("表单模板") || arr.contains("操作指导")) && !arr.contains("制度模型") && !arr.contains("EPC模型") && !arr.contains("泳道图")) {
+ DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '操作指导/表单模板',SECONDARY_AUDIT_REQUIRED = 'N',LEVEL_1_AUDIT_REQUIRED = 'N' WHERE BINDID = '" + processInstId + "'");
+ //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板");
+ } else {
+ DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '制度模型/EPC模型/泳道图' WHERE BINDID = '" + processInstId + "'");
+ //SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图");
+ }
+ return processInstId;
+ }
+
+ public ArrayList typeList(ArrayList arr, String plId) {
+ String sql = "SELECT PLMETHODID,EXT3 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + plId + "'";
+ RowMap map = DBSql.getMap(sql);
+ if (map != null) {
+ String methodId = map.getString("PLMETHODID");
+ if ("control.policy".equals(methodId)) {
+ String fileType = map.getString("EXT3");
+ if ("I/O_L4".equals(fileType)) {
+ arr.add("操作指导");
+ } else {
+ arr.add("制度模型");
+ }
+ } else if ("data.form".equals(methodId)) {
+ arr.add("表单模板");
+ } else if ("process.epc".equals(methodId)) {
+ arr.add("EPC模型");
+ } else if ("process.flowchart".equals(methodId)) {
+ arr.add("泳道图");
+ }
+
+
+ }
+ return arr;
}
- public ArrayList typeList(ArrayList arr,String plId){
- String sql = "SELECT PLMETHODID,EXT3 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+plId+"'";
- RowMap map = DBSql.getMap(sql);
- if(map!=null) {
- String methodId = map.getString("PLMETHODID");
- if("control.policy".equals(methodId)) {
- String fileType = map.getString("EXT3");
- if("I/O_L4".equals(fileType)) {
- arr.add("操作指导");
- }else {
- arr.add("制度模型");
- }
- }else if("data.form".equals(methodId)) {
- arr.add("表单模板");
- }else if("process.epc".equals(methodId)) {
- arr.add("EPC模型");
- }else if("process.flowchart".equals(methodId)) {
- arr.add("泳道图");
- }
-
-
- }
- return arr;
- }
}
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 a17b7565..a19533e4 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,1057 +20,1054 @@ 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(){
- getWsId();
- $('td,th').css('padding-top','0px');
- $('td,th').css('padding-bottom','0px');
- // $('#alertMsg').css('background', '#fff');
- $('#OPTIONTYPE_0').closest('td').width('10%');
- $('#OPTIONTYPE_1').closest('td').width('10%');
- initParam();// 初始化公共参数
- initHtml();// 初始化页面
- initCheckAll();// 初始化表头多选框
- initContentData();// 初始化内容数据
+$(document).ready(function () {
+ getWsId();
+ $('td,th').css('padding-top', '0px');
+ $('td,th').css('padding-bottom', '0px');
+ // $('#alertMsg').css('background', '#fff');
+ $('#OPTIONTYPE_0').closest('td').width('10%');
+ $('#OPTIONTYPE_1').closest('td').width('10%');
+ initParam();// 初始化公共参数
+ initHtml();// 初始化页面
+ initCheckAll();// 初始化表头多选框
+ initContentData();// 初始化内容数据
- // 初始化表格宽度
- initTableWidth();
+ // 初始化表格宽度
+ initTableWidth();
- initPagination();// 初始化页码
- initOptButton();
- //listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉
+ initPagination();// 初始化页码
+ initOptButton();
+ //listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉
})
-
//获取wsid
function getWsId() {
- var param = {
- sid : $("#sid").val(),
- cmd : "com.actionsoft.apps.coe.pal.publisher_publish_getWsId"
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- data : param,
- async: false,
- success : function(r) {
- if (r.result == 'ok') {
- var wsId=$("#WSID").val();
- if(wsId==""){
- $("#WSID").val(r.data.wsId);
- }
- }
- }
- });
+ var param = {
+ sid: $("#sid").val(),
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_getWsId"
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ data: param,
+ async: false,
+ success: function (r) {
+ if (r.result == 'ok') {
+ var wsId = $("#WSID").val();
+ if (wsId == "") {
+ $("#WSID").val(r.data.wsId);
+ }
+ }
+ }
+ });
}
var paginationSetting = {
- pageLimit: pageLimit,
- showItem: 10,
- currentPage: 0,
- ellipseCount: 1,
- linkTo: "#",
- prevText: "上一页",
- nextText: "下一页",
- ellipseText: "...",
- prevShowAlways: true,
- nextShowAlways: true,
- showIfSinglePage: true,
- loadFirstPage: false,
- showDisplay: true,
- display: "显示 {0} 到 {1} 条, 共 {2} 条"
+ pageLimit: pageLimit,
+ showItem: 10,
+ currentPage: 0,
+ ellipseCount: 1,
+ linkTo: "#",
+ prevText: "上一页",
+ nextText: "下一页",
+ ellipseText: "...",
+ prevShowAlways: true,
+ nextShowAlways: true,
+ showIfSinglePage: true,
+ loadFirstPage: false,
+ showDisplay: true,
+ display: "显示 {0} 到 {1} 条, 共 {2} 条"
};
// 初始化全选
function initCheckAll() {
- $("input[name=checkAll]").on("ifChanged",function(){
- 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 == '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);
- }
- 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);
- }
- }
- });
+ $("input[name=checkAll]").on("ifChanged", function () {
+ 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 == '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);
+ }
+ 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);
+ }
+ }
+ });
}
// 初始化表格宽度
function initTableWidth() {
- $(".data-table [class*=width_]").each(function(){
- var className = $(this).attr("class");
- var percent = parseInt(className.substr(6, 2));
- $(this).css({"width" : percent + '%'});
- });
+ $(".data-table [class*=width_]").each(function () {
+ var className = $(this).attr("class");
+ var percent = parseInt(className.substr(6, 2));
+ $(this).css({"width": percent + '%'});
+ });
}
// 初始化页数
function initPagination() {
- initNewPagination(0);
- initChangePagination(0);
- initStopPagination(0);
+ initNewPagination(0);
+ initChangePagination(0);
+ initStopPagination(0);
}
function initNewPagination(currentPage) {
- var copy1 = $.extend(true, {}, paginationSetting);
- copy1.currentPage = currentPage;
- copy1.callback = function (pageNum, start, dom) {
- newPageSetting.pageNum = pageNum;
- newPageSetting.start = start;
- initPublishData(newTemp, 'new', pageNum, start);
- return false;
- }
- $("#new_pagination").pagination(newTemp.length, copy1);
+ var copy1 = $.extend(true, {}, paginationSetting);
+ copy1.currentPage = currentPage;
+ copy1.callback = function (pageNum, start, dom) {
+ newPageSetting.pageNum = pageNum;
+ newPageSetting.start = start;
+ initPublishData(newTemp, 'new', pageNum, start);
+ return false;
+ }
+ $("#new_pagination").pagination(newTemp.length, copy1);
}
function initChangePagination(currentPage) {
- var copy2 = $.extend(true, {}, paginationSetting);
- copy2.currentPage = currentPage;
- copy2.callback = function (pageNum, start, dom) {
- changePageSetting.pageNum = pageNum;
- changePageSetting.start = start;
- initPublishData(changeTemp, 'change', pageNum, start);
- return false;
- }
- $("#change_pagination").pagination(changeTemp.length, copy2);
+ var copy2 = $.extend(true, {}, paginationSetting);
+ copy2.currentPage = currentPage;
+ copy2.callback = function (pageNum, start, dom) {
+ changePageSetting.pageNum = pageNum;
+ changePageSetting.start = start;
+ initPublishData(changeTemp, 'change', pageNum, start);
+ return false;
+ }
+ $("#change_pagination").pagination(changeTemp.length, copy2);
}
function initStopPagination(currentPage) {
- var copy3 = $.extend(true, {}, paginationSetting);
- copy3.currentPage = currentPage;
- copy3.callback = function (pageNum, start, dom) {
- stopPageSetting.pageNum = pageNum;
- stopPageSetting.start = start;
- initPublishData(stopTemp, 'stop', pageNum, start);
- return false;
- }
- $("#stop_pagination").pagination(stopTemp.length, copy3);
+ var copy3 = $.extend(true, {}, paginationSetting);
+ copy3.currentPage = currentPage;
+ copy3.callback = function (pageNum, start, dom) {
+ stopPageSetting.pageNum = pageNum;
+ stopPageSetting.start = start;
+ initPublishData(stopTemp, 'stop', pageNum, start);
+ return false;
+ }
+ $("#stop_pagination").pagination(stopTemp.length, copy3);
}
function initOptButton() {
- if (!editPerm) {
- $('#publish_new_button, #publish_change_button, #publish_stop_button').remove();
- $('#new_check_all, #change_check_all, #change_stop_all').check("disable");
- }
+ if (!editPerm) {
+ $('#publish_new_button, #publish_change_button, #publish_stop_button').remove();
+ $('#new_check_all, #change_check_all, #change_stop_all').check("disable");
+ }
}
// 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子
function initHtml() {
- var dialogHtml = '';
- dialogHtml += '';
- dialogHtml += '';
- dialogHtml += '
';
- dialogHtml += '
';
- dialogHtml += '
';
- dialogHtml += '
文件名
';
- dialogHtml += '
';
- dialogHtml += '';
- dialogHtml += ' ';
- dialogHtml += '';
- dialogHtml += ' ';
- dialogHtml += ' ';
- dialogHtml += ' ';
- dialogHtml += '
';
- dialogHtml += '
';
- dialogHtml += '
';
- dialogHtml += '
说明
';
- dialogHtml += '
';
- dialogHtml += '';
- dialogHtml += '
';
- dialogHtml += '
';
+ var 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 += '
';
+ //非三员管理显示创建
+ if (!isHighSecurity) {
+ 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 += '';
+ dialogHtml += '
';
+ dialogHtml += '
';
+ 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('
');
- var newHtml = '';
- newHtml += '';
- newHtml += '';
- newHtml += '';
- newHtml += '
';
- if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
- newHtml += '新增 ';
- // newHtml += '保存 ';
- newHtml += '删除 ';
- newHtml += '重新生成手册 ';
- newHtml += '生成附件 ';
- }
- //newHtml += '新增 ';
- // newHtml += '保存 ';
- //newHtml += '删除 ';
- newHtml += '
';
- newHtml += '
';
- newHtml += '
';
- newHtml += '';
- newHtml += '
';
- newHtml += '
';
+ $('#publisher_new_td').html('
');
+ $('#publisher_change_td').html('
');
+ $('#publisher_stop_td').html('
');
+ var newHtml = '';
+ newHtml += '';
+ newHtml += '';
+ newHtml += '';
+ newHtml += '
';
+ if ($("#userTaskDefId").val() == 'obj_c9e5a2e257f00001e2a375d01f601518') {
+ newHtml += '新增 ';
+ // newHtml += '保存 ';
+ newHtml += '删除 ';
+ newHtml += '重新生成手册 ';
+ newHtml += '生成附件 ';
+ }
+ //newHtml += '新增 ';
+ // newHtml += '保存 ';
+ //newHtml += '删除 ';
+ newHtml += '
';
+ newHtml += '
';
+ newHtml += '
';
+ newHtml += '';
+ newHtml += '
';
+ newHtml += '
';
- var changeHtml = '';
- changeHtml += '';
- changeHtml += '';
- changeHtml += '';
- changeHtml += '
';
+ changeHtml += '
';
+ changeHtml += '
';
+ changeHtml += '';
+ changeHtml += '
';
+ changeHtml += '
';
- var stopHtml = '';
- stopHtml += '';
- stopHtml += '';
- stopHtml += '';
- stopHtml += '';
- stopHtml += '
';
- stopHtml += '
';
- stopHtml += '
';
- stopHtml += '';
- stopHtml += '
';
- stopHtml += '
';
-
- $('#contentDiv1').append(newHtml);
- $('#contentDiv2').append(changeHtml);
- $('#contentDiv3').append(stopHtml);
- $("#contentDiv1 .awsui-checkbox,#contentDiv2 .awsui-checkbox,#contentDiv3 .awsui-checkbox").check();
+ $('#contentDiv1').append(newHtml);
+ $('#contentDiv2').append(changeHtml);
+ $('#contentDiv3').append(stopHtml);
+ $("#contentDiv1 .awsui-checkbox,#contentDiv2 .awsui-checkbox,#contentDiv3 .awsui-checkbox").check();
}
// 初始化参数
function initParam() {
- teamId = $("#TEAMID").val();
- sid = $("#sid").val();
- wsId = $("#WSID").val();
- processInstId = $("#processInstId").val();
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_high_security_mode_query"
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- data : param,
- async: false,
- success : function(r) {
- if (r.result == 'ok') {
- isHighSecurity = r.data.isHighSecurity;
- }
- }
- });
+ teamId = $("#TEAMID").val();
+ sid = $("#sid").val();
+ wsId = $("#WSID").val();
+ processInstId = $("#processInstId").val();
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_high_security_mode_query"
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ data: param,
+ async: false,
+ success: function (r) {
+ if (r.result == 'ok') {
+ isHighSecurity = r.data.isHighSecurity;
+ }
+ }
+ });
}
// 初始化内容数据
function initContentData() {
- var param = {
- cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query',
- processInstId: processInstId,
- wsId : wsId,
- sid: sid
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- var isEnd = r.data.isEnd;
- var proNumber = r.data.proNumber;
- if (proNumber) {
- editPerm = proNumber;
- }
- closeFormPage = r.data.closeFormPage;
- var newData = r.data.newData;
- newTemp = newData;
- var changeData = r.data.changeData;
- changeTemp = changeData;
- var stopData = r.data.stopData;
- stopTemp = stopData;
- var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
- var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
- if (!$.isEmptyObject(newData)) {
- $('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
- dealPublishCheck(true, 'new');// 显示
- // 更新数据
- $("#OPTIONTYPE_0").check("option","checked", true);
- initPublishData(newData, 'new', 1, 1);
- } else {
- $("#OPTIONTYPE_0").check("option","checked", false);
- $('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg);
- }
- if (!$.isEmptyObject(changeData)) {
- $('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
- dealPublishCheck(true, 'change');
- $("#OPTIONTYPE_1").check("option","checked", true);
- initPublishData(changeData, 'change', 1, 1);
- } else {
- $("#OPTIONTYPE_1").check("option","checked", false);
- $('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg);
- }
- if (!$.isEmptyObject(stopData)) {
- $('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
- dealPublishCheck(true, 'stop');
- $("#OPTIONTYPE_2").check("option","checked", true);
- initPublishData(stopData, 'stop', 1, 1);
- } else {
- $("#OPTIONTYPE_2").check("option","checked", false);
- $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg);
- }
- }
- });
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query',
+ processInstId: processInstId,
+ wsId: wsId,
+ sid: sid
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ var isEnd = r.data.isEnd;
+ var proNumber = r.data.proNumber;
+ if (proNumber) {
+ editPerm = proNumber;
+ }
+ closeFormPage = r.data.closeFormPage;
+ var newData = r.data.newData;
+ newTemp = newData;
+ var changeData = r.data.changeData;
+ changeTemp = changeData;
+ var stopData = r.data.stopData;
+ stopTemp = stopData;
+ var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
+ var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
+ if (!$.isEmptyObject(newData)) {
+ $('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'new');// 显示
+ // 更新数据
+ $("#OPTIONTYPE_0").check("option", "checked", true);
+ initPublishData(newData, 'new', 1, 1);
+ } else {
+ $("#OPTIONTYPE_0").check("option", "checked", false);
+ $('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg);
+ }
+ if (!$.isEmptyObject(changeData)) {
+ $('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'change');
+ $("#OPTIONTYPE_1").check("option", "checked", true);
+ initPublishData(changeData, 'change', 1, 1);
+ } else {
+ $("#OPTIONTYPE_1").check("option", "checked", false);
+ $('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg);
+ }
+ if (!$.isEmptyObject(stopData)) {
+ $('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'stop');
+ $("#OPTIONTYPE_2").check("option", "checked", true);
+ initPublishData(stopData, 'stop', 1, 1);
+ } else {
+ $("#OPTIONTYPE_2").check("option", "checked", false);
+ $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg);
+ }
+ }
+ });
}
var changedId = '';
-function initPublishData(data, type, pageNumber, start){
- showlist(data, type, pageNumber, start);
- if($("#readonly").val()=="true"){
- $("#publish_new_button").hide();
- $("#publish_change_button").hide();
- $("#publish_stop_button").hide();
- }
+function initPublishData(data, type, pageNumber, start) {
+ showlist(data, type, pageNumber, start);
+ if ($("#readonly").val() == "true") {
+ $("#publish_new_button").hide();
+ $("#publish_change_button").hide();
+ $("#publish_stop_button").hide();
+ }
}
// 初始化数据
function selectPublishData(data, type, pageNumber, start) {
- //渲染到前台的流程架构L1,L2,L3,L4
- var param = {
- cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
- processInstId: processInstId,
- wsId : wsId,
- sid: sid,
- type:type,
- datas:JSON.stringify(data)
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : true,
- data : param,
- success : function(r) {
- var info = r.data.info;
- var L1 = r.data.data.Process_Architecture_L1;
- var L2 = r.data.data.Process_Architecture_L2;
- var L3 = r.data.data.Process_Architecture_L3;
- var L4 = r.data.data.Process_Architecture_L4;
- var L1old = ui("LEVEL_1_PROCESS_NAME");
- var L2old = ui("LEVEL_2_PROCESS_NAME");
- var L3old = ui("LEVEL_3_PROCESS_NAME");
- var L4old = ui("LEVEL_4_PROCESS_NAME");
- ui("LEVEL_1_PROCESS_NAME",L1);
- ui("LEVEL_2_PROCESS_NAME",L2);
- ui("LEVEL_3_PROCESS_NAME",L3);
- ui("LEVEL_4_PROCESS_NAME",L4);
- 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;
- }
- });
+
+ //渲染到前台的流程架构L1,L2,L3,L4
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId: wsId,
+ sid: sid,
+ type: type,
+ datas: JSON.stringify(data)
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: true,
+ data: param,
+ success: function (r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+
+ //var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ //var L4old = ui("LEVEL_4_PROCESS_NAME");
+ ui("LEVEL_1_PROCESS_NAME", L1);
+ ui("LEVEL_2_PROCESS_NAME", L2);
+ ui("LEVEL_3_PROCESS_NAME", L3);
+ //ui("LEVEL_4_PROCESS_NAME",L4);
+ 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"),
- level4 :ui("LEVEL_4_PROCESS_NAME"),
- company :ui("ADAPT_NAME_THE_COMPANY"),
- region :ui("ADAPT_REGION_NAME"),
- product :ui("APPLICABLE_PRODUCT"),
- bindid : processInstId
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : true,
- data : param,
- success : function(r) {
- var info = r.data.data;
- if(info != ''){
- ui("PERSON_THREE_LEVEL_PROCESS_NO",info.AUDITOR_NO_3);
- ui("PROCESS_RESPONSIBLE_PERSON_NO",info.AUDITOR_NO_2);
- ui("PERSON_FOUR_LEVEL_PROCESS_NO",info.AUDITOR_NO_4);
- ui("RESPONSIBLE_PERSON1_NO",info.AUDITOR_NO_1);
- ui("PERSON_THREE_LEVEL_PROCESS",info.AUDITOR3);
- ui("PROCESS_RESPONSIBLE_PERSON",info.AUDITOR2);
- ui("RESPONSIBLE_PERSON1",info.AUDITOR1);
- ui("PERSON_FOUR_LEVEL_PROCESS",info.AUDITOR4);
+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"),
+ //level4 :ui("LEVEL_4_PROCESS_NAME"),
+ company: ui("ADAPT_NAME_THE_COMPANY"),
+ region: ui("ADAPT_REGION_NAME"),
+ product: ui("APPLICABLE_PRODUCT"),
+ bindid: processInstId
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: true,
+ data: param,
+ success: function (r) {
+ var info = r.data.data;
+ if (info != '') {
+ ui("PERSON_THREE_LEVEL_PROCESS_NO", info.AUDITOR_NO_3);
+ ui("PROCESS_RESPONSIBLE_PERSON_NO", info.AUDITOR_NO_2);
+ //ui("PERSON_FOUR_LEVEL_PROCESS_NO",info.AUDITOR_NO_4);
+ ui("RESPONSIBLE_PERSON1_NO", info.AUDITOR_NO_1);
+ ui("PERSON_THREE_LEVEL_PROCESS", info.AUDITOR3);
+ ui("PROCESS_RESPONSIBLE_PERSON", info.AUDITOR2);
+ ui("RESPONSIBLE_PERSON1", info.AUDITOR1);
+ //ui("PERSON_FOUR_LEVEL_PROCESS",info.AUDITOR4);
- ui("LEVEL_AUDIT_REQUIRED",info.L3_SP);
- ui("SECONDARY_AUDIT_REQUIRED",info.L2_SP);
- ui("LEVEL_1_AUDIT_REQUIRED",info.L1_SP);
- ui("FOURTH_AUDIT_REQUIRED",info.L4_SP);
+ ui("LEVEL_AUDIT_REQUIRED", info.L3_SP);
+ ui("SECONDARY_AUDIT_REQUIRED", info.L2_SP);
+ ui("LEVEL_1_AUDIT_REQUIRED", info.L1_SP);
+ //ui("FOURTH_AUDIT_REQUIRED",info.L4_SP);
-
- }
- }
- });
+ }
+ }
+ });
}
+
//预览下载附件
function openUrl(url) {
- //$.simpleAlert("文件正在处理", "loading");
- window.open(url);
+ //$.simpleAlert("文件正在处理", "loading");
+ window.open(url);
}
//by bzp
-function showlist(data, type, pageNumber, start){
- var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
- if (type == 'new') {
- $('#new_check_all').check("option", "checked", false);
- if (data.length > pageLimit) {// 显示分页
- $('#new_pagination').show();
- }
- // 加载数据
- var html = '';
- for (var i = 0, s = start; i < pageLimit; i++, s++) {
- var curr;
- if ((curr = data[s - 1]) != undefined) {
+function showlist(data, type, pageNumber, start) {
+ var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
+ if (type == 'new') {
+ $('#new_check_all').check("option", "checked", false);
+ if (data.length > pageLimit) {// 显示分页
+ $('#new_pagination').show();
+ }
+ // 加载数据
+ var html = '';
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
- var fName = '';
- var upFileId = curr.upfileId;
- if(upFileId!=''&&upFileId!=undefined){
- for(var i = 0; i < upFileId.length; i++){
- var upFileJson = upFileId[i]
- var json=JSON.parse(upFileJson);
- var upId = json.upfileId;
- var upName = json.upFileName;
- var openUrl = json.openUrl;
- var downUrl = json.downUrl;
- fName += '
' + upName + '  ';
- }
- }
- var fileName = curr.publishFileName + ' V' + curr.fileVersion;
- var outputName = getOutputName(curr.category, curr.methodId);
- var reportName = '' + fileName + "-" + outputName + ' ';
- if(outputName=="表单封面"){
- var reportName = "";
- }
- //var reportName = '' + fileName + "-" + outputName + ' ';
- var quickCreate = "立即创建 ";
- var processNumber = '提交后生成文件编号';
- if(curr.processNumber != undefined&&curr.processNumber != ''){
- processNumber = curr.processNumber;
- }
- reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
- // 三员管理,taskId为new标识未创建手册
- if (isHighSecurity){
- reportName = curr.taskId == 'new' ? quickCreate : reportName;
- }
- var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
- var textareaPerm = editPerm ? '' : 'readonly';
- html += '';
- html += ' ';
- html += '' + s + ' ';
- html += '' + fileName + ' ';
- if(fName!=''){
- html += '' + reportName + fName+' ';
- }else{
- html += '' + reportName +' ';
- }
- //html += '' + fName + ' ';
- //html += ' ';
- html += ''+ processNumber +' ';
- html += ' ';
- }
- }
- $('#publish_new_tbody').empty().html(html);
- $("#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();
- }
- // 加载数据
- var html = '';
- var tempSelect = [];
- for (var i = 0, s = start; i < pageLimit; i++, s++) {
- var curr;
- if ((curr = data[s - 1]) != undefined) {
+ var fName = '';
+ var upFileId = curr.upfileId;
+ if (upFileId != '' && upFileId != undefined) {
+ for (var i = 0; i < upFileId.length; i++) {
+ var upFileJson = upFileId[i]
+ var json = JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
+ var fileName = curr.publishFileName + ' V' + curr.fileVersion;
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + fileName + "-" + outputName + ' ';
+ if (outputName == "表单封面") {
+ var reportName = "";
+ }
+ //var reportName = '' + fileName + "-" + outputName + ' ';
+ var quickCreate = "立即创建 ";
+ var processNumber = '提交后生成文件编号';
+ if (curr.processNumber != undefined && curr.processNumber != '') {
+ processNumber = curr.processNumber;
+ }
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
+ // 三员管理,taskId为new标识未创建手册
+ if (isHighSecurity) {
+ reportName = curr.taskId == 'new' ? quickCreate : reportName;
+ }
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += '';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + fileName + ' ';
+ if (fName != '') {
+ html += '' + reportName + fName + ' ';
+ } else {
+ html += '' + reportName + ' ';
+ }
+ //html += '' + fName + ' ';
+ //html += ' ';
+ html += '' + processNumber + ' ';
+ html += ' ';
+ }
+ }
+ $('#publish_new_tbody').empty().html(html);
+ $("#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();
+ }
+ // 加载数据
+ var html = '';
+ var tempSelect = [];
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
- var fName = '';
- var upFileId = curr.upfileId;
- var changNumer = '提交后生成文件编号';
- if(curr.changedNumber != undefined&&curr.changedNumber != ''){
- changNumer = curr.changedNumber;
- }
- if(upFileId!=''&&upFileId!=undefined){
- for(var i = 0; i < upFileId.length; i++){
- var upFileJson = upFileId[i]
- var json=JSON.parse(upFileJson);
- var upId = json.upfileId;
- var upName = json.upFileName;
- var openUrl = json.openUrl;
- var downUrl = json.downUrl;
- fName += '' + upName + '  ';
- }
- }
- var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
- // 变更目标文件处理
- var targetFileName = "";
- if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
- targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
- }
- var targetId = "";
- if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
- targetId = curr.changedFileIdNew;
- }
- var outputName = getOutputName(curr.category, curr.methodId);
- var reportName = '' + targetFileName + "-" + outputName + ' ';
- if(outputName=="表单封面"){
- var reportName = "";
- }
- var quickCreate = "立即创建 ";
- createButtonObj[curr.changeFileId] = quickCreate;
- reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
+ var fName = '';
+ var upFileId = curr.upfileId;
+ var changNumer = '提交后生成文件编号';
+ if (curr.changedNumber != undefined && curr.changedNumber != '') {
+ changNumer = curr.changedNumber;
+ }
+ if (upFileId != '' && upFileId != undefined) {
+ for (var i = 0; i < upFileId.length; i++) {
+ var upFileJson = upFileId[i]
+ var json = JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
+ var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
+ // 变更目标文件处理
+ var targetFileName = "";
+ if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
+ targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
+ }
+ var targetId = "";
+ if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
+ targetId = curr.changedFileIdNew;
+ }
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + targetFileName + "-" + outputName + ' ';
+ if (outputName == "表单封面") {
+ var reportName = "";
+ }
+ var quickCreate = "立即创建 ";
+ createButtonObj[curr.changeFileId] = quickCreate;
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
- // 三员管理,taskId为change标识未创建手册
- if (isHighSecurity){
- reportName = curr.taskId == 'change' ? quickCreate : reportName;
- }
- if($("#userTaskDefName").val()!='发起人'||$("#readonly").val()=='true'){
- editPerm=false;
- }
+ // 三员管理,taskId为change标识未创建手册
+ if (isHighSecurity) {
+ reportName = curr.taskId == 'change' ? quickCreate : reportName;
+ }
+ if ($("#userTaskDefName").val() != '发起人' || $("#readonly").val() == 'true') {
+ editPerm = false;
+ }
- var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
- var textareaPerm = editPerm ? '' : 'readonly';
- html += '';
- html += ' ';
- html += '' + s + ' ';
- html += '' + sourceFileName + ' ';
- var selectPerm = editPerm ? ' ' : '' + targetFileName + ' ';
- html += '' + selectPerm + ' ';
- if(fName!=''){
- html += '' + reportName + fName +' ';
- }else{
- html += '' + reportName +' ';
- }
- //html += '' + reportName + fName +' ';
- //html += '' + reportName + ' ';
- //html += '' + fName + ' ';
- //html += ' ';
- html += '' + changNumer +' ';
- 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;
- 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;
- tempObj.category = curr.category;
- tempObj.methodId = curr.methodId;
- tempSelect.push(tempObj);
- }
- }
- $('#publish_change_tbody').empty().html(html);
- // 初始化select2
- for(var k = 0; k < tempSelect.length; k++) {
- var tempObj = tempSelect[k];
- $("#" + tempObj.selectId).select2(tempObj.opt);
- $('.select2').width('100%');
- if (tempObj.flag) {// 已选择版本
- $("#" + tempObj.selectId).val(tempObj.targetId).trigger("change");// 变更
- // 流程手册界面更新
- if (tempObj.taskId != undefined && tempObj.taskId != '') {
- // 三员管理,taskId为change标识未创建手册
- if (tempObj.taskId == 'submit_create' || tempObj.taskId == 'change') {
- // $('#report_' + tempObj.id).html(quickCreate);
- $('#report_' + tempObj.id).html(createButtonObj[tempObj.id]);
- } else {
- for (var m = 0; m < tempObj.opt.data.length; m++) {
- if (tempObj.opt.data[m].id == tempObj.targetId) {
- var outputName = getOutputName(tempObj.category, tempObj.methodId);
- 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) {
- // 获取选中的版本,获取流程手册,更新数据
- initChangedData(tempObj.id);
- }
- }
- // select改变事件
- $("#" + tempObj.selectId).on("change", function (e) {
- initChangedData($(this).attr('id').slice(7));
- });
- }
- $("#publish_change_tbody .awsui-checkbox").check();
- }
- if (type == 'stop') {
- $('#stop_check_all').check("option", "checked", false);
- if (data.length > pageLimit) {// 显示分页
- $('#stop_pagination').show();
- }
- // 加载数据
- var html = '';
- for (var i = 0, s = start; i < pageLimit; i++, s++) {
- var curr;
- if ((curr = data[s - 1]) != undefined) {
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += '';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + sourceFileName + ' ';
+ var selectPerm = editPerm ? ' ' : '' + targetFileName + ' ';
+ html += '' + selectPerm + ' ';
+ if (fName != '') {
+ html += '' + reportName + fName + ' ';
+ } else {
+ html += '' + reportName + ' ';
+ }
+ //html += '' + reportName + fName +' ';
+ //html += '' + reportName + ' ';
+ //html += '' + fName + ' ';
+ //html += ' ';
+ html += '' + changNumer + ' ';
+ 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;
+ 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;
+ tempObj.category = curr.category;
+ tempObj.methodId = curr.methodId;
+ tempSelect.push(tempObj);
+ }
+ }
+ $('#publish_change_tbody').empty().html(html);
+ // 初始化select2
+ for (var k = 0; k < tempSelect.length; k++) {
+ var tempObj = tempSelect[k];
+ $("#" + tempObj.selectId).select2(tempObj.opt);
+ $('.select2').width('100%');
+ if (tempObj.flag) {// 已选择版本
+ $("#" + tempObj.selectId).val(tempObj.targetId).trigger("change");// 变更
+ // 流程手册界面更新
+ if (tempObj.taskId != undefined && tempObj.taskId != '') {
+ // 三员管理,taskId为change标识未创建手册
+ if (tempObj.taskId == 'submit_create' || tempObj.taskId == 'change') {
+ // $('#report_' + tempObj.id).html(quickCreate);
+ $('#report_' + tempObj.id).html(createButtonObj[tempObj.id]);
+ } else {
+ for (var m = 0; m < tempObj.opt.data.length; m++) {
+ if (tempObj.opt.data[m].id == tempObj.targetId) {
+ var outputName = getOutputName(tempObj.category, tempObj.methodId);
+ 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) {
+ // 获取选中的版本,获取流程手册,更新数据
+ initChangedData(tempObj.id);
+ }
+ }
+ // select改变事件
+ $("#" + tempObj.selectId).on("change", function (e) {
+ initChangedData($(this).attr('id').slice(7));
+ });
+ }
+ $("#publish_change_tbody .awsui-checkbox").check();
+ }
+ if (type == 'stop') {
+ $('#stop_check_all').check("option", "checked", false);
+ if (data.length > pageLimit) {// 显示分页
+ $('#stop_pagination').show();
+ }
+ // 加载数据
+ var html = '';
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
- var fName = '';
- var upFileId = curr.upfileId;
- if(upFileId!=''&&upFileId!=undefined){
- for(var i = 0; i < upFileId.length; i++){
- var upFileJson = upFileId[i]
- var json=JSON.parse(upFileJson);
- var upId = json.upfileId;
- var upName = json.upFileName;
- var openUrl = json.openUrl;
- var downUrl = json.downUrl;
- fName += '' + upName + '  ';
- }
- }
+ var fName = '';
+ var upFileId = curr.upfileId;
+ if (upFileId != '' && upFileId != undefined) {
+ for (var i = 0; i < upFileId.length; i++) {
+ var upFileJson = upFileId[i]
+ var json = JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
- var fileName = curr.stopFileName + ' V' + curr.fileVersion;
- var outputName = getOutputName(curr.category, curr.methodId);
- var reportName = '' + fileName + "-" + outputName + ' ';
- reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName;
- var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
- var textareaPerm = editPerm ? '' : 'readonly';
- html += '';
- html += ' ';
- html += '' + s + ' ';
- html += '' + fileName + ' ';
- /*html += '' + reportName + ' ';*/
+ var fileName = curr.stopFileName + ' V' + curr.fileVersion;
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + fileName + "-" + outputName + ' ';
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName;
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += ' ';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + fileName + ' ';
+ /*html += '' + reportName + ' ';*/
- if(fName!=''){
- html += '' + reportName + fName +' ';
- }else{
- html += '' + reportName +' ';
- }
+ if (fName != '') {
+ html += '' + reportName + fName + ' ';
+ } else {
+ html += '' + reportName + ' ';
+ }
- html += ' ';
- html += ' ';
- }
- }
- $('#publish_stop_tbody').empty().html(html);
- $("#publish_stop_tbody .awsui-checkbox").check();
- }
+ html += ' ';
+ html += '';
+ }
+ }
+ $('#publish_stop_tbody').empty().html(html);
+ $("#publish_stop_tbody .awsui-checkbox").check();
+ }
}
function disabledButton() {
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', 'disabled');
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', 'disabled');
}
function checkCreateReportTime() {
- var isRadio1 = $('#radio1').closest('div').hasClass('checked');
- var isRadio2 = $('#radio2').closest('div').hasClass('checked');
- if (!isRadio1 && !isRadio2) {
- return false;
- } else {
- return true;
- }
+ var isRadio1 = $('#radio1').closest('div').hasClass('checked');
+ var isRadio2 = $('#radio2').closest('div').hasClass('checked');
+ if (!isRadio1 && !isRadio2) {
+ return false;
+ } else {
+ return true;
+ }
}
// 获取报告生成时机
function getReportCreateTime() {
- var createTime = 'now_create';
- var isRadio1 = $('#radio1').closest('div').hasClass('checked');
- if (isRadio1) {// 立即
+ var createTime = 'now_create';
+ var isRadio1 = $('#radio1').closest('div').hasClass('checked');
+ if (isRadio1) {// 立即
- } else {
- createTime = 'submit_create';
- }
- return createTime;
+ } else {
+ createTime = 'submit_create';
+ }
+ return createTime;
}
// 新增
function addProcess(type) {
- treeCheckedNewArr = [];
- treeCheckedChangeArr = [];
- treeCheckedStopArr = [];
- $('#publisher_dialog_name').val('');
- $('#publisher_dialog_desc').val('');
- var title = type == 'new' ? '发布流程' : type == 'change' ? '变更流程' : '停用流程';
- var height = 380;
- $("#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,
- title: title,
- 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]);
- }
- //校验支持文件是否上传
- //publishFlowCheck(newTemp);
- // 初始化页数及当前页
- initNewPagination(newPageSetting.pageNum - 1);
- // 初始化当前页的数据
- //initPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
- selectPublishData(newTemp, type, newPageSetting.pageNumber, newPageSetting.start);
- }
+ treeCheckedNewArr = [];
+ treeCheckedChangeArr = [];
+ treeCheckedStopArr = [];
+ $('#publisher_dialog_name').val('');
+ $('#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;
+ }
+ searchType = type;
+ $("#publisher_dialog").dialog({
+ width: 650,
+ title: title,
+ 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]);
+ }
+ //校验支持文件是否上传
+ //publishFlowCheck(newTemp);
+ // 初始化页数及当前页
+ 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 == 'stop') {
- debugger;
- 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");
- }
- }
- });
+ //$("#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 == '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");
+ }
+ }
+ });
}
// 打开流程树选择窗口
function queryTree() {
- if ($("#treeDialog").css('display') == 'none') {// 防止多次打开
- openQueryDataDialog(searchType);
- }
+ if ($("#treeDialog").css('display') == 'none') {// 防止多次打开
+ openQueryDataDialog(searchType);
+ }
}
//校验模型中支持文件附件是否上传
function publishFlowCheck(data) {
- var ids = [];
- for (var i = 0; i < data.length; i++) {
- var temp = data[i];
- if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
- ids.push(temp.publishFileId);
- }
- }
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ ids.push(temp.publishFileId);
+ }
+ }
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_get_publishFlow_files",
- wsId: wsId,
- uuids: JSON.stringify(ids)
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- data : param,
- success : function(r) {
- if (r.result == 'ok') {
- if(r.data.result=='error'){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- $.simpleAlert(r.data.sb,"error",3000);
- return;
- }
-
- }
- }
- });
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_get_publishFlow_files",
+ wsId: wsId,
+ uuids: JSON.stringify(ids)
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ data: param,
+ success: function (r) {
+ if (r.result == 'ok') {
+ if (r.data.result == 'error') {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert(r.data.sb, "error", 3000);
+ return;
+ }
+ }
+ }
+ });
}
@@ -1078,1585 +1075,1589 @@ function publishFlowCheck(data) {
// select2改变事件
function initChangedData(changeFileId) {
- var selectedId = $("#change_" + changeFileId).val();// 切换后的版本id
- for(var i = 0; i < changeTemp.length; i++) {
- if (changeTemp[i].changeFileId == changeFileId) {
- for(var j = 0; j < changeTemp[i].targetFiles.length; j++) {
- if (changeTemp[i].targetFiles[j].id == selectedId) {// 当前选中
- // 获取流程手册
- var selectedTaskId = "";
- selectedTaskId = createReport(changeTemp[i].category, changeTemp[i].methodId, selectedId, selectedTaskId);
+ var selectedId = $("#change_" + changeFileId).val();// 切换后的版本id
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changeFileId == changeFileId) {
+ for (var j = 0; j < changeTemp[i].targetFiles.length; j++) {
+ if (changeTemp[i].targetFiles[j].id == selectedId) {// 当前选中
+ // 获取流程手册
+ var selectedTaskId = "";
+ selectedTaskId = createReport(changeTemp[i].category, changeTemp[i].methodId, selectedId, selectedTaskId);
- // 更新数据
- changeTemp[i].changedFileIdNew = selectedId;
- changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text;
- changeTemp[i].taskId = selectedTaskId;
- changeTemp[i].targetFileVersion = changeTemp[i].targetFiles[j].version;
- changeTemp[i].targetMethodId = changeTemp[i].methodId;
- changeTemp[i].targetCategory = changeTemp[i].category;
+ // 更新数据
+ changeTemp[i].changedFileIdNew = selectedId;
+ changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text;
+ changeTemp[i].taskId = selectedTaskId;
+ changeTemp[i].targetFileVersion = changeTemp[i].targetFiles[j].version;
+ changeTemp[i].targetMethodId = changeTemp[i].methodId;
+ changeTemp[i].targetCategory = changeTemp[i].category;
- // 更新界面手册
- if (selectedTaskId != '') {
+ // 更新界面手册
+ if (selectedTaskId != '') {
- var outputName = getOutputName(changeTemp[i].category, changeTemp[i].methodId);
+ var outputName = getOutputName(changeTemp[i].category, changeTemp[i].methodId);
- var targetFileName2 = changeTemp[i].targetFiles[j].text + ' V' + changeTemp[i].targetFiles[j].version + '-' + outputName + ' ';
- $('#report_' + changeFileId).html('' + targetFileName2 + ' ');
- } else {
- $('#report_' + changeFileId).html('无');
- }
- //获取选中模型数据,更新架构数据
- updateFramework(changeTemp[i].changedFileIdNew);
- break;
- }
- }
- break;
- }
- }
+ var targetFileName2 = changeTemp[i].targetFiles[j].text + ' V' + changeTemp[i].targetFiles[j].version + '-' + outputName + ' ';
+ $('#report_' + changeFileId).html('' + targetFileName2 + ' ');
+ } else {
+ $('#report_' + changeFileId).html('无');
+ }
+ //获取选中模型数据,更新架构数据
+ updateFramework(changeTemp[i].changedFileIdNew);
+ break;
+ }
+ }
+ break;
+ }
+ }
}
-
// 打开流程文件查看页面
function openPortalPage(uuid, taskId) {
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
- uuid : uuid
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- 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
- } else {
- $.simpleAlert(r.msg);
- }
- }
- });
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
+ uuid: uuid
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ 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
+ } else {
+ $.simpleAlert(r.msg);
+ }
+ }
+ });
}
/**
* 重新生成手册
* @param uuid
*/
-function refreshManuals(processInstId,type) {
- $.simpleAlert("正在创建", "loading");
- FormToolBarAction.BTN_SAVE();
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_publish_Refresh_Manual",
- processInstId : processInstId,
- type : type
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- data : param,
- success : function(r) {
- $.simpleAlert('close');
- if (r.result == 'ok') {
+function refreshManuals(processInstId, type) {
+ $.simpleAlert("正在创建", "loading");
+ FormToolBarAction.BTN_SAVE();
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_Refresh_Manual",
+ processInstId: processInstId,
+ type: type
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ data: param,
+ success: function (r) {
+ $.simpleAlert('close');
+ if (r.result == 'ok') {
AWSFormUtil.refreshPage();
- } else {
- $.simpleAlert(r.msg);
- }
- }
- });
+ } else {
+ $.simpleAlert(r.msg);
+ }
+ }
+ });
}
// 打开流程选择dialog
function openQueryDataDialog(type) {
- $('#treeDataDiv').html('
');
- $('#searchData').html(' ');
- $("#loadImg").loading({
- 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
- debugger;
- 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);// 绑定搜索事件
- getNotPublishTreeData(type);
- } else {// stop
- initPublishSearch(type);// 绑定搜索事件
- getPublishedTreeData(type);
- }
+ $('#treeDataDiv').html('
');
+ $('#searchData').html(' ');
+ $("#loadImg").loading({
+ 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();
+ }
+ });
+ if (type == 'new') {
+ initPublishSearch(type);// 绑定搜索事件
+ getNotPublishTreeData(type);
+ } else {// stop
+ initPublishSearch(type);// 绑定搜索事件
+ getPublishedTreeData(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
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- 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 param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
+ teamId: teamId,
+ wsId: wsId,
+ type: type,
+ flag: true
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ 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);
+ }
+ });
}
+
//加载type为new的树节点
function loadNewData(treeNode) {
- // 如果是父节点并且存在子节点执行加载
- if (treeNode) {
- 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,
- method : "POST",
- dataType : "json"
- }
- initTree.refreshNode({
- id : pid,
- dataModel : dataModel
- });
- var data = initTree.getChildrenByPid(pid);
- var newData = [];
- for (var i=0;i   ' + 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
- });
- }
+ // 如果是父节点并且存在子节点执行加载
+ if (treeNode) {
+ 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,
+ method: "POST",
+ dataType: "json"
+ }
+ initTree.refreshNode({
+ id: pid,
+ dataModel: dataModel
+ });
+ var data = initTree.getChildrenByPid(pid);
+ var newData = [];
+ for (var i = 0; i < data.length; i++) {
+ 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
+ });
+ }
}
// 发布类型批量结果数据回填主dialog
function getNewPublishBatchResult(type) {
- var nodes = initTree.getCheckedNodes();
- treeCheckedNewArr = [];
- var param = {
- cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
- processInstId: processInstId,
- wsId : wsId,
- sid: sid,
- datas:JSON.stringify(nodes)
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- var info = r.data.info;
- var L1 = r.data.data.Process_Architecture_L1;
- var L2 = r.data.data.Process_Architecture_L2;
- var L3 = r.data.data.Process_Architecture_L3;
- var L4 = r.data.data.Process_Architecture_L4;
- var L1old = ui("LEVEL_1_PROCESS_NAME");
- var L2old = ui("LEVEL_2_PROCESS_NAME");
- var L3old = ui("LEVEL_3_PROCESS_NAME");
- var L4old = ui("LEVEL_4_PROCESS_NAME");
- if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L4 != L4old)){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- alert("只能选择同一级别下的流程,请重新选择");
- return;
- }else if(info == true){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- alert("只能选择同一级别下的流程,请重新选择");
- return;
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedNewArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId: wsId,
+ sid: sid,
+ datas: JSON.stringify(nodes)
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ //var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ //var L4old = ui("LEVEL_4_PROCESS_NAME");
+ if ((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ alert("只能选择同一级别下的流程,请重新选择");
+ return;
+ } else if (info == true) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ alert("只能选择同一级别下的流程,请重新选择");
+ return;
- }else{
- //treeCheckedNewArr = nodes;
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (node.id.length > 36) continue;
- //by bzp
- if(node.method == "process.framework"){
- continue;
- }
- var obj = {};
- obj.fileVersion = node.version;
- obj.publishFileId = node.id;
- obj.id = node.id;
- // obj.publishFileName = node.name;
- obj.publishFileName = node.tempName;
- obj.methodId = node.method;
- obj.category = node.category;
- obj.taskId = "";// 后续生成流程手册
- treeCheckedNewArr.push(obj);
- }
- }
- }
- });
+ } else {
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ //by bzp
+ if (node.method == "process.framework") {
+ continue;
+ }
+ var obj = {};
+ obj.fileVersion = node.version;
+ obj.publishFileId = node.id;
+ obj.id = node.id;
+ // obj.publishFileName = node.name;
+ obj.publishFileName = node.tempName;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.taskId = "";// 后续生成流程手册
+ treeCheckedNewArr.push(obj);
+ }
+ }
+ }
+ });
}
//获取已发布文件数据结构
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
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- data : param,
- success : function(r) {
- var data = r.data.data;
- var setting = {
- checkbox: true,
- checkInherit: r.data.checkInherit,
- dataModel : {
- data: data
- }
- };
- for (var i=0;i   ' + 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 + ' ';
- }
- }
- $("#treeDataDiv").empty();
- $('#treeDataDiv').html('');
- initTree = awsui.tree.init($("#tree"), setting);
- }
- });
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
+ teamId: teamId,
+ wsId: wsId,
+ type: type,
+ flag: true
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ data: param,
+ success: function (r) {
+ var data = r.data.data;
+ var setting = {
+ checkbox: true,
+ checkInherit: r.data.checkInherit,
+ dataModel: {
+ data: data
+ }
+ };
+ for (var i = 0; i < data.length; i++) {
+ // 流程名称连接责任部门和责任人
+ data[i].tempName = data[i].name;
+ var hasDutyDept = false;
+ var hasDutyUser = false;
+ if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
+ hasDutyDept = true;
+ }
+ if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
+ hasDutyUser = true;
+ }
+ if (hasDutyDept && hasDutyUser) {
+ var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
+ data[i].name += '   ' + 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 + ' ';
+ }
+ }
+ $("#treeDataDiv").empty();
+ $('#treeDataDiv').html('');
+ initTree = awsui.tree.init($("#tree"), setting);
+ }
+ });
}
//变更类型批量结果数据回填主dialog
function getChangeBatchResult(type) {
- var nodes = initTree.getCheckedNodes();
- treeCheckedChangeArr = [];
- var param = {
- cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
- processInstId: processInstId,
- wsId : wsId,
- sid: sid,
- datas:JSON.stringify(nodes)
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- var info = r.data.info;
- var L1 = r.data.data.Process_Architecture_L1;
- var L2 = r.data.data.Process_Architecture_L2;
- var L3 = r.data.data.Process_Architecture_L3;
- var L4 = r.data.data.Process_Architecture_L4;
- var L1old = ui("LEVEL_1_PROCESS_NAME");
- var L2old = ui("LEVEL_2_PROCESS_NAME");
- var L3old = ui("LEVEL_3_PROCESS_NAME");
- var L4old = ui("LEVEL_4_PROCESS_NAME");
- if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L3 != L4old)){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- $.simpleAlert("只能选择同一级别下的流程,请重新选择");
- return;
- }else if(info == true){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- $.simpleAlert("只能选择同一级别下的流程,请重新选择");
- return;
- }else{
- //treeCheckedNewArr = nodes;
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (node.id.length > 36) continue;
- var obj = {};
- // obj.changeFileName = node.name;
- obj.changeFileName = node.tempName;
- obj.changeFileId = node.id;
- obj.fileVersion = node.version;
- obj.methodId = node.method;
- obj.category = node.category;
- obj.id = node.id;
- obj.targetFiles = [];// 后续生成
- obj.changedFileIdNew = "";// 后续生成
- obj.changedFileNameNew = "";// 后续生成
- obj.taskId = "";// 后续生成
- obj.targetFileVersion = "";// 后续生成
- obj.targetMethodId = node.method
- obj.targetCategory = node.category
- treeCheckedChangeArr.push(obj);
- }
- }
- }
- });
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedChangeArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId: wsId,
+ sid: sid,
+ datas: JSON.stringify(nodes)
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ //var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ //var L4old = ui("LEVEL_4_PROCESS_NAME");
+ if ((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ } else if (info == true) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ } else {
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ var obj = {};
+ // obj.changeFileName = node.name;
+ obj.changeFileName = node.tempName;
+ obj.changeFileId = node.id;
+ obj.fileVersion = node.version;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.id = node.id;
+ obj.targetFiles = [];// 后续生成
+ obj.changedFileIdNew = "";// 后续生成
+ obj.changedFileNameNew = "";// 后续生成
+ obj.taskId = "";// 后续生成
+ obj.targetFileVersion = "";// 后续生成
+ obj.targetMethodId = node.method
+ obj.targetCategory = node.category
+ treeCheckedChangeArr.push(obj);
+ }
+ }
+ }
+ });
}
// 停用类型批量结果数据回填主dialog
function getStopBatchResult(type) {
- var nodes = initTree.getCheckedNodes();
- treeCheckedStopArr = [];
- var param = {
- cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
- processInstId: processInstId,
- wsId : wsId,
- sid: sid,
- datas:JSON.stringify(nodes)
- };
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- var info = r.data.info;
- var L1 = r.data.data.Process_Architecture_L1;
- var L2 = r.data.data.Process_Architecture_L2;
- var L3 = r.data.data.Process_Architecture_L3;
- var L4 = r.data.data.Process_Architecture_L4;
- var L1old = ui("LEVEL_1_PROCESS_NAME");
- var L2old = ui("LEVEL_2_PROCESS_NAME");
- var L3old = ui("LEVEL_3_PROCESS_NAME");
- var L4old = ui("LEVEL_4_PROCESS_NAME");
- if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L4 != L4old)){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- $.simpleAlert("只能选择同一级别下的流程,请重新选择");
- return;
- }else if(info == true){
- $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
- $.simpleAlert("只能选择同一级别下的流程,请重新选择");
- return;
- }else{
- //treeCheckedNewArr = nodes;
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (node.id.length > 36) continue;
- var obj = {};
- // obj.stopFileName = node.name;
- obj.stopFileName = node.tempName;
- obj.stopFileId = node.id;
- obj.fileVersion = node.version;
- obj.id = node.id;
- obj.methodId = node.method;
- obj.category = node.category;
- obj.taskId = "";// 后续查询已经存在的流程手册
- treeCheckedStopArr.push(obj);
- }
- }
- }
- });
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedStopArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId: wsId,
+ sid: sid,
+ datas: JSON.stringify(nodes)
+ };
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ //var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ //var L4old = ui("LEVEL_3_PROCESS_NAME");
+ if ((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old)) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ } else if (info == true) {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ } else {
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ var obj = {};
+ // obj.stopFileName = node.name;
+ obj.stopFileName = node.tempName;
+ obj.stopFileId = node.id;
+ obj.fileVersion = node.version;
+ obj.id = node.id;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.taskId = "";// 后续查询已经存在的流程手册
+ treeCheckedStopArr.push(obj);
+ }
+ }
+ }
+ });
}
// 获取已有的流程手册
function queryBatchReport(data) {
- var ids = [];
- for (var i = 0; i < data.length; i++) {
- var temp = data[i];
- if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
- ids.push(temp.stopFileId);
- }
- }
- 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)
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- var result = r.data.data;
- for (var i = 0; i < data.length; i++) {
- if (result[data[i].id] != undefined) {
- data[i].taskId = result[data[i].id];
- }
- }
- }
- });
- return data;
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ ids.push(temp.stopFileId);
+ }
+ }
+ 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)
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ var result = r.data.data;
+ for (var i = 0; i < data.length; i++) {
+ if (result[data[i].id] != undefined) {
+ data[i].taskId = result[data[i].id];
+ }
+ }
+ }
+ });
+ return data;
}
// 创建流程手册
function createReport(category, method, uuid, taskId) {
- if ((method == 'control.policy' || method == 'data.form' || method.indexOf('process.') > -1) && method != 'default') {
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
- teamId: teamId,
- wsId: wsId,
- uuid: uuid
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- if (r.result == 'ok') {
- taskId = r.data.taskId;
- }
- }
- });
- } else {
- $.simpleAlert('不支持创建手册');
- }
- return taskId;
+ if ((method == 'control.policy' || method == 'data.form' || method.indexOf('process.') > -1) && method != 'default') {
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
+ teamId: teamId,
+ wsId: wsId,
+ uuid: uuid
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ if (r.result == 'ok') {
+ taskId = r.data.taskId;
+ }
+ }
+ });
+ } else {
+ $.simpleAlert('不支持创建手册');
+ }
+ return taskId;
}
// 批量创建流程手册
function createBatchReport(data, createTime) {
- var ids = [];
- for (var i = 0; i < data.length; i++) {
- var temp = data[i];
- if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
- 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;
- }
- var param = {
- sid : sid,
- cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create",
- teamId: teamId,
- wsId: wsId,
- uuids: JSON.stringify(ids)
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- if (r.result == 'ok') {
- var result = r.data.data;
- for (var i = 0; i < data.length; i++) {
- if (result[data[i].id] != undefined) {
- data[i].taskId = result[data[i].id];
- }
- }
- }
- }
- });
- return data;
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ ids.push(temp.publishFileId);
+ }
+ }
+ 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;
+ }
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create",
+ teamId: teamId,
+ wsId: wsId,
+ uuids: JSON.stringify(ids)
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ if (r.result == 'ok') {
+ var result = r.data.data;
+ for (var i = 0; i < data.length; i++) {
+ if (result[data[i].id] != undefined) {
+ data[i].taskId = result[data[i].id];
+ }
+ }
+ }
+ }
+ });
+ return data;
}
// 查询流程的其他版本并生成流程手册
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
- }
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- data = r.data.data;
- }
- });
- return data;
+ 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
+ }
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ data = r.data.data;
+ }
+ });
+ return data;
}
// 获取手册专属名称
function getOutputName(category, method) {
- if (method == 'control.policy') {
- return '制度手册';
- }
- if (method == 'data.form') {
- return '表单封面'
- }
- if (method.indexOf('process.') > -1) {
- return '流程手册';
- }
- return '手册';
+ if (method == 'control.policy') {
+ return '制度手册';
+ }
+ if (method == 'data.form') {
+ return '表单封面'
+ }
+ if (method.indexOf('process.') > -1) {
+ return '流程手册';
+ }
+ return '手册';
}
//单个流程立即创建流程手册
function quickCreateReport(obj, object, type) {
- 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 + "\')");
+ 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 + "\')");
- //三员管理下,立即创建
- if(isHighSecurity){
- //更新数据记录
- if (type == 'new') {
- var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
- $(object).text(fileName);
- } else if (type == 'change') {
- var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
- $(object).text(targetFileName);
- }
- }else{
- //更新数据记录
- if (type == 'new') {
- var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
- $(object).text(fileName);
- for (var i = 0; i < newTemp.length; i++) {
- if (newTemp[i].publishFileId == uuid) {
- newTemp[i].taskId = taskId;
- }
- }
- } else if (type == 'change') {
- var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
- $(object).text(targetFileName);
- for (var i = 0; i < changeTemp.length; i++) {
- if (changeTemp[i].changedFileIdNew == uuid) {
- changeTemp[i].taskId = taskId;
- }
- }
- }
- }
- $(object).parent().append(' ');
+ //三员管理下,立即创建
+ if (isHighSecurity) {
+ //更新数据记录
+ if (type == 'new') {
+ var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
+ $(object).text(fileName);
+ } else if (type == 'change') {
+ var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
+ $(object).text(targetFileName);
+ }
+ } else {
+ //更新数据记录
+ if (type == 'new') {
+ var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
+ $(object).text(fileName);
+ for (var i = 0; i < newTemp.length; i++) {
+ if (newTemp[i].publishFileId == uuid) {
+ newTemp[i].taskId = taskId;
+ }
+ }
+ } else if (type == 'change') {
+ var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
+ $(object).text(targetFileName);
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changedFileIdNew == uuid) {
+ changeTemp[i].taskId = taskId;
+ }
+ }
+ }
+ }
+ $(object).parent().append(' ');
}
// 清空树结构
function clearTreeData() {
- initTree = {};
+ initTree = {};
}
// 禁用按钮
function disabledAll() {
- $('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled":"disabled"});
+ $('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled": "disabled"});
}
// 关闭模态窗
function closeDialog() {
- $("#treeDialog").dialog("close");
+ $("#treeDialog").dialog("close");
}
// 打开流程手册
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");
- }
- });
+ $.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");
+ }
+ });
}
// 删除
function deleteFile(type) {
- if ($('#publish_' + type + '_tbody').find('tr').length > 0) {
- var flag = true;
- $('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
- if ($(this).closest('div').hasClass('checked')) {
- flag = false;
- }
- });
- if (flag) {
- $.simpleAlert('请选择列表中数据');
- return;
- } else {
- 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;
- }
- }
- }
- 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;
- }
- }
- }
- 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;
- }
- }
- }
- 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('列表中无数据');
- }
+ if ($('#publish_' + type + '_tbody').find('tr').length > 0) {
+ var flag = true;
+ $('#publish_' + type + '_tbody').find('input[name="check"]').each(function () {
+ if ($(this).closest('div').hasClass('checked')) {
+ flag = false;
+ }
+ });
+ if (flag) {
+ $.simpleAlert('请选择列表中数据');
+ return;
+ } else {
+ 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;
+ }
+ }
+ }
+ 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;
+ }
+ }
+ }
+ 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;
+ }
+ }
+ }
+ 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('列表中无数据');
+ }
}
//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');
+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("PERSON_FOUR_LEVEL_PROCESS",'');
- ui("FOURTH_AUDIT_REQUIRED",'0');
+ ui("PERSON_FOUR_LEVEL_PROCESS", '');
+ ui("FOURTH_AUDIT_REQUIRED", '0');
- //流程级别信息
- ui("LEVEL_1_PROCESS_NAME",'');
- ui("LEVEL_2_PROCESS_NAME",'');
- ui("LEVEL_3_PROCESS_NAME",'');
- ui("LEVEL_4_PROCESS_NAME",'');
- //看是否需要清空后台数据~~
- queryapprove();
+ //流程级别信息
+ ui("LEVEL_1_PROCESS_NAME", '');
+ ui("LEVEL_2_PROCESS_NAME", '');
+ ui("LEVEL_3_PROCESS_NAME", '');
+ ui("LEVEL_4_PROCESS_NAME", '');
+ //看是否需要清空后台数据~~
+ queryapprove();
}
// 变更说明内容时处理
function changeDesc(type, id, obj) {
- var desc = $(obj).val();
- if (type == 'new') {
- for (var i = 0; i < newTemp.length; i++ ) {
- if (newTemp[i].publishFileId == id) {
- newTemp[i].publishDesc = desc;
- break;
- }
- }
- }
- if (type == 'change') {
- for (var i = 0; i < changeTemp.length; i++ ) {
- if (changeTemp[i].changeFileId == id) {
- changeTemp[i].changedDesc = desc;
- break;
- }
- }
- }
- if (type == 'stop') {
- for (var i = 0; i < stopTemp.length; i++ ) {
- if (stopTemp[i].stopFileId == id) {
- stopTemp[i].stopDesc = desc;
- break;
- }
- }
- }
+ var desc = $(obj).val();
+ if (type == 'new') {
+ for (var i = 0; i < newTemp.length; i++) {
+ if (newTemp[i].publishFileId == id) {
+ newTemp[i].publishDesc = desc;
+ break;
+ }
+ }
+ }
+ if (type == 'change') {
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changeFileId == id) {
+ changeTemp[i].changedDesc = desc;
+ break;
+ }
+ }
+ }
+ if (type == 'stop') {
+ for (var i = 0; i < stopTemp.length; i++) {
+ if (stopTemp[i].stopFileId == id) {
+ stopTemp[i].stopDesc = desc;
+ break;
+ }
+ }
+ }
}
// 点击checkbox
function onCheckboxClickEvent(boItemName, $checkbox, val) {
- var isCheck = !$checkbox.closest('div').hasClass('checked');
- if (val == '流程制度发布') {
- 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') {
- 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') {
- isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide();
- }
+ if (type == 'new') {
+ 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') {
+ isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide();
+ }
}
// 单独保存子表操作
function saveFormData(type) {
- $.simpleAlert('正在保存', 'loading');
- var saveData = [];
- if (type == 'new') {
- saveData = newTemp;
- }
- if (type == 'change') {
- saveData = changeTemp;
- }
- if (type == 'stop') {
- saveData = stopTemp;
- }
- var param = {
- 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;
- $.ajax({
- url : "./jd",
- type : "POST",
- dataType : "JSON",
- async : false,
- data : param,
- success : function(r) {
- if (r.result == 'error') {
- flag = true;
- tempData = r.data.data;
- }
- },
- error : function(XMLHttpRequest, textStatus, errorThrown) {
- $.simpleAlert("表单信息错误,请联系管理员!", 'error');
- }
- });
- $.simpleAlert('close');
- if (false) {
- var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
- if (tempData.length > 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);
- } else {
- $.simpleAlert('保存成功', 'ok');
- }
+ $.simpleAlert('正在保存', 'loading');
+ var saveData = [];
+ if (type == 'new') {
+ saveData = newTemp;
+ }
+ if (type == 'change') {
+ saveData = changeTemp;
+ }
+ if (type == 'stop') {
+ 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)
+ }
+ var flag = false;
+ var tempData;
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ if (r.result == 'error') {
+ flag = true;
+ tempData = r.data.data;
+ }
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ $.simpleAlert("表单信息错误,请联系管理员!", 'error');
+ }
+ });
+ $.simpleAlert('close');
+ if (false) {
+ var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
+ if (tempData.length > 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);
+ } else {
+ $.simpleAlert('保存成功', 'ok');
+ }
}
// 点击办理时的校验+保存字表
-function formSave(isTransact){
- var userTaskDefName = $("#userTaskDefName").val();
- if(userTaskDefName == '发起人'){
- if(isTransact==true){
- uiRequiredClass("PROCESS_TITLE", isShow);
- uiRequiredClass("SEND_SCOPE", isShow);
- uiRequiredClass("ADAPT_NAME_THE_COMPANY", isShow);
- uiRequiredClass("APPLICABLE_PRODUCT", isShow);
- uiRequiredClass("ADAPT_REGION_NAME", isShow);
- }
+function formSave(isTransact) {
+ var userTaskDefName = $("#userTaskDefName").val();
+ if (userTaskDefName == '发起人') {
+ if (isTransact == true) {
+ uiRequiredClass("PROCESS_TITLE", isShow);
+ uiRequiredClass("SEND_SCOPE", isShow);
+ uiRequiredClass("ADAPT_NAME_THE_COMPANY", isShow);
+ uiRequiredClass("APPLICABLE_PRODUCT", isShow);
+ uiRequiredClass("ADAPT_REGION_NAME", isShow);
+ }
- if (!editPerm) {// 只读状态不处理
- return true;
- }
- $.simpleAlert('正在保存', 'loading');
- if(isTransact) {// 点击办理进行校验
- // 判断页面是否有数据
- if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none'){
- $.simpleAlert('close');
- $.simpleAlert('发布内容不能为空', 'info');
- return false;
- }
- var index = 0;
- if (!($("#publisher_new_tr").css('display') == 'none') && newTemp.length > 0) {
- index++;
- }
- if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
- index++;
- }
- if (!($("#publisher_stop_tr").css('display') == 'none') && stopTemp.length > 0) {
- index++;
- }
- if (index == 0) {
- $.simpleAlert('close');
- $.simpleAlert('发布内容不能为空', 'info');
- return false;
- }
+ if (!editPerm) {// 只读状态不处理
+ return true;
+ }
+ $.simpleAlert('正在保存', 'loading');
+ if (isTransact) {// 点击办理进行校验
+ // 判断页面是否有数据
+ if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none') {
+ $.simpleAlert('close');
+ $.simpleAlert('发布内容不能为空', 'info');
+ return false;
+ }
+ var index = 0;
+ if (!($("#publisher_new_tr").css('display') == 'none') && newTemp.length > 0) {
+ index++;
+ }
+ if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
+ index++;
+ }
+ if (!($("#publisher_stop_tr").css('display') == 'none') && stopTemp.length > 0) {
+ index++;
+ }
+ if (index == 0) {
+ $.simpleAlert('close');
+ $.simpleAlert('发布内容不能为空', 'info');
+ return false;
+ }
- // 校验变更文件是否全部都有变更后文件
- if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
- var flag = false;
- var msg = '以下文件没有选择变更后的文件,不允许办理';
- for (var i = 0; i < changeTemp.length; i++) {
- if (changeTemp[i].changedFileIdNew == "") {
- flag = true;
- msg += ' ' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion;
- }
- }
- if (flag) {
- var options = {
- title : "提示",
- content:msg,
- type:"alert",
- onConfirm: function(){
- }
- };
- $.simpleAlert('close');
- $.confirm(options);
- return false;
- }
- }
- }
- // 保存校验
- // 1.不显示的数据默认删除
- var newTempData = newTemp;
- var changeTempData = changeTemp;
- var stopTempData = stopTemp;
- if (($("#publisher_new_tr").css('display') == 'none')) {
- newTempData = [];
- }
- if (($("#publisher_change_tr").css('display') == 'none')) {
- changeTempData = [];
- }
- if (($("#publisher_stop_tr").css('display') == 'none')) {
- stopTempData = [];
- }
- // 2.校验变更的数据与停用的数据是否有重叠
- if(isTransact) {
- if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) {
- for (var i = 0; i < changeTempData.length; i ++) {
- for (var j = 0; j < stopTempData.length; j++) {
- if (changeTempData[i].changeFileId == stopTempData[j].stopFileId) {
- $.simpleAlert('close');
- $.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + " 在变更流程和停用流程中同时存在,不允许办理", 'error');
- return false;
- }
- }
- }
- }
- }
- //三员管理,提交后不生成手册,更改taskId
- if (isHighSecurity){
- for (let i=0;i -1) && data.methodId != 'default') {
- data.taskId = "new";
- }
- }
- for (let j=0; j 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;
- } else {
- newTemp = newTempData;
- if (newTemp.length == 0) {
- newPageSetting = {
- pageNum:1,
- start:1
- };
- $('#new_pagination').hide();
- initPublishData(newTemp, 'new', 1, 1);
- }
- changeTemp = changeTempData;
- if (changeTemp.length == 0) {
- changePageSetting = {
- pageNum:1,
- start:1
- };
- $('#change_pagination').hide();
- initPublishData(changeTemp, 'change', 1, 1);
- }
- stopTemp = stopTempData;
- if (stopTemp.length == 0) {
- stopPageSetting = {
- pageNum:1,
- start:1
- };
- $('#stop_pagination').hide();
- initPublishData(stopTemp, 'stop', 1, 1);
- }
- $.simpleAlert('保存成功', 'ok');
- }
- }
+ // 校验变更文件是否全部都有变更后文件
+ if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
+ var flag = false;
+ var msg = '以下文件没有选择变更后的文件,不允许办理';
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changedFileIdNew == "") {
+ flag = true;
+ msg += ' ' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion;
+ }
+ }
+ if (flag) {
+ var options = {
+ title: "提示",
+ content: msg,
+ type: "alert",
+ onConfirm: function () {
+ }
+ };
+ $.simpleAlert('close');
+ $.confirm(options);
+ return false;
+ }
+ }
+ }
+ // 保存校验
+ // 1.不显示的数据默认删除
+ var newTempData = newTemp;
+ var changeTempData = changeTemp;
+ var stopTempData = stopTemp;
+ if (($("#publisher_new_tr").css('display') == 'none')) {
+ newTempData = [];
+ }
+ if (($("#publisher_change_tr").css('display') == 'none')) {
+ changeTempData = [];
+ }
+ if (($("#publisher_stop_tr").css('display') == 'none')) {
+ stopTempData = [];
+ }
+ // 2.校验变更的数据与停用的数据是否有重叠
+ if (isTransact) {
+ if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) {
+ for (var i = 0; i < changeTempData.length; i++) {
+ for (var j = 0; j < stopTempData.length; j++) {
+ if (changeTempData[i].changeFileId == stopTempData[j].stopFileId) {
+ $.simpleAlert('close');
+ $.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + " 在变更流程和停用流程中同时存在,不允许办理", 'error');
+ return false;
+ }
+ }
+ }
+ }
+ }
+ //三员管理,提交后不生成手册,更改taskId
+ if (isHighSecurity) {
+ for (let i = 0; i < newTempData.length; i++) {
+ let data = newTempData[i];
+ if ((data.methodId == 'control.policy' || data.methodId == 'data.form' || data.methodId.indexOf('process.') > -1) && data.methodId != 'default') {
+ data.taskId = "new";
+ }
+ }
+ for (let j = 0; j < changeTempData.length; j++) {
+ let changeData = changeTempData[j];
+ changeData.taskId = "change";
+ }
+ }
+ // 保存
+ var param = {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_batch_save_before",
+ teamId: teamId,
+ wsId: wsId,
+ processInstId: processInstId,
+ newData: JSON.stringify(newTempData),
+ changeData: JSON.stringify(changeTempData),
+ stopData: JSON.stringify(stopTempData),
+ isTransact: isTransact
+ };
+ var flag = false;
+ var tempData;
+ $.ajax({
+ url: "./jd",
+ type: "POST",
+ dataType: "JSON",
+ async: false,
+ data: param,
+ success: function (r) {
+ if (r.result == 'error') {
+ flag = true;
+ tempData = r.data.data;
+ }
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ $.simpleAlert("表单信息错误,请联系管理员!", 'error');
+ }
+ });
+ $.simpleAlert('close');
+ if (false) {
+ var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
+ if (tempData.length > 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;
+ } else {
+ newTemp = newTempData;
+ if (newTemp.length == 0) {
+ newPageSetting = {
+ pageNum: 1,
+ start: 1
+ };
+ $('#new_pagination').hide();
+ initPublishData(newTemp, 'new', 1, 1);
+ }
+ changeTemp = changeTempData;
+ if (changeTemp.length == 0) {
+ changePageSetting = {
+ pageNum: 1,
+ start: 1
+ };
+ $('#change_pagination').hide();
+ initPublishData(changeTemp, 'change', 1, 1);
+ }
+ stopTemp = stopTempData;
+ if (stopTemp.length == 0) {
+ stopPageSetting = {
+ pageNum: 1,
+ start: 1
+ };
+ $('#stop_pagination').hide();
+ initPublishData(stopTemp, 'stop', 1, 1);
+ }
+ $.simpleAlert('保存成功', 'ok');
+ }
+ }
}
//办理完成后关闭页面
-AWSFormMainAPI.customCloseFormPage(function(){
- if (closeFormPage) {
- window.close();
- } else {
- AWSFormUtil.refreshPage();
- }
- // 父页面刷新
- opener.refreshTab();
- return true;//最后返回true
+AWSFormMainAPI.customCloseFormPage(function () {
+ if (closeFormPage) {
+ window.close();
+ } else {
+ AWSFormUtil.refreshPage();
+ }
+ // 父页面刷新
+ opener.refreshTab();
+ return true;//最后返回true
});
/********************************快速搜索start***************************************/
// 绑定事件
function initPublishSearch(type) {
- $("#processName").buttonedit({
- onClick: function(e){
- searchProcess(type);
- }
- });
- $("#processName").bind("keypress",function(event){
- if(event.keyCode == "13"){
- searchProcess(type);
- }
- });
- $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
- $('#autoSearchProcessDiv').show();
- }).off("autoSearchProcessDiv").on("mouseleave", function () {
- $('#autoSearchProcessDiv').hide();
- });
+ $("#processName").buttonedit({
+ onClick: function (e) {
+ searchProcess(type);
+ }
+ });
+ $("#processName").bind("keypress", function (event) {
+ if (event.keyCode == "13") {
+ searchProcess(type);
+ }
+ });
+ $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
+ $('#autoSearchProcessDiv').show();
+ }).off("autoSearchProcessDiv").on("mouseleave", function () {
+ $('#autoSearchProcessDiv').hide();
+ });
}
// 搜索
function searchProcess(type) {
- $("#autoSearchProcessDiv").empty().hide();
- if ($("#processName").val() == "" || $("#processName").val().trim() == "") {
- return;
- }
- 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 += '
';
- }
- }
- });
- }
- if (html.length > 0) {
- $("#autoSearchProcessDiv").html(html).show();
- // $("#processName").val('');
- }
+ $("#autoSearchProcessDiv").empty().hide();
+ if ($("#processName").val() == "" || $("#processName").val().trim() == "") {
+ return;
+ }
+ 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 += '
';
+ }
+ }
+ });
+ }
+ if (html.length > 0) {
+ $("#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) {
- var name = text;
- do {
- var p = initTree.getParentNodeById(node.id);
- if (p == undefined) {
- break;
- }
- name = p.name + ">" + name;
- node = p;
- } while(true);
- return name;
+ var name = text;
+ do {
+ var p = initTree.getParentNodeById(node.id);
+ if (p == undefined) {
+ break;
+ }
+ name = p.name + ">" + name;
+ node = p;
+ } while (true);
+ return name;
}
function auto_move(obj) {
- obj.css({"color": "white", "background-image" : "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"});
+ obj.css({"color": "white", "background-image": "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"});
}
function auto_out(obj) {
- obj.css({"color": "black", "background-image" : "none"});
+ obj.css({"color": "black", "background-image": "none"});
}
function auto_click(obj, type) {
- var plId = obj.find("span").attr("plId");
- var type = obj.find("span").data("type");
- 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);
- $('#tree').scrollTop(ele.offsetTop);
- initTree.cancelSelectNode()
- initTree.selectNode(plId);
- $("#autoSearchProcessDiv").empty().hide();
+ 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);
+ }
+ initTree.expandNodes(dom, true, true, true);
+ // 偏移至可见区域
+ var ele = document.getElementById('tree_span_' + plId);
+ $('#tree').scrollTop(ele.offsetTop);
+ initTree.cancelSelectNode()
+ initTree.selectNode(plId);
+ $("#autoSearchProcessDiv").empty().hide();
}
+
/********************************快速搜索end***************************************/
function listenCloseEvent() {
- window.onbeforeunload = function(){
- // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
- awsui.ajax.request({
- type: "POST",
- url: "./jd",
- /*async: false,*/
- data: {
- sid: sid,
- cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
- processInstId: processInstId
- },
- success : function(r) {
- if (r.result == "ok") {
- if (r.data.saveStatus == '1') {
- return "未保存,关闭之后不会保存该表单!";
- }
- }
- }
- });
- }
+ window.onbeforeunload = function () {
+ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
+ processInstId: processInstId
+ },
+ success: function (r) {
+ if (r.result == "ok") {
+ if (r.data.saveStatus == '1') {
+ return "未保存,关闭之后不会保存该表单!";
+ }
+ }
+ }
+ });
+ }
- //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件
- window.onunload = function(){
- // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
- awsui.ajax.request({
- type: "POST",
- url: "./jd",
- /*async: false,*/
- data: {
- sid: sid,
- cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
- processInstId: processInstId
- },
- success : function(r) {
- if (r.result == "ok") {
- if (r.data.saveStatus == '1') {
- // 删除该流程实例,并刷新主页面
- awsui.ajax.request({
- type: "POST",
- url: "./jd",
- /*async: false,*/
- data: {
- sid: sid,
- cmd: "com.actionsoft.apps.coe.pal.publisher_remove",
- processInstIds: processInstId
- },
- success : function(r) {
- if (r.result == "ok") {
- // 父页面刷新
- opener.refreshTab();
- }
- }
- });
- }
- }
- }
- });
- }
+ //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件
+ window.onunload = function () {
+ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
+ processInstId: processInstId
+ },
+ success: function (r) {
+ if (r.result == "ok") {
+ if (r.data.saveStatus == '1') {
+ // 删除该流程实例,并刷新主页面
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_remove",
+ processInstIds: processInstId
+ },
+ success: function (r) {
+ if (r.result == "ok") {
+ // 父页面刷新
+ opener.refreshTab();
+ }
+ }
+ });
+ }
+ }
+ }
+ });
+ }
}
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) {
- if (r.result == "ok") {
- window.open (r.data.url);
- } else {
+ 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) {
+ if (r.result == "ok") {
+ window.open(r.data.url);
+ } else {
- }
- }
- });
+ }
+ }
+ });
}
-
//刷新页面
-function getFiles() {
- FormToolBarAction.BTN_SAVE();
- AWSFormUtil.refreshPage();
+function getFiles() {
+ FormToolBarAction.BTN_SAVE();
+ AWSFormUtil.refreshPage();
}
//下拉获取最新架构进行赋值操作
function updateFramework(uuid) {
- awsui.ajax.request({
- type: "POST",
- url: "./jd",
- async: false,
- data: {
- sid: sid,
- cmd: "com.actionsoft.apps.coe.pal.publisher_publish_updateFramework",
- uuid: uuid,
- processInstId:processInstId
- },
- success : function(r) {
- if (r.result == "ok") {
- 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 L4 = r.data.data.Process_Architecture_L4;
- ui("LEVEL_1_PROCESS_NAME",L1);
- ui("LEVEL_2_PROCESS_NAME",L2);
- ui("LEVEL_3_PROCESS_NAME",L3);
- ui("LEVEL_4_PROCESS_NAME",L4);
- }
- }
- });
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ async: false,
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_updateFramework",
+ uuid: uuid,
+ processInstId: processInstId
+ },
+ success: function (r) {
+ if (r.result == "ok") {
+ 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 L4 = r.data.data.Process_Architecture_L4;
+ ui("LEVEL_1_PROCESS_NAME", L1);
+ ui("LEVEL_2_PROCESS_NAME", L2);
+ ui("LEVEL_3_PROCESS_NAME", L3);
+ //ui("LEVEL_4_PROCESS_NAME",L4);
+ }
+ }
+ });
}
diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js
new file mode 100644
index 00000000..a17b7565
--- /dev/null
+++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js
@@ -0,0 +1,2662 @@
+var sid;
+var teamId;
+var wsId;
+var processInstId;
+var initTree;
+var editPerm = false;
+var closeFormPage = false;
+var searchType;
+var pageLimit = 10;
+// 数据记录
+var newTemp;
+var changeTemp;
+var stopTemp;
+// 树结构选择数据记录
+var treeCheckedNewArr = [];
+var treeCheckedChangeArr = [];
+var treeCheckedStopArr = [];
+// 统一中文变量
+var varDutyDept = "责任部门";
+var varDutyUser = "责任人";
+// 页码记录
+var newPageSetting = {
+ pageNum:1,
+ start:1
+}
+var changePageSetting = {
+ pageNum:1,
+ start:1
+}
+var stopPageSetting = {
+ pageNum:1,
+ start:1
+}
+var isHighSecurity;
+$(document).ready(function(){
+ getWsId();
+ $('td,th').css('padding-top','0px');
+ $('td,th').css('padding-bottom','0px');
+ // $('#alertMsg').css('background', '#fff');
+ $('#OPTIONTYPE_0').closest('td').width('10%');
+ $('#OPTIONTYPE_1').closest('td').width('10%');
+ initParam();// 初始化公共参数
+ initHtml();// 初始化页面
+ initCheckAll();// 初始化表头多选框
+ initContentData();// 初始化内容数据
+
+ // 初始化表格宽度
+ initTableWidth();
+
+ initPagination();// 初始化页码
+ initOptButton();
+ //listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉
+})
+
+
+
+//获取wsid
+function getWsId() {
+ var param = {
+ sid : $("#sid").val(),
+ cmd : "com.actionsoft.apps.coe.pal.publisher_publish_getWsId"
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ data : param,
+ async: false,
+ success : function(r) {
+ if (r.result == 'ok') {
+ var wsId=$("#WSID").val();
+ if(wsId==""){
+ $("#WSID").val(r.data.wsId);
+ }
+ }
+ }
+ });
+}
+
+
+var paginationSetting = {
+ pageLimit: pageLimit,
+ showItem: 10,
+ currentPage: 0,
+ ellipseCount: 1,
+ linkTo: "#",
+ prevText: "上一页",
+ nextText: "下一页",
+ ellipseText: "...",
+ prevShowAlways: true,
+ nextShowAlways: true,
+ showIfSinglePage: true,
+ loadFirstPage: false,
+ showDisplay: true,
+ display: "显示 {0} 到 {1} 条, 共 {2} 条"
+};
+
+// 初始化全选
+function initCheckAll() {
+ $("input[name=checkAll]").on("ifChanged",function(){
+ 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 == '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);
+ }
+ 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);
+ }
+ }
+ });
+}
+
+// 初始化表格宽度
+function initTableWidth() {
+ $(".data-table [class*=width_]").each(function(){
+ var className = $(this).attr("class");
+ var percent = parseInt(className.substr(6, 2));
+ $(this).css({"width" : percent + '%'});
+ });
+}
+
+// 初始化页数
+function initPagination() {
+ initNewPagination(0);
+ initChangePagination(0);
+ initStopPagination(0);
+}
+
+function initNewPagination(currentPage) {
+ var copy1 = $.extend(true, {}, paginationSetting);
+ copy1.currentPage = currentPage;
+ copy1.callback = function (pageNum, start, dom) {
+ newPageSetting.pageNum = pageNum;
+ newPageSetting.start = start;
+ initPublishData(newTemp, 'new', pageNum, start);
+ return false;
+ }
+ $("#new_pagination").pagination(newTemp.length, copy1);
+}
+
+function initChangePagination(currentPage) {
+ var copy2 = $.extend(true, {}, paginationSetting);
+ copy2.currentPage = currentPage;
+ copy2.callback = function (pageNum, start, dom) {
+ changePageSetting.pageNum = pageNum;
+ changePageSetting.start = start;
+ initPublishData(changeTemp, 'change', pageNum, start);
+ return false;
+ }
+ $("#change_pagination").pagination(changeTemp.length, copy2);
+}
+
+function initStopPagination(currentPage) {
+ var copy3 = $.extend(true, {}, paginationSetting);
+ copy3.currentPage = currentPage;
+ copy3.callback = function (pageNum, start, dom) {
+ stopPageSetting.pageNum = pageNum;
+ stopPageSetting.start = start;
+ initPublishData(stopTemp, 'stop', pageNum, start);
+ return false;
+ }
+ $("#stop_pagination").pagination(stopTemp.length, copy3);
+}
+
+function initOptButton() {
+ if (!editPerm) {
+ $('#publish_new_button, #publish_change_button, #publish_stop_button').remove();
+ $('#new_check_all, #change_check_all, #change_stop_all').check("disable");
+ }
+}
+
+// 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子
+function initHtml() {
+ var dialogHtml = '';
+ 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 += '';
+ dialogHtml += '';
+ dialogHtml += '
';
+ dialogHtml += '
';
+ 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('
');
+ var newHtml = '';
+ newHtml += '';
+ newHtml += '';
+ newHtml += '';
+ newHtml += '
';
+ if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
+ newHtml += '新增 ';
+ // newHtml += '保存 ';
+ newHtml += '删除 ';
+ newHtml += '重新生成手册 ';
+ newHtml += '生成附件 ';
+ }
+ //newHtml += '新增 ';
+ // newHtml += '保存 ';
+ //newHtml += '删除 ';
+ newHtml += '
';
+ newHtml += '
';
+ newHtml += '
';
+ newHtml += '';
+ newHtml += '
';
+ newHtml += '
';
+
+ var changeHtml = '';
+ changeHtml += '';
+ changeHtml += '';
+ changeHtml += '';
+ changeHtml += '
';
+ if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
+ changeHtml += '新增 ';
+ // changeHtml += '保存 ';
+ changeHtml += '删除 ';
+ changeHtml += '重新生成手册 ';
+ changeHtml += '生成附件 ';
+ }
+ //changeHtml += '新增 ';
+ // changeHtml += '保存 ';
+ //changeHtml += '删除 ';
+
+ if(!$("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
+ editPerm=false;
+ }
+
+ changeHtml += '
';
+ changeHtml += '
';
+ changeHtml += '
';
+ changeHtml += '';
+ changeHtml += '
';
+ changeHtml += '
';
+
+ var stopHtml = '';
+ stopHtml += '';
+ stopHtml += '';
+ stopHtml += '';
+ stopHtml += '';
+ stopHtml += '
';
+ if($("#userTaskDefId").val()=='obj_c9e5a2e257f00001e2a375d01f601518'){
+ stopHtml += '新增 ';
+ // stopHtml += '保存 ';
+ stopHtml += '删除 ';
+ stopHtml += '重新生成手册 ';
+ stopHtml += '生成附件 ';
+
+
+
+ }
+ //stopHtml += '新增 ';
+ // stopHtml += '保存 ';
+ //stopHtml += '删除 ';
+ stopHtml += '
';
+ stopHtml += '
';
+ stopHtml += '
';
+ stopHtml += '';
+ stopHtml += '
';
+ stopHtml += '
';
+
+ $('#contentDiv1').append(newHtml);
+ $('#contentDiv2').append(changeHtml);
+ $('#contentDiv3').append(stopHtml);
+ $("#contentDiv1 .awsui-checkbox,#contentDiv2 .awsui-checkbox,#contentDiv3 .awsui-checkbox").check();
+}
+
+// 初始化参数
+function initParam() {
+ teamId = $("#TEAMID").val();
+ sid = $("#sid").val();
+ wsId = $("#WSID").val();
+ processInstId = $("#processInstId").val();
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_high_security_mode_query"
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ data : param,
+ async: false,
+ success : function(r) {
+ if (r.result == 'ok') {
+ isHighSecurity = r.data.isHighSecurity;
+ }
+ }
+ });
+
+}
+
+// 初始化内容数据
+function initContentData() {
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_batch_data_query',
+ processInstId: processInstId,
+ wsId : wsId,
+ sid: sid
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ var isEnd = r.data.isEnd;
+ var proNumber = r.data.proNumber;
+ if (proNumber) {
+ editPerm = proNumber;
+ }
+ closeFormPage = r.data.closeFormPage;
+ var newData = r.data.newData;
+ newTemp = newData;
+ var changeData = r.data.changeData;
+ changeTemp = changeData;
+ var stopData = r.data.stopData;
+ stopTemp = stopData;
+ var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
+ var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
+ if (!$.isEmptyObject(newData)) {
+ $('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'new');// 显示
+ // 更新数据
+ $("#OPTIONTYPE_0").check("option","checked", true);
+ initPublishData(newData, 'new', 1, 1);
+ } else {
+ $("#OPTIONTYPE_0").check("option","checked", false);
+ $('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg);
+ }
+ if (!$.isEmptyObject(changeData)) {
+ $('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'change');
+ $("#OPTIONTYPE_1").check("option","checked", true);
+ initPublishData(changeData, 'change', 1, 1);
+ } else {
+ $("#OPTIONTYPE_1").check("option","checked", false);
+ $('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg);
+ }
+ if (!$.isEmptyObject(stopData)) {
+ $('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
+ dealPublishCheck(true, 'stop');
+ $("#OPTIONTYPE_2").check("option","checked", true);
+ initPublishData(stopData, 'stop', 1, 1);
+ } else {
+ $("#OPTIONTYPE_2").check("option","checked", false);
+ $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg);
+ }
+ }
+ });
+}
+
+var changedId = '';
+
+function initPublishData(data, type, pageNumber, start){
+ showlist(data, type, pageNumber, start);
+ if($("#readonly").val()=="true"){
+ $("#publish_new_button").hide();
+ $("#publish_change_button").hide();
+ $("#publish_stop_button").hide();
+ }
+
+}
+
+// 初始化数据
+function selectPublishData(data, type, pageNumber, start) {
+ //渲染到前台的流程架构L1,L2,L3,L4
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId : wsId,
+ sid: sid,
+ type:type,
+ datas:JSON.stringify(data)
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : true,
+ data : param,
+ success : function(r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ var L4old = ui("LEVEL_4_PROCESS_NAME");
+ ui("LEVEL_1_PROCESS_NAME",L1);
+ ui("LEVEL_2_PROCESS_NAME",L2);
+ ui("LEVEL_3_PROCESS_NAME",L3);
+ ui("LEVEL_4_PROCESS_NAME",L4);
+ 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"),
+ level4 :ui("LEVEL_4_PROCESS_NAME"),
+ company :ui("ADAPT_NAME_THE_COMPANY"),
+ region :ui("ADAPT_REGION_NAME"),
+ product :ui("APPLICABLE_PRODUCT"),
+ bindid : processInstId
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : true,
+ data : param,
+ success : function(r) {
+ var info = r.data.data;
+ if(info != ''){
+ ui("PERSON_THREE_LEVEL_PROCESS_NO",info.AUDITOR_NO_3);
+ ui("PROCESS_RESPONSIBLE_PERSON_NO",info.AUDITOR_NO_2);
+ ui("PERSON_FOUR_LEVEL_PROCESS_NO",info.AUDITOR_NO_4);
+ ui("RESPONSIBLE_PERSON1_NO",info.AUDITOR_NO_1);
+ ui("PERSON_THREE_LEVEL_PROCESS",info.AUDITOR3);
+ ui("PROCESS_RESPONSIBLE_PERSON",info.AUDITOR2);
+ ui("RESPONSIBLE_PERSON1",info.AUDITOR1);
+ ui("PERSON_FOUR_LEVEL_PROCESS",info.AUDITOR4);
+
+ ui("LEVEL_AUDIT_REQUIRED",info.L3_SP);
+ ui("SECONDARY_AUDIT_REQUIRED",info.L2_SP);
+ ui("LEVEL_1_AUDIT_REQUIRED",info.L1_SP);
+ ui("FOURTH_AUDIT_REQUIRED",info.L4_SP);
+
+
+
+ }
+ }
+ });
+}
+//预览下载附件
+function openUrl(url) {
+ //$.simpleAlert("文件正在处理", "loading");
+ window.open(url);
+}
+
+//by bzp
+function showlist(data, type, pageNumber, start){
+ var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
+ if (type == 'new') {
+ $('#new_check_all').check("option", "checked", false);
+ if (data.length > pageLimit) {// 显示分页
+ $('#new_pagination').show();
+ }
+ // 加载数据
+ var html = '';
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
+
+ var fName = '';
+ var upFileId = curr.upfileId;
+ if(upFileId!=''&&upFileId!=undefined){
+ for(var i = 0; i < upFileId.length; i++){
+ var upFileJson = upFileId[i]
+ var json=JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
+ var fileName = curr.publishFileName + ' V' + curr.fileVersion;
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + fileName + "-" + outputName + ' ';
+ if(outputName=="表单封面"){
+ var reportName = "";
+ }
+ //var reportName = '' + fileName + "-" + outputName + ' ';
+ var quickCreate = "立即创建 ";
+ var processNumber = '提交后生成文件编号';
+ if(curr.processNumber != undefined&&curr.processNumber != ''){
+ processNumber = curr.processNumber;
+ }
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
+ // 三员管理,taskId为new标识未创建手册
+ if (isHighSecurity){
+ reportName = curr.taskId == 'new' ? quickCreate : reportName;
+ }
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += '';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + fileName + ' ';
+ if(fName!=''){
+ html += '' + reportName + fName+' ';
+ }else{
+ html += '' + reportName +' ';
+ }
+ //html += '' + fName + ' ';
+ //html += ' ';
+ html += ''+ processNumber +' ';
+ html += ' ';
+ }
+ }
+ $('#publish_new_tbody').empty().html(html);
+ $("#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();
+ }
+ // 加载数据
+ var html = '';
+ var tempSelect = [];
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
+
+ var fName = '';
+ var upFileId = curr.upfileId;
+ var changNumer = '提交后生成文件编号';
+ if(curr.changedNumber != undefined&&curr.changedNumber != ''){
+ changNumer = curr.changedNumber;
+ }
+ if(upFileId!=''&&upFileId!=undefined){
+ for(var i = 0; i < upFileId.length; i++){
+ var upFileJson = upFileId[i]
+ var json=JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
+ var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
+ // 变更目标文件处理
+ var targetFileName = "";
+ if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
+ targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
+ }
+ var targetId = "";
+ if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
+ targetId = curr.changedFileIdNew;
+ }
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + targetFileName + "-" + outputName + ' ';
+ if(outputName=="表单封面"){
+ var reportName = "";
+ }
+ var quickCreate = "立即创建 ";
+ createButtonObj[curr.changeFileId] = quickCreate;
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : curr.taskId == 'submit_create' ? quickCreate : reportName;
+
+ // 三员管理,taskId为change标识未创建手册
+ if (isHighSecurity){
+ reportName = curr.taskId == 'change' ? quickCreate : reportName;
+ }
+ if($("#userTaskDefName").val()!='发起人'||$("#readonly").val()=='true'){
+ editPerm=false;
+ }
+
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += '';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + sourceFileName + ' ';
+ var selectPerm = editPerm ? ' ' : '' + targetFileName + ' ';
+ html += '' + selectPerm + ' ';
+ if(fName!=''){
+ html += '' + reportName + fName +' ';
+ }else{
+ html += '' + reportName +' ';
+ }
+ //html += '' + reportName + fName +' ';
+ //html += '' + reportName + ' ';
+ //html += '' + fName + ' ';
+ //html += ' ';
+ html += '' + changNumer +' ';
+ 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;
+ 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;
+ tempObj.category = curr.category;
+ tempObj.methodId = curr.methodId;
+ tempSelect.push(tempObj);
+ }
+ }
+ $('#publish_change_tbody').empty().html(html);
+ // 初始化select2
+ for(var k = 0; k < tempSelect.length; k++) {
+ var tempObj = tempSelect[k];
+ $("#" + tempObj.selectId).select2(tempObj.opt);
+ $('.select2').width('100%');
+ if (tempObj.flag) {// 已选择版本
+ $("#" + tempObj.selectId).val(tempObj.targetId).trigger("change");// 变更
+ // 流程手册界面更新
+ if (tempObj.taskId != undefined && tempObj.taskId != '') {
+ // 三员管理,taskId为change标识未创建手册
+ if (tempObj.taskId == 'submit_create' || tempObj.taskId == 'change') {
+ // $('#report_' + tempObj.id).html(quickCreate);
+ $('#report_' + tempObj.id).html(createButtonObj[tempObj.id]);
+ } else {
+ for (var m = 0; m < tempObj.opt.data.length; m++) {
+ if (tempObj.opt.data[m].id == tempObj.targetId) {
+ var outputName = getOutputName(tempObj.category, tempObj.methodId);
+ 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) {
+ // 获取选中的版本,获取流程手册,更新数据
+ initChangedData(tempObj.id);
+ }
+ }
+ // select改变事件
+ $("#" + tempObj.selectId).on("change", function (e) {
+ initChangedData($(this).attr('id').slice(7));
+ });
+ }
+ $("#publish_change_tbody .awsui-checkbox").check();
+ }
+ if (type == 'stop') {
+ $('#stop_check_all').check("option", "checked", false);
+ if (data.length > pageLimit) {// 显示分页
+ $('#stop_pagination').show();
+ }
+ // 加载数据
+ var html = '';
+ for (var i = 0, s = start; i < pageLimit; i++, s++) {
+ var curr;
+ if ((curr = data[s - 1]) != undefined) {
+
+ var fName = '';
+ var upFileId = curr.upfileId;
+ if(upFileId!=''&&upFileId!=undefined){
+ for(var i = 0; i < upFileId.length; i++){
+ var upFileJson = upFileId[i]
+ var json=JSON.parse(upFileJson);
+ var upId = json.upfileId;
+ var upName = json.upFileName;
+ var openUrl = json.openUrl;
+ var downUrl = json.downUrl;
+ fName += '' + upName + '  ';
+ }
+ }
+
+ var fileName = curr.stopFileName + ' V' + curr.fileVersion;
+ var outputName = getOutputName(curr.category, curr.methodId);
+ var reportName = '' + fileName + "-" + outputName + ' ';
+ reportName = (curr.taskId == undefined || curr.taskId == '') ? '无' : reportName;
+ var checkboxPerm = editPerm ? '' : 'disabled="disabled"';
+ var textareaPerm = editPerm ? '' : 'readonly';
+ html += '';
+ html += ' ';
+ html += '' + s + ' ';
+ html += '' + fileName + ' ';
+ /*html += '' + reportName + ' ';*/
+
+ if(fName!=''){
+ html += '' + reportName + fName +' ';
+ }else{
+ html += '' + reportName +' ';
+ }
+
+ html += ' ';
+ html += ' ';
+ }
+ }
+ $('#publish_stop_tbody').empty().html(html);
+ $("#publish_stop_tbody .awsui-checkbox").check();
+ }
+}
+
+function disabledButton() {
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', 'disabled');
+}
+
+function checkCreateReportTime() {
+ var isRadio1 = $('#radio1').closest('div').hasClass('checked');
+ var isRadio2 = $('#radio2').closest('div').hasClass('checked');
+ if (!isRadio1 && !isRadio2) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+// 获取报告生成时机
+function getReportCreateTime() {
+ var createTime = 'now_create';
+ var isRadio1 = $('#radio1').closest('div').hasClass('checked');
+ if (isRadio1) {// 立即
+
+ } else {
+ createTime = 'submit_create';
+ }
+ return createTime;
+}
+
+// 新增
+function addProcess(type) {
+ treeCheckedNewArr = [];
+ treeCheckedChangeArr = [];
+ treeCheckedStopArr = [];
+ $('#publisher_dialog_name').val('');
+ $('#publisher_dialog_desc').val('');
+ var title = type == 'new' ? '发布流程' : type == 'change' ? '变更流程' : '停用流程';
+ var height = 380;
+ $("#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,
+ title: title,
+ 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]);
+ }
+ //校验支持文件是否上传
+ //publishFlowCheck(newTemp);
+ // 初始化页数及当前页
+ 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 == 'stop') {
+ debugger;
+ 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");
+ }
+ }
+ });
+}
+
+// 打开流程树选择窗口
+function queryTree() {
+ if ($("#treeDialog").css('display') == 'none') {// 防止多次打开
+ openQueryDataDialog(searchType);
+ }
+}
+
+
+//校验模型中支持文件附件是否上传
+function publishFlowCheck(data) {
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ ids.push(temp.publishFileId);
+ }
+ }
+
+
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_get_publishFlow_files",
+ wsId: wsId,
+ uuids: JSON.stringify(ids)
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ data : param,
+ success : function(r) {
+ if (r.result == 'ok') {
+ if(r.data.result=='error'){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert(r.data.sb,"error",3000);
+ return;
+ }
+
+ }
+ }
+ });
+
+
+
+}
+
+
+// select2改变事件
+function initChangedData(changeFileId) {
+ var selectedId = $("#change_" + changeFileId).val();// 切换后的版本id
+ for(var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changeFileId == changeFileId) {
+ for(var j = 0; j < changeTemp[i].targetFiles.length; j++) {
+ if (changeTemp[i].targetFiles[j].id == selectedId) {// 当前选中
+ // 获取流程手册
+ var selectedTaskId = "";
+ selectedTaskId = createReport(changeTemp[i].category, changeTemp[i].methodId, selectedId, selectedTaskId);
+
+ // 更新数据
+ changeTemp[i].changedFileIdNew = selectedId;
+ changeTemp[i].changedFileNameNew = changeTemp[i].targetFiles[j].text;
+ changeTemp[i].taskId = selectedTaskId;
+ changeTemp[i].targetFileVersion = changeTemp[i].targetFiles[j].version;
+ changeTemp[i].targetMethodId = changeTemp[i].methodId;
+ changeTemp[i].targetCategory = changeTemp[i].category;
+
+ // 更新界面手册
+ if (selectedTaskId != '') {
+
+ var outputName = getOutputName(changeTemp[i].category, changeTemp[i].methodId);
+
+ var targetFileName2 = changeTemp[i].targetFiles[j].text + ' V' + changeTemp[i].targetFiles[j].version + '-' + outputName + ' ';
+ $('#report_' + changeFileId).html('' + targetFileName2 + ' ');
+ } else {
+ $('#report_' + changeFileId).html('无');
+ }
+ //获取选中模型数据,更新架构数据
+ updateFramework(changeTemp[i].changedFileIdNew);
+ break;
+ }
+ }
+ break;
+ }
+ }
+}
+
+
+
+// 打开流程文件查看页面
+function openPortalPage(uuid, taskId) {
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
+ uuid : uuid
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ 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
+ } else {
+ $.simpleAlert(r.msg);
+ }
+ }
+ });
+}
+
+/**
+ * 重新生成手册
+ * @param uuid
+ */
+function refreshManuals(processInstId,type) {
+ $.simpleAlert("正在创建", "loading");
+ FormToolBarAction.BTN_SAVE();
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_publish_Refresh_Manual",
+ processInstId : processInstId,
+ type : type
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ data : param,
+ success : function(r) {
+ $.simpleAlert('close');
+ if (r.result == 'ok') {
+ AWSFormUtil.refreshPage();
+ } else {
+ $.simpleAlert(r.msg);
+ }
+ }
+ });
+}
+
+// 打开流程选择dialog
+function openQueryDataDialog(type) {
+ $('#treeDataDiv').html('
');
+ $('#searchData').html(' ');
+ $("#loadImg").loading({
+ 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
+ debugger;
+ 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);// 绑定搜索事件
+ getNotPublishTreeData(type);
+ } else {// stop
+ initPublishSearch(type);// 绑定搜索事件
+ getPublishedTreeData(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
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ 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);
+ }
+ });
+}
+//加载type为new的树节点
+function loadNewData(treeNode) {
+ // 如果是父节点并且存在子节点执行加载
+ if (treeNode) {
+ 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,
+ method : "POST",
+ dataType : "json"
+ }
+ initTree.refreshNode({
+ id : pid,
+ dataModel : dataModel
+ });
+ var data = initTree.getChildrenByPid(pid);
+ var newData = [];
+ for (var i=0;i   ' + 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
+ });
+ }
+}
+
+// 发布类型批量结果数据回填主dialog
+function getNewPublishBatchResult(type) {
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedNewArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId : wsId,
+ sid: sid,
+ datas:JSON.stringify(nodes)
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ var L4old = ui("LEVEL_4_PROCESS_NAME");
+ if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L4 != L4old)){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ alert("只能选择同一级别下的流程,请重新选择");
+ return;
+ }else if(info == true){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ alert("只能选择同一级别下的流程,请重新选择");
+ return;
+
+ }else{
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ //by bzp
+ if(node.method == "process.framework"){
+ continue;
+ }
+ var obj = {};
+ obj.fileVersion = node.version;
+ obj.publishFileId = node.id;
+ obj.id = node.id;
+ // obj.publishFileName = node.name;
+ obj.publishFileName = node.tempName;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.taskId = "";// 后续生成流程手册
+ treeCheckedNewArr.push(obj);
+ }
+ }
+ }
+ });
+}
+
+//获取已发布文件数据结构
+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
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ data : param,
+ success : function(r) {
+ var data = r.data.data;
+ var setting = {
+ checkbox: true,
+ checkInherit: r.data.checkInherit,
+ dataModel : {
+ data: data
+ }
+ };
+ for (var i=0;i   ' + 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 + ' ';
+ }
+ }
+ $("#treeDataDiv").empty();
+ $('#treeDataDiv').html('');
+ initTree = awsui.tree.init($("#tree"), setting);
+ }
+ });
+}
+
+//变更类型批量结果数据回填主dialog
+function getChangeBatchResult(type) {
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedChangeArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId : wsId,
+ sid: sid,
+ datas:JSON.stringify(nodes)
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ var L4old = ui("LEVEL_4_PROCESS_NAME");
+ if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L3 != L4old)){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ }else if(info == true){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ }else{
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ var obj = {};
+ // obj.changeFileName = node.name;
+ obj.changeFileName = node.tempName;
+ obj.changeFileId = node.id;
+ obj.fileVersion = node.version;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.id = node.id;
+ obj.targetFiles = [];// 后续生成
+ obj.changedFileIdNew = "";// 后续生成
+ obj.changedFileNameNew = "";// 后续生成
+ obj.taskId = "";// 后续生成
+ obj.targetFileVersion = "";// 后续生成
+ obj.targetMethodId = node.method
+ obj.targetCategory = node.category
+ treeCheckedChangeArr.push(obj);
+ }
+ }
+ }
+ });
+}
+
+// 停用类型批量结果数据回填主dialog
+function getStopBatchResult(type) {
+ var nodes = initTree.getCheckedNodes();
+ treeCheckedStopArr = [];
+ var param = {
+ cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs',
+ processInstId: processInstId,
+ wsId : wsId,
+ sid: sid,
+ datas:JSON.stringify(nodes)
+ };
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ var info = r.data.info;
+ var L1 = r.data.data.Process_Architecture_L1;
+ var L2 = r.data.data.Process_Architecture_L2;
+ var L3 = r.data.data.Process_Architecture_L3;
+ var L4 = r.data.data.Process_Architecture_L4;
+ var L1old = ui("LEVEL_1_PROCESS_NAME");
+ var L2old = ui("LEVEL_2_PROCESS_NAME");
+ var L3old = ui("LEVEL_3_PROCESS_NAME");
+ var L4old = ui("LEVEL_4_PROCESS_NAME");
+ if((L1old != '' && L1 != L1old) || (L2old != '' && L2 != L2old) || (L3old != '' && L3 != L3old) || (L4old != '' && L4 != L4old)){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ }else if(info == true){
+ $('#publisher_dialog').find('div.dlg-button').find('button:first').prop('disabled', '');
+ $.simpleAlert("只能选择同一级别下的流程,请重新选择");
+ return;
+ }else{
+ //treeCheckedNewArr = nodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var node = nodes[i];
+ if (node.id.length > 36) continue;
+ var obj = {};
+ // obj.stopFileName = node.name;
+ obj.stopFileName = node.tempName;
+ obj.stopFileId = node.id;
+ obj.fileVersion = node.version;
+ obj.id = node.id;
+ obj.methodId = node.method;
+ obj.category = node.category;
+ obj.taskId = "";// 后续查询已经存在的流程手册
+ treeCheckedStopArr.push(obj);
+ }
+ }
+ }
+ });
+}
+
+// 获取已有的流程手册
+function queryBatchReport(data) {
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ ids.push(temp.stopFileId);
+ }
+ }
+ 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)
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ var result = r.data.data;
+ for (var i = 0; i < data.length; i++) {
+ if (result[data[i].id] != undefined) {
+ data[i].taskId = result[data[i].id];
+ }
+ }
+ }
+ });
+ return data;
+}
+
+// 创建流程手册
+function createReport(category, method, uuid, taskId) {
+ if ((method == 'control.policy' || method == 'data.form' || method.indexOf('process.') > -1) && method != 'default') {
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
+ teamId: teamId,
+ wsId: wsId,
+ uuid: uuid
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ if (r.result == 'ok') {
+ taskId = r.data.taskId;
+ }
+ }
+ });
+ } else {
+ $.simpleAlert('不支持创建手册');
+ }
+ return taskId;
+}
+
+// 批量创建流程手册
+function createBatchReport(data, createTime) {
+ var ids = [];
+ for (var i = 0; i < data.length; i++) {
+ var temp = data[i];
+ if ((temp.methodId == 'control.policy' || temp.methodId == 'data.form' || temp.methodId.indexOf('process.') > -1) && temp.methodId != 'default') {
+ 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;
+ }
+ var param = {
+ sid : sid,
+ cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_reports_create",
+ teamId: teamId,
+ wsId: wsId,
+ uuids: JSON.stringify(ids)
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ if (r.result == 'ok') {
+ var result = r.data.data;
+ for (var i = 0; i < data.length; i++) {
+ if (result[data[i].id] != undefined) {
+ data[i].taskId = result[data[i].id];
+ }
+ }
+ }
+ }
+ });
+ return data;
+}
+
+// 查询流程的其他版本并生成流程手册
+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
+ }
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ data = r.data.data;
+ }
+ });
+ return data;
+}
+
+// 获取手册专属名称
+function getOutputName(category, method) {
+ if (method == 'control.policy') {
+ return '制度手册';
+ }
+ if (method == 'data.form') {
+ return '表单封面'
+ }
+ if (method.indexOf('process.') > -1) {
+ return '流程手册';
+ }
+ return '手册';
+}
+
+//单个流程立即创建流程手册
+function quickCreateReport(obj, object, type) {
+ 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 + "\')");
+
+ //三员管理下,立即创建
+ if(isHighSecurity){
+ //更新数据记录
+ if (type == 'new') {
+ var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
+ $(object).text(fileName);
+ } else if (type == 'change') {
+ var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
+ $(object).text(targetFileName);
+ }
+ }else{
+ //更新数据记录
+ if (type == 'new') {
+ var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
+ $(object).text(fileName);
+ for (var i = 0; i < newTemp.length; i++) {
+ if (newTemp[i].publishFileId == uuid) {
+ newTemp[i].taskId = taskId;
+ }
+ }
+ } else if (type == 'change') {
+ var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
+ $(object).text(targetFileName);
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changedFileIdNew == uuid) {
+ changeTemp[i].taskId = taskId;
+ }
+ }
+ }
+ }
+ $(object).parent().append(' ');
+}
+
+// 清空树结构
+function clearTreeData() {
+ initTree = {};
+}
+
+// 禁用按钮
+function disabledAll() {
+ $('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled":"disabled"});
+}
+
+// 关闭模态窗
+function closeDialog() {
+ $("#treeDialog").dialog("close");
+}
+
+// 打开流程手册
+function openReportFile(taskId) {
+ $.simpleAlert("文件正在处理", "loading");
+ awsui.ajax.request({
+ 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");
+ }
+ });
+}
+
+// 删除
+function deleteFile(type) {
+ if ($('#publish_' + type + '_tbody').find('tr').length > 0) {
+ var flag = true;
+ $('#publish_' + type + '_tbody').find('input[name="check"]').each(function() {
+ if ($(this).closest('div').hasClass('checked')) {
+ flag = false;
+ }
+ });
+ if (flag) {
+ $.simpleAlert('请选择列表中数据');
+ return;
+ } else {
+ 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;
+ }
+ }
+ }
+ 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;
+ }
+ }
+ }
+ 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;
+ }
+ }
+ }
+ 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('列表中无数据');
+ }
+}
+
+//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("PERSON_FOUR_LEVEL_PROCESS",'');
+ ui("FOURTH_AUDIT_REQUIRED",'0');
+
+
+ //流程级别信息
+ ui("LEVEL_1_PROCESS_NAME",'');
+ ui("LEVEL_2_PROCESS_NAME",'');
+ ui("LEVEL_3_PROCESS_NAME",'');
+ ui("LEVEL_4_PROCESS_NAME",'');
+ //看是否需要清空后台数据~~
+ queryapprove();
+}
+
+// 变更说明内容时处理
+function changeDesc(type, id, obj) {
+ var desc = $(obj).val();
+ if (type == 'new') {
+ for (var i = 0; i < newTemp.length; i++ ) {
+ if (newTemp[i].publishFileId == id) {
+ newTemp[i].publishDesc = desc;
+ break;
+ }
+ }
+ }
+ if (type == 'change') {
+ for (var i = 0; i < changeTemp.length; i++ ) {
+ if (changeTemp[i].changeFileId == id) {
+ changeTemp[i].changedDesc = desc;
+ break;
+ }
+ }
+ }
+ if (type == 'stop') {
+ for (var i = 0; i < stopTemp.length; i++ ) {
+ if (stopTemp[i].stopFileId == id) {
+ stopTemp[i].stopDesc = desc;
+ break;
+ }
+ }
+ }
+}
+
+// 点击checkbox
+function onCheckboxClickEvent(boItemName, $checkbox, val) {
+ var isCheck = !$checkbox.closest('div').hasClass('checked');
+ if (val == '流程制度发布') {
+ dealPublishCheck(isCheck, 'new');
+ } else if (val == '流程制度版本更新') {
+ dealPublishCheck(isCheck, 'change');
+ } else if (val == '流程制度废止') {
+ dealPublishCheck(isCheck, 'stop');
+ }
+}
+
+// 主体内容显示与隐藏
+function dealPublishCheck(isCheck, type) {
+ if (type == 'new') {
+ 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') {
+ isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide();
+ }
+}
+
+// 单独保存子表操作
+function saveFormData(type) {
+
+ $.simpleAlert('正在保存', 'loading');
+ var saveData = [];
+ if (type == 'new') {
+ saveData = newTemp;
+ }
+ if (type == 'change') {
+ saveData = changeTemp;
+ }
+ if (type == 'stop') {
+ saveData = stopTemp;
+ }
+ var param = {
+ 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;
+ $.ajax({
+ url : "./jd",
+ type : "POST",
+ dataType : "JSON",
+ async : false,
+ data : param,
+ success : function(r) {
+ if (r.result == 'error') {
+ flag = true;
+ tempData = r.data.data;
+ }
+ },
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
+ $.simpleAlert("表单信息错误,请联系管理员!", 'error');
+ }
+ });
+ $.simpleAlert('close');
+ if (false) {
+ var msg = '以下文件已经在其他未办理完成的表单中,不允许保存/办理';
+ if (tempData.length > 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);
+ } else {
+ $.simpleAlert('保存成功', 'ok');
+ }
+}
+
+// 点击办理时的校验+保存字表
+function formSave(isTransact){
+ var userTaskDefName = $("#userTaskDefName").val();
+ if(userTaskDefName == '发起人'){
+ if(isTransact==true){
+ uiRequiredClass("PROCESS_TITLE", isShow);
+ uiRequiredClass("SEND_SCOPE", isShow);
+ uiRequiredClass("ADAPT_NAME_THE_COMPANY", isShow);
+ uiRequiredClass("APPLICABLE_PRODUCT", isShow);
+ uiRequiredClass("ADAPT_REGION_NAME", isShow);
+ }
+
+ if (!editPerm) {// 只读状态不处理
+ return true;
+ }
+ $.simpleAlert('正在保存', 'loading');
+ if(isTransact) {// 点击办理进行校验
+ // 判断页面是否有数据
+ if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none'){
+ $.simpleAlert('close');
+ $.simpleAlert('发布内容不能为空', 'info');
+ return false;
+ }
+ var index = 0;
+ if (!($("#publisher_new_tr").css('display') == 'none') && newTemp.length > 0) {
+ index++;
+ }
+ if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
+ index++;
+ }
+ if (!($("#publisher_stop_tr").css('display') == 'none') && stopTemp.length > 0) {
+ index++;
+ }
+ if (index == 0) {
+ $.simpleAlert('close');
+ $.simpleAlert('发布内容不能为空', 'info');
+ return false;
+ }
+
+ // 校验变更文件是否全部都有变更后文件
+ if (!($("#publisher_change_tr").css('display') == 'none') && changeTemp.length > 0) {
+ var flag = false;
+ var msg = '以下文件没有选择变更后的文件,不允许办理';
+ for (var i = 0; i < changeTemp.length; i++) {
+ if (changeTemp[i].changedFileIdNew == "") {
+ flag = true;
+ msg += ' ' + changeTemp[i].changeFileName + ' V' + changeTemp[i].fileVersion;
+ }
+ }
+ if (flag) {
+ var options = {
+ title : "提示",
+ content:msg,
+ type:"alert",
+ onConfirm: function(){
+ }
+ };
+ $.simpleAlert('close');
+ $.confirm(options);
+ return false;
+ }
+ }
+ }
+ // 保存校验
+ // 1.不显示的数据默认删除
+ var newTempData = newTemp;
+ var changeTempData = changeTemp;
+ var stopTempData = stopTemp;
+ if (($("#publisher_new_tr").css('display') == 'none')) {
+ newTempData = [];
+ }
+ if (($("#publisher_change_tr").css('display') == 'none')) {
+ changeTempData = [];
+ }
+ if (($("#publisher_stop_tr").css('display') == 'none')) {
+ stopTempData = [];
+ }
+ // 2.校验变更的数据与停用的数据是否有重叠
+ if(isTransact) {
+ if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) {
+ for (var i = 0; i < changeTempData.length; i ++) {
+ for (var j = 0; j < stopTempData.length; j++) {
+ if (changeTempData[i].changeFileId == stopTempData[j].stopFileId) {
+ $.simpleAlert('close');
+ $.simpleAlert(stopTempData[j].stopFileName + ' V' + stopTempData[j].fileVersion + " 在变更流程和停用流程中同时存在,不允许办理", 'error');
+ return false;
+ }
+ }
+ }
+ }
+ }
+ //三员管理,提交后不生成手册,更改taskId
+ if (isHighSecurity){
+ for (let i=0;i -1) && data.methodId != 'default') {
+ data.taskId = "new";
+ }
+ }
+ for (let j=0; j 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;
+ } else {
+ newTemp = newTempData;
+ if (newTemp.length == 0) {
+ newPageSetting = {
+ pageNum:1,
+ start:1
+ };
+ $('#new_pagination').hide();
+ initPublishData(newTemp, 'new', 1, 1);
+ }
+ changeTemp = changeTempData;
+ if (changeTemp.length == 0) {
+ changePageSetting = {
+ pageNum:1,
+ start:1
+ };
+ $('#change_pagination').hide();
+ initPublishData(changeTemp, 'change', 1, 1);
+ }
+ stopTemp = stopTempData;
+ if (stopTemp.length == 0) {
+ stopPageSetting = {
+ pageNum:1,
+ start:1
+ };
+ $('#stop_pagination').hide();
+ initPublishData(stopTemp, 'stop', 1, 1);
+ }
+ $.simpleAlert('保存成功', 'ok');
+ }
+ }
+
+}
+
+//办理完成后关闭页面
+AWSFormMainAPI.customCloseFormPage(function(){
+ if (closeFormPage) {
+ window.close();
+ } else {
+ AWSFormUtil.refreshPage();
+ }
+ // 父页面刷新
+ opener.refreshTab();
+ return true;//最后返回true
+});
+
+/********************************快速搜索start***************************************/
+
+// 绑定事件
+function initPublishSearch(type) {
+ $("#processName").buttonedit({
+ onClick: function(e){
+ searchProcess(type);
+ }
+ });
+ $("#processName").bind("keypress",function(event){
+ if(event.keyCode == "13"){
+ searchProcess(type);
+ }
+ });
+ $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
+ $('#autoSearchProcessDiv').show();
+ }).off("autoSearchProcessDiv").on("mouseleave", function () {
+ $('#autoSearchProcessDiv').hide();
+ });
+}
+
+// 搜索
+function searchProcess(type) {
+ $("#autoSearchProcessDiv").empty().hide();
+ if ($("#processName").val() == "" || $("#processName").val().trim() == "") {
+ return;
+ }
+ 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 += '
';
+ }
+ }
+ });
+ }
+ if (html.length > 0) {
+ $("#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;
+}
+
+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;
+ }
+}
+
+function getFilePath(node, text) {
+ var name = text;
+ do {
+ var p = initTree.getParentNodeById(node.id);
+ if (p == undefined) {
+ break;
+ }
+ name = p.name + ">" + name;
+ node = p;
+ } while(true);
+ return name;
+}
+
+function auto_move(obj) {
+ obj.css({"color": "white", "background-image" : "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"});
+}
+
+function auto_out(obj) {
+ obj.css({"color": "black", "background-image" : "none"});
+}
+
+function auto_click(obj, type) {
+ var plId = obj.find("span").attr("plId");
+ var type = obj.find("span").data("type");
+ 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);
+ $('#tree').scrollTop(ele.offsetTop);
+ initTree.cancelSelectNode()
+ initTree.selectNode(plId);
+ $("#autoSearchProcessDiv").empty().hide();
+}
+/********************************快速搜索end***************************************/
+
+function listenCloseEvent() {
+ window.onbeforeunload = function(){
+ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
+ processInstId: processInstId
+ },
+ success : function(r) {
+ if (r.result == "ok") {
+ if (r.data.saveStatus == '1') {
+ return "未保存,关闭之后不会保存该表单!";
+ }
+ }
+ }
+ });
+ }
+
+ //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件
+ window.onunload = function(){
+ // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query",
+ processInstId: processInstId
+ },
+ success : function(r) {
+ if (r.result == "ok") {
+ if (r.data.saveStatus == '1') {
+ // 删除该流程实例,并刷新主页面
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ /*async: false,*/
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_remove",
+ processInstIds: processInstId
+ },
+ success : function(r) {
+ if (r.result == "ok") {
+ // 父页面刷新
+ opener.refreshTab();
+ }
+ }
+ });
+ }
+ }
+ }
+ });
+ }
+}
+
+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) {
+ if (r.result == "ok") {
+ window.open (r.data.url);
+ } else {
+
+ }
+ }
+ });
+}
+
+
+
+//刷新页面
+function getFiles() {
+ FormToolBarAction.BTN_SAVE();
+ AWSFormUtil.refreshPage();
+}
+
+
+//下拉获取最新架构进行赋值操作
+function updateFramework(uuid) {
+ awsui.ajax.request({
+ type: "POST",
+ url: "./jd",
+ async: false,
+ data: {
+ sid: sid,
+ cmd: "com.actionsoft.apps.coe.pal.publisher_publish_updateFramework",
+ uuid: uuid,
+ processInstId:processInstId
+ },
+ success : function(r) {
+ if (r.result == "ok") {
+ 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 L4 = r.data.data.Process_Architecture_L4;
+ ui("LEVEL_1_PROCESS_NAME",L1);
+ ui("LEVEL_2_PROCESS_NAME",L2);
+ ui("LEVEL_3_PROCESS_NAME",L3);
+ ui("LEVEL_4_PROCESS_NAME",L4);
+ }
+ }
+ });
+
+}