systemMonitorDetail.jsp 18 KB

<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.general.TimeUtil"%>
<%@ page import="weaver.general.GCONST" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page"/>
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<jsp:useBean id="manageDetachComInfo" class="weaver.hrm.moduledetach.ManageDetachComInfo" scope="page" />
<jsp:useBean id="Monitor" class="weaver.workflow.monitor.Monitor" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<link href="/js/checkbox/jquery.tzCheckbox_wev8.css" type=text/css rel=STYLESHEET>
<script language=javascript src="/js/checkbox/jquery.tzCheckbox_wev8.js"></script>
<SCRIPT language="javascript" src="/js/datetime_wev8.js"></script>
<script language="javascript" src="/js/selectDateTime_wev8.js"></script>
<SCRIPT language="javascript" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</head>

<%
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(18759,user.getLanguage());
String needfav ="1";
String needhelp ="";

String isOpenWorkflowStopOrCancel=GCONST.getWorkflowStopOrCancel();//是否开启流程暂停或取消配置

String infoid = Util.null2String(request.getParameter("infoid"));
int typeid = Util.getIntValue(request.getParameter("typeid"),0);
int subcompanyid = Util.getIntValue(request.getParameter("subcompanyid"),0);
int operatelevel=0;
String inputt11 = Util.null2String(request.getParameter("inputt11"));
String operatedate = Util.null2String(request.getParameter("operatedate"));
String operatedateend = Util.null2String(request.getParameter("operatedateend"));

boolean isUseWfManageDetach = manageDetachComInfo.isUseWfManageDetach();
int detachable = isUseWfManageDetach?1:0;
//按钮权限
if (isUseWfManageDetach){
		operatelevel = CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(), "WorkflowMonitor:All", subcompanyid);
		if(operatelevel < 0){
            response.sendRedirect("/notice/noright.jsp") ;
            return ;
        }
}else{
	if (HrmUserVarify.checkUserRight("WorkflowMonitor:All", user)){
		operatelevel = 2;
	}
}


%>

<BODY>

<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if(operatelevel > 0){
	RCMenu += "{"+SystemEnv.getHtmlLabelName(611,user.getLanguage())+",javascript:addwfs(),_self} " ;
	RCMenuHeight += RCMenuHeightStep ;
	RCMenu += "{"+SystemEnv.getHtmlLabelName(91,user.getLanguage())+",javascript:batchDel(),_self} " ;
	RCMenuHeight += RCMenuHeightStep ;
	RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:doSave(),_self} " ;
	RCMenuHeight += RCMenuHeightStep ;
}%>	
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<div class="zDialog_div_content">
<jsp:include page="/systeminfo/commonTabHead.jsp">
   <jsp:param name="mouldID" value="workflow"/>
   <jsp:param name="navName" value='<%=Monitor.getWorkflowMonitor3(infoid,user.getLanguage()+"") %>'/>
