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

📄 plandepartment.asp

📁 物业管理和办公自动化系统
💻 ASP
字号:
<%
'************************************************************************************************
' 文件名: plandepartment.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'
'  创建人 : 蔡晓燕
'  日 期 : 2002-06-14
' 修改历史 :
'   ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 本页面是为部门经理设计的,应该用部门经理的账号登录
'			本页面包括部门工作计划的查询和新增、维护,输入查询条件(指定计划种类,时间),列出查询结果
'  版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>

<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/emp.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->
<!-- #include file="../common/commonpage.inc" -->
<!-- #include file="plandepartment.inc" -->

<%
call CheckSecurity()

'********************************************************************************************************
' 服务器端代码

'-------------------------------------------------------------------------------------------------------------------'********************************************************************************************************
' 如果是提交,则调用函数UpdateDiary()更新数据库
if UCase(Request.ServerVariables("REQUEST_METHOD") = "POST")  and (Request.Form("formAction") <> "quetype")then
	UpdatePlan()
end if
'------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName			: sFileName = "plandepartment.asp"
Dim iEmpSerial			: iEmpserial = GetEmpSerial
Dim iDepartmentId		:iDepartmentId = GetDepartmentId
Dim iTotalRecords		: iTotalRecords = 0			' 分页
Dim iRecordsPerPage	: iRecordsPerPage = 5
Dim iTotalPages			: iTotalPages = 0
Dim iCols					: iCols = 6
Dim iCurrentPage		: iCurrentPage = GetParam("Page")
Dim iSort					: iSort = GetParam("Sorting")
Dim iSorted				: iSorted = GetParam("Sorted")
Dim sSortParams		: sSortParams = ""
Dim sFormParams		: sFormParams = ""
Dim sDirection			: sDirection = ""

'-------------------------------------------------------------------------------------------------------------------------------------------------
' frmSearchPlan表单提交的查询参数,计划种类,年份,月份,季度,默认值为当年当月月度计划表
' frmUpdatePlan表单提交的个人工作计划参数,计划种类,年份,月份,季度,本月计划完成的工作,实施目标和措施,完成进度,责任人,备注
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim iSerial  :	iSerial = GetParam("serial")'在更新工作计划的时候传过来的参数,指该计划在T_Plan_Detail.Serial的值。
Dim iPlanSerial : iPlanSerial = GetParam("plan_serial")
Dim iType  :	iType = GetParam("type")
Dim iOf_year  : iOf_year = GetParam("of_year")
Dim iOf_month  : iOf_month = GetParam("of_month")
Dim iOf_season  : iOf_season = GetParam("of_season")
Dim sContent:		sContent = GetParam("content")
Dim sTarget:		sTarget = GetParam("Target")
Dim sProgress:		sProgress = GetParam("Progress")
Dim sHandler:		sHandler = GetParam("handler")
Dim sMemo:		sMemo = GetParam("memo")
Dim sAction:	sAction = GetParam("formAction")'包括quetype,addtype,updtype,deltype四种  

'如果iPlanSerial<>"",那么iType,iOf_year,iOf_month,iOf_season的值由iPlanSerial得到
if (iPlanSerial <> "") and (not Isnull(iPlanSerial)) and (not IsEmpty(iPlanSerial)) then
	sSQL = "select * from T_plan where serial = "&iPlanSerial
	dim crs	: set crs = New CRecordset
	dim rs	: set rs = crs.open(dbLocal,sSQL)
	if not rs.EOF then
		iType = crs.GetValue("type")
		iOf_year = crs.GetValue("of_year")
		iOf_month = crs.GetValue("of_month")
		iOf_season = crs.GetValue("of_season")
	end if
	crs.Close()
end if

