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

📄 purchase_payment.jsp

📁 医药供应链管理系统
💻 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.struts.form.IntercourseForm"/>
<jsp:directive.page import="com.captainli.dboperation.PaymentDA"/>
<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 'purchase_payment.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 bid = document.getElementById("p_b_id").value;
	createRequest("../utilPages/show_bank_money_ajax.jsp?b_id="+bid);
	
}
</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 piid = document.getElementById("p_i_id").value;
	var plid = document.getElementById("p_l_id").value;
	var pnote = document.getElementById("p_note").value;
	var pbid = document.getElementById("p_b_id").value;
	var psett = document.getElementById("p_sett").value;
	var pno = document.getElementById("p_no").value;
	if(piid == "0"){
		alert("请选择供应商!");
		form1.p_i_id.focus();
		return false;
	}
	if(plid == "0"){
		alert("请确定经手人!");
		form1.p_l_id.focus();
		return false;
	}if(pbid == "0"){
		alert("请选择银行帐务!");
		form1.p_b_id.focus();
		return false;
	}
	document.getElementById("paymentframe").src = "purchase_payment_frame.jsp?p_no="+pno+"&p_i_id="+piid+"&p_l_id="+plid+"&p_b_id="+pbid+"&p_sett="+psett+"&p_note="+pnote+"";
}
function sub(){
	var piid = document.getElementById("p_i_id").value;
	var plid = document.getElementById("p_l_id").value;
	var pnote = document.getElementById("p_note").value;
	var pbid = document.getElementById("p_b_id").value;
	var psett = document.getElementById("p_sett").value;
	var pno = document.getElementById("p_no").value;
	if(piid == "0"){
		alert("请选择供应商!");
		form1.p_i_id.focus();
		return false;
	}
	if(plid == "0"){
		alert("请确定经手人!");
		form1.p_l_id.focus();
		return false;
	}if(pbid == "0"){
		alert("请选择银行帐务!");
		form1.p_b_id.focus();
		return false;
	}if(psett == ""){
		alert("请输入要结算金额数!");
		form1.p_sett.focus();
		return false;
	}
}
function showPay(){
	window.location.href="purchase_payment_sel.jsp";
}
</script>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></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 p_time = sdf.format(cal.getTime());
    //获得供应商
    ArrayList arryInt = new intercourseDA().showIntercourseByType(2);
    //获得付款单编号
    String p_no = "";
    Calendar caltmp1 = Calendar.getInstance();
    SimpleDateFormat sdftmp1 = new SimpleDateFormat("yyyyMMdd");
    String timetmp1 = sdftmp1.format(caltmp1.getTime());
    String tmpTime1 = new PaymentDA().selectMaxNo(timetmp1);
    
    Calendar caltmp2 = Calendar.getInstance();
    SimpleDateFormat sdftmp2 = new SimpleDateFormat("HHmmss");
    String timetmp2 = sdftmp2.format(caltmp2.getTime());
    
    if(tmpTime1 == null){
    	p_no = "DZFK" + timetmp1 + timetmp2 + "0001";
    }else{
    	String tmpNo = String.valueOf((Integer.parseInt(tmpTime1.substring(18, 22)) + 1));
    	if(tmpNo.length() == 1){
    		p_no = "DZFK" + timetmp1 + timetmp2 + "000" + tmpNo;
    	}else if(tmpNo.length() == 2){
    		p_no = "DZFK" + timetmp1 + timetmp2 + "00" + tmpNo;
    	}else{
    		p_no = "DZFK" + timetmp1 + timetmp2 + "0" + tmpNo;
    	}
    }   
 %> 
  <body>
  <br>
  <form name="form1" method="post" action="../payment.do?method=addPayment">
    <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%">&nbsp;</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="p_time" type="text" id="p_time" value="<%= p_time %>" style="width:100%; "></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td>&nbsp;</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="p_no" type="text" id="p_no" value="<%= p_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="p_i_id" id="p_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="p_l_id" id="p_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="p_note" type="text" id="p_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">&nbsp;</td>
                      <td width="213" height="30">&nbsp;</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="p_b_id" name="p_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">&nbsp;</td>
                      <td align="center"><input name="p_sett" type="text" id="p_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;">&nbsp;</td>
                            <td width="80%" align="right"><input name="Submit" type="button" class="button" value=" 付款单查询 " onclick="return showPay()">
                            <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="paymentframe" id="paymentframe" src=""></iframe></td>
              </tr>
            </table></td>
      </tr>
    </table>
  </form>
  </body>
</html>

⌨️ 快捷键说明

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