天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
12
返回列表 发新帖
楼主: 广州市交委

怎么样在流程历史中区分哪些是回退回退记录【feature #8685】

[复制链接]
 楼主| 广州市交委 发表于 2013-9-2 16:17:34 | 显示全部楼层
可是我现在是在表单里面展示不是视图里面
广州市交委 发表于 2013-9-2 15:50

或者你告诉我数据库哪里有标示我自己写iscript区分也可以啊
 楼主| 广州市交委 发表于 2013-9-2 16:23:33 | 显示全部楼层
那视图的灯泡功能是怎么实现的?
bobo 发表于 2013-9-2 16:24:04 | 显示全部楼层
回复 12# 广州市交委


    .....不是贴图告诉您具体的操作了吗?
 楼主| 广州市交委 发表于 2013-9-2 16:25:24 | 显示全部楼层
我这里本身就是iscript代码实现的,提交给开发是修改平台内置的列表页改不到我自己写的代码的地方吧!
bobo 发表于 2013-9-2 16:27:13 | 显示全部楼层
回复 14# 广州市交委


    嗯,如果您只是想要在视图那里显示灯泡的那种效果,在平台完全就可以设置...
kimi 发表于 2013-9-2 22:16:11 | 显示全部楼层
您好:请问您现在的需要是否在这表单中显示流程历史,希望在流程历史中显示时,有某列标记流程的操作时正常提交的,还是回退或者回撤的么?如果是您可以在函数库中写函数实现具体代码类似于:
  1. function testhis(){
  2. var message="<table cellSpacing='0' cellPadding='1' width='100%' align='center' style='border:solid #cccccc;border-width:2px 0px 0px 2px;'><tbody><tr style='line-height:22px;'><td width=25%'  style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;' >办理人(部门)</td><td width='40%' style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'  >办理意见</td><td width='25%' style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;' >办理时间</td><td width='40%' style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;' >流程操作</td></tr>";           
  3. var applicationId=getApplication();//获取应用id
  4. var docid=getId();//获取文档id
  5. var doc=getCurrentDocument();//获取当前文档对象
  6. var flowStateId=doc.getStateid();//当前流程实例ID
  7. var hisProcess =  new Packages.cn.myapps.core.workflow.storage.runtime.ejb.RelationHISProcessBean(applicationId);  //流程历史处理类                       
  8. var hisList = hisProcess.doAllQueryByDocIdAndFlowStateId(docid, flowStateId);//根据文档id与流程实例id返回对应的流程历史集合
  9. for(var iter = hisList.iterator();hisList!=null && iter.hasNext();){
  10.                         var relHis = iter.next();
  11.                         if (relHis.getActorhiss().size() > 0) {
  12.                                 for (var iterator = relHis.getActorhiss().iterator(); iterator.hasNext();) {
  13.                                         var actorHis = iterator.next();
  14.                                        
  15.                                         //流程处理人部门信息
  16.                                         var depprocess=getDepartmentProcess();//部门处理类
  17.                                         var userid = actorHis.getActorid();//用户id
  18.                                         var user =  getUserById(userid);//用户对象
  19.                                         var dname ="";
  20.                                         if(user!= null ){
  21.                                               var depart = depprocess.doView(user.defaultDepartment);//部门对象
  22.                                               if(depart != null){
  23.                                                       dname = depart.getName();//部门名称
  24.                                                                  }
  25.                                                         }                    

  26.                                         // 流程处理人
  27.                                         var agname="";
  28.                                         if(actorHis.getAgentname()!=null && actorHis.getAgentname().trim().length()>0){
  29.                                                 agname=actorHis.getAgentname()+"("+actorHis.getName()+")"+"("+dname+")";
  30.                                         }else{
  31.                                                 agname=actorHis.getName()+"("+dname+")";
  32.                                         }                                                                                
  33.                                         // 审批意见
  34.                                         var attitude = "";
  35.                                         if (actorHis.getAttitude() != null&& actorHis.getAttitude().length() > 0) {
  36.                                                 attitude = actorHis.getAttitude();
  37.                                         }else{
  38.                                            attitude="&nbsp";
  39.                                         }
  40.                                         // 审批时间
  41.                                         var pocesstime = "";
  42.                                         var dateutil=new Packages.cn.myapps.util.DateUtil();
  43.                                         if (actorHis.getProcesstime() != null) {
  44.                                                 pocesstime = dateutil.getDateTimeStr(actorHis.getProcesstime());               
  45.                                         } else {
  46.                                                 pocesstime = dateutil.getDateTimeStr(relHis.getActiontime());
  47.                                                 
  48.                                         }
  49.                                     
  50.                                 }
  51.                                    //流程标记
  52.                                     var flowoperation ="";
  53.                                     if(relHis.getFlowOperation()!=null && relHis.getFlowOperation().length()>0){
  54.                                                 flowoperation =relHis.getFlowOperation();
  55.                                     }else{
  56.                                                 flowoperation="&nbsp";
  57.                                       }
  58.                                 message += "<tr style='line-height:22px;'><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+agname+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+attitude+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+pocesstime+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+flowoperation+"</td></tbody></tr>";
  59.                         } else {
  60.                                 
  61.                                 message += "<tr style='line-height:22px;'><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getAuditor()+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getAttitude()+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getActiontime()+"</td><td style='font-size:larger;font-family: Arial;border:solid #cccccc;border-width:0px 2px 2px 0px;'>"+relHis.getFlowOperation()+"</td></tbody></tr>";
  62.                         }
  63.                         
  64.                 }
  65. return message;
  66. }
复制代码
然后在表单使用计算脚本调用该函数,具体代码如下:
  1. #include "flowHis";//flowHis函数库名称
  2. testhis();
复制代码
前台显示效果:
a.gif

PS:这里流程历史记录流程操作为81的就表示是回退的操作。

本版积分规则

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

GMT+8, 2026-8-13 02:55

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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