'以下代码确定缺省的查询参数
if IsEmpty(iType) then iType = 1
if IsEmpty(iOf_year) then iOf_year = year(date)
if IsEmpty(iOf_month) or Isnull(iOf_month) or (iOf_month = "") then iOf_month = month(date)
if IsEmpty(iOf_season) or Isnull(iOf_season)  or (iOf_season = "") then iOf_season = 1
sFormParams = "type=" & iType & "&of_year=" & iOf_year & "&of_month=" & iOf_month & "&of_season=" & iOf_season & "&"
'********************************************************************************************************
' 根据查询的计划类型不同,构造分页的SQL语句
'********************************************************************************************************
select case iType 
case 1'月度个人计划查询
	sSQL = "select * from T_Plan_Detail where plan_serial = (select serial from T_Plan where type = " &_
	ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and of_month = " & ToSQL(iOf_month, "Number") & " and scope = 2" & " and node = "& iDepartmentId & ")"
case 2'季度个人计划查询
	sSQL = "select * from T_Plan_Detail where plan_serial = (select serial from T_Plan where type = " &_
	ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and of_season = " & ToSQL(iOf_season, "Number") & " and scope = 2" & " and node = "& iDepartmentId & ")"
case 3'年度个人计划查询
	sSQL = "select * from T_Plan_Detail where plan_serial = (select serial from T_Plan where type = " &_
	ToSQL(iType, "Number") & " and of_year = " & ToSQL(iOf_year, "Number") & " and scope = 2" & _
	" and node = "& iDepartmentId & ")"
end select

sOrderby = " order by T_Plan_Detail.serial"
'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(4), sDelimiter
sDelimiter = "*"
arrayFields(0) = "content"
arrayFields(1) = "target"
arrayFields(2) = "progress"
arrayFields(3) = "handler"
arrayFields(4) = "memo"
call PrepareListData(sSQL & sWhere & sOrderBy, Join(arrayFields, sDelimiter), sDelimiter)

'********************************************************************************************************

%>

<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../common/common.css" type="text/css">
<script language="VBScript" src="../common/validate.vbs"></script>
<script language="VBScript" src="plantypechange.vbs"></script>
<script language="VBScript">
Sub btnSearch_OnClick()
	document.all.frmSearchPlan.submit()
End Sub

Sub btnUpdate_OnClick()
	dim sError
	sError = ValidateText("document.all.frmUpdatePlan.content", "工作计划", true, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.target", "实施目标和措施", false, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.progress", "完成进度", false, 25)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.handler", "责任人", false, 25)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.memo", "备注", false, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	document.all.frmUpdatePlan.formAction.value = "updtype"
	document.all.frmUpdatePlan.submit()
End Sub

Sub btnDelete_OnClick()
	if  DeleteConfirm("这条工作计划") then
		document.all.frmUpdatePlan.formAction.value = "deltype"
		document.all.frmUpdatePlan.submit()
	end if
End Sub

Sub btnAdd_OnClick()
	dim sError
	sError = ValidateText("document.all.frmUpdatePlan.content", "工作计划", true, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.target", "实施目标和措施", false, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.progress", "完成进度", false, 25)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.handler", "责任人", false, 25)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	sError = ValidateText("document.all.frmUpdatePlan.memo", "备注", false, 50)
	if sError <> "" then
		msgbox sError
		exit sub
	end if
	document.all.frmUpdatePlan.formAction.value = "addtype"
	document.all.frmUpdatePlan.submit()
End Sub

Sub btnReset_OnClick()
	document.all.frmUpdatePlan.reset()
End Sub

Sub btnClear_OnClick()
	document.all.frmUpdatePlan.reset()
End Sub

Sub btnCancel_OnClick()
	document.all.frmUpdatePlan.formAction.value = "cancel"
	document.all.frmUpdatePlan.submit()
End Sub

</script>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>

<%
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader
'********************************************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------------------------
Response.Write TableSearch
select case iType
case 1
	Response.Write MonthTableHeader
case 2
	Response.Write SeasonTableHeader
case 3
	Response.Write YearTableHeader
end select
Response.Write TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write FormUpdatePlan
Response.Write TableLink()
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>

</body>
</html>

⌨️ 快捷键说明

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