ソースを参照

退/付款单改页面

zhijiezhao 3 年 前
コミット
db3de9c9e9

+ 4 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -69,4 +69,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     void updateByShopOtherFee(@Param("shopOtherFee") BigDecimal shopOtherFee, @Param("shopOrderId") Integer shopOrderId);
 
     void updateByDifferencePrice(@Param("type") Integer type,@Param("differencePrice") BigDecimal differencePrice, @Param("shopOrderId") Integer shopOrderId);
+
+    List<String> findShopOrderNos(Integer orderID);
+
+    Double findIncome(Integer orderID);
 }

+ 0 - 9
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -51,7 +51,6 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     private Double ableRebateAmount;//供应商可用余额
     private Double rebateAmount;//供应商余额
     private List<NewShopOrder> shopOrders;  //付款单关联的子订单
-    private List<String> shopOrderNos;      //主订单下所有子订单
     private String reApply;  // 审核不通过  重新修改发起申请
 
     private String shopOrderNo;// 子订单编号
@@ -68,14 +67,6 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     //  付款账号的类型 0公账, 1私账
     private String typeStr;
 
-    public List<String> getShopOrderNos() {
-        return shopOrderNos;
-    }
-
-    public void setShopOrderNos(List<String> shopOrderNos) {
-        this.shopOrderNos = shopOrderNos;
-    }
-
     public String getPayBank() {
         return payBank;
     }

+ 18 - 0
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -89,6 +89,8 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private Integer userBeans; //订单采美豆数量
     private Double svipShopReduction;   //超级会员优惠
     //-------------        虚拟字段   ----------------------------
+    private Double income;       //主订单总佣金
+    private List<String> shopOrderNos;      //主订单下所有子订单
     private String shopName;            //供应商
     private String commercialCode;      //分账方,子商户商编
     private String receiver;//收货人
@@ -143,6 +145,22 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
 
     private boolean payShopOtherFee = true; //是否可以付第三方申请
 
+    public Double getIncome() {
+        return income;
+    }
+
+    public void setIncome(Double income) {
+        this.income = income;
+    }
+
+    public List<String> getShopOrderNos() {
+        return shopOrderNos;
+    }
+
+    public void setShopOrderNos(List<String> shopOrderNos) {
+        this.shopOrderNos = shopOrderNos;
+    }
+
     public Double getCouponAmount() {
         return couponAmount;
     }

+ 12 - 1
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -255,6 +255,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 Integer returnedFreightNum = newOrderProductDao.countReturnedFreightProduct(so.getOrderID());
                 Boolean returnedFreightFlag = returnedFreightNum == null ? false : returnedFreightNum > 0 ? true : false;
                 so.setReturnedFreightFlag(returnedFreightFlag);
+                //所有子订单号
+                List<String> strings = newShopOrderDao.findShopOrderNos(so.getOrderID());
+                so.setShopOrderNos(strings);
+                //主订单总佣金
+                Double income = newShopOrderDao.findIncome(so.getOrderID());
+                so.setIncome(income);
             }
             cmPayShop.setTotalAmount(totalAmount);
             cmPayShop.setBalancePayFee(0D);
@@ -264,7 +270,6 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             cmPayShop.setApplicantName(currentUser.getName());
             cmPayShop.setStatus("0");
             cmPayShop.setShopOrders(payOrderList);
-//            newCmShopDao.find
         } else {
             applyDetail(cmPayShop);
         }
@@ -333,6 +338,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 Integer returnedFreightNum = newOrderProductDao.countReturnedFreightProduct(so.getOrderID());
                 Boolean returnedFreightFlag = returnedFreightNum == null ? false : returnedFreightNum > 0 ? true : false;
                 so.setReturnedFreightFlag(returnedFreightFlag);
