Browse Source

分销可见转仓商品,审核时候提示

sunhao 5 years ago
parent
commit
599c3aa3f1

+ 1 - 1
app/Http/Controllers/Admin/GoodsController.php

@@ -429,7 +429,7 @@ class GoodsController extends Controller
429 429
 
430 430
             if($is_fx>0){
431 431
                 //如果是分销,不展示没有库存的和白名单的
432
-                if( ($v['quantity'] <= 0 && $v['is_white'] != 1) || $v['is_not_fx'] == 1){
432
+                if( $v['quantity'] <= 0 && $v['is_white'] != 1 ){
433 433
                     unset($result[$k]); 
434 434
                 }
435 435
             }

+ 7 - 1
app/Http/Controllers/Admin/OrderController.php

@@ -118,6 +118,8 @@ class OrderController extends Controller
118 118
         foreach($result as $k=>&$v){
119 119
             //毛利 40%下
120 120
             $v['pre_cost_flag'] = 0;
121
+            //是否需要转仓
122
+            $v['is_not_fx'] = 0;
121 123
             //获取商品信息
122 124
             $v['goods'] = '';
123 125
             $goods = DB::table('order_goods_skus')->where('order_id', $v['id'])->where('is_del', 0)->get();
@@ -125,12 +127,16 @@ class OrderController extends Controller
125 127
                 $v['pre_cost'] = 0;
126 128
                 foreach($goods as $item){
127 129
                     $goods_name = Goods::where('id', $item->goods_id)->pluck('name');
128
-                    $goods_sku_info = GoodsSkus::select('propsName', 'is_weigh', 'referenceCost')->where('id', $item->sku_id)->first();
130
+                    $goods_sku_info = GoodsSkus::select('propsName', 'is_weigh', 'referenceCost', 'is_not_fx')->where('id', $item->sku_id)->first();
129 131
                     if(!empty($goods_sku_info)){
130 132
                         $props_name = $goods_sku_info->propsName;
131 133
                         $is_weigh = $goods_sku_info->is_weigh;
132 134
                         $weigh_note = $is_weigh==1 ? '重量(斤)':'数量';
133 135
                         if(!$item->gift_id) $v['pre_cost'] += $goods_sku_info->referenceCost * $item->num;
136
+
137
+                        if( $goods_sku_info->is_not_fx == 1 && $v['warehouse']==3 && $v['is_not_fx'] == 0 ){
138
+                            $v['is_not_fx'] = 1;
139
+                        }
134 140
                     }else{
135 141
                         $props_name = '';
136 142
                         $weigh_note = '数量';

+ 8 - 3
resources/views/order/orderlist.blade.php

@@ -260,7 +260,7 @@
260 260
                                             <a id="verify_refuse2" style="text-decoration:none" onClick='refuse_reason2("{{$a['id']}}")' href="javascript:;" title="反审"><span class="btn btn-danger radius">反审</span></a>
261 261
                                             @endif
262 262
                                         @else
263
-                                            <a id="verify" style="text-decoration:none" onClick='order_verify("{{$a['id']}}", "{{$item['status']}}", "{{$item['name']}}", "{{$a['pre_cost_flag']}}")' href="javascript:;" title="{{$item['name']}}"><span class="btn btn-primary radius">{{$item['name']}}</span></a>
263
+                                            <a id="verify" style="text-decoration:none" onClick='order_verify("{{$a['id']}}", "{{$item['status']}}", "{{$item['name']}}", "{{$a['pre_cost_flag']}}", "{{$a['is_not_fx']}}")' href="javascript:;" title="{{$item['name']}}"><span class="btn btn-primary radius">{{$item['name']}}</span></a>
264 264
                                         @endif
265 265
                                     @endforeach
266 266
                                 @endif
@@ -854,8 +854,13 @@
854 854
             });
855 855
         }
856 856
 
857
-        function order_verify(id, status, name, pre_cost_flag){
858
-            if( status == 2 && pre_cost_flag==1){
857
+        function order_verify(id, status, name, pre_cost_flag, is_not_fx){
858
+            if( status == 2 && is_not_fx==1){
859
+                if( !confirm('该订单需要转仓,请联系售后管理员!') ){
860
+                    return false;
861
+                }
862
+            }
863
+            else if( status == 2 && pre_cost_flag==1){
859 864
                 if( !confirm('该订单毛利低于<40%, 是否确定订单价格合理?') ){
860 865
                     return false;
861 866
                 }