⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 拷贝于 拷 oa_document_send.jsp

📁 java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理,角色管理,权限) 2.工作流管理 (流程类别,流程) 3.字典管理 (国家,省份,城市,公共数据字典) 4.项目
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ include file="../../include/configuration.jsp"%>
<%@ page import="com.vere.oa.document.bean.*"%>
<%@ page import="com.vere.oa.document.item.*"%>

<%@ page contentType="text/html; charset=gb2312" %>
<%
	ParameterUtils.setCharacterEncoding(request);
	String status=ParameterUtils.getString(request,"status");
	//删除
	if(status.equals("remove"))
	{
		Oa_document_sendItem item=new Oa_document_sendItem();
		item.setId(ParameterUtils.getString(request,"id"));
		Oa_document_sendBean bean=new Oa_document_sendBean();
		item=bean.find(ParameterUtils.getString(request,"id"));
		String filepath=Configuration.getInstance().fileUpload+"/oa_document_send/"+item.getId()+"."+item.getFileExt();
		if(CFile.fileExists(filepath)){
			CFile.deleteFile(filepath);
		}
		filepath=Configuration.getInstance().xmlUpload+"/oa_document_send_xml/workflow_state"+item.getId()+".xml";
		if(CFile.fileExists(filepath)){
			CFile.deleteFile(filepath);
		}
		filepath=Configuration.getInstance().xmlUpload+"/oa_document_send_xml/workflow_line"+item.getId()+".xml";
		if(CFile.fileExists(filepath)){
			CFile.deleteFile(filepath);
		}
		String[] files=item.getTemple_file().split(",");
		for(int i=0;files!=null&&i<files.length;i++)
		{
			filepath=Configuration.getInstance().fileUpload+"/oa_document_send/"+files[i];
			if(CFile.fileExists(filepath)){
				CFile.deleteFile(filepath);
			}
		}
		bean.removeItem(item);
	}
	//删除全部选择的

	if(status.equals("removeSelect"))
	{
		String ids=ParameterUtils.getString(request,"ids");
		Oa_document_sendBean bean=new Oa_document_sendBean();
		List list=bean.findByIds(ids+"0");
		Iterator e=list.iterator();
		while(e.hasNext()){
			Oa_document_sendItem item=(Oa_document_sendItem)e.next();
			String filepath=Configuration.getInstance().fileUpload+"/oa_document_send/"+item.getId()+"."+item.getFileExt();
			if(CFile.fileExists(filepath)){
				CFile.deleteFile(filepath);
			}
			filepath=Configuration.getInstance().xmlUpload+"/oa_document_send_xml/workflow_state"+item.getId()+".xml";
			if(CFile.fileExists(filepath)){
				CFile.deleteFile(filepath);
			}
			filepath=Configuration.getInstance().xmlUpload+"/oa_document_send_xml/workflow_line"+item.getId()+".xml";
			if(CFile.fileExists(filepath)){
				CFile.deleteFile(filepath);
			}
		}
		list=bean.findByIds(ids+"0");
		e=list.iterator();
		while(e.hasNext()){
			Oa_document_sendItem item=(Oa_document_sendItem)e.next();
			String[] files=item.getFileExt().split(",");
			for(int i=0;files!=null&&i<files.length;i++)
			{
				String filepath=Configuration.getInstance().fileUpload+"/oa_document_send/"+files[i];
				if(CFile.fileExists(filepath)){
					CFile.deleteFile(filepath);
				}
			}
		}
		String[] idArray=ids.split(",");
		bean.removeItems(idArray);
	}
	
	if(status.equals("send"))
	{
		String ids=ParameterUtils.getString(request,"ids");
		Oa_document_sendBean bean=new Oa_document_sendBean();
		Oa_document_sendItem document_sendItem=new Oa_document_sendItem();
		document_sendItem.setDocument_status("2");
		document_sendItem.setId(ids+"0");
		bean.updateDocument_Status(document_sendItem);
	}
	
	int pageNo=ParameterUtils.getInt(request,"page");
	if(pageNo<=0)
	{
		pageNo=1;
	}
	Oa_document_sendItem item=new Oa_document_sendItem();
	String title=ParameterUtils.getString(request,"title");//主题
	String create_name=ParameterUtils.getString(request,"create_name");//申请人
	String create_date=ParameterUtils.getString(request,"create_date");//申请日期
	String document_status=ParameterUtils.getString(request,"document_status");//当前状态
	item.setTitle(title);
	item.setCreate_name(create_name);
	item.setCreate_date(create_date);
	item.setDocument_status(document_status);
	Oa_document_sendBean bean=new Oa_document_sendBean();
	List list=bean.find(item,pageNo,pageSize);
	int totalRecord=bean.getTotalRecord();
	int page_num=(int)Math.ceil((double)totalRecord/pageSize);
%>
<html>
<head>
<title><%=titleName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../js/check.js"></script>
<link href="../../css/date.css" rel="stylesheet" type="text/css">
<script src="../../js/ShowDate.js"></script>
<script language="javascript">
    init();
</script>
</head>
<body>
<form name="form1" method="post" action="">
	<table border="0" cellpadding="0"  cellspacing="0" class="firsttable">
		<tr>
			<td align="center" valign="top">
				<table  class="centertable">
					<tr>
						<td>
						</td>
					</tr>
					<tr>
						<td align="center" valign="top">
							<table class="containContentsTable">
								<tr>
									<td align="right" colspan=2 >
									主题:<input type="text" size=10 name="title" value="<%=ParameterUtils.getString(request,"title")%>">
									申请人:<input type="text" size=10 name="create_name" value="<%=ParameterUtils.getString(request,"create_name")%>">
									申请日期:<input type="text" size=10 name="create_date" value="<%=ParameterUtils.getString(request,"create_date")%>">
									当前状态:<select name="document_status" id="document_status">
									<option value=''></option>
									<%
										Oa_dictionaryBean oa_dictionaryBean=new Oa_dictionaryBean();
										List oa_dictionaryList=oa_dictionaryBean.findByNum("6");
										Iterator oa_dictionaryE=oa_dictionaryList.iterator();
										while(oa_dictionaryE.hasNext()){
											Oa_dictionaryItem oa_dictionaryItem=(Oa_dictionaryItem)oa_dictionaryE.next();
											if(ParameterUtils.getString(request,"document_status").equals(oa_dictionaryItem.getCode()))
												out.println("<option value='"+oa_dictionaryItem.getCode()+"' selected>"+oa_dictionaryItem.getCode_name()+"</option>");
											else
												out.println("<option value='"+oa_dictionaryItem.getCode()+"' >"+oa_dictionaryItem.getCode_name()+"</option>");
										}
									%>
									</select>
									</td>
								</tr>
								<tr>
									<td  colspan="2" align='center'><input name="Submit" type="button" class="button" value="添加" onClick="javascript:add()">
									  <input name="Submit22" type="button" class="button" value="发送" onClick="javascript:send()">
										<input name="Submit2" type="button" class="button" value="删除" onClick="javascript:removeSelect()">
										<input name="Submit3" type="button" class="button" value="修改" onClick="javascript:edit()">
										<input name="Submit3" type="button" class="button" value="浏览" onClick="javascript:look()">
										<input name="Submit35" type="button" class="button" value="审批" onClick="javascript:verify()">
										<input name="Submit3322" style="width:80px;" type="button" class="button" value="查看审批记录" onClick="javascript:verifylook()">
										<input name="Submit352" type="button" class="button" value="接收" onClick="javascript:receive_record()">
										<input name="Submit33222" style="width:80px;" type="button" class="button" value="查看接收记录" onClick="javascript:receive_record_look()">
										<input name="Submit34" type="button" class="button" value="流转" onClick="javascript:workflow()">
										<input name="Submit332222" style="width:80px;" type="button" class="button" value="查看流转记录" onClick="javascript:flow_record()">
										<input name="Submit332" style="width:80px;" type="button" class="button" value="查看流程图" onClick="javascript:workflowlook()">
										<input name="Submit33" style="width:80px;" type="button" class="button" value="修改流程图" onClick="javascript:workflowedit()">
										<input name="Submit32" type="button" class="button" value="查询" onClick="javascript:query()">
									</td>
								</tr>
								<tr>
									<td colspan="2">
									<%
										out.println("<table  class='contentsTable'   border='0' cellpadding='0'  cellspacing='1'>");
										out.println("<tr class='tr1'  align=center ><td width=5% ></td><td>主题</td><td>申请人</td><td>申请日期</td><td>当前状态</td><td>流程状态</td></tr>");
										Iterator e=list.iterator();
										while(e.hasNext()){
											Oa_document_sendItem rItem=(Oa_document_sendItem)e.next();
											out.println("<tr class='tr2'>");
											out.println("<td><input type='checkbox' name=checkvalue value='"+rItem.getId()+"'></td>");
											out.println("<td>"+rItem.getTitle()+"</td>");//主题
											out.println("<td>"+rItem.getCreate_name()+"</td>");//申请人
											out.println("<td>"+DateUtils.formatString(rItem.getCreate_date())+"</td>");//申请日期
											out.println("<td>"+rItem.getOa_dictionaryItem().getCode_name()+"</td>");//当前状态
											out.println("<td>"+rItem.getWorkflow_state_name()+"</td>");//流程状态
											out.println("</tr>");
										}
										out.println("</table>");
									%>
									</td>
								</tr>
								<tr>
									<td>
										<input name="cboAll" type="checkbox" id="cboAll" value="checkbox" onClick="checkBoxAll()"> 全选
									</td>
									<td align="right" class="pagelink" > 共 <%=totalRecord%> 条, 共 <%=page_num%> 页, 第 <%=pageNo%> 页 <a href="javascript:first()">第一页</a> <a href="javascript:next()">下一页</a> <a  href="javascript:pre()">上一页</a> <a  href="javascript:last()" >最后一页</a>
									<select name="position" id="position"  onChange="goposition()">
										<option value=""></option>
										<%
											for(int i=1;i<=page_num;i++)
											{
												out.println("<option ");
												if(pageNo==i){out.println("selected");}
													out.println(" value="+i+">");
												out.println(i);
												out.println("</option>");
											}
										%>
									</select>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td></td>
					</tr>
				</table>
			</td>
		</tr>
</table>
	<input type="hidden" name="status" value="">
	<input type="hidden" name="page" value=<%=pageNo%>>
	<input type="hidden" name="totalpage" value=<%=page_num%>>
	<input type="hidden" name="id" value="">
	<input type="hidden" name="ids" value="">
</form>
</body>
</html>
<script language="JavaScript" >
	function checkBoxAll()//全选
	{
		var form = form1;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				form.elements[i].checked = form.cboAll.checked;
			}
		}
	}

	function edit()
	{
		var form=form1;
		var j=0;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.id.value=form.elements[i].value;
					j++;
				}
			}
		}
		if(form.id.value=="")
		{
			alert("请选择要修改的一条记录");
			return;
		}
		if(j>1)
		{
			alert("一次只能修改一条记录");
			return;
		}
		location="oa_document_sendedit.jsp?id="+form.id.value;
	}

	function workflowedit()
	{
		var form=form1;
		var j=0;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.id.value=form.elements[i].value;
					j++;
				}
			}
		}
		if(form.id.value=="")
		{
			alert("请选择要修改流程图的一条记录");
			return;
		}
		if(j>1)
		{
			alert("一次只能修改流程图一条记录");
			return;
		}
		var url="../public/workflowxmledit.jsp?dir_name=oa_document_send_xml&workflow_id="+form.id.value;
		open(url,'win','scrollbars=no,width=700,height=500,resizable=no,left=200,top=100,resizable=false');
	}
	
	function workflowlook()
	{
		var form=form1;
		var j=0;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.id.value=form.elements[i].value;
					j++;
				}
			}
		}
		if(form.id.value=="")
		{
			alert("请选择要查看流程图的一条记录");
			return;
		}
		if(j>1)
		{
			alert("一次只能查看流程图一条记录");
			return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -