|
@@ -95,29 +95,82 @@
|
|
|
<%--涛姐遍历下面这个table--%>
|
|
|
<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">订单编号(ID)</th>
|
|
|
- <th>订单金额</th>
|
|
|
- <th>下单时间</th>
|
|
|
- <th colspan="2">经理折扣</th>
|
|
|
- <th>成本类型</th>
|
|
|
- <th>付第三方</th>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>${s.shopOrderNo}(${s.shopOrderID})</td>
|
|
|
- <td colspan="3">${s.orderNo}(${s.orderID})</td>
|
|
|
- <td>${s.payTotalFee}</td>
|
|
|
- <td>${s.orderTime}</td>
|
|
|
- <td colspan="2">
|
|
|
- <c:if test="${s.discountTotalFee gt 0}">
|
|
|
- <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
|
|
|
- <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}" type="currency"/>
|
|
|
+ <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"> 所有子订单</td>
|
|
|
+ <td>订单总佣金</td>
|
|
|
+ <td>
|
|
|
+ <label class="clubFreight">
|
|
|
+ <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.discountTotalFee le s.returnedPurchaseTotalFee}">
|
|
|
- ¥0.00
|
|
|
+ <c:if test="${s.freight == -1}">
|
|
|
+ 到付
|
|
|
</c:if>
|
|
|
- <c:if test="${s.returnedPurchaseTotalFee gt 0}">
|
|
|
+ <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>
|
|
|
+ </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}">
|
|
@@ -127,51 +180,48 @@
|
|
|
<fmt:formatNumber value="${s.discountTotalFee}" type="currency"/>
|
|
|
</c:if>)
|
|
|
</span>
|
|
|
+ </c:if>
|
|
|
</c:if>
|
|
|
- </c:if>
|
|
|
- <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
|
|
|
- </td>
|
|
|
- <td><c:if test="${empty s.costType || s.costType == '1'}">固定成本</c:if><c:if test="${s.costType == '2'}">比例成本</c:if></td>
|
|
|
- <td class="third-party-fee"><fmt:formatNumber value="${s.shopOtherFee}" type="number" pattern="#,##0.00"/></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th>供应商</th>
|
|
|
- <th colspan="3">客户</th>
|
|
|
- <th>机构运费</th>
|
|
|
- <th>供应商运费</th>
|
|
|
- <th>商品费</th>
|
|
|
- <th>付款状态</th>
|
|
|
- <th>应付税费</th>
|
|
|
- <th colspan="2">付供应商</th>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>${s.shopName}</td>
|
|
|
- <td colspan="3">${s.buyer}<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>
|
|
|
- </td>
|
|
|
- <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number" pattern="#,##0.00"/></td>
|
|
|
- <td class="product-fee"><fmt:formatNumber value="${s.shopProductAmount}" type="number" pattern="#,##0.00"/>
|
|
|
- <td><c:if test="${s.payStatus == 1}"><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 class="taxes"><fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/></td>
|
|
|
- <td class="supplier-fee">
|
|
|
- <div>
|
|
|
- <c:if test="${s.differenceType ne 1 && s.differenceType ne 2}">应付:<fmt:formatNumber
|
|
|
- value="${s.shouldPayShopAmount}" type="number" pattern="#,##0.00"/>
|
|
|
+ <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
|
|
|
+ </td>
|
|
|
+ <td>${s.couponAmount} </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})</td>
|
|
|
+ <td colspan="3">${s.shopName}</td>
|
|
|
+ <td colspan="3">子订单佣金</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.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="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>
|
|
@@ -179,60 +229,104 @@
|
|
|
<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>
|
|
|
- ,已付:<fmt:formatNumber value="${s.payedShopAmount}" type="number" pattern="#,##0.00"/>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <c:if test="${s.refundAmount > 0}">
|
|
|
- <span style="color:red">退款:<fmt:formatNumber value="${s.refundAmount}" type="number" pattern="#,##0.00"/></span>,
|
|
|
- </c:if>
|
|
|
- 待付:<fmt:formatNumber value="${s.wipePayment>0 ? 0 : s.waitPayShop}" type="number" pattern="#,##0.00"/>
|
|
|
- </div>
|
|
|
- <c:if test="${s.wipePayment > 0}">
|
|
|
- <div>
|
|
|
- 付款抹平:<fmt:formatNumber value="${s.wipePayment}" type="number" pattern="#,##0.00"/>
|
|
|
- </div>
|
|
|
- </c:if>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th>商品名</th>
|
|
|
- <th>规格</th>
|
|
|
- <th>数量<%--(赠品数)--%></th>
|
|
|
- <th>退货<%--数量--%></th>
|
|
|
- <th>供应商税率</th>
|
|
|
- <th>供应商税费(单)</th>
|
|
|
- <th colspan="2">供应商税费(总)</th>
|
|
|
- <th>成本(单)</th>
|
|
|
- <th>成本(总)</th>
|
|
|
- </tr>
|
|
|
- <c:forEach items="${s.newOrderProducts}" var="p" varStatus="pIndex">
|
|
|
- <tr class="pay-product-item">
|
|
|
- <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}
|
|
|
+ ,</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">
|
|
|
+ <label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
|
|
|
+ class="red wipeText">¥0.00</em></span></label>
|
|
|
</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 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>
|
|
|
- <td><font color="${p.returnedNum>0?'red':''}">${empty p.returnedNum?0:p.returnedNum}</font></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 colspan="2" class="p-taxes-t"><c:choose>
|
|
|
+ </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.shouldPayTotalTax ?0.00:(p.singleShouldPayTotalTax * (p.num+p.presentNum-p.returnedNum))}" type="number" pattern="#,##0.00"/>
|
|
|
+ <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><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>
|
|
|
+ <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>
|
|
@@ -330,15 +424,44 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
|
- (function(){
|
|
|
- var payTableEle = $('.pay-table'),
|
|
|
- payProductEle = $('.pay-product-item');
|
|
|
- payTableEle.each(function (i,l) {
|
|
|
- var productLength = $(this).find('.pay-product-item').length;
|
|
|
- // 商品列表合并单元格
|
|
|
- $(this).find('.mergeRows').attr('rowspan',productLength);
|
|
|
- });
|
|
|
+ // (function(){
|
|
|
+ // var payTableEle = $('.pay-table'),
|
|
|
+ // payProductEle = $('.pay-product-item');
|
|
|
+ // payTableEle.each(function (i,l) {
|
|
|
+ // var productLength = $(this).find('.pay-product-item').length;
|
|
|
+ // // 商品列表合并单元格
|
|
|
+ // $(this).find('.mergeRows').attr('rowspan',productLength);
|
|
|
+ // });
|
|
|
+ // var payCm = 0;
|
|
|
+ // $('.payCm').each(function () {
|
|
|
+ // payCm += Number($(this).text().replace(',', ''));
|
|
|
+ // });
|
|
|
+ // $('.freight,.taxes').each(function () {
|
|
|
+ // payCm -= Number($(this).text().replace(',', ''));
|
|
|
+ // });
|
|
|
+ // $('.payCm-t').text(payCm.toFixed(2).toLocaleString());
|
|
|
+ //
|
|
|
+ // $('.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();
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ //
|
|
|
+ // $('.export').on('click',function() {
|
|
|
+ // window.print();
|
|
|
+ // })
|
|
|
+ //
|
|
|
+ // function showTips(title,text) {
|
|
|
+ // $('.tips-popup h4').text(title);
|
|
|
+ // $('.tips-popup p').text(text);
|
|
|
+ // $('.tips-popup').show();
|
|
|
+ // }
|
|
|
+ // })();
|
|
|
|
|
|
+ (function () {
|
|
|
var payCm = 0;
|
|
|
$('.payCm').each(function () {
|
|
|
payCm += Number($(this).text().replace(',', ''));
|
|
@@ -346,27 +469,299 @@
|
|
|
$('.freight,.taxes').each(function () {
|
|
|
payCm -= Number($(this).text().replace(',', ''));
|
|
|
});
|
|
|
+ $('.export').on('click',function() {
|
|
|
+ window.print();
|
|
|
+ })
|
|
|
$('.payCm-t').text(payCm.toFixed(2).toLocaleString());
|
|
|
|
|
|
- $('.tips-cancel-btn, #close-btn1').on('click',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) {
|
|
|
+ <%--if ($(this).val() <= 0) {--%>
|
|
|
+ <%-- alertx("待付金额为负数,不能操作付款抹平。请先去操作供应商退款,使数据恢复正常", function () {--%>
|
|
|
+ <%-- window.location.href = "${ctx}/shopOrder/refundRecordList?operatingMode=2"--%>
|
|
|
+ <%-- });--%>
|
|
|
+ <%--}--%>
|
|
|
+ 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-cfm-directly').on('click', function () {
|
|
|
+ if ($('.tips-cfm-btn').hasClass('tips-cfm-directly')) {
|
|
|
$('.tips-popup').hide();
|
|
|
+ } else {
|
|
|
+ if (listenClickNumStatus) {
|
|
|
+ $('#form').submit();
|
|
|
+ listenClickNumStatus = false;
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $('.export').on('click',function() {
|
|
|
- window.print();
|
|
|
- })
|
|
|
-
|
|
|
- function showTips(title,text) {
|
|
|
+ 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 () {
|
|
|
+ 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(',', ''));
|
|
|
+ totalComissionEle.each(function () {
|
|
|
+ totalComissionVal += Number($(this).text().replace(',', ''));
|
|
|
+ })
|
|
|
+ resVal = (totalComissionVal + clubFreight - discountFee - thirdPartyVal - freightVal).toFixed(2);
|
|
|
+ comissionEle.text(resVal);
|
|
|
+ })
|
|
|
+
|
|
|
+ $('.apply-btn').on('click', function () {
|
|
|
+ var payNameVal = $('#payment-form-name').val(),
|
|
|
+ accountNameVal = $('#account-name').val(),
|
|
|
+ accountNoVal = $('#account-no').val(),
|
|
|
+ accountBankVal = $('#account-bank').val();
|
|
|
+
|
|
|
+ if (!payNameVal.trim()) {
|
|
|
+ alertx("付款单名称不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!accountNameVal.trim()) {
|
|
|
+ alertx("户名不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!accountNoVal.trim()) {
|
|
|
+ alertx("账号不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!accountBankVal.trim()) {
|
|
|
+ alertx("开户行不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#wipePayment').val() * 1 > 0) {
|
|
|
+ if (!$('#wipeRemarks').val().trim()) {
|
|
|
+ alertx("抹平备注不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var imgArr = [];
|
|
|
+ if ($('#image1').val()) {
|
|
|
+ imgArr.push($('#image1').val());
|
|
|
+ }
|
|
|
+ if ($('#image2').val()) {
|
|
|
+ imgArr.push($('#image2').val());
|
|
|
+ }
|
|
|
+ if ($('#image3').val()) {
|
|
|
+ imgArr.push($('#image3').val());
|
|
|
+ }
|
|
|
+ if ($('#image4').val()) {
|
|
|
+ imgArr.push($('#image4').val());
|
|
|
+ }
|
|
|
+ if ($('#image5').val()) {
|
|
|
+ imgArr.push($('#image5').val());
|
|
|
+ }
|
|
|
+ if (imgArr.length > 0) {
|
|
|
+ $('#wipeRemarkImages').val(imgArr.join("##"));
|
|
|
+ } else {
|
|
|
+ $('#wipeRemarkImages').val('');
|
|
|
+ }
|
|
|
+ $('.tips-cfm-btn').removeClass('tips-cfm-directly');
|
|
|
+ $('.tips-cancel-btn').show();
|
|
|
+ showTips('确认提示', '本次付款存在付款抹平行为,付款抹平总额为¥' + $('#wipePayment').val() + ',确认无误后,请点击确定按钮提交付款申请!');
|
|
|
+ } else {
|
|
|
+ $('#wipePayment').val(0);
|
|
|
+ $('#wipeRemarks').val('');
|
|
|
+ $('#wipeRemarkImages').val('');
|
|
|
+ $('.tips-cfm-btn').removeClass('tips-cfm-directly');
|
|
|
+ $('.tips-cancel-btn').show();
|
|
|
+ showTips('确认提示', '确定要提交申请吗?');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })();
|
|
|
+
|
|
|
+ //图片初始化
|
|
|
+ $(function () {
|
|
|
+ $('.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').find('.cancel-upload').hide();
|
|
|
+ var observeEle = document.getElementsByClassName('upload-content')[0];
|
|
|
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
+ var MutationObserverConfig = {
|
|
|
+ childList: true,
|
|
|
+ subtree: true,
|
|
|
+ characterData: true
|
|
|
+ };
|
|
|
+ var observer = new MutationObserver(function (mutations) {
|
|
|
+ $.each(mutations, function (index, item) {
|
|
|
+ if (item.type === 'childList') {
|
|
|
+ // 在创建新的 element 时调用
|
|
|
+ var target = $(item.target),
|
|
|
+ thisWrapper = target.closest('.conList'),
|
|
|
+ nextEle = thisWrapper.next();
|
|
|
+ thisWrapper.find('li').css('z-index', 99);
|
|
|
+ thisWrapper.find('.cancel-upload').show();
|
|
|
+ if (nextEle.hasClass('hide-pic')) {
|
|
|
+ nextEle.removeClass('hide-pic');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ observer.observe(observeEle, MutationObserverConfig);
|
|
|
+
|
|
|
+ $('body').on('click', '.cancel-upload', function () {
|
|
|
+ var wrapper = $(this).closest('.conList');
|
|
|
+ wrapper.find('li').css('z-index', '-1');
|
|
|
+ wrapper.find('input').val('');
|
|
|
+ $(this).hide();
|
|
|
+ if ($('.cancel-upload:visible').length < 9) {
|
|
|
+ wrapper.addClass("hide-pic");
|
|
|
+ } else {
|
|
|
+ wrapper.removeClass("hide-pic");
|
|
|
+ }
|
|
|
+ wrapper.parent().append(wrapper.clone());
|
|
|
+ wrapper.remove();
|
|
|
+ $(".conList").each(function (i, ele) {
|
|
|
+ if ($(ele).find("input.imagesInput").val()) {
|
|
|
+ $(ele).next().removeClass("hide-pic")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ $(window).on("load", function () {
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#wipeImageBox").find("input.imagesInput").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);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|