user-task.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <style>
  4. .ui_buttons{
  5. text-align: center !important;
  6. }
  7. </style>
  8. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  9. <script src = "plug-in/tools/jquery.tips.js"></script>
  10. <c:if test="${param.filter==1}">
  11. <c:set var="filterName">-急待处理</c:set>
  12. </c:if>
  13. <c:if test="${param.filter==2}">
  14. <c:set var="filterName">-逾期</c:set>
  15. </c:if>
  16. <div class="easyui-layout" fit="true">
  17. <div region="center" style="padding:0px;border:0px">
  18. <t:datagrid name="projecttaskList" fitColumns="true" sortName="createDate" sortOrder="desc" checkbox="false" title="我的任务${filterName}"
  19. actionUrl="projecttaskController.do?userTaskDatagrid&filter=${param.filter}" idField="id" queryMode="group" onLoadSuccess="onloaded">
  20. <t:dgCol title="主键" field="id" hidden="true" width="120"></t:dgCol>
  21. <t:dgCol title="标题" field="name" width="320"></t:dgCol>
  22. <t:dgCol title="详情" field="description" width="200"></t:dgCol>
  23. <t:dgCol title="流程名称" hidden="true" field="sourceid" dictionary="p_activiti_task,id,process_name" width="120"></t:dgCol>
  24. <t:dgCol title="任务发起人" field="createName" width="120"></t:dgCol>
  25. <t:dgCol title="开始时间" field="planstarttime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
  26. <t:dgCol title="截止时间" field="planendtime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
  27. <t:dgCol title="状态" field="taskstatus" width="120" dictionary="taskstatus"></t:dgCol>
  28. <t:dgCol title="类型" field="tasktype" hidden="true" width="120"></t:dgCol>
  29. <t:dgCol title="" field="executeType" hidden="true" width="120"></t:dgCol>
  30. <t:dgCol title="" field="form" hidden="true" width="120"></t:dgCol>
  31. <t:dgCol title="工作类型" field="sourcetype" hidden="true" width="120" dictionary="tasksourcetype"></t:dgCol>
  32. <t:dgCol title="" field="sourceid" hidden="true" width="120"></t:dgCol>
  33. <t:dgCol title="" field="tasktype" hidden="true" width="120"></t:dgCol>
  34. <t:dgToolBar title="查看" icon="icon-search" url="projecttaskController.do?goUpdate" funname="detail" height="500"></t:dgToolBar>
  35. <t:dgCol title="common.operation" field="opt"></t:dgCol>
  36. <t:dgFunOpt exp="taskstatus#eq#0,1" urlclass="ace_button" urlfont="fa-cog" funname="toDoTask(id,name,executeType,form)" title=" 办理" ></t:dgFunOpt>
  37. <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-file-text-o"
  38. funname="viewActivitiTask(sourceid,sourcetype,tasktype)" title=" 签报内容" urlStyle="background-color:#5c7a29" ></t:dgFunOpt>
  39. <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-commenting-o"
  40. funname="startus(sourceid,sourcetype,tasktype)" title=" 查看流程" urlStyle="background-color:#007947" ></t:dgFunOpt>
  41. </t:datagrid>
  42. </div>
  43. </div>
  44. <script type="text/javascript">
  45. $(document).ready(function(){
  46. });
  47. function onloaded(){
  48. var _grid = $('#projecttaskList');
  49. var tableTd = $('div.datagrid-body td[field="description"]');
  50. tableTd.each(function () {
  51. var $this = $(this);
  52. var index = $this.parent('tr').attr('datagrid-row-index');
  53. var rows = _grid.datagrid('getRows');
  54. var currentRow = rows[index];
  55. var content = '<div style="font-size:16px; max-width:350px;word-break: break-all; word-wrap: break-word;">' + currentRow.description + '</div>';
  56. $this.tips({ content: content, wrapColor: 'black' });
  57. });
  58. }
  59. function closeTask(id){
  60. }
  61. function detail(title,url, id){
  62. var rowsData = $('#'+id).datagrid('getSelections');
  63. // if (rowData.id == '') {
  64. // tip('请选择查看项目');
  65. // return;
  66. // }
  67. if (!rowsData || rowsData.length == 0) {
  68. tip('请选择查看项目');
  69. return;
  70. }
  71. if (rowsData.length > 1) {
  72. tip('请选择一条记录再查看');
  73. return;
  74. }
  75. url += '&load=detail&id='+rowsData[0].id;
  76. createdetailwindow(title,url,'800px','700px');
  77. }
  78. //导入
  79. function ImportXls() {
  80. openuploadwin('Excel导入', 'projecttaskController.do?upload', "projecttaskList");
  81. }
  82. //导出
  83. function ExportXls() {
  84. JeecgExcelExport("projecttaskController.do?exportXls","projecttaskList");
  85. }
  86. //模板下载
  87. function ExportXlsByT() {
  88. JeecgExcelExport("projecttaskController.do?exportXlsByT","projecttaskList");
  89. }
  90. function toDoTask(id,name,executeType,form){
  91. // var width = window.top.document.body.offsetWidth - 300;
  92. /* var windowHeight = window.top.document.body.offsetHeight-100; */
  93. var url = "projecttaskController.do?doExeTask&id="+id;
  94. var width = "850";
  95. var height = "500";
  96. $.ajax({
  97. async : false,
  98. cache : false,
  99. type : 'POST',
  100. url : url,// 请求的action路径
  101. error : function() {// 请求失败处理函数
  102. },
  103. success : function(data) {
  104. var d = data; // ------ $.parseJSON(data);
  105. if (d.success) {
  106. //form == ’‘,则说明此任务不是执行流中的任务
  107. if(form == '' || executeType=='offline'){
  108. var tasktype = d.obj.tasktype;
  109. if(tasktype == 'maintainbill')
  110. height = 660;
  111. var viewurl = "projecttaskController.do?goExeTaskView&id="+id;
  112. // createwindow('完成工作: ' + name,viewurl, width,height);
  113. $.dialog({
  114. content: 'url:'+viewurl,
  115. title : '完成工作: ' + name,
  116. lock : true,
  117. zIndex: getzIndex(),
  118. opacity : 0.3,
  119. width: width,
  120. height: height,
  121. ok:function(){
  122. iframe = this.iframe.contentWindow;
  123. saveObj();
  124. return false;
  125. }
  126. // ,okVal:'完成任务'
  127. ,cancel: function(){
  128. },
  129. button: [
  130. {
  131. name: '暂存',
  132. callback: function(){
  133. iframe = this.iframe.contentWindow;
  134. $('#formobj', iframe.document).form('submit', {
  135. url : 'taskResultController.do?doUpdate&finished=0',
  136. onSubmit : function() {
  137. //iframe.editor.sync();
  138. },
  139. success : function(r) {
  140. //iframe.api.opener.refresh();
  141. iframe.closeCurrentDialog();
  142. tip('暂存成功');
  143. reloadTable('projecttaskList');
  144. return false;
  145. }
  146. });
  147. // saveObj();
  148. return false;
  149. },
  150. class:"ui_state_highlight",
  151. focus: true
  152. }
  153. ]
  154. });
  155. }else{
  156. $.dialog({
  157. content: 'url:'+form,
  158. title : '完成工作: ' + name,
  159. lock : true,
  160. zIndex: getzIndex(),
  161. opacity : 0.3,
  162. width: width,
  163. height: height,
  164. ok:function(){
  165. var done =true;
  166. $.ajax(
  167. {
  168. url:'projecttaskController.do?checkResult'
  169. ,async:false
  170. ,type:'POST'
  171. ,dataType:'json'
  172. ,data:{
  173. id:id
  174. }
  175. ,success:function(d){
  176. done = d.done;
  177. if(done){
  178. $.post('projecttaskController.do?finishTask',{id:id},function(){
  179. reloadTable('projecttaskList');
  180. })
  181. }else {
  182. top.layer.alert(d.reason);
  183. }
  184. }
  185. ,error:function(d){
  186. }
  187. }
  188. )
  189. return done;
  190. }
  191. // ,okVal:'完成任务'
  192. ,cancel: function(){
  193. }
  194. });
  195. }
  196. } else {
  197. layer.alert(d.msg)
  198. }
  199. }
  200. });
  201. }
  202. //查看签报
  203. function viewActivitiTask(sourceid,sourcetype,tasktype) {
  204. /* var title='查看签报';
  205. var url = '${webBasePath}/tBusActivitiGreenController.do?goView&id='+sourceid;
  206. createdetailwindow(title, url,800,400);
  207. */
  208. $.ajax(
  209. {
  210. url : 'projecttaskController.do?findProcInstId'// 请求的action路径
  211. ,async:false
  212. ,type:'POST'
  213. ,dataType:'json'
  214. ,data:{
  215. sourceid:sourceid,
  216. tasktype:tasktype
  217. }
  218. ,success:function(d){
  219. if(d.success){
  220. goProcessHisTab(d.obj);
  221. }else {
  222. top.layer.alert(d.msg);
  223. }
  224. }
  225. ,error:function(d){
  226. }
  227. }
  228. );
  229. }
  230. //查看流程
  231. function startus(sourceid,sourcetype,tasktype ){
  232. $.ajax(
  233. {
  234. url : 'projecttaskController.do?findProcInstId'// 请求的action路径
  235. ,async:false
  236. ,type:'POST'
  237. ,dataType:'json'
  238. ,data:{
  239. sourceid:sourceid,
  240. tasktype:tasktype
  241. }
  242. ,success:function(d){
  243. if(d.success){
  244. processtracking(sourceid,d.obj);
  245. }else {
  246. top.layer.alert(d.msg);
  247. }
  248. }
  249. ,error:function(d){
  250. }
  251. }
  252. );
  253. }
  254. function none(){}
  255. </script>