common_workflow_zh-cn.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /**
  2. * 流程启动
  3. * @param id 业务id
  4. * @param tableName 表单名称
  5. * @param bpmType 流程类型
  6. * @param gridId 表格(列表grid)id
  7. * @param formUrl web端审核使用url地址(如果流程中节点配置url设置后,该参数可以传入空字符串)
  8. * @param mobileFormUrl 手机端审核url地址(如果流程中节点配置url设置后,该参数可以传入空字符串)
  9. */
  10. function startUserDefinedProcess(id,tableName,bpmType,gridId,formUrl,mobileFormUrl){
  11. if (typeof id == "undefined"||null ==id||'' ==id ) {
  12. $.messager.alert("error","传入参数错误",'error');
  13. return ;
  14. }
  15. if (typeof tableName == "undefined"||null ==tableName||'' ==tableName ) {
  16. $.messager.alert("error","传入参数错误",'error');
  17. return ;
  18. }
  19. if (typeof formUrl == "undefined"||null ==formUrl||'' ==formUrl ) {
  20. $.messager.alert("error","传入参数错误",'error');
  21. return ;
  22. }
  23. confirm('activitiController.do?startUserDefinedProcess&id='+id+'&tableName='+tableName+'&formUrl='+formUrl+'&formUrlMobile='+mobileFormUrl,'确定提交流程吗?',gridId);
  24. }
  25. /**
  26. * 流程重新启动
  27. * @param id 业务id
  28. * @param tableName 表单名称
  29. * @param bpmType 流程类型
  30. * @param gridId 表格(列表grid)id
  31. * @param formUrl web端审核使用url地址(如果流程中节点配置url设置后,该参数可以传入空字符串)
  32. * @param mobileFormUrl 手机端审核url地址(如果流程中节点配置url设置后,该参数可以传入空字符串)
  33. */
  34. function reStartUserDefinedProcess(id,tableName,bpmType,gridId,formUrl,mobileFormUrl){
  35. if (typeof id == "undefined"||null ==id||'' ==id ) {
  36. $.messager.alert("error","传入参数错误",'error');
  37. return ;
  38. }
  39. if (typeof tableName == "undefined"||null ==tableName||'' ==tableName ) {
  40. $.messager.alert("error","传入参数错误",'error');
  41. return ;
  42. }
  43. if (typeof formUrl == "undefined"||null ==formUrl||'' ==formUrl ) {
  44. $.messager.alert("error","传入参数错误",'error');
  45. return ;
  46. }
  47. confirm('activitiController.do?reStartUserDefinedProcess&id='+id+'&tableName='+tableName+'&formUrl='+formUrl+'&formUrlMobile='+mobileFormUrl,'确定提交流程吗?',gridId);
  48. }
  49. /**
  50. * 流程撤回
  51. * @param id 业务id
  52. * @param tableName 表单名称
  53. * @param processInstanceId 流程实例id
  54. * @param gridId 表格(列表grid)id
  55. */
  56. function retractProcess(id,tableName,processInstanceId,gridId){
  57. if (typeof id == "undefined"||null ==id||'' ==id ) {
  58. $.messager.alert("error","传入参数错误",'error');
  59. return ;
  60. }
  61. if (typeof tableName == "undefined"||null ==tableName||'' ==tableName ) {
  62. $.messager.alert("error","传入参数错误",'error');
  63. return ;
  64. }
  65. $.ajax({
  66. url : 'pubController.do?checkRetractable&procInstId='+ processInstanceId,
  67. type : 'POST',
  68. cache : false,
  69. success : function(data) {
  70. var d = data; // ------ $.parseJSON(data);
  71. if (d.success) {
  72. confirm('activitiController.do?retractProcess&id='+id+'&tableName='+tableName+'&processInstanceId='+processInstanceId,'确定撤回流程吗?',gridId);
  73. }else{
  74. tip(d.msg);
  75. try{
  76. reloadTable();
  77. }catch(e){
  78. }
  79. }
  80. }
  81. });
  82. }
  83. /**
  84. * 流程撤回
  85. * @param id 业务id
  86. * @param tableName 表单名称
  87. * @param processInstanceId 流程实例id
  88. * @param gridId 表格(列表grid)id
  89. */
  90. function retractProcess1(id,tableName,processInstanceId,gridId){
  91. if (typeof id == "undefined"||null ==id||'' ==id ) {
  92. $.messager.alert("error","传入参数错误",'error');
  93. return ;
  94. }
  95. if (typeof tableName == "undefined"||null ==tableName||'' ==tableName ) {
  96. $.messager.alert("error","传入参数错误",'error');
  97. return ;
  98. }
  99. confirm('activitiController.do?retractProcess&id='+id+'&tableName='+tableName+'&processInstanceId='+processInstanceId,'确定撤回流程吗?',gridId);
  100. }
  101. /**
  102. * 流程跟踪
  103. * @param id 业务id
  104. * @param processInstanceId 流程实例id
  105. */
  106. function processtracking(id,processInstanceId)
  107. {
  108. if (typeof id == "undefined"||null ==id||'' ==id ) {
  109. $.messager.alert("error","传入参数错误",'error');
  110. return ;
  111. }
  112. if (typeof processInstanceId == "undefined"||null ==processInstanceId||'' ==processInstanceId ) {
  113. $.messager.alert("error","传入参数错误",'error');
  114. return ;
  115. }
  116. openwindow('流程进度','activitiController.do?processTracking&businessKey='+ id+"&instId="+processInstanceId,gridname,800,600);
  117. }
  118. /**
  119. * 处理意见页面
  120. * @param title 窗口标题
  121. * @param width 宽度
  122. * @param height 高度
  123. * @param buttonTitle 按钮标题
  124. * @param taskId 业务id
  125. * @param nextNodeCount 下一节点数量
  126. * @param nextNodeId 下一节点id
  127. */
  128. function popWriteOption(title,width,height,buttonTitle,taskId,nextNodeCount,nextNodeId){
  129. $.dialog({
  130. content: 'url:activitiController.do?popDealOption'
  131. + "&title="+encodeURIComponent(buttonTitle)
  132. + "&taskId="+encodeURIComponent(taskId)
  133. + "&nextNodeCount="+encodeURIComponent(nextNodeCount)
  134. + "&nextNodeId="+encodeURIComponent(nextNodeId),
  135. lock : true,
  136. zIndex: getzIndex(),
  137. width:500,
  138. height:160,
  139. title:'处理意见',
  140. opacity : 0.3,
  141. cache:false
  142. });
  143. }
  144. /**
  145. * 流程流转(流程流转需要输入审核意见)
  146. * @param title 按钮标题
  147. * @param taskId 当前任务ID
  148. * @param nextNodeCount 下一步节点数
  149. * @param nextNodeId 下一步节点ID
  150. * @param dealOption 处理意见,如果参数没有传入空值即可
  151. */
  152. function dealProcFlow(title,taskId,nextNodeId,nextNodeCount,dealOption){
  153. var formData = {};
  154. formData["nextnode"]=nextNodeId;
  155. formData["nextNodeName"]=title;
  156. formData["operateType"]=title;
  157. formData["nextCodeCount"]=nextNodeCount;
  158. formData["taskId"]=taskId;
  159. formData["dealOption"]=dealOption;
  160. formData["model"]="1";
  161. {
  162. if(dealOption.trim()<1){
  163. layer.alert("请输入审核意见");
  164. //$.messager.alert("error",'請輸入審核意見','error');
  165. }
  166. disabledButton();
  167. //ajax方式提交iframe内的表单
  168. $.ajax({
  169. async : true,
  170. cache : false,
  171. type : 'POST',
  172. data : formData,
  173. url : 'activitiController.do?processComplete',// 请求的action路径
  174. error : function() {// 请求失败处理函数
  175. //$.messager.alert("error",'提交申请失败','error');
  176. layer.alert("提交申请失败");
  177. },
  178. success : function(data) {
  179. var d = data; // ------ $.parseJSON(data);
  180. var win = frameElement.api.opener;
  181. if (d.success) {
  182. frameElement.api.close();
  183. var msg = d.msg;
  184. try{
  185. win.callbackTable(msg);
  186. }catch(e){
  187. };
  188. }else{
  189. var msg = d.msg;
  190. $.messager.alert("error",msg,'error');
  191. }
  192. return true;
  193. }
  194. });
  195. }
  196. return true;
  197. }
  198. /**
  199. * 流程流转(流程流转不需要输入审核意见)
  200. * @param title 按钮标题
  201. * @param taskId 当前任务ID
  202. * @param nextNodeCount 下一步节点数
  203. * @param nextNodeId 下一步节点ID
  204. * @param isPop 是否是弹出页面办理方式
  205. */
  206. function dealProcFlowNoOption(title,taskId,nextNodeId,nextNodeCount,isPop){
  207. var formData = {};
  208. formData["nextnode"]=nextNodeId;
  209. formData["operateType"]=title;
  210. formData["nextCodeCount"]=nextNodeCount;
  211. formData["taskId"]=taskId;
  212. formData["nextNodeName"]=title;
  213. formData["model"]="1";
  214. $.ajax({
  215. async : false,
  216. cache : false,
  217. type : 'POST',
  218. data : formData,
  219. url : 'activitiController.do?processComplete',// 请求的action路径
  220. error : function() {// 请求失败处理函数
  221. $.messager.alert("error",'提交申请失败','error');
  222. },
  223. success : function(data) {
  224. var d = data; // ------ $.parseJSON(data);
  225. if (d.success) {
  226. var msg = d.msg;
  227. if(isPop){
  228. if (typeof window.parent.callbackTable != "undefined") {
  229. window.parent.callbackTable(msg);
  230. }
  231. }else{
  232. if (typeof callbackTable != "undefined") {
  233. callbackTable(msg);
  234. }
  235. }
  236. }else{
  237. var msg = d.msg;
  238. $.messager.alert("error",msg,'error');
  239. }
  240. }
  241. });
  242. }