Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/developer' into developerH

Duan_xu 2 gadi atpakaļ
vecāks
revīzija
5d7c276c7f
24 mainītis faili ar 1337 papildinājumiem un 682 dzēšanām
  1. 2 0
      src/main/java/com/caimei/modules/order/dao/CmUtilsDao.java
  2. 2 0
      src/main/java/com/caimei/modules/order/dao/NewOrderDao.java
  3. 9 0
      src/main/java/com/caimei/modules/order/entity/CmPayShop.java
  4. 10 1
      src/main/java/com/caimei/modules/order/entity/NewOrder.java
  5. 9 0
      src/main/java/com/caimei/modules/order/entity/NewShopOrder.java
  6. 14 1
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  7. 7 1
      src/main/java/com/caimei/modules/order/utils/OrderUtil.java
  8. 47 11
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  9. 3 0
      src/main/resources/mappings/modules/order/CmUtilsMapper.xml
  10. 12 1
      src/main/resources/mappings/modules/order/OrderMapper.xml
  11. 3 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  12. 1 1
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp
  13. 2 2
      src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp
  14. 24 14
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp
  15. 719 462
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp
  16. 6 1
      src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp
  17. 12 2
      src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp
  18. 45 0
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp
  19. 43 5
      src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp
  20. 64 0
      src/main/webapp/WEB-INF/views/modules/order/rebateFeeEdit.jsp
  21. 239 169
      src/main/webapp/WEB-INF/views/modules/order/secondProductOrderForm.jsp
  22. 17 9
      src/main/webapp/WEB-INF/views/modules/order/secondhandOrderList.jsp
  23. 1 2
      src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp
  24. 46 0
      src/main/webapp/static/modules/bulkpurchase/orderForm.js

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/CmUtilsDao.java

@@ -24,4 +24,6 @@ public interface CmUtilsDao {
      * @return
      */
     Double selectPayTotalFees(Integer orderID);
+
+    Integer findOrderIsSecond(Integer orderId);
 }

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/NewOrderDao.java

@@ -260,4 +260,6 @@ public interface NewOrderDao extends CrudDao<NewOrder> {
     List<SettleRecord> findSettleRecord(Integer orderID);
 
     Double findSettleAmount(Integer orderID);
+
+    Integer findShopOrderSize(Integer orderID);
 }

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

@@ -43,6 +43,7 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     private String status;        // 审核状态  0待审核,  1审核通过 2 审核不通过
     private String reason;        // 审核不通过原因
     private Integer paymentType; //付款类型: 1子订单付款 2供应商差价 3付第三方
+    private String rebateFee; // 返佣服务费
 
     private String startTime;
     private String endTime;
@@ -67,6 +68,14 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     //  付款账号的类型 0公账, 1私账
     private String typeStr;
 
+    public String getRebateFee() {
+        return rebateFee;
+    }
+
+    public void setRebateFee(String rebateFee) {
+        this.rebateFee = rebateFee;
+    }
+
     public String getPayBank() {
         return payBank;
     }

+ 10 - 1
src/main/java/com/caimei/modules/order/entity/NewOrder.java

@@ -136,7 +136,8 @@ public class NewOrder extends DataEntity<NewOrder> {
     private boolean receiptOrderFlag;// 判断订单中抹平的订单是否是和多个订单一起支付的,
     private Integer rechargeGoods; //1,缴纳订金;2,充值余额
     private String affirmPaymentFlag;// 二手订单确认付款供应商标识 0未确认,1已确认
-    private String rebateFlag;//返佣订单标识,0非返佣订单,1返佣订单
+    private String rebateFlag;//返佣订单标识,0非返佣订单,1返佣订单,2普通订单有返佣服务费
+    private String rebateFee; // 返佣服务费
     private String associationType;//订单关联方式: 1手动 2自动
     private Double ableUserMoney; //当前下单用户可用余额
     private String organizeStoreName;//组织门店名称
@@ -162,6 +163,14 @@ public class NewOrder extends DataEntity<NewOrder> {
     private Integer receiveCouponId;
     private CmHeheCouponOrderRecord heheCouponRecord;   //优惠券信息
 
+    public String getRebateFee() {
+        return rebateFee;
+    }
+
+    public void setRebateFee(String rebateFee) {
+        this.rebateFee = rebateFee;
+    }
+
     public Integer getProductCategory() {
         return productCategory;
     }

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

@@ -137,6 +137,7 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private Double payed;//已付金额
     private String clubName; //会所名称
     private Integer orderArchiveId; //订单资料id
+    private String rebateFee; //主订单返佣服务费
 
     // 备注图片
     private String remarkImage1;
@@ -154,6 +155,14 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
 
     private boolean payShopOtherFee = true; //是否可以付第三方申请
 
+    public String getRebateFee() {
+        return rebateFee;
+    }
+
+    public void setRebateFee(String rebateFee) {
+        this.rebateFee = rebateFee;
+    }
+
     public Integer getSettleStatus() {
         return settleStatus;
     }

+ 14 - 1
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -1239,7 +1239,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             //获取订单商品
             List<NewOrderProduct> list = new ArrayList<>();
             List<NewShopOrder> shopOrders = newShopOrderDao.findListByOrderID(newOrder.getOrderID());
-            if (shopOrders.size() > 1) {
+            Integer count=newOrderDao.findShopOrderSize(newOrder.getOrderID());
+            if (count > 1) {
                 newOrder.setRechargeGoods(3);
             }
             if (CollectionUtils.isNotEmpty(shopOrders)) {
@@ -2661,4 +2662,16 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     public List<SettleRecord> findSettleRecord(Integer orderID) {
         return newOrderDao.findSettleRecord(orderID);
     }
+
+    public NewOrder editRebateFee(NewOrder newOrder) {
+        NewOrder order = newOrderDao.get(String.valueOf(newOrder.getOrderID()));
+        return order;
+    }
+
+    @Transactional(readOnly = false)
+    public void saveRebateFee(NewOrder newOrder) {
+        newOrder.setRebateFee(newOrder.getRebateFee());
+        newOrder.setRebateFlag("2");
+        newOrderDao.update(newOrder);
+    }
 }

+ 7 - 1
src/main/java/com/caimei/modules/order/utils/OrderUtil.java

@@ -34,7 +34,7 @@ public class OrderUtil {
      *
      * @param order
      */
-    public static void orderSplit(NewOrder order,boolean payOnline) {
+    public static void orderSplit(NewOrder order, boolean payOnline) {
         int shopOrderNoIndex = 0;
         List<NewOrderProduct> orderProducts = order.getOrderProduct();
         // 促销
@@ -338,6 +338,12 @@ public class OrderUtil {
         if ("20".equals(payType)) {
             return "建设银行3346";
         }
+        if ("21".equals(payType)) {
+            return "中国银行9139";
+        }
+        if ("22".equals(payType)) {
+            return "华夏银行2400";
+        }
         return "";
     }
 

+ 47 - 11
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -428,7 +428,7 @@ public class NewOrderController extends BaseController {
                     if (ladderPriceFlag != null && !"".equals(ladderPriceFlag)) {
                         o.setLadderPriceFlag(Integer.valueOf(ladderPriceFlag));
                     }
-                    o.setSplitCode(productDao.getSplitCodeByProductId(o.getProductID())) ;
+                    o.setSplitCode(productDao.getSplitCodeByProductId(o.getProductID()));
                     if ("0".equals(productType)) {
                         o.setPreferential((o.getPrice() - o.getDiscountPrice()) * o.getNum());//折扣
                         o.setDiscountFee(BigDecimal.valueOf(o.getTotalFee()).subtract(BigDecimal.valueOf(o.getShouldPayFee())).doubleValue());//经理折扣
@@ -464,7 +464,6 @@ public class NewOrderController extends BaseController {
                     String productCategory = o.getProductCategory();
                     if (StringUtils.equals(productCategory, "2")) {
                         isSecondHandOrder = true;
-                        newOrder.setRebateFlag("0");
                     }
                 }
             }
@@ -530,7 +529,11 @@ public class NewOrderController extends BaseController {
             newOrderProductService.updateShopConfigFlag(newOrder.getOrderID());
         }
         addMessage(redirectAttributes, "保存订单成功");
-        return "redirect:" + Global.getAdminPath() + "/order/secondhandOrderList";
+        if ("1".equals(newOrder.getSecondHandOrderFlag())) {
+            return "redirect:" + Global.getAdminPath() + "/order/secondhandOrderList";
+        } else {
+            return "redirect:" + Global.getAdminPath() + "/order/orderList";
+        }
     }
 
     @RequiresPermissions("order:order:edit")
@@ -596,7 +599,7 @@ public class NewOrderController extends BaseController {
     @RequestMapping("confirmOrder")
     public String confirmOrder(Integer orderID, Model model, RedirectAttributes redirectAttributes) {
         NewOrder order = newOrderService.get(orderID + "");
-        if (StringUtils.isNotEmpty(order.getStatus()) && Integer.parseInt(order.getStatus())>0){
+        if (StringUtils.isNotEmpty(order.getStatus()) && Integer.parseInt(order.getStatus()) > 0) {
             addMessage(redirectAttributes, "订单状态异常,请刷新后重试!");
             return "redirect:" + Global.getAdminPath() + "/order/detail/?id=" + orderID;
         }
@@ -626,7 +629,7 @@ public class NewOrderController extends BaseController {
                 Integer svipPriceFlag = op.getSvipPriceFlag();
                 Integer ladderPriceFlag = op.getLadderPriceFlag();
                 //活动商品和阶梯商品和超级会员价不写入价格库
-                if (StringUtil.equals("0", isActProduct) && 0 == svipPriceFlag && 0==ladderPriceFlag) {
+                if (StringUtil.equals("0", isActProduct) && 0 == svipPriceFlag && 0 == ladderPriceFlag) {
                     String buyAgainFlag = op.getBuyAgainFlag();
                     //对于可以复购的商品添加买家商品价格,提供再次购买商品使用(如果不存在没有改买家商品价格则不能购买该商品)
                     if (StringUtils.isNotEmpty(buyAgainFlag) && StringUtils.equals("1", buyAgainFlag)) {
@@ -772,7 +775,6 @@ public class NewOrderController extends BaseController {
     }
 
 
-
     /**
      * 确认收货
      *
@@ -789,8 +791,6 @@ public class NewOrderController extends BaseController {
     }
 
 
-
-
     /**
      * 去子订单orderProduct页面
      *
@@ -834,6 +834,7 @@ public class NewOrderController extends BaseController {
         r.put("data", orderProductList);
         return r;
     }
+
     @RequestMapping("toShipLogistic")
     public String toShipLogistic(Integer orderID, Model model) {
         model.addAttribute("orderID", orderID);
@@ -1338,7 +1339,7 @@ public class NewOrderController extends BaseController {
         }
         //订单已收金额
         Double brokerage = cmUtilsDao.selectPayTotalFees(order.getOrderID());
-        model.addAttribute("brokerage",brokerage);
+        model.addAttribute("brokerage", brokerage);
         Double receiptAmount = cmDiscernReceiptService.findOrderReceipt(order.getOrderID());
         model.addAttribute("returnValue", returnValue);
         model.addAttribute("receiptAmount", receiptAmount == null ? 0 : receiptAmount);
@@ -1461,17 +1462,17 @@ public class NewOrderController extends BaseController {
 
     /**
      * 置为已收款已付款
+     *
      * @param orderId
      * @return
      */
     @RequestMapping("toChangePay")
-    public String changePay(Integer orderId){
+    public String changePay(Integer orderId) {
         newOrderService.changePay(orderId);
         return "redirect:" + Global.getAdminPath() + "/order/orderList";
     }
 
 
-
     @RequestMapping(value = "saveClause")
     public String saveClause(NewOrder order, RedirectAttributes redirectAttributes, HttpServletRequest request) {
         String clauseContent = request.getParameter("clauseContent");
@@ -2085,6 +2086,36 @@ public class NewOrderController extends BaseController {
         return "modules/order/newOrderEdit";
     }
 
+    /**
+     * 编辑返佣服务费
+     */
+    @RequiresPermissions("order:order:edit")
+    @RequestMapping(value = "RebateFee")
+    public String editRebateFee(NewOrder newOrder, Model model, RedirectAttributes redirectAttributes) {
+        NewOrder order = newOrderService.editRebateFee(newOrder);
+        model.addAttribute("order", order);
+        return "modules/order/rebateFeeEdit";
+    }
+
+    /**
+     * 保存返佣服务费
+     */
+    @RequiresPermissions("order:order:edit")
+    @ResponseBody
+    @RequestMapping(value = "saveRebateFee")
+    public Map<String, Object> saveRebateFee(NewOrder newOrder) {
+        Map<String, Object> map = new HashMap();
+        try {
+            newOrderService.saveRebateFee(newOrder);
+            map.put("success", true);
+            map.put("msg", "修改返佣服务费成功");
+        } catch (Exception e) {
+            map.put("success", false);
+            map.put("msg", "修改返佣服务费失败");
+        }
+        return map;
+    }
+
     /**
      * 保存经理折扣
      */
@@ -2158,6 +2189,11 @@ public class NewOrderController extends BaseController {
     @RequestMapping("modifyRebate")
     public String modifyRebate(Integer orderId) {
         newOrderService.modifyRebate(orderId);
+        //1二手 0非二手
+        Integer secondHandOrderFlag = cmUtilsDao.findOrderIsSecond(orderId);
+        if (1 == secondHandOrderFlag) {
+            return "redirect:" + Global.getAdminPath() + "/order/secondhandOrderList";
+        }
         return "redirect:" + Global.getAdminPath() + "/order/orderList";
     }
 

+ 3 - 0
src/main/resources/mappings/modules/order/CmUtilsMapper.xml

@@ -56,6 +56,9 @@
         from cm_order co
         where orderID = #{orderID}
     </select>
+    <select id="findOrderIsSecond" resultType="java.lang.Integer">
+        select secondHandOrderFlag from cm_order where orderId= #{orderId}
+    </select>
 
 
 </mapper>

+ 12 - 1
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -59,6 +59,7 @@
 		a.couponAmount as couponAmount,
         a.svipFullReduction as svipFullReduction,
         (a.discountFee + a.promotionFullReduction + a.couponAmount) as discountAmount,
+        a.rebateFee,
         if(chcm.id is not null,1,0) as collageFlag,
         chc.status as collageStatus
     </sql>
@@ -126,7 +127,8 @@
         else
         ''
         end) AS spName,
-        co.rebateFlag AS rebateFlag
+        co.rebateFlag AS rebateFlag,
+        co.rebateFee AS rebateFee
         FROM cm_order co
         LEFT JOIN bp_order_userinfo bou ON bou.orderId = co.orderID
         LEFT JOIN user u ON u.userID = co.userID
@@ -394,6 +396,7 @@
                              promotionalGiftsCount,
                              affirmPaymentFlag,
                              rebateFlag,
+                             rebateFee,
                              payStatus,
                              zeroCostFlag,
                              couponAmount,
@@ -442,6 +445,7 @@
                 #{promotionalGiftsCount},
                 #{affirmPaymentFlag},
                 #{rebateFlag},
+                #{rebateFee},
                 #{payStatus},
                 #{zeroCostFlag},
                 #{couponAmount},
@@ -601,6 +605,9 @@
             <if test="rebateFlag != null">
                 rebateFlag = #{rebateFlag},
             </if>
+            <if test="rebateFee != null">
+                rebateFee = #{rebateFee},
+            </if>
             <if test="zeroCostFlag != null">
                 zeroCostFlag = #{zeroCostFlag},
             </if>
@@ -1381,6 +1388,10 @@
         WHERE settleType=1
           AND cso.orderId=#{orderID}
     </select>
+    <select id="findShopOrderSize" resultType="java.lang.Integer">
+        SELECT COUNT(*) FROM cm_shop_order WHERE orderId=#{orderID}
+                                             AND shopId!=998
+    </select>
     <insert id="insertSplitAccount">
         INSERT INTO cm_split_account (orderId, productId, orderProductId, shopId, couponRecordId, vipRecordId,
                                       authVipRecordId, type, subUserNo, splitAccount,

+ 3 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.caimei.modules.order.dao.NewShopOrderDao">
 
     <sql id="shopOrderColumns">
+        co.rebateFee as rebateFee,
         co.couponAmount as couponAmount,
 			co.userBeans as userBeans,
 			a.shopOrderID AS shopOrderID,
@@ -827,6 +828,7 @@
                 and a.payStatus = 3 and co.status NOT IN (6,7)
             </if>
             and co.delFlag = 0
+            and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
             and a.delFlag = 0
             and a.shopID != 998
             and co.orderID not in (
@@ -1026,6 +1028,7 @@
                                                                          WHERE cso.orderID = co.orderID)
                                                 AND cpsr.delFlag = 0
                                                 AND (cpsr.`status` = 1 OR cpsr.`status` = 0)), 0)
+                                    +IFNULL(co.rebateFee,0)
                                 ), 0), 2) AS "采美总佣金"
         FROM cm_order co
         WHERE co.orderID = #{orderID}

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptForm.jsp

@@ -165,7 +165,7 @@
 						<c:if test="${vo.receiptType == 2}">
                             非订单款
                             <c:if test="${cmDiscernReceipt.newReceiptType eq 1}">-上架费</c:if>
-                            <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-订单返佣</c:if>
+                            <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-服务返佣</c:if>
                             <c:if test="${cmDiscernReceipt.newReceiptType eq 3}">-认证通会员</c:if>
                             <c:if test="${cmDiscernReceipt.newReceiptType eq 4}">-认证通企划</c:if>
                         </c:if>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp

@@ -140,7 +140,7 @@
             <form:select path="newReceiptType" class="select-ele input-medium secondType" style="display: none">
                 <form:option value="" label="全部"/>
                 <form:option value="1" label="上架费"/>
-                <form:option value="2" label="订单返佣"/>
+                <form:option value="2" label="服务返佣"/>
                 <form:option value="3" label="认证通会员"/>
                 <form:option value="4" label="认证通企划"/>
             </form:select>
@@ -261,7 +261,7 @@
                     ${fns:getDictLabel(cmDiscernReceipt.receiptType, 'receiptType', null)}
                         <c:if test="${cmDiscernReceipt.receiptType eq 2 or cmDiscernReceipt.receiptType eq 9}">
                 <c:if test="${cmDiscernReceipt.newReceiptType eq 1}">-上架费</c:if>
-                        <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-订单返佣</c:if>
+                        <c:if test="${cmDiscernReceipt.newReceiptType eq 2}">-服务返佣</c:if>
                         <c:if test="${cmDiscernReceipt.newReceiptType eq 3}">-认证通会员</c:if>
                         <c:if test="${cmDiscernReceipt.receiptType eq 9}">认证通会员</c:if>
                         <c:if test="${cmDiscernReceipt.newReceiptType eq 4}">-认证通企划</c:if>

+ 24 - 14
src/main/webapp/WEB-INF/views/modules/order/cmPayShopCheck.jsp

@@ -278,8 +278,13 @@
             border-radius: 2px
         }
 
-        .clubFreight{display: none}
-        .discountFee{display: none}
+        .clubFreight {
+            display: none
+        }
+
+        .discountFee {
+            display: none
+        }
     </style>
 </head>
 <body>
@@ -333,13 +338,18 @@
                     <td colspan="2"> ${s.orderTime}</td>
                     <td>${s.payTotalFee}</td>
                     <td colspan="3">
-                    <c:forEach items="${s.shopOrderNos}" var="cs">
-                        ${cs}<br/>
-                    </c:forEach>
+                        <c:forEach items="${s.shopOrderNos}" var="cs">
+                            ${cs}<br/>
+                        </c:forEach>
+                    </td>
+                    <td>
+                            ${s.income}
+                        <c:if test="${not empty s.rebateFee}">
+                            <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>
+                        </c:if>
                     </td>
-                    <td>${s.income}</td>
                     <td>
-                        <label class="clubFreight"  style="display: none">
+                        <label class="clubFreight" style="display: none">
                             <c:choose>
                                 <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
                                     <fmt:formatNumber value="${s.freight}"/>
@@ -378,7 +388,7 @@
                            style="text-decoration: underline">${s.receiptTotalFee}</a>
                     </td>
                     <td>
-                        <label class="discountFee"  style="display: none">
+                        <label class="discountFee" style="display: none">
                             <c:choose>
                                 <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
                                     <fmt:formatNumber value="${s.discountTotalFee - s.returnedPurchaseTotalFee}"/>
@@ -671,12 +681,12 @@
                 totalComissionVal = 0,
                 resVal = '';
             totalComissionEle = thisEle.find('.payCm'),
-            comissionEle = thisEle.find('.payCm-t'),
-            thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),
-            freightVal = thisEle.find('.freight').text().replace(',', ''),
-            clubFreight = Number(thisEle.find('.clubFreight').text().replace(',','')),
-            discountFee = Number(thisEle.find('.discountFee').text().replace(',','')),
-            eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',',''));//分摊优惠
+                comissionEle = thisEle.find('.payCm-t'),
+                thirdPartyVal = thisEle.find('.third-party-fee').text().replace(',', ''),
+                freightVal = thisEle.find('.freight').text().replace(',', ''),
+                clubFreight = Number(thisEle.find('.clubFreight').text().replace(',', '')),
+                discountFee = Number(thisEle.find('.discountFee').text().replace(',', '')),
+                eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',', ''));//分摊优惠
             totalComissionEle.each(function () {
                 totalComissionVal += Number($(this).text().replace(',', ''));
             })

+ 719 - 462
src/main/webapp/WEB-INF/views/modules/order/cmPayShopDetail.jsp

@@ -1,487 +1,744 @@
 <%@ 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}
-		.payment-form h4{width:96%;margin-left:2%;padding-bottom:20px;text-align:center;border-bottom:1px solid #eee}
-		.required{color:red}
-		.payment-form label{width:100px;text-align:right;vertical-align:middle;font-weight:600}
-		.payment-form-top{padding:10px 0}
-		.payment-form-top>div,.payment-form-bottom>div{width:94%;margin-left:3%;height:50px;line-height:50px;border-bottom:1px solid #eee;white-space:nowrap}
-		.payment-form-top input{vertical-align:baseline}
-		.payment-form-top>div:last-child span{margin-left:15px}
-		.payment-form-top>div:last-child span:nth-of-type(1){margin-left:0}
-		.pay-list-item{margin-bottom:30px}
-		.pay-table{width:96%;margin-left:2%;margin-bottom:10px}
-		.pay-table th{background:#f9f9f9}
-		.pay-table tr:first-child th{background:#eee !important}
-		.pay-table td{background:#fff !important}
-		.check-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
-		.check-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-		.payment-form-bottom label{width:140px}
-		.used-amount{width:80px;margin-top:6px}
-		.process-details span{width:140px;margin-left:50px;font-weight:600}
-		.process-for-label{margin-left:0 !important}
-		.process-details div{display:inline-block}
-		.payment-btn{width:96%;margin-left:2%;text-align:center;height:60px;line-height:60px;margin-top:30px}
-		.payment-btn button{width:100px;height:35px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:none;border:1px solid #ddd}
-		.apply-btn{background:#3daae9;color:#fff}
-		.cfm-btn:active,.return-btn:active{background:#ddd;color:#fff}
-		.mask{width:100%;height:100%;position:fixed;top:0;background:rgba(0,0,0,0.7);display:none}
-		.tips-popup-content{width:40%;height:auto;padding-bottom:30px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
-		.tips-popup-content div{width:100%;text-align:center}
-		.tips-popup-content{width:30%}
-		.tips-popup-content p{text-align:center;padding:80px;font-size:20px}
-		.tips-popup-content h4{padding-left:10px;height:40px;line-height:40px;border-bottom:1px solid #eee;margin-bottom:20px}
-		.tips-cfm-btn,.tips-cancel-btn,.export{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}
-		.export{float:right;margin-right:50px}
-		.red{color:red;}
-		.payment-form-bottom .wipeImgs{height:auto;padding:8px 0;}
-		.wipeImgs img{width:120px;height:90px;background-color:#eee;margin-right:15px;}
-		.weishaIcon {background:darkorange;color:white;margin:0 0px;padding:0 3px;font-style:normal;font-size: 12px; display:inline-block;border-radius:2px}
-		.clubFreight{display: none}
-		.discountFee{display: none}
-	</style>
-	<style media="print">
-		.styleWidth{width:6%;word-break:break-all}
-		.styleWidth{}
-		.styleWidth3{width:10%;word-break:break-all}
-		.table{margin-left:0;margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid #ddd;box-sizing:border-box}
-		.export{display:none}
-	</style>
+    <title>付款单表管理</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .table th {
+            text-align: center
+        }
+
+        .table td {
+            text-align: center
+        }
+
+        .payment-form h4 {
+            width: 96%;
+            margin-left: 2%;
+            padding-bottom: 20px;
+            text-align: center;
+            border-bottom: 1px solid #eee
+        }
+
+        .required {
+            color: red
+        }
+
+        .payment-form label {
+            width: 100px;
+            text-align: right;
+            vertical-align: middle;
+            font-weight: 600
+        }
+
+        .payment-form-top {
+            padding: 10px 0
+        }
+
+        .payment-form-top > div, .payment-form-bottom > div {
+            width: 94%;
+            margin-left: 3%;
+            height: 50px;
+            line-height: 50px;
+            border-bottom: 1px solid #eee;
+            white-space: nowrap
+        }
+
+        .payment-form-top input {
+            vertical-align: baseline
+        }
+
+        .payment-form-top > div:last-child span {
+            margin-left: 15px
+        }
+
+        .payment-form-top > div:last-child span:nth-of-type(1) {
+            margin-left: 0
+        }
+
+        .pay-list-item {
+            margin-bottom: 30px
+        }
+
+        .pay-table {
+            width: 96%;
+            margin-left: 2%;
+            margin-bottom: 10px
+        }
+
+        .pay-table th {
+            background: #f9f9f9
+        }
+
+        .pay-table tr:first-child th {
+            background: #eee !important
+        }
+
+        .pay-table td {
+            background: #fff !important
+        }
+
+        .check-btn {
+            width: 96%;
+            margin-left: 2%;
+            text-align: center;
+            height: 60px;
+            line-height: 60px;
+            margin-top: 30px
+        }
+
+        .check-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
+
+        .payment-form-bottom label {
+            width: 140px
+        }
+
+        .used-amount {
+            width: 80px;
+            margin-top: 6px
+        }
+
+        .process-details span {
+            width: 140px;
+            margin-left: 50px;
+            font-weight: 600
+        }
+
+        .process-for-label {
+            margin-left: 0 !important
+        }
+
+        .process-details div {
+            display: inline-block
+        }
+
+        .payment-btn {
+            width: 96%;
+            margin-left: 2%;
+            text-align: center;
+            height: 60px;
+            line-height: 60px;
+            margin-top: 30px
+        }
+
+        .payment-btn button {
+            width: 100px;
+            height: 35px;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            border: none;
+            border: 1px solid #ddd
+        }
+
+        .apply-btn {
+            background: #3daae9;
+            color: #fff
+        }
+
+        .cfm-btn:active, .return-btn:active {
+            background: #ddd;
+            color: #fff
+        }
+
+        .mask {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            background: rgba(0, 0, 0, 0.7);
+            display: none
+        }
+
+        .tips-popup-content {
+            width: 40%;
+            height: auto;
+            padding-bottom: 30px;
+            background: #fff;
+            -webkit-border-radius: 5px;
+            -moz-border-radius: 5px;
+            border-radius: 5px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%)
+        }
+
+        .tips-popup-content div {
+            width: 100%;
+            text-align: center
+        }
+
+        .tips-popup-content {
+            width: 30%
+        }
+
+        .tips-popup-content p {
+            text-align: center;
+            padding: 80px;
+            font-size: 20px
+        }
+
+        .tips-popup-content h4 {
+            padding-left: 10px;
+            height: 40px;
+            line-height: 40px;
+            border-bottom: 1px solid #eee;
+            margin-bottom: 20px
+        }
+
+        .tips-cfm-btn, .tips-cancel-btn, .export {
+            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
+        }
+
+        .export {
+            float: right;
+            margin-right: 50px
+        }
+
+        .red {
+            color: red;
+        }
+
+        .payment-form-bottom .wipeImgs {
+            height: auto;
+            padding: 8px 0;
+        }
+
+        .wipeImgs img {
+            width: 120px;
+            height: 90px;
+            background-color: #eee;
+            margin-right: 15px;
+        }
+
+        .weishaIcon {
+            background: darkorange;
+            color: white;
+            margin: 0 0px;
+            padding: 0 3px;
+            font-style: normal;
+            font-size: 12px;
+            display: inline-block;
+            border-radius: 2px
+        }
+
+        .clubFreight {
+            display: none
+        }
+
+        .discountFee {
+            display: none
+        }
+    </style>
+    <style media="print">
+        .styleWidth {
+            width: 6%;
+            word-break: break-all
+        }
+
+        .styleWidth {
+        }
+
+        .styleWidth3 {
+            width: 10%;
+            word-break: break-all
+        }
+
+        .table {
+            margin-left: 0;
+            margin-bottom: 20px;
+            padding-bottom: 2px;
+            border-bottom: 1px solid #ddd;
+            box-sizing: border-box
+        }
+
+        .export {
+            display: none
+        }
+    </style>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
-		<li class="active"><a href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">付款单详情</a></li>
-	</ul><br/>
-	<div class="payment-form">
-		<h4>付款单</h4>
-		<div class="payment-form-top">
-			<div>
-				<label><span class="required">* </span>付款单名称:</label>
-				<span>${cmPayShop.name}</span>
-			</div>
-			<div>
-				<label>供应商名称:</label>
-				<span>${cmPayShop.shopName}</span>
-			</div>
-			<div>
-				<label><em class="required">* </em>付款账号:</label>
-				<c:if test="${cmPayShop.payType eq '6'}">
-					无
-				</c:if>
-				<c:if test="${cmPayShop.payType ne '6'}">
-					<span>户名:${cmPayShop.bankAccountName}</span>
-					<span>账号:${cmPayShop.bankAccount}</span>
-					<span>开户行:${cmPayShop.bankName}</span>
-					<span>账户类型:
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/cmPayShop/">付款列表</a></li>
+    <li class="active"><a href="${ctx}/order/cmPayShop/applyDetail?id=${cmPayShop.id}">付款单详情</a></li>
+</ul>
+<br/>
+<div class="payment-form">
+    <h4>付款单</h4>
+    <div class="payment-form-top">
+        <div>
+            <label><span class="required">* </span>付款单名称:</label>
+            <span>${cmPayShop.name}</span>
+        </div>
+        <div>
+            <label>供应商名称:</label>
+            <span>${cmPayShop.shopName}</span>
+        </div>
+        <div>
+            <label><em class="required">* </em>付款账号:</label>
+            <c:if test="${cmPayShop.payType eq '6'}">
+                无
+            </c:if>
+            <c:if test="${cmPayShop.payType ne '6'}">
+                <span>户名:${cmPayShop.bankAccountName}</span>
+                <span>账号:${cmPayShop.bankAccount}</span>
+                <span>开户行:${cmPayShop.bankName}</span>
+                <span>账户类型:
 						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
 						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
 					</span>
-				</c:if>
-			</div>
-		</div>
-		<div class="payment-form-content">
-            <%--涛姐遍历下面这个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">客户</th>
-						<th colspan="2">下单时间</th>
-						<th>订单金额</th>
-						<th colspan="3">所有子订单</th>
-						<th>订单总佣金</th>
-						<th>机构运费</th>
-						<th>收款状态</th>
-						<th colspan="3">收款金额</th>
-						<th>经理折扣</th>
-						<th>优惠券</th>
-					<tr/>
-					<tr>
-						<td> ${s.orderNo}(${s.orderID})</td>
-						<td colspan="3"> ${s.buyer}</td>
-						<td colspan="2"> ${s.orderTime}</td>
-						<td>${s.payTotalFee}</td>
-						<td colspan="3">
-							<c:forEach items="${s.shopOrderNos}" var="cs">
-								${cs}<br/>
-							</c:forEach>
-						</td>
-						<td>${s.income}</td>
-						<td>
-							<label class="clubFreight"  style="display: none">
-								<c:choose>
-									<c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
-										<fmt:formatNumber value="${s.freight}"/>
-									</c:when>
-									<c:otherwise>
-										<fmt:formatNumber value="0"/>
-									</c:otherwise>
-								</c:choose>
-							</label>
-							<c:if test="${s.freight == 0}">
-								包邮
-							</c:if>
-							<c:if test="${s.freight == -1}">
-								到付
-							</c:if>
-							<c:if test="${s.freight == -2}">
-								仪器到付-产品包邮
-							</c:if>
-							<c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
-								<fmt:formatNumber value="${s.freight}" type="currency"/>
-								<c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
-							</c:if>
-							<c:if test="${s.userBeans gt 0}">
-								(采美豆抵用${s.userBeans})
-							</c:if>
-						</td>
-						<td>
-							<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-							   style="text-decoration: underline">
-								<c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-								<c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-								<c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
-						</td>
-						<td colspan="3">
-							<a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-							   style="text-decoration: underline">${s.receiptTotalFee}</a>
-						</td>
-						<td>
-							<label class="discountFee"  style="display: none">
-								<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}">
+            </c:if>
+        </div>
+    </div>
+    <div class="payment-form-content">
+        <%--涛姐遍历下面这个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">客户</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}
+                        <c:if test="${not empty s.rebateFee}">
+                            <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>
+                        </c:if>
+                    </td>
+                    <td>
+                        <label class="clubFreight" style="display: none">
+                            <c:choose>
+                                <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
+                                    <fmt:formatNumber value="${s.freight}"/>
+                                </c:when>
+                                <c:otherwise>
+                                    <fmt:formatNumber value="0"/>
+                                </c:otherwise>
+                            </c:choose>
+                        </label>
+                        <c:if test="${s.freight == 0}">
+                            包邮
+                        </c:if>
+                        <c:if test="${s.freight == -1}">
+                            到付
+                        </c:if>
+                        <c:if test="${s.freight == -2}">
+                            仪器到付-产品包邮
+                        </c:if>
+                        <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
+                            <fmt:formatNumber value="${s.freight}" type="currency"/>
+                            <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                        </c:if>
+                        <c:if test="${s.userBeans gt 0}">
+                            (采美豆抵用${s.userBeans})
+                        </c:if>
+                    </td>
+                    <td>
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                           style="text-decoration: underline">
+                            <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
+                            <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                            <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                    </td>
+                    <td colspan="3">
+                        <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
+                           style="text-decoration: underline">${s.receiptTotalFee}</a>
+                    </td>
+                    <td>
+                        <label class="discountFee" style="display: none">
+                            <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>
-						<td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
-					<tr/>
-					<tr>
-						<th>子订单编号(ID)</th>
-						<th colspan="3"> 供应商</th>
-						<th colspan="3">子订单佣金</th>
-						<th colspan="3">商品费</th>
-						<th>应付税费</th>
-						<th>供应商运费</th>
-						<th>付款状态</th>
-						<th colspan="3">付供应商</th>
-						<th>付第三方</th>
-						<th>成本类型</th>
-					</tr>
-					<tr>
-						<td>${s.shopOrderNo}(${s.shopOrderID})</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>
+                        </c:if>
+                        <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
+                    </td>
+                    <td>${s.couponAmount} </td>
+                    <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
+                <tr/>
+                <tr>
+                    <th>子订单编号(ID)</th>
+                    <th colspan="3"> 供应商</th>
+                    <th colspan="3">子订单佣金</th>
+                    <th colspan="3">商品费</th>
+                    <th>应付税费</th>
+                    <th>供应商运费</th>
+                    <th>付款状态</th>
+                    <th colspan="3">付供应商</th>
+                    <th>付第三方</th>
+                    <th>成本类型</th>
+                </tr>
+                <tr>
+                    <td>${s.shopOrderNo}(${s.shopOrderID})</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>
-		<div class="payment-form-bottom">
-			<div >
-				<label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
-				<span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
-				<c:if test="${cmPayShop.wipePayment > 0}">
-					<span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}" pattern="#,##0.00"/>)</span>
-				</c:if>
-			</div>
-			<c:if test="${cmPayShop.wipePayment > 0}">
-				<div>
-					<label>抹平备注:</label>
-					<span>${cmPayShop.wipeRemarks}</span>
-				</div>
-				<c:if test="${not empty cmPayShop.wipeImages}">
-                    <div class="wipeImgs">
-                        <label>图片:</label>
-                        <c:forEach items="${cmPayShop.wipeImages}" var="wi" varStatus="wIndex">
-                            <img src="${wi}">
-                        </c:forEach>
-                    </div>
-                </c:if>
-			</c:if>
-			<div>
-				<label>欠款抵扣:</label>
-				总欠款:<span id="rebateAmount">${empty cmPayShop.rebateAmount ? 0 : cmPayShop.rebateAmount }</span>,
-				可抵扣欠款:<span id="ableRebateAmount">${empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount }</span>,
-				使用:${cmPayShop.balancePayFee},
-				剩余:<span id="remainingBalance"> ${cmPayShop.status == '2'?((empty cmPayShop.ableRebateAmount ? 0:cmPayShop.ableRebateAmount)-cmPayShop.balancePayFee): (empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount)}</span>
-			</div>
-			<c:if test="${cmPayShop.payType ne '6'}">
-				<div>
-					<label style="font-weight: bold; font-size:18px">转账支付:</label>
-					<span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/></span>
-					<c:if test="${cmPayShop.status != '2'}">
-						<c:if test="${not empty cmPayShop.payType }">
-							<label>付款银行:</label>
-							<span id="payType">
+                            <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>
+    <div class="payment-form-bottom">
+        <div>
+            <label style="font-weight: bold; font-size:18px">${cmPayShop.paymentType eq 2 ? "需补供应商差价":"付供应商总金额"}:</label>
+            <span id="totalAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                    value="${cmPayShop.totalAmount}" pattern="#,##0.00"/> </span>
+            <c:if test="${cmPayShop.wipePayment > 0}">
+                <span class="red">(付款抹平总额:¥<fmt:formatNumber value="${cmPayShop.wipePayment}"
+                                                             pattern="#,##0.00"/>)</span>
+            </c:if>
+        </div>
+        <c:if test="${cmPayShop.wipePayment > 0}">
+            <div>
+                <label>抹平备注:</label>
+                <span>${cmPayShop.wipeRemarks}</span>
+            </div>
+            <c:if test="${not empty cmPayShop.wipeImages}">
+                <div class="wipeImgs">
+                    <label>图片:</label>
+                    <c:forEach items="${cmPayShop.wipeImages}" var="wi" varStatus="wIndex">
+                        <img src="${wi}">
+                    </c:forEach>
+                </div>
+            </c:if>
+        </c:if>
+        <div>
+            <label>欠款抵扣:</label>
+            总欠款:<span id="rebateAmount">${empty cmPayShop.rebateAmount ? 0 : cmPayShop.rebateAmount }</span>,
+            可抵扣欠款:<span
+                id="ableRebateAmount">${empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount }</span>,
+            使用:${cmPayShop.balancePayFee},
+            剩余:<span
+                id="remainingBalance"> ${cmPayShop.status == '2'?((empty cmPayShop.ableRebateAmount ? 0:cmPayShop.ableRebateAmount)-cmPayShop.balancePayFee): (empty cmPayShop.ableRebateAmount ? 0 : cmPayShop.ableRebateAmount)}</span>
+        </div>
+        <c:if test="${cmPayShop.payType ne '6'}">
+            <div>
+                <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber
+                        value="${cmPayShop.transferPayFee}" pattern="#,##0.00"/></span>
+                <c:if test="${cmPayShop.status != '2'}">
+                    <c:if test="${not empty cmPayShop.payType }">
+                        <label>付款银行:</label>
+                        <span id="payType">
 							<c:if test="${cmPayShop.payType eq 1}">
-								建设银行7297
-							</c:if>
+                                建设银行7297
+                            </c:if>
 							<c:if test="${cmPayShop.payType eq 2}">
-								中信银行0897
-							</c:if>
+                                中信银行0897
+                            </c:if>
 							<c:if test="${cmPayShop.payType eq 3}">
-								中信银行7172
-							</c:if>
+                                中信银行7172
+                            </c:if>
 							<c:if test="${cmPayShop.payType eq 4}">
-								广发银行0115
-							</c:if>
+                                广发银行0115
+                            </c:if>
 							<c:if test="${cmPayShop.payType eq 5}">
-								广发银行5461
-							</c:if>
+                                广发银行5461
+                            </c:if>
 						</span>
-						</c:if>
-						<c:if test="${cmPayShop.status != '0'}">
-						<label>付款时间:</label>
-						<span>${cmPayShop.payTime}</span>
-						</c:if>
-					</c:if>
-				</div>
-			</c:if>
-			<div class="process-details">
-				<label>申请人:</label><div class="process-for-label">${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}</div>
-				<span>申请时间:</span><div>${cmPayShop.applyTime}</div>
-				<c:if test="${cmPayShop.status != '0'}">
-				<span>审核人:</span><div>
-										<c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
-											${cmPayShop.payType eq '6'? '系统自动':cmPayShop.reviewerName}
-										</c:if>
-										</div>
-				<span>审核时间:</span><div>
-										<c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
-											${cmPayShop.reviewTime}
-										</c:if>
-										</div>
-				</c:if>
-			</div>
-			<div class="process-details process-details-last">
-				<label>审核状态:</label><div class="process-for-label">
-				<c:if test="${cmPayShop.status == '0'}">
-					待审核
-				</c:if>
-				<c:if test="${cmPayShop.status == '1'}">
-					审核通过
-				</c:if>
-				<c:if test="${cmPayShop.status == '2'}">
-					<font color="red">审核不通过</font>
-				</c:if></div>
-				<c:if test="${cmPayShop.status == '2'}">
-					<span>原因:</span><div>
-						${cmPayShop.reason}
-					</div>
-				</c:if>
-			</div>
-		</div>
-		<c:if test="${cmPayShop.status == '1'}">
-			<div class="check-btn">
-				<button class="apply-btn btn btn-primary" type="button" onclick="window.location.href='${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}'">去打印</button>
-			</div>
-		</c:if>
-	</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);
-			});
-
-			$('.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();
-				}
-			})
-			$('.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(',','')),
-				eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',',''));//分摊优惠
-                totalComissionEle.each(function(){
-                    totalComissionVal += Number($(this).text().replace(',',''));
-				})
-				resVal = (totalComissionVal - thirdPartyVal - eachDiscount).toFixed(2);
-                comissionEle.text(resVal);
-			})
-
-			$('.export').on('click',function() {
-				window.print();
-			})
-
-			function showTips(title,text) {
-				$('.tips-popup h4').text(title);
-				$('.tips-popup p').text(text);
-				$('.tips-popup').show();
-			}
-		})()
-	</script>
+                    </c:if>
+                    <c:if test="${cmPayShop.status != '0'}">
+                        <label>付款时间:</label>
+                        <span>${cmPayShop.payTime}</span>
+                    </c:if>
+                </c:if>
+            </div>
+        </c:if>
+        <div class="process-details">
+            <label>申请人:</label>
+            <div class="process-for-label">${cmPayShop.payType eq '6'? '系统自动':cmPayShop.applicantName}</div>
+            <span>申请时间:</span>
+            <div>${cmPayShop.applyTime}</div>
+            <c:if test="${cmPayShop.status != '0'}">
+                <span>审核人:</span>
+                <div>
+                    <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
+                        ${cmPayShop.payType eq '6'? '系统自动':cmPayShop.reviewerName}
+                    </c:if>
+                </div>
+                <span>审核时间:</span>
+                <div>
+                    <c:if test="${cmPayShop.status == 1 || cmPayShop.status == 2}">
+                        ${cmPayShop.reviewTime}
+                    </c:if>
+                </div>
+            </c:if>
+        </div>
+        <div class="process-details process-details-last">
+            <label>审核状态:</label>
+            <div class="process-for-label">
+                <c:if test="${cmPayShop.status == '0'}">
+                    待审核
+                </c:if>
+                <c:if test="${cmPayShop.status == '1'}">
+                    审核通过
+                </c:if>
+                <c:if test="${cmPayShop.status == '2'}">
+                    <font color="red">审核不通过</font>
+                </c:if></div>
+            <c:if test="${cmPayShop.status == '2'}">
+                <span>原因:</span>
+                <div>
+                        ${cmPayShop.reason}
+                </div>
+            </c:if>
+        </div>
+    </div>
+    <c:if test="${cmPayShop.status == '1'}">
+        <div class="check-btn">
+            <button class="apply-btn btn btn-primary" type="button"
+                    onclick="window.location.href='${ctx}/order/cmPayShop/printDetail?id=${cmPayShop.id}'">去打印
+            </button>
+        </div>
+    </c:if>
+</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);
+        });
+
+        $('.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();
+            }
+        })
+        $('.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(',', '')),
+                eachDiscount = Number(thisEle.find('.eachDiscount').text().replace(',', ''));//分摊优惠
+            totalComissionEle.each(function () {
+                totalComissionVal += Number($(this).text().replace(',', ''));
+            })
+            resVal = (totalComissionVal - thirdPartyVal - eachDiscount).toFixed(2);
+            comissionEle.text(resVal);
+        })
+
+        $('.export').on('click', function () {
+            window.print();
+        })
+
+        function showTips(title, text) {
+            $('.tips-popup h4').text(title);
+            $('.tips-popup p').text(text);
+            $('.tips-popup').show();
+        }
+    })()
+</script>
 </body>
 </html>

