ソースを参照

商品默认仓库逻辑以及提取公共仓库配置以及卖家云配置到配置文件

shensong00 4 年 前
コミット
15b4426725

+ 13 - 1
app/Http/Controllers/Admin/FxOrderController.php

@@ -27,6 +27,18 @@ use YPSMS;
27 27
 
28 28
 class FxOrderController extends Controller
29 29
 {
30
+    protected $warehouse = [];
31
+
32
+    public function __construct()
33
+    {
34
+        $this->warehouse = config('constants.WAREHOUSE');
35
+        $is_fx = env('IS_FX');
36
+        if($is_fx > 0) {
37
+            unset($this->warehouse[1]);
38
+            unset($this->warehouse[2]);
39
+        }
40
+    }
41
+
30 42
 	public function orderindex(Request $request){
31 43
         $page = (int)$request->input('page');
32 44
         $pageSize = 20;
@@ -1476,7 +1488,7 @@ class FxOrderController extends Controller
1476 1488
             $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
1477 1489
             $v['status_name'] = $status_arr[$v['status']];   
1478 1490
             $v['address'] = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverStreet'].$v['receiverAddress'];   
1479
-            $v['warehouse'] = $v['warehouse'] == 1? 'A仓库':'B仓库';      
1491
+            $v['warehouse'] = $this->warehouse[$v['warehouse']];
1480 1492
             $v['is_fugou'] = $v['is_fugou'] == 1? '是':'否';      
1481 1493
             $v['is_refund'] = $v['is_refund'] == 1? '是':'否'; 
1482 1494
             $v['payment_type'] = $payArr[$v['payment_type']];    

+ 14 - 12
app/Http/Controllers/Admin/FxStatisticsController.php

@@ -21,6 +21,18 @@ use Illuminate\Support\Facades\DB;
21 21
 
22 22
 class FxStatisticsController extends Controller
23 23
 {
24
+    protected $warehouse = [];
25
+
26
+    public function __construct()
27
+    {
28
+        $this->warehouse = config('constants.WAREHOUSE');
29
+        $is_fx = env('IS_FX');
30
+        if($is_fx > 0) {
31
+            unset($this->warehouse[1]);
32
+            unset($this->warehouse[2]);
33
+        }
34
+    }
35
+
24 36
      /**
25 37
      * 发货财务明细
26 38
      */
@@ -68,12 +80,7 @@ class FxStatisticsController extends Controller
68 80
         
69 81
         $result = json_decode(json_encode($result), true);
70 82
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
71
-        $wareArr = array(
72
-            0 => '其他',
73
-            1 => 'A仓',
74
-            2 => 'B仓',
75
-            3 => 'C仓',
76
-        );
83
+        $wareArr = $this->warehouse;
77 84
         foreach($result as $k=>&$v){
78 85
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
79 86
             $v['payment_type'] = $payArr[$v['payment_type']];
@@ -115,12 +122,7 @@ class FxStatisticsController extends Controller
115 122
         
116 123
         $result = json_decode(json_encode($result), true);
117 124
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
118
-        $wareArr = array(
119
-            0 => '其他',
120
-            1 => 'A仓',
121
-            2 => 'B仓',
122
-            3 => 'C仓',
123
-        );
125
+        $wareArr = $this->warehouse;
124 126
         foreach($result as $k=>&$v){
125 127
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
126 128
             $v['payment_type'] = $payArr[$v['payment_type']];

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

@@ -23,6 +23,18 @@ use PHPExcel_Reader_CSV;
23 23
 
24 24
 class GoodsController extends Controller
25 25
 {
26
+    protected $warehouse = [];
27
+
28
+    public function __construct()
29
+    {
30
+        $this->warehouse = config('constants.WAREHOUSE');
31
+        $is_fx = env('IS_FX');
32
+        if($is_fx > 0) {
33
+            unset($this->warehouse[1]);
34
+            unset($this->warehouse[2]);
35
+        }
36
+    }
37
+
26 38
 	public function index(Request $request){
27 39
         $page = (int)$request->input('page');
28 40
         $pageSize = 20;
@@ -426,7 +438,10 @@ class GoodsController extends Controller
426 438
             echo '0';die;
427 439
         }
428 440
         $is_fx = env('IS_FX');
429
-        $result = Goods::select('gs.id as sku_id', 'goods.id as goods_id', 'goods.name', 'gs.propsName', 'gs.price', 'gs.is_weigh', 'gs.quantity', 'gs.is_white', 'gs.is_not_fx')->leftJoin('goods_skus as gs', 'gs.goodsCode', '=', 'goods.id')->where('goods.name', 'like', '%'.$name.'%')->where('goods.is_del', 0)->where('gs.is_del', 0)->orderBy('goods.id', 'desc')->get();
441
+        $result = Goods::select('gs.id as sku_id', 'goods.id as goods_id', 'goods.name', 'gs.propsName', 'gs.price',
442
+            'gs.is_weigh', 'gs.quantity', 'gs.is_white', 'gs.is_not_fx', 'gs.warehouse')->leftJoin('goods_skus as gs',
443
+            'gs.goodsCode', '=', 'goods.id')->where('goods.name', 'like', '%'.$name.'%')->where('goods.is_del', 0)
444
+            ->where('gs.is_del', 0)->orderBy('goods.id', 'desc')->get();
430 445
         $result = json_decode(json_encode($result), true);
431 446
         foreach($result as $k=>&$v){
432 447
             //计算实际库存 -还未到卖家云的量
@@ -439,6 +454,8 @@ class GoodsController extends Controller
439 454
                     unset($result[$k]); 
440 455
                 }
441 456
             }
457
+
458
+            $v['warehouse_name'] = $this->warehouse[$v['warehouse']];
442 459
         }
443 460
 
444 461
         $result = array_values($result); 

+ 89 - 60
app/Http/Controllers/Admin/OrderController.php

@@ -28,7 +28,19 @@ use YPSMS;
28 28
 
29 29
 class OrderController extends Controller
30 30
 {
31
-	public function orderindex(Request $request){
31
+    protected $warehouse = [];
32
+
33
+    public function __construct()
34
+    {
35
+        $this->warehouse = config('constants.WAREHOUSE');
36
+        $is_fx = env('IS_FX');
37
+        if($is_fx > 0) {
38
+            unset($this->warehouse[1]);
39
+            unset($this->warehouse[2]);
40
+        }
41
+    }
42
+
43
+    public function orderindex(Request $request){
32 44
         $page = (int)$request->input('page');
33 45
         $pageSize = 20;
34 46
         if($page<=0){
@@ -127,22 +139,25 @@ class OrderController extends Controller
127 139
                 $v['pre_cost'] = 0;
128 140
                 foreach($goods as $item){
129 141
                     $goods_name = Goods::where('id', $item->goods_id)->pluck('name');
130
-                    $goods_sku_info = GoodsSkus::select('propsName', 'is_weigh', 'referenceCost', 'is_not_fx')->where('id', $item->sku_id)->first();
142
+                    $goods_sku_info = GoodsSkus::select('propsName', 'is_weigh', 'referenceCost', 'is_not_fx', 'warehouse')->where('id', $item->sku_id)->first();
131 143
                     if(!empty($goods_sku_info)){
132 144
                         $props_name = $goods_sku_info->propsName;
133 145
                         $is_weigh = $goods_sku_info->is_weigh;
134 146
                         $weigh_note = $is_weigh==1 ? '重量(斤)':'数量';
135 147
                         if(!$item->gift_id) $v['pre_cost'] += $goods_sku_info->referenceCost * $item->num;
136 148
 
137
-                        if( $goods_sku_info->is_not_fx == 1 && $v['warehouse']==3 && $v['is_not_fx'] == 0 ){
149
+                        //若有商品不属于C仓并且现在所属仓库是C仓,审核时提醒转仓
150
+                        if( $goods_sku_info->warehouse != 3 && $v['warehouse']==3 && $v['is_not_fx'] == 0 ){
151
+//                        if( $goods_sku_info->is_not_fx == 1 && $v['warehouse']==3 && $v['is_not_fx'] == 0 ){
138 152
                             $v['is_not_fx'] = 1;
139 153
                         }
140 154
                     }else{
141 155
                         $props_name = '';
142 156
                         $weigh_note = '数量';
143 157
                     }
158
+                    $goodsWarehouse = isset($this->warehouse[$goods_sku_info->warehouse]) ? $this->warehouse[$goods_sku_info->warehouse] : '';
144 159
                     
145
-                    $v['goods'][] = $goods_name.'('.$props_name.')&nbsp; '.$weigh_note.':'.$item->num.'';
160
+                    $v['goods'][] = $goods_name.'('.$props_name.')&nbsp; '.$weigh_note.':'.$item->num.' '.$goodsWarehouse;
146 161
                 }
147 162
                 $v['pre_cost'] = round($v['pre_cost'], 2);
148 163
 
@@ -213,25 +228,26 @@ class OrderController extends Controller
213 228
 
214 229
         $is_fx = env('IS_FX');
215 230
         return view('order/orderlist', ['result' =>$result,
216
-            'page'              =>$page,
217
-            'count'             =>$count,
218
-            'pages'             =>$pages,
219
-            'admin_id'          =>$admin_id,
220
-            'team_id'           =>$team_id,
221
-            'stime'             =>$stime,
222
-            'etime'             =>$etime,
223
-            'adminlist'         =>$adminList,
224
-            'search_admin'      =>$search_admin,
225
-            'self_role'         =>$self_role,
226
-            'receiverName'         =>$receiverName,
227
-            'receiverMobile'       =>$receiverMobile,
228
-            'status'            =>$status,
229
-            'id'            =>$id,
230
-            'last_url'      => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
231
-            'overtime'      => $overtime,
232
-            'warehouse'      => $warehouse,
233
-            'is_fx'      => $is_fx,
234
-            'thisTime'      => date('Y-m-d H:i:s'),
231
+            'page'                  => $page,
232
+            'count'                 => $count,
233
+            'pages'                 => $pages,
234
+            'admin_id'              => $admin_id,
235
+            'team_id'               => $team_id,
236
+            'stime'                 => $stime,
237
+            'etime'                 => $etime,
238
+            'adminlist'             => $adminList,
239
+            'search_admin'          => $search_admin,
240
+            'self_role'             => $self_role,
241
+            'receiverName'          => $receiverName,
242
+            'receiverMobile'        => $receiverMobile,
243
+            'status'                => $status,
244
+            'id'                    => $id,
245
+            'last_url'              => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
246
+            'overtime'              => $overtime,
247
+            'warehouse'             => $warehouse,
248
+            'is_fx'                 => $is_fx,
249
+            'thisTime'              => date('Y-m-d H:i:s'),
250
+            'warehouseArr'          => $this->warehouse,
235 251
             ]);
236 252
     }
237 253
 
@@ -475,21 +491,22 @@ class OrderController extends Controller
475 491
         })->where('id','>', 1)->where('is_use', 1)->get();
476 492
         $adminList = json_decode(json_encode($adminList), true);
477 493
         return view('order/predictorderlist', ['result' =>$result,
478
-            'page'              =>$page,
479
-            'count'             =>$count,
480
-            'pages'             =>$pages,
481
-            'admin_id'          =>$admin_id,
482
-            'team_id'           =>$team_id,
483
-            'stime'             =>$stime,
484
-            'etime'             =>$etime,
485
-            'adminlist'         =>$adminList,
486
-            'search_admin'      =>$search_admin,
487
-            'self_role'         =>$self_role,
488
-            'receiverName'         =>$receiverName,
489
-            'receiverMobile'       =>$receiverMobile,
490
-            'status'            =>$status,
491
-            'if_all'            =>$if_all,
492
-            'last_url'      => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
494
+            'page'              => $page,
495
+            'count'             => $count,
496
+            'pages'             => $pages,
497
+            'admin_id'          => $admin_id,
498
+            'team_id'           => $team_id,
499
+            'stime'             => $stime,
500
+            'etime'             => $etime,
501
+            'adminlist'         => $adminList,
502
+            'search_admin'      => $search_admin,
503
+            'self_role'         => $self_role,
504
+            'receiverName'      => $receiverName,
505
+            'receiverMobile'    => $receiverMobile,
506
+            'status'            => $status,
507
+            'if_all'            => $if_all,
508
+            'last_url'          => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
509
+            'warehouseArr'      => $this->warehouse,
493 510
             ]);
494 511
     }
495 512
 
@@ -540,7 +557,16 @@ class OrderController extends Controller
540 557
             }
541 558
         }
542 559
 
543
-        return view('order/ordercreate', ['categorylist' => $catelist, 'adminlist'=>$adminList, 'teamlist'=>$teamList, 'self_role'=>$self_role, 'createTime'=>$createTime, 'm_gift'=>$m_gift, 'b_gift'=>$b_gift]);
560
+        return view('order/ordercreate', [
561
+            'categorylist'  => $catelist,
562
+            'adminlist'     => $adminList,
563
+            'teamlist'      => $teamList,
564
+            'self_role'     => $self_role,
565
+            'createTime'    => $createTime,
566
+            'm_gift'        => $m_gift,
567
+            'b_gift'        => $b_gift,
568
+            'warehouseArr'  => $this->warehouse,
569
+            ]);
544 570
     }
545 571
     /**
546 572
      * 分组管理-进行添加操作
@@ -1009,19 +1035,20 @@ class OrderController extends Controller
1009 1035
         }
1010 1036
 
1011 1037
         return view('order/orderedit', [       
1012
-            'order' => $order,
1038
+            'order'         => $order,
1013 1039
             //'categorylist' => $catelist,
1014
-            'adminlist'=>$adminList,
1015
-            'teamlist'=>$teamList,
1016
-            'self_role'=>$self_role,
1017
-            'str_query'=> 'page='.$page.'&admin_id='.$admin_id.'&stime='.$stime.'&etime='.$etime.'&receiverName='.$receiverName.'&receiverMobile='.$receiverMobile,
1018
-            'last_url' => $last_url,
1040
+            'adminlist'     => $adminList,
1041
+            'teamlist'      => $teamList,
1042
+            'self_role'     => $self_role,
1043
+            'str_query'     => 'page='.$page.'&admin_id='.$admin_id.'&stime='.$stime.'&etime='.$etime.'&receiverName='.$receiverName.'&receiverMobile='.$receiverMobile,
1044
+            'last_url'      => $last_url,
1019 1045
             'deposit_phone' => $deposit_phone,
1020
-            'm_gift' => $m_gift,
1021
-            'b_gift' => $b_gift,
1046
+            'm_gift'        => $m_gift,
1047
+            'b_gift'        => $b_gift,
1022 1048
             'order_m_gifts' => $order_m_gifts,
1023 1049
             'order_b_gifts' => $order_b_gifts,
1024
-            'cust_info' => $cust_info,
1050
+            'cust_info'     => $cust_info,
1051
+            'warehouseArr'  => $this->warehouse,
1025 1052
         ]);
1026 1053
 
1027 1054
     }
@@ -1973,7 +2000,7 @@ class OrderController extends Controller
1973 2000
             $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
1974 2001
             $v['status_name'] = $status_arr[$v['status']];   
1975 2002
             $v['address'] = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverStreet'].$v['receiverAddress'];   
1976
-            $v['warehouse'] = $v['warehouse'] == 1? 'A仓库':'B仓库';      
2003
+            $v['warehouse'] = $this->warehouse[$v['warehouse']];
1977 2004
             $v['is_fugou'] = $v['is_fugou'] == 1? '是':'否';      
1978 2005
             $v['is_refund'] = $v['is_refund'] == 1? '是':'否'; 
1979 2006
             $v['payment_type'] = $payArr[$v['payment_type']];    
@@ -2779,14 +2806,15 @@ class OrderController extends Controller
2779 2806
         }
2780 2807
 
2781 2808
         return view('order/customerServiceAfterSaleCreate',[
2782
-            'order'=>$order,
2809
+            'order'         => $order,
2783 2810
             'deposit_phone' => $deposit_phone,
2784
-            'self_role' => $self_role,
2785
-            'm_gift' => $m_gift,
2786
-            'b_gift' => $b_gift,
2811
+            'self_role'     => $self_role,
2812
+            'm_gift'        => $m_gift,
2813
+            'b_gift'        => $b_gift,
2787 2814
             'order_m_gifts' => $order_m_gifts,
2788 2815
             'order_b_gifts' => $order_b_gifts,
2789
-            'cust_info' => $cust_info,
2816
+            'cust_info'     => $cust_info,
2817
+            'warehouseArr'  => $this->warehouse,
2790 2818
             ]);
2791 2819
     }
2792 2820
 
@@ -2966,15 +2994,16 @@ class OrderController extends Controller
2966 2994
         }
2967 2995
 
2968 2996
         return view('order/customerServiceAfterSaleEdit',[
2969
-            'order' => $order,
2997
+            'order'         => $order,
2970 2998
             'deposit_phone' => $deposit_phone,
2971
-            'self_role' => $self_role,
2972
-            'm_gift' => $m_gift,
2973
-            'b_gift' => $b_gift,
2999
+            'self_role'     => $self_role,
3000
+            'm_gift'        => $m_gift,
3001
+            'b_gift'        => $b_gift,
2974 3002
             'order_m_gifts' => $order_m_gifts,
2975 3003
             'order_b_gifts' => $order_b_gifts,
2976
-            'cust_info' => $cust_info,
2977
-            'id'=>$id,
3004
+            'cust_info'     => $cust_info,
3005
+            'id'            => $id,
3006
+            'warehouseArr'  => $this->warehouse,
2978 3007
         ]);
2979 3008
     }
2980 3009
 

+ 54 - 90
app/Http/Controllers/Admin/StatisticsController.php

@@ -34,6 +34,14 @@ use Illuminate\Support\Facades\DB;
34 34
 
35 35
 class StatisticsController extends Controller
36 36
 {
37
+
38
+    protected $warehouse = [];
39
+
40
+    public function __construct()
41
+    {
42
+        $this->warehouse = config('constants.WAREHOUSE');
43
+    }
44
+
37 45
     /**
38 46
      * 当日数据统计
39 47
      */
@@ -2111,13 +2119,7 @@ class StatisticsController extends Controller
2111 2119
         
2112 2120
         $result = json_decode(json_encode($result), true);
2113 2121
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2114
-        $wareArr = array(
2115
-            0 => '其他',
2116
-            1 => 'A仓',
2117
-            2 => 'B仓',
2118
-            3 => 'C仓',
2119
-            4 => 'D仓',
2120
-        );
2122
+        $wareArr = $this->warehouse;
2121 2123
         foreach($result as $k=>&$v){
2122 2124
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;
2123 2125
             //$v['true_amount'] = $v['receivedAmount'] + $v['refund_price'] - $v['aftersale_fee'];
@@ -2130,15 +2132,16 @@ class StatisticsController extends Controller
2130 2132
         $teamList = json_decode(json_encode($teamList), true);
2131 2133
 
2132 2134
         return view('/statistics/aftersaleFinanceList',[
2133
-            'result'   =>   $result,
2134
-            'team_id'   =>   $team_id,
2135
-            'stime'   =>   $stime,
2136
-            'etime'   =>   $etime,
2137
-            'page'   =>   $page,
2138
-            'count'   =>   $count,
2139
-            'pages'   =>   $pages,
2140
-            'teamlist'   =>   $teamList,
2141
-            'warehouse'   =>   $warehouse,
2135
+            'result'        => $result,
2136
+            'team_id'       => $team_id,
2137
+            'stime'         => $stime,
2138
+            'etime'         => $etime,
2139
+            'page'          => $page,
2140
+            'count'         => $count,
2141
+            'pages'         => $pages,
2142
+            'teamlist'      => $teamList,
2143
+            'warehouse'     => $warehouse,
2144
+            'warehouseArr'  => $this->warehouse,
2142 2145
         ]);
2143 2146
     } 
2144 2147
 
@@ -2186,13 +2189,7 @@ class StatisticsController extends Controller
2186 2189
         
2187 2190
         $result = json_decode(json_encode($result), true);
2188 2191
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2189
-        $wareArr = array(
2190
-            0 => '其他',
2191
-            1 => 'A仓',
2192
-            2 => 'B仓',
2193
-            3 => 'C仓',
2194
-            4 => 'D仓',
2195
-        );
2192
+        $wareArr = $this->warehouse;
2196 2193
         foreach($result as $k=>&$v){
2197 2194
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
2198 2195
             $v['payment_type'] = $payArr[$v['payment_type']];
@@ -2216,15 +2213,16 @@ class StatisticsController extends Controller
2216 2213
         $teamList = json_decode(json_encode($teamList), true);
2217 2214
 
2218 2215
         return view('/statistics/refundFinanceList',[
2219
-            'result'   =>   $result,
2220
-            'team_id'   =>   $team_id,
2221
-            'stime'   =>   $stime,
2222
-            'etime'   =>   $etime,
2223
-            'page'   =>   $page,
2224
-            'count'   =>   $count,
2225
-            'pages'   =>   $pages,
2226
-            'teamlist'   =>   $teamList,
2227
-            'warehouse'   =>   $warehouse,
2216
+            'result'        => $result,
2217
+            'team_id'       => $team_id,
2218
+            'stime'         => $stime,
2219
+            'etime'         => $etime,
2220
+            'page'          => $page,
2221
+            'count'         => $count,
2222
+            'pages'         => $pages,
2223
+            'teamlist'      => $teamList,
2224
+            'warehouse'     => $warehouse,
2225
+            'warehouseArr'  => $this->warehouse
2228 2226
         ]);
2229 2227
     } 
2230 2228
 
@@ -2272,13 +2270,7 @@ class StatisticsController extends Controller
2272 2270
         
2273 2271
         $result = json_decode(json_encode($result), true);
2274 2272
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2275
-        $wareArr = array(
2276
-            0 => '其他',
2277
-            1 => 'A仓',
2278
-            2 => 'B仓',
2279
-            3 => 'C仓',
2280
-            4 => 'D仓',
2281
-        );
2273
+        $wareArr = $this->warehouse;
2282 2274
         foreach($result as $k=>&$v){
2283 2275
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
2284 2276
             $v['payment_type'] = $payArr[$v['payment_type']];
@@ -2290,15 +2282,16 @@ class StatisticsController extends Controller
2290 2282
         $teamList = json_decode(json_encode($teamList), true);
2291 2283
 
2292 2284
         return view('/statistics/sendFinanceList',[
2293
-            'result'   =>   $result,
2294
-            'team_id'   =>   $team_id,
2295
-            'stime'   =>   $stime,
2296
-            'etime'   =>   $etime,
2297
-            'page'   =>   $page,
2298
-            'count'   =>   $count,
2299
-            'pages'   =>   $pages,
2300
-            'teamlist'   =>   $teamList,
2301
-            'warehouse'   =>   $warehouse,
2285
+            'result'        => $result,
2286
+            'team_id'       => $team_id,
2287
+            'stime'         => $stime,
2288
+            'etime'         => $etime,
2289
+            'page'          => $page,
2290
+            'count'         => $count,
2291
+            'pages'         => $pages,
2292
+            'teamlist'      => $teamList,
2293
+            'warehouse'     => $warehouse,
2294
+            'warehouseArr'  => $this->warehouse,
2302 2295
         ]);
2303 2296
     } 
2304 2297
 
@@ -2323,13 +2316,7 @@ class StatisticsController extends Controller
2323 2316
         
2324 2317
         $result = json_decode(json_encode($result), true);
2325 2318
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2326
-        $wareArr = array(
2327
-            0 => '其他',
2328
-            1 => 'A仓',
2329
-            2 => 'B仓',
2330
-            3 => 'C仓',
2331
-            4 => 'D仓',
2332
-        );
2319
+        $wareArr = $this->warehouse;
2333 2320
         foreach($result as $k=>&$v){
2334 2321
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;
2335 2322
             //$v['true_amount'] = $v['receivedAmount'] + $v['refund_price'] - $v['aftersale_fee'];
@@ -2365,13 +2352,7 @@ class StatisticsController extends Controller
2365 2352
         
2366 2353
         $result = json_decode(json_encode($result), true);
2367 2354
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2368
-        $wareArr = array(
2369
-            0 => '其他',
2370
-            1 => 'A仓',
2371
-            2 => 'B仓',
2372
-            3 => 'C仓',
2373
-            4 => 'D仓',
2374
-        );
2355
+        $wareArr = $this->warehouse;
2375 2356
         foreach($result as $k=>&$v){
2376 2357
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
2377 2358
             $v['payment_type'] = $payArr[$v['payment_type']];
@@ -2418,13 +2399,7 @@ class StatisticsController extends Controller
2418 2399
         
2419 2400
         $result = json_decode(json_encode($result), true);
2420 2401
         $payArr = [1=>'微信支付', 2=>'付款码支付', 3=>'个体户支付', 4=>'充值卡支付'];
2421
-        $wareArr = array(
2422
-            0 => '其他',
2423
-            1 => 'A仓',
2424
-            2 => 'B仓',
2425
-            3 => 'C仓',
2426
-            4 => 'D仓',
2427
-        );
2402
+        $wareArr = $this->warehouse;
2428 2403
         foreach($result as $k=>&$v){
2429 2404
             $v['team_name'] = $v['team_id']>0 ? $teams[$v['team_id']] : '';;            
2430 2405
             $v['payment_type'] = $payArr[$v['payment_type']];
@@ -4059,13 +4034,7 @@ class StatisticsController extends Controller
4059 4034
             if($warehouse>0) $query->where('warehouse', '=', $warehouse);
4060 4035
         })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->offset($offset)->limit($pageSize)->get();
4061 4036
 
4062
-        $wareArr = array(
4063
-            0 => '其他',
4064
-            1 => 'A仓',
4065
-            2 => 'B仓',
4066
-            3 => 'C仓',
4067
-            4 => 'D仓',
4068
-        );
4037
+        $wareArr = $this->warehouse;
4069 4038
         foreach($result as $k=>&$item){
4070 4039
             $item->warehouse = $wareArr[$item->warehouse];
4071 4040
         }
@@ -4079,13 +4048,14 @@ class StatisticsController extends Controller
4079 4048
 
4080 4049
 
4081 4050
         return view('statistics/warehouseFinanceList', ['result'=>$result,
4082
-            'page'              =>$page,
4083
-            'count'             =>$count,
4084
-            'pages'             =>$pages,  
4085
-            'warehouse'         =>$warehouse,
4086
-            'stime'             =>$stime,  
4087
-            'etime'             =>$etime,  
4088
-            'total'             =>$total,
4051
+            'page'              => $page,
4052
+            'count'             => $count,
4053
+            'pages'             => $pages,
4054
+            'warehouse'         => $warehouse,
4055
+            'stime'             => $stime,
4056
+            'etime'             => $etime,
4057
+            'total'             => $total,
4058
+            'warehouseArr'      => $this->warehouse,
4089 4059
         ]);
4090 4060
 
4091 4061
     }   
@@ -4103,13 +4073,7 @@ class StatisticsController extends Controller
4103 4073
             if($warehouse>0) $query->where('warehouse', '=', $warehouse);
4104 4074
         })->whereNotNull('send_time')->where('warehouse','>',0)->where('logistics_id','>','')->where('is_del', 0)->groupBy('warehouse')->groupBy('send_time')->orderBy('send_time', 'desc')->get();
