Browse Source

添加收货人信息

zengjun 4 years ago
parent
commit
af95084db3

+ 25 - 19
resources/views/order/workOrder/_rejected_item_equals_order_commodity.blade.php

@@ -1,37 +1,43 @@
 <el-dialog :visible.sync="dialogCommoditiesEqualsVisible" width="75%">
+    <h4 class="text-center">商品比较</h4>
     <table class="table table-bordered table-sm">
-        <tr class="text-center">
-           <th colspan="3" class="bg-light-info" style="width: 600px">
-               订单商品信息
-           </th>
-           <th colspan="3" class="bg-light-khaki" style="width: 600px">
-               退回商品信息
-           </th>
-        </tr>
         <tr>
-            <th class="bg-light-info">商品条码</th>
-            <th class="bg-light-info">商品名</th>
-            <th class="bg-light-info">数量</th>
-            <th class="bg-light-khaki">商品条码</th>
-            <th class="bg-light-khaki">商品名</th>
-            <th class="bg-light-khaki">数量</th>
+            <th class="bg-light-info">订单商品名</th>
+            <th class="bg-light-info">订单商品条码</th>
+
+            <th class="bg-light-khaki">退货商品名</th>
+            <th class="bg-light-khaki">退货商品条码</th>
+
+            <th class="bg-light-info">订单数量</th>
+            <th class="bg-light-info">退回数量</th>
+
+            <th class="bg-light-info">状态</th>
         </tr>
         <tr v-for="item in commodityEqualsMap">
-            <td class="bg-light-info" v-text="item.order_commodity_sku"></td>
             <td class="bg-light-info" v-text="item.order_commodity_name"></td>
-            <td class="bg-light-info" v-text="item.order_commodity_amount"></td>
-            <td class="bg-light-khaki" v-text="item.rejected_item_sku"></td>
+            <td class="bg-light-info" v-text="item.order_commodity_sku"></td>
+
             <td class="bg-light-khaki" v-text="item.rejected_item_name"></td>
-            <td class="bg-light-khaki">
+            <td class="bg-light-khaki" v-text="item.rejected_item_sku"></td>
+
+            <td class="bg-light-info" v-text="item.order_commodity_amount"></td>
+
+            <td class="bg-light-info">
                 <div v-for="item_quality_label in item.rejected_item_quality_label">
                     <span class="badge badge-primary"
                         v-show="item_quality_label.quality_label === '正品'" v-text="'正品数量:' + item_quality_label.amount"></span>
                     <span class="badge badge-danger"
-                        v-show="item_quality_label.quality_label === '次'" v-text="'次品数量' + item_quality_label.amount"></span>
+                        v-show="item_quality_label.quality_label === '次'" v-text="'次品数量' + item_quality_label.amount"></span>
                     <span class="badge badge-secondary"
                         v-show="item_quality_label.quality_label === '未知'" v-text="'未知数量' + item_quality_label.amount"></span>
                 </div>
             </td>
+            <td class="bg-light-info">
+                <span v-text="item.status" v-show="item.status === '全部退回'"></span>
+                <span v-text="item.status" v-show="item.status === '部分退回'" class="text-danger"></span>
+                <span v-text="item.status" v-show="item.status === '差异退回'" class="text-danger"></span>
+                <span v-text="item.status" v-show="item.status === '超量退回'" class="text-danger"></span>
+            </td>
         </tr>
     </table>
     <div slot="footer" class="dialog-footer">

+ 46 - 4
resources/views/order/workOrder/index.blade.php

@@ -317,8 +317,9 @@
                                 </td>
                                 <template v-if="receivingInfo">
                                     <td v-text="item.consignee_name"></td>
-                                    <td  class="text-muted text-wrap text-letter">
-                                        <div class="text-overflow-warp-200 warp-min-200" v-text="item.consignee_phone"></div>
+                                    <td class="text-muted text-wrap text-letter">
+                                        <div class="text-overflow-warp-200 warp-min-200"
+                                             v-text="item.consignee_phone"></div>
                                     </td>
                                     <td v-text="item.province"></td>
                                     <td v-text="item.city"></td>
@@ -804,7 +805,7 @@
                 ],
                 commodityEqualsMap: [],
                 hideRejectedBills: false,
-                receivingInfo:false,
+                receivingInfo: false,
                 tableHeader: null,
                 toggleBtnHeight: 0,
                 batchOthers: {
@@ -4069,6 +4070,10 @@
                     axios.post(url, data).then(res => {
                         window.tempTip.cancelWaitingTip();
                         if (res.data.success) {
+                            for (const resKey in res.data.data) {
+                                console.log(resKey,res.data.data[resKey]);
+                                this.reckonStatus(res.data.data[resKey]);
+                            }
                             this.commodityEqualsMap = res.data.data;
                             this.dialogCommoditiesEqualsVisible = true;
                             return;
@@ -4091,7 +4096,7 @@
                 toggleRejectedBill() {
                     this.hideRejectedBills = !this.hideRejectedBills;
                 },
-                toggleReceivingInfo(){
+                toggleReceivingInfo() {
                     this.receivingInfo = !this.receivingInfo;
                 },
                 showBatchCustomRejectedStatus() {
@@ -4199,9 +4204,46 @@
                         window.tempTip.cancelWaitingTip()
                         this.errorTempTip(err)
                     })
+                },
+                reckonStatus(item) {
+                    let {
+                        order_commodity_sku,
+                        rejected_item_sku,
+                        order_commodity_amount,
+                        rejected_item_quality_label
+                    } = item;
+                    if (order_commodity_sku == null || order_commodity_amount === '') {
+                        item.status = "差异退回";
+                        return ;
+                    }
+                    for (const key in rejected_item_quality_label) {
+                        let date = rejected_item_quality_label[key];
+                        let amount = Number(date.amount);
+                        let order_amount = Number(order_commodity_amount);
+                        if(key === "正品"){
+                            if( amount === order_amount ){
+                                item.status = "全部退回";
+                            } else if(amount > order_amount){
+                                item.status = "超量退回";
+                            } else {
+                                item.status = "部分退回";
+                            }
+                            return;
+                        } else if(key === "残次"){
+                            item.status = "差异退回";
+                            return;
+                        } else if(key === "未知"){
+                            item.status = "差异退回";
+                            return ;
+                        }
+                    }
+                    if (rejected_item_sku == null || rejected_item_sku === '') {
+                        return item.status = "未退回";
+                    }
 
                 }
             },
+
         });
     </script>
 @endsection