+ 6 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -437,7 +437,12 @@
                             ${cs}<br/>
                         </c:forEach>
                         </td>
-                        <td>${s.income}</td>
+                        <td>
+                                ${s.income}
+                            <c:if test="${not empty s.rebateFee}">
+                                    <span style="color: red">(含返佣服务费¥${s.rebateFee})</span>
+                            </c:if>
+                        </td>
                         <td>
                             <label class="clubFreight"  style="display: none">
                                 <c:choose>

+ 12 - 2
src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp

@@ -235,6 +235,7 @@
         <li>退款状态</li>
         <li>待审核退款</li>
         <li>订单金额</li>
+        <li>返佣服务费</li>
         <li>下单时间</li>
         <li>确认时间</li>
         <li>操作</li>
@@ -381,8 +382,17 @@
                 </c:if>
             </li>
-            <li><fmt:formatNumber value="${order.payTotalFee}" type="currency"/></li>
-                <%-- 订单金额 --%>
+            <li>                    <%-- 订单金额 --%>
+                <fmt:formatNumber value="${order.payTotalFee}" type="currency"/>
+            </li>
+            <li>                    <%-- 返佣服务费 --%>
+                <c:if test="${not empty order.rebateFee}">
+                <fmt:formatNumber value="${order.rebateFee}" type="currency"/>
+                </c:if>
+                <c:if test="${empty order.rebateFee}">
+                    ---
+                </c:if>
+            </li>
             <li>${order.orderTime}</li>
             <li>
                 <c:if test="${empty order.confirmTime}">

+ 45 - 0
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -669,10 +669,20 @@
                         <a href="javascript:void(0);"
                            onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
                     </c:if>
+
+                    <c:if test="${order.secondHandOrderFlag ne 1 && order.rebateFlag ne 1 && order.status != 0 && order.status != 6 && order.status != 7 && empty order.rechargeGoods}">
+                        <a href="javascript:void(0);"
+                           onclick="rebateFeeEdit('${order.orderID}')">编辑返佣服务费</a>
+                    </c:if>
+
                     <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag ne 1 && order.rechargeGoods ne 1 && order.rechargeGoods ne 3}">
                         <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
                            onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为返佣订单</a>
                     </c:if>
+                    <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag eq 1}">
+                        <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
+                           onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为二手返佣订单</a>
+                    </c:if>
                 </shiro:hasPermission>
                 <shiro:hasPermission name="order:order:applyrefound">
                     <%--线下订单以主订单为单位退款--%>
@@ -1262,6 +1272,41 @@
         });
     }
 
+    function rebateFeeEdit(orderID) {
+        top.$.jBox("iframe:${ctx}/order/RebateFee?orderID=" + orderID, {
+            iframeScrolling: 'yes',
+            top: 150,
+            width: 480,
+            height: 250,
+            persistent: true,
+            title: "编辑返佣服务费",
+            buttons: {"确认": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var rebateFee = $jboxFrame[0].contentWindow.submit();
+                    if (!rebateFee) {
+                        return false;
+                    }
+                    $.post("${ctx}/order/saveRebateFee", {
+                        'rebateFee': rebateFee,
+                        'orderID': orderID
+                    }, function (data) {
+                        if (true == data.success) {
+                            refresh(data.msg);
+                        } else {
+                            alertx(data.msg, 1000);
+                        }
+                    }, "JSON");//这里返回的类型有:json,html,xml,text
+                }
+                return true;
+            }, closed: function () {/* 窗口关闭后执行的函数 */
+            }
+        });
+    }
+
     //订单商品备注
     function remarks(orderID, shopOrderID) {
         top.$.jBox("iframe:${ctx}/order/cmOrderRemark/remarksView?orderID=" + orderID + "&shopOrderID=" + shopOrderID, {

+ 43 - 5
src/main/webapp/WEB-INF/views/modules/order/orderForm.jsp

@@ -506,13 +506,26 @@
         <thead>
         <tr>
             <td colspan="2">订单金额详情</td>
-            <td colspan="4">
+            <td colspan="2">
                 <div id="rebateDiv"
                      style="display: ${empty order.newShopOrders?'':(order.newShopOrders.size() ne 1)?'none':''}">
-                    <input type="checkbox" id="rebateCheckBox" ${order.rebateFlag eq 1?'checked':''}
-                           onchange="updateRebateFlag()" ${(empty order.orderID || order.status eq 0)?'':'disabled'} >
-                    <label>返佣订单</label>
-                    <form:hidden path="rebateFlag" value="${empty order.rebateFlag?'0':order.rebateFlag}"/>
+                        <%--                    <input type="checkbox" id="rebateCheckBox" ${order.rebateFlag eq 1?'checked':''}--%>
+                        <%--                           onchange="updateRebateFlag()" ${(empty order.orderID || order.status eq 0)?'':'disabled'} >--%>
+                        <%--                    <label>返佣订单</label>--%>
+                    <label>是否返佣: </label>
+                    <form:select id="rebateFlag" path="rebateFlag" class="required" cssStyle="width: 180px"
+                                 onchange="updateRebateFlag()">
+                        <form:option value="0">否</form:option>
+                        <form:option value="1">返佣订单</form:option>
+                        <form:option value="2">普通订单,存在返佣费用</form:option>
+                    </form:select>
+<%--                    <form:hidden path="rebateFlag" value="${empty order.rebateFlag?'0':order.rebateFlag}"/>--%>
+                </div>
+            </td>
+            <td colspan="2">
+                <div id="rebateFee" style="display: ${empty order.rebateFlag||order.rebateFlag != 2?'none':''}">
+                    <label>返佣服务费: </label>
+                    <input id="rebateFeeVal" type="text" name="rebateFee" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'')"/>
                 </div>
             </td>
         </tr>
@@ -839,6 +852,14 @@
                 if (onSubmitBefor() == false) {
                     return;
                 }
+                var rebateFlag = $("#rebateFlag").val()*1;
+                if(2===rebateFlag){
+                   var rebateFee = $("#rebateFeeVal").val();
+                   if(!rebateFee){
+                       alertx("请输入返佣服务费金额");
+                       return;
+                   }
+                }
                 top.$.jBox.confirm("请仔细确认订单是否为返佣订单后再提交订单", '提示', function (v, h, f) {
                     if (v == true) {
                         // 因为订单总额和应收订单金额都为0元,如果保存订单则状态直接为已付款!
@@ -974,6 +995,23 @@
 <script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/stages.js?<%=Math.random()%>"></script>
 <script>
     (function () {
+        var rebateFlag = $("#rebateFlag").val()*1;
+        if (1===rebateFlag) {
+            //选中返佣订单后不可用优惠券
+            // $("#couponBox").find("input[name=clubCouponId]").prop('checked', 'checked');
+            $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+            $("#couponBox").find("input[name=clubCouponId]").attr("disabled", true);
+            $("#couponBox").find("#bsy").prop('checked', 'checked');
+            $("#freePostFlag").attr("value", "-1");
+            $("#freeDesc").find(".select2-chosen").text("到付");
+            $("#useBalancePayFee").prop('checked', '');
+            setFreight();
+            $("#freePostFlag").attr("disabled", true);
+            $("#useBalancePayFee").attr("disabled", true);
+            $("#couponAmount").val(0);
+            $("#seen").find("#orderSeen2").prop('checked', 'checked');
+            setOrderFee();
+        }
         //初始化添加商品按钮--默认隐藏
         if (${empty order.confirmFlag || order.confirmFlag eq 0 ? 0:1 }) {
             var ui = document.getElementById("shopSelected");

+ 64 - 0
src/main/webapp/WEB-INF/views/modules/order/rebateFeeEdit.jsp

@@ -0,0 +1,64 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>编辑经理折扣</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            $("#inputForm").validate({
+                ignore: "",
+                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);
+                    }
+                }
+            });
+
+            // $("#rebateFee").blur(function () {
+            //     var _discountFeeVal = $(this).val();
+            //     var _balancePayFee = $('#balancePayFee').text();
+            //     var _orderTotalFeeVal = $('#orderTotalFee').text();
+            //     var New_payTotalFeeVal = _orderTotalFeeVal - _discountFeeVal - _balancePayFee;
+            //     $('#payTotalFee').text(New_payTotalFeeVal);
+            //     if (New_payTotalFeeVal <= 0) {
+            //         $('#isnumber').show();
+            //     } else {
+            //         $('#isnumber').hide();
+            //     }
+            // })
+        });
+
+        function submit() {
+            var rebateFee = $("#rebateFee").val();
+            return rebateFee;
+        }
+
+        function onlynum(obj) {
+            obj.value = obj.value.replace(/[^\.\d]/g, ""); //清除"数字 . "以外的字符
+        }
+    </script>
+</head>
+<body>
+<br>
+<form:form id="inputForm" modelAttribute="newOrder" action="${ctx}/order/rebateFee" method="post"
+           class="form-horizontal">
+    <sys:message content="${message}"/>
+
+    <div style="padding-top: 15px">
+        <span><label class="control-label">返佣服务费:</label></span>
+        <span><form:input path="rebateFee" htmlEscape="false" maxlength="20" class="input-medium"
+                          onkeyup="onlynum(this)" value="${order.rebateFee}"/></span>
+    </div>
+
+</form:form>
+</body>
+</html>

+ 239 - 169
src/main/webapp/WEB-INF/views/modules/order/secondProductOrderForm.jsp

@@ -36,9 +36,11 @@
             text-align: center;
             white-space: nowrap;
         }
+
         .fix-width {
             width: 230px;
         }
+
         .fix-right-margin {
             margin-right: 150px;
         }
@@ -46,30 +48,51 @@
     <script type="text/javascript">
         $(document).ready(function () {
             $("#name").focus();
+            $('#btnSubmit').click(function () {
+                if ($('.clauseId').is(':checked')) {
+                    $('.clauseId:checked').siblings('.clauseContent').attr("name", "clauseContent");
+                    $('.clauseId:checked').siblings('.clauseName').attr("name", "clauseName");
+                }
+                buttonSubmit();
+            })
+            //初始化添加按钮 隐藏商品添加入口
+            var val = $("#orderID").val();
+            if (val) {
+                $(".addSecondHandProduct").hide();
+            }
+        });
+
+        function buttonSubmit() {
             $("#inputForm").validate({
                 submitHandler: function (form) {
                     if (onSubmitBefor() == false) {
                         return;
                     }
-                    // 因为订单总额和应收订单金额都为0元,如果保存订单则状态直接为已付款!
-                    var payableAmount = $(".payableAmount").html();
-                    var payTotalFee = $(".payTotalFee").html();
-                    if(0 == payableAmount && 0 == payTotalFee ){
-                        top.$.jBox.confirm("该订单无须支付,保存后订单收款状态直接为“已收款”,且无需再确认订单",'保存订单提示',function(v,h,f){
-                                if(v=='ok'){
-                                    // 提交订单
-                                    loading('正在提交,请稍等...');
-                                    form.submit();
-                                }
-                            },{buttonsFocus:1, closed:function(){
-                                if (typeof closed == 'function') {
-                                    closed();
-                                }
-                            }});
-                    }else{
-                        loading('正在提交,请稍等...');
-                        form.submit();
-                    }
+                    top.$.jBox.confirm("请仔细确认订单是否为返佣订单后再提交订单", '提示', function (v, h, f) {
+                        if (v == true) {
+                            // 因为订单总额和应收订单金额都为0元,如果保存订单则状态直接为已付款!
+                            var payableAmount = $(".payableAmount").html();
+                            var payTotalFee = $(".payTotalFee").html();
+                            if (0 == payableAmount && 0 == payTotalFee) {
+                                top.$.jBox.confirm("该订单无须支付,保存后订单收款状态直接为“已收款”,且无需再确认订单", '保存订单提示', function (v, h, f) {
+                                    if (v == 'ok') {
+                                        // 提交订单
+                                        loading('正在提交,请稍等...');
+                                        form.submit();
+                                    }
+                                }, {
+                                    buttonsFocus: 1, closed: function () {
+                                        if (typeof closed == 'function') {
+                                            closed();
+                                        }
+                                    }
+                                });
+                            } else {
+                                loading('正在提交,请稍等...');
+                                form.submit();
+                            }
+                        }
+                    }, {buttonsFocus: 1, persistent: true, buttons: {'继续提交': true, '再想一想': false}});
                 },
                 errorContainer: "#messageBox",
                 errorPlacement: function (error, element) {
@@ -81,16 +104,7 @@
                     }
                 }
             });
-
-
-            // 初始化添加按钮
-            // 隐藏商品添加入口
-           var val = $("#orderID").val();
-           if(val){
-                $(".addSecondHandProduct").hide();
-           }
-        });
-
+        }
 
         function getCurPurchaseProduct(productId) {
             var $tr = $("#product_" + productId);
@@ -143,7 +157,7 @@
                 alertx("分期总额不等于订单应付总额");
                 return false;
             }
