📄 dispatch.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ 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 uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath()%>/html/css/style.css"
rel="stylesheet" type="text/css">
<script src="<%=request.getContextPath()%>/html/script/common.js"></script>
<script src="<%=request.getContextPath()%>/html/script/cal/calShow.js"></script>
<script
src="<%=request.getContextPath()%>/html/script/cal/calendar.js"></script>
<script
src="<%=request.getContextPath()%>/html/script/cal/calendar-en.js"></script>
<link type="text/css" rel="stylesheet"
href="<%=request.getContextPath()%>/html/script/cal/calendar-system.css" />
<script>
function doSearch(){
var name = document.forms['searchForm'].elements['serviceCondition.customersName'].value;
var gaiyao= document.forms['searchForm'].elements['serviceCondition.serviceSummary'].value;
var type=document.forms['searchForm'].elements['serviceCondition.type'].value;
var time=document.forms['searchForm'].elements['serviceCondition.createrDatetimeStr'].value;
document.forms['pageForm'].elements['serviceCondition.customersName'].value=name;
document.forms['pageForm'].elements['serviceCondition.serviceSummary'].value=gaiyao;
document.forms['pageForm'].elements['serviceCondition.createrDatetimeStr'].value=time;
document.forms['pageForm'].elements['serviceCondition.type'].value=type;
document.forms['searchForm'].action="<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['searchForm'].submit();
}
function getuserId(obj1,obj2){
var select = document.getElementById(obj1);
var userid= select.value;
document.getElementById(obj2).value=userid;
}
function doAssign(obj1,obj2){
var serviceid=document.getElementById(obj1).value;
var userid=document.getElementById(obj2).value;
if(serviceid=="" || userid=="")
{
alert("用户ID丢失");
return false;
}
var url="<%=request.getContextPath()%>/service.do?method=doAssign&sid="+serviceid+"&uid="+userid;
to(url);
}
function delcustomer(obj1,obj2){
var url="<%=request.getContextPath()%>/service.do?method=doDeleteService&sid="+obj1;
if(window.confirm("确定删除客户:"+obj2+"?")){
to(url);}
}
</script>
</head>
<body>
<div class="page_title">
客户服务管理 > 服务分配
</div>
<div class="button_bar">
<button class="common_button" onclick="help('');">
帮助
</button>
<button class="common_button" onclick="doSearch();">
查询
</button>
</div>
<table class="query_form_table" height="53">
<html:form action="/service" method="post" styleId="searchForm">
<tr>
<th height="28">
客户
</th>
<td>
<html:text property="serviceCondition.customersName" />
</td>
<th height="28">
概要
</th>
<td>
<html:text property="serviceCondition.serviceSummary" />
</td>
<th height="28">
服务类型
</th>
<td>
<html:select property="serviceCondition.type">
<html:option value="">请选择...</html:option>
<c:forEach items="${servicetype}" var="servicetype">
<html:option value="${servicetype.baseName}">${servicetype.baseName}</html:option>
</c:forEach>
</html:select>
</td>
</tr>
<tr>
<th height="22">
创建日期
</th>
<td colspan="3">
<html:text property="serviceCondition.createrDatetimeStr"
size="10" onclick="calShow('creattime');"
onfocus="calShow('creattime');" readonly="readonly"
styleId="creattime" />
</td>
<th height="22">
状态
</th>
<td>
<select name="D1">
<option selected>
新创建
</option>
</select>
</td>
</tr>
</html:form>
</table>
<br />
<table class="data_list_table">
<tr>
<th>
编号
</th>
<th>
客户
</th>
<th>
概要
</th>
<th>
服务类型
</th>
<th>
创建人
</th>
<th>
创建日期
</th>
<th>
分配给
</th>
<th>
操作
</th>
</tr>
<c:forEach items="${servicelist}" var="service">
<tr>
<td class="list_data_number">
${service.serviceId }
</td>
<td class="list_data_text">
${service.customersName }
</td>
<td class="list_data_ltext">
${service.serviceSummary }
</td>
<td class="list_data_text">
${service.serviceTypeId.baseName }
</td>
<td class="list_data_text">
${service.userInfoByCreaterId.userName }
</td>
<td class="list_data_text">
<logic:notEmpty name="servicelist" scope="request">
<bean:write name="service" property="createrDatetime"
format="yyyy年MM月dd日" />
</logic:notEmpty>
</td>
<td class="list_data_text">
<form action="" id="form${service.serviceId }" method="post">
<select name="D2" id="userlist${service.serviceId }"
onchange="getuserId('userlist${service.serviceId }','user${service.serviceId }')">
<option value="">请选择...</option>
<c:forEach items="${userlist}" var="user">
<option value="${user.userId }">
${user.userName }
</option>
</c:forEach>
</select>
<input type="hidden" id="user${service.serviceId }" />
<input type="hidden" id="service${service.serviceId }"
value="${service.serviceId }" />
<button class="common_button"
onclick="doAssign('service${service.serviceId }','user${service.serviceId }');">
分配
</button>
</form>
</td>
<td class="list_data_op">
<img
onclick="delcustomer('${service.serviceId }','${service.customersName }');"
title="删除"
src="<%=request.getContextPath()%>/html/images/bt_del.gif"
class="op_button" />
</td>
</tr>
</c:forEach>
<tr>
<th colspan="8" class="pager">
<div class="pager">
<logic:empty name="servicelist" scope="request"><div style="color: red;">没有记录</div></logic:empty>
<html:form action="/service" method="post" styleId="pageForm">
<html:hidden property="serviceCondition.customersName" />
<html:hidden property="serviceCondition.serviceSummary" />
<html:hidden property="serviceCondition.type" />
<html:hidden property="serviceCondition.createrDatetimeStr" />
<logic:notEmpty name="servicelist" scope="request">
共
${count }条记录 每页显示<html:text property="serviceCondition.maxReuslts"
style="width:20px;" />条
第<html:text property="serviceCondition.pageNo" style="width:20px;" />页 / 共${pages }页
<input type="hidden" name="lastNo" value="${pages }" />
<a href="javascript:page_first();">第一页</a>
<a href="javascript:page_pre();">上一页</a>
<a href="javascript:page_next();">下一页</a>
<a href="javascript:page_last();">最后一页</a>
<button onclick="javascript:page_go();">
GO
</button>
<script>
function page_go()
{
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['pageForm'].submit();
}
function page_first()
{
document.forms['pageForm'].action = "<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['pageForm'].elements["serviceCondition.pageNo"].value = 1;
document.forms['pageForm'].submit();
}
function page_pre()
{
var pageNo = document.forms['pageForm'].elements["serviceCondition.pageNo"].value;
document.forms['pageForm'].elements["serviceCondition.pageNo"].value = parseInt(pageNo) - 1;
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['pageForm'].submit();
}
function page_next()
{
var pageNo = document.forms['pageForm'].elements["serviceCondition.pageNo"].value;
document.forms['pageForm'].elements["serviceCondition.pageNo"].value = parseInt(pageNo) + 1;
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['pageForm'].submit();
}
function page_last()
{
var lastNo = document.forms['pageForm'].elements["lastNo"].value;
document.forms['pageForm'].elements["serviceCondition.pageNo"].value = lastNo;
document.forms['pageForm'].action = "<%=request.getContextPath()%>/service.do?method=toAssignService";
document.forms['pageForm'].submit();
}
function page_validate()
{
var pageTotal = document.forms['pageForm'].elements["lastNo"].value;
var pageNo = document.forms['pageForm'].elements["serviceCondition.pageNo"].value;
if (pageNo<1)pageNo=1;
if (pageNo>pageTotal)pageNo=pageTotal;
document.forms['pageForm'].elements["serviceCondition.pageNo"].value = pageNo;
var recTotal = 18;
var pageSize = document.forms['pageForm'].elements["serviceCondition.maxReuslts"].value;
if (pageSize<1)pageSize=1;
document.forms['pageForm'].elements["serviceCondition.maxReuslts"].value = pageSize;
}
</script>
</logic:notEmpty>
</html:form>
</div>
</th>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -