|
@@ -1,32 +1,43 @@
|
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
|
|
|
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
|
|
<html>
|
|
<html>
|
|
<head>
|
|
<head>
|
|
- <title>付款修改</title>
|
|
|
|
- <meta name="decorator" content="default"/>
|
|
|
|
- <style type="text/css">
|
|
|
|
- .table th {text-align: center}
|
|
|
|
- .table td {text-align: center}
|
|
|
|
- #searchForm {
|
|
|
|
- white-space: nowrap;
|
|
|
|
- }
|
|
|
|
- .pay-wrapper {
|
|
|
|
- padding: 0 10px;
|
|
|
|
- }
|
|
|
|
- .pay-list-item {
|
|
|
|
- margin-bottom: 30px;
|
|
|
|
- }
|
|
|
|
- .pay-table th {
|
|
|
|
- background: #f9f9f9;
|
|
|
|
- }
|
|
|
|
- .pay-table tr:first-child th {
|
|
|
|
- background: #eee !important;
|
|
|
|
- }
|
|
|
|
- .pay-table td {
|
|
|
|
- background: #fff !important;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .form-horizontal .controls {
|
|
|
|
|
|
+ <title>付款修改</title>
|
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
|
+ <style type="text/css">
|
|
|
|
+ .table th {
|
|
|
|
+ text-align: center
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .table td {
|
|
|
|
+ text-align: center
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #searchForm {
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pay-wrapper {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pay-list-item {
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pay-table th {
|
|
|
|
+ background: #f9f9f9;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pay-table tr:first-child th {
|
|
|
|
+ background: #eee !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pay-table td {
|
|
|
|
+ background: #fff !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .form-horizontal .controls {
|
|
margin-left: 0;
|
|
margin-left: 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -47,23 +58,29 @@
|
|
text-align: center;
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
- .controls{
|
|
|
|
|
|
+
|
|
|
|
+ .controls {
|
|
font-size: 0;
|
|
font-size: 0;
|
|
}
|
|
}
|
|
- .controls .conList{
|
|
|
|
|
|
+
|
|
|
|
+ .controls .conList {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
margin-right: 15px;
|
|
margin-right: 15px;
|
|
}
|
|
}
|
|
- .conList .btn:nth-of-type(1){
|
|
|
|
|
|
+
|
|
|
|
+ .conList .btn:nth-of-type(1) {
|
|
margin-left: 25px;
|
|
margin-left: 25px;
|
|
}
|
|
}
|
|
- .select2-choice{
|
|
|
|
|
|
+
|
|
|
|
+ .select2-choice {
|
|
width: 100px;
|
|
width: 100px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.upload-content {
|
|
.upload-content {
|
|
margin-top: -70px;
|
|
margin-top: -70px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
+
|
|
.upload-content .conList .btn:nth-of-type(1) {
|
|
.upload-content .conList .btn:nth-of-type(1) {
|
|
width: 90px;
|
|
width: 90px;
|
|
height: 100px;
|
|
height: 100px;
|
|
@@ -71,19 +88,23 @@
|
|
background: #fff;
|
|
background: #fff;
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
- .upload-content .conList .btn:nth-of-type(1)>div {
|
|
|
|
|
|
+
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) > div {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 50%;
|
|
top: 50%;
|
|
left: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
transform: translate(-50%, -50%);
|
|
color: #666;
|
|
color: #666;
|
|
}
|
|
}
|
|
|
|
+
|
|
.upload-content .conList .btn:nth-of-type(1) span {
|
|
.upload-content .conList .btn:nth-of-type(1) span {
|
|
font-size: 35px;
|
|
font-size: 35px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.upload-content .conList .btn:nth-of-type(1) h5 {
|
|
.upload-content .conList .btn:nth-of-type(1) h5 {
|
|
color: #666;
|
|
color: #666;
|
|
}
|
|
}
|
|
|
|
+
|
|
.cancel-upload {
|
|
.cancel-upload {
|
|
background: transparent;
|
|
background: transparent;
|
|
border: none;
|
|
border: none;
|
|
@@ -94,7 +115,8 @@
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
z-index: 100;
|
|
z-index: 100;
|
|
}
|
|
}
|
|
- .upload-content .conList ol li {
|
|
|
|
|
|
+
|
|
|
|
+ .upload-content .conList ol li {
|
|
width: 114px;
|
|
width: 114px;
|
|
min-height: 80px;
|
|
min-height: 80px;
|
|
text-align: center;
|
|
text-align: center;
|
|
@@ -103,46 +125,47 @@
|
|
top: 120px;
|
|
top: 120px;
|
|
margin-left: 2px;
|
|
margin-left: 2px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.hide-pic {
|
|
.hide-pic {
|
|
display: none !important;
|
|
display: none !important;
|
|
}
|
|
}
|
|
- </style>
|
|
|
|
- <script type="text/javascript">
|
|
|
|
- $(document).ready(function() {
|
|
|
|
- $("#inputForm").validate({
|
|
|
|
- ignore:"",
|
|
|
|
- submitHandler: function(form){
|
|
|
|
- var modifyShouldPayNote = $("#modifyShouldPayNote").val();//备注
|
|
|
|
- if(null == modifyShouldPayNote || "" == modifyShouldPayNote){
|
|
|
|
- alertx("请填写备注内容");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- var confirmProductNames = $("#confirmProductNames").val();//修改了成本的含税商品商品名
|
|
|
|
- if (confirmProductNames != "") {
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
+ $(document).ready(function () {
|
|
|
|
+ $("#inputForm").validate({
|
|
|
|
+ ignore: "",
|
|
|
|
+ submitHandler: function (form) {
|
|
|
|
+ var modifyShouldPayNote = $("#modifyShouldPayNote").val();//备注
|
|
|
|
+ if (null == modifyShouldPayNote || "" == modifyShouldPayNote) {
|
|
|
|
+ alertx("请填写备注内容");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ var confirmProductNames = $("#confirmProductNames").val();//修改了成本的含税商品商品名
|
|
|
|
+ if (confirmProductNames != "") {
|
|
var products = confirmProductNames.substring(0, confirmProductNames.length - 1);
|
|
var products = confirmProductNames.substring(0, confirmProductNames.length - 1);
|
|
- var msg = "["+products+"]为含税商品,\n" +
|
|
|
|
- "\n" +
|
|
|
|
- "您已修改了成本,请确认是否需要修改税率。\n" +
|
|
|
|
- "\n" +
|
|
|
|
- "若需要修改税率,请点击继续修改按钮后进行修改;\n" +
|
|
|
|
- "\n" +
|
|
|
|
- "若不需要修改税率,请点击直接确定按钮完成修改";
|
|
|
|
- top.$.jBox.confirm(msg, '提示', function (v, h, f) {
|
|
|
|
- if (v == true) {
|
|
|
|
- loading('正在提交,请稍等...');
|
|
|
|
- form.submit();
|
|
|
|
- }
|
|
|
|
- return;
|
|
|
|
- }, {buttons: {'继续修改': false, '直接确定': true}});
|
|
|
|
- }else {
|
|
|
|
|
|
+ var msg = "[" + products + "]为含税商品,\n" +
|
|
|
|
+ "\n" +
|
|
|
|
+ "您已修改了成本,请确认是否需要修改税率。\n" +
|
|
|
|
+ "\n" +
|
|
|
|
+ "若需要修改税率,请点击继续修改按钮后进行修改;\n" +
|
|
|
|
+ "\n" +
|
|
|
|
+ "若不需要修改税率,请点击直接确定按钮完成修改";
|
|
|
|
+ top.$.jBox.confirm(msg, '提示', function (v, h, f) {
|
|
|
|
+ if (v == true) {
|
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
|
+ form.submit();
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }, {buttons: {'继续修改': false, '直接确定': true}});
|
|
|
|
+ } else {
|
|
loading('正在提交,请稍等...');
|
|
loading('正在提交,请稍等...');
|
|
form.submit();
|
|
form.submit();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
errorContainer: "#messageBox",
|
|
errorContainer: "#messageBox",
|
|
- errorPlacement: function(error, element) {
|
|
|
|
|
|
+ errorPlacement: function (error, element) {
|
|
$("#messageBox").text("输入有误,请先更正。");
|
|
$("#messageBox").text("输入有误,请先更正。");
|
|
- if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
|
|
|
+ if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
error.appendTo(element.parent().parent());
|
|
error.appendTo(element.parent().parent());
|
|
} else {
|
|
} else {
|
|
error.insertAfter(element);
|
|
error.insertAfter(element);
|
|
@@ -150,7 +173,8 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- function page(n,s){
|
|
|
|
|
|
+
|
|
|
|
+ function page(n, s) {
|
|
$("#pageNo").val(n);
|
|
$("#pageNo").val(n);
|
|
$("#pageSize").val(s);
|
|
$("#pageSize").val(s);
|
|
$("#searchForm").submit();
|
|
$("#searchForm").submit();
|
|
@@ -159,314 +183,363 @@
|
|
|
|
|
|
//初始化默认清除本地本地Item数据
|
|
//初始化默认清除本地本地Item数据
|
|
|
|
|
|
- </script>
|
|
|
|
|
|
+ </script>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
<ul class="nav nav-tabs">
|
|
<ul class="nav nav-tabs">
|
|
-<%-- <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>--%>
|
|
|
|
- <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
|
|
|
|
- <li class="active"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">修改成本</a></li>
|
|
|
|
|
|
+ <%-- <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>--%>
|
|
|
|
+ <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
|
|
|
|
+ <li class="active"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">修改成本</a>
|
|
|
|
+ </li>
|
|
</ul>
|
|
</ul>
|
|
<input type="hidden" id="confirmProductNames">
|
|
<input type="hidden" id="confirmProductNames">
|
|
-<form:form id="inputForm" modelAttribute="newShopOrder" action="${ctx}/order/cmPayShop/saveChangePayShopAmount?id=${shopOrderId}&costType=1" method="post"
|
|
|
|
|
|
+<form:form id="inputForm" modelAttribute="newShopOrder"
|
|
|
|
+ action="${ctx}/order/cmPayShop/saveChangePayShopAmount?id=${shopOrderId}&costType=1" method="post"
|
|
class="form-horizontal">
|
|
class="form-horizontal">
|
|
- <ul class="nav nav-tabs" id="myTab">
|
|
|
|
- <c:if test="${dbCostType eq 1 || empty dbCostType}">
|
|
|
|
- <li class="active" id="li-fixed-cost"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">固定成本修改</a></li>
|
|
|
|
- </c:if>
|
|
|
|
- <c:if test="${dbCostType eq 2 || empty dbCostType}">
|
|
|
|
- <li id="li-proportional-cost"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=2&shopOrderID=${shopOrderId}">销售比例成本修改</a></li>
|
|
|
|
- </c:if>
|
|
|
|
- </ul>
|
|
|
|
- <c:forEach items="${page.list}" var="newShopOrder">
|
|
|
|
- <div class="tab-content">
|
|
|
|
- <div class="tab-pane active revise-content" id="fixed-cost">
|
|
|
|
- <input id="shopOrderID" type="hidden" name="shopOrderID" value="${newShopOrder.shopOrderID}">
|
|
|
|
- <input id="orderID" type="hidden" name="orderID" value="${newShopOrder.orderID}">
|
|
|
|
- <input id="productAmount" type="hidden" name="productAmount" value="${newShopOrder.productAmount}">
|
|
|
|
- <label style="color:red">注意:计算成本时请注意,含税商品的成本包括税费,无需另外计算税费</label>
|
|
|
|
- <table class="table table-striped table-bordered table-condensed" style="width: 70%">
|
|
|
|
- <tr>
|
|
|
|
- <td>商品名</td>
|
|
|
|
- <td>供应商成本(单)</td>
|
|
|
|
- <td>集团成本(单)</td>
|
|
|
|
- <td>采美成本(单)</td>
|
|
|
|
- <td>供应商税率</td>
|
|
|
|
- <td>供应商税费(单)</td>
|
|
|
|
- </tr>
|
|
|
|
- <c:forEach items="${newShopOrder.newOrderProducts}" var="product" varStatus="index">
|
|
|
|
- <tr class="orderProducts">
|
|
|
|
- <td hidden><input id="num" name="newOrderProducts[${index.index}].num" value="${product.num - product.returnedNum}"></td>
|
|
|
|
- <td hidden><input id="presentNum" name="newOrderProducts[${index.index}].presentNum" value="${product.presentNum}"></td>
|
|
|
|
- <td hidden><input id="name" name="newOrderProducts[${index.index}].name" value="${product.name}"></td>
|
|
|
|
- <td hidden><input id="orderProductID" name="newOrderProducts[${index.index}].orderProductID" value="${product.orderProductID}"></td>
|
|
|
|
- <td hidden><input id="includedTax${index.index}" value="${product.includedTax}"></td>
|
|
|
|
- <td hidden><input id="productID${index.index}" value="${product.productID}"></td>
|
|
|
|
- <td width="40%" id="productName${index.index}">${product.name}</td>
|
|
|
|
- <td width="30%"><input id="costPrice" style="width: 80px;float: left" name="newOrderProducts[${index.index}].costPrice" value="${product.costPrice}" onchange="changeShouldPay(this,${index.index})" />
|
|
|
|
- <c:if test="${product.includedTax != null and product.includedTax != '' and product.includedTax ne 2}">
|
|
|
|
- <label style="color: red">
|
|
|
|
- (${product.includedTax eq 1?'含税':(product.invoiceType eq 1 or product.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
|
|
|
|
- </label>
|
|
|
|
- </c:if>
|
|
|
|
- </td>
|
|
|
|
- <td><input id="organizeCostPrice" style="width: 80px;float: left" name="newOrderProducts[${index.index}].organizeCostPrice" value="${product.organizeCostPrice}"/></td>
|
|
|
|
- <td><input id="cmCostPrice" style="width: 80px;float: left" name="newOrderProducts[${index.index}].cmCostPrice" value="${product.cmCostPrice}"/></td>
|
|
|
|
- <td width="20%">
|
|
|
|
- <c:choose>
|
|
|
|
- <c:when test="${product.includedTax ne '' and product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2}">
|
|
|
|
- <label style="text-align: center">-----</label>
|
|
|
|
- </c:when>
|
|
|
|
- <c:otherwise>
|
|
|
|
- <input style="width: 120px;float: left" maxlength="5" id="supplierTaxRate" name="newOrderProducts[${index.index}].supplierTaxRate" value="${empty product.supplierTaxRate?0.0:product.supplierTaxRate}" onchange="changeShouldPay(this)" />%
|
|
|
|
- </c:otherwise>
|
|
|
|
- </c:choose>
|
|
|
|
- </td>
|
|
|
|
- <td width="10%">
|
|
|
|
- <c:choose>
|
|
|
|
- <c:when test="${product.includedTax ne '' and ((product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2) or product.includedTax eq 1 )}">
|
|
|
|
- <label id="singleShouldPayTotalTaxLabel" name="newOrderProducts[${index.index}].singleShouldPayTotalTaxLabel" style="text-align: center">-----</label>
|
|
|
|
- <input type="hidden" id="singleShouldPayTotalTax" name="newOrderProducts[${index.index}].singleShouldPayTotalTax" value="${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}">
|
|
|
|
- </c:when>
|
|
|
|
- <c:otherwise>
|
|
|
|
- <label id="singleShouldPayTotalTaxLabel" style="text-align: center" name="newOrderProducts[${index.index}].singleShouldPayTotalTaxLabel">${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}</label>
|
|
|
|
- <input type="hidden" id="singleShouldPayTotalTax" name="newOrderProducts[${index.index}].singleShouldPayTotalTax" value="${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}">
|
|
|
|
- </c:otherwise>
|
|
|
|
- </c:choose>
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
- </c:forEach>
|
|
|
|
- </table>
|
|
|
|
- </div>
|
|
|
|
- <table>
|
|
|
|
- <tr>
|
|
|
|
- <td>
|
|
|
|
- <b>供应商运费:</b><input type="number" id="shopPostFee" name="shopPostFee" onchange="changeShouldPay(this)" value="${newShopOrder.shopPostFee}" style="margin-left: 20px"/>
|
|
|
|
- </td>
|
|
|
|
- <td>
|
|
|
|
- <b>付第三方:</b><input type="number" id="shopOtherFee" name="shopOtherFee" onchange="inputnum(this)" value="${newShopOrder.shopOtherFee}" style="margin-left: 5px;" ${(!newShopOrder.payShopOtherFee || payShopOtherFee > 0) ? 'readonly="true"':""}/>
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td style="padding-top: 10px;">
|
|
|
|
- <b>付供应商:</b><font color="red"><span id="div-supplier-fee">${newShopOrder.shouldPayShopAmount}</span></font>
|
|
|
|
- </td>
|
|
|
|
- <%--<td style="padding-top: 10px;">
|
|
|
|
- <b>已付供应商:</b><font color="red"><span id="div-payedShopAmount">${newShopOrder.payedShopAmount}</span></font>
|
|
|
|
- </td>--%>
|
|
|
|
- </tr>
|
|
|
|
- </table>
|
|
|
|
- <div style="margin-top: 10px">
|
|
|
|
- <div class="remark-title"><font color="red">*</font>备注内容:</div>
|
|
|
|
- <textarea name="modifyShouldPayNote" id="modifyShouldPayNote" class="remark-textarea" maxlength="500" placeholder="建议填写修改原因和修改前后的金额对比,不超过500字" style="width: 600px;height: 150px;margin-left: 70px;margin-top: -20px"></textarea>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- </c:forEach>
|
|
|
|
-
|
|
|
|
- <div >
|
|
|
|
- <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
|
|
|
|
- <label>图片:</label>
|
|
|
|
- <div class="conList">
|
|
|
|
- <form:hidden id="remarkImage1" path="remarkImage1" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage2" path="remarkImage2" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage3" path="remarkImage3" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage4" path="remarkImage4" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage5" path="remarkImage5" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage6" path="remarkImage6" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage7" path="remarkImage7" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage8" path="remarkImage8" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage9" path="remarkImage9" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- <div class="conList hide-pic">
|
|
|
|
- <form:hidden id="remarkImage10" path="remarkImage10" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
|
- <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-actions">
|
|
|
|
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="确认"/>
|
|
|
|
- <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
|
|
|
|
|
|
+ <%-- <ul class="nav nav-tabs" id="myTab">--%>
|
|
|
|
+ <%-- <c:if test="${dbCostType eq 1 || empty dbCostType}">--%>
|
|
|
|
+ <%-- <li class="active" id="li-fixed-cost"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=1&shopOrderID=${shopOrderId}">固定成本修改</a></li>--%>
|
|
|
|
+ <%-- </c:if>--%>
|
|
|
|
+ <%-- <c:if test="${dbCostType eq 2 || empty dbCostType}">--%>
|
|
|
|
+ <%-- <li id="li-proportional-cost"><a href="${ctx}/shopOrder/toChangePayShopAmount?costType=2&shopOrderID=${shopOrderId}">销售比例成本修改</a></li>--%>
|
|
|
|
+ <%-- </c:if>--%>
|
|
|
|
+ <%-- </ul>--%>
|
|
|
|
+ <c:forEach items="${page.list}" var="newShopOrder">
|
|
|
|
+ <div class="tab-content">
|
|
|
|
+ <div class="tab-pane active revise-content" id="fixed-cost">
|
|
|
|
+ <input id="shopOrderID" type="hidden" name="shopOrderID" value="${newShopOrder.shopOrderID}">
|
|
|
|
+ <input id="orderID" type="hidden" name="orderID" value="${newShopOrder.orderID}">
|
|
|
|
+ <input id="productAmount" type="hidden" name="productAmount" value="${newShopOrder.productAmount}">
|
|
|
|
+ <label style="color:red">注意:计算成本时请注意,含税商品的成本包括税费,无需另外计算税费</label>
|
|
|
|
+ <table class="table table-striped table-bordered table-condensed" style="width: 70%">
|
|
|
|
+ <tr>
|
|
|
|
+ <td>商品名</td>
|
|
|
|
+ <td>供应商成本(单)</td>
|
|
|
|
+ <td>集团成本(单)</td>
|
|
|
|
+ <td>采美成本(单)</td>
|
|
|
|
+ <td>供应商税率</td>
|
|
|
|
+ <td>供应商税费(单)</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <c:forEach items="${newShopOrder.newOrderProducts}" var="product" varStatus="index">
|
|
|
|
+ <tr class="orderProducts">
|
|
|
|
+ <td hidden><input id="num" name="newOrderProducts[${index.index}].num"
|
|
|
|
+ value="${product.num - product.returnedNum}"></td>
|
|
|
|
+ <td hidden><input id="presentNum" name="newOrderProducts[${index.index}].presentNum"
|
|
|
|
+ value="${product.presentNum}"></td>
|
|
|
|
+ <td hidden><input id="name" name="newOrderProducts[${index.index}].name"
|
|
|
|
+ value="${product.name}"></td>
|
|
|
|
+ <td hidden><input id="orderProductID" name="newOrderProducts[${index.index}].orderProductID"
|
|
|
|
+ value="${product.orderProductID}"></td>
|
|
|
|
+ <td hidden><input id="includedTax${index.index}" value="${product.includedTax}"></td>
|
|
|
|
+ <td hidden><input id="productID${index.index}" value="${product.productID}"></td>
|
|
|
|
+ <td width="40%" id="productName${index.index}">${product.name}</td>
|
|
|
|
+ <td width="30%"><input id="costPrice" style="width: 80px;float: left"
|
|
|
|
+ name="newOrderProducts[${index.index}].costPrice"
|
|
|
|
+ value="${product.costPrice}"
|
|
|
|
+ onchange="changeShouldPay(this,${index.index})"/>
|
|
|
|
+ <c:if test="${product.includedTax != null and product.includedTax != '' and product.includedTax ne 2}">
|
|
|
|
+ <label style="color: red">
|
|
|
|
+ (${product.includedTax eq 1?'含税':(product.invoiceType eq 1 or product.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
|
|
|
|
+ </label>
|
|
|
|
+ </c:if>
|
|
|
|
+ </td>
|
|
|
|
+ <td><input id="organizeCostPrice" style="width: 80px;float: left" name="newOrderProducts[${index.index}].organizeCostPrice" value="${product.organizeCostPrice}"/></td>
|
|
|
|
+ <td><input id="cmCostPrice" style="width: 80px;float: left"
|
|
|
|
+ name="newOrderProducts[${index.index}].cmCostPrice"
|
|
|
|
+ value="${product.cmCostPrice}"/></td>
|
|
|
|
+ <td width="20%">
|
|
|
|
+ <c:choose>
|
|
|
|
+ <c:when test="${product.includedTax ne '' and product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2}">
|
|
|
|
+ <label style="text-align: center">-----</label>
|
|
|
|
+ </c:when>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <input style="width: 120px;float: left" maxlength="5" id="supplierTaxRate"
|
|
|
|
+ name="newOrderProducts[${index.index}].supplierTaxRate"
|
|
|
|
+ value="${empty product.supplierTaxRate?0.0:product.supplierTaxRate}"
|
|
|
|
+ onchange="changeShouldPay(this)"/>%
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+ </td>
|
|
|
|
+ <td width="10%">
|
|
|
|
+ <c:choose>
|
|
|
|
+ <c:when test="${product.includedTax ne '' and ((product.includedTax eq 0 and product.invoiceType ne 1 and product.invoiceType ne 2) or product.includedTax eq 1 )}">
|
|
|
|
+ <label id="singleShouldPayTotalTaxLabel"
|
|
|
|
+ name="newOrderProducts[${index.index}].singleShouldPayTotalTaxLabel"
|
|
|
|
+ style="text-align: center">-----</label>
|
|
|
|
+ <input type="hidden" id="singleShouldPayTotalTax"
|
|
|
|
+ name="newOrderProducts[${index.index}].singleShouldPayTotalTax"
|
|
|
|
+ value="${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}">
|
|
|
|
+ </c:when>
|
|
|
|
+ <c:otherwise>
|
|
|
|
+ <label id="singleShouldPayTotalTaxLabel" style="text-align: center"
|
|
|
|
+ name="newOrderProducts[${index.index}].singleShouldPayTotalTaxLabel">${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}</label>
|
|
|
|
+ <input type="hidden" id="singleShouldPayTotalTax"
|
|
|
|
+ name="newOrderProducts[${index.index}].singleShouldPayTotalTax"
|
|
|
|
+ value="${empty product.singleShouldPayTotalTax?0.0:product.singleShouldPayTotalTax}">
|
|
|
|
+ </c:otherwise>
|
|
|
|
+ </c:choose>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </c:forEach>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+ <table>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
|
|
+ <b>供应商运费:</b><input type="number" id="shopPostFee" name="shopPostFee"
|
|
|
|
+ onchange="changeShouldPay(this)" value="${newShopOrder.shopPostFee}"
|
|
|
|
+ style="margin-left: 20px"/>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <b>付第三方:</b><input type="number" id="shopOtherFee" name="shopOtherFee" onchange="inputnum(this)"
|
|
|
|
+ value="${newShopOrder.shopOtherFee}"
|
|
|
|
+ style="margin-left: 5px;" ${(!newShopOrder.payShopOtherFee || payShopOtherFee > 0) ? 'readonly="true"':""}/>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td style="padding-top: 10px;">
|
|
|
|
+ <b>付供应商:</b><font color="red"><span
|
|
|
|
+ id="div-supplier-fee">${newShopOrder.shouldPayShopAmount}</span></font>
|
|
|
|
+ </td>
|
|
|
|
+ <%--<td style="padding-top: 10px;">
|
|
|
|
+ <b>已付供应商:</b><font color="red"><span id="div-payedShopAmount">${newShopOrder.payedShopAmount}</span></font>
|
|
|
|
+ </td>--%>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ <div style="margin-top: 10px">
|
|
|
|
+ <div class="remark-title"><font color="red">*</font>备注内容:</div>
|
|
|
|
+ <textarea name="modifyShouldPayNote" id="modifyShouldPayNote" class="remark-textarea" maxlength="500"
|
|
|
|
+ placeholder="建议填写修改原因和修改前后的金额对比,不超过500字"
|
|
|
|
+ style="width: 600px;height: 150px;margin-left: 70px;margin-top: -20px"></textarea>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ </c:forEach>
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ <div class="controls upload-content" style="margin: -91px 0px 0px 16px;" id="remarkImageBox">
|
|
|
|
+ <label>图片:</label>
|
|
|
|
+ <div class="conList">
|
|
|
|
+ <form:hidden id="remarkImage1" path="remarkImage1" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage1" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage2" path="remarkImage2" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage2" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage3" path="remarkImage3" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage3" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage4" path="remarkImage4" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage4" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage5" path="remarkImage5" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage5" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage6" path="remarkImage6" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage6" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage7" path="remarkImage7" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage7" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage8" path="remarkImage8" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage8" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage9" path="remarkImage9" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage9" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="conList hide-pic">
|
|
|
|
+ <form:hidden id="remarkImage10" path="remarkImage10" htmlEscape="false" maxlength="255"
|
|
|
|
+ class="input-xlarge"/>
|
|
|
|
+ <sys:ckfinder input="remarkImage10" type="images" uploadPath="/photo" selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-actions">
|
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="确认"/>
|
|
|
|
+ <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
|
|
|
|
+ </div>
|
|
</form:form>
|
|
</form:form>
|
|
|
|
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
|
|
-//图片初始化
|
|
|
|
- $(function () {
|
|
|
|
|
|
+ //图片初始化
|
|
|
|
+ $(function () {
|
|
$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
$('.upload-content .conList').find('.cancel-upload').hide();
|
|
$('.upload-content .conList').find('.cancel-upload').hide();
|
|
var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
- var MutationObserverConfig={
|
|
|
|
|
|
+ var MutationObserverConfig = {
|
|
childList: true,
|
|
childList: true,
|
|
subtree: true,
|
|
subtree: true,
|
|
characterData: true
|
|
characterData: true
|
|
};
|
|
};
|
|
- var observer = new MutationObserver(function(mutations){
|
|
|
|
- $.each(mutations, function(index,item) {
|
|
|
|
|
|
+ var observer = new MutationObserver(function (mutations) {
|
|
|
|
+ $.each(mutations, function (index, item) {
|
|
if (item.type === 'childList') {
|
|
if (item.type === 'childList') {
|
|
// 在创建新的 element 时调用
|
|
// 在创建新的 element 时调用
|
|
var target = $(item.target),
|
|
var target = $(item.target),
|
|
thisWrapper = target.closest('.conList'),
|
|
thisWrapper = target.closest('.conList'),
|
|
nextEle = thisWrapper.next();
|
|
nextEle = thisWrapper.next();
|
|
- thisWrapper.find('li').css('z-index',99);
|
|
|
|
|
|
+ thisWrapper.find('li').css('z-index', 99);
|
|
thisWrapper.find('.cancel-upload').show();
|
|
thisWrapper.find('.cancel-upload').show();
|
|
- if(nextEle.hasClass('hide-pic')) {
|
|
|
|
|
|
+ if (nextEle.hasClass('hide-pic')) {
|
|
nextEle.removeClass('hide-pic');
|
|
nextEle.removeClass('hide-pic');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
- observer.observe(observeEle,MutationObserverConfig);
|
|
|
|
|
|
+ observer.observe(observeEle, MutationObserverConfig);
|
|
|
|
|
|
- $('body').on('click','.upload-content li',function() {
|
|
|
|
|
|
+ $('body').on('click', '.upload-content li', function () {
|
|
var index = $(this).closest('.conList').index() + 1,
|
|
var index = $(this).closest('.conList').index() + 1,
|
|
- str = 'remarkImage'+index+'FinderOpen';
|
|
|
|
- eval(str+'()');
|
|
|
|
|
|
+ str = 'remarkImage' + index + 'FinderOpen';
|
|
|
|
+ eval(str + '()');
|
|
});
|
|
});
|
|
- $('body').on('click', '.cancel-upload',function() {
|
|
|
|
|
|
+ $('body').on('click', '.cancel-upload', function () {
|
|
var wrapper = $(this).closest('.conList');
|
|
var wrapper = $(this).closest('.conList');
|
|
- wrapper.find('li').css('z-index','-1');
|
|
|
|
|
|
+ wrapper.find('li').css('z-index', '-1');
|
|
wrapper.find('input').val('');
|
|
wrapper.find('input').val('');
|
|
$(this).hide();
|
|
$(this).hide();
|
|
if ($('.cancel-upload:visible').length < 9) {
|
|
if ($('.cancel-upload:visible').length < 9) {
|
|
wrapper.addClass("hide-pic");
|
|
wrapper.addClass("hide-pic");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
wrapper.removeClass("hide-pic");
|
|
wrapper.removeClass("hide-pic");
|
|
}
|
|
}
|
|
wrapper.parent().append(wrapper.clone());
|
|
wrapper.parent().append(wrapper.clone());
|
|
wrapper.remove();
|
|
wrapper.remove();
|
|
- $(".conList").each(function(i,ele){
|
|
|
|
- if($(ele).find("input.input-xlarge").val()){
|
|
|
|
- $(ele).next().removeClass("hide-pic")
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ $(".conList").each(function (i, ele) {
|
|
|
|
+ if ($(ele).find("input.input-xlarge").val()) {
|
|
|
|
+ $(ele).next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ $(window).on("load", function () {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ $("#remarkImageBox").find("input.input-xlarge").each(function (i, ele) {
|
|
|
|
+ if ($(ele).val()) {
|
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
|
+ $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }, 500);
|
|
});
|
|
});
|
|
- $(window).on("load", function(){
|
|
|
|
- setTimeout(function(){
|
|
|
|
- $("#remarkImageBox").find("input.input-xlarge").each(function(i,ele){
|
|
|
|
- if($(ele).val()){
|
|
|
|
- $(ele).next().find("li").css("z-index","99");
|
|
|
|
- $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
|
- $(ele).parents(".conList").next().removeClass("hide-pic")
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },500);
|
|
|
|
- });
|
|
|
|
});
|
|
});
|
|
|
|
|
|
// 输入框验证
|
|
// 输入框验证
|
|
- function inputnum(obj){
|
|
|
|
- obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
|
|
|
- obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
|
|
|
|
- obj.value = obj.value.replace(/\.{2,}/g,""); //只保留第一个, 清除多余的
|
|
|
|
- obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
|
|
|
- obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
|
|
|
- if(obj.value == null || obj.value == "" ){
|
|
|
|
- obj.value = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 修改成本价
|
|
|
|
- var confirmProductNames = "";
|
|
|
|
- var confirmProductIdArr = [];
|
|
|
|
- function changeShouldPay(eleThis,index) {
|
|
|
|
- var productName = $("#productName" + index).text();
|
|
|
|
- var productId = $("#productID" + index).val();
|
|
|
|
- var includedTax = $("#includedTax" + index).val();
|
|
|
|
- var addFlag = true;
|
|
|
|
- for (var i = 0 ;i<confirmProductIdArr.length;i++){
|
|
|
|
- if (confirmProductIdArr[i] == productId) {
|
|
|
|
- addFlag = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (includedTax == '1' && addFlag) {
|
|
|
|
- confirmProductIdArr.push(productId);
|
|
|
|
- confirmProductNames += productName+",";
|
|
|
|
- confirmProductNames.substring(0, confirmProductNames.length-1);
|
|
|
|
- $("#confirmProductNames").val(confirmProductNames);
|
|
|
|
- }
|
|
|
|
- //修改不符合规则值
|
|
|
|
- eleThis.value = eleThis.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
|
|
|
- eleThis.value = eleThis.value.replace(/^\./g,""); //验证第一个字符是数字
|
|
|
|
- eleThis.value = eleThis.value.replace(/\.{2,}/g,""); //只保留第一个, 清除多余的
|
|
|
|
- eleThis.value = eleThis.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
|
|
|
- eleThis.value = eleThis.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
|
|
|
- if($(eleThis).val() == null || $(eleThis).val() == "" ){
|
|
|
|
- $(eleThis).val(0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var totalAmount = Number(0);
|
|
|
|
- //获取供应商层信息
|
|
|
|
- var shopPostFee = $("#shopPostFee").val();
|
|
|
|
- var shopOtherFee = $("#shopOtherFee").val();
|
|
|
|
- if(null == shopPostFee)shopPostFee = 0;
|
|
|
|
- // if(null == shopOtherFee)shopOtherFee = 0;
|
|
|
|
- /*var n = parseFloat(that.value);
|
|
|
|
- that.value = n.toFixed(2)*/
|
|
|
|
- // 计算所有商品的成本和税费
|
|
|
|
- $(".orderProducts").each(function(i, ele){
|
|
|
|
- // 商品层信息
|
|
|
|
- var num = $(ele).find('input[id=num]').val();
|
|
|
|
- var presentNum = $(ele).find('input[id=presentNum]').val();
|
|
|
|
- var costPrice = $(ele).find('input[id=costPrice]').val();
|
|
|
|
- var supplierTaxRate = $(ele).find('input[id=supplierTaxRate]').val();
|
|
|
|
- var singleShouldPayTotalTax = $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text();// 单个供应商是税费
|
|
|
|
-
|
|
|
|
- console.log(num+" "+presentNum+" "+" "+costPrice+" "+supplierTaxRate+" "+singleShouldPayTotalTax)
|
|
|
|
-
|
|
|
|
- // 校验参数
|
|
|
|
- if(null == num)num = 0;
|
|
|
|
- if(null == presentNum)presentNum = 0;
|
|
|
|
- if(null == costPrice)costPrice = 0;
|
|
|
|
- if(null == supplierTaxRate)supplierTaxRate = 0;
|
|
|
|
- if(null == singleShouldPayTotalTax)singleShouldPayTotalTax = 0;
|
|
|
|
- var productNum = Number(num) + Number(presentNum);
|
|
|
|
-
|
|
|
|
- if (singleShouldPayTotalTax == '-----') {
|
|
|
|
- singleShouldPayTotalTax = 0;
|
|
|
|
- $(ele).find('input[id=singleShouldPayTotalTax]').val(0);
|
|
|
|
- }else {
|
|
|
|
- //计算供应商税费(单)
|
|
|
|
- singleShouldPayTotalTax = (costPrice * supplierTaxRate * 0.01).toFixed(2);
|
|
|
|
- $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text(singleShouldPayTotalTax);
|
|
|
|
- $(ele).find('input[id=singleShouldPayTotalTax]').val(singleShouldPayTotalTax);
|
|
|
|
- }
|
|
|
|
- //计算应付供应商
|
|
|
|
- totalAmount += ((Number(productNum) * Number(costPrice)) + (Number(productNum) * Number(singleShouldPayTotalTax)));
|
|
|
|
- });
|
|
|
|
- totalAmount += Number(shopPostFee);
|
|
|
|
- // 四舍五入
|
|
|
|
- var s = totalAmount.toFixed(2);
|
|
|
|
- $("#div-supplier-fee").text(s);
|
|
|
|
- }
|
|
|
|
|
|
+ function inputnum(obj) {
|
|
|
|
+ obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
|
|
|
|
+ obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
|
|
|
|
+ obj.value = obj.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
|
|
|
|
+ obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
|
|
+ obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
|
|
|
|
+ if (obj.value == null || obj.value == "") {
|
|
|
|
+ obj.value = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 修改成本价
|
|
|
|
+ var confirmProductNames = "";
|
|
|
|
+ var confirmProductIdArr = [];
|
|
|
|
+
|
|
|
|
+ function changeShouldPay(eleThis, index) {
|
|
|
|
+ var productName = $("#productName" + index).text();
|
|
|
|
+ var productId = $("#productID" + index).val();
|
|
|
|
+ var includedTax = $("#includedTax" + index).val();
|
|
|
|
+ var addFlag = true;
|
|
|
|
+ for (var i = 0; i < confirmProductIdArr.length; i++) {
|
|
|
|
+ if (confirmProductIdArr[i] == productId) {
|
|
|
|
+ addFlag = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (includedTax == '1' && addFlag) {
|
|
|
|
+ confirmProductIdArr.push(productId);
|
|
|
|
+ confirmProductNames += productName + ",";
|
|
|
|
+ confirmProductNames.substring(0, confirmProductNames.length - 1);
|
|
|
|
+ $("#confirmProductNames").val(confirmProductNames);
|
|
|
|
+ }
|
|
|
|
+ //修改不符合规则值
|
|
|
|
+ eleThis.value = eleThis.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
|
|
|
|
+ eleThis.value = eleThis.value.replace(/^\./g, ""); //验证第一个字符是数字
|
|
|
|
+ eleThis.value = eleThis.value.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
|
|
|
|
+ eleThis.value = eleThis.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
|
|
+ eleThis.value = eleThis.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
|
|
|
|
+ if ($(eleThis).val() == null || $(eleThis).val() == "") {
|
|
|
|
+ $(eleThis).val(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var totalAmount = Number(0);
|
|
|
|
+ //获取供应商层信息
|
|
|
|
+ var shopPostFee = $("#shopPostFee").val();
|
|
|
|
+ var shopOtherFee = $("#shopOtherFee").val();
|
|
|
|
+ if (null == shopPostFee) shopPostFee = 0;
|
|
|
|
+ // if(null == shopOtherFee)shopOtherFee = 0;
|
|
|
|
+ /*var n = parseFloat(that.value);
|
|
|
|
+ that.value = n.toFixed(2)*/
|
|
|
|
+ // 计算所有商品的成本和税费
|
|
|
|
+ $(".orderProducts").each(function (i, ele) {
|
|
|
|
+ // 商品层信息
|
|
|
|
+ var num = $(ele).find('input[id=num]').val();
|
|
|
|
+ var presentNum = $(ele).find('input[id=presentNum]').val();
|
|
|
|
+ var costPrice = $(ele).find('input[id=costPrice]').val();
|
|
|
|
+ var supplierTaxRate = $(ele).find('input[id=supplierTaxRate]').val();
|
|
|
|
+ var singleShouldPayTotalTax = $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text();// 单个供应商是税费
|
|
|
|
+
|
|
|
|
+ console.log(num + " " + presentNum + " " + " " + costPrice + " " + supplierTaxRate + " " + singleShouldPayTotalTax)
|
|
|
|
+
|
|
|
|
+ // 校验参数
|
|
|
|
+ if (null == num) num = 0;
|
|
|
|
+ if (null == presentNum) presentNum = 0;
|
|
|
|
+ if (null == costPrice) costPrice = 0;
|
|
|
|
+ if (null == supplierTaxRate) supplierTaxRate = 0;
|
|
|
|
+ if (null == singleShouldPayTotalTax) singleShouldPayTotalTax = 0;
|
|
|
|
+ var productNum = Number(num) + Number(presentNum);
|
|
|
|
+
|
|
|
|
+ if (singleShouldPayTotalTax == '-----') {
|
|
|
|
+ singleShouldPayTotalTax = 0;
|
|
|
|
+ $(ele).find('input[id=singleShouldPayTotalTax]').val(0);
|
|
|
|
+ } else {
|
|
|
|
+ //计算供应商税费(单)
|
|
|
|
+ singleShouldPayTotalTax = (costPrice * supplierTaxRate * 0.01).toFixed(2);
|
|
|
|
+ $(ele).find('label[id=singleShouldPayTotalTaxLabel]').text(singleShouldPayTotalTax);
|
|
|
|
+ $(ele).find('input[id=singleShouldPayTotalTax]').val(singleShouldPayTotalTax);
|
|
|
|
+ }
|
|
|
|
+ //计算应付供应商
|
|
|
|
+ totalAmount += ((Number(productNum) * Number(costPrice)) + (Number(productNum) * Number(singleShouldPayTotalTax)));
|
|
|
|
+ });
|
|
|
|
+ totalAmount += Number(shopPostFee);
|
|
|
|
+ // 四舍五入
|
|
|
|
+ var s = totalAmount.toFixed(2);
|
|
|
|
+ $("#div-supplier-fee").text(s);
|
|
|
|
+ }
|
|
|
|
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|