</jsp:include>
<iframe id="frame" name="frame" style="display: none"></iframe>
<form id="searchFrom" name="searchFrom" target="_self" method="post" action="systemMonitorDetail.jsp">
<input type="hidden" name="pageId" _showCol="false" id="pageId" value="monitordetail"/>
<INPUT type="hidden" name="infoid"  id ="infoid" value=<%=infoid%>>
<INPUT type="hidden" name="typeid"  id ="typeid" value=<%=typeid%>>
<INPUT type="hidden" name="subcompanyid"  id ="subcompanyid" value=<%=subcompanyid%>>
<INPUT type="hidden" name="actionKey"  id ="actionKey" value="updateDetail">
			<table id="topTitle" cellpadding="0" cellspacing="0">
				<tr>
					<td></td>
					<td class="rightSearchSpan" style="text-align:right; width:500px!important">
					<%if(operatelevel > 0){ %>
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(611,user.getLanguage())%>" class="e8_btn_top" onclick="addwfs()"/>
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(91,user.getLanguage())%>" class="e8_btn_top" onclick="batchDel()"/>
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(86,user.getLanguage()) %>"  class="e8_btn_top"  onclick="doSave()">
					<%} %>
					<input type="text" class="searchInput" name="flowTitle"  value="<%=inputt11 %>" onchange="reSetInputt1()" />
					<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995,user.getLanguage())%></span>
					<span title="<%=SystemEnv.getHtmlLabelName(81804,user.getLanguage()) %>" class="cornerMenu"></span>
					</td>
				</tr>
			</table>

			<div class="advancedSearchDiv" id="advancedSearchDiv" style="display:none;" >
				
					<wea:layout type="fourCol">
						<wea:group context='<%=SystemEnv.getHtmlLabelName(15774,user.getLanguage())%>'>
							<wea:item><%=SystemEnv.getHtmlLabelName(81651,user.getLanguage())%></wea:item>
							<wea:item>
	              					<input type="text" name="inputt11" class=inputstyle  value="<%=inputt11%>"/> 
							</wea:item>
							<wea:item><%=SystemEnv.getHtmlLabelName(1339,user.getLanguage())%></wea:item>
							<wea:item>
									<span class="wuiDateSpan" selectId="operatedatespan" selectValue="">
										<input class=wuiDateSel type="hidden" name="operatedate" value="<%=operatedate%>">
										<input class=wuiDateSel type="hidden" name="operatedateend" value="<%=operatedateend%>">
									</span>
							</wea:item>
						</wea:group>
						<wea:group context="" attributes="{'groupDisplay':'none'}">
							<wea:item type="toolbar">
								<input type="submit" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage())%>" class="e8_btn_submit" onclick="doSubmit(2);"/>
								<span class="e8_sep_line">|</span>
								<input type="button" value="<%=SystemEnv.getHtmlLabelName(2022,user.getLanguage())%>" class="e8_btn_cancel" onclick="resetCondtion();"/>
								<span class="e8_sep_line">|</span>
								<input type="button" value="<%=SystemEnv.getHtmlLabelName(31129,user.getLanguage())%>" class="e8_btn_cancel" id="cancel"/>
							</wea:item>
						</wea:group>
					</wea:layout>
				
			</div>
</form>

<%
int perpage=20;
String tableString = "";
if(perpage <2) perpage=10;                                 
String backfields = " a.workflowid, "+
	                "b.workflowname, "+
	                "b.subcompanyid,"+
	                "max(a.operatordate) as operatordate, "+
	                "max(a.operatortime) as operatortime, "+
	                "sum(convert(INT,isnull(a.isview,0))) as isview, "+
	                "sum(convert(INT,isnull(a.isintervenor,0))) as isintervenor, "+
	                "sum(convert(INT,isnull(a.isdelete,0))) as isdelete, "+
	                "sum(convert(INT,isnull(a.isForceDrawBack,0))) as isForceDrawBack, "+
	                "sum(convert(INT,isnull(a.isForceOver,0))) as isForceOver, "+
	                "sum(convert(INT,isnull(a.issooperator,0))) as issooperator ";
