找回密码
 注册成为天翎用户
查看: 309|回复: 1

[已解决] 流程历史脚本

[复制链接]
吴思敏 发表于 2021-6-11 09:20:50 | 显示全部楼层 |阅读模式
【myApps/OBPM版本号】:v4.4- sp XX
【浏览器类型】:Chrome/其他
【联系方式-QQ】:请留下您的QQ号码
【联系电话】:    请留下您的联系电话,以便技术同事更好解决您的问题
【问题描述】:









1、问题描述最好图文并茂,如有视频/脚本可直接放出,这样技术同事在处理该问题时效率更加高效哦~
2、如果该问题已得到解决,请在该帖子下回复\"已解决可结帖\"
 楼主| 吴思敏 发表于 2021-6-11 09:23:07 | 显示全部楼层
  1. #include"deptFunction1";
  2. (function testhis(){
  3.    var flsg=IsWeixin();
  4.    if(!flsg){
  5.          var curDoc = getCurrentDocument();
  6.          var message="<table id='flowhistory' cellSpacing='0' cellPadding='1' width='90%' align='center' style='table-layout:fixed;border:solid #cccccc;border-width:1px 0px 0px 1px;'><tbody><tr style='line-height:22px;'><td style='width:10%;align:center;font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;background-color:#EFF0F1;width=10%;' >审批人</td><td style='width:20%;font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;background-color:#EFF0F1;width=20%' >审批时间</td><td style='width:30%;align:center;font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;background-color:#EFF0F1;width=30%' >备注</td><td style='width:10%;align:center;font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;background-color:#EFF0F1;width=10%' >动作</td><td style='font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;background-color:#EFF0F1;'  >流程状态</td></tr>";
  7.          var txtNo = curDoc.getId();
  8.   
  9.          var sql="select acthis.nodehis_id,acthis.name,acthis.attitude,acthis.processtime,relhis.startNodename, relhis.flowoperation from (select * from T_Actorhis where doc_id = '"+txtNo+"') acthis,(select * from t_relationhis where docid = '"+txtNo+"') relhis where acthis.nodehis_id=relhis.ID and relhis.startNodename='部门审批中1' and acthis.processtime=(select max(acthis.processtime) as processtime from (select * from T_Actorhis where doc_id = '"+txtNo+"') acthis,(select * from t_relationhis where docid = '"+txtNo+"') relhis where acthis.nodehis_id=relhis.ID and relhis.startNodename='部门审批中1')";
  10.          var datas  = queryByDSName("cunhuoBusiness",sql);
  11.          var count = 0;
  12.          if(datas!=null&&datas.size()>0){
  13.                  for(var iter = datas.iterator();iter.hasNext();){
  14.                          count = count + 1;
  15.                          var doc = iter.next();
  16.                          var name = doc.get("name");
  17.                          var namebak = name;
  18.                          if ("admin".equalsIgnoreCase(name)) {
  19.                                  name = "系统管理员";
  20.                          }
  21.                          var time1 = doc.get("processtime");   
  22.                                          var time =format(time1,"yyyy-MM-dd HH:mm:ss");            
  23.                                     
  24.                                     // var time= parseDate(time2,"yyyy-MM-dd HH:mm:ss");  
  25.   
  26.                          var id = doc.get("nodehis_id");
  27.                          var nodeName = "";
  28.                          var status = "";
  29.                          nodeName = doc.get("startNodename");
  30.                          var statusNum = doc.get("flowoperation")-0;
  31.                          var attitude = "";
  32.                          var att = doc.get("attitude");
  33.                          if(att!=null&&att.trim().length()>0){
  34.                                  if("提交备注".equals(att)||"说点什么吧...".equals(att)){
  35.                                          attitude = "";
  36.                                  }else{
  37.                                          attitude = att;
  38.                                  }
  39.                          }
  40.                          if (statusNum == 80) {
  41.                                  if (name.indexOf("[")>=0 || name.indexOf("]")>=0) {
  42.                                          status = "代理审批";
  43.                                  } else {
  44.                                          status = "流转";
  45.                                  }
  46.                          } else if (statusNum == 81) {
  47.                                  status = "回退";
  48.                          } else if (statusNum == 7) {
  49.                                  status = "完成";
  50.                          } else if (statusNum == 87) {
  51.                                  status = "自动审批";
  52.                          } else if (statusNum == 85) {
  53.                                  status = "回撤";
  54.                          } else if (statusNum == 86) {
  55.                                  status = "流程监控";
  56.                          }  else if (statusNum == 100) {
  57.                                  status = "提交至回退人";
  58.                          }
  59.                           
  60.                          if(count>0){
  61.                                  message += "<tr style='line-height:22px;'><td style='font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;align:center;'>"+name+"</td><td style='align:center;font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;'>"+time+"</td><td style='font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;align:center;'><font style='font-weight:bold;'>"+attitude+"</font></td><td style='font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;'>"+status+"</td><td style='font-size:12px;font-family: Arial;border:solid #cccccc;border-width:0px 1px 1px 0px;word-wrap:break-word; white-space: pre-wrap;'>"+nodeName+" </td></tr>";
  62.                          }
  63.                  }
  64.          }
  65.          message += "</tbody></table>";
  66.          return message;
  67.    }
  68. })();
复制代码
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 03:55

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表