mytaskList.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. <div class="easyui-layout" fit="true">
  10. <div region="center" style="padding:0px;border:0px">
  11. <t:datagrid name="projecttaskList" fitColumns="true" sortName="taskstatus,createDate" pageSize="30" sortOrder="asc,desc" checkbox="false" title="我的任务"
  12. actionUrl="projecttaskController.do?myTaskListDatagrid" idField="id" queryMode="group" >
  13. <t:dgCol title="主键" field="id" hidden="true" width="120"></t:dgCol>
  14. <t:dgCol title="标题" field="name" query="true" width="320"></t:dgCol>
  15. <t:dgCol title="流程名称" hidden="true" field="sourceid" dictionary="p_activiti_task,id,process_name" width="120"></t:dgCol>
  16. <t:dgCol title="任务发起人" field="createName" query="true" width="120"></t:dgCol>
  17. <t:dgCol title="开始时间" field="planstarttime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
  18. <t:dgCol title="截止时间" field="planendtime" formatter="yyyy-MM-dd" align="center" width="80"></t:dgCol>
  19. <t:dgCol title="执行状态" hidden="true" field="taskstatus" width="120" dictionary="taskstatus"></t:dgCol>
  20. <t:dgCol title="执行状态" field="stateWrittenWords" width="120" ></t:dgCol>
  21. <t:dgCol title="类型" field="tasktype" hidden="true" width="120"></t:dgCol>
  22. <t:dgCol title="" field="executeType" hidden="true" width="120"></t:dgCol>
  23. <t:dgCol title="" field="form" hidden="true" width="120"></t:dgCol>
  24. <t:dgCol title="工作类型" field="sourcetype" hidden="true" query="true" width="120" dictionary="tasksourcetype"></t:dgCol>
  25. <t:dgCol title="" field="sourceid" hidden="true" width="120"></t:dgCol>
  26. <t:dgCol title="" field="tasktype" hidden="true" width="120"></t:dgCol>
  27. <t:dgCol title="common.operation" field="opt"></t:dgCol>
  28. <t:dgFunOpt exp="taskstatus#eq#0,1" urlclass="ace_button" urlfont="fa-cog" funname="toDoTask()" title=" 办理" ></t:dgFunOpt>
  29. <t:dgFunOpt exp="sourcetype#eq#taskplan" urlclass="ace_button" urlfont="fa-file-text-o"
  30. funname="detail()" title=" 任务内容" ></t:dgFunOpt>
  31. <t:dgOpenOpt exp="taskstatus#eq#20" width="800" height="600" url="projecttaskController.do?goExeTaskView&load=detail&id={id}"
  32. urlclass="ace_button" urlfont="fa-check" title="查看结果"></t:dgOpenOpt>
  33. <t:dgFunOpt exp="tasktype#eq#pmdept" urlclass="ace_button" urlfont="fa-file-text-o"
  34. funname="downloadAttr(id)" title=" 下载附件" ></t:dgFunOpt>
  35. <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-file-text-o"
  36. funname="viewActivitiTask(sourceid,sourcetype,tasktype)" title=" 签报内容" ></t:dgFunOpt>
  37. <t:dgFunOpt exp="sourcetype#eq#activititask" urlclass="ace_button" urlfont="fa-commenting-o"
  38. funname="startus(sourceid,sourcetype,tasktype)" title=" 查看流程" ></t:dgFunOpt>
  39. <%-- <t:dgToolBar title="任务清单" icon="icon-search" url="#" funname="none" ></t:dgToolBar> --%>
  40. </t:datagrid>
  41. </div>
  42. </div>
  43. <span style="display:-moz-inline-box;display:inline-block;" id="entryNameSearch">
  44. <span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;width: 90px;text-align:right;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap; " title="执行状态">执行状态:</span>
  45. <select id="taskstatus" name="taskstatus">
  46. <option value="">---请选择---</option>
  47. <option value="1">未完成</option>
  48. <option value="20">已完成</option>
  49. <option value="30">逾期未完成</option>
  50. <option value="40">逾期已完成</option>
  51. </select>
  52. </span>
  53. <script type="text/javascript">
  54. var _gridId='projecttaskList';
  55. $(document).ready(function(){
  56. $('#projecttaskListForm').append($('#entryNameSearch'));
  57. //给时间控件加上样式
  58. $(":input[name='createName']").css("width","150px");
  59. $(":input[name='createName']").css("margin","5px");
  60. $("select[name='taskstatus']").css("width","150px");
  61. $("select[name='taskstatus']").css("margin","5px");
  62. $("select[name='sourcetype']").css("width","150px");
  63. $("select[name='sourcetype']").css("margin","5px");
  64. });
  65. function closeTask(id){
  66. }
  67. function detail( index){
  68. var row = $('#projecttaskList').datagrid('getRows')[index];
  69. var id = row.id;
  70. var url ='projecttaskController.do?goUpdate';
  71. var title = '任务内容';
  72. // var rowsData = $('#'+id).datagrid('getSelections');
  73. // if (rowData.id == '') {
  74. // tip('请选择查看项目');
  75. // return;
  76. // }
  77. /* if (!rowsData || rowsData.length == 0) {
  78. tip('请选择查看项目');
  79. return;
  80. }
  81. if (rowsData.length > 1) {
  82. tip('请选择一条记录再查看');
  83. return;
  84. } */
  85. url += '&load=detail&id='+id;
  86. createdetailwindow(title,url,'800px','700px');
  87. }
  88. //导入
  89. function ImportXls() {
  90. openuploadwin('Excel导入', 'projecttaskController.do?upload', "projecttaskList");
  91. }
  92. //导出
  93. function ExportXls() {
  94. JeecgExcelExport("projecttaskController.do?exportXls","projecttaskList");
  95. }
  96. //模板下载
  97. function ExportXlsByT() {
  98. JeecgExcelExport("projecttaskController.do?exportXlsByT","projecttaskList");
  99. }
  100. function toDoTask(index){
  101. // id,name,executeType,form
  102. var row = $('#projecttaskList').datagrid('getRows')[index];
  103. var id = row.id;
  104. var name = row.name;
  105. var executeType = row.executeType;
  106. var form = row.form;
  107. // var width = window.top.document.body.offsetWidth - 300;
  108. /* var windowHeight = window.top.document.body.offsetHeight-100; */
  109. var url = "projecttaskController.do?doExeTask&id="+id;
  110. var width = "820";
  111. var height = "550";
  112. $.ajax({
  113. async : false,
  114. cache : false,
  115. type : 'POST',
  116. url : url,// 请求的action路径
  117. error : function() {// 请求失败处理函数
  118. },
  119. success : function(data) {
  120. var d = data; // ------ $.parseJSON(data);
  121. if (d.success) {
  122. //form == ’‘,则说明此任务不是执行流中的任务
  123. if(form == '' || executeType=='offline'){
  124. var tasktype = d.obj.tasktype;
  125. if(tasktype == 'maintainbill')
  126. height = 660;
  127. var viewurl = "projecttaskController.do?goExeTaskView&id="+id;
  128. mycreatewindow('完成工作: ' + name,viewurl, width,height);
  129. }else{
  130. $.dialog({
  131. content: 'url:'+form,
  132. title : '完成工作: ' + name,
  133. lock : true,
  134. zIndex: getzIndex(),
  135. opacity : 0.3,
  136. width: width,
  137. height: height,
  138. ok:function(){
  139. var done =true;
  140. $.ajax(
  141. {
  142. url:'projecttaskController.do?checkResult'
  143. ,async:false
  144. ,type:'POST'
  145. ,dataType:'json'
  146. ,data:{
  147. id:id
  148. }
  149. ,success:function(d){
  150. done = d.done;
  151. if(done){
  152. $.post('projecttaskController.do?finishTask',{id:id},function(){
  153. reloadTable('projecttaskList');
  154. })
  155. }else {
  156. top.layer.alert(d.reason);
  157. }
  158. }
  159. ,error:function(d){
  160. }
  161. }
  162. )
  163. return done;
  164. }
  165. // ,okVal:'完成任务'
  166. ,cancel: function(){
  167. }
  168. });
  169. }
  170. } else {
  171. layer.alert(d.msg)
  172. }
  173. }
  174. });
  175. }
  176. //查看签报
  177. function viewActivitiTask(sourceid,sourcetype,tasktype) {
  178. /* var title='查看签报';
  179. var url = '${webBasePath}/tBusActivitiGreenController.do?goView&id='+sourceid;
  180. createdetailwindow(title, url,800,400);
  181. */
  182. $.ajax(
  183. {
  184. url : 'projecttaskController.do?findProcInstId'// 请求的action路径
  185. ,async:false
  186. ,type:'POST'
  187. ,dataType:'json'
  188. ,data:{
  189. sourceid:sourceid,
  190. tasktype:tasktype
  191. }
  192. ,success:function(d){
  193. if(d.success){
  194. goProcessHisTab(d.obj);
  195. }else {
  196. top.layer.alert(d.msg);
  197. }
  198. }
  199. ,error:function(d){
  200. }
  201. }
  202. );
  203. }
  204. //查看流程
  205. function startus(sourceid,sourcetype,tasktype ){
  206. $.ajax(
  207. {
  208. url : 'projecttaskController.do?findProcInstId'// 请求的action路径
  209. ,async:false
  210. ,type:'POST'
  211. ,dataType:'json'
  212. ,data:{
  213. sourceid:sourceid,
  214. tasktype:tasktype
  215. }
  216. ,success:function(d){
  217. if(d.success){
  218. processtracking(sourceid,d.obj);
  219. }else {
  220. top.layer.alert(d.msg);
  221. }
  222. }
  223. ,error:function(d){
  224. }
  225. }
  226. );
  227. }
  228. function none(){}
  229. function a (iframe){
  230. var memo = iframe.$('#memo').val();
  231. var completePer = iframe.$('#completePer').val();
  232. if(memo == ""){
  233. iframe.tip("请输入工作执行说明");
  234. return false;
  235. }
  236. if(completePer == ""){
  237. iframe.tip("请输入工作进度");
  238. return false;
  239. }else{
  240. var result = completePer.match(/^[0-9]*$/);
  241. if(result == null){
  242. iframe.tip("请输入正确的工作进度");
  243. return false;
  244. }
  245. if(parseInt(completePer) > 100){
  246. iframe.tip("请输入正确的工作进度范围0--100");
  247. return false;
  248. }
  249. }
  250. return true;
  251. }
  252. function mycreatewindow(title, addurl,width,height) {
  253. width = width?width:800;
  254. height = height?height:500;
  255. if(width=="100%" ){
  256. width = window.top.document.body.offsetWidth;
  257. }
  258. if( height=="100%"){
  259. height =window.top.document.body.offsetHeight-100;
  260. }
  261. //--author:JueYue---------date:20140427---------for:弹出bug修改,设置了zindex()函数
  262. if(typeof(windowapi) == 'undefined'){
  263. $.dialog({
  264. content: 'url:'+addurl,
  265. lock : true,
  266. zIndex: getzIndex(),
  267. width:width,
  268. height:height,
  269. title:title,
  270. opacity : 0.3,
  271. cache:false,
  272. okVal:'提交',
  273. ok: function(){
  274. iframe = this.iframe.contentWindow;
  275. var result = a(iframe);
  276. if(result){
  277. saveObj();
  278. tip('提交成功');
  279. reloadTable('projecttaskList');
  280. }else{
  281. return false;
  282. }
  283. },
  284. cancelVal: '关闭',
  285. cancel: function(){
  286. }, /*为true等价于function(){}*/
  287. button: [
  288. {
  289. name: '暂存',
  290. callback: function(){
  291. iframe = this.iframe.contentWindow;
  292. var result = a(iframe);
  293. if(result){
  294. $('#formobj', iframe.document).form('submit', {
  295. url : 'taskResultController.do?doUpdate&temp=1',
  296. onSubmit : function() {
  297. //iframe.editor.sync();
  298. },
  299. success : function(r) {
  300. //iframe.api.opener.refresh();
  301. iframe.closeCurrentDialog();
  302. tip('暂存成功');
  303. reloadTable('projecttaskList');
  304. return false;
  305. }
  306. });
  307. }
  308. return false;
  309. },
  310. class:"ui_state_highlight",
  311. focus: true
  312. }
  313. ]
  314. });
  315. }
  316. }
  317. function downloadAttr(id){
  318. var url = "projecttaskController.do?downloadAttrByTask&taskid="+id;
  319. layer.msg('数据导出中,请稍候···', {
  320. time : 6000,
  321. shade: 0.1});
  322. window.location.href = url;
  323. }
  324. </script>