From 6ada97d503bd93722c081b66a9adcce7599e5536 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Wed, 14 Apr 2021 17:31:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/score_shop' into score_shop

---
 zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html |   64 +++++++++++++++++++++++++++++--
 1 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html
index 7d02c7a..6fae16b 100644
--- a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html
@@ -130,10 +130,11 @@
                     <th data-checkbox="true"></th>
                     <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th>
                     <th data-align="center" data-width="195px" data-field="id" data-formatter="buidOperate">操作</th>
-                    <th data-field="userName">客户姓名</th>
-                    <th data-field="userTel">客户电话</th>
-                    <th data-field="storeName">店铺名称</th>
+                    <th data-field="deliveryInfo.receiveAddress" data-formatter="buildLogistics">发货信息</th>
+                    <!--<th data-field="userName">客户姓名</th>-->
+                    <!--<th data-field="userTel">客户电话</th>-->
                     <th data-field="orderStatus" data-formatter="buildOrderStatus">订单状态</th>
+                    <th data-field="deliveryInfo.waybillNo" data-formatter="buildDelivery">物流信息</th>
                     <th data-field="orderTime" data-formatter="MGrid.getTime">下单时间</th>
                     <th data-field="details" data-formatter="buildDetails">购买商品</th>
                     <!--<th data-field="purchaseQuantity">购买件数</th>-->
@@ -142,6 +143,7 @@
                     <th data-field="shippingMethod"  data-formatter="buildShippingMethod" >配送方式</th>
                     <!--<th data-field="orderType" data-formatter="orderTypeFormatter">订单类型</th>-->
                     <th data-field="orderNo">订单编号</th>
+                    <th data-field="storeName">店铺名称</th>
                     <!--<th data-field="applyStatus" data-formatter="applyStatusFormatter">是否已提现</th>-->
                 </tr>
                 </thead>
@@ -225,6 +227,17 @@
         return details;
     }
 
+    // 发货信息
+    function buildLogistics(value, row, index) {
+        return (row.userName==null?"":row.userName)+" <br/>"+ (row.userTel==null?"":row.userTel) +" <br/>"+value  ;
+    }
+    // 物流信息
+    function buildDelivery(value, row, index) {
+        return (row.deliveryInfo.logisticsCompanyCode==null?"":"快递编码:"+row.deliveryInfo.logisticsCompanyCode)
+            +" <br/>"+ (row.deliveryInfo.logisticsCompany==null?"":"快递名称:"+row.deliveryInfo.logisticsCompany)
+            +" <br/>"+(value==null?"":"快递单号:"+value)  ;
+    }
+
 
     function buildOrderStatus(value, row, index) {
         if (value == 1) {
@@ -269,11 +282,16 @@
             + '操作 <span class="caret"></span>' + '</button>'
             + '<ul class="dropdown-menu" role="menu">'
             + btns[0].replace('VALUE', value)
+        if (row.deliveryInfo.waybillNo != null && typeof row.deliveryInfo.waybillNo != 'undefined' && row.deliveryInfo.waybillNo != '') {
+            html += btns[3].replace('orderId',row.id).replace('waybillNo',row.deliveryInfo.waybillNo);
+        }
         if (row.orderStatus == 2) {
-            html += btns[1].replace('VALUE', value)
+            html += btns[1].replace('VALUE', value);
+            html += btns[4].replace('orderId',row.id);
         }
         if (row.orderStatus == 3) {
-            html += btns[2].replace('VALUE', value)
+            html += btns[2].replace('VALUE', value);
+            html += btns[4].replace('orderId',row.id);
         }
         html += '</ul>' + '</div>';
         return html;
@@ -290,6 +308,40 @@
                 content: [basePath + '/admin/shopOrder/editForm?id=' + id]
             })
         )
+    }
+
+    /**
+     * 查看物流信息
+     * @param id
+     */
+    function showLogisticsInfo(orderId,waybillNo){
+        if(waybillNo == '' || waybillNo == null){
+            layer.msg("订单还未发货,暂无物流信息", {
+                icon : 2,
+                time : 2000
+            });
+            return false;
+        }
+        layer.open({
+            type : 2,
+            title : "查看物流信息",
+            area : [ MUI.SIZE_L, '500px' ],
+            maxmin : true,
+            content : [ basePath+'/admin/redirect/shop/shopLogisticsInfo-list?orderId=' + orderId]
+        });
+    }
+    /**
+     * 编辑物流信息
+     * @param id
+     */
+    function editDeliveryInfo(orderId){
+        layer.open({
+            type : 2,
+            title : "编辑物流信息",
+            area : [ MUI.SIZE_L, '500px' ],
+            maxmin : true,
+            content : [ basePath + '/admin/shopDeliveryInfo/editDeliveryInfoForm?orderId=' + orderId]
+        });
     }
 
     //修改订单为发货
@@ -366,6 +418,8 @@
 btns[0] = '<li><a href="javascript:void(0)" onClick="openEdit(\'VALUE\')" title="编辑">编辑</a></li>'
 btns[1] = '<li><a href="javascript:void(0)" onClick="openSendPackage(\'VALUE\')" title="开始发货">开始发货</a></li>'
 btns[2] = '<li><a href="javascript:void(0)" onClick="openSendPackageOver(\'VALUE\')" title="配送完成">配送完成</a></li>'
+btns[3] = '<li><a href="javascript:void(0)" onclick="showLogisticsInfo(\'orderId\',\'waybillNo\')" title="查看物流">查看物流</a></li>'
+btns[4] = '<li><a href="javascript:void(0)" onclick="editDeliveryInfo(\'orderId\')" title="编辑快递">编辑快递</a></li>'
 
 </script>
 

--
Gitblit v1.9.1