+                //所有子订单号
+                List<String> strings = newShopOrderDao.findShopOrderNos(so.getOrderID());
+                so.setShopOrderNos(strings);
+                //主订单总佣金
+                Double income = newShopOrderDao.findIncome(so.getOrderID());
+                so.setIncome(income);
             }
             cmPayShop.setShopOrders(csos);
         }

ファイルの差分が大きいため隠しています
+ 637 - 627
src/main/resources/mappings/modules/order/ShopOrderMapper.xml


+ 9 - 6
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -332,12 +332,12 @@
                     <td colspan="3"> ${s.buyer}</td>
                     <td colspan="2"> ${s.orderTime}</td>
                     <td>${s.payTotalFee}</td>
-                    <td colspan="3"> 所有子订单
-            <c:forEach items="${cmPayShop.shopOrders}" var="cs">
-                ${cs.shopOrderNo}(${s.shopOrderID})
-            </c:forEach>
+                    <td colspan="3">
+                    <c:forEach items="${s.shopOrderNos}" var="cs">
+                        ${cs}<br/>
+                    </c:forEach>
                     </td>
-                    <td>订单总佣金</td>
+                    <td>${s.income}</td>
                     <td>
                         <label class="clubFreight">
                             <c:choose>
@@ -362,6 +362,9 @@
                             <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"
@@ -424,7 +427,7 @@
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})</td>
                     <td colspan="3">${s.shopName}</td>
-                    <td colspan="3">子订单佣金</td>
+                    <td colspan="3" class="payCm-t">子订单佣金</td>
                     <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
                     <td class="taxes">

+ 10 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -111,8 +111,12 @@
 						<td colspan="3"> ${s.buyer}</td>
 						<td colspan="2"> ${s.orderTime}</td>
 						<td>${s.payTotalFee}</td>
-						<td colspan="3"> 所有子订单</td>
-						<td>订单总佣金</td>
+						<td colspan="3">
+							<c:forEach items="${s.shopOrderNos}" var="cs">
+								${cs}<br/>
+							</c:forEach>
+						</td>
+						<td>${s.income}</td>
 						<td>
 							<label class="clubFreight">
 								<c:choose>
@@ -137,6 +141,9 @@
 								<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"
@@ -199,7 +206,7 @@
 					<tr>
 						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
 						<td colspan="3">${s.shopName}</td>
-						<td colspan="3">子订单佣金</td>
+						<td colspan="3" class="payCm-t">子订单佣金</td>
 						<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
 						<td class="taxes">

+ 10 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopEdit.jsp

@@ -100,8 +100,12 @@
                         <td colspan="3"> ${s.buyer}</td>
                         <td colspan="2"> ${s.orderTime}</td>
                         <td>${s.payTotalFee}</td>
-                        <td colspan="3"> 所有子订单</td>
-                        <td>订单总佣金</td>
+                        <td colspan="3">
+                        <c:forEach items="${s.shopOrderNos}" var="cs">
+                            ${cs}<br/>
+                        </c:forEach>
+                        </td>
+                        <td>${s.income}</td>
                         <td>
                             <label class="clubFreight">
                                 <c:choose>
@@ -126,6 +130,9 @@
                                 <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"
@@ -188,7 +195,7 @@
                     <tr>
                         <td>${s.shopOrderNo}(${s.shopOrderID})</td>
                         <td colspan="3">${s.shopName}</td>
-                        <td colspan="3">子订单佣金</td>
+                        <td colspan="3" class="payCm-t">子订单佣金</td>
                         <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
                         <td class="taxes">

+ 10 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -432,8 +432,12 @@
                         <td colspan="3"> ${s.buyer}</td>
                         <td colspan="2"> ${s.orderTime}</td>
                         <td>${s.payTotalFee}</td>
-                        <td colspan="3"> 所有子订单</td>
-                        <td>订单总佣金</td>
+                        <td colspan="3">
+                        <c:forEach items="${s.shopOrderNos}" var="cs">
+                            ${cs}<br/>
+                        </c:forEach>
+                        </td>
+                        <td>${s.income}</td>
                         <td>
                             <label class="clubFreight">
                                 <c:choose>
