|
@@ -0,0 +1,1092 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>子订单手动分账</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <style type="text/css">
|
|
|
+ .table th {
|
|
|
+ text-align: center
|
|
|
+ }
|
|
|
+
|
|
|
+ .table td {
|
|
|
+ text-align: center
|
|
|
+ }
|
|
|
+
|
|
|
+ .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
|
|
|
+ }
|
|
|
+
|
|
|
+ input[type="checkbox"]::before {
|
|
|
+ content: '\a0';
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: .2em;
|
|
|
+ width: .8em;
|
|
|
+ height: .8em;
|
|
|
+ margin-right: .2em;
|
|
|
+ border-radius: .2em;
|
|
|
+ text-indent: .15em;
|
|
|
+ line-height: .65
|
|
|
+ }
|
|
|
+
|
|
|
+ .t-btn {
|
|
|
+ width: 100px;
|
|
|
+ height: 30px;
|
|
|
+ -webkit-border-radius: 5px;
|
|
|
+ -moz-border-radius: 5px;
|
|
|
+ border-radius: 5px;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ margin-bottom: 10px
|
|
|
+ }
|
|
|
+
|
|
|
+ #select-all {
|
|
|
+ width: 70px;
|
|
|
+ height: 30px;
|
|
|
+ -webkit-border-radius: 5px;
|
|
|
+ -moz-border-radius: 5px;
|
|
|
+ border-radius: 5px;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ margin-bottom: 10px
|
|
|
+ }
|
|
|
+
|
|
|
+ #select-all:active {
|
|
|
+ background: #3daae9;
|
|
|
+ color: #fff
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-more-func {
|
|
|
+ float: right;
|
|
|
+ color: #2fa4e7;
|
|
|
+ cursor: pointer
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-more-func span:first-child {
|
|
|
+ margin-right: 6px
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-more-func span:hover {
|
|
|
+ color: #7aa9c3
|
|
|
+ }
|
|
|
+
|
|
|
+ .mask {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.7);
|
|
|
+ display: none
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content, .tips-popup-content {
|
|
|
+ width: 40%;
|
|
|
+ height: auto;
|
|
|
+ padding-bottom: 30px;
|
|
|
+ background: #fff;
|
|
|
+ -webkit-border-radius: 5px;
|
|
|
+ -moz-border-radius: 5px;
|
|
|
+ border-radius: 5px;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%)
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content {
|
|
|
+ width: 450px;
|
|
|
+ height: 360px;
|
|
|
+ overflow-y: scroll;
|
|
|
+ padding: 0 15px 30px 15px
|
|
|
+ }
|
|
|
+
|
|
|
+ .tips-popup-content {
|
|
|
+ width: 30%
|
|
|
+ }
|
|
|
+
|
|
|
+ .tips-popup-content p {
|
|
|
+ text-align: center;
|
|
|
+ padding: 80px;
|
|
|
+ font-size: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content h4, .tips-popup-content h4 {
|
|
|
+ padding-left: 10px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ border-bottom: 1px solid #eee;
|
|
|
+ margin-bottom: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content div {
|
|
|
+ margin-top: 7px;
|
|
|
+ text-align: center
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content label {
|
|
|
+ width: 70px;
|
|
|
+ text-align: right;
|
|
|
+ vertical-align: text-bottom
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content button {
|
|
|
+ width: 80px;
|
|
|
+ height: 30px;
|
|
|
+ -webkit-border-radius: 5px;
|
|
|
+ -moz-border-radius: 5px;
|
|
|
+ border-radius: 5px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content > div:nth-of-type(4) > span:first-child {
|
|
|
+ margin-left: -104px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content > div:nth-of-type(4) > span:last-child {
|
|
|
+ margin-left: 30px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content > div:nth-of-type(4) > span span {
|
|
|
+ margin-left: 10px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content > div:last-child {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .revise-popup-content input {
|
|
|
+ width: 100px;
|
|
|
+ margin-bottom: 0px
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-cfm-btn, .tips-cfm-btn {
|
|
|
+ background: #3daae9;
|
|
|
+ color: #fff;
|
|
|
+ border: none
|
|
|
+ }
|
|
|
+
|
|
|
+ .tips-cfm-btn {
|
|
|
+ width: 100px;
|
|
|
+ height: 40px;
|
|
|
+ margin: auto;
|
|
|
+ display: block;
|
|
|
+ -webkit-border-radius: 5px;
|
|
|
+ -moz-border-radius: 5px;
|
|
|
+ border-radius: 5px
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-cancel-btn {
|
|
|
+ background: #fff;
|
|
|
+ color: #555;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ margin-left: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-tips {
|
|
|
+ color: red;
|
|
|
+ display: none
|
|
|
+ }
|
|
|
+
|
|
|
+ #close-btn, #close-btn1 {
|
|
|
+ top: 8px;
|
|
|
+ right: 10px;
|
|
|
+ width: 18px;
|
|
|
+ position: absolute;
|
|
|
+ cursor: pointer
|
|
|
+ }
|
|
|
+
|
|
|
+ .tips-input-wrapper {
|
|
|
+ width: 100px
|
|
|
+ }
|
|
|
+
|
|
|
+ .reset-btn {
|
|
|
+ background: #fff;
|
|
|
+ color: #555;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ margin-right: 20px
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-status {
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ display: block
|
|
|
+ }
|
|
|
+
|
|
|
+ .form-search label {
|
|
|
+ width: 80px;
|
|
|
+ text-align: left;
|
|
|
+ margin-top: 12px
|
|
|
+ }
|
|
|
+
|
|
|
+ .remark-textarea {
|
|
|
+ width: 95%;
|
|
|
+ height: 100px;
|
|
|
+ resize: none
|
|
|
+ }
|
|
|
+
|
|
|
+ .remark-title {
|
|
|
+ text-align: left !important
|
|
|
+ }
|
|
|
+
|
|
|
+ .remark-title span {
|
|
|
+ color: red
|
|
|
+ }
|
|
|
+
|
|
|
+ .ul-form {
|
|
|
+ white-space: nowrap;
|
|
|
+ margin-left: -10px !important
|
|
|
+ }
|
|
|
+
|
|
|
+ .ul-form label {
|
|
|
+ width: 90px;
|
|
|
+ text-align: left;
|
|
|
+ margin-top: 15px
|
|
|
+ }
|
|
|
+
|
|
|
+ .time-space-symbols {
|
|
|
+ width: 100px;
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center
|
|
|
+ }
|
|
|
+
|
|
|
+ #btnSubmit {
|
|
|
+ width: 128px;
|
|
|
+ margin-left: 165px
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-status label {
|
|
|
+ margin-left: 0
|
|
|
+ }
|
|
|
+
|
|
|
+ .pay-status label:first-child {
|
|
|
+ margin-left: 10px
|
|
|
+ }
|
|
|
+
|
|
|
+ .weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
|
|
|
+
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript">
|
|
|
+ function page(n, s) {
|
|
|
+ $("#pageNo").val(n);
|
|
|
+ $("#pageSize").val(s);
|
|
|
+ $("#searchForm").submit();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<ul class="nav nav-tabs">
|
|
|
+ <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
|
|
|
+ <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
|
|
|
+ <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
|
|
|
+ <li class="active tab-li"><a href="${ctx}/shopOrder/splitList">子订单手动分账</a></li>
|
|
|
+</ul>
|
|
|
+<form:form id="searchForm"
|
|
|
+ action="${ctx}/splitAccount/split" method="post" class="breadcrumb form-search">
|
|
|
+ <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
|
+ <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
|
|
+ <div class="pay-status">
|
|
|
+ <span style="color: red">点击右侧分账按钮,可将以下展示的所有订单的收款金额进行分账,将应付供应商款项金额分账给对应供应商。</span>
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" onclick="return confirmx('确定将展示的子订单全部分账吗?', '${ctx}/splitAccount/split')" value="手动分账"/>
|
|
|
+ </div>
|
|
|
+</form:form>
|
|
|
+<sys:message content="${message}"/>
|
|
|
+<div class="pay-wrapper">
|
|
|
+ <c:forEach items="${page.list}" var="s" varStatus="sIndex">
|
|
|
+ <div class="pay-list-item">
|
|
|
+ <table class="table table-striped table-bordered table-condensed pay-table">
|
|
|
+ <tr>
|
|
|
+ <th>子订单编号(ID)</th>
|
|
|
+ <th colspan="3">订单编号(ID)</th>
|
|
|
+ <th colspan="2">订单金额</th>
|
|
|
+ <th colspan="3">下单时间</th>
|
|
|
+ <th>收款状态</th>
|
|
|
+ <th>收款金额</th>
|
|
|
+ <th colspan="3">经理折扣</th>
|
|
|
+ <th>优惠券</th>
|
|
|
+ <th>成本类型</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
|
|
|
+ <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
|
|
|
+ <td colspan="2"><fmt:formatNumber value="${s.payTotalFee}" type="number" pattern="#,##0.00"/></td>
|
|
|
+ <td colspan="3">${s.orderTime}</td>
|
|
|
+ <%--此处对应订单列表收款状态--%>
|
|
|
+ <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">
|
|
|
+ <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
|
|
|
+ <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
|
|
|
+ <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
|
|
|
+ </td>
|
|
|
+ <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptTotalFee}</a></td>
|
|
|
+ <td colspan="3">
|
|
|
+ <c:if test="${s.discountTotalFee gt 0}">
|
|
|
+ <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
|
|
|
+ <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"
|
|
|
+ type="currency"/>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
|
|
|
+ ¥0.00
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.returnedPurchaseTotalFee gt 0}">
|
|
|
+ <span style="color: red">
|
|
|
+ (原<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>,因退货折扣取消
|
|
|
+ <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
|
|
|
+ <fmt:formatNumber value="${s.returnedPurchaseTotalFee}" type="currency"/>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.discountTotalFee le s.returnedPurchaseTotalFee}">
|
|
|
+ <fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
|
|
|
+ </c:if>)
|
|
|
+ </span>
|
|
|
+ </c:if>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${s.couponAmount}
|
|
|
+ </td>
|
|
|
+ <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if
|
|
|
+ test="${s.costType == '2'}">比例成本</c:if></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>供应商</th>
|
|
|
+ <th colspan="3">机构</th>
|
|
|
+ <th>机构运费</th>
|
|
|
+ <th>供应商运费</th>
|
|
|
+ <th colspan="3">商品费</th>
|
|
|
+ <th colspan="2">付款状态</th>
|
|
|
+ <th colspan="3">应付税费</th>
|
|
|
+ <th>付供应商</th>
|
|
|
+ <th>付第三方</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>${s.shopName}</td>
|
|
|
+ <td colspan="3">
|
|
|
+ <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
|
|
|
+ ${s.clubName}
|
|
|
+ <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
|
|
|
+ <c:if test="${s.organizeID == 3}"></c:if>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <c:if test="${s.freight == 0}">
|
|
|
+ 包邮
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.freight == -1}">
|
|
|
+ 到付
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.freight == -2}">
|
|
|
+ 仪器到付-产品包邮
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
|
|
|
+ <fmt:formatNumber value="${s.freight}" type="currency"/>
|
|
|
+ <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.userBeans > 0}">
|
|
|
+ <br><font color="red">(采美豆抵用:${s.userBeans})</font>
|
|
|
+ </c:if>
|
|
|
+ </td>
|
|
|
+ <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
|
|
|
+ pattern="#,##0.00"/></td>
|
|
|
+ <td colspan="3" class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number"
|
|
|
+ pattern="#,##0.00"/></td>
|
|
|
+ <td colspan="2"><c:if test="${s.payStatus == 1 || empty s.payStatus || s.payStatus == 0}"><font
|
|
|
+ color="red">待付款</font></c:if>
|
|
|
+ <c:if test="${s.payStatus == 2}"><font color="#ff8c00">部分付款</font></c:if>
|
|
|
+ <c:if test="${s.payStatus == 3}"><font color="green">已付款</font></c:if></td>
|
|
|
+ <td colspan="3" class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number"
|
|
|
+ pattern="#,##0.00"/></td>
|
|
|
+ <td class="supplier-fee">
|
|
|
+ <c:if test="${s.differenceType ne 1 && s.differenceType ne 2 }">
|
|
|
+ <font color="#E15616"><fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/></font>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.differenceType eq 1 && s.differencePrice > 0}">
|
|
|
+ <font color="black">${s.shouldPayShopAmount+s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已补差价:${s.differencePrice})</font>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.differenceType eq 2 && s.differencePrice > 0}">
|
|
|
+ <font color="black">${s.shouldPayShopAmount-s.differencePrice}</font><font color="red">(原应付:${s.shouldPayShopAmount},已退差价:${s.differencePrice})</font>
|
|
|
+ </c:if>
|
|
|
+ </td>
|
|
|
+ <input type="hidden" class="payedShopAmount" value="${s.payedShopAmount}">
|
|
|
+ <input type="hidden" class="productAmount" value="${s.productAmount}">
|
|
|
+ <input type="hidden" class="costType" value="${s.costType}">
|
|
|
+ <input type="hidden" class="proportional" value="${s.proportional}">
|
|
|
+ <input type="hidden" class="modifyShouldPayNote" value="${s.modifyShouldPayNote}">
|
|
|
+ <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number"
|
|
|
+ pattern="#,##0.00"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>商品名</th>
|
|
|
+ <th>规格</th>
|
|
|
+ <th>数量<%--(赠品)--%></th>
|
|
|
+ <th>退货</th>
|
|
|
+ <th colspan="2">单价</th>
|
|
|
+ <th colspan="3">机构税率 / 单税费 / 总税费</th>
|
|
|
+ <th colspan="2">总价</th>
|
|
|
+ <th colspan="3">供应商税率 / 单税费 / 总税费</th>
|
|
|
+ <th>成本(单)</th>
|
|
|
+ <th>成本(总)</th>
|
|
|
+ </tr>
|
|
|
+ <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
|
|
|
+ <tr class="pay-product-item">
|
|
|
+ <input type="hidden" class="p-copId" value="${p.orderProductID}">
|
|
|
+ <td style="width:300px;" class="p-name">
|
|
|
+ <c:if test="${p.productType eq 1}"><font color="red">协商赠品:</font></c:if>
|
|
|
+ <c:if test="${p.productType eq 2}"><font color="red">促销赠品:</font></c:if>
|
|
|
+ ${p.name}
|
|
|
+ </td>
|
|
|
+ <td style="width:80px;">${p.unit}</td>
|
|
|
+ <td class="p-num" data-num="${p.num + p.presentNum}">
|
|
|
+ ${p.num}
|
|
|
+ <c:if test="${p.presentNum > 0}">(赠:${p.presentNum})</c:if>
|
|
|
+ </td>
|
|
|
+ <td><font color="${p.returnedNum>0?'red':''}">${p.returnedNum}</font></td>
|
|
|
+ <td colspan="2"><fmt:formatNumber value="${empty p.touchPrice?p.discountPrice:p.touchPrice}"
|
|
|
+ type="number" pattern="#,##0.00"/>
|
|
|
+ <c:if test="${p.includedTax != null and p.includedTax != '' and p.includedTax ne 2}">
|
|
|
+ <label style="color: red">
|
|
|
+ (${p.includedTax eq 1?'含税':(p.invoiceType eq 1 or p.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
|
|
|
+ </label>
|
|
|
+ </c:if>
|
|
|
+ </td>
|
|
|
+ <td>${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.taxRate?0.0:p.taxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
|
|
|
+ <td>${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.addedValueTax ?0.00:p.addedValueTax}</td>
|
|
|
+ <td>
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
|
|
|
+ ---
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <fmt:formatNumber
|
|
|
+ value="${empty p.totalAddedValueTax ?0.00:(p.addedValueTax * (p.num+p.presentNum-p.returnedNum))}"
|
|
|
+ type="number" pattern="#,##0.00"/>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </td>
|
|
|
+ <td colspan="2"><fmt:formatNumber
|
|
|
+ value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
|
|
|
+ type="number" pattern="#,##0.00"/></td>
|
|
|
+ <td class="p-taxes">${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'---':empty p.supplierTaxRate?0.0:p.supplierTaxRate}${(p.includedTax ne '' and p.includedTax eq 0 and p.invoiceType eq 3)?'':'%'}</td>
|
|
|
+ <td class="p-taxes">${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))?'---': empty p.singleShouldPayTotalTax ?0.00:p.singleShouldPayTotalTax}</td>
|
|
|
+ <td class="p-taxes-t">
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${(p.includedTax ne '' and (p.includedTax eq 1 or (p.includedTax eq 0 and p.invoiceType eq 3)))}">
|
|
|
+ ---
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>
|
|
|
+ <fmt:formatNumber
|
|
|
+ value="${empty p.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}"
|
|
|
+ type="number" pattern="#,##0.00"/>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+ </td>
|
|
|
+ <td class="p-costprice"><fmt:formatNumber value="${p.costPrice}" type="number"
|
|
|
+ pattern="#,##0.00"/></td>
|
|
|
+ <td><fmt:formatNumber value="${p.costPrice * (p.num + p.presentNum - p.returnedNum)}"
|
|
|
+ type="number" pattern="#,##0.00"/></td>
|
|
|
+ </tr>
|
|
|
+ </c:forEach>
|
|
|
+ </table>
|
|
|
+ <div class="pay-more-func">
|
|
|
+ <c:if test="${s.paying ne '1' and s.payStatus eq '1' and !s.modifyPayable}">
|
|
|
+ <shiro:hasPermission name="order:cmPayShop:modifyPay">
|
|
|
+ <a href="${ctx}/shopOrder/toChangePayShopAmount?shopOrderID=${s.shopOrderID}">修改成本</a>
|
|
|
+ </shiro:hasPermission>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${(s.modifyPayable and s.paying ne '1') || s.payStatus eq '2'}">
|
|
|
+ <a href="${ctx}/order/cmPayShop/differencePriceForm?shopOrderId=${s.shopOrderID}">供应商差价</a>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${s.paying ne '1' and s.payStatus eq '2'}">
|
|
|
+ <c:if test="${!s.modifyPayable || s.receiptStatus eq '3'}">
|
|
|
+ <shiro:hasPermission name="order:cmPayShop:modifyPay">
|
|
|
+ <a href="${ctx}/shopOrder/toApplyPayWipe?shopOrderID=${s.shopOrderID}">付款抹平</a>
|
|
|
+ </shiro:hasPermission>
|
|
|
+ </c:if>
|
|
|
+ </c:if>
|
|
|
+ <a href="${ctx}/shopOrder/payShopRemark?shopOrderId=${s.shopOrderID}">应付备注</a>
|
|
|
+ <a href="${ctx}/shopOrder/payedAndRefundRecordList?shopOrderID=${s.shopOrderID}&operatingMode=${operatingMode}">退/付款记录</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </c:forEach>
|
|
|
+</div>
|
|
|
+<div class="mask revise-popup">
|
|
|
+ <div class="revise-popup-content">
|
|
|
+ <h4>确认提示</h4>
|
|
|
+ <ul class="nav nav-tabs" id="myTab">
|
|
|
+ <li class="active" id="li-fixed-cost"><a class="revise-tab" href="#fixed-cost">固定成本修改</a></li>
|
|
|
+ <li id="li-proportional-cost"><a class="revise-tab" href="#proportional-cost">销售比例成本修改</a></li>
|
|
|
+ </ul>
|
|
|
+ <div class="tab-content">
|
|
|
+ <div class="tab-pane active revise-content" id="fixed-cost">
|
|
|
+ <table class="table table-striped table-bordered table-condensed pay-table div-table">
|
|
|
+ <tr>
|
|
|
+ <th>商品名</th>
|
|
|
+ <th>成本(单)</th>
|
|
|
+ <th>税费(单)</th>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane revise-content" id="proportional-cost">
|
|
|
+ <div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>子订单金额:<span id="div-productAmount"></span></span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>成本(总)占订单金额的<input type="number" id="proportional">%</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>运费:<input type="number" id="div-freight" onchange="inputnum(this)"></span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>付第三方:<input type="number" id="div-third-party-fee" onchange="inputnum(this)"></span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>付供应商:<span id="div-supplier-fee"></span></span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div style="display: inline-block">
|
|
|
+ <p>
|
|
|
+ <span>已付供应商:<span id="div-payedShopAmount"></span></span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="remark-title"><span>* </span>备注:</div>
|
|
|
+ <textarea name="modifyShouldPayNote" class="remark-textarea" maxlength="200"
|
|
|
+ placeholder="建议填写修改前和修改后的金额对比" cols="100" rows="10"></textarea>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="popup-tips">不能为空</div>
|
|
|
+ <div>
|
|
|
+ <button class="reset-btn">恢复默认值</button>
|
|
|
+ <button class="popup-cfm-btn">确定</button>
|
|
|
+ <button class="popup-cancel-btn">取消</button>
|
|
|
+ </div>
|
|
|
+ <img id="close-btn" src="/static/images/close-btn.png" alt="close-btn">
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<div class="mask tips-popup">
|
|
|
+ <div class="tips-popup-content">
|
|
|
+ <h4>信息提示</h4>
|
|
|
+ <p></p>
|
|
|
+ <button class="tips-cfm-btn" onclick="$('.tips-popup').hide()">确定</button>
|
|
|
+ <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<div class="pagination">${page}</div>
|
|
|
+<c:if test="${empty page.list}">
|
|
|
+ <p style="text-align: center;"><font color="#1e90ff">暂无待分账子订单……</font></p>
|
|
|
+</c:if>
|
|
|
+<script>
|
|
|
+ (function () {
|
|
|
+ var payTableEle = $('.pay-table'),
|
|
|
+ payProductEle = $('.pay-product-item');
|
|
|
+ payTableEle.each(function (i, l) {
|
|
|
+ var leftLength = $(this).find('tr').length,
|
|
|
+ productLength = $(this).find('.pay-product-item').length;
|
|
|
+ // 左侧栏合并单元格
|
|
|
+ // $(this).find('tr:first-child th:first-child').attr('rowspan', leftLength);
|
|
|
+ // 商品列表合并单元格
|
|
|
+ /*$(this).find('.mergeRows').attr('rowspan',productLength);*/
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ var getCheckedArr = sessionStorage.getItem('checkedIndexArr'),
|
|
|
+ allCheckedEle = $('.pay-all-status');
|
|
|
+ if (getCheckedArr) {
|
|
|
+ getCheckedArr = JSON.parse(getCheckedArr);
|
|
|
+ if (getCheckedArr.length > 0) {
|
|
|
+ allCheckedEle.prop('checked', false);
|
|
|
+ $.each(getCheckedArr, function (index, value) {
|
|
|
+ $('.pay-checkbox').eq(value).prop('checked', true);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ allCheckedEle.prop('checked', true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ allCheckedEle.prop('checked', true);
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.tab-li').on('click', function () {
|
|
|
+ if (getCheckedArr) {
|
|
|
+ sessionStorage.removeItem('checkedIndexArr');
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 点击全选
|
|
|
+ // var selectAllBtn = $('#select-all'),
|
|
|
+ // selectedInput = $('.pay-wrapper input[type=checkbox]');
|
|
|
+ // selectAllBtn.on('click', function () {
|
|
|
+ // if (selectedInput.length > 0) {
|
|
|
+ // var shopid = '';
|
|
|
+ // for (var i = 0; i < selectedInput.length; i++) {
|
|
|
+ // var id = $(selectedInput[i]).attr('data-shopid');
|
|
|
+ // if (shopid == '') {
|
|
|
+ // //第一个选中的 选择框
|
|
|
+ // shopid = id;
|
|
|
+ // } else {
|
|
|
+ // //后面的
|
|
|
+ // if (shopid != id) {
|
|
|
+ // alertx("应付多个订单时,它们必须属于同一个供应商");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if ($(this).text() === '全选') {
|
|
|
+ // for (var i = 0; i < selectedInput.length; i++) {
|
|
|
+ // selectedInput[i].checked = true;
|
|
|
+ // }
|
|
|
+ // $(this).text('取消全选');
|
|
|
+ // } else {
|
|
|
+ // for (var i = 0; i < selectedInput.length; i++) {
|
|
|
+ // selectedInput[i].checked = false;
|
|
|
+ // }
|
|
|
+ // $(this).text('全选');
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ function renderPopup(p, f, t, th, s, ps, plist) {
|
|
|
+ if (plist == '') {
|
|
|
+ $('.div-table tr:gt(0)').remove();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var tsize = plist.size(),
|
|
|
+ str = '';
|
|
|
+ for (var i = 0; i < tsize; i++) {
|
|
|
+ var current = $(plist.get(i));
|
|
|
+ str += '<tr>' +
|
|
|
+ '<td>' + current.find('.p-name').text() + '</td>' +
|
|
|
+ '<td class="tips-input-wrapper">' +
|
|
|
+ '<input type="number" onchange="inputnum(this)" data-num=' + current.find('.p-num').attr('data-num') + ' data-copid=' + current.find('.p-copId').attr('value') + ' data-ov=' + current.find('.p-costprice').text().replace(',', '') + ' value=' + current.find('.p-costprice').text().replace(',', '') + ' class="modify-product-costprice">' +
|
|
|
+ '</td>' +
|
|
|
+ '<td class="tips-input-wrapper">' +
|
|
|
+ '<input type="number" onchange="inputnum(this)" data-num=' + current.find('.p-num').attr('data-num') + ' data-ov=' + current.find('.p-taxes').text().replace(',', '') + ' value=' + current.find('.p-taxes').text().replace(',', '') + ' class="modify-product-taxes">' +
|
|
|
+ '</td>' +
|
|
|
+ '</tr>';
|
|
|
+ }
|
|
|
+ $('.div-table').append(str);
|
|
|
+ }
|
|
|
+
|
|
|
+ function showTips1(content) {
|
|
|
+ var block = $('.popup-tips');
|
|
|
+ block.text(content);
|
|
|
+ block.show();
|
|
|
+ }
|
|
|
+
|
|
|
+ function btnToGrey() {
|
|
|
+ $('.popup-cfm-btn').css({'background': '#ddd', 'color': '#555'});
|
|
|
+ $('.popup-cfm-btn').attr('disabled', true);
|
|
|
+ }
|
|
|
+
|
|
|
+ function btnToNormal() {
|
|
|
+ $('.popup-cfm-btn').css({'background': '#3daae9', 'color': '#fff'});
|
|
|
+ $('.popup-cfm-btn').attr('disabled', false);
|
|
|
+ }
|
|
|
+
|
|
|
+ function renderSupplierFee() {
|
|
|
+ var productFee = Number($('#popup-product-fee').val()),
|
|
|
+ supplierPaidFee = Number($('#popup-sPaid-fee').text()),
|
|
|
+ freight = Number($('#popup-freight').val()),
|
|
|
+ taxes = Number($('#popup-taxes').val()),
|
|
|
+ totalFee = productFee + freight + taxes;
|
|
|
+ $('#popup-supplier-fee').text(totalFee);
|
|
|
+ if (totalFee < supplierPaidFee) {
|
|
|
+ showTips1('付供应商的金额不能小于已付款金额');
|
|
|
+ btnToGrey();
|
|
|
+ } else {
|
|
|
+ showTips1('');
|
|
|
+ $('.popup-tips').hide();
|
|
|
+ btnToNormal();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function showTips(text) {
|
|
|
+ $('.tips-popup p').text(text);
|
|
|
+ $('.tips-popup').show();
|
|
|
+ }
|
|
|
+
|
|
|
+ function toZero(thisEle) {
|
|
|
+ if (Number(thisEle.val()) < 0) {
|
|
|
+ thisEle.val(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// 点击修改应付
|
|
|
+ $('body').on('click', '.revise-amount', function () {
|
|
|
+ var index = $(this).index(),
|
|
|
+ wrapper = $(this).closest('.pay-list-item'),
|
|
|
+ plist = wrapper.find('.pay-product-item'),
|
|
|
+ productFee = wrapper.find('.product-fee').text().replace(',', ''),
|
|
|
+ freight = wrapper.find('.freight').text().replace(',', ''),
|
|
|
+ taxes = wrapper.find('.taxes').text().replace(',', ''),
|
|
|
+ supplierFee = wrapper.find('.supplier-fee').text().replace(',', ''),
|
|
|
+ thirdPartyFee = wrapper.find('.third-party-fee').text().replace(',', ''),
|
|
|
+ payedShopAmount = wrapper.find('.payedShopAmount').val(),
|
|
|
+ productAmount = wrapper.find('.productAmount').val(),
|
|
|
+ costType = wrapper.find('.costType').val(),
|
|
|
+ modifyShouldPayNote = wrapper.find('.modifyShouldPayNote').val();
|
|
|
+ $('.revise-popup').attr('data-shoporderid', $(this).attr('data-shoporderid'));
|
|
|
+ $('.revise-popup').show();
|
|
|
+ $('#div-freight').attr('value', freight);
|
|
|
+ $('#div-freight').attr('data-ov', freight);
|
|
|
+ $('#div-third-party-fee').attr('value', thirdPartyFee);
|
|
|
+ $('#div-third-party-fee').attr('data-ov', thirdPartyFee);
|
|
|
+ $('#div-supplier-fee').text(Number(supplierFee).toFixed(2));
|
|
|
+ $('#div-supplier-fee').attr('data-ov', Number(supplierFee).toFixed(2));
|
|
|
+ $('#div-payedShopAmount').text(payedShopAmount);
|
|
|
+ $('#div-productAmount').text(productAmount);
|
|
|
+ $('.remark-textarea').val(modifyShouldPayNote);
|
|
|
+ $('#proportional').attr('value', wrapper.find('.proportional').attr('value'));
|
|
|
+ $('#proportional').attr('data-ov', wrapper.find('.proportional').attr('value'));
|
|
|
+ $('#myTab li:first').addClass('active').siblings().removeClass('active');
|
|
|
+ if (costType == '1') { //显示固定成本编辑
|
|
|
+ renderPopup(productFee, freight, taxes, thirdPartyFee, supplierFee, payedShopAmount, plist);
|
|
|
+ //隐藏比例成本
|
|
|
+ $('#proportional-cost').css('display', 'none');
|
|
|
+ $('#li-proportional-cost').css('display', 'none');
|
|
|
+ $('#fixed-cost').css('display', 'block');
|
|
|
+ $('#li-fixed-cost').css('display', 'block');
|
|
|
+ $('#li-fixed-cost').addClass('active');
|
|
|
+ } else if (costType == '2') { //显示比例成本编辑
|
|
|
+ //隐藏固定成本
|
|
|
+ $('#fixed-cost').css('display', 'none');
|
|
|
+ $('#li-fixed-cost').css('display', 'none');
|
|
|
+ $('#proportional-cost').css('display', 'block');
|
|
|
+ $('#li-proportional-cost').css('display', 'block');
|
|
|
+ $('#li-proportional-cost').addClass('active');
|
|
|
+ } else { //第一次设置两种编辑方式都显示
|
|
|
+ renderPopup(productFee, freight, taxes, thirdPartyFee, supplierFee, payedShopAmount, plist);
|
|
|
+ $('#proportional-cost').css('display', 'none');
|
|
|
+ $('#li-proportional-cost').css('display', 'block');
|
|
|
+ $('#fixed-cost').css('display', 'block');
|
|
|
+ $('#li-fixed-cost').css('display', 'block');
|
|
|
+ $('#li-fixed-cost').addClass('active');
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#apply').on('click', function () {
|
|
|
+ var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
|
|
|
+ for (var i = 0; i < checked.length; i++) {
|
|
|
+ var shoporderId = $(checked[i]).attr('data-shoporderid');
|
|
|
+ params += ('&shopOrderIDs=' + shoporderId);
|
|
|
+ var receiptStatus = $(checked[i]).attr('data-receiptStatus');
|
|
|
+ var modifyPayable = $(checked[i]).attr('data-modifyPayable');
|
|
|
+ if (modifyPayable && "3" != receiptStatus) {
|
|
|
+ alertx('存在母订单线上支付尚未完成的情况,子订单(' + shoporderId + ')不能申请付款');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (checked.length < 1 || params == '?') {
|
|
|
+ alertx('请至少选择一个订单');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ window.location.href = '${ctx}/order/cmPayShop/applyEdit' + params;
|
|
|
+ });
|
|
|
+
|
|
|
+ //付第三方
|
|
|
+ $('#applyShopOtherFee').on('click', function () {
|
|
|
+ var checked = $('.pay-wrapper input[type=checkbox]:checked');
|
|
|
+ if (checked.length < 1) {
|
|
|
+ alertx('请选择一个子订单');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (checked.length > 1) {
|
|
|
+ alertx('每次只能选择一个子订单进行付第三方申请');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var isPayShopOtherFee = $(checked[0]).attr('data-isPayShopOtherFee');
|
|
|
+ if ("false" == isPayShopOtherFee) {
|
|
|
+ alertx("付第三方处于待审核状态,暂不能操作");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var shopOrderId = $(checked[0]).attr('data-shoporderid');
|
|
|
+
|
|
|
+ window.location.href = '${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=' + shopOrderId;
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#refund').on('click', function () {
|
|
|
+ var checked = $('.pay-wrapper input[type=checkbox]:checked'), params = '?';
|
|
|
+ for (var i = 0; i < checked.length; i++) {
|
|
|
+ params += ('&shopOrderIDs=' + $(checked[i]).attr('data-shoporderid'));
|
|
|
+ }
|
|
|
+ if (checked.length < 1 || params == '?') {
|
|
|
+ alertx('请至少选择一个订单');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ window.location.href = '${ctx}/order/cmRefundShop/toRefund' + params;
|
|
|
+ });
|
|
|
+
|
|
|
+ //恢复默认值
|
|
|
+ $('.reset-btn').on('click', function () {
|
|
|
+ var elements = $('.modify-product-costprice,#div-freight,.modify-product-taxes,#div-third-party-fee,#proportional');
|
|
|
+ elements.each(function () {
|
|
|
+ $(this).attr('value', $(this).attr('data-ov'));
|
|
|
+ });
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#close-btn, .popup-cancel-btn').on('click', function () {
|
|
|
+ $('.revise-popup').hide();
|
|
|
+ renderPopup('', '', '', '', '', '', '');
|
|
|
+ })
|
|
|
+
|
|
|
+ $("#popup-product-fee").on("input propertychange", function () {
|
|
|
+ toZero($(this));
|
|
|
+ renderSupplierFee();
|
|
|
+ })
|
|
|
+
|
|
|
+ $("#popup-freight").on("input propertychange", function () {
|
|
|
+ toZero($(this));
|
|
|
+ renderSupplierFee();
|
|
|
+ })
|
|
|
+
|
|
|
+ $("#popup-taxes").on("input propertychange", function () {
|
|
|
+ toZero($(this));
|
|
|
+ renderSupplierFee();
|
|
|
+ })
|
|
|
+
|
|
|
+ $("#popup-third-party").on("input propertychange", function () {
|
|
|
+ toZero($(this));
|
|
|
+ if (!$(this).text().trim()) {
|
|
|
+ showTips1('');
|
|
|
+ $('.popup-tips').hide();
|
|
|
+ btnToNormal();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#close-btn1').on('click', function () {
|
|
|
+ $('.tips-popup').hide();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ $('.popup-cfm-btn').on('click', function () {
|
|
|
+ var freight = Number($('#div-freight').attr('value')), //运费
|
|
|
+ third_party_fee = Number($('#div-third-party-fee').attr('value')), //运费
|
|
|
+ shopOrderID = $(this).parents('.revise-popup').attr('data-shoporderid'),//子订单ID
|
|
|
+ params = '?shopOrderID=' + shopOrderID + '&freight=' + freight + '&thirdPartyFee=' + third_party_fee;
|
|
|
+ if ($('#fixed-cost').css('display') == 'block') { //固定成本显示
|
|
|
+ params += '&costType=1';
|
|
|
+ var tr_items = $('.div-table tr:gt(0)');
|
|
|
+ for (var i = 0; i < tr_items.size(); i++) {
|
|
|
+ var item = $(tr_items.get(i)),
|
|
|
+ param = item.find('.modify-product-costprice').attr('data-copid');
|
|
|
+ param += ('_' + Number(item.find('.modify-product-costprice').val()));
|
|
|
+ param += ('_' + Number(item.find('.modify-product-taxes').val()));
|
|
|
+ params += ('¶m=' + param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($('#proportional-cost').css('display') == 'block') { //比例成本显示
|
|
|
+ params += '&costType=2';
|
|
|
+ params += '&proportional=' + $('#proportional').val();
|
|
|
+ }
|
|
|
+ var remark = $('.remark-textarea').val();
|
|
|
+ if (!remark) {
|
|
|
+ showTips('备注不能为空');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: "${ctx}/order/cmPayShop/modifyPayShopAmount" + params,
|
|
|
+ type: "POST",
|
|
|
+ data: {'modifyShouldPayNote': remark},
|
|
|
+ success: function (res) {
|
|
|
+ if (res.success) {
|
|
|
+ $('.revise-popup').hide();
|
|
|
+ $('#searchForm').submit();
|
|
|
+ } else {
|
|
|
+ alertx(res.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $('body').on('input propertychange', '.modify-product-costprice', function () {
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+ $('body').on('input propertychange', '#div-freight', function () {
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+ $('body').on('input propertychange', '.modify-product-taxes', function () {
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+ $('body').on('input propertychange', '#div-third-party-fee', function () {
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+ $('body').on('input propertychange', '#proportional', function () {
|
|
|
+ validAndAdd();
|
|
|
+ });
|
|
|
+
|
|
|
+ function validAndAdd() {
|
|
|
+ //先还原按钮
|
|
|
+ showTips1('');
|
|
|
+ $('.popup-tips').hide();
|
|
|
+ btnToNormal();
|
|
|
+ var total = 0;
|
|
|
+ if ($('#fixed-cost').css('display') == 'block') { //固定成本显示
|
|
|
+ var elements = $('.modify-product-costprice,#div-freight,.modify-product-taxes,#div-third-party-fee');
|
|
|
+ elements.each(function () {
|
|
|
+ var ele = $(this);
|
|
|
+ if (ele.attr('value') == '') {
|
|
|
+ showTips1('成本/运费/税费/付第三方不能为空');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Number(ele.attr('value')) < 0) {
|
|
|
+ // ele.attr('value', 0.01);
|
|
|
+ showTips1('金额不可以为负');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ /*if (ele.hasClass('modify-product-costprice') && Number(ele.attr('value')) == 0) {
|
|
|
+ showTips1('成本必须大于零');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }*/
|
|
|
+ if (ele.attr('id') != 'div-third-party-fee') {
|
|
|
+ if (ele.hasClass('modify-product-costprice') || ele.hasClass('modify-product-taxes')) {
|
|
|
+ total += (Number($(this).attr('value')) * Number($(this).attr('data-num')));
|
|
|
+ } else {
|
|
|
+ total += Number($(this).attr('value'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if ($('#proportional-cost').css('display') == 'block') { //比例成本显示
|
|
|
+ var productAmount = Number($('#div-productAmount').text()),
|
|
|
+ proportional = $('#proportional').attr('value'),
|
|
|
+ freight = $('#div-freight').attr('value'), //运费
|
|
|
+ third_party_fee = $('#div-third-party-fee').attr('value'); //付第三方
|
|
|
+ if (proportional == '' || isNaN(Number(proportional))) {
|
|
|
+ showTips1('请输入成本比例');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Number(proportional) <= 0) {
|
|
|
+ showTips1('成本比例必须大于零');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (freight == '' || isNaN(Number(freight))) {
|
|
|
+ showTips1('请输入运费');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Number(freight) < 0) {
|
|
|
+ showTips1('运费不能小于零');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (third_party_fee == '' || isNaN(Number(third_party_fee))) {
|
|
|
+ showTips1('请输入付第三方金额');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Number(third_party_fee) < 0) {
|
|
|
+ showTips1('付第三方金额不能小于零');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ total = (productAmount * Number(proportional) / 100) + Number(freight);
|
|
|
+ }
|
|
|
+ if (Number($('#div-payedShopAmount').text()) > total) {
|
|
|
+ //已付供应商 > 付供应商 不能够
|
|
|
+ showTips1('付供应商的金额不能小于已付款金额');
|
|
|
+ btnToGrey();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $('#div-supplier-fee').text(total.toFixed(2));
|
|
|
+ }
|
|
|
+
|
|
|
+ var shopid = '';
|
|
|
+ $('body').on('click', '.pay-wrapper input[type=checkbox]', function () {
|
|
|
+ var that = $(this),
|
|
|
+ sid = $(this).data('shopid'),
|
|
|
+ status = Boolean($(this).attr('checked'));
|
|
|
+ if (status) {
|
|
|
+ if (shopid != '' && shopid != sid) {
|
|
|
+ that.get(0).checked = false;
|
|
|
+// showTips('应付多个订单时,它们必须属于同一个供应商');
|
|
|
+ alertx("应付多个订单时,它们必须属于同一个供应商")
|
|
|
+ } else {
|
|
|
+ shopid = sid;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ shopid = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // $('#myTab a:first').tab('show');
|
|
|
+ $('#myTab a').click(function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ var parentLi = $(this).closest('li'),
|
|
|
+ index = parentLi.index(),
|
|
|
+ reviseContentEle = $('.revise-content');
|
|
|
+ parentLi.addClass('active').siblings().removeClass('active');
|
|
|
+ reviseContentEle.eq(index).show().siblings('.revise-content').hide();
|
|
|
+ if ($('#li-fixed-cost,#li-proportional-cost').length == 2) {
|
|
|
+ validAndAdd();
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ $('.pay-all-status').on('click', function () {
|
|
|
+ var thisStatus = $(this).prop('checked');
|
|
|
+ if (thisStatus) {
|
|
|
+ $('.pay-other-status').prop('checked', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ $('.pay-other-status').on('click', function () {
|
|
|
+ var thisStatus = $(this).prop('checked');
|
|
|
+ if (thisStatus) {
|
|
|
+ $('.pay-all-status').prop('checked', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param obj
|
|
|
+ * jquery控制input只能输入数字
|
|
|
+ */
|
|
|
+ function onlynum(obj) {
|
|
|
+ obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
+ }
|
|
|
+
|
|
|
+ function inputnum(obj, val) {
|
|
|
+ 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'); //只能输入两个小数
|
|
|
+ }
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|