4105 4075
 
4106
-        $wareArr = array(
4107
-            0 => '其他',
4108
-            1 => 'A仓',
4109
-            2 => 'B仓',
4110
-            3 => 'C仓',
4111
-            4 => 'D仓',
4112
-        );
4076
+        $wareArr = $this->warehouse;
4113 4077
         foreach($result as $k=>&$item){
4114 4078
             $item->warehouse = $wareArr[$item->warehouse];
4115 4079
         }

+ 3 - 5
app/Order.php

@@ -213,11 +213,9 @@ class Order extends Model
213 213
       return $result;
214 214
     }
215 215
 
216
-   	public static function mjApi($params = array()){  		
217
-      $accessKey = "B1E69297B5DA44DAB35099A5F28F41D9"; //erp 生成的 accessKey
218
-      $accessSecret = "4sN2LbylhOglelMP";
219
-//   		$accessKey = "F82A757089D84F89B1782EDC3A4DA82A"; //erp 生成的 accessKey
220
-//        $accessSecret = "wB2ueW8eQOHXNWcN";
216
+   	public static function mjApi($params = array()){
217
+        $accessKey = env('ERP_ACCESS_KEY');
218
+        $accessSecret = env('ERP_ACCESS_SECRET');
221 219
 	    $params["timestamp"] = time()."000";
222 220
 	    $params["version"] = "v1";
223 221
 	    $reqparams = $params;

+ 3 - 5
app/OrderScript.php

@@ -150,11 +150,9 @@ class OrderScript extends Model
150 150
       return $result;
151 151
     }
152 152
 
153
-   	public static function mjApi($params = array()){  		
154
-      $accessKey = "B1E69297B5DA44DAB35099A5F28F41D9"; //erp 生成的 accessKey
155
-      $accessSecret = "4sN2LbylhOglelMP";
156
-   		//$accessKey = "F82A757089D84F89B1782EDC3A4DA82A"; //erp 生成的 accessKey     
157
-		  //$accessSecret = "wB2ueW8eQOHXNWcN";
153
+   	public static function mjApi($params = array()){
154
+        $accessKey = env('ERP_ACCESS_KEY');
155
+        $accessSecret = env('ERP_ACCESS_SECRET');
158 156
 	    $params["timestamp"] = time()."000";
159 157
 	    $params["version"] = "v1";
160 158
 	    $reqparams = $params;

+ 1 - 4
resources/views/order/customerServiceAfterSaleCreate.blade.php

@@ -102,10 +102,7 @@
102 102
                 <font color='red'>* </font>发货仓库:</label>
103 103
                 <div class="formControls col-xs-6 col-sm-6">
104 104
                     <span>
105
-                        @if($order['warehouse']=='1') A仓库  @endif
106
-                        @if($order['warehouse']=='2') B仓库 @endif
107
-                        @if($order['warehouse']=='3') C仓库 @endif
108
-                        @if($order['warehouse']=='4') D仓库 @endif
105
+                        {{$warehouseArr[$order['warehouse']]}}
109 106
                     </span>
110 107
                 </div>
111 108
             </div>

+ 1 - 4
resources/views/order/customerServiceAfterSaleEdit.blade.php

@@ -100,10 +100,7 @@
100 100
                         <font color='red'>* </font>发货仓库:</label>
101 101
                     <div class="formControls col-xs-6 col-sm-6">
102 102
                     <span>
103
-                        @if($order['warehouse']=='1') A仓库  @endif
104
-                        @if($order['warehouse']=='2') B仓库 @endif
105
-                        @if($order['warehouse']=='3') C仓库 @endif
106
-                        @if($order['warehouse']=='4') D仓库 @endif
103
+                        {{$warehouseArr[$order['warehouse']]}}
107 104
                     </span>
108 105
                     </div>
109 106
                 </div>

File diff suppressed because it is too large
+ 32 - 12
resources/views/order/ordercreate.blade.php


+ 6 - 10
resources/views/order/orderedit.blade.php

@@ -145,10 +145,9 @@
145 145
                     <span class="select-box">
146 146
                         <select  size="1" name="warehouse" id='warehouse'>
147 147
                             <option value="0" @if($order['warehouse']=='0') selected @endif>- 请选择 -</option>
148
-                            <option value="1" @if($order['warehouse']=='1') selected @endif>A仓库</option>                            
149
-                            <option value="2" @if($order['warehouse']=='2') selected @endif>B仓库</option>                            
150
-                            <option value="3" @if($order['warehouse']=='3') selected @endif>C仓库</option>                            
151
-                            <option value="4" @if($order['warehouse']=='4') selected @endif>D仓库</option>                            
148
+                            @foreach($warehouseArr as $warehouseVal=>$warehouseName)
149
+                                <option value="{{$warehouseVal}}" @if($order['warehouse']==$warehouseVal) selected @endif>{{$warehouseName}}</option>
150
+                            @endforeach
152 151
                         </select>
153 152
                     </span>
154 153
                 </div>
@@ -157,12 +156,9 @@
157 156
             <div class="row cl">
158 157
                 <label class="form-label col-xs-4 col-sm-2">
159 158
                     <font color='red'>* </font>发货仓库:</label>
160
-                <div class="formControls col-xs-6 col-sm-6">                        
161
-                    @if($order['warehouse']=='1') A仓库  @endif                          
162
-                    @if($order['warehouse']=='2') B仓库 @endif                          
163
-                    @if($order['warehouse']=='3') C仓库 @endif 
164
-                    @if($order['warehouse']=='4') D仓库 @endif 
165
-                    <input type="hidden" name="warehouse" id='warehouse' value="{{$order['warehouse']}}"/>                         
159
+                <div class="formControls col-xs-6 col-sm-6">
160
+                    {{$warehouseArr[$order['warehouse']]}}
161
+                    <input type="hidden" name="warehouse" id='warehouse' value="{{$order['warehouse']}}"/>
166 162
 
167 163
                 </div>
168 164
             </div>

+ 10 - 13
resources/views/order/orderlist.blade.php

@@ -43,13 +43,9 @@
43 43
                 <input class="input-text" style="width:5%;text-align:center" type="text" value="发货仓库"/>
44 44
                 <select style="width:6%;text-align:center" id='warehouse' name="warehouse">
45 45
                     <option value="0" @if($warehouse=='0') selected @endif>-- 请选择--</option>
46
-                    @if($self_role != '分销销售' && $self_role != '分销管理员')
47
-                    <option value="1" @if($warehouse==1) selected @endif>A仓</option>
48
-                    <option value="2" @if($warehouse==2) selected @endif>B仓</option>
49
-                    @endif
50
-                    <option value="3" @if($warehouse==3) selected @endif>C仓</option>
51
-                    <option value="4" @if($warehouse==4) selected @endif>D仓</option>
52
-
46
+                    @foreach($warehouseArr as $warehouseVal=>$warehouseName)
47
+                        <option value="$warehouseVal" @if($warehouse==$warehouseVal) selected @endif>{{$warehouseName}}</option>
48
+                    @endforeach
53 49
                 </select> 
54 50
                 <div style="float:right">
55 51
                     <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
@@ -168,7 +164,7 @@
168 164
                             </td>
169 165
                             @endif
170 166
                             @endif                          
171
-                            <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @elseif($a['warehouse']==3) C仓库 @elseif($a['warehouse']==4) D仓库 @else @endif</td>                            
167
+                            <td>{{$warehouseArr[$a['warehouse']]}}</td>
172 168
                             <td>{{$a['receivedAmount']}}</td>                            
173 169
                             <td>{{$a['payment_type']}}</td>                            
174 170
                             <td>{{$a['createTime']}}</td> 
@@ -288,7 +284,7 @@
288 284
 
289 285
                                 @if($a['status'] >= 3)
290 286
 
291
-                                @elseif($a['status'] == 2 && $self_role !='超级管理员' && $self_role !='售后管理员')
287
+                                @elseif($a['status'] == 2 && $self_role !='超级管理员')
292 288
 
293 289
                                 @else
294 290
                                 <a style="text-decoration:none" onClick='order_del("删除","{{$a['id']}}","{{$a['is_cannot_del']}}")' href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a>
@@ -454,7 +450,7 @@
454 450
         function order_del(obj,id,is_cannot_del){
455 451
             var msg = '确认要删除吗?';
456 452
             if(is_cannot_del){
457
-                var msg = '该订单已打单待发货,请务必联系仓库管理员确认可以删除该订单,是否继续删除?'
453
+                var msg = '该订单已打单待发货,请务必联系超级管理员确认可以删除该订单,是否继续删除?'
458 454
             }
459 455
             layer.confirm(msg,function(index){
460 456
                 location.href='/admin/order/delete/'+id;
@@ -861,11 +857,11 @@
861 857
 
862 858
         function order_verify(id, status, name, pre_cost_flag, is_not_fx){
863 859
             if( status == 2 && is_not_fx==1){
864
-                if( !confirm('该订单需要转仓,请联系售后管理员!') ){
865
-                    return false;
866
-                }
860
+                confirm('该订单需要转仓,请联系售后管理员!');
861
+                return false;
867 862
             }
868 863
             else if( status == 2 && pre_cost_flag==1){
864
+                //点击确定后继续向下执行,点击取消则return false
869 865
                 if( !confirm('该订单毛利低于<40%, 是否确定订单价格合理?') ){
870 866
                     return false;
871 867
                 }
@@ -873,6 +869,7 @@
873 869
             else if( !confirm('确认'+name) ){
874 870
                 return false;
875 871
             }
872
+
876 873
             var admin_id = $('#admin_id').val();
877 874
             var stime = $('#stime').val();
878 875
             var etime = $('#etime').val();

+ 1 - 1
resources/views/order/predictorderlist.blade.php

@@ -140,7 +140,7 @@
140 140
                             </td>
141 141
                             @endif
142 142
                             @endif                          
143
-                            <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @elseif($a['warehouse']==3) C仓库 @elseif($a['warehouse']==4) D仓库 @else @endif</td>                            
143
+                            <td>{{$warehouseArr[$a['warehouse']]}}</td>
144 144
                             <td>{{$a['receivedAmount']}}</td>                            
145 145
                             <td>{{$a['payment_type']}}</td>                            
146 146
                             <td>{{$a['createTime']}}</td> 

+ 3 - 5
resources/views/statistics/aftersaleFinanceList.blade.php

@@ -18,11 +18,9 @@
18 18
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="所属仓库"/> 
19 19
                 <select style="width:10%;text-align:center" id='warehouse' name="warehouse">
20 20
                     <option value="0" @if($warehouse==0) selected @endif>-- 选择仓库 --</option>
21
-                    <option value="1" @if($warehouse==1) selected @endif>A仓库</option>
22
-                    <option value="2" @if($warehouse==2) selected @endif>B仓库</option>
23
-                    <option value="3" @if($warehouse==3) selected @endif>C仓库</option>
24
-                    <option value="4" @if($warehouse==4) selected @endif>D仓库</option>
25
-                    
21
+                    @foreach($warehouseArr as $warehouseVal=>$warehouseName)
22
+                        <option value="{{$warehouseVal}}" @if($warehouse == $warehouseVal) selected @endif >{{$warehouseName}}</option>
23
+                    @endforeach
26 24
                 </select> 
27 25
                               
28 26
                 <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>

+ 3 - 5
resources/views/statistics/refundFinanceList.blade.php

@@ -18,11 +18,9 @@
18 18
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="所属仓库"/> 
19 19
                 <select style="width:10%;text-align:center" id='warehouse' name="warehouse">
20 20
                     <option value="0" @if($warehouse==0) selected @endif>-- 选择仓库 --</option>
21
-                    <option value="1" @if($warehouse==1) selected @endif>A仓库</option>
22
-                    <option value="2" @if($warehouse==2) selected @endif>B仓库</option>
23
-                    <option value="3" @if($warehouse==3) selected @endif>C仓库</option>
24
-                    <option value="4" @if($warehouse==4) selected @endif>D仓库</option>
25
-                    
21
+                    @foreach($warehouseArr as $warehouseVal=>$warehouseName)
22
+                        <option value="{{$warehouseVal}}" @if($warehouse == $warehouseVal) selected @endif>{{$warehouseName}}</option>
23
+                    @endforeach
26 24
                 </select> 
27 25
                               
28 26
                 <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>

+ 3 - 5
resources/views/statistics/sendFinanceList.blade.php

@@ -18,11 +18,9 @@
18 18
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="所属仓库"/> 
19 19
                 <select style="width:10%;text-align:center" id='warehouse' name="warehouse">
20 20
                     <option value="0" @if($warehouse==0) selected @endif>-- 选择仓库 --</option>
21
-                    <option value="1" @if($warehouse==1) selected @endif>A仓库</option>
22
-                    <option value="2" @if($warehouse==2) selected @endif>B仓库</option>
23
-                    <option value="3" @if($warehouse==3) selected @endif>C仓库</option>
24
-                    <option value="4" @if($warehouse==4) selected @endif>D仓库</option>
25
-                    
21
+                    @foreach($warehouseArr as $warehouseVal=>$warehouseName)
22
+                        <option value="{{$warehouseVal}}" @if($warehouse == $warehouseVal) selected @endif>{{$warehouseName}}</option>
23
+                    @endforeach
26 24
                 </select> 
27 25
                               
28 26
                 <a class="btn btn-primary radius"  style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>

+ 3 - 5
resources/views/statistics/warehouseFinanceList.blade.php

@@ -7,11 +7,9 @@
7 7
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="所属仓库"/> 
8 8
                 <select style="width:10%;text-align:center" id='warehouse' name="warehouse">
9 9
                     <option value="0" @if($warehouse==0) selected @endif>-- 选择仓库 --</option>
10
-                    <option value="1" @if($warehouse==1) selected @endif>A仓库</option>
11
-                    <option value="2" @if($warehouse==2) selected @endif>B仓库</option>
12
-                    <option value="3" @if($warehouse==3) selected @endif>C仓库</option>
13
-                    <option value="4" @if($warehouse==4) selected @endif>D仓库</option>
14
-                    
10
+                    @foreach($warehouseArr as $warehouseVal=>$warehouseName)
11
+                        <option value="{{$warehouseVal}}" @if($warehouse == $warehouseVal) selected @endif >{{$warehouseName}}</option>
12
+                    @endforeach
15 13
                 </select>                          
16 14
                 <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
17 15
                 <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" autocomplete="off" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">