task_manager.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <%@ taglib prefix="tms" uri="http://fzywtx.com/jsp/yw/tms" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>任务列表</title>
  9. <link href="/shares/js/yw/master1/liger/skins/ynet/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  12. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  13. <script src="/shares/jquery.progressbar/js/jquery.progressbar.js" type="text/javascript"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript" src="/shares/js/constant.js"></script>
  16. <script type="text/javascript" src="/shares/js/yw/master1/page.js"></script>
  17. <script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
  18. <script type="text/javascript" src="/shares/js/yw/master1/searchBox.js"></script>
  19. <script type="text/javascript" src="/shares/js/yw/ytpm/task/pm_common.js"></script>
  20. <script type="text/javascript">
  21. $(function(){
  22. search("mtTaskMgr.do?task=taskMgrpageInfo&project_id=${project_id}");
  23. });
  24. function search(url,s){
  25. var p = $("#p").val();
  26. var pSize = $("#pSize").val();
  27. var param={"p":p,"pSize":pSize};
  28. sendAsyncAjax(param, url+"&time="+ new Date().getTime()+s, "json", function(data) {
  29. var num = data.Total;
  30. page(num,pSize,p);
  31. var datas = data.Rows;
  32. var item_name = $('#contentDiv');
  33. $(item_name).empty();//初始化table,清空table
  34. var html = '';
  35. if(datas.length == 0){
  36. html = notquery();
  37. }else{
  38. var j=0;
  39. for (var i = 0; i < datas.length; i++){
  40. var arr = datas[i];
  41. var bdiv = 1;
  42. bdiv = 1 + j;
  43. if (j < 7) {
  44. j++
  45. } else {
  46. j = 0;
  47. }
  48. html+= '<div class="tr_cont_new mar4 f5_new">';
  49. html+= '<a href="#" onclick="viewtask('+arr.universalid+')">';
  50. html+= '<div class="wdrw_tiao_new bn'+bdiv+' fl"></div>';
  51. html += '<div class="tr_rw_d_new fl">';
  52. html+= '<p><img src="/shares/images/master1/rw_ico_menu.png" width="17" height="15" />';
  53. if(arr.lose_flag==1){
  54. html+='[已派发(<font color="red">'+arr.task_state_name+'</font>)]&nbsp;&nbsp;';
  55. }else{
  56. html+='[未派发]&nbsp;&nbsp;';
  57. }
  58. html+='[责任人:'+ arr.responsible_name+']';
  59. html+='&nbsp;&nbsp;[任务名称:'+ arr.task_name+']';
  60. html+='</p>';
  61. html+='<p class=\'mar5\'>';
  62. html+='[任务进度:'+arr.finish_percent+'%]&nbsp;&nbsp;[任务积分:'+arr.plan_hour+']&nbsp;&nbsp;计划开始时间:'+arr. plan_start_date+',&nbsp;&nbsp;计划结束时间:'+arr.plan_end_date+'&nbsp;&nbsp;';
  63. html+='</p>';
  64. html+='</a>';
  65. html+= '</div>';
  66. html+= '<div class="tr_rw_btn_new fr" style="width:360px;">';
  67. if(arr.task_state==2){
  68. html+= '<div class="div_btn">';
  69. html+='<input type="button" class="btn_c" value="暂停" onclick="stop_view('+arr.universalid+')" />';
  70. html+='</div>';
  71. html+= '<div class="div_btn">';
  72. html+='<input type="button" class="btn_c" value="回收" onclick="task_back('+arr.universalid+','+arr.project_id+')" />';
  73. html+='</div>';
  74. }
  75. if(arr.lose_flag==0){
  76. html+= '<div class="div_btn">';
  77. html+='<input type="button" class="btn_c" value="派发" onclick="openProvDialog_single('+arr.universalid+','+arr.project_id+')" />';
  78. html+='</div>';
  79. html+= '<div class="div_btn">';
  80. html+='<input type="button" class="btn_c" value="修改" onclick="edit_view('+arr.universalid+','+arr.project_id+')" />';
  81. html+='</div>';
  82. html+= '<div class="div_btn">';
  83. html+='<input type="button" class="btn_c" value="删除" onclick="deleteTask('+arr.universalid+')" />';
  84. html+='</div>';
  85. }else if(arr.task_state=="4" || arr.task_state=="5"){
  86. html+= '<div class="div_btn">';
  87. html+='<input type="button" class="btn_c" value="查看原因" onclick="reason_view('+arr.universalid+')" />';
  88. html+='</div>';
  89. }
  90. // html+= '<div class="div_btn">';
  91. // html+='<input type="button" class="btn_c" value="查看任务" onclick="viewtask('+arr.universalid+')" />';
  92. // html+='</div>';
  93. html+= '</div>';
  94. html+= '</div>';
  95. }
  96. }
  97. $(item_name).html(html);
  98. });
  99. }
  100. function viewtask(task_id){
  101. item("mtTaskMgr.do?task=viewtask&task_id="+task_id);
  102. }
  103. function edit_view(task_id,project_id){
  104. item("mtTaskMgr.do?task=toedittask2&task_id="+task_id+"&project_id="+project_id);
  105. }
  106. function stop_view(task_id){
  107. var url="mtTaskMgr.do?task=do_task_state&task_state=3&task_id="+task_id;
  108. var param={};
  109. if(!confirm("确定要暂停任务")){
  110. return ;
  111. }
  112. sendAsyncAjax(param,url+"&time="+ new Date().getTime(), "json", function(data) {
  113. if(data.i>0){
  114. $.ligerDialog.open({content:"任务已暂停!", "title":"暂停任务!", "type":"success",allowClose:true,
  115. buttons: [ { text: '确定', onclick: function (item, dialog) { searchByKword();dialog.close();} }]
  116. });
  117. }else{
  118. $.ligerDialog.error("操作失败!");
  119. }
  120. });
  121. }
  122. function deleteTask(task_id){
  123. if(!confirm("确定要删除任务")){
  124. return ;
  125. }
  126. $.ajax({
  127. type:"post",
  128. url:"mtTaskMgr.do?task=deltask&task_id="+task_id+"&time=" + new Date().getTime(),
  129. timeout:30000,
  130. cache:false,
  131. dataType:"json",
  132. beforeSend:function(){
  133. $("#noticeMsg").html("正在操作中,请稍后……").show();
  134. },
  135. success:function(data){
  136. if(data.i>0){
  137. $.ligerDialog.open({content:"任务已删除!", "title":"删除任务!", "type":"success",allowClose:true,
  138. buttons: [ { text: '确定', onclick: function (item, dialog) { searchByKword();dialog.close();} }]
  139. });
  140. }else{
  141. $.ligerDialog.error("删除失败!");
  142. }
  143. },
  144. error:function(err){
  145. $("#noticeMsg").html("").hide();
  146. showAjaxError(err);
  147. },
  148. });
  149. }
  150. function searchByKword(){
  151. var s = "";
  152. var task_name=searchBox.getValue();
  153. if (task_name != "" && typeof (task_name) != "undefined" && task_name !="输入模块名称") {
  154. s += "&task_name=" + encodeURI(encodeURI(task_name));
  155. }
  156. var task_state=$("#task_state").val();
  157. if(task_state !="" && task_state !=null){
  158. s+="&task_state="+task_state;
  159. }
  160. search("mtTaskMgr.do?task=taskMgrpageInfo&project_id=${project_id}",s);
  161. }
  162. var ProvContent_single = '<div id="ProvDialog" class="forum-container2">'
  163. + '<table class="dialogTable">'
  164. + '<tr><td class="left-text">提示:</td><td class="save-and-prov-notice">请选择提醒方式,点击确定后开始派发。</td></tr>'
  165. + '<tr><td class="left-text">提醒方式:</td>'
  166. + '<td class="l-table-edit-td" nowrap="nowrap" id="ProvDialogMsg_single"></tr>'
  167. + '<tr><td colspan="2" style="text-align: center"><br/>'
  168. + '<input type="button" id="SubmitBtn_single" value="确定" class="l-button" />&nbsp;&nbsp;&nbsp;&nbsp;'
  169. + '<input type="button" id="CancelBtn_single" value="取消" class="l-button" />'
  170. + '</td></tr>'
  171. + '</table></div>';
  172. var ProvDialog_single;
  173. function openProvDialog_single(task_id,project_id){
  174. if(ProvDialog_single == undefined){
  175. ProvDialog_single = $.ligerDialog.open({
  176. content: ProvContent_single,
  177. width: 450,
  178. modal: true,
  179. title: "派发任务",
  180. allowClose: true,
  181. isHidden: false,
  182. onClose: function(dialog, options){
  183. ProvDialog_single = undefined;
  184. return true;
  185. }
  186. });
  187. // 创建提醒方式
  188. tmsMsgRemindUtil = new TmsMsgRemindUtil;
  189. tmsMsgRemindUtil.createPanel({id:"ProvDialogMsg_single", panelId:"ProvDialogMsg_singlePanel"});
  190. $("#SubmitBtn_single").bind("click", function(){Prov("mtTaskMgr.do?task=provTask_single&task_id="+task_id+"&project_id="+project_id,"ProvDialogMsg_singlePanel");});
  191. $("#CancelBtn_single").bind("click", function(){ProvDialog_single.close();});
  192. }else{
  193. $("#SubmitBtn_single").bind("click", function(){Prov("mtTaskMgr.do?task=provTask_single&task_id="+task_id,"ProvDialogMsg_singlePanel");});
  194. ProvDialog_single.show();
  195. }
  196. }
  197. function Prov(action,panel){
  198. var msgType = tmsMsgRemindUtil.getSelectResult(panel);
  199. $.ajax({
  200. type:"POST",
  201. url:action+"&time=" + new Date().getTime(),
  202. timeout:30000,
  203. cache:false,
  204. dataType:"json",
  205. data:{msgType:msgType},
  206. beforeSend:function(){
  207. $(":button").attr("disabled", true);
  208. if("ProvDialogMsgPanel"==panel){
  209. ProvDialog.hidden();
  210. }else if("ProvDialogMsg_singlePanel"==panel){
  211. ProvDialog_single.hidden();
  212. }
  213. $.ligerDialog.waitting("正在处理,请耐心等待...");
  214. },
  215. success:function(data){
  216. var i = data.i;
  217. if(i<0){
  218. if("ProvDialogMsgPanel"==panel){
  219. ProvDialog.show();
  220. }else if("ProvDialogMsg_singlePanel"==panel){
  221. ProvDialog_single.show();
  222. }
  223. $.ligerDialog.error("任务派发失败");
  224. }else if(i>0){
  225. $.ligerDialog.open({content:"提交成功!", "title":"提交成功", "type":"success",allowClose:false,
  226. buttons: [{text: '确定',
  227. onclick: function(item, dialog){
  228. dialog.close();
  229. $("#p").val("1");
  230. searchByKword();
  231. }
  232. }]
  233. });
  234. }else if(i==0){
  235. $.ligerDialog.error("没有任务可派发");
  236. }
  237. },
  238. error:function(err){
  239. if("ProvDialogMsgPanel"==panel){
  240. ProvDialog.show();
  241. }else if("ProvDialogMsg_singlePanel"==panel){
  242. ProvDialog_single.show();
  243. }
  244. showAjaxError(err);
  245. },
  246. complete:function(){
  247. $.ligerDialog.closeWaitting();
  248. $(":button").attr("disabled", false);
  249. }
  250. });
  251. }
  252. function task_back(task_id,project_id){
  253. item('mtTaskMgr.do?task=toeditback&type=2&task_id='+task_id+"&project_id="+project_id);
  254. }
  255. function reason_view(task_id){
  256. item("mtTaskMgr.do?task=reason_view&task_id="+task_id);
  257. }
  258. </script>
  259. </head>
  260. <body>
  261. <div class="tc_b">
  262. <div id="left" style="float:left;width:100%;">
  263. <div class="tc_r">
  264. <div class="tr_con b5 f4">
  265. <div class="fl f4">
  266. <img src="/shares/images/master1/wdrw_ico.png" width="25" height="31" />&nbsp;
  267. '${map.project_code }'任务列表
  268. </div>
  269. <div class="fl f4" style="margin-left:30px;">
  270. 任务状态:
  271. </div>
  272. <div class="fl mar6">
  273. <select style="width:150px; height:25px;" name="task_state" id="task_state" onchange="searchByKword()">
  274. <option value=""></option>
  275. <c:forEach items="${pm_task_state}" var="obj" >
  276. <option value="${obj.dvalue }" >${obj.dname }</option>
  277. </c:forEach>
  278. </select>
  279. </div>
  280. <div class="div_ck_k fr">
  281. <input class="div_cx fl" name="task_name" id="task_name" type="text" value="输入任务名称" />
  282. <input class="btn_ck fl" type="button" id="button" onclick="searchByKword();"/>
  283. </div>
  284. </div>
  285. <div class="tr_right_bg">
  286. <div id="contentDiv"></div>
  287. <jsp:include page="/yw/master1/page.jsp">
  288. <jsp:param name="functionName" value="searchByKword"/>
  289. </jsp:include>
  290. </div>
  291. </div>
  292. </div>
  293. <%@ include file="/yw/master1_ytpm/task/info/left_task.jsp"%>
  294. </div>
  295. </body>
  296. </html>