-            if(stages_surplusShopFee != 0 ){
+            if (stages_surplusShopFee != 0) {
                 alertx("还剩应付供应商金额不为零");
                 return false;
             }
@@ -153,22 +167,22 @@
 
         function setFreight() {
             var obj = $("#freePostFlag").val();
-            if(obj == "0"){
+            if (obj == "0") {
                 $(".freightSpan").remove();
                 setFreightFee();
             }
-            if(obj == "-1"){
+            if (obj == "-1") {
                 $(".freightSpan").remove();
                 setFreightFee();
             }
-            if(obj == "1"){
+            if (obj == "1") {
                 $("#freeDesc").append("<span class='freightSpan'><input class='freight' name='freight' value='0' oninput='value=value.replace(/[^\\d]/g,'')' onblur='setFreightFee()'>元</input></span>")
             }
         }
 
         function setFreightFee() {
             var fee = $(".freight").val();
-            if(fee == undefined || fee == NaN || fee == ""){
+            if (fee == undefined || fee == NaN || fee == "") {
                 fee = 0.00;
             }
             $("#freight").val(fee);
@@ -193,12 +207,16 @@
         <li><a href="${ctx}/order/secondhandOrderList">二手订单列表</a></li>
     </shiro:hasPermission>
     <shiro:hasPermission name="order:order:secondeProductOrderForm">
-        <li class="active"><a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">${empty order.orderID?'添加':'编辑'}二手订单</a></li>
+        <li class="active"><a
+                href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">${empty order.orderID?'添加':'编辑'}二手订单</a>
+        </li>
     </shiro:hasPermission>
 
 </ul>
 <br/>
-<form:form id="inputForm" modelAttribute="newOrder" action="${ctx}${order.status eq 0 || empty order.orderID ? '/order/save' :'/order/balanceDeduction'}" method="post"
+<form:form id="inputForm" modelAttribute="newOrder"
+           action="${ctx}${order.status eq 0 || empty order.orderID ? '/order/save' :'/order/balanceDeduction'}"
+           method="post"
            class="form-horizontal">
     <form:hidden path="orderID"/>
     <form:hidden path="secondHandOrderFlag"/>
@@ -211,64 +229,74 @@
         <form:hidden path="orderSource"/>
         <form:hidden path="userID"/>
     </c:if>
-    <c:if test="${order.orderSubmitType ne 6}">  <!--  协销帮个人用户下的订单  不显示地址等内容  -->
+    <c:if test="${order.orderSubmitType ne 6}"> <!-- 协销帮个人用户下的订单 不显示地址等内容 -->
         <!-- 初始化的地址 start -->
         <input type="hidden" id="curProvince" name="curProvince" value="${order.bpOrderUserinfo.province }">
         <input type="hidden" id="curCity" name="curCity" value="${order.bpOrderUserinfo.city }">
         <input type="hidden" id="curTown" name="curTown" value="${order.bpOrderUserinfo.town }">
-            <!-- 初始化的地址 end -->
-            <table id="contentTable" class="table table-striped table-bordered table-condensed">
-                <form:hidden path="bpOrderUserinfo.id" />
-                <form:hidden path="bpOrderUserinfo.clubId" class="required"/>
-                <form:hidden path="bpOrderUserinfo.userId"/>
-                <thead>
-    <c:if test="${empty order.confirmFlag || order.confirmFlag eq 0 }">
+        <!-- 初始化的地址 end -->
+        <table id="contentTable" class="table table-striped table-bordered table-condensed">
+            <form:hidden path="bpOrderUserinfo.id"/>
+            <form:hidden path="bpOrderUserinfo.clubId" class="required"/>
+            <form:hidden path="bpOrderUserinfo.userId"/>
+            <thead>
+            <c:if test="${empty order.confirmFlag || order.confirmFlag eq 0 }">
                 <input id="CmclubSelected" class="btn btn-primary" type="button" value="选择会所"
                        onclick="showClubSelect('iframe:${ctx}/bulkpurchase/cmClub')"/>
-    </c:if>
-                <tr>
-                    <td colspan="4">用户信息</td>
-                </tr>
-                </thead>
+            </c:if>
+            <tr>
+                <td colspan="4">用户信息</td>
+            </tr>
+            </thead>
 
-                <tr>
-                    <td>买家</td>
-                    <td><form:input path="bpOrderUserinfo.name" readonly="true" cssClass="input-xlarge"/></td>
-                    <td>收货人<span class="help-inline"><font color="red">*</font> </span></td>
-                    <td><form:input path="bpOrderUserinfo.shouHuoRen" readonly="${empty order.orderID || order.status eq 0? false:true}" class="input-medium required"/></td>
+            <tr>
+                <td>买家</td>
+                <td><form:input path="bpOrderUserinfo.name" readonly="true" cssClass="input-xlarge"/></td>
+                <td>收货人<span class="help-inline"><font color="red">*</font> </span></td>
+                <td><form:input path="bpOrderUserinfo.shouHuoRen"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}"
+                                class="input-medium required"/></td>
 
-                </tr>
+            </tr>
 
-                <tr>
-                    <td>电话</td>
-                    <td><form:input path="bpOrderUserinfo.phone" class="input-xlarge" readonly="${empty order.orderID || order.status eq 0? false:true}" maxlength="15"/></td>
-                    <td>手机<span class="help-inline"><font color="red">*</font> </span></td>
-                    <td><form:input path="bpOrderUserinfo.mobile" minlength="11" maxlength="11" readonly="${empty order.orderID || order.status eq 0? false:true}"
-                                    class="input-medium required "/></td>
-                </tr>
-                <tr>
-                    <td> 收货地址<span class="help-inline"><font color="red">*</font> </span></td>
-                    <td>
-                        <form:select path="bpOrderUserinfo.province" class="input-xlarge required" id="province" disabled="${empty order.orderID || order.status eq 0? false:true}"
-                                     onchange="loadCity()" style="width:100px;">
-                            <form:option value="" label="省" provinceId=""/>
-                        </form:select>
-                        <form:select path="bpOrderUserinfo.city" class="input-xlarge required" id="city" onchange="loadTown()" disabled="${empty order.orderID || order.status eq 0? false:true}"
-                                     style="width:100px;">
-                            <form:option value="" label="市" cityId=""/>
-                        </form:select>
-                        <form:select path="bpOrderUserinfo.town" class="input-xlarge required" id="town" style="width:100px;" disabled="${empty order.orderID || order.status eq 0? false:true}">
-                            <form:option value="" label="区"/>
-                        </form:select>
-                        <from:input path="bpOrderUserinfo.address" class="input-group required" readonly="${empty order.orderID || order.status eq 0? false:true}"></from:input>
-                    </td>
-                    <td></td>
-                    <td></td>
-                </tr>
+            <tr>
+                <td>电话</td>
+                <td><form:input path="bpOrderUserinfo.phone" class="input-xlarge"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}" maxlength="15"/></td>
+                <td>手机<span class="help-inline"><font color="red">*</font> </span></td>
+                <td><form:input path="bpOrderUserinfo.mobile" minlength="11" maxlength="11"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}"
+                                class="input-medium required "/></td>
+            </tr>
+            <tr>
+                <td> 收货地址<span class="help-inline"><font color="red">*</font> </span></td>
+                <td>
+                    <form:select path="bpOrderUserinfo.province" class="input-xlarge required" id="province"
+                                 disabled="${empty order.orderID || order.status eq 0? false:true}"
+                                 onchange="loadCity()" style="width:100px;">
+                        <form:option value="" label="省" provinceId=""/>
+                    </form:select>
+                    <form:select path="bpOrderUserinfo.city" class="input-xlarge required" id="city"
+                                 onchange="loadTown()"
+                                 disabled="${empty order.orderID || order.status eq 0? false:true}"
+                                 style="width:100px;">
+                        <form:option value="" label="市" cityId=""/>
+                    </form:select>
+                    <form:select path="bpOrderUserinfo.town" class="input-xlarge required" id="town"
+                                 style="width:100px;"
+                                 disabled="${empty order.orderID || order.status eq 0? false:true}">
+                        <form:option value="" label="区"/>
+                    </form:select>
+                    <from:input path="bpOrderUserinfo.address" class="input-group required"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}"></from:input>
+                </td>
+                <td></td>
+                <td></td>
+            </tr>
 
-            </table>
-            <br>
-            <table id="orderTable" class="table table-striped table-bordered table-condensed">
+        </table>
+        <br>
+        <table id="orderTable" class="table table-striped table-bordered table-condensed">
             <thead>
             <tr>
                 <td colspan="4">订单详情</td>
@@ -287,12 +315,15 @@
             </tr>
             <tr>
                 <td>收货人邮编</td>
-                <td><form:input path="bpOrderUserinfo.postalCode" readonly="${empty order.orderID || order.status eq 0? false:true}"/></td>
+                <td><form:input path="bpOrderUserinfo.postalCode"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}"/></td>
 
                 <td>下单时间</td>
                 <td>
-                    <form:input path="orderTime" type="text" maxlength="20" class="input Wdate required" value="${order.orderTime}"
-                                onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" readonly="${empty order.orderID || order.status eq 0? false:true}"/>
+                    <form:input path="orderTime" type="text" maxlength="20" class="input Wdate required"
+                                value="${order.orderTime}"
+                                onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"
+                                readonly="${empty order.orderID || order.status eq 0? false:true}"/>
                 </td>
 
             </tr>
@@ -311,7 +342,8 @@
             <tr>
                 <td>来源</td>
                 <td colspan="3">
-                    <form:select id="orderSource" path="orderSource" class="required" disabled="${empty order.orderID || order.status eq 0? false:true}">
+                    <form:select id="orderSource" path="orderSource" class="required"
+                                 disabled="${empty order.orderID || order.status eq 0? false:true}">
                         <form:option value="4" label="客服"/>
                         <form:option value="2" label="CRM"/>
                         <form:option value="1" label="PC"/>
@@ -324,9 +356,10 @@
     </c:if>
     <c:if test="${empty order.confirmFlag || order.confirmFlag eq 0 }">
         <div class="addSecondHandProduct">
-            <input style="display: none"  id="shopSelected" class="btn btn-primary" type="button" value="添加商品"
-               onclick="showSencondHandSelect('iframe:${ctx}/bulkpurchase/purchaseProduct/secondProductList?flag=1${order.orderSubmitType eq 6 ? '&priceType=normal' : ''}')"/>
-            <input  style="display: ''"   id="shopSelected1" class="btn btn-primary" type="button" onclick="alertx('请您先选择会所!')" value="添加商品" />
+            <input style="display: none" id="shopSelected" class="btn btn-primary" type="button" value="添加商品"
+                   onclick="showSencondHandSelect('iframe:${ctx}/bulkpurchase/purchaseProduct/secondProductList?flag=1${order.orderSubmitType eq 6 ? '&priceType=normal' : ''}')"/>
+            <input style="display: ''" id="shopSelected1" class="btn btn-primary" type="button"
+                   onclick="alertx('请您先选择会所!')" value="添加商品"/>
         </div>
     </c:if>
     <%int idx = 0;%>
@@ -339,13 +372,15 @@
                 <span class="fix-right-margin"><label>子订单金额:</label><span class="bmd">¥${shopOrder.needPayAmount}</span></span>
                 <br>
                 <span><label>留言:</label>
-                <input id="shopID_${shopOrder.shopID}" type="text" class="shopNote" value="${shopOrder.note}" data-shopid="${shopOrder.shopID}" ${empty order.orderID || order.status eq 0 ? "":"disabled"}>
+                <input id="shopID_${shopOrder.shopID}" type="text" class="shopNote" value="${shopOrder.note}"
+                       data-shopid="${shopOrder.shopID}" ${empty order.orderID || order.status eq 0 ? "":"disabled"}>
                 <input type="hidden" value="${shopOrder.note}=${shopOrder.shopID}" name="shopNote">
                 </span>
             </div>
-            <table id="pTable_${shopOrder.shopID}" class="productTable table table-striped table-bordered table-condensed">
+            <table id="pTable_${shopOrder.shopID}"
+                   class="productTable table table-striped table-bordered table-condensed">
                 <thead>
-                    <tr>
+                <tr>
                     <th>商品ID</th>
                     <th hidden></th>
                     <th hidden></th>
@@ -360,17 +395,17 @@
                     <th>税费</th>
                     <th>总价</th>
                     <th>应付供应商</th>
-                    <%--以下三个应付不显示,但是内容值参与计算并保存---关闭控制入口移动到财务管理中控制20181201--%>
-                    <%--<th>应付供应商</th>--%>
-                    <%--<th>应付第三方</th>--%>
-                    <%--<th>应付采美</th>--%>
+                        <%--以下三个应付不显示,但是内容值参与计算并保存---关闭控制入口移动到财务管理中控制20181201--%>
+                        <%--<th>应付供应商</th>--%>
+                        <%--<th>应付第三方</th>--%>
+                        <%--<th>应付采美</th>--%>
                     <th>能否复购</th>
                     <th>操作</th>
-                    </tr>
+                </tr>
                 </thead>
                 <tbody>
-                    <c:forEach items="${shopOrder.newOrderProducts}" var="orderProduct">
-                        <tr id="product_${orderProduct.productID}" data-value='${fns:toJson(orderProduct)}'
+                <c:forEach items="${shopOrder.newOrderProducts}" var="orderProduct">
+                    <tr id="product_${orderProduct.productID}" data-value='${fns:toJson(orderProduct)}'
                         data-index="<%=idx%>">
 
                         <td>${orderProduct.productID}</td>
@@ -378,8 +413,8 @@
                         <td hidden>${orderProduct.shopName}</td>
                         <td class="fix-width">${orderProduct.name}</td>
                         <td class="fix-width"><input type="hidden" name="orderProduct[<%=idx%>].enabledStatus"
-                                   id="orderProduct<%=idx%>.enabledStatus"
-                                   value='${fns:toJson(orderProduct)}'>${orderProduct.shopName}</td>
+                                                     id="orderProduct<%=idx%>.enabledStatus"
+                                                     value='${fns:toJson(orderProduct)}'>${orderProduct.shopName}</td>
                         <% idx++; %>
                         <td>${orderProduct.num}(${orderProduct.presentNum})</td>
                         <td>${orderProduct.price}</td>
@@ -389,10 +424,10 @@
                         <td>${orderProduct.addedValueTax}</td>
                         <td>${orderProduct.totalAddedValueTax}</td>
                         <td class="totalFee">${orderProduct.totalFee}</td>
-                        <%--以下三个应付不显示,但是内容值参与计算并保存---关闭控制入口移动到财务管理中控制20181201--%>
-                        <%--<td>${orderProduct.shouldPayFee}</td>--%>
-                        <%--<td>${orderProduct.shopFee}</td>--%>
-                        <%--<td>${orderProduct.otherFee}</td>--%>
+                            <%--以下三个应付不显示,但是内容值参与计算并保存---关闭控制入口移动到财务管理中控制20181201--%>
+                            <%--<td>${orderProduct.shouldPayFee}</td>--%>
+                            <%--<td>${orderProduct.shopFee}</td>--%>
+                            <%--<td>${orderProduct.otherFee}</td>--%>
                         <td>${orderProduct.shopFee}</td>
                         <td>
                             <c:if test="${orderProduct.buyAgainFlag eq 1}">
@@ -416,7 +451,7 @@
                         </td>
                     </tr>
                 </c:forEach>
-            </tbody>
+                </tbody>
             </table>
         </c:if>
     </c:forEach>
@@ -425,7 +460,15 @@
     <table id="orderPrice" class="table table-striped table-bordered table-condensed">
         <thead>
         <tr>
-            <td colspan="4">订单金额</td>
+            <td colspan="2">订单金额</td>
+            <td colspan="2">
+                <div id="rebateDiv">
+                    <input type="checkbox" id="rebateCheckBox" ${order.rebateFlag eq 1?'checked':''}
+                           onchange="updateRebateFlags()" ${(empty order.orderID || order.status eq 0)?'':'disabled'} >
+                    <label>返佣订单</label>
+                    <form:hidden path="rebateFlag" value="${empty order.rebateFlag?'0':order.rebateFlag}"/>
+                </div>
+            </td>
         </tr>
         </thead>
         <tr>
@@ -454,19 +497,22 @@
         <tr>
             <td>经理折扣</td>
             <td>
-                <from:input path="discountFee" value="${empty order.discountFee ?'0.00':(order.discountFee)}" readonly="${empty order.orderID || order.status eq 0? false:true}"
+                <from:input path="discountFee" value="${empty order.discountFee ?'0.00':(order.discountFee)}"
+                            readonly="${empty order.orderID || order.status eq 0? false:true}"
                             cssClass="input-small number" onkeyup="num(this)"/>
                 <input type="button" onclick="setProductTotalFee()" value="确认折扣">
             </td>
             <td>运费</td>
             <td class="freeDesc" id="freeDesc">
 
-                    <form:select id="freePostFlag" path="freePostFlag" class="required" onchange="setFreight()" disabled="${empty order.orderID || order.status eq 0? false:true}">
-                        <form:option value="0" label="包邮"/>
-                        <form:option value="1" label="不包邮"/>
-                        <form:option value="-1" label="到付"/>
-                    </form:select>
-                <from:hidden path="freight" value="${empty order.freight ?'0.00':(order.freight)}" cssClass="input-small number"/>
+                <form:select id="freePostFlag" path="freePostFlag" class="required" onchange="setFreight()"
+                             disabled="${empty order.orderID || order.status eq 0? false:true}">
+                    <form:option value="0" label="包邮"/>
+                    <form:option value="1" label="不包邮"/>
+                    <form:option value="-1" label="到付"/>
+                </form:select>
+                <from:hidden path="freight" value="${empty order.freight ?'0.00':(order.freight)}"
+                             cssClass="input-small number"/>
             </td>
         </tr>
         <tr>
@@ -479,9 +525,14 @@
             <from:hidden path="payTotalFee"/>
             <td>
 
-                <input id="useBalancePayFee" type="checkbox" onchange="setProductTotalFee()"/>使用账户余额(可用余额¥<span id="availableBalance">0.00</span>,当前使用¥<span class="balancePayFee">0.00</span>,剩余¥<span id="surplusBalance">0.00</span>)
-                <from:hidden path="balancePayFee" value="${empty order.balancePayFee ?'0.00':(order.balancePayFee)}" cssClass="input-small number"/>
-                <from:hidden path="bpOrderUserinfo.ableUserMoney" value="${empty order.bpOrderUserinfo.ableUserMoney ?'0.00':(order.bpOrderUserinfo.ableUserMoney)}" cssClass="input-small number"/>
+                <input id="useBalancePayFee" type="checkbox" onchange="setProductTotalFee()"/>使用账户余额(可用余额¥<span
+                    id="availableBalance">0.00</span>,当前使用¥<span class="balancePayFee">0.00</span>,剩余¥<span
+                    id="surplusBalance">0.00</span>)
+                <from:hidden path="balancePayFee" value="${empty order.balancePayFee ?'0.00':(order.balancePayFee)}"
+                             cssClass="input-small number"/>
+                <from:hidden path="bpOrderUserinfo.ableUserMoney"
+                             value="${empty order.bpOrderUserinfo.ableUserMoney ?'0.00':(order.bpOrderUserinfo.ableUserMoney)}"
+                             cssClass="input-small number"/>
             </td>
             <td></td>
         </tr>
@@ -525,13 +576,13 @@
                             <input type="radio" name="normalTitle_r" checked="checked">
                             <label>企业抬头</label>
                             <input type="text" id="orderInvoice_companyTitle"
-                                    <%--name="orderInvoice.invoiceTitle"--%>
+                                <%--name="orderInvoice.invoiceTitle"--%>
                                    value="${(order.orderInvoice.type == '1' ?
                                    (order.orderInvoice.invoiceTitleType == '1' ? (order.orderInvoice.invoiceTitle) : '') : '')}"
                                    class="input-xxlarge"/>
                             <label>纳税人识别号</label>
                             <input type="text" id="orderInvoice_corporationTaxNum"