if(RecordSet.getDBType().equals("oracle"))
{
	backfields = " a.workflowid, "+
	                "b.workflowname, "+
	                "b.subcompanyid,"+
	                "max(a.operatordate) as operatordate, "+
	                "max(a.operatortime) as operatortime, "+
	                "sum(to_number(nvl(a.isview,0))) as isview, "+
	                "sum(to_number(nvl(a.isintervenor,0))) as isintervenor, "+
	                "sum(to_number(nvl(a.isdelete,0))) as isdelete, "+
	                "sum(to_number(nvl(a.isForceDrawBack,0))) as isForceDrawBack, "+
	                "sum(to_number(nvl(a.isForceOver,0))) as isForceOver, "+
	                "sum(to_number(nvl(a.issooperator,0))) as issooperator ";
}else if(RecordSet.getDBType().equals("mysql")){
    backfields = " a.workflowid, "+
    "b.workflowname, "+
    "b.subcompanyid,"+
    "max(a.operatordate) as operatordate, "+
    "max(a.operatortime) as operatortime, "+
    "sum(convert(ifnull(a.isview,0) , SIGNED)) as isview, "+
    "sum(convert(ifnull(a.isintervenor,0),SIGNED)) as isintervenor, "+
    "sum(convert(ifnull(a.isdelete,0),SIGNED)) as isdelete, "+
    "sum(convert(ifnull(a.isForceDrawBack,0),SIGNED)) as isForceDrawBack, "+
    "sum(convert(ifnull(a.isForceOver,0),SIGNED)) as isForceOver, "+
    "sum(convert(ifnull(a.issooperator,0),SIGNED)) as issooperator ";
}
String fromSql  = " workflow_monitor_detail a,workflow_base b,workflow_monitor_info c ";
String sqlWhere = "where a.workflowid = b.id and a.infoid = c.id and c.id = " + infoid ;
if(detachable==1)
{
	if(subcompanyid<1)
	{
		operatelevel = 2;
	}
}


if(!"".equals(inputt11)){
	sqlWhere += " and  b.workflowname like '%"+inputt11+"%'  ";
}
if(!"".equals(operatedate)){
	sqlWhere += " and a.operatordate >=  '"+operatedate+"' ";
}
if(!"".equals(operatedateend)){
	sqlWhere += " and a.operatordate <=  '"+operatedateend+"' ";
}

//if(detachable == 1 && user.getUID() != 1){
//    sqlWhere += " and b.subcompanyid = "+subcompanyid;
//}

String editSubs=SubCompanyComInfo.getRightSubCompany(user.getUID(),"WorkflowManage:All",0);
String para2=infoid+"+column:workflowid+"+detachable+"+column:subcompanyid+"+user.getUID()+"+"+operatelevel+"+"+editSubs;
String para3=infoid+"+column:workflowid+"+user.getLanguage()+"+"+user.getUID()+"+"+operatelevel+"+"+detachable+"+"+subcompanyid;

