123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834 |
- <%@ 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>
- .red {
- color: red;
- font-style: normal;
- }
- .nowrap {
- white-space: nowrap;
- }
- .table th {
- text-align: center
- }
- .table td {
- text-align: center
- }
- .payment-form h4 {
- width: 96%;
- margin-left: 2%;
- padding-bottom: 20px;
- text-align: center;
- border-bottom: 1px solid #eee
- }
- .required {
- color: red
- }
- .payment-form label {
- width: 100px;
- text-align: right;
- vertical-align: middle;
- font-weight: 600
- }
- .payment-form-top {
- padding: 10px 0
- }
- .payment-form-top > div, .payment-form-bottom > div {
- width: 94%;
- margin-left: 3%;
- height: 50px;
- line-height: 50px;
- border-bottom: 1px solid #eee;
- white-space: nowrap
- }
- .payment-form-top input {
- vertical-align: baseline
- }
- .payment-form-top > div:last-child span {
- margin-left: 15px
- }
- .payment-form-top > div:last-child span:nth-of-type(1) {
- margin-left: 0
- }
- .pay-list-item {
- margin-bottom: 30px
- }
- .pay-table {
- width: 96%;
- margin-left: 2%;
- margin-bottom: 10px
- }
- .pay-table th {
- background: #f9f9f9
- }
- .pay-table tr:first-child th {
- background: #eee !important
- }
- .pay-table td {
- background: #fff !important
- }
- .need-to-pay {
- width: 90px
- }
- .payment-form-bottom label {
- width: 140px
- }
- .used-amount {
- width: 80px;
- margin-top: 6px
- }
- .process-details span {
- width: 140px;
- margin-left: 50px;
- font-weight: 600
- }
- .process-for-label {
- margin-left: 0 !important
- }
- .process-details div {
- display: inline-block
- }
- .payment-btn {
- width: 96%;
- margin-left: 2%;
- text-align: center;
- height: 60px;
- line-height: 60px;
- margin-top: 30px
- }
- .payment-btn button {
- width: 100px;
- height: 35px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- border: none;
- border: 1px solid #ddd
- }
- .apply-btn {
- background: #3daae9;
- color: #fff
- }
- .cfm-btn:active, .return-btn:active {
- background: #ddd;
- color: #fff
- }
- .mask {
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0;
- background: rgba(0, 0, 0, 0.7);
- display: none
- }
- .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%)
- }
- .tips-popup-content div {
- width: 100%;
- text-align: center
- }
- .tips-popup-content {
- width: 30%
- }
- .tips-popup-content p {
- text-align: center;
- padding: 80px;
- font-size: 20px
- }
- .tips-popup-content h4 {
- padding-left: 10px;
- height: 40px;
- line-height: 40px;
- border-bottom: 1px solid #eee;
- margin-bottom: 20px
- }
- .tips-cfm-btn, .tips-cancel-btn {
- width: 100px;
- height: 40px;
- margin: auto;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- background: #3daae9;
- color: #fff;
- border: none
- }
- .return-btn, .tips-cancel-btn {
- background: #fff;
- color: #555;
- margin-left: 50px
- }
- .tips-cancel-btn {
- border: 1px solid #ddd;
- margin-left: 20px;
- display: none
- }
- #close-btn1 {
- top: 8px;
- right: 10px;
- width: 18px;
- position: absolute;
- cursor: pointer
- }
- td.supplier-fee {
- text-align: left;
- }
- td.supplier-fee .wipeBtn {
- width: auto;
- white-space: nowrap;
- height: 30px;
- line-height: 30px;
- display: none;
- }
- .inputForm { /*max-width:1200px;*/
- width: 100%;
- }
- .inputForm table {
- width: 100%;
- line-height: 18px;
- margin-bottom: 50px;
- }
- .inputForm th, .inputForm td {
- font-weight: normal;
- text-align: left;
- padding: 8px 5px;
- border-bottom: 1px solid rgb(238, 238, 238);
- }
- .inputForm th {
- width: 15%;
- text-align: right;
- white-space: nowrap;
- font-weight: bold;
- }
- .inputForm td input[type="text"] {
- width: 320px;
- height: 16px;
- line-height: 16px;
- }
- .inputForm td input.short {
- width: 110px;
- }
- .inputForm td b.line {
- margin: 0 15px 0 20px;
- font-weight: normal
- }
- .wipeVisible {
- display: none;
- }
- .wipeRemarks {
- margin: 0;
- }
- .controls {
- font-size: 0
- }
- .select2-choice {
- width: 100px
- }
- .upload-content {
- position: relative;
- }
- .upload-content * {
- margin: 0;
- padding: 0;
- }
- .upload-content .conList {
- display: inline-block;
- margin-right: 5px;
- width: 90px;
- height: 90px;
- background: #e6e6e6;
- border-radius: 5px;
- position: relative;
- overflow: hidden
- }
- .upload-content .conList li {
- position: relative;
- padding: 18px 0
- }
- .upload-content .conList li img {
- width: 100%;
- margin: 0 !important;
- padding: 0 !important
- }
- .upload-content img.cancel-upload {
- position: absolute;
- top: 0;
- right: 0;
- cursor: pointer;
- z-index: 100
- }
- .upload-content .conList .btn {
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- background: #e6e6e6
- }
- .upload-content .conList .btn div {
- padding-top: 20px
- }
- .upload-content .conList .btn div span {
- font-size: 35px
- }
- .hide-pic {
- display: none !important
- }
- .upload-tips {
- margin: 10px 0
- }
- .mask {
- z-index: 9999;
- }
- .weishaIcon {
- background: darkorange;
- color: white;
- margin: 0 0px;
- padding: 0 3px;
- font-style: normal;
- font-size: 12px;
- display: inline-block;
- border-radius: 2px
- }
- .clubFreight {
- display: none
- }
- .discountFee {
- display: none
- }
- </style>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li><a href="${ctx}/shopOrder/settlement">子订单手动结算</a></li>
- <li class="active"><a>申请结算</a></li>
- </ul>
- <br/>
- <form action="${ctx}/order/cmPayShop/apply" id="form" method="post">
- <div class="payment-form">
- <h4>付款单</h4>
- <div class="payment-form-content">
- <c:forEach items="${cmPayShop.shopOrders}" var="s">
- <table class="table table-striped table-bordered table-condensed pay-table">
- <tr>
- <th>订单编号(ID)</th>
- <th colspan="3">客户</th>
- <th colspan="2">下单时间</th>
- <th>订单金额</th>
- <th colspan="3">所有子订单</th>
- <th>订单总佣金</th>
- <th>机构运费</th>
- <th>收款状态</th>
- <th colspan="3">收款金额</th>
- <th>经理折扣</th>
- <th>优惠券</th>
- <tr/>
- <tr>
- <td> ${s.orderNo}(${s.orderID})</td>
- <td colspan="3"> ${s.buyer}</td>
- <td colspan="2"> ${s.orderTime}</td>
- <td>${s.payTotalFee}</td>
- <td colspan="3">
- <c:forEach items="${s.shopOrderNos}" var="cs">
- ${cs}<br/>
- </c:forEach>
- </td>
- <td>${s.income}</td>
- <td>
- <label class="clubFreight" style="display: none">
- <c:choose>
- <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
- <fmt:formatNumber value="${s.freight}"/>
- </c:when>
- <c:otherwise>
- <fmt:formatNumber value="0"/>
- </c:otherwise>
- </c:choose>
- </label>
- <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 gt 0}">
- (采美豆抵用${s.userBeans})
- </c:if>
- </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 colspan="3">
- <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
- style="text-decoration: underline">${s.receiptTotalFee}</a>
- </td>
- <td>
- <label class="discountFee">
- <c:choose>
- <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
- <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
- </c:when>
- <c:otherwise>
- 0
- </c:otherwise>
- </c:choose>
- </label>
- <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 class="couponAmount">${s.couponAmount} </td>
- <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
- <tr/>
- <tr>
- <th>子订单编号(ID)</th>
- <th colspan="3"> 供应商</th>
- <th colspan="3">子订单佣金</th>
- <th colspan="3">商品费</th>
- <th>应付税费</th>
- <th>供应商运费</th>
- <th>结算状态</th>
- <th colspan="3">付供应商</th>
- <th>付第三方</th>
- <th>成本类型</th>
- </tr>
- <tr>
- <td>${s.shopOrderNo}(${s.shopOrderID})<input type="hidden" id="shopOrderId-hidden" name="shopOrderId"
- value="${s.shopOrderID}"></td>
- <td colspan="3">${s.shopName}</td>
- <td colspan="3" class="payCm-t"></td>
- <%-- 子订单佣金=商品总佣金+机构运费-付第三方-供应商运费-分摊优惠--%>
- <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
- <td class="taxes">
- <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
- </td>
- <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
- pattern="#,##0.00"/></td>
- <td>
- <c:if test="${s.settleStatus == 1}"><font
- color="red">待结算</font></c:if>
- <c:if test="${s.settleStatus == 2}"><font color="#ff8c00">部分结算</font></c:if>
- <c:if test="${s.settleStatus == 3 || empty s.settleStatus}"><font color="green">已结算</font></c:if>
- </td>
- <td colspan="3" class="supplier-fee">
- <div><span class="nowrap">
- <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">
- 应付:<fmt:formatNumber value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
- </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>
- ,</span>
- <span class="nowrap">已付:${s.payedShopAmount},</span></div>
- <div><span class="nowrap">待付:<input type="number"
- value="<fmt:formatNumber value="${s.waitPayShop}" pattern="0.00"/>"
- class="need-to-pay" data-type="${s.differenceType}"
- data-difference="${s.differencePrice}"
- data-pay="${s.shouldPayShopAmount}"
- data-payed="${s.payedShopAmount}"></span></div>
- <input type="hidden" name="payInfo" class="payInfo" data-shoporderid="${s.shopOrderID}"
- value="${s.shopOrderID}_${s.waitPayShop}_0">
- </td>
- <td class="third-party-fee">${s.shopOtherFee}</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>规格</th>
- <th>数量<%--(赠品)--%></th>
- <th>退货</th>
- <th colspan="3">单价</th>
- <th colspan="3">机构税率 / 单税费 / 总税费</th>
- <th>总价</th>
- <th>佣金(单)</th>
- <th>佣金(总)</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="3"><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><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><fmt:formatNumber
- value="${(empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax}"
- pattern="#,##0.00"/></td>
- <td class="payCm"><fmt:formatNumber
- value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax - p.costPrice - p.singleShouldPayTotalTax) * (p.num + p.presentNum - p.returnedNum)}"
- 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>
- </c:forEach>
- </div>
- <div class="inputForm">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <th><span
- style="font-weight:bold;font-size:18px">${cmPayShop.paymentType eq 2 ? "结算供应商总金额":"结算供应商总金额"}:</span>
- </th>
- <td colspan="3">
- <span id="totalAmount" style="font-weight: bold;font-size:18px"><fmt:formatNumber
- value="${cmPayShop.totalAmount}" pattern="#,##0.00"/></span>
- <input type="hidden" id="totalAmount-hidden" name="totalAmount"
- value="${cmPayShop.totalAmount}">
- </td>
- </tr>
- <tr>
- <td colspan="4" style="text-align:center;">
- <button class="apply-btn btn btn-primary" type="button">确定</button>
- <button class="return-btn btn" type="button" onclick="history.go(-1)">返回</button>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </form>
- <script>
- (function () {
- var payTableEle = $('.pay-table'),
- listenClickNumStatus = true,
- payProductEle = $('.pay-product-item');
- payTableEle.each(function (i, l) {
- var productLength = $(this).find('.pay-product-item').length;
- // 商品列表合并单元格
- /*$(this).find('.mergeRows').attr('rowspan',productLength);*/
- });
- $(window).on("load", function () {
- $('.need-to-pay').each(function (index, ele) {
- var thisEle = $(this),
- wrapper = thisEle.parents(".supplier-fee"),
- shouldPay = thisEle.attr('data-pay') * 1,
- differencePrice = thisEle.attr('data-difference') * 1,
- differenceType = thisEle.attr('data-type'),
- alreadyPaid = thisEle.attr('data-payed') * 1;
- if (thisEle.val().length > 8) {
- thisEle.val(thisEle.val().slice(0, 8));
- }
- if (differenceType == 2) {
- differencePrice = -differencePrice;
- }
- if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
- thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
- }
- var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
- if (wipe > 0) {
- wrapper.find('.wipeBtn').show();
- } else {
- wrapper.find('.wipeBtn').hide();
- wrapper.find('.wipeFee').prop("checked", false);
- }
- wrapper.find('.wipeFee').val(wipe);
- wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
- });
- });
- $('.tips-cancel-btn, #close-btn1').on('click', function () {
- $('.tips-popup').hide();
- });
- $('.tips-cfm-directly').on('click', function () {
- if ($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
- $('.tips-popup').hide();
- } else {
- if (listenClickNumStatus) {
- $('#form').submit();
- listenClickNumStatus = false;
- }
- }
- })
- function showTips(title, text) {
- $('.tips-popup h4').text(title);
- $('.tips-popup p').text(text);
- $('.tips-popup').show();
- }
- $('body').on('keyup', '#wipeRemarks', function () {
- $('#remarkLen').text($(this).val().length);
- });
- $('body').on('change', '.wipeBtn input', function () {
- var wrapper = $(this).parents(".supplier-fee");
- wrapper.find('.need-to-pay').trigger("input");
- wrapper.find('.need-to-pay').trigger("propertychange");
- });
- // 待付<=应付-已付
- $('body').on('input propertychange', '.need-to-pay', function () {
- var thisEle = $(this),
- wrapper = thisEle.parents(".supplier-fee"),
- shouldPay = thisEle.attr('data-pay') * 1,
- differencePrice = thisEle.attr('data-difference') * 1,
- differenceType = thisEle.attr('data-type'),
- alreadyPaid = thisEle.attr('data-payed') * 1;
- if (thisEle.val().length > 8) {
- thisEle.val(thisEle.val().slice(0, 8));
- }
- if (differenceType == 2) {
- differencePrice = -differencePrice;
- }
- if ((thisEle.val() > shouldPay - alreadyPaid + differencePrice) || thisEle.val() < 0) {
- thisEle.val((shouldPay - alreadyPaid + differencePrice).toFixed(2));
- }
- var wipe = parseFloat((shouldPay - alreadyPaid - thisEle.val() + differencePrice).toFixed(12));
- if (wipe > 0) {
- wrapper.find('.wipeBtn').show();
- } else {
- wrapper.find('.wipeBtn').hide();
- wrapper.find('.wipeFee').prop("checked", false);
- }
- wrapper.find('.wipeFee').val(wipe);
- wrapper.find('.wipeText').text('¥' + wipe.toFixed(2));
- var totalAmount = 0, wipeTotalFee = 0;
- $('.need-to-pay').each(function (index, ele) {
- totalAmount += Number($(this).val());
- });
- $('.wipeFee:checked').each(function (index, ele) {
- wipeTotalFee += Number($(this).val());
- });
- totalAmount = totalAmount.toFixed(2);
- wipeTotalFee = wipeTotalFee.toFixed(2);
- if (Number(wipeTotalFee) > 0) {
- $('.wipeVisible').show();
- $('#wipePayment').val(wipeTotalFee);
- $('.wipeTotalFee').text('¥' + wipeTotalFee);
- } else {
- $('.wipeVisible').hide();
- $('#wipePayment').val(0);
- $('.wipeTotalFee').text('¥0.00');
- }
- $('#totalAmount').text(totalAmount);
- $('#totalAmount-hidden').val(totalAmount);
- $('#transferPayFee').text(totalAmount);
- $('#transferPayFee-hidden').val(totalAmount);
- $('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
- $('#remainingBalance').text($('#ableRebateAmount-hidden').val());
- $('.used-amount').val(0);
- var payInfo = wrapper.find('.payInfo');
- var checkedWipe = wrapper.find('.wipeFee:checked').length > 0 ? wrapper.find('.wipeFee:checked').val() : 0;
- payInfo.val(payInfo.attr('data-shoporderid') + '_' + thisEle.val() + '_' + checkedWipe);
- });
- // 使用余额<总余额
- $('body').on('input propertychange', '.used-amount', function () {
- var thisEle = $(this),
- thisVal = Number(thisEle.val()),
- //totalAmount = Number($('#totalAmount').text()),
- totalAmount = ${cmPayShop.totalAmount},
- rebateAmount = Number($('#rebateAmount-hidden').val()),
- ableRebateAmount = Number($('#ableRebateAmount-hidden').val());
- if ((thisVal > ableRebateAmount) || thisVal < 0 || thisVal > totalAmount) {
- thisEle.val(0);
- $('#transferPayFee').text(totalAmount);
- $('#transferPayFee-hidden').val(totalAmount);
- $('#ableRebateAmount').text($('#ableRebateAmount-hidden').val());
- $('#remainingBalance').text(rebateAmount);
- } else {
- $('#transferPayFee').text((totalAmount - thisVal).toFixed(2));
- $('#transferPayFee-hidden').val((totalAmount - thisVal).toFixed(2));
- $('#ableRebateAmount').text((ableRebateAmount - thisVal).toFixed(2));
- $('#remainingBalance').text((rebateAmount - thisVal).toFixed(2));
- }
- });
- $('.pay-table').each(function () {
- debugger
- var thisEle = $(this),
- totalComissionVal = 0,
- resVal = '';
- totalComissionEle = thisEle.find('.payCm'),//单个商品总佣金
- comissionEle = thisEle.find('.payCm-t'),//子订单佣金
- thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),//付第三方
- freightVal = thisEle.find('.freight').text().replace(',', ''),//供应商运费
- clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),//机构运费
- discountFee = Number(thisEle.find('.discountFee').text().replace(',', '')),//经理折扣
- eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',', ''));//分摊优惠
- totalComissionEle.each(function () {
- totalComissionVal += Number($(this).text().replace(',', ''));
- })
- // 子订单佣金=单个商品总佣金+机构运费-付第三方-供应商运费-子订单分摊优惠
- resVal = (totalComissionVal - thirdPartyVal - eachDiscount).toFixed(2);
- comissionEle.text(resVal);
- })
- $('.apply-btn').on('click', function () {
- var settleAmount = $('#totalAmount-hidden').val();
- var shopOrderId = $('#shopOrderId-hidden').val();
- console.log("settleAmount---------->"+settleAmount);
- console.log("shopOrderId---------->"+shopOrderId);
- window.location.href = '${ctx}/order/cmPayShop/settlement?settleAmount=' + settleAmount+'&shopOrderId='+ shopOrderId;
- })
- })();
- </script>
- </body>
- </html>
|