| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="tms" uri="http://fzywtx.com/jsp/yw/tms" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>任务列表</title>
- <link href="/shares/js/yw/master1/liger/skins/ynet/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script src="/shares/jquery.progressbar/js/jquery.progressbar.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1/page.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1/searchBox.js"></script>
- <script type="text/javascript" src="/shares/js/yw/ytpm/task/pm_common.js"></script>
- <script type="text/javascript">
- $(function(){
- search("mtTaskMgr.do?task=taskMgrpageInfo&project_id=${project_id}");
- });
- function search(url,s){
- var p = $("#p").val();
- var pSize = $("#pSize").val();
- var param={"p":p,"pSize":pSize};
- sendAsyncAjax(param, url+"&time="+ new Date().getTime()+s, "json", function(data) {
- var num = data.Total;
- page(num,pSize,p);
- var datas = data.Rows;
- var item_name = $('#contentDiv');
- $(item_name).empty();//初始化table,清空table
- var html = '';
- if(datas.length == 0){
- html = notquery();
- }else{
- var j=0;
- for (var i = 0; i < datas.length; i++){
- var arr = datas[i];
- var bdiv = 1;
- bdiv = 1 + j;
- if (j < 7) {
- j++
- } else {
- j = 0;
- }
- html+= '<div class="tr_cont_new mar4 f5_new">';
- html+= '<a href="#" onclick="viewtask('+arr.universalid+')">';
- html+= '<div class="wdrw_tiao_new bn'+bdiv+' fl"></div>';
- html += '<div class="tr_rw_d_new fl">';
- html+= '<p><img src="/shares/images/master1/rw_ico_menu.png" width="17" height="15" />';
- if(arr.lose_flag==1){
- html+='[已派发(<font color="red">'+arr.task_state_name+'</font>)] ';
- }else{
- html+='[未派发] ';
- }
-
- html+='[责任人:'+ arr.responsible_name+']';
- html+=' [任务名称:'+ arr.task_name+']';
- html+='</p>';
- html+='<p class=\'mar5\'>';
- html+='[任务进度:'+arr.finish_percent+'%] [任务积分:'+arr.plan_hour+'] 计划开始时间:'+arr. plan_start_date+', 计划结束时间:'+arr.plan_end_date+' ';
- html+='</p>';
- html+='</a>';
- html+= '</div>';
- html+= '<div class="tr_rw_btn_new fr" style="width:360px;">';
- if(arr.task_state==2){
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="暂停" onclick="stop_view('+arr.universalid+')" />';
- html+='</div>';
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="回收" onclick="task_back('+arr.universalid+','+arr.project_id+')" />';
- html+='</div>';
- }
- if(arr.lose_flag==0){
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="派发" onclick="openProvDialog_single('+arr.universalid+','+arr.project_id+')" />';
- html+='</div>';
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="修改" onclick="edit_view('+arr.universalid+','+arr.project_id+')" />';
- html+='</div>';
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="删除" onclick="deleteTask('+arr.universalid+')" />';
- html+='</div>';
- }else if(arr.task_state=="4" || arr.task_state=="5"){
- html+= '<div class="div_btn">';
- html+='<input type="button" class="btn_c" value="查看原因" onclick="reason_view('+arr.universalid+')" />';
- html+='</div>';
- }
- // html+= '<div class="div_btn">';
- // html+='<input type="button" class="btn_c" value="查看任务" onclick="viewtask('+arr.universalid+')" />';
- // html+='</div>';
- html+= '</div>';
- html+= '</div>';
- }
- }
- $(item_name).html(html);
- });
- }
- function viewtask(task_id){
- item("mtTaskMgr.do?task=viewtask&task_id="+task_id);
- }
- function edit_view(task_id,project_id){
- item("mtTaskMgr.do?task=toedittask2&task_id="+task_id+"&project_id="+project_id);
- }
- function stop_view(task_id){
- var url="mtTaskMgr.do?task=do_task_state&task_state=3&task_id="+task_id;
- var param={};
- if(!confirm("确定要暂停任务")){
- return ;
- }
- sendAsyncAjax(param,url+"&time="+ new Date().getTime(), "json", function(data) {
- if(data.i>0){
- $.ligerDialog.open({content:"任务已暂停!", "title":"暂停任务!", "type":"success",allowClose:true,
- buttons: [ { text: '确定', onclick: function (item, dialog) { searchByKword();dialog.close();} }]
- });
- }else{
- $.ligerDialog.error("操作失败!");
- }
- });
- }
- function deleteTask(task_id){
- if(!confirm("确定要删除任务")){
- return ;
- }
- $.ajax({
- type:"post",
- url:"mtTaskMgr.do?task=deltask&task_id="+task_id+"&time=" + new Date().getTime(),
- timeout:30000,
- cache:false,
- dataType:"json",
- beforeSend:function(){
- $("#noticeMsg").html("正在操作中,请稍后……").show();
- },
- success:function(data){
- if(data.i>0){
- $.ligerDialog.open({content:"任务已删除!", "title":"删除任务!", "type":"success",allowClose:true,
- buttons: [ { text: '确定', onclick: function (item, dialog) { searchByKword();dialog.close();} }]
- });
- }else{
- $.ligerDialog.error("删除失败!");
- }
- },
- error:function(err){
- $("#noticeMsg").html("").hide();
- showAjaxError(err);
- },
- });
- }
- function searchByKword(){
- var s = "";
- var task_name=searchBox.getValue();
- if (task_name != "" && typeof (task_name) != "undefined" && task_name !="输入模块名称") {
- s += "&task_name=" + encodeURI(encodeURI(task_name));
- }
- var task_state=$("#task_state").val();
- if(task_state !="" && task_state !=null){
- s+="&task_state="+task_state;
- }
- search("mtTaskMgr.do?task=taskMgrpageInfo&project_id=${project_id}",s);
- }
- var ProvContent_single = '<div id="ProvDialog" class="forum-container2">'
- + '<table class="dialogTable">'
- + '<tr><td class="left-text">提示:</td><td class="save-and-prov-notice">请选择提醒方式,点击确定后开始派发。</td></tr>'
- + '<tr><td class="left-text">提醒方式:</td>'
- + '<td class="l-table-edit-td" nowrap="nowrap" id="ProvDialogMsg_single"></tr>'
- + '<tr><td colspan="2" style="text-align: center"><br/>'
- + '<input type="button" id="SubmitBtn_single" value="确定" class="l-button" /> '
- + '<input type="button" id="CancelBtn_single" value="取消" class="l-button" />'
- + '</td></tr>'
- + '</table></div>';
- var ProvDialog_single;
- function openProvDialog_single(task_id,project_id){
- if(ProvDialog_single == undefined){
- ProvDialog_single = $.ligerDialog.open({
- content: ProvContent_single,
- width: 450,
- modal: true,
- title: "派发任务",
- allowClose: true,
- isHidden: false,
- onClose: function(dialog, options){
- ProvDialog_single = undefined;
- return true;
- }
- });
- // 创建提醒方式
- tmsMsgRemindUtil = new TmsMsgRemindUtil;
- tmsMsgRemindUtil.createPanel({id:"ProvDialogMsg_single", panelId:"ProvDialogMsg_singlePanel"});
- $("#SubmitBtn_single").bind("click", function(){Prov("mtTaskMgr.do?task=provTask_single&task_id="+task_id+"&project_id="+project_id,"ProvDialogMsg_singlePanel");});
- $("#CancelBtn_single").bind("click", function(){ProvDialog_single.close();});
- }else{
- $("#SubmitBtn_single").bind("click", function(){Prov("mtTaskMgr.do?task=provTask_single&task_id="+task_id,"ProvDialogMsg_singlePanel");});
- ProvDialog_single.show();
- }
- }
- function Prov(action,panel){
- var msgType = tmsMsgRemindUtil.getSelectResult(panel);
- $.ajax({
- type:"POST",
- url:action+"&time=" + new Date().getTime(),
- timeout:30000,
- cache:false,
- dataType:"json",
- data:{msgType:msgType},
- beforeSend:function(){
- $(":button").attr("disabled", true);
- if("ProvDialogMsgPanel"==panel){
- ProvDialog.hidden();
- }else if("ProvDialogMsg_singlePanel"==panel){
- ProvDialog_single.hidden();
- }
- $.ligerDialog.waitting("正在处理,请耐心等待...");
- },
- success:function(data){
- var i = data.i;
- if(i<0){
- if("ProvDialogMsgPanel"==panel){
- ProvDialog.show();
- }else if("ProvDialogMsg_singlePanel"==panel){
- ProvDialog_single.show();
- }
- $.ligerDialog.error("任务派发失败");
- }else if(i>0){
- $.ligerDialog.open({content:"提交成功!", "title":"提交成功", "type":"success",allowClose:false,
- buttons: [{text: '确定',
- onclick: function(item, dialog){
- dialog.close();
- $("#p").val("1");
- searchByKword();
- }
- }]
- });
- }else if(i==0){
- $.ligerDialog.error("没有任务可派发");
- }
- },
- error:function(err){
- if("ProvDialogMsgPanel"==panel){
- ProvDialog.show();
- }else if("ProvDialogMsg_singlePanel"==panel){
- ProvDialog_single.show();
- }
- showAjaxError(err);
- },
- complete:function(){
- $.ligerDialog.closeWaitting();
- $(":button").attr("disabled", false);
- }
- });
- }
- function task_back(task_id,project_id){
- item('mtTaskMgr.do?task=toeditback&type=2&task_id='+task_id+"&project_id="+project_id);
- }
- function reason_view(task_id){
- item("mtTaskMgr.do?task=reason_view&task_id="+task_id);
- }
- </script>
- </head>
- <body>
- <div class="tc_b">
- <div id="left" style="float:left;width:100%;">
- <div class="tc_r">
- <div class="tr_con b5 f4">
- <div class="fl f4">
- <img src="/shares/images/master1/wdrw_ico.png" width="25" height="31" />
- '${map.project_code }'任务列表
- </div>
- <div class="fl f4" style="margin-left:30px;">
- 任务状态:
- </div>
- <div class="fl mar6">
- <select style="width:150px; height:25px;" name="task_state" id="task_state" onchange="searchByKword()">
- <option value=""></option>
- <c:forEach items="${pm_task_state}" var="obj" >
- <option value="${obj.dvalue }" >${obj.dname }</option>
- </c:forEach>
- </select>
- </div>
- <div class="div_ck_k fr">
- <input class="div_cx fl" name="task_name" id="task_name" type="text" value="输入任务名称" />
- <input class="btn_ck fl" type="button" id="button" onclick="searchByKword();"/>
- </div>
- </div>
- <div class="tr_right_bg">
- <div id="contentDiv"></div>
- <jsp:include page="/yw/master1/page.jsp">
- <jsp:param name="functionName" value="searchByKword"/>
- </jsp:include>
- </div>
- </div>
- </div>
- <%@ include file="/yw/master1_ytpm/task/info/left_task.jsp"%>
- </div>
- </body>
- </html>
|