String orderby=" b.subcompanyid,b.workflowname";
String sqlgroupby = " a.workflowid,b.workflowname,b.subcompanyid ";
boolean wfintervenor= GCONST.getWorkflowIntervenorByMonitor();
tableString =   " <table instanceid=\"workflowMoniterListTable\" tabletype=\"checkbox\" pagesize=\""+PageIdConst.getPageSize("monitordetail",user.getUID())+"\" >"+
" 		<checkboxpopedom  id=\"checkbox\" popedompara=\"column:subcompanyid+"+ user.getUID()+"+"+detachable+"+"+operatelevel+"\" showmethod=\"weaver.workflow.monitor.Monitor.getDetailCheckBox\" />"+
"       <sql backfields=\""+backfields+"\" sqlform=\""+fromSql+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\"  sqlorderby=\""+orderby+"\" sqlgroupby=\""+sqlgroupby+"\"  sqlprimarykey=\"workflowid\" sqlsortway=\"Desc\" sqlisdistinct=\"false\" />"+
"       <head>"+
"           <col width=\"18%\"  text=\""+SystemEnv.getHtmlLabelName(81651,user.getLanguage())+"\" column=\"workflowname\" orderkey=\"workflowname\" />"+
"           <col width=\"16%\"  text=\""+SystemEnv.getHtmlLabelName(1339,user.getLanguage())+"\" column=\"operatordate\" orderkey=\"operatordate,operatortime\" transmethod=\"weaver.general.WorkFlowTransMethod.getWFSearchResultCreateTime\" otherpara=\"column:operatortime\" />"+
"        <col width=\"12%\"  text=\"&lt;input type=checkbox notfirstcolumn id=isview_all notbeauty=true onclick=checkall('isview')  &gt;"+SystemEnv.getHtmlLabelName(82770,user.getLanguage())+"\" column=\"isview\"  otherpara=\"1+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />"+
"        <col width=\"8%\"  text=\"&lt;input type='checkbox' notfirstcolumn id='isdelete_all' notbeauty='true' onclick=checkall('isdelete')  &gt;"+SystemEnv.getHtmlLabelName(20307,user.getLanguage())+"\" column=\"isdelete\"  otherpara=\"2+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />"+
"        <col width=\"12%\"  text=\"&lt;input type='checkbox' notfirstcolumn id='isintervenor_all' notbeauty='true' onclick=checkall('isintervenor')  &gt;"+SystemEnv.getHtmlLabelName(82771,user.getLanguage())+"\" column=\"isintervenor\"  otherpara=\"3+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />"+
"        <col width=\"10%\"  text=\"&lt;input type='checkbox' notfirstcolumn id='isForceDrawBack_all' notbeauty='true' onclick=checkall('isForceDrawBack')  &gt;"+SystemEnv.getHtmlLabelName(82772,user.getLanguage())+"\" column=\"isForceDrawBack\"  otherpara=\"4+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />"+
"        <col width=\"10%\"  text=\"&lt;input type='checkbox' notfirstcolumn id='isForceOver_all' notbeauty='true' onclick=checkall('isForceOver')  &gt;"+SystemEnv.getHtmlLabelName(82773,user.getLanguage())+"\" column=\"isForceOver\"  otherpara=\"5+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />";
if(isOpenWorkflowStopOrCancel.equals("1")){ 
//是否开启流程暂停或取消配置	
tableString+="        <col width=\"14%\"  text=\"&lt;input type='checkbox' notfirstcolumn id='issooperator_all' notbeauty='true' onclick=checkall('issooperator')  &gt;"+SystemEnv.getHtmlLabelName(82774,user.getLanguage())+"\" column=\"issooperator\" otherpara=\"6+"+para2+"\" transmethod=\"weaver.workflow.monitor.Monitor.getMonitorWFCompetence\" />";
}
tableString+= "       </head></table>";
%>
<form id="submitform" name="submitform" target="frame" method="post" action="/system/systemmonitor/workflow/systemMonitorOperation.jsp">
<INPUT type="hidden" name="infoid"  id ="infoid" value=<%=infoid%>>
<INPUT type="hidden" name="typeid"  id ="typeid" value=<%=typeid%>>
<INPUT type="hidden" name="subcompanyid"  id ="subcompanyid" value=<%=subcompanyid%>>
<INPUT type="hidden" name="actionKey"  id ="actionKey" value="updateDetail">
<TABLE width="100%">
    <tr>
        <td valign="top">
            <wea:SplitPageTag  tableString='<%=tableString%>'  mode="run" />
        </td>
    </tr>
</TABLE>
</form>

</div>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
	<wea:layout needImportDefaultJsAndCss="false">
		<wea:group context=""  attributes="{\"groupDisplay\":\"none\"}">
			<wea:item type="toolbar">
		    	<input type="button" value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" id="zd_btn_cancle"  class="zd_btn_cancle" onclick="dialog.closeByHand()">
			</wea:item>
		</wea:group>
	</wea:layout>