-                                   <%--name="orderInvoice.corporationTaxNum"--%>
+                                <%--name="orderInvoice.corporationTaxNum"--%>
                                    value="${order.orderInvoice.type == '1' ? order.orderInvoice.corporationTaxNum : ''}"
                                    class="input-xxlarge"/>
                         </div>
@@ -581,12 +632,12 @@
         </div>
     </div>
     <div>
-        <%--<label>分期信息:</label>--%>
-        <%--<input id="stages1" name="stages" type="radio" value="0">--%>
-        <%--<label for="stages1">不需要分期</label>--%>
-        <%--<input id="stages2" name="stages" type="radio" value="1">--%>
-        <%--<label for="stages2">需要分期</label>--%>
-        <%--<form:hidden path="stagesFlag"/>--%>
+            <%--<label>分期信息:</label>--%>
+            <%--<input id="stages1" name="stages" type="radio" value="0">--%>
+            <%--<label for="stages1">不需要分期</label>--%>
+            <%--<input id="stages2" name="stages" type="radio" value="1">--%>
+            <%--<label for="stages2">需要分期</label>--%>
+            <%--<form:hidden path="stagesFlag"/>--%>
         <div class="panel panel-default stagesTable hide">
             <div class="controls">
                 <table id="stagesTable" class="table table-striped table-bordered table-condensed" width="100%">