@@ -458,6 +462,9 @@
                                 <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"
@@ -520,7 +527,7 @@
                     <tr>
                         <td>${s.shopOrderNo}(${s.shopOrderID})</td>
                         <td colspan="3">${s.shopName}</td>
-                        <td colspan="3">子订单佣金</td>
+                        <td colspan="3" class="payCm-t">子订单佣金</td>
                         <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
                         <td class="taxes">

+ 9 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -355,9 +355,12 @@
                     <td colspan="3"> ${s.buyer}</td>
                     <td colspan="2"> ${s.orderTime}</td>
                     <td>${s.payTotalFee}</td>
-                    <td colspan="3"> 所有子订单
+                    <td colspan="3">
+                        <c:forEach items="${s.shopOrderNos}" var="cs">
+                            ${cs}<br/>
+                        </c:forEach>
                     </td>
-                    <td>订单总佣金</td>
+                    <td>${s.income}</td>
                     <td>
                         <label class="clubFreight">
                             <c:choose>
@@ -382,6 +385,9 @@
                             <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"
@@ -444,7 +450,7 @@
                 <tr>
                     <td>${s.shopOrderNo}(${s.shopOrderID})</td>
                     <td colspan="3">${s.shopName}</td>
-                    <td colspan="3">子订单佣金</td>
+                    <td colspan="3" class="payCm-t">子订单佣金</td>
                     <td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
                     <td class="taxes">

+ 10 - 3
src/main/webapp/WEB-INF/views/modules/order/cmPayShopPrintDetail.jsp

@@ -113,8 +113,12 @@
 						<td colspan="3"> ${s.buyer}</td>
 						<td colspan="2"> ${s.orderTime}</td>
 						<td>${s.payTotalFee}</td>
-						<td colspan="3"> 所有子订单</td>
-						<td>订单总佣金</td>
+						<td colspan="3">
+						<c:forEach items="${s.shopOrderNos}" var="cs">
+							${cs}<br/>
+						</c:forEach>
+						</td>
+						<td>${s.income}</td>
 						<td>
 							<label class="clubFreight">
 								<c:choose>
@@ -139,6 +143,9 @@
 								<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"
@@ -201,7 +208,7 @@
 					<tr>
 						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
 						<td colspan="3">${s.shopName}</td>
-						<td colspan="3">子订单佣金</td>
+						<td colspan="3" class="payCm-t">子订单佣金</td>
 						<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
 						<td class="taxes">

