activitiButtons.jsp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <t:dgFunOpt exp="bpmStatus#eq#1${not empty activitiButtonShowExp?activitiButtonShowExp:''}" urlclass="ace_button" urlfont="fa-cog" funname="startUserDefinedProcess(id,bpmStatus,applicantId)" title="提交流程" />
  3. <t:dgFunOpt exp="bpmStatus#ne#1${not empty activitiButtonShowExp?activitiButtonShowExp:''}" urlclass="ace_button" urlfont="fa-cog" funname="startus(id,procInstId)" title="查看流程" />
  4. <t:dgFunOpt exp="bpmStatus#eq#2${not empty activitiButtonShowExp?activitiButtonShowExp:''}" urlclass="ace_button" urlStyle="background-color:#FF6347" urlfont="fa-exchange"
  5. funname="startusr(id,procInstId,bpmStatus,processObject,handlerPersonId)" title="撤回流程" />
  6. <script src="webpage/cn/com/lzt/useractiviti/select_user_tools.js?v=1"></script>
  7. <script>
  8. //启动流程
  9. function startUserDefinedProcess(id,bpmStatus,applicantId,tableName,formUrl){
  10. if(bpmStatus == 2){
  11. layer.alert('<t:mutiLang langKey="申请处理中不可再次提交流程"/>');
  12. return;
  13. }else if(bpmStatus == 3){
  14. layer.alert('<t:mutiLang langKey="申请已完成不可再次提交流程"/>');
  15. return;
  16. }
  17. confirm('activitiController.do?startUserDefinedProcess&id='+id+'&tableName='+_tableName+'&formUrl='+_formUrl,'确定提交流程吗?',_gridId);
  18. }
  19. //撤销流程
  20. function startusr(id,usid,processObject,iamApplyUser,applicantId){
  21. /* if(processObject != null){
  22. retractProcess1(id,_tableName,usid,_gridId);
  23. return;
  24. }*/
  25. //业务表名
  26. retractProcess(id,_tableName,usid,_gridId);
  27. }
  28. //查看流程
  29. function startus(id,usid){
  30. processtracking(id,usid);
  31. }
  32. //新增
  33. function add(title,addurl,gname,width,height) {
  34. gridname=gname;
  35. if(typeof (_selectDepBeforeAdd)!='undefined' &&_selectDepBeforeAdd ==true){
  36. $.post('userActivitiDataController.do?depSelectDatagrid',{'field':'id,departName,finCode'},function(d){
  37. if(d.rows.length>1){
  38. selectUserDep("选择所属部门",function(selectedRows){
  39. var one = selectedRows[0];
  40. _openAddUrl(one);
  41. });
  42. }else {
  43. var one = d.rows[0];
  44. _openAddUrl(one);
  45. }
  46. });
  47. }else if(typeof (_selectDep4HR)!='undefined' &&_selectDep4HR ==true){
  48. $.post('userActivitiDataController.do?isHr',{},function(d){
  49. if(d.obj==true){//人事
  50. selectAllDep("选择所属部门",function(selectedRows){
  51. var one = selectedRows[0];
  52. _openAddUrl(one);
  53. });
  54. }else{
  55. $.post('userActivitiDataController.do?depSelectDatagrid',{'field':'id,departName,finCode'},function(d){
  56. if(d.rows.length>1){
  57. selectUserDep("选择所属部门",function(selectedRows){
  58. var one = selectedRows[0];
  59. _openAddUrl(one);
  60. });
  61. }else {
  62. var one = d.rows[0];
  63. _openAddUrl(one);
  64. }
  65. });
  66. }
  67. },'json');
  68. }else{
  69. createwindow(title, addurl,width,height);
  70. }
  71. function _openAddUrl(row){
  72. var depId = row.id;
  73. var depName = row.departName;
  74. var finCode = row.finCode;
  75. addurl +='&departId='+depId+"&depName="+encodeURI(depName)+"&finCode="+encodeURI(finCode);
  76. createwindow(title, addurl,width,height);
  77. }
  78. }
  79. function detail(title,url,id,width,height){
  80. var rowsData = $('#'+id).datagrid('getSelections');
  81. if (!rowsData || rowsData.length == 0) {
  82. tip('请选择查看项目');
  83. return;
  84. }
  85. if (rowsData.length > 1) {
  86. tip('请选择一条记录再查看');
  87. return;
  88. }
  89. url += '&load=detail&id='+rowsData[0].id;
  90. createdetailwindow(title,url,width,height);
  91. }
  92. function update(title,url, id,width,height){
  93. gridname=id;
  94. var rowsData = $('#'+id).datagrid('getSelections');
  95. if (!rowsData || rowsData.length==0) {
  96. tip('请选择编辑项目');
  97. return;
  98. }
  99. if (rowsData.length>1) {
  100. tip('请选择一条记录再编辑');
  101. return;
  102. }
  103. if(rowsData[0].bpmStatus == 2){
  104. tip('<t:mutiLang langKey="申请处理中不可编辑"/>');
  105. return;
  106. }else if(rowsData[0].bpmStatus == 3){
  107. tip('<t:mutiLang langKey="申请已完成不可编辑"/>');
  108. return;
  109. }
  110. url +="&id="+rowsData[0].id;
  111. /*if(!width){
  112. width='100%';
  113. }
  114. if(!height){
  115. height='100%';
  116. }*/
  117. createwindow(title,url, width,height);
  118. // updateNotCreateWin("修改",url, gridname,false);
  119. // window.location.href=url
  120. }
  121. function exportPdf(procInstId){
  122. var url=_controller+'exportPdf&procInstId='+procInstId;
  123. // $.post(url,{id:id},function(){});
  124. location =url;
  125. }
  126. </script>