@@ -594,9 +645,9 @@
                     <tr>
                         <td colspan="4">
                             <button type="button" id="decrease">-</button>
-                            <%--<input type="hidden" id="lineNum" value="${fn:length(order.orderStages)}">--%>
-                            <%--<input type="text" class="lineNum" value="${fn:length(order.orderStages)}"--%>
-                                   <%--onchange="crease($(this))">--%>
+                                <%--<input type="hidden" id="lineNum" value="${fn:length(order.orderStages)}">--%>
+                                <%--<input type="text" class="lineNum" value="${fn:length(order.orderStages)}"--%>
+                                <%--onchange="crease($(this))">--%>
                             <button type="button" id="increase">+</button>
                         </td>
                         <td colspan="2">
@@ -616,11 +667,11 @@
                         <th>产品添加</th>
                         <th>采美佣金</th>
                         <th>第三方</th>
-                        <%--<c:if test="${not empty order.orderStages  && fn:length(order.orderStages)>0}">--%>
+                            <%--<c:if test="${not empty order.orderStages  && fn:length(order.orderStages)>0}">--%>
                             <%--<c:forEach items="${order.orderStages[0].orderStagesShopList}" var="bpOrderStagesShop" varStatus="x">--%>
-                                <%--<th>${bpOrderStagesShop.shopName}</th>--%>
+                            <%--<th>${bpOrderStagesShop.shopName}</th>--%>
                             <%--</c:forEach>--%>
-                        <%--</c:if>--%>
+                            <%--</c:if>--%>
                     </tr>
                     </thead>
 
@@ -644,8 +695,8 @@
                 <label>售后条款:</label><br>
                 <c:if test="${order.confirmFlag ne 1}">
                     <c:if test="${empty order.clauseContent || fn:length(order.clauseContent)<=0}">
-                    <c:forEach items="${bpClauses}" var="items" varStatus="index">
-                        <c:if test="${items.clauseType ne 0  }">
+                        <c:forEach items="${bpClauses}" var="items" varStatus="index">
+                            <c:if test="${items.clauseType ne 0  }">
                 <span>
                     <input id="clauseId${index.index+1}" class="clauseId" name="clauseID" type="radio"
                            value="${items.id}"${(order.clauseID)==(items.id)?'checked="checked"':''}
@@ -656,8 +707,8 @@
                     <a href="javascript:void(0);"
                        onclick="openClauseInfo(${index.index+1});"><label>${items.name}</label></a>
                 </span>