+ 686 - 454
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -1,496 +1,728 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
-	<title>退款表--供应商退款给采美管理</title>
-	<meta name="decorator" content="default"/>
-	<style>
-		.table th{text-align:center}
-		.table td{text-align:center}
-		.refund-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
-		.required{color:red}
-		.refund-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
-		.refund-form-top{padding:10px 0}
-		.refund-form-top>div,.refund-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
-		.refund-form-top input{vertical-align:baseline}
-		.refund-form-top>div:last-child span{margin-left:15px}
-		.refund-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}
-		/*.supplier-fee{text-align:left !important;padding-top:20px !important;padding-left:20px !important}*/
-		.need-to-pay{width:90px}
-		.refund-form-bottom label{width:110px}
-		.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}
-		.refund-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
-		.refund-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-		.refund-cfm-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}
-		.remark-wrapper{height:auto !important;padding:0px 0 8px 0}
-		.remark-wrapper textarea{width:400px;height:150px;vertical-align:text-top;resize:none}
-		.refund-methods{height:auto !important}
-		.refund-methods>div{display:inline-block}
-		.refund-methods label{vertical-align:top;line-height:50px}
-		.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">
-		$(document).ready(function() {
-			//$("#name").focus();
-			$("#inputForm").validate({
-				submitHandler: function(form){
-					loading('正在提交,请稍等...');
-					form.submit();
-				},
-				errorContainer: "#messageBox",
-				errorPlacement: function(error, element) {
-					$("#messageBox").text("输入有误,请先更正。");
-					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
-						error.appendTo(element.parent().parent());
-					} else {
-						error.insertAfter(element);
-					}
-				}
-			});
-		});
-	</script>
+    <title>退款表--供应商退款给采美管理</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .refund-form h4 {
+            width: 96%;
+            margin-left: 2%;
+            padding-bottom: 20px;
+            text-align: center;
+            border-bottom: 1px solid #eee
+        }
+
+        .required {
+            color: red
+        }
+
+        .refund-form label {
+            width: 100px;
+            text-align: right;
+            vertical-align: middle;
+            font-weight: 600
+        }
+
+        .refund-form-top {
+            padding: 10px 0
+        }
+
+        .refund-form-top > div, .refund-form-bottom > div {
+            width: 94%;
+            margin-left: 3%;
+            height: 50px;
+            line-height: 50px;
+            border-bottom: 1px solid #eee;
+            white-space: nowrap
+        }
+
+        .refund-form-top input {
+            vertical-align: baseline
+        }
+
+        .refund-form-top > div:last-child span {
+            margin-left: 15px
+        }
+
+        .refund-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
+        }
+
+        /*.supplier-fee{text-align:left !important;padding-top:20px !important;padding-left:20px !important}*/
+        .need-to-pay {
+            width: 90px
+        }
+
+        .refund-form-bottom label {
+            width: 110px
+        }
+
+        .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
+        }
+
+        .refund-btn {
+            width: 96%;
+            margin-left: 2%;
+            text-align: center;
+            height: 60px;
+            line-height: 60px;
+            margin-top: 30px
+        }
+
+        .refund-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
+
+        .refund-cfm-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
+        }
+
+        .remark-wrapper {
+            height: auto !important;
+            padding: 0px 0 8px 0
+        }
+
+        .remark-wrapper textarea {
+            width: 400px;
+            height: 150px;
+            vertical-align: text-top;
+            resize: none
+        }
+
+        .refund-methods {
+            height: auto !important
+        }
+
+        .refund-methods > div {
+            display: inline-block
+        }
+
+        .refund-methods label {
+            vertical-align: top;
+            line-height: 50px
+        }
+
+        .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">
+        $(document).ready(function () {
+            //$("#name").focus();
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function (error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+        });
+    </script>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/order/cmRefundShop/">退款列表</a></li>
-		<li class="active"><a href="${ctx}/order/cmRefundShop/toRefund?id=${cmRefundShop.id}">退款详情</a></li>
-	</ul><br/>
-	<div class="refund-form">
-		<div class="refund-form-top">
-			<div>
-				<label>退款供应商:</label>
-				<span>${cmRefundShop.shopName}</span>
-			</div>
-		</div>
-			<div class="refund-form-content">
-				<c:forEach items="${cmRefundShop.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"> 所有子订单</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.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>
-								<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}">
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmRefundShop/">退款列表</a></li>
+    <li class="active"><a href="${ctx}/order/cmRefundShop/toRefund?id=${cmRefundShop.id}">退款详情</a></li>
+</ul>
+<br/>
+<div class="refund-form">
+    <div class="refund-form-top">
+        <div>
+            <label>退款供应商:</label>
+            <span>${cmRefundShop.shopName}</span>
+        </div>
+    </div>
+    <div class="refund-form-content">
+        <c:forEach items="${cmRefundShop.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">
+                            <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>
+                                        <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>)
+                                        <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>
-						<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>
+                        </c:if>
+                        <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" 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.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>
+                                应付:<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>
+                                <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>
+                                <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">
-								<label class="wipeBtn"><input class="wipeFee" type="checkbox" value="0"><span>付款抹平:<em
-										class="red wipeText">¥0.00</em></span></label>
-							</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>
-		<c:if test="${cmRefundShop.recordRefundType ne 5}">
-			<div class="refund-form-bottom">
-				<div style="text-align: center">
-					<label style="text-align: right">退款总金额:</label><span id="totalRefundAmount">${cmRefundShop.refundAmount+cmRefundShop.refundBalanceAmount}</span>
-					<input type="hidden" id="totalRefundAmount-hidden" name="refundAmount" value="${cmRefundShop.refundAmount}">
-					<input type="hidden" id="totalAmount-hidden" name="totalAmount" value="${cmRefundShop.refundAmount}">
-				</div>
-				<div class="refund-methods">
-					<label>接收退款方式:</label>
-					<div>
-						<div class="refund-wrapper">
-							<c:if test="${cmRefundShop.refundWay == '1'||cmRefundShop.refundWay == '3'||cmRefundShop.refundWay == '4'}">
-								线下转账:
-								<c:if test="${cmRefundShop.refundType == '1'}">
-									建设银行7297
-								</c:if>
-								<c:if test="${cmRefundShop.refundType == '2'}">
-									中信银行0897
-								</c:if>
-								<c:if test="${cmRefundShop.refundType == '3'}">
-									中信银行7172
-								</c:if>
-								<c:if test="${cmRefundShop.refundType == '4'}">
-									广发银行0115
-								</c:if>
-								<c:if test="${cmRefundShop.refundType == '5'}">
-									广发银行5461
-								</c:if>
-								<c:if test="${cmRefundShop.refundType == '6'}">
-									虚拟银行0000
-								</c:if>
-								,¥${cmRefundShop.refundAmount}
-								<c:if test="${cmRefundShop.refundWay eq 4}">
-									,${cmRefundShop.crmOperatorName}确认(CRM收款:${cmRefundShop.operatTime})
-								</c:if>
-							</c:if>
-						</div>
-						<div class="refund-wrapper">
-							<c:if test="${cmRefundShop.refundWay == '2'||cmRefundShop.refundWay == '3'}">
-								欠款账簿:¥${cmRefundShop.refundBalanceAmount}
-							</c:if>
-						</div>
-					</div>
-				</div>
-				<div class="remark-wrapper">
-					<label>备注:</label>
-					<span>
-					${cmRefundShop.remark}</span>
-				</div>
-			</div>
-		</c:if>
-	</div>
+                            <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 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>
+    <c:if test="${cmRefundShop.recordRefundType ne 5}">
+        <div class="refund-form-bottom">
+            <div style="text-align: center">
+                <label style="text-align: right">退款总金额:</label><span
+                    id="totalRefundAmount">${cmRefundShop.refundAmount+cmRefundShop.refundBalanceAmount}</span>
+                <input type="hidden" id="totalRefundAmount-hidden" name="refundAmount"
+                       value="${cmRefundShop.refundAmount}">
+                <input type="hidden" id="totalAmount-hidden" name="totalAmount" value="${cmRefundShop.refundAmount}">
+            </div>
+            <div class="refund-methods">
+                <label>接收退款方式:</label>
+                <div>
+                    <div class="refund-wrapper">
+                        <c:if test="${cmRefundShop.refundWay == '1'||cmRefundShop.refundWay == '3'||cmRefundShop.refundWay == '4'}">
+                            线下转账:
+                            <c:if test="${cmRefundShop.refundType == '1'}">
+                                建设银行7297
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '2'}">
+                                中信银行0897
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '3'}">
+                                中信银行7172
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '4'}">
+                                广发银行0115
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '5'}">
+                                广发银行5461
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '6'}">
+                                虚拟银行0000
+                            </c:if>
+                            ,¥${cmRefundShop.refundAmount}
+                            <c:if test="${cmRefundShop.refundWay eq 4}">
+                                ,${cmRefundShop.crmOperatorName}确认(CRM收款:${cmRefundShop.operatTime})
+                            </c:if>
+                        </c:if>
+                    </div>
+                    <div class="refund-wrapper">
+                        <c:if test="${cmRefundShop.refundWay == '2'||cmRefundShop.refundWay == '3'}">
+                            欠款账簿:¥${cmRefundShop.refundBalanceAmount}
+                        </c:if>
+                    </div>
+                </div>
+            </div>
+            <div class="remark-wrapper">
+                <label>备注:</label>
+                <span>
+                        ${cmRefundShop.remark}</span>
+            </div>
+        </div>
+    </c:if>
+</div>
 <c:if test="${cmRefundShop.recordRefundType eq 5}">
-	<div style="margin-left: 35px">
-		<div style="font-weight: bold;width: 100%;float: left;"><span style="float: left;">${cmRefundShop.shopDifference.systemName}</span><span style="float: left;margin-left:10px;"><fmt:formatDate value="${cmRefundShop.shopDifference.updateTime}" pattern="yyyy-MM-dd HH:mm"/></span></div>
-		<br><br>
-		<div>
-			<ul><b>差价类型:</b>${cmRefundShop.shopDifference.type eq 1 ? "成本上升":"成本降低"}</ul>
-			<ul><b>差价金额:</b>${cmRefundShop.shopDifference.differencePrice}</ul>
-			<c:if test="${not empty cmRefundShop}">
-				<ul><b>接收退款方式:</b></ul>
-				<div style="margin-left: 100px">
-					<div class="refund-wrapper">
-						<c:if test="${cmRefundShop.refundWay == '1'||cmRefundShop.refundWay == '3'||cmRefundShop.refundWay == '4'}">
-							线下转账:
-							<c:if test="${cmRefundShop.refundType == '1'}">
-								建设银行7297
-							</c:if>
-							<c:if test="${cmRefundShop.refundType == '2'}">
-								中信银行0897
-							</c:if>
-							<c:if test="${cmRefundShop.refundType == '3'}">
-								中信银行7172
-							</c:if>
-							<c:if test="${cmRefundShop.refundType == '4'}">
-								广发银行0115
-							</c:if>
-							<c:if test="${cmRefundShop.refundType == '5'}">
-								广发银行5461
-							</c:if>
-							<c:if test="${cmRefundShop.refundType == '6'}">
-								虚拟银行0000
-							</c:if>
-							,¥${cmRefundShop.refundAmount}
-							<c:if test="${cmRefundShop.refundWay eq 4}">
-								,${cmRefundShop.crmOperatorName}确认(CRM收款:${cmRefundShop.operatTime})
-							</c:if>
-						</c:if>
-					</div>
-					<div class="refund-wrapper">
-						<c:if test="${cmRefundShop.refundWay == '2'||cmRefundShop.refundWay == '3'}">
-							<b>余额账户:</b>¥${cmRefundShop.refundBalanceAmount}
-						</c:if>
-					</div>
-				</div><br>
-			</c:if>
-			<ul><b>备注内容:</b>${cmRefundShop.shopDifference.remark}</ul>
-			<ul><b>图片:</b>
-				<c:forEach items="${cmRefundShop.shopDifference.remarkImages}" var="image">
-					<img src="${image}" style="height: 100px;width: 100px">
-				</c:forEach>
-			</ul>
-		</div>
-	</div>
+    <div style="margin-left: 35px">
+        <div style="font-weight: bold;width: 100%;float: left;"><span
+                style="float: left;">${cmRefundShop.shopDifference.systemName}</span><span
+                style="float: left;margin-left:10px;"><fmt:formatDate value="${cmRefundShop.shopDifference.updateTime}"
+                                                                      pattern="yyyy-MM-dd HH:mm"/></span></div>
+        <br><br>
+        <div>
+            <ul><b>差价类型:</b>${cmRefundShop.shopDifference.type eq 1 ? "成本上升":"成本降低"}</ul>
+            <ul><b>差价金额:</b>${cmRefundShop.shopDifference.differencePrice}</ul>
+            <c:if test="${not empty cmRefundShop}">
+                <ul><b>接收退款方式:</b></ul>
+                <div style="margin-left: 100px">
+                    <div class="refund-wrapper">
+                        <c:if test="${cmRefundShop.refundWay == '1'||cmRefundShop.refundWay == '3'||cmRefundShop.refundWay == '4'}">
+                            线下转账:
+                            <c:if test="${cmRefundShop.refundType == '1'}">
+                                建设银行7297
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '2'}">
+                                中信银行0897
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '3'}">
+                                中信银行7172
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '4'}">
+                                广发银行0115
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '5'}">
+                                广发银行5461
+                            </c:if>
+                            <c:if test="${cmRefundShop.refundType == '6'}">
+                                虚拟银行0000
+                            </c:if>
+                            ,¥${cmRefundShop.refundAmount}
+                            <c:if test="${cmRefundShop.refundWay eq 4}">
+                                ,${cmRefundShop.crmOperatorName}确认(CRM收款:${cmRefundShop.operatTime})
+                            </c:if>
+                        </c:if>
+                    </div>
+                    <div class="refund-wrapper">
+                        <c:if test="${cmRefundShop.refundWay == '2'||cmRefundShop.refundWay == '3'}">
+                            <b>余额账户:</b>¥${cmRefundShop.refundBalanceAmount}
+                        </c:if>
+                    </div>
+                </div>
+                <br>
+            </c:if>
+            <ul><b>备注内容:</b>${cmRefundShop.shopDifference.remark}</ul>
+            <ul><b>图片:</b>
+                <c:forEach items="${cmRefundShop.shopDifference.remarkImages}" var="image">
+                    <img src="${image}" style="height: 100px;width: 100px">
+                </c:forEach>
+            </ul>
+        </div>
+    </div>
 </c:if>