</div>
<script language="JavaScript">
var diag_vote;
jQuery(document).ready(function () {
	$("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
	$(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
	$("#tabDiv").remove();
	
	
	jQuery('input[type=checkbox]').each(function(){
		jQuery(this).trigger('disabled',false);
	});		
});



var dialog = parent.getDialog(window);
var parentWin = parent.getParentWindow(window);
function doSave(){
	document.getElementById('submitform').submit();
	Dialog.alert('<%=SystemEnv.getHtmlLabelName(83551,user.getLanguage())%>',function(){
		parentWin.reload();
		dialog.close();
	});
}


function addwfs(){
	var title = "<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())%>";
	var url="/workflow/monitor/MutiwfBrowser4Monitor.jsp?isfrom_systemMonitorDetail=1&infoid=<%=infoid%>";
	dlg = new window.top.Dialog();
	dlg.currentWindow = window;
	dlg.Width = 550;
	dlg.Height = 650;
	dlg.Modal = true;
	dlg.Title = title;
	dlg.URL =url;
	dlg.show();
}

function batchDel(){
	var ids = "";
	$("input[name='chkInTableTag']").each(function(){
		if($(this).attr("checked"))	{	
			ids += ',' + $(this).attr("checkboxId");
		}
	});
	if(ids==""){
		top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(20149,user.getLanguage())%>");
		return false;
	}else
		ids = ids.substring(1);
		
	top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>", function (){
		var parentWin = null;
		try{
			jQuery.ajax({
			    url: "systemMonitorOperation.jsp?actionKey=deldetail&infoid=<%=infoid%>&ids="+ids,
			    dataType: "text", 
				type:"post",
				async:true,  
			    contentType : "charset=gbk", 
			    error:function(ajaxrequest){}, 
			    success:function(data){
			    	_table.reLoad();
			    	parentWin = parent.getParentWindow(window);
					parentWin.reload();
			    }  
			}); 
		}catch(e){}
			
	}, function () {}, 320, 90,true);
	
}

var showTableDiv  = document.getElementById('divshowreceivied');
var oIframe = document.createElement('iframe');
function showreceiviedPopup(content){
    showTableDiv.style.display='';
    var message_Div = document.createElement("<div>");
     message_Div.id="message_Div";
     message_Div.className="xTable_message";
     showTableDiv.appendChild(message_Div);
     var message_Div1  = document.getElementById("message_Div");
     message_Div1.style.display="inline";
     message_Div1.innerHTML=content;
     var pTop= document.body.offsetHeight/2+document.body.scrollTop-50;
     var pLeft= document.body.offsetWidth/2-50;
     message_Div1.style.position="absolute"
     message_Div1.style.posTop=pTop;
     message_Div1.style.posLeft=pLeft;

     message_Div1.style.zIndex=1002;

     oIframe.id = 'HelpFrame';
     showTableDiv.appendChild(oIframe);
     oIframe.frameborder = 0;
     oIframe.style.position = 'absolute';
     oIframe.style.top = pTop;
     oIframe.style.left = pLeft;
     oIframe.style.zIndex = message_Div1.style.zIndex - 1;
     oIframe.style.width = parseInt(message_Div1.offsetWidth);
     oIframe.style.height = parseInt(message_Div1.offsetHeight);
     oIframe.style.display = 'block';
}

function hiddenreceiviedPopup(){
    showTableDiv.style.display='none';
    oIframe.style.display='none';
}
function changecolor(obj,color){
    obj.style.color=color;
}
function afterDoWhenLoaded(){
	jQuery("input[type=checkbox]").each(function(){
	  if(jQuery(this).attr("tzCheckbox")=="true"){
	   	jQuery(this).tzCheckbox({labels:['','']});
	   	//如果禁用,则修改开关CSS
	   	if(jQuery(this).attr('disabled')){
			jQuery(this).next().attr("class",jQuery(this).next().attr('class').replace('tzCheckBox','tzCheckBox_disabled'));
			jQuery(this).next().find('.tzCBPart').attr('class','tzCBPart_disabled');
	   	}
	  }
	 });
}

function checkall(type){
	var ischecked = jQuery('#'+type+'_all').is(':checked');
	jQuery("input[name^='"+type+"_']").each(function(){
		jQuery(this).attr("checked", ischecked);
	});
}

function reSetInputt1(){
	var typename=$("input[name='flowTitle']").val();
	$("input[name='inputt11']").val(typename);
}

function refresh(){
	_table.reLoad();
	parentWin.reload();
}

function onBtnSearchClick(){
	document.getElementById('searchFrom').submit();
}

jQuery(function(){
	//hiddenRCMenuItem(<%=showColMenuIndex%>);
})

</script>

</BODY>
</HTML>