📄 sells_collection.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<jsp:directive.page import="com.captainli.dboperation.BankDA"/>
<jsp:directive.page import="com.captainli.struts.form.LoginForm"/>
<jsp:directive.page import="com.captainli.dboperation.LoginDA"/>
<jsp:directive.page import="java.text.SimpleDateFormat"/>
<jsp:directive.page import="com.captainli.dboperation.intercourseDA"/>
<jsp:directive.page import="com.captainli.dboperation.CollectionDA"/>
<jsp:directive.page import="com.captainli.struts.form.IntercourseForm"/>
<jsp:directive.page import="com.captainli.struts.form.BankForm"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'sells_collection.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="../css/sys.css">
<style type="text/css">
<!--
body {
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
background-color: #FFFFFF;
}
a:link {
color: #1A438E;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: underline;
}
.style5 {font-size: large}
</style>
<script language="javascript" type="text/javascript">
function yinhangsub(){
var cid = document.getElementById("c_b_id").value;
createRequest("../utilPages/show_bank_money_ajax.jsp?b_id="+cid);
}
</script>
<script type="text/javascript" language="javascript">
var http_request = false;
function createRequest(url) {
//初始化对象并发出XMLHttpRequest请求
http_request = false;
if (window.XMLHttpRequest) { // Mozilla或其他除IE以外的浏览器
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType("text/xml");
}
} else if (window.ActiveXObject) { // IE浏览器
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert("不能创建XMLHTTP实例!");
return false;
}
http_request.onreadystatechange = alertContents; //指定响应方法
//发出HTTP请求
http_request.open("GET", url, true);
http_request.setRequestHeader("If-Modified-Since","0");
http_request.send(null);
}
function alertContents() { //处理服务器返回的信息
if (http_request.readyState == 4) {
if (http_request.status == 200) {
jine.innerHTML=http_request.responseText;
} else {
alert('您请求的页面发现错误');
}
}
}
</script>
<script language="javascript" type="text/javascript">
function go(){
var ciid = document.getElementById("c_i_id").value;
var clid = document.getElementById("c_l_id").value;
var cnote = document.getElementById("c_note").value;
var cbid = document.getElementById("c_b_id").value;
var csett = document.getElementById("c_sett").value;
var cno = document.getElementById("c_no").value;
if(ciid == "0"){
alert("请选择客户!");
form1.c_i_id.focus();
return false;
}
if(clid == "0"){
alert("请确定经手人!");
form1.c_l_id.focus();
return false;
}if(cbid == "0"){
alert("请选择银行帐务!");
form1.c_b_id.focus();
return false;
}
document.getElementById("collectionframe").src = "sells_collection_frame.jsp?c_no="+cno+"&c_i_id="+ciid+"&c_l_id="+clid+"&c_b_id="+cbid+"&c_sett="+csett+"&c_note="+cnote+"";
}
function sub(){
var ciid = document.getElementById("c_i_id").value;
var clid = document.getElementById("c_l_id").value;
var cnote = document.getElementById("c_note").value;
var cbid = document.getElementById("c_b_id").value;
var csett = document.getElementById("c_sett").value;
var cno = document.getElementById("c_no").value;
if(ciid == "0"){
alert("请选择客户!");
form1.c_i_id.focus();
return false;
}
if(clid == "0"){
alert("请确定经手人!");
form1.c_l_id.focus();
return false;
}if(cbid == "0"){
alert("请选择银行帐务!");
form1.c_b_id.focus();
return false;
}if(csett == ""){
alert("请输入要结算金额数!");
form1.c_sett.focus();
return false;
}
}
function showColl(){
window.location.href="sells_collection_sel.jsp";
}
</script>
</head>
<%
ArrayList arryBank = new BankDA().showBank();//银行帐务集合
String[] user = null;//经手人
if(session.getAttribute("users") != null){
LoginForm form = (LoginForm)session.getAttribute("users");
String tmp = new LoginDA().showUserName(form);
user = tmp.split(",");
}
//获得系统时间
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String c_time = sdf.format(cal.getTime());
//获得客户
ArrayList arryInt = new intercourseDA().showIntercourseByType(1);
//获得收款单编号
String c_no = "";
Calendar caltmp1 = Calendar.getInstance();
SimpleDateFormat sdftmp1 = new SimpleDateFormat("yyyyMMdd");
String timetmp1 = sdftmp1.format(caltmp1.getTime());
String tmpTime1 = new CollectionDA().selectMaxNo(timetmp1);
Calendar caltmp2 = Calendar.getInstance();
SimpleDateFormat sdftmp2 = new SimpleDateFormat("HHmmss");
String timetmp2 = sdftmp2.format(caltmp2.getTime());
if(tmpTime1 == null){
c_no = "DZSK" + timetmp1 + timetmp2 + "0001";
}else{
String tmpNo = String.valueOf((Integer.parseInt(tmpTime1.substring(18, 22)) + 1));
if(tmpNo.length() == 1){
c_no = "DZSK" + timetmp1 + timetmp2 + "000" + tmpNo;
}else if(tmpNo.length() == 2){
c_no = "DZSK" + timetmp1 + timetmp2 + "00" + tmpNo;
}else{
c_no = "DZSK" + timetmp1 + timetmp2 + "0" + tmpNo;
}
}
%>
<body>
<br>
<form name="form1" method="post" action="../collection.do?method=addCollection">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35%"> </td>
<td width="30%" rowspan="2" align="center" valign="middle"><span class="style5">收款单</span></td>
<td width="35%" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%" align="right">日期:</td>
<td width="71%"><input name="c_time" type="text" id="c_time" value="<%= c_time %>" style="width:100%; "></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%" align="right">付款单编号:</td>
<td width="71%"><input name="c_no" type="text" id="c_no" value="<%= c_no %>" style="width:100%; "></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/system/r_1.gif" alt="" /></td>
<td width="100%" background="../images/system/r_0.gif"><table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="7%" align="right">客户:</td>
<td width="25%"><select name="c_i_id" id="c_i_id" style="width:100% ">
<option value="0">--请选择客户--</option>
<%
for(int i = 0;i < arryInt.size();i++){
IntercourseForm form = (IntercourseForm)arryInt.get(i);
%>
<option value="<%= form.getI_id() %>"><%= form.getI_name() %></option>
<%} %>
</select></td>
<td width="7%" align="right">经手人:</td>
<td width="7%"><select name="c_l_id" id="c_l_id" style="width:100% ">
<option value="0"></option>
<option value="<%= user[0] %>"><%= user[1] %></option>
</select></td>
<td width="6%" align="right">备注:</td>
<td width="48%"><input name="c_note" type="text" id="c_note" style="width:100% "></td>
</tr>
</table></td>
<td><img src="../images/system/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td><table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr align="center">
<td width="70"> </td>
<td width="213" height="30"> </td>
<td width="320"><strong>金额(元)</strong></td>
<td width="321"><strong>结算金额(元)</strong></td>
</tr>
<tr>
<td align="right">银行帐务:</td>
<td align="center" height="25"><select id="c_b_id" name="c_b_id" style="width:100% " onChange="yinhangsub()">
<option value="0">--请选择银行帐务--</option>
<%
for(int i = 0;i < arryBank.size();i++){
BankForm form = (BankForm)arryBank.get(i);
%>
<option value="<%= form.getB_id() %>"><%= form.getB_name() %></option>
<%} %>
</select></td>
<td align="center" id="jine"> </td>
<td align="center"><input name="c_sett" type="text" id="c_sett" style="width:100%; text-align:center " onKeyUp="value=value.replace(/[^\d.]/g,'')"></td>
</tr>
<tr>
<td colspan="10" height="30" class="category"><table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="20%" align="left" style="color:#FF0000;"> </td>
<td width="80%" align="right"><input name="Submit" type="button" class="button" value=" 收款单查询 " onclick="return showColl()">
<input name="Submit" type="button" class="button" value=" 按单结算 " onclick="return go()">
<input name="Submit" type="submit" class="button" value=" 过帐结算 " onclick="return sub()"></td>
</tr>
</table></td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td><img src="../images/system/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/system/r_3.gif" alt="" /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><hr style="color:#EFF7FF "></td>
</tr>
</table>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><iframe scrolling='no' width="100%" height="100%" frameborder="0" name="collectionframe" id="collectionframe" src=""></iframe></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -