<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>发货申请</title>
<script type="text/javascript">
function countTotalRealPrice(){
var productNeedNum = $("#productNeedNum").val();
var realPrice= $("#realPrice").val();
var totalRealPrice=productNeedNum*realPrice;
$("#totalRealPrice").val(totalRealPrice);
}
function countTotalTicketPrice(){
var productNeedNum = $("#productNeedNum").val();
var ticketPrice = $("#ticketPrice").val()
var totalTicketPrice= productNeedNum*ticketPrice;
$("#totalTicketPrice").val(totalTicketPrice);
}
$(function(){
$("#t1").css("display", "none");
$("#t2").css("display", "none");
$("#t3").css("display", "none");
$("#t4").css("display", "none");
$("#t5").css("display", "none");
});
/* function sumNum(){
$("input[name=productNeedNum]").each(function(){
//alert($(this).attr("id"));//每一个的id
var productNeedNum=$("#productNeedNum").attr("value")
alert(productNeedNum);
// var sum += productNeedNum;
//alert("sum:"+sum);
// $("#sum").val(sum);
});
} */
function addRow(){
var x=document.getElementById('tb1').insertRow(3);
var a=x.insertCell(0)
var b=x.insertCell(1)
var c=x.insertCell(2)
var d=x.insertCell(3)
var e=x.insertCell(4)
var f=x.insertCell(5)
var g=x.insertCell(6)
var h=x.insertCell(7)
var a1 = "<select><c:forEach items='${productIdNames}' var='p'><option value='${p.productId }'>${p.commName }</option></c:forEach></select>";
var b1="<select><c:forEach items='${typeInfos }' var='ti'><option value='${ti.typeId }'> ${ti.typeName }</option></c:forEach> </select>";
var c1 = "<select><option value='0'> 盒</option><option value='1'> 瓶</option></select>";
var d1="<input onkeyup='sum(this.id)' type='text' value='0' />";
var e1='<input onkeyup="sum(this.id)" type="text" value="0"/>';
var f1='<input onkeyup="sum(this.id)" type="text" value="0"/>';
var g1='<input type="text" value="0" />';
var h1="<input type='text' value='0' />";
a.innerHTML=a1
b.innerHTML=b1
c.innerHTML=c1
d.innerHTML=d1
e.innerHTML=e1
f.innerHTML=f1
g.innerHTML=g1
h.innerHTML=h1
}
function deleteRow(){
var tab = document.getElementById('tb1');
if(tab.rows.length > 4)
{
tab.deleteRow(tab.rows.length-2);
}else{
alertMsg.confirm("已经剩下最后一行,不能删除!");
}
}
function sum(x){
var y=document.getElementById(x).value;
if(isNaN(y)){
document.getElementById(x).value=0;
}
var num=document.getElementById("productNeedNum").value;
var realPrice=document.getElementById("realPrice").value;
var ticketPrice=document.getElementById("ticketPrice").value;
var total=0;
if(realPrice!=null){
total=num*realPrice;
document.getElementById("totalRealPrice").value=total;
}
if(ticketPrice!=null){
total=num*ticketPrice;
document.getElementById("totalTicketPrice").value=total;
}
}
</script>
</head>
<body>
<form method="post" action="${basePath}/sale/deliverSaleApply" onsubmit="return validateCallback(this,navTabAjaxDone)">
<div layoutH="56">
<div>
<table>
<tr>
<td>申请人:
<input type="text" value="${user.fullName }" disabled="true" />
</td>
<td>区域:
<select >
<c:forEach items="${areaTypes}" var="a">
<option value="${a.areaId}">${a.areaName }</option>
</c:forEach>
</select>
</td>
<td>申请日期:
<input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a>
</td>
<td>业务类型:
<input type="radio" value="0" checked="checked"/>即发
<input type="radio" value="1"/>即发即开
<input type="radio" value="2"/>其他
</td>
</tr>
</table>
<table>
<tr>
<td>收货单位全称</td>
<td><input type="text"/></td>
</tr>
</table>
<table>
<tr>
<td rowspan="80">申请发货明细</td>
<td rowspan="2">产品名称</td>
<td rowspan="2">规格</td>
<td colspan="2">数量</td>
<td colspan="2">单价</td>
<td colspan="2">结算贷款</td>
</tr>
<tr>
<td>盒/瓶</td>
<td>件</td>
<td>实价(元)</td>
<td>开票价(元)</td>
<td>实价合计(元)</td>
<td>开票价合计(元)</td>
</tr>
<tr>
<td>
<select>
<c:forEach items="${productIdNames}" var="p">
<option value="${p.productId }">${p.commName }</option>
</c:forEach>
</select>
</td>
<td>
<select>
<c:forEach items="${typeInfos }" var="ti">
<option value="${ti.typeId }"> ${ti.typeName }</option>
</c:forEach>
</select>
</td>
<td>
<select>
<option value="0"> 盒</option>
<option value="1"> 瓶</option>
</select>
</td>
<td><input type="text" value="0" onkeyup="sum(this.id)"/></td>
<td><input type="text" value="0" onkeyup="sum(this.id)"/></td>
<td><input type="text" value="0" onkeyup="sum(this.id)"/></td>
<td><input type="text" value="0" /></td>
<td><input type="text" value="0" /></td>
</tr>
<tr>
<td >合计</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table>
<tr>
<td>结算/付款方式</td>
<td colspan="7">
<input type="radio" checked="checked" value="0"/>对公
<input type="radio" value="1"/>对私
<input type="radio" value="2"/>非现
</td>
</tr>
<tr>
<td rowspan="3">发货资料</td>
<td>发货方式</td>
<td>
<select>
<option value="0">邮政</option>
<option value="1">申通</option>
<option value="2">其他</option>
</select></td>
<td>发货始限</td>
<td> <input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a></td>
<td colspan="3">
<input type="radio" checked="checked" value="0"/>普通件
<input type="radio" value="1"/>急件
</td>
</tr>
<tr>
<td>收货地址</td>
<td colspan="6"><input type="text"/></td>
</tr>
<tr>
<td>到站</td>
<td><input type="text"/></td>
<td>收货人</td>
<td><input type="text"/></td>
<td>联系方式</td>
<td colspan="2"><input type="text"/></td>
</tr>
<tr>
<td rowspan="2" >审批</td>
<td colspan="2">总经理室</td>
<td colspan="2">市场部</td>
<td colspan="3">所在区域</td>
</tr>
<tr>
<td colspan="2">
<input type="radio" checked="checked" value="0"/>不同意
<input type="radio" value="1" disabled="true"/>同意
</td>
<td colspan="2">
<input type="radio" checked="checked" value="0"/>不同意
<input type="radio" value="1" disabled="true"/>同意
</td>
<td colspan="3">
<input type="radio" checked="checked" value="0"/>不同意
<input type="radio" value="1" disabled="true"/>同意
</td>
</tr>
</table>
<table>
<tr>
<td>以下由市场部/财务部填写</td>
</tr>
</table>
<table>
<tr>
<td rowspan="4">贷款给付情况</td>
<td>入账时间</td>
<td>入账银行 账号/卡号</td>
<td>入账金额</td>
<td colspan="2">经办人</td>
</tr>
<tr>
<td><input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a></td>
<td><input type="text"/></td>
<td><input type="text"/></td>
<td><input disabled="true" type="text" value="${user.fullName}"/></td>
</tr>
</table>
<table>
<tr>
<td rowspan="2">发运情况</td>
<td>发运时间</td>
<td>
<input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a>
</td>
<td>经办人</td>
<td><input disabled="true" type="text" value="${user.fullName}"/></td>
<td>《内部发货单》号码</td>
</tr>
<tr>
<td>承运单位</td>
<td><input type="text"/></td>
<td>运单号码</td>
<td><input type="text"/></td>
<td><input type="text"/></td>
</tr>
</table>
<table>
<tr>
<td rowspan="4">申请开票事项</td>
<td >客户(收票)全称</td>
<td colspan="4"><input type="text"/></td>
</tr>
<tr>
<td>单位地址</td>
<td colspan="4"><input type="text"/></td>
</tr>
<tr>
<td>单位税号</td>
<td colspan="2"><input type="text"/></td>
<td>电话</td>
<td><input type="text"/></td>
</tr>
<tr>
<td>开户银行</td>
<td colspan="2"><input type="text"/></td>
<td>账号</td>
<td><input type="text"/></td>
</tr>
<tr>
<td rowspan="4">发票开具领用情况</td>
<td>开票时间</td>
<td colspan="2"><input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a></td>
<td>发票号码</td>
<td><input type="text"/></td>
</tr>
<tr>
<td rowspan="3">开票款额</td>
<td>金额</td>
<td><input type="text"/></td>
<td>领票人</td>
<td><input type="text"/></td>
</tr>
<tr>
<td>税额</td>
<td><input type="text"/></td>
<td>领票时间</td>
<td>
<input type="text" readonly="readonly"/>
<a href="javascript:;">选择</a>
</td>
</tr>
<tr>
<td>价税合计</td>
<td> </td>
<td>承寄商/单号</td>
<td><input type="text"/></td>
</tr>
</table>
<table>
<tr>
<td>备注</td>
<td><input type="text"/></td>
</tr>
</table><br/>
<p>说明:①、点击单元格"开票价合计(元)"添加行</p><br/><br/>
<p>②、点击单元格"实格合计(元)"删除行</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<div>
<ul>
<li><div><div><button type="submit">提交</button></div></div></li>
<li><div><div><button type="button">取消</button></div></div></li>
</ul>
</div>
</form>
</body>
</html>
js实现动态添加、删除行、onkeyup表格求和示例
内容版权声明:除非注明,否则皆为本站原创文章。