-                        </c:if>
-                    </c:forEach>
+                            </c:if>
+                        </c:forEach>
                     </c:if>
                     <c:if test="${not empty order.clauseContent && fn:length(order.clauseContent)>0}">
                         <span><input type="hidden" id="clauseContent97" value="${fns:escapeHtml(order.clauseContent)}"/>
@@ -678,8 +729,8 @@
                 <label>售后条款:</label><br>
                 <c:if test="${order.confirmFlag ne 1}">
                     <c:if test="${empty order.clauseContent || fn:length(order.clauseContent)<=0}">
-                    <c:forEach items="${bpClauses}" var="items" varStatus="index">
-                        <c:if test="${items.clauseType ne 1}">
+                        <c:forEach items="${bpClauses}" var="items" varStatus="index">
+                            <c:if test="${items.clauseType ne 1}">
                     <span>
                         <input id="clauseId${index.index+1}" class="clauseId" name="clauseID" type="radio"
                                value="${items.id}"${(order.clauseID)==(items.id)?'checked="checked"':''} >
@@ -689,27 +740,29 @@
                         <a href="javascript:void(0);"
                            onclick="openClauseInfo(${index.index+1});"><label>${items.name}</label></a>
                     </span>
-                        </c:if>
-                    </c:forEach>
+                            </c:if>
+                        </c:forEach>
                     </c:if>
                     <c:if test="${not empty order.clauseContent && fn:length(order.clauseContent)>0}">
-                            <span><input type="hidden" id="clauseContent96" value="${fns:escapeHtml(order.clauseContent)}"/>
-                                <input  name="clauseID" type="hidden"
-                                       value="${order.clauseID}" >
+                            <span><input type="hidden" id="clauseContent96"
+                                         value="${fns:escapeHtml(order.clauseContent)}"/>
+                                <input name="clauseID" type="hidden"
+                                       value="${order.clauseID}">
                         <a href="javascript:void(0);" id="clauseName96"
                            onclick="openClauseInfo(96);"><label>${order.clauseName}</label></a></span>
                     </c:if>
                 </c:if>
                 <c:if test="${order.confirmFlag eq 1 }">
-                    <span><span><input type="hidden" id="clauseContent98"
-                                       value="${fns:escapeHtml(order.clauseContent)}"/>
-                    <a href="javascript:void(0);" id="clauseName98" type="hidden" onclick="openClauseInfoByConfigOrder2();"><label>${order.clauseName}</label></a></span>
+                <span><span><input type="hidden" id="clauseContent98"
+                                   value="${fns:escapeHtml(order.clauseContent)}"/>
+                    <a href="javascript:void(0);" id="clauseName98" type="hidden"
+                       onclick="openClauseInfoByConfigOrder2();"><label>${order.clauseName}</label></a></span>
                 </c:if>
             </div>
         </div>
     </div>
     <div class="form-actions">
-            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
     </div>
 </form:form>
@@ -718,7 +771,24 @@
 <script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/orderForm.js?<%=Math.random()%>"></script>
 <script type="text/javascript" src="${ctxStatic}/modules/bulkpurchase/stages.js?<%=Math.random()%>"></script>
 <script>
-    (function(){
+    (function () {
+        var rebateFlag =  $("#rebateFlag").val()*1;
+        if (1===rebateFlag) {
+            //选中返佣订单后不可用优惠券
+            // $("#couponBox").find("input[name=clubCouponId]").prop('checked', 'checked');
+            $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+            $("#couponBox").find("input[name=clubCouponId]").attr("disabled", true);
+            $("#couponBox").find("#bsy").prop('checked', 'checked');
+            $("#freePostFlag").attr("value", "-1");
+            $("#freeDesc").find(".select2-chosen").text("到付");
+            $("#useBalancePayFee").prop('checked', '');
+            setFreight();
+            $("#freePostFlag").attr("disabled", true);
+            $("#useBalancePayFee").attr("disabled", true);
+            $("#couponAmount").val(0);
+            $("#seen").find("#orderSeen2").prop('checked', 'checked');
+            setOrderFee();
+        }
         if (${empty order.confirmFlag || order.confirmFlag eq 0 }) {
             //初始化添加商品按钮--默认隐藏
             var ui = document.getElementById("shopSelected");
@@ -748,26 +818,25 @@
             console.log("stages1");
         }
 
-        $('#btnSubmit').on('click', function () {
-            if ($('.clauseId').is(':checked')) {
-                $('.clauseId:checked').siblings('.clauseContent').attr("name", "clauseContent");
-                $('.clauseId:checked').siblings('.clauseName').attr("name", "clauseName");
-            }
-
-            $('#inputForm').submit();
-        })
+        // $('#btnSubmit').on('click', function () {
+        //
+        //     $('#inputForm').submit();
+        // })
     });
+
     //初始化余额抵扣
     function setBalancePayFee() {
         var balancePayFee = Number($("#balancePayFee").val());
-        var ableUserMoney = $("#inputForm").find("[name*='bpOrderUserinfo.ableUserMoney']").val();;
+        var ableUserMoney = $("#inputForm").find("[name*='bpOrderUserinfo.ableUserMoney']").val();
+        ;
         $("#availableBalance").html(ableUserMoney);
-        if(balancePayFee > 0){
-            $("#useBalancePayFee").attr("checked",true);
+        if (balancePayFee > 0) {
+            $("#useBalancePayFee").attr("checked", true);
             $(".balancePayFee").html(balancePayFee);
         }
         $("#surplusBalance").html(ableUserMoney);
     };
+
     // 修改应付供应商金额
     function shopFeeWin(id) {
         var html = "<div style='padding:20px;'><font color='red'>*</font>应付供应商金额:<input onkeyup='num(this)' id='shopFee' name='shopFee' rows='1' cols='12'/></div>";
@@ -779,7 +848,7 @@
                 $.jBox.tip("输入的供应商金额不正确", 'error', {focusId: "shopFee"});
                 return false;
             }
-            location.href = "${ctx}/bulkpurchase/purchaseProduct/formShopFee?id=" + id + "&shopFee=" + f.shopFee+ "&clubId=" + ${order.bpOrderUserinfo.clubId};
+            location.href = "${ctx}/bulkpurchase/purchaseProduct/formShopFee?id=" + id + "&shopFee=" + f.shopFee + "&clubId=" + ${order.bpOrderUserinfo.clubId};
             return true;
         };
         $.jBox(html, {title: "确定修改应付供应商金额?", submit: submit});
@@ -799,26 +868,26 @@
 
     function onlyNum(obj) {
         obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
-        if (obj.value >= 100 || obj.value < 0){
+        if (obj.value >= 100 || obj.value < 0) {
             obj.value = 0;
         }
         //分期免息金额
         setProductTotalFee();
     };
 
-    $(document).on("change",'select#cooFreeFlag',function(){
-        var options =$(this).val();
-        console.log("options:"+options);
-        if(options == 0){
+    $(document).on("change", 'select#cooFreeFlag', function () {
+        var options = $(this).val();
+        console.log("options:" + options);
+        if (options == 0) {
             //免息
-            $("#stages1").attr("checked",true);//设置为不需要分期
+            $("#stages1").attr("checked", true);//设置为不需要分期
             $(".stagesTable1").show();
             $(".stagesTable").hide();
             $("#stagesFlag").val(0);
-            $('#cooFreeRate').attr("readOnly",false);
+            $('#cooFreeRate').attr("readOnly", false);
             setProductTotalFee();
         }
-        if(options == 1){
+        if (options == 1) {
             //不免息
             $("#cooFreeRate").val('0');
             $(".cooFreeAmount").html('0.00');
@@ -827,6 +896,7 @@
             setProductTotalFee();
         }
     });
+
     /**
      * 应付采美可取负数
      * @param obj

+ 17 - 9
src/main/webapp/WEB-INF/views/modules/order/secondhandOrderList.jsp

@@ -171,6 +171,14 @@
                             value="${endConfirmTime}"
                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
             </div>
+            <div class="item">
+                <label>返佣订单:</label>
+                <form:select path="rebateOrder" class="select-ele input-medium required">
+                    <form:option value="" label="请选择"/>
+                    <form:option value="1" label="是"/>
+                    <form:option value="0" label="否"/>
+                </form:select>
+            </div>
             <div class="item">
                 <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left: 20px;"/>
             </div>
@@ -185,7 +193,7 @@
         <li>订单ID</li>
         <li>订单编号</li>
         <li>订单类型</li>
-<%--        <li>返佣订单</li>--%>
+        <li>二手返佣订单</li>
 <%--        <li>二手订单</li>--%>
         <li>机构</li>
         <li>收货人</li>
@@ -218,14 +226,14 @@
                     </c:if>
                 </c:if>
             </li>
-<%--            <li>--%>
-<%--                <c:if test="${order.rebateOrder == '0'}">--%>
-<%----%>
-<%--                </c:if>--%>
-<%--                <c:if test="${order.rebateOrder ne '0'}">--%>
-<%----%>
-<%--                </c:if>--%>
-<%--            </li>--%>
+            <li>
+                <c:if test="${order.rebateOrder == '0'}">
+                    否
+                </c:if>
+                <c:if test="${order.rebateOrder ne '0'}">
+                    是
+                </c:if>
+            </li>
 <%--            <li>--%>
 <%--                <c:if test="${order.secondHandOrderFlag == '1'}">--%>
 <%--                    是--%>

+ 1 - 2
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -911,8 +911,7 @@
             } else {
             $("#priceFlag").prop("disabled",false);
             $("#visibility").prop("disabled",false);
-
-             }
+            }
         }
 
 

+ 46 - 0
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -2214,6 +2214,45 @@ function showPromotionDetail(iframe, title) {
  * 改变返佣标识
  */
 function updateRebateFlag() {
+    var rebateFlag = $("#rebateFlag").val()*1;
+    console.log(rebateFlag);
+    if (1===rebateFlag) {
+        // $("#rebateFlag").val(1);
+        //选中返佣订单后不可用优惠券
+        // $("#couponBox").find("input[name=clubCouponId]").prop('checked', 'checked');
+        checkRebateFee(rebateFlag);
+        $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        $("#couponBox").find("input[name=clubCouponId]").attr("disabled", true);
+        $("#couponBox").find("#bsy").prop('checked', 'checked');
+        $("#freePostFlag").attr("value", "-1");
+        $("#freeDesc").find(".select2-chosen").text("到付");
+        $("#useBalancePayFee").prop('checked', '');
+        setFreight();
+        $("#freePostFlag").attr("disabled", true);
+        $("#useBalancePayFee").attr("disabled", true);
+        $("#couponAmount").val(0);
+        $("#seen").find("#orderSeen2").prop('checked', 'checked');
+        setOrderFee();
+    } else {
+        // $("#rebateFlag").val(0);
+        // $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        checkRebateFee(rebateFlag);
+        $("#couponBox").find("input[name=clubCouponId]").prop('checked', '');
+        $("#couponBox").find("input[name=clubCouponId]").attr("disabled", false);
+        $("#freePostFlag").attr("value", "0");
+        $("#freeDesc").find(".select2-chosen").text("包邮");
+        $("#useBalancePayFee").prop('checked', '');
+        setFreight();
+        $("#freePostFlag").attr("disabled", false);
+        $("#useBalancePayFee").attr("disabled", false);
+        $("#couponAmount").val(0);
+        $("#seen").find("#orderSeen1").prop('checked', 'checked');
+        // 重新计算总价
+        setOrderFee();
+    }
+}
+
+function updateRebateFlags() {
     var rebateFlag = $("#rebateCheckBox").is(':checked');
     if (rebateFlag) {
         $("#rebateFlag").val(1);
@@ -2249,6 +2288,13 @@ function updateRebateFlag() {
     }
 }
 
+function checkRebateFee(rebateFlag){
+    if(2===rebateFlag){
+        $("#rebateFee").show();
+    }else {
+        $("#rebateFee").hide();
+    }
+}
 /**
  * 修改返佣选项是否可见
  */