1.布局全部弄好显示
2.给首布局添加明细有数据则显示的jq控制
$(function () { $("#oTable40282aa187314b1d0187318ac6a9000d").hide(); //部门负责人子议题审议没有历史隐藏 var firstblerows = $("#oTable40282aa183c61c840183ee5d7e971ab1").find("tr").length; if (firstblerows>2) { $("#oTable40282aa183c61c840183ee5d7e971ab1").show(); }else { $("#oTable40282aa183c61c840183ee5d7e971ab1").hide(); } //法务子议题审议没有历史隐藏 var towblerows = $("#oTable40282aa187c723b00187ef187dcb5308").find("tr").length; if (towblerows>2) { $("#oTable40282aa187c723b00187ef187dcb5308").show(); }else { $("#oTable40282aa187c723b00187ef187dcb5308").hide(); } //风控子议题审议没有历史隐藏 var threeblerows = $("#oTable40282aa187c723b00187ef1dfb18531e").find("tr").length; if (threeblerows>2) { $("#oTable40282aa187c723b00187ef1dfb18531e").show(); }else { $("#oTable40282aa187c723b00187ef1dfb18531e").hide(); } })
3.驳回到首节点,后处理给下个审批人的明细添加数据,给历史数据添加状态为1,布局中明细根据状态1给对应标签添加disabled=true,然后因为提交表单disabled是不会返回数据到后端的,
所以需要在提交事件把disabled移除掉。
3.1驳回到首节点,后处理给下个审批人的明细添加数据,给历史数据添加状态为1
//当前工作流包含表单是抽象表单 //三会议题审批表 ID:40282aa183c61c840183edef01fc1a23 // 申请人: creator // 申请日期: createdate // 项目名称: projectid // 流程编号: wfno // 项目负责人: projectmgr // 被投企业名称: invcompany // 申请主题: subject // 会议类型: mettype // 会议时间: metdate // 通知时间: noticedate // 会议召开方式: metform // 我方参会人: attendee // 线下会议地点: metplace // 表决情况: voting // 申请概述: remarks // 会议决议: metfile // 决议日期: resultdate // 会议资料: metmaterials //议题情况 ID:40282aa183c61c840183ee588c871aa2 // 议题: subject // 内容说明: content // 项目组意见: proteam // 分析说明: remarks //子议题审议 ID:40282aa183c61c840183ee5d7e971ab1 // 审议人: reviewer // 议题: subject // 审议结论: result // 意见: remarks //--------------------------------------- package com.velcro.workflow.extclass; /** * 流程预后处理类 */ // 引入所需要的包 import java.util.Map; import java.util.List; import com.velcro.base.IDGernerator; import com.velcro.workflow.AbstractWorkflowService; import com.velcro.workflow.pipe.service.ExtendJspService; import com.velcro.base.util.*; import com.velcro.kernel.base.IDataService; import org.apache.ecs.html.S; public class SHwf017 extends AbstractWorkflowService {// 类名由用户自定义,必需与上后处理Class的名称相同 public void doExtWorkflow(Map wfparameters) { // 在此处编写用户自定义实现, // 以下面这种方式获取相关Service ExtendJspService extendJspService=(ExtendJspService)super.getObjectService("extendJspService"); IDataService dataService = (IDataService)super.getObjectService("dataService"); // 以下面这种方式获取相关属性值 String workflowid = (String)wfparameters.get("workflowid"); String formid="40282aa183c61c840183edef01fc1a23"; //全局通用 String creator="";//创建人 String field001="";//部门负责人 String field002="";//法务负责人 String field003="";//风控负责人 List list=extendJspService.getFormfieldsValues(formid,workflowid); //用一个循环读取每一行的记录 for(int i=0;i<list.size();i++){ //map中的key为表单的字段名,value为该字段的值 Map map=(Map)list.get(i); //读取字段值,fieldName为表单中的字段名称,fieldValue为取出的值 String fieldValue=(String)map.get("fieldName"); creator=StringHelper.null2String(map.get("creator"));//创建人 field001=StringHelper.null2String(map.get("field001"));//部门负责人 field002=StringHelper.null2String(map.get("field002"));//法务负责人 field003=StringHelper.null2String(map.get("field003"));//风控负责人 //流程编号 String workflowno=dataService.getValue("select workflowno from workflowbase where id='"+workflowid+"'"); String updateSql="update ufl9o1a61666144177775 set wfno='"+StringHelper.null2String(workflowno)+"' where requestid='"+workflowid+"'"; dataService.executeSql(updateSql); } //退回则相关流程中的子议题审议明细中的状态为1 //部门负责人子议题审议 dataService.executeSql("update ufu2j2l41666151426702 set stated='1' where REQUESTID='"+workflowid+"'"); //法务子议题审议 dataService.executeSql("update ufi8k1a11683343521396 set stated='1' where REQUESTID='"+workflowid+"'"); //部门负责人子议题审议 dataService.executeSql("update ufg4f1a21683343909179 set stated='1' where REQUESTID='"+workflowid+"'"); //议题情况中议题插入子议题审议 String formid1="40282aa183c61c840183ee588c871aa2";//议题情况 List list1=extendJspService.getFormfieldsValues(formid1,workflowid); //用一个循环读取每一行的记录 for(int i=0;i<list1.size();i++) { //map中的key为表单的字段名,value为该字段的值 Map map = (Map) list1.get(i); //读取字段值,fieldName为表单中的字段名称,fieldValue为取出的值 String deptPerson= field001; //部门负责人 String legalPerson=field002; //法务负责人 String riskPerson=field003; //风控负责人 String subject=StringHelper.null2String(map.get("subject"));//议题 //插入人员到子议题审议明细中 //部门负责人 String nodeid=dataService.getValue("select NODEID from ufl9o1a61666144177775 where REQUESTID='"+workflowid+"'"); if (StringHelper.isNotEmpty(deptPerson)){ String getId = IDGernerator.getUnquieID(); int history1 = Integer.parseInt(dataService.getValue("select count(*) from ufu2j2l41666151426702 where REQUESTID='" + workflowid + "'")); int depcount=history1+1; String insertSql = "insert into ufu2j2l41666151426702(id,REQUESTID,NODEID,DSPORDER,reviewer,subject,creator,field001) values('"+getId+"','" + workflowid + "','" + nodeid + "',"+depcount+",'" + deptPerson + "','"+subject+"','"+creator+"','dept')"; dataService.executeSql(insertSql); } } } public void undoExtWorkflow(Map wfparameters) { } }
3.2布局中明细根据状态1给对应标签添加disabled=true,然后因为提交表单disabled是不会返回数据到后端的,所以需要在提交事件把disabled移除掉
<script type=text/javascript> $(function () { var p1=$("#field_40282aa187314b1d01873198ea29002d").val(); if(p1=='40288110301fdb1601301fedb6080096'){//是 $("#oTable40282aa187314b1d0187318ac6a9000d").show(); }else { $("#oTable40282aa187314b1d0187318ac6a9000d").hide(); } //部门负责人子议题审议历史不能编辑 var firstblerows = $("#oTable40282aa183c61c840183ee5d7e971ab1").find("tr").length var firstdetailid= "#detailid_40282aa183c61c840183ee5d7e971ab1_"; var firstjl="#field_40282aa183c61c840183ee60ba311aba_";//审议结论 var firstyj="#field_40282aa183c61c840183ee61874a1abd_";//意见 for (var i=0;i<firstblerows-1;i++){ //明细id var fdetailid=$(firstdetailid+i).val(); var detailstate=SQL("select stated from ufu2j2l41666151426702 where id='"+fdetailid+"' and requestid in(select id from workflowbase where isdelete=0)"); if (detailstate==1) { $(firstjl+i).attr("disabled","true"); $(firstyj+i).attr("disabled","true"); } } }) function onSubmitPlus(issave) { if (issave != 0) { return true; } //部门负责人子议题审议历史不能编辑 var firstblerows = $("#oTable40282aa183c61c840183ee5d7e971ab1").find("tr").length var firstdetailid = "#detailid_40282aa183c61c840183ee5d7e971ab1_"; var firstjl = "#field_40282aa183c61c840183ee60ba311aba_";//审议结论 var firstyj = "#field_40282aa183c61c840183ee61874a1abd_";//意见 for (var i = 0; i < firstblerows - 1; i++) { //明细id var fdetailid = $(firstdetailid + i).val(); var detailstate = SQL("select stated from ufu2j2l41666151426702 where id='" + fdetailid + "' and requestid in(select id from workflowbase where isdelete=0)"); if (detailstate == 1) { $(firstjl + i)[0].removeAttribute("disabled"); $(firstyj + i)[0].removeAttribute("disabled"); } } return true; } </SCRIPT>
标签:String,明细表,disabled,velcro,var,import,历史数据,com,驳回 From: https://www.cnblogs.com/jk200/p/17414176.html