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

📄 workplan_edit.jsp

📁 oa 源代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import = "java.net.URLEncoder"%>
<%@ page import = "java.util.*"%>
<%@ page import = "cn.js.fan.util.*"%>
<%@ page import = "cn.js.fan.web.*"%>
<%@ page import = "com.redmoon.oa.workplan.*"%>
<%@ page import = "com.redmoon.oa.kernel.*"%>
<%@ page import = "com.redmoon.oa.dept.*"%>
<%@ page import = "com.redmoon.oa.person.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>工作计划编辑</title>
<link href="../common.css" rel="stylesheet" type="text/css">
<script src="../inc/common.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

var selUserNames = "";
var selUserRealNames = "";

function getSelUserNames() {
	return selUserNames;
}

function getSelUserRealNames() {
	return selUserRealNames;
}

function setUsers(users, userRealNames) {
	if (doWhat=="users") {
		form1.users.value = users;
		form1.userRealNames.value = userRealNames;
	}
	if (doWhat=="principal") {
		form1.principal.value = users;
		form1.principalRealNames.value = userRealNames;
	}
}

var doWhat = "";

function openWinUsers() {
	doWhat = "users";
	selUserNames = form1.users.value;
	selUserRealNames = form1.userRealNames.value;
	showModalDialog('../user_multi_sel.jsp',window.self,'dialogWidth:600px;dialogHeight:480px;status:no;help:no;')
}

function openWinPrincipal() {
	doWhat = "principal";
	selUserNames = form1.principal.value;
	selUserRealNames = form1.principalRealNames.value;
	showModalDialog('../user_multi_sel.jsp',window.self,'dialogWidth:600px;dialogHeight:480px;status:no;help:no;')
}

function openWinDepts() {
	var ret = showModalDialog('../dept_multi_sel.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')
	if (ret==null)
		return;
	form1.deptNames.value = "";
	form1.depts.value = "";
	for (var i=0; i<ret.length; i++) {
		if (form1.deptNames.value=="") {
			form1.depts.value += ret[i][0];
			form1.deptNames.value += ret[i][1];
		}
		else {
			form1.depts.value += "," + ret[i][0];
			form1.deptNames.value += "," + ret[i][1];
		}
	}
	if (form1.depts.value.indexOf("<%=DeptDb.ROOTCODE%>")!=-1) {
		form1.depts.value = "<%=DeptDb.ROOTCODE%>";
		form1.deptNames.value = "全部";
	}
}

function getDepts() {
	return form1.depts.value;
}
//-->
</script>
<script src="../inc/calendar.js"></script>
<style type="text/css">
<!--
.style2 {font-size: 14px}
-->
</style>
</head>
<body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
<jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
<%
String priv="read";
if (!privilege.isUserPrivValid(request, priv)) {
	out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
	return;
}

int id = ParamUtil.getInt(request, "id");
WorkPlanMgr wpm = new WorkPlanMgr();
WorkPlanDb wpd = null;
// 由这里来检查权限
try {
	wpd = wpm.getWorkPlanDb(request, id, "edit");
}
catch (ErrMsgException e) {
	out.print(StrUtil.Alert_Back(e.getMessage()));
	return;
}

String beginDate = DateUtil.format(wpd.getBeginDate(), "yyyy-MM-dd");
String endDate = DateUtil.format(wpd.getEndDate(), "yyyy-MM-dd");
%>
<%@ include file="workplan_inc_menu_top.jsp"%>
<br>
<table class="main" cellSpacing="1" cellPadding="2" width="600" align="center" border="0">
<form action="workplan_do.jsp?op=modify&id=<%=id%>" name="form1" method="post" enctype="multipart/form-data">
  <tbody>
    <tr>
      <td colspan="2" noWrap class="right-title">修改计划</td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>计划名称:</td>
      <td class="TableData"><input name="title" id="title" size="36" maxLength="200" value="<%=wpd.getTitle()%>">
	  <input type=hidden name="id" value="<%=wpd.getId()%>">
	  </td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>计划内容:</td>
      <td class="TableData"><textarea name="content" cols="45" rows="5" wrap="yes" id="content"><%=wpd.getContent()%></textarea></td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>有效期:</td>
      <td class="TableData">开始日期:
		<input readonly type="text" id="beginDate" name="beginDate" size="10" onClick="showcalendar(event, this)" onFocus="showcalendar(event, this);if(this.value=='0000-00-00') this.value=''" value="<%=beginDate%>">
           为空则立即生效<br>
        结束日期: 
		<input readonly type="text" id="endDate" name="endDate" size="10" onClick="showcalendar(event, this)" onFocus="showcalendar(event, this);if(this.value=='0000-00-00') this.value=''" value="<%=endDate%>"></td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>计划类型:</td>
      <td class="TableData">
	  <%
	  WorkPlanTypeDb wptd = new WorkPlanTypeDb();
	  String opts = "";
	  Iterator ir = wptd.list().iterator();
	  while (ir.hasNext()) {
	  	wptd = (WorkPlanTypeDb)ir.next();
	  	opts += "<option value='" + wptd.getId() + "'>" + wptd.getName() + "</option>";
	  }
	  %>
	  <select name="typeId" id="typeId">
	  <%=opts%>
      </select>
	  <script>
	  form1.typeId.value = "<%=wpd.getTypeId()%>";
	  </script>	  </td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>发布范围(部门):</td>
      <td class="TableData">
	  <%
	  String[] arydepts = wpd.getDepts();
	  String[] aryusers = wpd.getUsers();
	  String depts = "";
	  String deptNames = "";
	  String users = "";
	  String userRealNames = "";
	  String principal = "";
	  String principalRealNames = "";
	  
	  int len = 0;
	  if (arydepts!=null) {
	  	len = arydepts.length;
		DeptDb dd = new DeptDb();
	  	for (int i=0; i<len; i++) {
			if (depts.equals("")) {
				depts = arydepts[i];
				dd = dd.getDeptDb(arydepts[i]);
				deptNames = dd.getName();
			}
			else {
				depts += "," + arydepts[i];
				dd = dd.getDeptDb(arydepts[i]);
				deptNames += "," + dd.getName();
			}
		}
	  }
	  
	  if (aryusers!=null) {
	  	len = aryusers.length;
		//DeptDb dd = new DeptDb();
	  	for (int i=0; i<len; i++) {
			if (users.equals("")) {
				users = aryusers[i];
				UserDb ud = new UserDb();
				ud = ud.getUserDb(aryusers[i]);
				userRealNames = ud.getRealName();
			}
			else {
				users += "," + aryusers[i];
				UserDb ud = new UserDb();
				ud = ud.getUserDb(aryusers[i]);
				userRealNames += "," + ud.getRealName();
			}
		}
	  }
	  %>
	  	  <input type="hidden" name="depts" value="<%=depts%>">
          <textarea name="deptNames" cols="45" rows="5" readOnly wrap="yes" id="deptName"><%=deptNames%></textarea>
        &nbsp;
        <input class="SmallButton" title="添加部门" onClick="openWinDepts()" type="button" value="添 加" name="button">
        &nbsp;
        <input class="SmallButton" title="清空部门" onClick="form1.deptNames.value='';form1.depts.value=''" type="button" value="清 空" name="button"></td>
    </tr>
    <tr>
      <td class="TableContent" noWrap>参与人:</td>
      <td class="TableData">
          <textarea name="userRealNames" cols="45" rows="3" readOnly wrap="yes" id="userRealNames"><%=userRealNames%></textarea>

⌨️ 快捷键说明

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