Zhouzhendong 5 роки тому
батько
коміт
ecf5ec68f2

+ 6 - 0
app/Http/Controllers/RegionController.php

@@ -15,4 +15,10 @@ class RegionController extends Controller
         if (!$type)$regions->where("type",$type);
         $this->success($regions->get());
     }
+
+    public function index()
+    {
+        $regions = Region::withTrashed()->get();
+        return view("maintenance.region.index",compact("regions"));
+    }
 }

+ 5 - 3
app/Http/Controllers/api/thirdPart/flux/SortingController.php

@@ -25,10 +25,12 @@ class SortingController extends Controller
      *
      * @param Request $request
      * @return Response
+     *
+     * 2021-01-20 zzd 因同步订单,波次等已上线,弃用该通知接口
      */
     public function newBatch(Request $request)
     {
-        $requestArr=$request->all();
+/*        $requestArr=$request->all();
         app('LogService')->log(__METHOD__, 'issued_' . __FUNCTION__, json_encode($request->all()));
         !$requestArr?$requestArr=json_decode($request->getContent(),true):false;
         $errors=$this->newBatchValidator($requestArr)->errors();
@@ -81,7 +83,7 @@ class SortingController extends Controller
                         ->where('order_id',$order['id'])->where('wms_ptltaskid',$requestBarcode['ptltaskid'])->first();
                     if(!$orderCommodity){
                         /** @var CommodityService $commodityService */
-                        $commodityService=app('CommodityService');
+                        /*$commodityService=app('CommodityService');
                         $commodity=$commodityService->syncBarcodes($requestBarcode['alternate_sku1'],$owner['id'],$requestBarcode['sku']);
                         $orderCommodity=OrderCommodity::query()->firstOrCreate(['order_id'=>$order['id'],'commodity_id'=>$commodity['id']]);
                         if(!$orderCommodity){
@@ -104,7 +106,7 @@ class SortingController extends Controller
                     }
                 }
             }
-        }
+        }*/
         return response()->json(['Response'=>['return'=>['returnFlag'=>'1','returnCode'=>'0000',
             'returnDesc'=>'消息处理成功:Success','resultInfo'=>'']]])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
     }

+ 2 - 0
app/Region.php

@@ -5,6 +5,7 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 
 use App\Traits\LogModelChanging;
+use Illuminate\Database\Eloquent\SoftDeletes;
 
 /**
  * 留存:目前仅当作区级使用 后续将省市表并入此表
@@ -12,6 +13,7 @@ use App\Traits\LogModelChanging;
 class Region extends Model
 {
     use LogModelChanging;
+    use SoftDeletes;
 
     public $timestamps=false;
     protected $fillable = ["parent_id","name","type","code"];

+ 2 - 2
app/Services/WaybillService.php

@@ -20,8 +20,8 @@ Class WaybillService
      * @return Builder
      */
     private function conditionQuery(array $param){
-        $waybills = Waybill::filterAuthorities()->with(['owner','logistic','destinationCity.province',
-            'uploadFile','amountUnit','priceModel','warehouseWeightUnit','carrierWeightUnit',
+        $waybills = Waybill::filterAuthorities()->with(['owner','logistic','originationCity','destinationCity.province',
+            'uploadFile','amountUnit','warehouseWeightUnit','carrierWeightUnit',
             'warehouseWeightUnitOther','carrierWeightUnitOther','carType','uploadFile','waybillAuditLogs.user'])
             ->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
             ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')

+ 32 - 0
database/migrations/2021_01_20_104314_add_column_deleted_at_table_region.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddColumnDeletedAtTableRegion extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('regions', function (Blueprint $table) {
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('regions', function (Blueprint $table) {
+            $table->dropSoftDeletes();
+        });
+    }
+}

+ 1 - 1
resources/views/customer/project/part/_express.blade.php

@@ -27,7 +27,7 @@
         <div class="w-100 form-inline">
             <input id="expressFile" type="file" class="d-none" accept=".csv, .xlsx, .xls" @change="importExpress($event)"/>
             <button type="button" class="btn btn-sm btn-outline-info w-25" @click="addExpressItem()">新增</button>
-            <button type="button" class="btn btn-sm btn-outline-primary w-25 ml-2" @click="selectFile('expressFile')" @mouseenter="hoverEffect('express',true)" @mouseleave="hoverEffect('express',false)">导入</button>
+            <button type="button" class="btn btn-sm btn-outline-primary w-25 ml-2" @click="   ('expressFile')" @mouseenter="hoverEffect('express',true)" @mouseleave="hoverEffect('express',false)">导入</button>
             <h5><span class="ml-0 fa fa-question-circle-o cursor-pointer" data-toggle="tooltip" data-placement="top" title="导入与保存时自动过滤重复数据"></span></h5>
         </div>
         <div class="w-100 mt-1 ml-1" v-if="model.express.items.length>searchBase">

+ 3 - 3
resources/views/waybill/index.blade.php

@@ -278,9 +278,9 @@
                         wms_bill_number:'{{$waybill->wms_bill_number}}',
                         origination:'{{$waybill->origination}}',
                         destination:'{{$waybill->destination_city_id}}'?
-                            (('{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity->name}}')===-1 &&
-                                '{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity->province->name}}')===-1)?
-                                '{{($waybill->destinationCity->province->name).($waybill->destinationCity->name).($waybill->destination)}}'
+                            (('{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity ? $waybill->destinationCity->name : ''}}')===-1 &&
+                                '{{$waybill->destination}}'.indexOf('{{$waybill->destinationCity ? ($waybill->destinationCity->province ? $waybill->destinationCity->province->name : '') : ''}}')===-1)?
+                                '{{($waybill->destinationCity ? ($waybill->destinationCity->province ? $waybill->destinationCity->province->name : '') : '').($waybill->destinationCity ? $waybill->destinationCity->name : '').($waybill->destination)}}'
                                 :'{{$waybill->destination}}')
                             :'{{$waybill->destination}}',
                         recipient:'{{$waybill->recipient}}',