-	<div class="refund-btn">
-			<input id="btnCancel" class="return-btn btn" type="button" value="返 回" onclick="history.go(-1)"/>
-	</div>
-	<div class="mask tips-popup">
-		<div class="tips-popup-content">
-			<h4>信息提示</h4>
-			<p></p>
-			<div>
-				<button class="tips-cfm-btn tips-cfm-directly" type="button">确定</button>
-				<button class="tips-cancel-btn" type="button">取消</button>
-			</div>
-			<img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
-		</div>
-	</div>
+<div class="refund-btn">
+    <input id="btnCancel" class="return-btn btn" type="button" value="返 回" onclick="history.go(-1)"/>
+</div>
+<div class="mask tips-popup">
+    <div class="tips-popup-content">
+        <h4>信息提示</h4>
+        <p></p>
+        <div>
+            <button class="tips-cfm-btn tips-cfm-directly" type="button">确定</button>
+            <button class="tips-cancel-btn" type="button">取消</button>
+        </div>
+        <img id="close-btn1" src="/static/images/close-btn.png" alt="close-btn">
+    </div>
+</div>
 </body>
 <script>
-	(function () {
-        $('.tips-cancel-btn, #close-btn1').on('click',function() {
+    (function () {
+        $('.tips-cancel-btn, #close-btn1').on('click', function () {
             $('.tips-popup').hide();
         });
 
-		$('body').on('input propertychange','.refund',function() {
-			var thisEle = $(this), wrapper = thisEle.parents(".supplier-fee"),
-				thisVal = thisEle.val(),
-				totalAmount = 0,
-				alreadyPaid = Number(wrapper.find('.payed').text());
-				//alreadyPaid = Number(wrapper.find('div:nth-child(2)').text().replace('已付:',''));
-			if(thisVal.length > 8){
-				wrapper.find('.refund').val(thisVal.slice(0,8));
-			}
-			if((thisVal > alreadyPaid) ) {
-				thisEle.val(alreadyPaid);
-			}
-			if (thisVal < 0) {
-				thisEle.val(0);
-			}
+        $('.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);
+        })
+
+        $('body').on('input propertychange', '.refund', function () {
+            var thisEle = $(this), wrapper = thisEle.parents(".supplier-fee"),
+                thisVal = thisEle.val(),
+                totalAmount = 0,
+                alreadyPaid = Number(wrapper.find('.payed').text());
+            //alreadyPaid = Number(wrapper.find('div:nth-child(2)').text().replace('已付:',''));
+            if (thisVal.length > 8) {
+                wrapper.find('.refund').val(thisVal.slice(0, 8));
+            }
+            if ((thisVal > alreadyPaid)) {
+                thisEle.val(alreadyPaid);
+            }
+            if (thisVal < 0) {
+                thisEle.val(0);
+            }
             $('.refund').each(function (index, ele) {
-                totalAmount+= Number($(this).val());
+                totalAmount += Number($(this).val());
                 $('#totalRefundAmount').text(totalAmount);
             });
-			var refundInfo = thisEle.next("input[name='refundInfo']");
-			refundInfo.val(refundInfo.attr('data-shoporderid') + '_' + thisEle.val());
-		});
+            var refundInfo = thisEle.next("input[name='refundInfo']");
+            refundInfo.val(refundInfo.attr('data-shoporderid') + '_' + thisEle.val());
+        });
 
-        function showTips(title,text) {
+        function showTips(title, text) {
             $('.tips-popup h4').text(title);
             $('.tips-popup p').text(text);
             $('.tips-popup').show();
         }
 
-        $('.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 {
                 $('#form').submit();
             }
         })
-        $('.refund-cfm-btn').on('click',function() {
+        $('.refund-cfm-btn').on('click', function () {
             var totalRefundAmount = $('#totalRefundAmount').text();
-            if(!totalRefundAmount.trim()) {
-                showTips('信息提示','退款金额不能为空');
+            if (!totalRefundAmount.trim()) {
+                showTips('信息提示', '退款金额不能为空');
             } else {
                 $('.tips-cfm-btn').removeClass('tips-cfm-directly');
                 $('.tips-cancel-btn').show();
-                showTips('确认提示','确定操作已退付款?');
-			}
+                showTips('确认提示', '确定操作已退付款?');
+            }
         })
-	})()
+    })()
 </script>
 </html>

+ 27 - 3
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopForm.jsp

@@ -107,8 +107,12 @@
 						<td colspan="3"> ${s.buyer}</td>
 						<td colspan="2"> ${s.orderTime}</td>
 						<td>${s.payTotalFee}</td>
-						<td colspan="3"> 所有子订单</td>
-						<td>订单总佣金</td>
+						<td colspan="3">
+						<c:forEach items="${s.shopOrderNos}" var="cs">
+							${cs}<br/>
+						</c:forEach>
+						</td>
+						<td>${s.income}</td>
 						<td>
 							<label class="clubFreight">
 								<c:choose>
@@ -133,6 +137,9 @@
 								<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"
@@ -195,7 +202,7 @@
 					<tr>
 						<td>${s.shopOrderNo}(${s.shopOrderID})</td>
 						<td colspan="3">${s.shopName}</td>
-						<td colspan="3">子订单佣金</td>
+						<td colspan="3" class="payCm-t">子订单佣金</td>
 						<td colspan="3" class="product-fee">${s.shopProductAmount}</td>
 
 						<td class="taxes">
@@ -408,6 +415,23 @@
                 /*$(this).find('.mergeRows').attr('rowspan',productLength);*/
             });
 
+			$('.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);
+			})
+
 			$('.tips-cancel-btn, #close-btn1').on('click',function() {
 				$('.tips-popup').hide();
                 if(isflg) {

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません