writeemail.jsp
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:9k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page language="java" pageEncoding="GBK"%>
- <%@ page import="java.util.ArrayList"%>
- <%@ page import="java.util.List"%>
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
- <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
- <title>无标题文档</title>
- <script>
- function selectCheck(){
- }
- //选中孩子
- function selectChild(o){
- //获得本菜单的tr
- var otr = o.parentElement.parentElement;
- //获得子菜单的tr
- var otrmenu = otr.nextSibling;
- //遍历子菜单的checkbox
- for(var i=0;i<otrmenu.all.length;i++) {
- if(otrmenu.all[i].type=="checkbox"){
- otrmenu.all[i].checked = o.checked;
- }
- }
- }
- //选中父类(适用二级)
- function selectParent(o){
- //t=true默认找到
- var t= false;
- //获得本菜单的tr
- var otr = o.parentElement.parentElement;
- //获得父菜单的tr
- var otrmenu = otr.previousSibling;
- //遍历子菜单的checkbox,验证是有选
- for(var i=0;i<otr.all.length;i++) {
- if(otr.all[i].type=="checkbox" && otr.all[i].checked){
- t = true;
- break;
- }
- }
- //设置父类的checkbox状态
- if(t){
- for(var i=0;i<otrmenu.all.length;i++) {
- if(otrmenu.all[i].type=="checkbox"){
- otrmenu.all[i].checked = "checked";
- selectRoot(otrmenu.all[i]);
- break;
- }
- }
- }else{
- for(var i=0;i<otrmenu.all.length;i++) {
- if(otrmenu.all[i].type=="checkbox"){
- otrmenu.all[i].checked = "";
- selectRoot(otrmenu.all[i]);
- break;
- }
- }
- }
- }
- //选中根点节(适用一级)
- function selectRoot(o){
- //t=true默认找到
- var t= false;
- //获得本菜单的tr
- var otr = o.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement
- //获得父菜单的tr
- var otrmenu = otr.previousSibling;
- //遍历子菜单的checkbox,验证是否全选
- for(var i=0;i<otr.all.length;i++) {
- if(otr.all[i].type=="checkbox" && otr.all[i].checked){
- t = true;
- break;
- }
- }
- //设置父类的checkbox状态
- if(t){
- for(var i=0;i<otrmenu.all.length;i++) {
- if(otrmenu.all[i].type=="checkbox"){
- otrmenu.all[i].checked = "checked";
- break;
- }
- }
- }else{
- for(var i=0;i<otrmenu.all.length;i++) {
- if(otrmenu.all[i].type=="checkbox"){
- otrmenu.all[i].checked = "";
- break;
- }
- }
- }
- }
- //菜单的显示与隐藏
- function setDisplay(o){
- if(o.style.display==""){
- o.style.display="none";
- }else{
- o.style.display="";
- }
- }
- </script>
- <script language="javascript">
- //增加附件
- var num=0;
- var fg=0;
- function addfile(){
- document.getElementById("aspan").innerHTML="";
- if(num<3){
- fg=1;
- var file = document.getElementById("file");
- var tr = document.createElement("tr");
- var td = document.createElement("td");
- file.appendChild(tr);
- tr.appendChild(td);
- var vput=document.createElement("input");
- vput.setAttribute("type","file");
- vput.setAttribute("name","myfile"+num);
- /* vput.setAttribute("name","fileb"+fg);*/
- var str="<input type='button' value='删除' onclick='delefile(this);'/>";
- td.innerHTML =str+" ";
- td.appendChild(vput);
- num = num + 1;
- }else
- if (num >= 3){
- document.getElementById("aspan").innerHTML="<font color="red">[最多只能添加三个附件]</font>";
- }
- }
- //删除附件
- function delefile(img){
- document.getElementById("aspan").innerHTML="";
- var tdy=document.getElementById("tdy");
- var tr=img.parentElement.parentElement;
- file.removeChild(tr);
- num--;
- }
- //发送验证
- function send(){
- var user = document.getElementsByName("checkeduserList");
- var flag = false;
- for(var i=0; i<user.length; i++){
- if(user[i].checked){
- flag = true;
- }
- }
- if(flag == false){
- alert("请选择发送用户");
- return false;
- }
- var title = document.getElementById("title");
- if(title.value.length<=0){
- alert("发送主题不能为空");
- title.focus();
- return false;
- }
- var content = document.getElementById("content");
- if(content.value.length<=0){
- alert("请填写发送的内容");
- return false;
- }
- /*var isfujian = document.getElementById("isfujian");
- if(num>0){
- isfujian.value="1";
- }else{
- isfujian.value="0";
- }*/
- }
- //存草稿
- function saveletter(){
- var title = document.getElementById("title");
- if(title.value.length<=0){
- title.value="来自${requestScope.user.username}的邮件";
- }
- var method = document.getElementById("method");
- method.value="saveletter";
- }
- </script>
- <style>
- <!--
- a{TEXT-DECORATION:none; color:#000000}
- body{ font-size:12px}
- -->
- </style>
- </head>
- <body>
- <html:form action="/email" enctype="multipart/form-data" >
- <html:hidden property="method" value="sendEmail" />
- <html:hidden property="isfujian" value="" />
- <html:hidden property="emailtype" value="" />
- <html:hidden property="isread" value="0" />
- <table width="100%" border="1">
- <tr>
- <td>
- 收件人
- </td>
- <td>
- <font color="#FF0000">请从右边公司列表里选择</font>
- </td>
- <td>
- 公司员工列表
- </td>
- </tr>
- <tr>
- <td>
- 主题
- </td>
- <td>
- <html:text property="title" name="emailForm" />
- <html:errors property="title" />
- </td>
- <td rowspan="5" valign="top">
- <table>
- <tr>
- <td>
- <input type="checkbox" name="m1" onclick="selectChild(this);">
- <span onclick="setDisplay(m1_menu);" style="cursor: hand" id="${requestScope.company.comid}"> ${requestScope.company.comName} </span>
- </td>
- </tr>
- <tr id="m1_menu" style="">
- <td>
- <table>
- <%int i = 10;%>
- <logic:iterate id="dept" name="company" property="deptList">
- <tr>
- <%i++;%>
- <td>
-
- <input type="checkbox" name="m<%=i%>" onclick="selectChild(this);selectRoot(this);">
- <span onclick="setDisplay(m<%=i%>_menu);" style="cursor: hand"> ${dept.dname} </span>
- </td>
- </tr>
- <tr id="m<%=i%>_menu">
- <td>
- <logic:iterate id="user" name="dept" property="userList">
-
- <!-- <input type="checkbox" name="userList" onclick="selectParent(this);" />-->
- <html:multibox property="checkeduserList" onclick="selectParent(this);" value="${user.uname},${user.uno}">
- </html:multibox>
- <a href="#">${user.uname}</a>
- <br>
- </logic:iterate>
- </td>
- </tr>
- </logic:iterate>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <span style="margin-right:20px" />
- <table width="100%" border="0" align="center" valign="midden" cellpadding="0" cellspacing="0">
- <tr>
- <td colspan="3" align="left">
- <!--javascript:addfile(); -->
- <a href="#">添加附件</a> <SPAN id="aspan"></SPAN>
- </td>
- </tr>
- <TR>
- <TD colspan="2">
- <TABLE id="uptable">
- <TBODY id="file">
- <tr>
- <td>
- <input type="file" name="file1" />
- </td>
- <td>
- <html:errors name="fileerror1" />
- </td>
- </tr>
- <tr>
- <td>
- <input type="file" name="file2" />
- </td>
- <td>
- <html:errors name="fileerror2" />
- </td>
- </tr>
- <tr>
- <td>
- <input type="file" name="file3" />
- </td>
- <td>
- <html:errors name="fileerror3" />
- </td>
- </tr>
- </TBODY>
- </TABLE>
- </TD>
- </TR>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <html:hidden property="content" value="${emailForm.content}" />
- <IFRAME ID="eWebEditor1" src="${pageContext.request.contextPath}/editor/eWebEditor.jsp?id=content&style=standard" frameborder="0" scrolling="no" width="650" height="350">
- </IFRAME>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <input type="submit" value="发送" name="dd" onclick="content.value=eWebEditor1.getHTML(); return send();" />
- <input type="submit" value="存草稿" onclick="content.value=eWebEditor1.getHTML(); return saveletter();"/>
- <input type="button" value="返回" onclick="history.back();" />
- </td>
- </tr>
- </table>
- </html:form>
- </body>
- </html>