Просмотр исходного кода

Merge branch 'master' into zengjun

ajun 5 лет назад
Родитель
Сommit
8da506de7a
71 измененных файлов с 1125 добавлено и 481 удалено
  1. 29 23
      app/Console/Commands/CreateOwnerBillReport.php
  2. 46 0
      app/Events/OrderIssueProcessLogCreateEvent.php
  3. 9 3
      app/Filters/OrderIssueFilters.php
  4. 9 6
      app/Filters/OrderPackageFilters.php
  5. 6 2
      app/Http/Controllers/CommodityController.php
  6. 26 3
      app/Http/Controllers/CustomerController.php
  7. 3 3
      app/Http/Controllers/DeliveryAppointmentController.php
  8. 32 0
      app/Http/Controllers/ForeignHaiRoboticsController.php
  9. 34 1
      app/Http/Controllers/OrderController.php
  10. 2 0
      app/Http/Controllers/OrderIssueController.php
  11. 18 1
      app/Http/Controllers/OrderPackageController.php
  12. 5 1
      app/Http/Controllers/ProcurementController.php
  13. 33 46
      app/Http/Controllers/TestController.php
  14. 3 0
      app/Http/Controllers/api/thirdPart/flux/WaybillController.php
  15. 1 0
      app/Http/Controllers/api/thirdPart/haiq/StorageController.php
  16. 1 0
      app/Http/Controllers/api/thirdPart/haochuang/SortingController.php
  17. 20 2
      app/Http/Controllers/api/thirdPart/weixin/ProcurementController.php
  18. 11 14
      app/Imports/RejectedImport.php
  19. 0 1
      app/Jobs/DeleteRepetitionSkuItem.php
  20. 4 3
      app/Jobs/LogisticZopSync.php
  21. 46 0
      app/Listeners/UpdateOrderPackageExceptionListener.php
  22. 1 0
      app/OrderPackage.php
  23. 2 0
      app/OwnerBillReport.php
  24. 3 0
      app/Providers/EventServiceProvider.php
  25. 7 22
      app/Services/AllInventoryService.php
  26. 4 2
      app/Services/BatchService.php
  27. 8 7
      app/Services/ForeignHaiRoboticsService.php
  28. 13 28
      app/Services/InventoryService.php
  29. 4 3
      app/Services/LaborReportService.php
  30. 28 12
      app/Services/OrderService.php
  31. 6 7
      app/Services/OwnerAreaReportService.php
  32. 2 2
      app/Services/OwnerFeeDetailService.php
  33. 5 3
      app/Services/OwnerPriceExpressService.php
  34. 6 2
      app/Services/OwnerPriceOperationService.php
  35. 13 2
      app/Services/OwnerStoragePriceModelService.php
  36. 2 1
      app/Services/StationTaskMaterialBoxService.php
  37. 1 0
      app/Services/WaybillService.php
  38. 19 0
      app/Traits/ModelSearchWay.php
  39. 238 155
      composer.lock
  40. 28 0
      database/migrations/2021_04_27_162219_add_authority_rejected_index_general_update_is_loaded.php
  41. 32 0
      database/migrations/2021_04_29_141639_change_remark_to_text.php
  42. 34 0
      database/migrations/2021_05_11_094426_change_owner_bill_report_add_column_tax.php
  43. 35 0
      database/migrations/2021_05_11_113944_add_procurement_authorities.php
  44. 2 0
      laravel-echo-server.json
  45. 4 3
      resources/views/customer/project/create.blade.php
  46. 4 4
      resources/views/customer/project/part/_auditComparison.blade.php
  47. 10 10
      resources/views/customer/project/part/_express.blade.php
  48. 2 0
      resources/views/customer/project/part/_three.blade.php
  49. 2 5
      resources/views/customer/project/part/_two.blade.php
  50. 4 4
      resources/views/finance/instantBill.blade.php
  51. 2 2
      resources/views/maintenance/role/edit.blade.php
  52. 43 5
      resources/views/order/index/delivering.blade.php
  53. 23 36
      resources/views/order/issue/index.blade.php
  54. 1 1
      resources/views/order/wave/search.blade.php
  55. 62 2
      resources/views/package/logistic/index.blade.php
  56. 1 1
      resources/views/personnel/discharge/statement/index.blade.php
  57. 1 1
      resources/views/personnel/discharge/task/index.blade.php
  58. 4 4
      resources/views/personnel/laborReport/index.blade.php
  59. 1 1
      resources/views/procurement/procurement/_addQuantity.blade.php
  60. 75 31
      resources/views/procurement/procurement/index.blade.php
  61. 1 2
      resources/views/rejected/create.blade.php
  62. 1 0
      resources/views/rejected/import.blade.php
  63. 10 4
      resources/views/rejected/search/general.blade.php
  64. 1 1
      resources/views/store/checkingReceive/mission.blade.php
  65. 15 0
      resources/views/store/deliveryAppointment/index.blade.php
  66. 1 1
      resources/views/store/inStorage/index.blade.php
  67. 12 8
      resources/views/transport/waybill/index.blade.php
  68. 1 0
      routes/api/thirdPart/weixin.php
  69. 6 0
      routes/apiLocal.php
  70. 1 0
      routes/web.php
  71. 6 0
      tests/webApi/thirdPart/haiq/listBoxes.http

+ 29 - 23
app/Console/Commands/CreateOwnerBillReport.php

@@ -51,22 +51,25 @@ class CreateOwnerBillReport extends Command
         $sql = "SELECT owner_id,SUM(IFNULL(work_fee,0)) AS work_fee,SUM(IFNULL(logistic_fee,0)) AS logistic_fee FROM owner_fee_details WHERE worked_at LIKE ? AND ((type = '发货' AND logistic_fee IS NOT NULL AND work_fee IS NOT NULL) OR (type <> '发货' AND work_fee IS NOT NULL))  GROUP BY owner_id";
         $billDetails = DB::select(DB::raw($sql),[$year."-".$lastMonth."%"]);
 
-        $areas = OwnerAreaReport::query()->with("ownerStoragePriceModel")->where("counting_month","like",$year."-".$lastMonth."%")->get();
+        $areas = OwnerAreaReport::query()->with(["ownerStoragePriceModel.timeUnit","ownerStoragePriceModel.taxRate"])->where("counting_month","like",$year."-".$lastMonth."%")->get();
         $map = [];
+        $mapTax = [];
         foreach($areas as $area){
-            if (isset($map[$area->owner_id."_".$area->counting_month])){
+            $key = $area->owner_id."_".$area->counting_month;
+            if (isset($map[$key])){
                 if (!$area->ownerStoragePriceModel)continue;
-                $map[$area->owner_id."_".$area->counting_month] += app('OwnerStoragePriceModelService')
+                list($money,$taxFee) = app('OwnerStoragePriceModelService')
                     ->calculationAmount($area->ownerStoragePriceModel,$area->accounting_area,$area->owner_id,$area->counting_month);
+                $map[$key] += $money;
+                $mapTax[$key] += $taxFee;
             }else{
                 if (!$area->ownerStoragePriceModel)continue;
-                $map[$area->owner_id."_".$area->counting_month] = app('OwnerStoragePriceModelService')
+                list($map[$key],$mapTax[$key]) = app('OwnerStoragePriceModelService')
                     ->calculationAmount($area->ownerStoragePriceModel,$area->accounting_area,$area->owner_id,$area->counting_month);
             }
         }
         foreach (OwnerPriceSystem::query()->with(["timeUnit","taxRate"])->select("owner_id","usage_fee")->whereNull("operation")->orWhere("operation","")->get() as $system){
-            if (!$system->timeUnit)$systemFee[$system->owner_id] = $system->usage_fee;
-            else $systemFee[$system->owner_id] = $this->systemFee($system,$year."-".$lastMonth);
+            list($systemFee[$system->owner_id],$systemTaxFee[$system->owner_id]) = $this->systemFee($system,$year."-".$lastMonth);
         }
         $chunks = array_chunk($billDetails,50);
         foreach ($chunks as $bills){
@@ -74,14 +77,15 @@ class CreateOwnerBillReport extends Command
             $createOwnerBillReport = [];
             foreach ($bills as $bill){
                 $key = $bill->owner_id."_".$year."-".$lastMonth;
-                $otherFee = $systemFee[$bill->owner_id] ?? null;
                 $createOwnerBillReport[] = [
                     "owner_id"          => $bill->owner_id,       //项目ID
                     "counting_month"    => $year."-".$lastMonth."-01", //结算月
                     "work_fee"          => $bill->work_fee,
                     "logistic_fee"      => $bill->logistic_fee,
                     "storage_fee"       => $map[$key] ?? 0,
-                    "other_fee"         => $otherFee,
+                    "storage_tax_fee"   => $mapTax[$key] ?? 0,
+                    "other_fee"         => $systemFee[$bill->owner_id] ?? null,
+                    "other_tax_fee"     => $systemTaxFee[$bill->owner_id] ?? null,
                     "created_at"        => $date,
                 ];
             }
@@ -96,23 +100,25 @@ class CreateOwnerBillReport extends Command
      * @param OwnerPriceSystem|\stdClass $system
      * @param string $month
      *
-     * @return double
+     * @return array
      */
     private function systemFee(OwnerPriceSystem $system,$month)
     {
-        $money = null;
-        switch ($system->timeUnit->name){
-            case "日":
-                $money = $system->usage_fee*(Carbon::parse($month)->lastOfMonth()->format("d"));
-                break;
-            case "单":
-                $money = $system->usage_fee * (app("OrderService")->getOrderQuantity($system->owner_id));
-                break;
-            case "年":
-                $money = $system->usage_fee/12;
-                break;
-            default:
-                $money = $system->usage_fee;
+        if (!$system->timeUnit)$money = $system->usage_fee;
+        else{
+            switch ($system->timeUnit->name){
+                case "日":
+                    $money = $system->usage_fee*(Carbon::parse($month)->lastOfMonth()->format("d"));
+                    break;
+                case "单":
+                    $money = $system->usage_fee * (app("OrderService")->getOrderQuantity($system->owner_id));
+                    break;
+                case "年":
+                    $money = $system->usage_fee/12;
+                    break;
+                default:
+                    $money = $system->usage_fee;
+            }
         }
         if ($system->taxRate)$taxFee = $money * ($system->taxRate->value/100);
         else{
@@ -120,6 +126,6 @@ class CreateOwnerBillReport extends Command
             if ($system->owner && $system->owner->taxRate)$taxFee = $money * ($system->owner->taxRate->value/100);
             else $taxFee = null;
         }
-        return $money;
+        return array($money,$taxFee);
     }
 }

+ 46 - 0
app/Events/OrderIssueProcessLogCreateEvent.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace App\Events;
+
+use Illuminate\Broadcasting\Channel;
+use Illuminate\Broadcasting\InteractsWithSockets;
+use Illuminate\Broadcasting\PresenceChannel;
+use Illuminate\Broadcasting\PrivateChannel;
+use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
+use Illuminate\Foundation\Events\Dispatchable;
+use Illuminate\Queue\SerializesModels;
+
+class OrderIssueProcessLogCreateEvent
+{
+    use Dispatchable, InteractsWithSockets, SerializesModels;
+
+    public $orderPackageIds;
+    /**
+     * @var int
+     * 1 返回派件
+     * 2 已收件
+     */
+    public $status;
+
+    /**
+     * OrderIssueProcessLogCreateEvent constructor.
+     * @param array $orderPackageIds
+     * @param int $status
+     */
+    public function __construct(array $orderPackageIds, int $status)
+    {
+        $this->orderPackageIds = $orderPackageIds;
+        $this->status = $status;
+    }
+
+
+    /**
+     * Get the channels the event should broadcast on.
+     *
+     * @return \Illuminate\Broadcasting\Channel|array
+     */
+    public function broadcastOn()
+    {
+        return new PrivateChannel('channel-name');
+    }
+}

+ 9 - 3
app/Filters/OrderIssueFilters.php

@@ -375,9 +375,15 @@ class OrderIssueFilters
         if(is_string($user_work_groups)){
             $user_work_groups = explode(',', $user_work_groups);
         }
-        $this->queryBuilder->whereIn('order_issues.id',function($query)use($user_work_groups){
-            $query->from('order_issue_user_workgroup')->selectRaw('order_issue_id')->whereIn('user_workgroup_id',$user_work_groups);
-        });
+        if(in_array('空',$user_work_groups)){
+            $this->queryBuilder->whereNotIn('order_issues.id',function($query)use($user_work_groups){
+                $query->from('order_issue_user_workgroup')->selectRaw('order_issue_id');
+            });
+        }else{
+            $this->queryBuilder->whereIn('order_issues.id',function($query)use($user_work_groups){
+                $query->from('order_issue_user_workgroup')->selectRaw('order_issue_id')->whereIn('user_workgroup_id',$user_work_groups);
+            });
+        }
     }
 
     public function sendOrderLogisticNumber($sendOrderLogisticNumber)

+ 9 - 6
app/Filters/OrderPackageFilters.php

@@ -6,6 +6,8 @@ namespace App\Filters;
 use App\Order;
 use App\Services\UserService;
 use Illuminate\Http\Request;
+use Illuminate\Support\Carbon;
+use Illuminate\Support\Str;
 use phpDocumentor\Reflection\Types\Boolean;
 
 class OrderPackageFilters
@@ -13,7 +15,7 @@ class OrderPackageFilters
     protected $request;
     protected $queryBuilder;
     protected $filters = ['logistic_number', 'status', 'received_at_start',
-        'received_at_end', 'is_weighed', 'logistic_id', 'owner_id', 'sent_at_start', 'sent_at_end', 'is_exception','exception_type','default_date'];
+        'received_at_end', 'is_weighed', 'logistic_id', 'owner_id', 'sent_at_start', 'sent_at_end', 'is_exception', 'exception_type', 'default_date'];
 
     public function __construct(Request $request)
     {
@@ -42,6 +44,7 @@ class OrderPackageFilters
             $this->queryBuilder->where('logistic_number','like',$logistic_number."%");
         }
     }
+
     private function exception_type($exception_type)
     {
         $this->queryBuilder->where('exception_type', $exception_type);
@@ -74,8 +77,8 @@ class OrderPackageFilters
     private function logistic_id($logistic_id)
     {
         $logistic_ids = array_filter(preg_split('/[,, ]+/is', $logistic_id));
-        $this->queryBuilder->whereIn('order_id',function($query)use($logistic_ids){
-            $query->from('orders')->select('id')->whereIn('logistic_id',$logistic_ids);
+        $this->queryBuilder->whereIn('order_id', function ($query) use ($logistic_ids) {
+            $query->from('orders')->select('id')->whereIn('logistic_id', $logistic_ids);
         });
     }
 
@@ -87,12 +90,12 @@ class OrderPackageFilters
 
     private function sent_at_start($sent_at_start)
     {
-        $this->queryBuilder->where('sent_at', '>=', $sent_at_start);
+        $this->queryBuilder->where('sent_at', '>=', Carbon::parse($sent_at_start)->startOfDay());
     }
 
     private function sent_at_end($sent_at_end)
     {
-        $this->queryBuilder->where('sent_at', '<=', $sent_at_end);
+        $this->queryBuilder->where('sent_at', '<=', Carbon::parse($sent_at_end)->endOfDay());
     }
 
     private function is_exception($is_exception)
@@ -102,6 +105,6 @@ class OrderPackageFilters
 
     public function default_date()
     {
-        $this->queryBuilder->where('sent_at', '>=',now()->startOfDay() ->subDays(15))->where('sent_at', '<',now()->startOfDay()->addDay());
+        $this->queryBuilder->where('sent_at', '>=', now()->startOfDay()->subDays(15))->where('sent_at', '<', now()->startOfDay()->addDay());
     }
 }

+ 6 - 2
app/Http/Controllers/CommodityController.php

@@ -172,10 +172,14 @@ class CommodityController extends Controller
     public function apiGetCommodityByBarcode(Request $request)
     {
         $barcode=$request->input('barcode');
+        $owner_id=$request->input('owner_id');
 //        $name = '';
-        $commodity = '';
+        $commodity=[];
         if($barcode){
-            $commodity=Commodity::query()->whereHas('barcodes', function (Builder $query)use($barcode){
+            $commodity=Commodity::query()->where('owner_id',$owner_id)->whereHas('barcodes', function (Builder $query)use($barcode){
+                $query->where('code',$barcode);
+            })->first();
+            if (!$commodity)$commodity=Commodity::query()->whereNotNull('owner_id')->whereHas('barcodes', function (Builder $query)use($barcode){
                 $query->where('code',$barcode);
             })->first();
 //            if($commodity&&$commodity['name']) $name=$commodity['name'];

+ 26 - 3
app/Http/Controllers/CustomerController.php

@@ -3,7 +3,9 @@
 namespace App\Http\Controllers;
 
 use App\Components\AsyncResponse;
+use App\Jobs\OrderCreateInstantBill;
 use App\Jobs\ResetInstantBill;
+use App\Order;
 use App\Owner;
 use App\OwnerAreaReport;
 use App\OwnerBillReport;
@@ -14,6 +16,7 @@ use App\Services\OwnerAreaReportService;
 use App\Services\OwnerBillReportService;
 use App\Services\OwnerReportService;
 use App\Services\OwnerService;
+use App\Store;
 use Exception;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Http\Request;
@@ -432,7 +435,7 @@ class CustomerController extends Controller
             'customer_id'=>['required'],
             'owner_group_id'=>['required'],
             'warehouse_id'=>['required'],
-            'tax_rate_id' => ["required",'integer'],
+            'tax_rate_id' => ["nullable",'integer'],
             'waring_line_on' => ["nullable",'integer'],
         ],[
             'required'=>':attribute 为必填项',
@@ -538,6 +541,7 @@ class CustomerController extends Controller
 
     public function resetInstantBill()
     {
+        ini_set('max_execution_time', 2500);
         $startData = request("startDate");
         $endDate = request("endDate");
         $owner = request("owner");
@@ -546,11 +550,30 @@ class CustomerController extends Controller
         if ($endDate)$details->where("worked_at","<=",$endDate." 23:59:59");
         if (count($owner)>0)$details->whereIn("owner_id",$owner);
         $details->get()->each(function ($detail){
-            $this->dispatch(new ResetInstantBill($detail));
+            dispatch(new ResetInstantBill($detail));
         });
+        $this->restoreResetInstantBillOrder($startData,$endDate);
+        $this->restoreResetInstantBillStore($startData,$endDate);
         $this->success();
     }
-
+    private function restoreResetInstantBillOrder($startData,$endDate)
+    {
+        $orders = Order::query()->where("wms_status","订单完成")->whereBetween("updated_at",["{$startData} 00:00:00","{$endDate} 23:59:59"])
+            ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")->where("outer_table_name","orders")
+                ->whereBetween("worked_at",["{$startData} 00:00:00","{$endDate} 23:59:59"]))->get();
+        foreach ($orders->chunk(50) as $or){
+            dispatch(new OrderCreateInstantBill($or));
+        }
+    }
+    private function restoreResetInstantBillStore($startData,$endDate)
+    {
+        $stores = Store::query()->where("status","已入库")->whereBetween("updated_at",["{$startData} 00:00:00","{$endDate} 23:59:59"])
+            ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")->where("outer_table_name","stores")
+                ->whereBetween("worked_at",["{$startData} 00:00:00","{$endDate} 23:59:59"]))->get();
+        foreach ($stores->chunk(50) as $st){
+            dispatch(new OrderCreateInstantBill($st));
+        }
+    }
     public function resetBillConfirmation()
     {
         $month = request("month");

+ 3 - 3
app/Http/Controllers/DeliveryAppointmentController.php

@@ -39,7 +39,7 @@ class DeliveryAppointmentController extends Controller
 
     public function appointment()
     {
-        if(!Gate::allows('入库管理-入库预约-预约')){ return view("exception.authority");  }
+        if(!Gate::allows('入库管理-入库预约-预约')){ return view("store.deliveryAppointment.index");  }
         $owners = app("OwnerService")->getIntersectPermitting();
         $cars = CarType::query()->get();
         $logistics = Logistic::query()->get();
@@ -228,12 +228,12 @@ class DeliveryAppointmentController extends Controller
                 $available = $total-$result->capacity;
                 if ($available < $appointment->capacity)$this->success(["isFail"=>true]);
             }
-            $appointment = $appointment->update([
+            $appointment->update([
                 "appointment_date"      => $selectDate["date"],
                 "date_period"           => $selectDate["time"],
             ]);
         });
-        dispatch(new DeliveryAppointmentCheck($appointment->id))->delay(Carbon::parse($appointment->appointment_date." ".(explode("-",DeliveryAppointment::PERIOD[$appointment->date_period])[1]).":00:01"));
+        dispatch(new DeliveryAppointmentCheck($appointment->id))->delay(Carbon::parse($selectDate["date"]." ".(explode("-",DeliveryAppointment::PERIOD[$selectDate["time"]])[1]).":00:01"));
         $this->success();
     }
 

+ 32 - 0
app/Http/Controllers/ForeignHaiRoboticsController.php

@@ -0,0 +1,32 @@
+<?php
+
+
+namespace App\Http\Controllers;
+
+
+use App\Services\StationTaskBatchService;
+use App\StationTaskBatch;
+use Illuminate\Http\Request;
+use App\Traits\TestableInstant;
+class ForeignHaiRoboticsController
+{
+    use TestableInstant;
+
+    /** @var StationTaskBatchService $stationTaskBatchService */
+    private $stationTaskBatchService=null;
+
+    function runBatch(Request $request){
+        $request->validate(
+            ['id'=>'required|exists:station_task_batches,id']
+        );
+        $batchTask=StationTaskBatch::query()->first($request['id']);
+        $batchesFailed=$this->stationTaskBatchService->runMany(collect([$batchTask]));//执行波次任务
+        if($batchesFailed && $batchesFailed->isNotEmpty()){
+            return [
+                'success'=>false,
+                'errorMsg'=>'有部分失败波次:'.$batchesFailed->toJson()
+            ];
+        }
+        return ['success'=>true];
+    }
+}

+ 34 - 1
app/Http/Controllers/OrderController.php

@@ -6,6 +6,7 @@ use App\OracleBasCustomer;
 use App\OracleDOCOrderHeader;
 use App\OracleDOCWaveDetails;
 use App\OrderIssueType;
+use App\Services\LogisticService;
 use App\Services\LogService;
 use App\Services\OrderService;
 use App\Services\RejectedBillItemService;
@@ -25,6 +26,8 @@ class OrderController extends Controller
         $orderService = app('OrderService');
         $request = $request->input();
         $owners = app('OwnerService')->getIntersectPermitting(['id','code']);
+        $service=app(LogisticService::class);
+        $logistics=$service->getSelection(['id','name']);
         $codes = array_column($owners->toArray(),'code');
         if ($request['customerid'] ?? false){
             $arr = explode(',',$request['customerid']);
@@ -44,7 +47,7 @@ class OrderController extends Controller
         $page = $request["page"] ?? 1;
         $codes=DB::connection('oracle')->table('BAS_CODES')->select('code','codename_c')->where('codeid','SO_STS')->orderBy('code','asc')->get();
         $orderIssueType = OrderIssueType::all();
-        return view('order/index/delivering',compact('orders','customers','request','codes','commodities','page','picktotraceids','orderIssueType','orderIssueNos'));
+        return view('order/index/delivering',compact('orders','customers','request','codes','commodities','page','picktotraceids','orderIssueType','orderIssueNos','logistics'));
     }
 
     //导出
@@ -302,7 +305,37 @@ sql;
         }
         oci_close($conn);
         return true;
+    }
+
+    public function resetInterfaceReturnMark(Request $request)
+    {
+        if(!Gate::allows('订单管理-编辑')){ return redirect(url('/'));  }
+        $orderno=$request->orderno;
+        $oldIds =OracleDOCOrderHeader::query()
+            ->whereIn('orderno', $orderno)
+            ->where('edisendflag', 'N')->pluck('orderno')->toArray();
 
+        OracleDOCOrderHeader::query()
+            ->whereIn('orderno',$orderno)
+            ->where('sostatus','99')
+            ->whereIn('edisendflag',['R','W'])
+                ->where('addwho','!=','EDI')
+            ->update(['edisendflag'=>'N']);
+
+        $failedOrdernos =OracleDOCOrderHeader::query()
+            ->whereIn('orderno', $orderno)
+            ->where('edisendflag', '!=', 'N')->pluck('orderno');
+
+        $successedOrdernos =OracleDOCOrderHeader::query()
+            ->whereIn('orderno', array_diff($orderno,$oldIds))
+            ->where('edisendflag', 'N')->pluck('orderno');
+
+        app('LogService')->log(__METHOD__,'重置接口回传标记'.__FUNCTION__,json_encode($orderno),Auth::user()['id']);
+        if (count($failedOrdernos)==0) {
+            return ['success'=>true];
+        } else {
+            return ['success'=>false,'fail_info'=>"数据 {$failedOrdernos} 更新失败,数据{$successedOrdernos}更新成功"];
+        }
     }
 
 }

+ 2 - 0
app/Http/Controllers/OrderIssueController.php

@@ -43,6 +43,8 @@ class OrderIssueController extends Controller
         }
         $owners = app(OwnerService::class)->getAuthorizedOwners();
         $orderIssues = OrderIssue::query()->filter($filter)->defaultWith()->paginate($request['paginate'] ?? 50);
+//        $orderIssues = OrderIssue::query()->filter($filter)->defaultWith()->toSql();
+//        dd($orderIssues);
         $orderIssueType = OrderIssueType::all();
         $qualityLabel = QualityLabel::all();
         $logistics = Logistic::all();

+ 18 - 1
app/Http/Controllers/OrderPackageController.php

@@ -7,6 +7,23 @@ use Illuminate\Http\Request;
 
 class OrderPackageController extends Controller
 {
-
+    public function update(Request $request)
+    {
+        $remarkItem = $request->input('remark');
+        /**
+         * @var $orderPackage OrderPackage
+         */
+        $orderPackage = OrderPackage::query()->find($request->input('orderPackageId'));
+        if (is_null($orderPackage->remark)) {
+            $orderPackage->remark = [$remarkItem];
+        } else {
+            $remark = $orderPackage->remark;
+            $remark[] = $remarkItem;
+            $remark = array_reverse($remark);
+            $orderPackage->remark = $remark;
+        }
+        $orderPackage->save();
+        return ['success' => true, 'data' => $orderPackage->refresh()->remark];
+    }
 
 }

+ 5 - 1
app/Http/Controllers/ProcurementController.php

@@ -70,9 +70,10 @@ class ProcurementController extends Controller
         $procurements = Procurement::query()
             ->orderByDesc('id')
             ->filter($filters)
+            ->withCount('procurementQuotations')
             ->with(['initiator','ownerMaterial.file','ownerMaterial.material','supplier','ownerMaterial.owner'=>function($query)use($owner_ids){
                 $query->with('customer')->whereIn('id',$owner_ids);
-            },'procurementDeliveries'])
+            },'procurementDeliveries','procurementQuotations.supplier'])
             ->whereHas('ownerMaterial',function($builder)use($owner_ids){
                 $builder->whereHas('owner',function ($build)use($owner_ids){
                     $build->whereIn('id',$owner_ids);
@@ -80,6 +81,7 @@ class ProcurementController extends Controller
             })
             ->paginate($param['paginate'] ?? 50);
         foreach ($procurements as $procurement){
+            if ($procurement->procurement_quotations_count>0 && $procurement->status==0) $procurement->status=1;
             if (empty($procurement->procurementDeliveries))continue;
             if (Carbon::now()->gt($procurement['deadline'])){
                 $procurement->isFinishEnquiry=true;
@@ -348,6 +350,7 @@ class ProcurementController extends Controller
         $owner_ids=app('UserService')->getPermittingOwnerIds(auth()->user());
         $procurements = Procurement::query()
             ->filter($filters)
+            ->withCount('procurementQuotations')
             ->with(['initiator','ownerMaterial.material','ownerMaterial.owner'=>function($query)use($owner_ids){
                 $query->with('customer')->whereIn('id',$owner_ids);
             },'procurementDeliveries'])
@@ -358,6 +361,7 @@ class ProcurementController extends Controller
             })
             ->get();
         foreach ($procurements as $procurement){
+            if ($procurement->procurement_quotations_count>0 && $procurement->status==0) $procurement->status=1;
             if (empty($procurement->procurementDeliveries))continue;
             $procurement->deliver_amount=$procurement->procurementDeliveries->sum('amount');
         }

+ 33 - 46
app/Http/Controllers/TestController.php

@@ -63,12 +63,14 @@ use App\OrderIssue;
 use App\OrderPackage;
 use App\Owner;
 use App\OwnerAreaReport;
+use App\OwnerBillReport;
 use App\OwnerFeeDetail;
 use App\OwnerFeeDetailLogistic;
 use App\OwnerMaterial;
 use App\OwnerPriceExpress;
 use App\OwnerPriceOperation;
 use App\OwnerPriceOperationItem;
+use App\OwnerPriceSystem;
 use App\OwnerReport;
 use App\OwnerStoragePriceModel;
 use App\Package;
@@ -141,6 +143,7 @@ use ChangeColumnOrderIdToOrderIssues;
 use Doctrine\DBAL\Exception\DatabaseObjectExistsException;
 use Doctrine\DBAL\Query\QueryBuilder;
 use Illuminate\Database\Connection;
+use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\QueryException;
 use Illuminate\Support\Facades\Auth;
@@ -176,44 +179,13 @@ class TestController extends Controller
 
     public function test()
     {
-        $owner = Owner::query()->with("taxRate")
-            ->whereHas("taxRate")
-            ->find(1);
-        dd($owner);
-    }
-    public function a(int $c)
-    {
-        return $c;
-    }
-    public function restoreResetInstantBill()
-    {
-        ini_set('max_execution_time', 2500);
-        $date = \request("date");
-        foreach (OwnerFeeDetail::query()->whereBetween("worked_at",["{$date} 00:00:00","{$date} 23:59:59"])->cursor() as $detail){
-            dispatch(new ResetInstantBill($detail));
-        }
-    }
-    public function restoreResetInstantBillOrder()
-    {
-        ini_set('max_execution_time', 2500);
-        $date = \request("date");
-        $orders = Order::query()->where("wms_status","订单完成")->whereBetween("updated_at",["{$date} 00:00:00","{$date} 23:59:59"])
-            ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")->where("outer_table_name","orders")
-                ->whereBetween("worked_at",["{$date} 00:00:00","{$date} 23:59:59"]))->get();
-        foreach ($orders->chunk(50) as $or){
-            dispatch(new OrderCreateInstantBill($or));
-        }
-    }
-    public function restoreResetInstantBillStore()
-    {
-        ini_set('max_execution_time', 2500);
-        $date = \request("date");
-        $stores = Store::query()->where("status","已入库")->whereBetween("updated_at",["{$date} 00:00:00","{$date} 23:59:59"])
-            ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")->where("outer_table_name","stores")
-                ->whereBetween("worked_at",["{$date} 00:00:00","{$date} 23:59:59"]))->get();
-        foreach ($stores->chunk(50) as $st){
-            dispatch(new OrderCreateInstantBill($st));
-        }
+        $order = Order::query()->where("code","SO210509003964")->first();
+        $ser = new OrderService();
+        $ser->createInstantBill($order);
+        dd();
+        $store = Store::query()->find(164944);
+        $ser = new StoreService();
+        $ser->createInstantBill($store);
     }
     public function supplementMarchOwnerReport()
     {
@@ -451,10 +423,12 @@ class TestController extends Controller
         }
     }
 
-    public function excelIt()
+    public function ld()
     {
-        $excel = new ExcelController();
-        return $excel->makeExcel();
+        dd(
+            json_encode(collect(collect(collect([City::query()->first()]))))
+
+        );
     }
 
     public function featureIt()
@@ -1440,11 +1414,6 @@ where purch.islower=1 and deliver.id>'.$id);
         app('OrderPackageCommoditySerialNumberService')->syncOrderPackageCommoditySerialNumbers($orderHeaders);
         $service->createByWmsOrderHeader($orderHeaders);
     }
-    public function testArray1()
-    {
-        $arr = (array)'update_at';
-        dd($arr);
-    }
     public function addHaiBox(Request $request)
     {
         echo <<<TEXT
@@ -1468,6 +1437,24 @@ TEXT;
         MeasuringMachine::query()->firstOrCreate(['code'=>'hengli003'],['name'=>'hengli003']);
     }
 
+    public function testProcurement()
+    {
+        $procurementTotals = ProcurementTotalBill::query()
+            ->where('status', 1)
+            ->where('counting_month', '2021-04-01')
+            ->get();
+        foreach ($procurementTotals as $procurementTotalBill) {
+            /** @var  ProcurementTotalBill $procurementTotalBill */
+            $procurementTotalBill->setCurrentMothProcurements();
+            if (isset($procurementTotalBill->procurementCheckSheets)) {
+                $procurementCheckSheets = $procurementTotalBill->procurementCheckSheets;
+                foreach ($procurementCheckSheets as $procurementCheckSheet) {
+                    $procurementCheckSheet->update(['status' => 2]);//2 已出账
+                }
+            }
+        }
+    }
+
     public function testHttp()
     {
         return view('httpTest');

+ 3 - 0
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -14,6 +14,7 @@ use App\WMSWaybill;
 use App\WMSWaybillOrder;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Validator;
 use Ramsey\Uuid\Uuid;
 use Zttp\Zttp;
@@ -97,6 +98,8 @@ class WaybillController extends Controller
                 if ($unit)$waybill->warehouse_weight_unit_id_other=$unit->id;
             }
             if ($waybill->wms_bill_number){
+                $notes = DB::connection("oracle")->selectOne(DB::raw("SELECT notes FROM DOC_ORDER_HEADER WHERE ORDERNO = ?"),[$waybill->wms_bill_number]);
+                if ($notes)$waybill->ordering_remark = $notes->notes;
                 $order = app("OrderService")->first(["code"=>$waybill->wms_bill_number]);
                 if ($order)$waybill->order_id = $order->id;
             }

+ 1 - 0
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -309,6 +309,7 @@ class StorageController
         ]
         ];
         foreach ($codes as &$code){
+            if(!trim($code))continue;
             $code=str_replace(['ide','IDE'],'',$code);
             $code='IDE'.str_pad($code,7,'0',STR_PAD_LEFT);
             $post[0]['bins'][]=[

+ 1 - 0
app/Http/Controllers/api/thirdPart/haochuang/SortingController.php

@@ -99,6 +99,7 @@ class SortingController extends Controller
                 $commodity=$orderCommodity->commodity()->first();
                 if(!$commodity){
                     app('LogService')->log(__METHOD__, 'error' . __FUNCTION__, '播种位数据准备出错,找不到订单对应的Commodity id的对象'.$orderCommodity['commodity_id'].',是否表数据在波次生成后丢失?'.json_encode($request->all()));
+                    return;
                 }
                 $barcodeStr=$commodity->barcodes()->get()->map(function(CommodityBarcode $barcode){
                     return $barcode['code'];

+ 20 - 2
app/Http/Controllers/api/thirdPart/weixin/ProcurementController.php

@@ -142,6 +142,13 @@ class ProcurementController extends Controller
         $procurement=Procurement::query()->find($id)->update(['status'=>5]);//  5 => "待收货",
         if ($procurement) return $this->success($procurement);
     }
+    //取消生产
+    public function cancelProcurement(Request $request): \Illuminate\Http\JsonResponse
+    {
+        $id=$request->input('id');
+        $procurement=Procurement::query()->find($id)->update(['status'=>10]);//  10 => "订单取消",
+        if ($procurement) return $this->success($procurement);
+    }
 
     public function getProcurementDeliveries(): \Illuminate\Http\JsonResponse
     {
@@ -216,7 +223,8 @@ class ProcurementController extends Controller
     public function markProcurementTotalBillStatus(Request $request): \Illuminate\Http\JsonResponse//供应商提交对账单
     {
         $id=$request->input('id');
-        $procurementTotalBill=ProcurementTotalBill::query()->find($id)->update(['status'=>1]);//1:已出账
+        $procurementTotalBill=ProcurementTotalBill::query()->find($id);
+        $procurementTotalBill->update(['status'=>1]);//1:已出账
         /** @var  ProcurementTotalBill $procurementTotalBill */
         $procurementTotalBill->setCurrentMothProcurements();
         if (isset($procurementTotalBill->procurementCheckSheets)){
@@ -232,7 +240,17 @@ class ProcurementController extends Controller
     {
         $param=$request->all(['id','delivernum']);
         $procurementDelivery=ProcurementDeliverie::query()->with('procurement')->find($param['id']);
-        $procurementDelivery ->update(['status'=>1,'receipt_amount'=>$param['delivernum'],'created_at'=>Carbon::now()->toDateTimeString(),'signed_at'=>Carbon::now()->toDateString()]);
+        if ($param['delivernum']!=0) {
+            $receipt_amount=$param['delivernum'];
+        }else{
+            $receipt_amount=$procurementDelivery['amount'];
+        }
+        $procurementDelivery ->update([
+            'status'=>1,
+            'receipt_amount'=>$receipt_amount,
+            'created_at'=>Carbon::now()->toDateTimeString(),
+            'signed_at'=>Carbon::now()->toDateString()]
+        );
         $procurementDelivery->procurement->update(['status'=>6]);
         if ($procurementDelivery) return $this->success($procurementDelivery);
     }

+ 11 - 14
app/Imports/RejectedImport.php

@@ -32,27 +32,24 @@ class RejectedImport implements ToCollection, WithHeadingRow
     {
         foreach ($collections as $row)
         {
-            $logistic_number_return = trim($row['退回单号']??$row['快递单号']??$row['logistic_number_return']??'');
+            $logistic_number_return = trim($row['退回单号']??$row['退货单号']??$row['快递单号']??$row['logistic_number_return']??'');
             $mobile_sender = trim($row['手机号']??$row['mobile_sender']??'');
             $logistic_name = trim($row['快递公司']??$row['logistic_name']??'');
             $barcode = trim($row['条码']??$row['barcode']??'');
             $amount = trim($row['数量']??$row['amount']??'');
             $quality_label_name = trim($row['品质']??$row['quality_label_name']??'');
             $remark = trim($row['备注']??$row['remark']??'');
-            $id_owner=Session::get('jianshangIdOwner');
+            $owner=trim($row['货主']??$row['owner']??'');
 
-            $lastReturnNumber = Session::get('jianshangLastImportedBill');
-            if(!$logistic_number_return)$logistic_number_return=$lastReturnNumber;
-            $lastMobile = Session::get('jianshangLastImportedMobile');
-            if(!$mobile_sender)$mobile_sender=$lastMobile;
-            $lastlogistic_name = Session::get('jianshangLastImportedLogisticName');
-            if(!$logistic_name)$logistic_name=$lastlogistic_name;
+//            $lastReturnNumber = Session::get('jianshangLastImportedBill');
+//            if(!$logistic_number_return)$logistic_number_return=$lastReturnNumber;
+//            $lastMobile = Session::get('jianshangLastImportedMobile');
+//            if(!$mobile_sender)$mobile_sender=$lastMobile;
+//            $lastlogistic_name = Session::get('jianshangLastImportedLogisticName');
+//            if(!$logistic_name)$logistic_name=$lastlogistic_name;
 
 
-            if(!$id_owner){
-                $id_owner=Owner::query()->where('name','like','%笕尚%')->first()['id'];
-                Session::put('jianshangIdOwner',$id_owner);
-            }
+            $owner=Owner::query()->where('name','like',$owner.'%')->first();
             $id_logistic_return=Logistic::query()->where('name','like',"%{$logistic_name}%")->first()['id'];
             if(!$id_logistic_return){
                 $id_logistic_return=Logistic::query()->where('name','like',"%其它%")->first()['id'];
@@ -87,7 +84,7 @@ class RejectedImport implements ToCollection, WithHeadingRow
                 $bill->syncOrderIssue();
             }else{
                 $bill=new RejectedBill([
-                    'id_owner'=>$id_owner,
+                    'id_owner'=>$owner['id'],
                     'mobile_sender'=>$mobile_sender,
                     'logistic_number_return'=>$logistic_number_return,
                     'id_logistic_return'=>$id_logistic_return,
@@ -114,7 +111,7 @@ class RejectedImport implements ToCollection, WithHeadingRow
             }
 
             $lastBill = Session::get('jianshangLastImportedBill');
-            if($lastBill&&$lastBill !=trim($logistic_number_return)){
+            if($owner['name']=='笕尚'&&$lastBill&&$lastBill !=trim($logistic_number_return)){
                 $this->submitToApi($bill);
             }
             Session::put('jianshangLastImportedLogisticName',trim($logistic_name));

+ 0 - 1
app/Jobs/DeleteRepetitionSkuItem.php

@@ -62,7 +62,6 @@ class DeleteRepetitionSkuItem implements ShouldQueue
             if ($del['id']==$this->param[0]['id']) continue;
             Commodity::query()->where('id',$del['id'])->delete();
             LogService::log(__METHOD__,"去除重复sku商品",json_encode($del));
-
         }
     }
 }

+ 4 - 3
app/Jobs/LogisticZopSync.php

@@ -41,6 +41,7 @@ class LogisticZopSync implements ShouldQueue
         ini_set('max_execution_time', 10);
         $zopResult = [];
         $response = $this->sentRequestToZT();
+        if(is_null($response)) return;
         if ($response->status) {
             $zopResult[] = [
                 'routes' => $response->result,
@@ -123,7 +124,7 @@ class LogisticZopSync implements ShouldQueue
         $delivered_duration = now()->diffInHours(Carbon::parse($orderPackage['sent_at']));
         $last_routed_duration = now()->diffInHours(Carbon::parse($lastRouteDate));
         $VALID_HOURS = 4;
-        $SHORT_RESPONSE_HOURS =  (function ($province) {
+        $SHORT_RESPONSE_HOURS = (function ($province) {
             switch ($province) {
                 case '浙江省':
                 case '江苏省':
@@ -247,8 +248,8 @@ class LogisticZopSync implements ShouldQueue
             default:
                 break;
         }
-        if($conclusion
-            ==($conclusion | $IS_ROUTED | $IS_IN_VALID_TIME | $IS_SENDING | $IS_SENDING_NO_RESPONSE)){
+        if ($conclusion
+            == ($conclusion | $IS_ROUTED | $IS_IN_VALID_TIME | $IS_SENDING | $IS_SENDING_NO_RESPONSE)) {
             $data['exception_type'] = '派件异常';
         }
         switch ($conclusion) {

+ 46 - 0
app/Listeners/UpdateOrderPackageExceptionListener.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace App\Listeners;
+
+use App\Events\OrderIssueProcessLogCreateEvent;
+use App\OrderPackage;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Queue\InteractsWithQueue;
+
+class UpdateOrderPackageExceptionListener implements ShouldQueue
+{
+    /**
+     * Create the event listener.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+
+    /**
+     * Handle the event.
+     *
+     * @param OrderIssueProcessLogCreateEvent $event
+     * @return void
+     */
+    public function handle(OrderIssueProcessLogCreateEvent $event)
+    {
+        switch ($event->status) {
+            case 1:
+                $status = '返回派件';
+                break;
+            case 2:
+                $status = '已收件';
+                break;
+            default:
+                $status = '无';
+        }
+        OrderPackage::query()->whereIn('id', $event->orderPackageIds)->update([
+            'exception_type' => '无',
+            'exception' => '否',
+            'status' => $status,
+        ]);
+    }
+}

+ 1 - 0
app/OrderPackage.php

@@ -31,6 +31,7 @@ class OrderPackage extends Model
 
     protected $casts = [
         'transfer_status' => 'array',
+        'remark' => 'array',
     ];
 
     public function commodities(){

+ 2 - 0
app/OwnerBillReport.php

@@ -20,6 +20,8 @@ class OwnerBillReport extends Model
        "difference",     //差额
        "confirmed",      //确认状态
        "other_fee",      //其他费用
+       "storage_tax_fee",//仓储税费
+       "other_tax_fee",  //其他税费
    ];
    protected $appends=[
         "initial_fee"

+ 3 - 0
app/Providers/EventServiceProvider.php

@@ -38,6 +38,9 @@ class EventServiceProvider extends ServiceProvider
         'App\Events\AddOrUpdateOrderIssues' => [
             'App\Listeners\AddOrUpdateOrderIssuesListener',
         ],
+        'App\Events\OrderIssueProcessLogCreateEvent' => [
+            'App\Listeners\UpdateOrderPackageExceptionListener',
+        ],
     ];
 
     /**

+ 7 - 22
app/Services/AllInventoryService.php

@@ -3,6 +3,7 @@
 namespace App\Services;
 
 use App\Owner;
+use App\Traits\ModelSearchWay;
 use Illuminate\Support\Facades\DB;
 use App\Traits\ServiceAppAop;
 
@@ -10,6 +11,8 @@ use App\Traits\ServiceAppAop;
 class AllInventoryService
 {
     use ServiceAppAop;
+    use ModelSearchWay;
+
     protected $modelClass=AllInventory::class;
     public function getSql(array $params, $page=null, $paginate=null){
         $ownerCodes=Owner::filterAuthorities()->select('code')->get();
@@ -57,15 +60,15 @@ class AllInventoryService
 //        if ($TOLocation)$sql .= " and 库位 like '".$TOLocation."' ";
 //        if ($SKU)$sql.=" and 产品编码 like '".$SKU."' ";
 //        if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
-        if ($TOLocation)$sql=$this->searchWay($sql,$TOLocation,"库位");
-        if ($SKU)$sql=$this->searchWay($sql,$SKU,"产品编码");
-        if ($LotAtt05)$sql=$this->searchWay($sql,$LotAtt05,"属性仓");
+        if ($TOLocation)$sql=$this->sqlSearchWay($sql,$TOLocation,"库位");
+        if ($SKU)$sql=$this->sqlSearchWay($sql,$SKU,"产品编码");
+        if ($LotAtt05)$sql=$this->sqlSearchWay($sql,$LotAtt05,"属性仓");
         if ($date_start)$sql.=" and 创建时间 > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end)$sql.=" and 创建时间 < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
         if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
         if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
 //        if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
-        if ($ALTERNATE_SKU1)$sql=$this->searchWay($sql,$ALTERNATE_SKU1,"产品条码");
+        if ($ALTERNATE_SKU1)$sql=$this->sqlSearchWay($sql,$ALTERNATE_SKU1,"产品条码");
         if ($page&&$paginate)$sql.="  and ROWNUM<='".$page*$paginate."'";
         $sql.=' )  ';
         if ($page&&$paginate)$sql.="  where rn>'".($page-1)*$paginate."'";
@@ -75,22 +78,4 @@ class AllInventoryService
     public function paginate(array $params){
         return DB::connection('oracle')->select(DB::raw($this->getSql($params,$params['page'] ?? 1, $params['paginate'] ?? 50)));
     }
-    private function searchWay($sql,$condition,$column)
-    {
-        if ($condition){
-            if (strpos($condition, ',') || strpos($condition, ',') || strpos($condition, ' ')) {
-                $arr = array_filter(preg_split('/[,, ]+/is', $condition));
-                $sql .= ' and '.$column.' in (';
-                foreach ($arr as $index => $arr){
-                    if ($index != 0)$sql .= ',';
-                    $sql .= "'".$arr."'";
-                }
-                $sql .= ') ';
-                unset($condition);
-            } else {
-                $sql .= " and $column like '".$condition."' ";
-            }
-        }
-        return $sql;
-    }
 }

+ 4 - 2
app/Services/BatchService.php

@@ -98,13 +98,15 @@ class BatchService
                 LogService::log(__METHOD__,'assignTasks','波次任务分配6:'.json_encode($batches));
             });
 
-            $ran=$this->stationTaskBatchService->runMany($stationTaskBatches);//执行波次任务
+//            $ran=$this->stationTaskBatchService->runMany($stationTaskBatches);//执行波次任务
             LogService::log(__METHOD__,'assignTasks','波次任务分配7:'.json_encode($batches));
         }catch(Exception $e){
+            $batchesJson='';
             foreach ($batches as $batch){
+                $batchesJson.=json_encode($batch);
                 Cache::tags(['波次防重叠'.$batch['id']])->flush();
             }
-            throw new ErrorException('注册任务失败: '.json_encode($batches). $e->getMessage().$e->getTrace());
+            throw new ErrorException('注册任务失败: '. $batchesJson . $e->getMessage().$e->getTrace());
         }
     }
 

+ 8 - 7
app/Services/ForeignHaiRoboticsService.php

@@ -8,6 +8,7 @@ use App\Exceptions\ErrorException;
 use App\MaterialBox;
 use App\StationCacheShelfGrid;
 use App\StationTaskMaterialBox;
+use Carbon\Carbon;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Http;
@@ -140,16 +141,16 @@ class ForeignHaiRoboticsService
                 $this->materialBoxService->get(['code'=>$binCode])->first();
             LogService::log('海柔请求','markBinProcessed1.5',
                 json_encode($materialBox));
+            /** @var StationTaskMaterialBox $stationTaskMaterialBox */
             $stationTaskMaterialBox
                 =(function()use($materialBox){
                 return $stationTaskMaterialBox=
-                    $this->stationTaskMaterialBoxService
-                        ->get(
-                            [
-                                'material_box_id'=>$materialBox['id'],
-                                'status'=>['处理中','待处理','异常','处理队列'],
-                            ]
-                        )->first();
+                    StationTaskMaterialBox::query()
+                        ->where('material_box_id',$materialBox['id'])
+                        ->where('created_at','>',Carbon::now()->subDay())
+                        ->whereIn('status',['处理中','待处理','异常','处理队列'])
+                        ->orderBy('id','desc')
+                    ->first();
             })();
             LogService::log('海柔请求','markBinProcessed1.6',
                 json_encode($stationTaskMaterialBox));

+ 13 - 28
app/Services/InventoryService.php

@@ -7,6 +7,7 @@ use App\inventoryDailyLog;
 use App\InventoryDailyLoggingOwner;
 use App\Owner;
 use App\Services\common\QueryService;
+use App\Traits\ModelSearchWay;
 use Illuminate\Support\Facades\DB;
 use App\Traits\ServiceAppAop;
 
@@ -14,6 +15,7 @@ use App\Traits\ServiceAppAop;
 class InventoryService
 {
     use ServiceAppAop;
+    use ModelSearchWay;
     protected $modelClass=Inventory::class;
     public function getSql(array $params,$page=null,$paginate=null){
         $ownerCodes=Owner::filterAuthorities()->select('code')->get();
@@ -40,8 +42,8 @@ class InventoryService
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
 //        if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
 //        if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
-        if ($TOLocation)$sql=$this->searchWay($sql,$TOLocation,"TOLocation");
-        if ($SKU)$sql=$this->searchWay($sql,$SKU,"FMSKU");
+        if ($TOLocation)$sql=$this->sqlSearchWay($sql,$TOLocation,"TOLocation");
+        if ($SKU)$sql=$this->sqlSearchWay($sql,$SKU,"FMSKU");
         if ($customerid){
             $sql .= ' and TOCustomerID in (';
             $arr = explode(',',$customerid);
@@ -66,8 +68,8 @@ class InventoryService
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
 //        if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
 //        if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
-        if ($TOLocation)$sql=$this->searchWay($sql,$TOLocation,"FMLOCATION");
-        if ($SKU)$sql=$this->searchWay($sql,$SKU,"FMSKU");
+        if ($TOLocation)$sql=$this->sqlSearchWay($sql,$TOLocation,"FMLOCATION");
+        if ($SKU)$sql=$this->sqlSearchWay($sql,$SKU,"FMSKU");
         if ($customerid){
             $sql .= ' and FMCUSTOMERID in (';
             $arr = explode(',',$customerid);
@@ -92,8 +94,8 @@ class InventoryService
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
 //        if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
 //        if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
-        if ($TOLocation)$sql=$this->searchWay($sql,$TOLocation,"FMLocation");
-        if ($SKU)$sql=$this->searchWay($sql,$SKU,"FMSKU");
+        if ($TOLocation)$sql=$this->sqlSearchWay($sql,$TOLocation,"FMLocation");
+        if ($SKU)$sql=$this->sqlSearchWay($sql,$SKU,"FMSKU");
 
         if ($customerid){
             $sql .= ' and FMCUSTOMERID in (';
@@ -119,8 +121,8 @@ class InventoryService
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
 //        if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
 //        if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
-        if ($TOLocation)$sql=$this->searchWay($sql,$TOLocation,"TOLocation");
-        if ($SKU)$sql=$this->searchWay($sql,$SKU,"FMSKU");
+        if ($TOLocation)$sql=$this->sqlSearchWay($sql,$TOLocation,"TOLocation");
+        if ($SKU)$sql=$this->sqlSearchWay($sql,$SKU,"FMSKU");
 
         if ($customerid){
             $sql .= ' and TOCustomerID in (';
@@ -150,34 +152,17 @@ class InventoryService
         $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,stockLog.客户  ';
         $sql.=' )result where 1=1 ';
 //        if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
-        if ($LotAtt05)$sql=$this->searchWay($sql,$LotAtt05,"属性仓");
+        if ($LotAtt05)$sql=$this->sqlSearchWay($sql,$LotAtt05,"属性仓");
         if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
         if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
 //        if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
-        if ($ALTERNATE_SKU1)$sql=$this->searchWay($sql,$ALTERNATE_SKU1,"产品条码");
+        if ($ALTERNATE_SKU1)$sql=$this->sqlSearchWay($sql,$ALTERNATE_SKU1,"产品条码");
         if ($page&&$paginate)$sql.="  and ROWNUM<='".$page*$paginate."'";
         $sql.=' )  ';
         if ($page&&$paginate)$sql.="  where rn>'".($page-1)*$paginate."'";
         return $sql;
     }
-    private function searchWay($sql,$condition,$column)
-    {
-        if ($condition){
-            if (strpos($condition, ',') || strpos($condition, ',') || strpos($condition, ' ')) {
-                $arr = array_filter(preg_split('/[,, ]+/is', $condition));
-                $sql .= ' and '.$column.' in (';
-                foreach ($arr as $index => $arr){
-                    if ($index != 0)$sql .= ',';
-                    $sql .= "'".$arr."'";
-                }
-                $sql .= ') ';
-                unset($condition);
-            } else {
-                $sql .= " and $column like '".$condition."' ";
-            }
-        }
-        return $sql;
-    }
+
 
     public function paginate(array $params)
     {

+ 4 - 3
app/Services/LaborReportService.php

@@ -41,11 +41,12 @@ class LaborReportService
             });
         }else unset($params['is_export']);
         $columnQueryRules=[
-            'enter_number' => ['timeLimit' => 15],
+            'enter_number' => ['batch'=>'','timeLimit' => 15],
             'created_at_start' => ['alias' => 'created_at' , 'startDate' => ' 00:00:00'],
             'created_at_end' => ['alias' => 'created_at' , 'endDate' => ' 23:59:59'],
-            'identity_number' => ['timeLimit' => 15],
-            'name' => ['like' => ''],
+            'identity_number' => ['batch'=>'','timeLimit' => 15],
+            'name' => ['batch' => ''],
+            'mobile_phone' => ['batch' => ''],
             'user_workgroup_id' => ['multi' => ','],
             'labor_company_id' => ['multi' => ','],
             'id' => ['multi' => ',']

+ 28 - 12
app/Services/OrderService.php

@@ -24,6 +24,7 @@ use App\RejectedBill;
 use App\Services\common\BatchUpdateService;
 use App\Services\common\DataHandlerService;
 use App\Shop;
+use App\Traits\ModelSearchWay;
 use App\ValueStore;
 use App\Warehouse;
 use Carbon\Carbon;
@@ -38,6 +39,7 @@ use App\Traits\ServiceAppAop;
 class OrderService
 {
     use ServiceAppAop;
+    use ModelSearchWay;
     protected $modelClass=Order::class;
     /**
      * @var OracleDOCOrderHeaderService $oracleDOCOrderHeaderService
@@ -91,9 +93,8 @@ class OrderService
         if ($ordernos){
             $sql .= " AND orderno IN ".$ordernos;
         }
-        if ($c_contact){
-            $sql .= " AND c_contact like '".$c_contact."'";
-        }
+//        if ($c_contact) $sql .= " AND c_contact like '".$c_contact."'";
+        if ($c_contact)$sql=$this->sqlSearchWay($sql,$c_contact,'c_contact');
         if ($c_tel2){
             $sql .= " AND (c_tel2 like '".$c_tel2."' OR c_tel1 like '".$c_tel2."')";
         }
@@ -156,11 +157,28 @@ class OrderService
                 $sql.=")";
             }
         }
-        if ($orderno)$sql.=" and orderno like '".$orderno."%'";
+//        if ($orderno)$sql.=" and orderno like '".$orderno."%'";
+        if ($orderno)$sql=$this->sqlSearchWay($sql,$orderno,'orderno');
         if ($codename_c&&$codename_c_end)$sql.=" and sostatus between '".$codename_c."' and '".$codename_c_end."'";
         if ($codename_c&&!$codename_c_end)$sql.=" and sostatus = '".$codename_c."'";
         if (!$codename_c&&$codename_c_end)$sql.=" and sostatus = '".$codename_c_end."'";
-        if ($carriername)$sql.=" and carriername like '".$carriername."%'";
+//        if ($carriername)$sql.=" and carriername like '".$carriername."%'";
+//        if ($carriername)$sql=$this->sqlSearchWay($sql,$carriername,'carriername');
+        if ($carriername){
+            if (!is_array($carriername))$arr = explode(',',$carriername);
+            else $arr = $carriername;
+            if (count($arr)>0) {
+                $sql.=" and carriername in (";
+                foreach ($arr as $index=>$str){
+                    if ($index==0){
+                        $sql.="'".$str."'";
+                        continue;
+                    }
+                    $sql.=",'".$str."'";
+                }
+                $sql.=")";
+            }
+        }
         if ($soreference1){
             $arr=array_values(array_filter(preg_split('/[,, ]+/is', $soreference1)));
             if (count($arr)==1){
@@ -178,7 +196,8 @@ class OrderService
                 $sql.=")";
             }
         }
-        if ($waveno)$sql.=" and WaveNo like '".$waveno."%'";
+//        if ($waveno)$sql.=" and WaveNo like '".$waveno."%'";
+        if ($waveno)$sql=$this->sqlSearchWay($sql,$waveno,'WaveNo');
         if ($issuepartyname)$sql.=" and issuepartyname like '".$issuepartyname."%'";
         if ($notes){
             if ($addtime&&$addtime!=0)$sql.=" and addtime >= to_date('".date('Y-m-d H:i:s',strtotime("-".$addtime." day"))."','yyyy-mm-dd hh24:mi:ss')";
@@ -213,12 +232,9 @@ class OrderService
                 $sql.=")";
             }
         }
-        if ($edisendflag2){
-            $sql.=" and edisendflag2 like '".$edisendflag2."%'";
-        }
-        if ($edisendflag){
-            $sql.=" and edisendflag like '".$edisendflag."%'";
-        }
+        if ($edisendflag2) $sql.=" and edisendflag2 like '".$edisendflag2."%'";
+
+        if ($edisendflag) $sql.=" and edisendflag like '".$edisendflag."%'";
         return $sql;
     }
 

+ 6 - 7
app/Services/OwnerAreaReportService.php

@@ -62,14 +62,13 @@ class OwnerAreaReportService
                     ->where("counting_month",'like',$area->counting_month."%")->first();
                 if ($report){
                     if (!$area->ownerStoragePriceModel)return false;
-                    $diff = $area->accounting_area>0 ? $area->accounting_area - $values["accounting_area"] : $values["accounting_area"];
-                    $diffAmount = app("OwnerStoragePriceModelService")->calculationAmount($area->ownerStoragePriceModel, $diff, $area->owner_id, $area->counting_month);
-                    if ($diffAmount != 0){
-                        $up = ["storage_fee"=>$report->storage_fee - $diffAmount];
-                        $initial = $report->initial_fee - ($report->storage_fee - $diffAmount);
-                        if ($report->confirm_fee !== null)$up["difference"] = $initial - $report->confirm_fee;
-                        $report->update($up);
+                    $storeFee = app("OwnerStoragePriceModelService")->calculationAmount($area->ownerStoragePriceModel, $values["accounting_area"], $area->owner_id, $area->counting_month);
+                    $up = ["storage_fee"=>$storeFee];
+                    if ($report->confirm_fee !== null || $report->confirmed == '是'){
+                        $initial = $report->work_fee + $report->logistic_fee + $storeFee;
+                        $up["difference"] = $initial - $report->confirm_fee;
                     }
+                    $report->update($up);
                 }
             }
             $area->update($values);

+ 2 - 2
app/Services/OwnerFeeDetailService.php

@@ -24,8 +24,8 @@ class OwnerFeeDetailService
             'worked_at_end' => ['alias' => 'worked_at', 'endDate' => ''],
             'owner_id' => ['multi' => ','],
             'id' => ['multi' => ','],
-            'operation_bill' => ['like' => ''],
-            'logistic_bill' => ['like' => ''],
+            'operation_bill' => ['batch' => ''],
+            'logistic_bill' => ['batch' => ''],
         ];
         if ($params["customer_id"] ?? false){
             $builder->whereHas('owner',function ($query)use(&$params){

+ 5 - 3
app/Services/OwnerPriceExpressService.php

@@ -292,9 +292,11 @@ sql
 
         $initPrice = $model->details[0]->initial_weight_price[$to1][$to2];
         $additionalPrice = $model->details[0]->additional_weight_price[$to1][$to2];
-        if ($weight <= $model->initial_weight)return $initPrice;
-        $weight -= $model->initial_weight;
-        $money = (ceil($weight/$model->additional_weight)*$additionalPrice)+$initPrice;
+        if ($weight <= $model->initial_weight)$money = $initPrice;
+        else{
+            $weight -= $model->initial_weight;
+            $money = (ceil($weight/$model->additional_weight)*$additionalPrice)+$initPrice;
+        }
         if ($model->tax_rate_id && $model->taxRate){
             $taxFee = $money*($model->taxRate->value/100);
         }else{

+ 6 - 2
app/Services/OwnerPriceOperationService.php

@@ -438,10 +438,10 @@ class OwnerPriceOperationService
             if ($result)$rule->unit_price = explode(",",$rule->discount_price)[key($result)]; //满足满减条件,单价调整为满减单价
 
             if ($rule->strategy=='起步'){
-                $money = $rule->unit_price;
                 $startNumber = $rule->amount;
-                if ($unitName && $startNumber && $unitName != $units[$rule->unit_id])return -3; //校验单位是否一致
+                $money = $startNumber ? $startNumber*$rule->unit_price : $rule->unit_price;
 
+                if ($unitName && $startNumber && $unitName != $units[$rule->unit_id])return -3; //校验单位是否一致
                 if ($startNumber)$matchObject=$this->settingCount($matchObject,$columnMapping[8],$startNumber);
                 if ($matchObject)foreach ($matchObject as $package)$money += $package[$columnMapping[8]] * $package["price"];
                 if (!$startNumber && $money<$rule->unit_price)$money = $rule->unit_price;
@@ -487,6 +487,10 @@ class OwnerPriceOperationService
             if ($package[$amountColumn] <= 0){
                 unset($packages[$i]);continue;
             }
+            if (!($package["price"] ?? false)){
+                $package["price"] = 0;
+                $packages[$i]["price"] = 0;
+            }
             if ($package["price"] > $maxPrice || ($package["price"]==0 && $maxPrice==0)){
                 $maxPrice = $package["price"];
                 $index = $i;

+ 13 - 2
app/Services/OwnerStoragePriceModelService.php

@@ -3,6 +3,7 @@
 namespace App\Services;
 
 use App\Order;
+use App\Owner;
 use App\OwnerReport;
 use App\OwnerStoragePriceModel;
 use App\Services\common\QueryService;
@@ -111,7 +112,7 @@ class OwnerStoragePriceModelService
     public function calculationAmount(OwnerStoragePriceModel $model, $area, $owner_id = null, $month = null)
     {
         /** @var \stdClass $model */
-        if (!$model || !$area || $model->operation) return 0;
+        if (!$model || !$area || $model->operation) return array(0,null);
         if ($area < $model->minimum_area) $area = $model->minimum_area;
         switch ($model->discount_type){
             case "按单减免":
@@ -154,6 +155,16 @@ class OwnerStoragePriceModelService
                 if ($total>=$model->amount_interval[$i])$model->price = $index;
             }
         }
-        return $area*$model->price[$index];
+        $money = $area>0 ? $area*$model->price[$index] : 0;
+        if ($model->taxRate)$taxFee = $money * ($model->taxRate->value/100);
+        else{
+            /** @var Owner|\stdClass $owner */
+            $owner = new Owner();
+            $owner->id = $owner_id;
+            $owner->load("taxRate");
+            if ($owner->taxRate)$taxFee = $money * ($owner->taxRate->value/100);
+            else $taxFee = null;
+        }
+        return array($money,$taxFee);
     }
 }

+ 2 - 1
app/Services/StationTaskMaterialBoxService.php

@@ -113,6 +113,7 @@ class StationTaskMaterialBoxService
         $stationType=$this->stationTypeService->getForMaterialBox_onBatchProcess();
         $stationTaskBatch=$this->stationTaskBatchService->get(['batch_id'=>$batch['id']])->first();
         $materialBoxIds_used=[];
+        $orderCommodities=$orderCommodities->sortBy('commodity_id');//按商品排序后,出货可以同商品挨在一起
         foreach ($orderCommodities as $orderCommodity){
             $station=$this->stationService->getStation_byType($stationType['name']);
             $materialBox=$this->materialBoxService->firstOrCreate(['code' => $orderCommodity['location']]);
@@ -194,7 +195,7 @@ class StationTaskMaterialBoxService
         }
     }
 
-    function processNextQueued(StationTaskMaterialBox $stationTaskMaterialBox_lastProcessed){
+    function processNextQueued(?StationTaskMaterialBox $stationTaskMaterialBox_lastProcessed){
         $station_id=$stationTaskMaterialBox_lastProcessed['station_id'];
         $stationTaskMaterialBox_next=StationTaskMaterialBox::query()
             ->where('station_id',$station_id)

+ 1 - 0
app/Services/WaybillService.php

@@ -125,6 +125,7 @@ class WaybillService
             'created_at_end' => ['alias' => 'created_at' , 'endDate' => ':59'],
             'uriType' => ['alias' => 'type'],
             'id' => ['multi' => ','],
+            'logistic_id' => ['multi' => ','],
         ];
         $waybills = app(QueryService::class)->query($param,$waybills,$columnQueryRules,"waybills");
         return $waybills;

+ 19 - 0
app/Traits/ModelSearchWay.php

@@ -23,4 +23,23 @@ trait ModelSearchWay
         }
         return $query;
     }
+
+    private function sqlSearchWay($sql,$condition,$column)
+    {
+        if ($condition){
+            if (strpos($condition, ',') || strpos($condition, ',') || strpos($condition, ' ')) {
+                $arr = array_filter(preg_split('/[,, ]+/is', $condition));
+                $sql .= ' and '.$column.' in (';
+                foreach ($arr as $index => $arr){
+                    if ($index != 0)$sql .= ',';
+                    $sql .= "'".$arr."'";
+                }
+                $sql .= ') ';
+                unset($condition);
+            } else {
+                $sql .= " and $column like '".$condition."' ";
+            }
+        }
+        return $sql;
+    }
 }

Разница между файлами не показана из-за своего большого размера
+ 238 - 155
composer.lock


+ 28 - 0
database/migrations/2021_04_27_162219_add_authority_rejected_index_general_update_is_loaded.php

@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddAuthorityRejectedIndexGeneralUpdateIsLoaded extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        \App\Authority::query()->firstOrCreate(["name" => "退货管理-查询-一般-修改入库"],["alias_name"=>"退货管理-查询-一般-修改入库"]);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        \App\Authority::query()->where('name', '退货管理-查询-一般-修改入库')->delete();
+    }
+}

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

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

+ 34 - 0
database/migrations/2021_05_11_094426_change_owner_bill_report_add_column_tax.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeOwnerBillReportAddColumnTax extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table("owner_bill_reports",function (Blueprint $table){
+           $table->decimal("storage_tax_fee",9,3)->nullable()->comment("仓储税费");
+           $table->decimal("other_tax_fee",9,3)->nullable()->comment("其他税费");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table("owner_bill_reports",function (Blueprint $table){
+            $table->dropColumn("storage_tax_fee");
+            $table->dropColumn("other_tax_fee");
+        });
+    }
+}

+ 35 - 0
database/migrations/2021_05_11_113944_add_procurement_authorities.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddProcurementAuthorities extends Migration
+{
+    protected $authorities = [
+        "采购管理-采购-提前确定",
+    ];
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        foreach ($this->authorities as $authority){
+            \App\Authority::query()->firstOrCreate(["name"=>$authority],["name"=>$authority,"alias_name"=>$authority]);
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        foreach ($this->authorities as $authority){
+            \App\Authority::query()->where("name",$authority)->delete();
+        }
+    }
+}

+ 2 - 0
laravel-echo-server.json

@@ -27,6 +27,8 @@
 	"protocol": "http",
 	"socketio": {},
 	"secureOptions": 67108864,
+	"sslCertPath": "",
+	"sslKeyPath": "",
 	"sslCertChainPath": "",
 	"sslPassphrase": "",
 	"subscribers": {

+ 4 - 3
resources/views/customer/project/create.blade.php

@@ -97,13 +97,13 @@
                     owner_group_id : "{{$owner->user_owner_group_id ?? ''}}",
                     user_workgroup_id : "{{$owner->user_workgroup_id ?? ''}}",
                     warehouse_id : "{{ $owner->warehouse_id ?? ''}}",
-                    tax_rate_id : "{{$owner->tax_rate_id ?? ''}}",
+                    tax_rate_id : "{{$owner->is_tax_exist}}"==='Y' ? '0' : "{{$owner->tax_rate_id ?? ''}}",
                     linkman : "{{$owner->linkman ?? ''}}",
                     phone_number : "{{$owner->phone_number ?? ''}}",
                     description : "{{$owner->description ?? ''}}",
                     waring_line_on : "{{$owner->waring_line_on ?? ''}}",
                     subjection : "{{$owner->subjection ?? ''}}",
-                    is_tax_exist : "{{$owner->is_tax_exist}}"=='Y',
+                    is_tax_exist : "{{$owner->is_tax_exist}}"==='Y',
                 },
                 ownerTemp : {},
                 customers : [
@@ -493,8 +493,9 @@
                     //if (!this.owner.tax_rate_id) error["tax_rate_id"] = ["必须选择税率"];
                     if (JSON.stringify(error) !== "{}"){
                         this.errors = error;
-                        return;
+                        return false;
                     }
+                    this.owner.is_tax_exist = this.owner.tax_rate_id==='0';
                     let url = "{{url('customer/project/projectUpdate')}}";
                     let params = this.owner;
                     let old = this.ownerTemp;

+ 4 - 4
resources/views/customer/project/part/_auditComparison.blade.php

@@ -216,7 +216,7 @@
                                     <td v-if="s.items.length>0">
                                         <table class="table table-sm">
                                             <tr><th v-for="(val,key) in auditList.mapping.operation.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.items">
+                                            <tr v-for="item in s.items" :class="item.operation=='C' ? 'bg-success' : (item.operation=='D' ? 'bg-danger' : '')">
                                                 <td v-for="(val,key) in auditList.mapping.operation.child" v-html="item[key]"></td>
                                             </tr>
                                         </table>
@@ -235,7 +235,7 @@
                                     <td v-if="s.details.length>0">
                                         <table class="table table-sm">
                                             <tr><th v-for="(val,key) in auditList.mapping.express.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
+                                            <tr v-for="item in s.details" :class="item.operation=='C' ? 'bg-success' : (item.operation=='D' ? 'bg-danger' : '')">
                                                 <td v-for="(val,key) in auditList.mapping.express.child" v-html="item[key]"></td>
                                             </tr>
                                         </table>
@@ -254,7 +254,7 @@
                                     <td v-if="s.details.length>0">
                                         <table class="table table-sm">
                                             <tr><th v-for="(val,key) in auditList.mapping.logistic.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
+                                            <tr v-for="item in s.details" :class="item.operation=='C' ? 'bg-success' : (item.operation=='D' ? 'bg-danger' : '')">
                                                 <td v-for="(val,key) in auditList.mapping.logistic.child" v-html="item[key]"></td>
                                             </tr>
                                         </table>
@@ -273,7 +273,7 @@
                                     <td v-if="s.details.length>0">
                                         <table class="table table-sm">
                                             <tr><th v-for="(val,key) in auditList.mapping.directLogistic.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
+                                            <tr v-for="item in s.details" :class="item.operation=='C' ? 'bg-success' : (item.operation=='D' ? 'bg-danger' : '')">
                                                 <td v-for="(val,key) in auditList.mapping.directLogistic.child" v-html="item[key]"></td>
                                             </tr>
                                         </table>

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

@@ -100,22 +100,22 @@
              :class="hover.express ? 'text-danger font-weight-bold text-shadow-stress' : ''">
             <div class="w-100 text-nowrap">
                 <label class="w-25 d-inline-block m-0 text-center">省</label>
-                <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*25+'%'}">
-                    首重价(@{{ (model.express.amount_interval[i+1]) ? (model.express.amount_interval[i]+'-'+model.express.amount_interval[i+1]) : (model.express.amount_interval[i]+' +') }}单)
+                <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*33+'%'}">
+                    首重价(@{{ (model.express.amount_interval[i+1]) ? (model.express.amount_interval[i]+'-'+model.express.amount_interval[i+1]) : (model.express.amount_interval[i]+' +') }}单)
                 </label>
-                <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*25+'%'}">
-                    续重价(@{{ (model.express.amount_interval[i+1]) ? (model.express.amount_interval[i]+'-'+model.express.amount_interval[i+1]) : (model.express.amount_interval[i]+' +') }}单)
+                <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*33+'%'}">
+                    续重价(@{{ (model.express.amount_interval[i+1]) ? (model.express.amount_interval[i]+'-'+model.express.amount_interval[i+1]) : (model.express.amount_interval[i]+' +') }}单)
                 </label>
-                <label v-if="!model.express.isInterval" class="w-25 d-inline-block m-0 text-center">首重价</label>
-                <label v-if="!model.express.isInterval" class="w-25 d-inline-block m-0 text-center">续重价</label>
+                <label v-if="!model.express.isInterval" class="w-25 d-inline-block m-0 text-center">首重价</label>
+                <label v-if="!model.express.isInterval" class="w-25 d-inline-block m-0 text-center">续重价</label>
             </div>
             <div class="w-100 text-nowrap" v-if="model.express.isInterval">
                 <label class="w-25 d-inline-block m-0 text-center"></label>
-                <label class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*25+'%'}">
+                <label class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*33+'%'}">
                     <label v-if="model.express.weight_interval[i].length>0" v-for="(weight,j) in model.express.weight_interval[i]" :style="{width:100/model.express.weight_interval[i].length+'%'}">重(@{{ model.express.weight_interval[i][j+1] ? (model.express.weight_interval[i][j]+'-'+model.express.weight_interval[i][j+1]) : (model.express.weight_interval[i][j]+' +') }}kg)</label>
                     <label v-if="model.express.weight_interval[i].length<=0" class="w-100">重(0 +kg)</label>
                 </label>
-                <label class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*25+'%'}">
+                <label class="d-inline-block m-0 text-center" v-for="(amount,i) in model.express.amount_interval" :style="{width:(model.express.weight_interval[i].length<1 ? 1 : model.express.weight_interval[i].length)*33+'%'}">
                     <label v-if="model.express.weight_interval[i].length>0" v-for="(weight,j) in model.express.weight_interval[i]" :style="{width:100/model.express.weight_interval[i].length+'%'}">重(@{{ model.express.weight_interval[i][j+1] ? (model.express.weight_interval[i][j]+'-'+model.express.weight_interval[i][j+1]) : (model.express.weight_interval[i][j]+' +') }}kg)</label>
                     <label v-if="model.express.weight_interval[i].length<=0" class="w-100">重(0 +kg)</label>
                 </label>
@@ -127,7 +127,7 @@
                             <option v-for="province in pool.provinces" :value="province.id">@{{ province.name }}</option>
                         </select>
                     </label>
-                    <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,j) in model.express.amount_interval" :style="{width:(model.express.weight_interval[j].length<1 ? 1 : model.express.weight_interval[j].length)*25+'%'}">
+                    <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,j) in model.express.amount_interval" :style="{width:(model.express.weight_interval[j].length<1 ? 1 : model.express.weight_interval[j].length)*33+'%'}">
                         <label v-for="(weight,k) in model.express.weight_interval[j]" :style="{width:100/model.express.weight_interval[j].length+'%'}">
                             <input type="number" step="0.01" min="0" :class="errors['items.'+i+'.initial_weight_price.'+j+'.'+k] ? 'is-invalid' : ''" class="form-control form-control-sm" v-model="item.initial_weight_price[j][k]">
                         </label>
@@ -135,7 +135,7 @@
                             <input type="number" step="0.01" min="0" :class="errors['items.'+i+'.initial_weight_price.'+j+'.0'] ? 'is-invalid' : ''" class="form-control form-control-sm" v-model="model.express.items[i]['initial_weight_price'][j][0]">
                         </label>
                     </label>
-                    <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,j) in model.express.amount_interval" :style="{width:(model.express.weight_interval[j].length<1 ? 1 : model.express.weight_interval[j].length)*25+'%'}">
+                    <label v-if="model.express.isInterval" class="d-inline-block m-0 text-center" v-for="(amount,j) in model.express.amount_interval" :style="{width:(model.express.weight_interval[j].length<1 ? 1 : model.express.weight_interval[j].length)*33+'%'}">
                         <label v-for="(weight,k) in model.express.weight_interval[j]" :style="{width:100/model.express.weight_interval[j].length+'%'}">
                             <input type="number" :class="errors['items.'+i+'.additional_weight_price.'+j+'.'+k] ? 'is-invalid' : ''" step="0.01" min="0" class="form-control form-control-sm" v-model="item.additional_weight_price[j][k]">
                         </label>

+ 2 - 0
resources/views/customer/project/part/_three.blade.php

@@ -78,6 +78,7 @@
                                     <label>@{{ operation.name }}</label><span class="badge badge-pill badge-danger" v-if="operation.isRejected">退</span>
                                     <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
                                     <label v-if="operation.surcharge">耗材附加费:<b>@{{ operation.surcharge }}</b>/@{{ poolMapping.units ? poolMapping.units[operation.surcharge_unit_id] : '' }}</label>
+                                    <label v-if="operation.max_fee">封顶费:<b>@{{ operation.max_fee }}</b></label>
                                     <label v-if="operation.tax_rate_id">税率:@{{ poolMapping.taxRates ? poolMapping.taxRates[operation.tax_rate_id] : '' }}</label>
                                 </div>
                                 <div class="col-1">
@@ -126,6 +127,7 @@
                                     <label>@{{ operation.name }}</label>
                                     <label v-if="operation.remark" class="text-secondary">&nbsp;&nbsp;(@{{ operation.remark }})</label>
                                     <label v-if="operation.surcharge">耗材附加费:<b>@{{ operation.surcharge }}</b>/@{{ poolMapping.units ? poolMapping.units[operation.surcharge_unit_id] : '' }}</label>
+                                    <label v-if="operation.max_fee">封顶费:<b>@{{ operation.max_fee }}</b></label>
                                     <label v-if="operation.tax_rate_id">税率:@{{ poolMapping.taxRates ? poolMapping.taxRates[operation.tax_rate_id] : '' }}</label>
                                 </div>
                                 <div class="col-1">

+ 2 - 5
resources/views/customer/project/part/_two.blade.php

@@ -46,17 +46,14 @@
 <div class="row mt-3">
     <label for="tax_rate_id" class="col-2">税率</label>
     <select id="tax_rate_id" v-model="owner.tax_rate_id" class="form-control form-control-sm col-4 mb-0" :class="errors.tax_rate_id ? 'is-invalid' : ''" >
-        <option> </option>
+        <option value=""> </option>
+        <option value="0">子模型必填</option>
         <option v-for="taxRate in pool.taxRates" :value="taxRate.id">@{{ taxRate.value }}%</option>
     </select>
     <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.tax_rate_id">
         <strong>@{{ errors.tax_rate_id[0] }}</strong>
     </span>
 </div>
-<div class="row mt-3">
-    <label for="is_tax_exist" class="col-2">子模型必填税率</label>
-    <input type="checkbox" class="switch" id="is_tax_exist" v-model="owner.is_tax_exist">
-</div>
 <div class="row mt-3">
     <label for="waring_line_on" class="col-2">月单量预警</label>
     <input type="number" v-model="owner.waring_line_on" id="waring_line_on" class="form-control form-control-sm col-3 mb-0" :class="errors.waring_line_on ? 'is-invalid' : ''">

+ 4 - 4
resources/views/finance/instantBill.blade.php

@@ -152,11 +152,11 @@
                         {name:'worked_at_start',type:'dateTime',tip:'起始作业日期'},
                         {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的项目'],
                             placeholder:['项目','定位或多选项目'],data:this.owners},
-                        {name: 'operation_bill', type: 'input', tip: '发/收/退/提货单号:可在两侧增加百分号(%)进行模糊搜索', placeholder: '单据号'},
+                        {name: 'operation_bill', type: 'input', tip: '可支持多发/收/退/提货单号:模糊搜索可在两侧增加百分号(%)进行', placeholder: '单据号'},
                     ],[
                         {name:'customer_id',type:'select',tip:'客户',placeholder: '客户',data:this.customers},
                         {name:'worked_at_end',type:'dateTime',tip:'结束作业日期'},
-                        {name:'logistic_bill', type: 'input', tip: '物流/快递单号:可在两侧增加百分号(%)进行模糊搜索', placeholder: '快递单号'},
+                        {name:'logistic_bill', type: 'input', tip: '可支持多物流/快递单号,模糊搜索可在两侧增加百分号(%)进行', placeholder: '快递单号'},
                         {name:'type',type:'select',tip:'类型',placeholder: '类型',data:this.types},
                     ],
                 ];
@@ -195,7 +195,7 @@
                     before:[
                         {colspan:'2',value: ''},
                         {colspan:'9',value: '单据信息', class:"bg-light-info"},
-                        {colspan:'4',value: '物流作业信息', class:"bg-light-khaki"},
+                        {colspan:'5',value: '物流作业信息', class:"bg-light-khaki"},
                         {colspan:'4',value: '费用信息', class:"bg-light-cyanogen"},
                     ],
                 }).init();
@@ -225,4 +225,4 @@
             },
         });
     </script>
-@stop
+@stop

+ 2 - 2
resources/views/maintenance/role/edit.blade.php

@@ -35,7 +35,7 @@
                     <div class="form-group row">
                         <label for="authority" class="col-2 col-form-label text-md-right">允许权限</label>
                         <div class="col-8">
-                            <input type="text"  class="form-control tooltipTarget" placeholder="定位权限"
+                            <input @keydown.enter.prevent="false" type="text"  class="form-control tooltipTarget" placeholder="定位权限"
                                    @input="seekAuthority($event)" title="输入关键词快速定位下拉列表"></div>
                     </div>
                     <div class="form-group row">
@@ -66,7 +66,7 @@
                     <div class="form-group row">
                         <label for="authority" class="col-2 col-form-label text-md-right">禁止权限</label>
                         <div class="col-8">
-                            <input type="text"  class="form-control tooltipTarget" placeholder="定位权限"
+                            <input @keydown.enter.prevent="false" type="text"  class="form-control tooltipTarget" placeholder="定位权限"
                                    @input="seekAuthority($event)" title="输入关键词快速定位下拉列表"></div>
                     </div>
                     <div class="form-group row">

+ 43 - 5
resources/views/order/index/delivering.blade.php

@@ -28,6 +28,7 @@
                         <button type="button" @click="thaw(null,true)" class="btn btn-sm btn-outline-danger tooltipTarget ml-1" title="解除已冻结订单" style="opacity: 0.7">解冻</button>
                         <span class="btn btn-sm btn-outline-dark tooltipTarget ml-1" @click="deAllocationAll" style="cursor: pointer"  title="订单的取消分配条件要只局限在“分配完成”或“部分分配”">取消分配</span>
                         <button type="button" @click="resetLogisticsGetMark()" class="btn btn-sm ml-1 btn-outline-success">重置快递获取标记</button>
+                        <button type="button" @click="resetInterfaceReturnMark()" class="btn btn-sm ml-1 btn-outline-secondary">重置接口回传标记</button>
                     @endcan
                     @can('订单管理-订单-生成问题件')<button  @click="orderIssueTag()" type="button" class="btn btn-sm ml-1 btn-outline-primary">标记问题件</button>@endcan
                     @can('订单管理-订单-生成退货单')
@@ -241,6 +242,11 @@
                     { name:'{{$customer->customerid}}',value:'{{$customer->descr_c}}' },
                     @endforeach
                 ],
+                logistics:[
+                        @foreach($logistics as $logistic)
+                    { name:'{{$logistic->name}}',value:'{{$logistic->name}}' },
+                    @endforeach
+                ],
                 orders:{!! $orders !!},
                 commodities:{!! $commodities !!},
                 content:'',
@@ -285,13 +291,15 @@
                     [   {name:'codename_c',type:'select',placeholder:'订单状态',data:this.codes},
                         {name:'orderdate_start',type:'time',tip:['选择显示日期的起始时间','选择显示日期的起始时间'],
                             rules:{date_relevance:{date:['orderdate_start','orderdate_end'],relevance:'addtime',killing:'relevance',default:[31,92,183,366]}}},
-                        {name:'orderno',type:'input',tip:'SO号,糊模查找需要在左边打上%符号',placeholder: 'SO号'},
-                        {name:'carriername',type:'input',tip:'',placeholder:'承运人'},
+                        {name:'orderno',type:'input',tip:'可支持多SO号,糊模查找需要在左边打上%符号',placeholder: 'SO号'},
+                        // {name:'carriername',type:'input',tip:'可支持多承运人,糊模查找需要在左边打上%符号',placeholder:'承运人'},
+                        {name:'carriername',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的承运人'],
+                            placeholder:['承运人','定位或多选承运人'],data:this.logistics},
                         {name:['notes','addtime'],type:'input_select',tip:['右侧选择查询范围,默认为一月内','查询范围,范围越短搜索越快'],placeholder: ['备注',''],
                             data:[{name:'31',value:'近一月'},{name:'92',value:'近三月'},{name:'183',value:'近半年'},{name:'366',value:'近一年'},{name:'0',value:'不限'},],
                             rules:{son:{addtime:{default:'31',required_without_all_if:['orderdate_start','orderdate_end']}},
                                 date_relevance:{date:['orderdate_start','orderdate_end'],relevance:'addtime',killing:'date',default:[31,92,183,366]}}},
-                        {name:'issuepartyname',type:'input',tip:'',placeholder: '店铺名称'},
+                        {name:'issuepartyname',type:'input',tip:'糊模查找需要在左边打上%符号',placeholder: '店铺名称'},
                         {name:'edisendflag2',type:'select',tip:'快递获取标记',placeholder: '快递获取标记',data:[{name:'Y',value:'是'},{name:'N',value:'否'},{name:'W',value:'错误'},]},
                         {name:'edisendflag',type:'select',tip:'接口回传标记',placeholder: '接口回传标记',data:[{name:'Y',value:'Y'},{name:'N',value:'N'},{name:'W',value:'W'},{name:'R',value:'R'},]}
                     ],
@@ -303,9 +311,9 @@
                             placeholder:['货主','定位或多选货主'],data:this.owners},
                         {name:'soreference5',type:'input',tip:'可支持多快递单号,糊模查找需要在左边打上%符号',placeholder: '多快递单号'},
                         {name:'soreference1',type:'input',tip:'客户订单号,糊模查找需要在左边打上%符号',placeholder: '客户订单号'},
-                        {name:'waveno',type:'input',tip:'波次编号,模糊查找需要在左边打上%的符号',placeholder: '波次编号'},
+                        {name:'waveno',type:'input',tip:'可支持多波次编号,模糊查找需要在左边打上%的符号',placeholder: '波次编号'},
                         {name:'alternate_sku1',type:'input',tip:'产品条码,模糊查找需要在左边打上%的符号',placeholder: '产品条码'},
-                        {name:'c_contact',type:'input',tip:'收货人名称:15天以内模糊搜索,15天以外精确搜索',placeholder:'收货人名称'},
+                        {name:'c_contact',type:'input',tip:'可支持多收货人名称:15天以内模糊搜索,15天以外精确搜索',placeholder:'收货人名称'},
                     ],
                     [
                         {name:'c_tel2',type:'input',tip:'收货人电话:15天以内模糊搜索,15天以外精确搜索',placeholder:'收货人电话'},
@@ -675,6 +683,36 @@
                         tempTip.show("网络错误:"+err)
                     })
                 },
+                resetInterfaceReturnMark(){
+                    if (checkData.length < 1){
+                        tempTip.setDuration(3000);
+                        tempTip.showSuccess('未选择任何单号');
+                        return
+                    }
+                    if (!confirm('确定要重置接口回传标记吗?'))return;
+                    let url = '{{url('order/resetInterfaceReturnMark')}}';
+                    let _this = this;
+                    axios.post(url,{orderno : checkData}).then(function (response) {
+                        if (response.data.success){
+                            checkData.forEach(orderno => {
+                                _this.orders.some(order => {
+                                    if (order.orderno === orderno){
+                                        order.edisendflag  = "N";
+                                        return true;
+                                    }
+                                });
+                            });
+                            tempTip.setDuration(2000);
+                            tempTip.showSuccess('重置接口回传标记成功!');
+                        } else{
+                            tempTip.setDuration(5000);
+                            tempTip.show(response.data.fail_info);
+                        }
+                        }).catch(function (err) {
+                            tempTip.setDuration(3000);
+                            tempTip.show("网络错误:"+err)
+                       });
+                },
                 changeRemark(){
                     this.typeId ='';
                     this.result_explain ='';

+ 23 - 36
resources/views/order/issue/index.blade.php

@@ -960,7 +960,9 @@
                     {
                         name:{{$item->id}}, value: '{{$item->name}}'
                     },
-                    @endforeach],
+                    @endforeach
+                    {name:'空',value:'空'},
+                    ],
                 userOwnerGroups:{!! $userOwnerGroups !!},
                 rejectingStatus: [
                     {name: '无', value: '无'},
@@ -1051,12 +1053,12 @@
                         placeholder: ['货主', '定位或多选货主'],
                         data: _this.owners
                     },
-                    {name: 'client_code', type: 'input', tip: '原始订单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '原始订单号'},
+                    {name: 'client_code', type: 'input', tip: '可支持多客户订单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '客户订单号'},
                     {
                         name: 'logistic_number',
                         type: 'input',
-                        tip: ['输入原始运单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索'],
-                        placeholder: '运单号'
+                        tip: ['可支持原始运单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索'],
+                        placeholder: '原始运单号'
                     },
                     {
                         name: 'logistic_id',
@@ -1068,7 +1070,7 @@
                     {
                         name: 'logistic_number_return',
                         type: 'input',
-                        tip: '退回单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索',
+                        tip: '可支持多退回单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索',
                         placeholder: '退回单号'
                     },
                     // {name: 'send_client_code', type: 'input', tip: '二次订单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '二次订单号'},
@@ -1087,29 +1089,20 @@
                             }
                         }]
                     },
-                ], [
-                    {name: 'created_at_end', type: 'dateTime', tip: '登记结束日期'},
-                    {
-                        name: 'consignee_name',
-                        type: 'input',
-                        tip: '收货人名称:前或后加百分号为单个模糊搜索,否则为多条件精确搜索',
-                        placeholder: '收货人名称'
-                    },
                     {
-                        name: 'consignee_phone',
-                        type: 'input',
-                        tip: '收货人电话:前或后加百分号为单个模糊搜索,否则为多条件精确搜索',
-                        placeholder: '收货人电话'
-                    },
-                    {name: 'good_barcode', type: 'input', tip: '条码:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '条码'},
-                    {name: 'good_name', type: 'input', tip: '商品名:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '商品名'},
-                    {
-                        name: 'id_quality_label',
+                        name: 'user_owner_group_id',
                         type: 'select',
-                        tip: '是否正品',
-                        placeholder: '是否正品',
-                        data: this.qualityLabel
+                        tip: '项目责任方',
+                        placeholder: '项目责任方',
+                        data: this.userOwnerGroups
                     },
+                ], [
+                    {name: 'created_at_end', type: 'dateTime', tip: '登记结束日期'},
+                    {name: 'consignee_name', type: 'input', tip: '可支持多收货人名称:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '收货人名称'},
+                    {name: 'consignee_phone', type: 'input', tip: '可支持多收货人电话:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '收货人电话'},
+                    {name: 'good_barcode', type: 'input', tip: '可支持多条码:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '条码'},
+                    {name: 'good_name', type: 'input', tip: '可支持多商品名:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '商品名'},
+                    {name: 'id_quality_label', type: 'select', tip: '是否正品', placeholder: '是否正品', data: this.qualityLabel},
                     {name: 'is_imported', type: 'select', tip: '是否导入处理', placeholder: '是否导入处理', data: imported_status},
                     {
                         name: 'user_workgroups',
@@ -1163,8 +1156,6 @@
                         }]
                     },
                     // {date_relevance:{date:['orderdate_start','orderdate_end'],relevance:'addtime',killing:'date',default:[31,92,183,366]}}]},
-                    {name: 'custom_code', type: 'input', tip: '自定义订单号:自定义订单号', placeholder: '自定义订单号'},
-                    {name: 'is_handle', type: 'checkbox', tip: '是否已处理', data: [{name: 'ture', value: '已解决'}]},
                     {
                         name: 'finance_confirm',
                         type: 'select',
@@ -1192,20 +1183,16 @@
                     },
                     {name: 'sendOrderClientCode', type: 'input', tip: '二次客户订单号', placeholder: '二次客户订单号'},
                     {name: 'sendOrderLogisticNumber', type: 'input', tip: '二次运单号', placeholder: '二次运单号'},
-                    {
-                        name: 'user_owner_group_id',
-                        type: 'select',
-                        tip: '项目责任方',
-                        placeholder: '项目责任方',
-                        data: this.userOwnerGroups
-                    },
+                    {name: 'custom_code', type: 'input', tip: '自定义订单号:自定义订单号', placeholder: '自定义订单号'},
                 ],
-                    @cannot('订单管理-问题件-客户不可见')
+
                     [
+                            @cannot('订单管理-问题件-客户不可见')
                         {name: 'archive_at_start', type: 'dateTime', tip: '归档起始日期'},
                         {name: 'archive_at_end', type: 'dateTime', tip: '归档结束日期'},
+                            @endcannot
+                        {name: 'is_handle', type: 'checkbox', tip: '是否已处理', data: [{name: 'ture', value: '已解决'}]},
                     ]
-                    @endcannot
                 ];
                 this.form = new query({
                     el: '#form_div',

+ 1 - 1
resources/views/order/wave/search.blade.php

@@ -139,7 +139,7 @@
                 let data = [[
                     {name: 'start_time', type: 'dateTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
                     {name: 'end_time', type: 'dateTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
-                    {name: 'wave_num', type: 'input', tip: '波次编号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: ''},
+                    {name: 'wave_num', type: 'input', tip: '波次编号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: '波次编号'},
                 ]];
                 this.form = new query({
                     el: '#form_div',

+ 62 - 2
resources/views/package/logistic/index.blade.php

@@ -60,12 +60,33 @@
                         <div @click="showRoute(i)" v-if="package.transfer_status && package.transfer_status.length > 1">
                             <label class="text-center mt-0 p-0 cursor-pointer pull-left">
                                 <span class="fa"
-                                      :class="package.isShowRoute ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>
+                                      :class="package.isShowTransferStatus ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>
                                 &nbsp;<span v-if="package.transfer_status && showList[i]">收起</span><span
                                     v-else>展开</span>&nbsp;@{{ package.transfer_status.length }} 条
                             </label>
                         </div>
                     </td>
+                    <td @mouseover="remarkHover = package.id" @mouseleave="remarkHover=null;remark=null;isShowRemarkInput = false">
+                        <button @click="isShowRemarkInput = true" v-if="remarkHover===package.id">新增</button>
+                        <input @keydown.enter="submitRemark(package)" v-if="isShowRemarkInput && remarkHover===package.id" type="text" v-model="remark">
+                        <div v-if="package.remark && package.remark.length>0"
+                             class="text-overflow-warp-200 up" :id="'remark-'+i">
+                            <p v-for="remark_item in package.remark">
+                                @{{ remark_item }}
+                            </p>
+                        </div>
+                        <div class="text-overflow-warp-200 " v-if=" package.remark && !showRemarkList[i] && package.remark.length > 0">
+                            @{{ package.remark[0] }}
+                        </div>
+                        <div @click="showRemarkItem(i)" v-if="package.remark && package.remark.length > 1">
+                            <label class="text-center mt-0 p-0 cursor-pointer pull-left">
+                                <span class="fa"
+                                      :class="package.isShowRemark ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>
+                                &nbsp;<span v-if="package.remark && showRemarkList[i]">收起</span><span
+                                    v-else>展开</span>&nbsp;@{{ package.remark.length }} 条
+                            </label>
+                        </div>
+                    </td>
                     <td class="text-overflow-warp-200"><span v-if="package.order && package.order.issue">@{{ package.order.issue.result_explain }}</span>
                     </td>
                     <td class="text-overflow-warp-200"><span
@@ -115,6 +136,7 @@
                     @endforeach
                 ],
                 showList: {},
+                showRemarkList: {},
                 selectTr: 0,
                 exception_types: [
                     '疑似库内丢件',
@@ -127,10 +149,15 @@
                 ],
                 exception_editable: @can('包裹管理-快递-异常类型-编辑') true @else false  @endcan,
                 selectedExceptionType: '修改异常类型',
-                batchExceptionType: null
+                batchExceptionType: null,
+                remarkHover: null,
+                remark: null,
+                isShowRemarkInput: false
             },
             created() {
                 $.each(this.packages, function (index, item) {
+                    item.isShowTransferStatus = false;
+                    item.isShowRemark = false;
                     if (item.transfer_status != null && item.transfer_status.length > 1) {
                         item.transfer_status.sort(function (item1, item2) {
                             let date1 = new Date(item1.accept_time);
@@ -243,6 +270,7 @@
                     {name:'received_at',value: '收货日期'},
                     {name:'weighed_at',value: '称重日期'},
                     {name:'transfer_status',value: '快递路由'},
+                    {name:'remark',value: '客服备注'},
                     {name:'result_explain',value: '情况说明'},
                     {name:'issue_type',value: '问题类别'},
                     {name:'content',value: '说明'},
@@ -260,6 +288,7 @@
             },
             methods: {
                 showRoute(id) {
+                    // item.isShowTransferStatus = true;
                     if (this.showList[id]) {
                         this.$set(this.showList, id, false);
                         $("#route-" + id).slideUp();
@@ -269,6 +298,17 @@
                     }
                     this.$forceUpdate();
                 },
+                showRemarkItem(id) {
+                    // item.isShowTransferStatus = true;
+                    if (this.showRemarkList[id]) {
+                        this.$set(this.showRemarkList, id, false);
+                        $("#remark-" + id).slideUp();
+                    } else {
+                        this.$set(this.showRemarkList, id, true);
+                        $("#remark-" + id).slideDown();
+                    }
+                    this.$forceUpdate();
+                },
                 updateExceptionType(orderPackages) {
                     let url = '{{ url("package/logistic") }}' + '/' + orderPackages.id;
                     let data = {id: orderPackages['id'], exception_type: orderPackages.exception_type}
@@ -289,6 +329,26 @@
                         tempTip.setDuration(1000);
                         tempTip.showSuccess('批量更新异常类型成功');
                     })
+                },
+                submitRemark(orderPackage) {
+                    if (this.remark===null){
+                        return
+                    }
+                    let url = '{{url('apiLocal/package/logistic/')}}';
+                    let _this = this;
+                    axios.put(url,{remark:_this.remark,orderPackageId:orderPackage.id}).then(function (response) {
+                        if (response.data.success){
+                            orderPackage.remark = response.data.data
+                            tempTip.setDuration(2000);
+                            tempTip.showSuccess('成功!');
+                        } else{
+                            tempTip.setDuration(5000);
+                            tempTip.show(response.data.fail_info);
+                        }
+                    }).catch(function (err) {
+                        tempTip.setDuration(3000);
+                        tempTip.show("网络错误:"+err)
+                    });
                 }
             },
             filters: {

+ 1 - 1
resources/views/personnel/discharge/statement/index.blade.php

@@ -71,7 +71,7 @@
                     },
                     {name: 'created_at_start', type: 'dateTime', tip: '创建开始日期'},
                     {name: 'created_at_end', type: 'dateTime', tip: '创建结束日期'},
-                    {name: 'numbers', type: 'input', tip: '入库单号', placeholder: '入库单号'},
+                    {name: 'numbers', type: 'input', tip: '可支持多入库单号,模糊搜索可在两侧增加百分号(%)进行', placeholder: '入库单号'},
                     {name: 'status', type: 'select', tip: '状态', data: status, placeholder: '状态'},
                 ], [
                     {

+ 1 - 1
resources/views/personnel/discharge/task/index.blade.php

@@ -99,7 +99,7 @@
                     },
                     {name: 'created_at_start', type: 'dateTime', tip: '创建开始日期'},
                     {name: 'created_at_end', type: 'dateTime', tip: '创建结束日期'},
-                    {name: 'numbers', type: 'input', tip: '入库单号',placeholder:'入库单号'},
+                    {name: 'numbers', type: 'input', tip: '可支持多入库单号,模糊搜索可在两侧增加百分号(%)进行',placeholder:'入库单号'},
                     {name: 'status', type: 'select', tip: '状态' , data: _this.status,placeholder:'状态'},
                     {name: 'income_remark', type: 'input', tip: '备注' , data: _this.status,placeholder:'备注'}
                 ]];

+ 4 - 4
resources/views/personnel/laborReport/index.blade.php

@@ -439,14 +439,14 @@
                                 placeholder:['小组','定位或多选小组'],data:this.userWorkGroups},
                             {name:'labor_company_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的劳务所'],
                                 placeholder:['劳务所','定位或多选劳务所'],data:this.laborCompanies},
-                            {name:'enter_number',type:'input',tip:'进场编号:支持15天内模糊搜索,15天外精确搜索',placeholder: '进场编号'},
+                            {name:'enter_number',type:'input',tip:'可支持多进场编号:支持15天内模糊搜索',placeholder: '进场编号'},
                             {name:'is_export',type:'checkbox',data:[{name:true,value:'显示已退场'}]},
                         ],
                         [
                             {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
-                            {name:'name',type:'input',tip:'',placeholder: '姓名'},
-                            {name:'mobile_phone',type:'input',tip:'',placeholder: '电话号'},
-                            {name:'identity_number',type:'input',tip:'',placeholder: '身份证号'},
+                            {name:'name',type:'input',tip:'可支持多姓名,模糊搜索可在两侧增加百分号(%)进行',placeholder: '姓名'},
+                            {name:'mobile_phone',type:'input',tip:'可支持多电话号,模糊搜索可在两侧增加百分号(%)进行',placeholder: '电话号'},
+                            {name:'identity_number',type:'input',tip:'可支持多身份证号:支持15天内模糊搜索',placeholder: '身份证号'},
                         ],
                     ];
                     this.form = new query({

+ 1 - 1
resources/views/procurement/procurement/_addQuantity.blade.php

@@ -2,7 +2,7 @@
     <div class="modal-dialog modal-lg modal-dialog-centered">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title text-center">添加采购数量和销售数量</h5>
+                <h5 class="modal-title text-center">完善采购数量和销售数量</h5>
                 <button type="button" class="close" data-dismiss="modal">
                     <span>&times;</span>
                 </button>

+ 75 - 31
resources/views/procurement/procurement/index.blade.php

@@ -66,19 +66,39 @@
                 <td>
                     <input class="checkItem" type="checkbox" :value="procurement.id">
                 </td>
-                <td><span>@{{ procurement.code }}</span></td>
+                <td><span class="text-center">@{{ procurement.code }}</span></td>
                 <td>
+                    <span v-if="procurement_status[procurement.status]!='订单取消'">
+                        <span class="btn btn-sm btn-outline-secondary" v-if="procurement.status<3"
+                              @click="cancel(procurement.id,procurement.type,procurement.code)">取消</span>
+                         @can('采购管理-采购-提前确定')
+                        <span class="btn btn-sm btn-outline-success" v-if="procurement_type[procurement.type]=='询价单' && procurement.status==1"
+                              @click="initiateProcurement(procurement)">发起采购</span>
+                        <span class="btn btn-sm btn-outline-info" v-if="procurement_type[procurement.type]=='采购单' && procurement.status==1"
+                              @click="initiateProcurement(procurement)">提前确定</span>
+                        @else
+                            <span class="btn btn-sm btn-outline-success" v-if="procurement_type[procurement.type]=='询价单' && procurement.isFinishEnquiry"
+                                  @click="initiateProcurement(procurement)">发起采购</span>
+{{--                            <span class="btn btn-sm btn-outline-info" v-if="procurement_type[procurement.type]=='采购单' && procurement.status==1"--}}
+{{--                                  @click="initiateProcurement(procurement)">提前确定</span>--}}
+                        @endcan
+                    </span>
+                </td>
+                <td class="text-center">
+                    <span :class="[procurement.type==1?'text-info font-weight-bold':procurement.type==2?'text-success font-weight-bold':'']">@{{ procurement_type[procurement.type] }}</span>
+                </td>
+                <td class="text-center">
                     <span :class="[procurement.status==10?'text-danger font-weight-bold':procurement.status==9?'text-success font-weight-bold':'']"  >@{{ procurement_status[procurement.status] }}</span>
                 </td>
-                <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</span></td>
-                <td>@{{ procurement_type[procurement.type] }}</td>
+
+                <td class="text-center text-muted"><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</span></td>
 {{--                <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.company_name:'' }}</span></td>--}}
-                <td class="tooltipTarget" style="max-width: 200px;overflow:hidden"><span v-if="procurement.owner_material">@{{ procurement.owner_material.material_code }}</span></td>
-                <td><span v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.name }}</span></td>
-                <td><span v-if="procurement.owner_material">@{{ procurement.owner_material.size }}</span></td>
-                <td><span v-if="procurement.owner_material">@{{ procurement.owner_material.special }}</span></td>
-                <td><span v-if="procurement.owner_material">@{{ procurement.owner_material.specification }}</span></td>
-                <td>
+                <td class="tooltipTarget text-center" style="max-width: 200px;overflow:hidden"><span v-if="procurement.owner_material">@{{ procurement.owner_material.material_code }}</span></td>
+                <td class="text-center text-muted"><span v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.name }}</span></td>
+                <td class="text-center"><span v-if="procurement.owner_material">@{{ procurement.owner_material.size }}</span></td>
+                <td class="text-center text-muted"><span v-if="procurement.owner_material">@{{ procurement.owner_material.special }}</span></td>
+                <td class="text-center"><span v-if="procurement.owner_material">@{{ procurement.owner_material.specification }}</span></td>
+                <td class="text-center">
                     <div class="align-center text-center" >
                             <span v-if="procurement.owner_material.file">
                         <a target='_blank' :href="getDownFileUrl(procurement.owner_material)" class="text-primary text-decoration is-hover"  style="cursor: default" >
@@ -88,27 +108,31 @@
                             <span v-else>-</span>
                     </div>
                 </td>
-                <td>
+{{--                <td>--}}
 {{--                    <span v-if="procurement_type[procurement.type]=='询价单' && procurement.supplier" >@{{ procurement.supplier.name ??  '' }}</span>--}}
-                    <span  v-if="procurement.supplier">@{{ procurement.supplier.name ??  '' }}</span>
+{{--                    <span  v-if="procurement.supplier">@{{ procurement.supplier.name ??  '' }}</span>--}}
+{{--                </td>--}}
+                <td class="text-center" style="min-width: 80px">
+                    <div :class="procurement.procurement_quotations&&procurement.procurement_quotations.length==1 ? '' : 'up'" :id="'procurement_quotation-'+i">
+                        <div v-for="procurement_quotation in procurement.procurement_quotations" class="row">
+                            <div class="col-6  border border-1"><span v-if="procurement_quotation.supplier">@{{ procurement_quotation.supplier.name }}</span></div>
+                            <div class="col-6 border border-1">@{{ procurement_quotation.offer }}</div>
+                        </div>
+                    </div>
+                    <div class="row text-center cursor-pointer" v-if="procurement.procurement_quotations&&procurement.procurement_quotations.length>1">
+                        <b @click="unfold(i)" class="col-12 cursor-pointer" v-if="!upList[i]">共有 @{{ procurement.procurement_quotations.length }} 家报价,<template v-for="(item,i) in procurement.procurement_quotations">价格@{{ i+1 }}:@{{ item.offer }}&nbsp</template>点击展开</b>
+                        <b class="col-12" @click="unfold(i)" v-else>点击收起明细</b>
+                    </div>
                 </td>
-                <td>@{{ procurement.quantity }}</td>
-                <td>
+                <td class="text-center">@{{ procurement.quantity }}</td>
+{{--                <td>--}}
 {{--                    <span v-if="procurement_type[procurement.type]=='询价单'">@{{ procurement.cost_price }}</span>--}}
-                    <span >@{{ procurement.cost_price }}</span>
-                </td>
-                <td><span>@{{ procurement.unit_price }}</span></td>
-                <td><span v-if="procurement.deliver_amount">@{{ procurement.deliver_amount }}</span></td>
-                <td><span>@{{ procurement.quantity*procurement.unit_price }}</span></td>
-                <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.phone:'' }}</span></td>
-                <td>
-                    <span v-if="procurement_status[procurement.status]!='订单取消'">
-                        <span class="btn btn-sm btn-outline-danger" v-if="procurement.status<3"
-                              @click="cancel(procurement.id,procurement.type,procurement.code)">取消</span>
-                        <span class="btn btn-sm btn-outline-success" v-if="procurement_type[procurement.type]=='询价单' && procurement.isFinishEnquiry"
-                              @click="initiateProcurement(procurement)">发起采购</span>
-                    </span>
-                </td>
+{{--                    <span >@{{ procurement.cost_price }}</span>--}}
+{{--                </td>--}}
+                <td class="text-center"><span>@{{ procurement.unit_price }}</span></td>
+                <td class="text-center"><span v-if="procurement.deliver_amount">@{{ procurement.deliver_amount }}</span></td>
+                <td class="text-center"><span>@{{ procurement.quantity*procurement.unit_price }}</span></td>
+                <td class="text-muted"><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.phone:'' }}</span></td>
             </tr>
         </table>
         <div class="text-info h5 btn btn">{{$procurements->count()}}/@{{ sum }}</div>
@@ -173,8 +197,10 @@
                 errors: {},
                 selectTr:'',
                 createdProcurement:{},
+                upList:{},
             },
             mounted: function () {
+                $(".up").slideUp();
                 $(".tooltipTarget").tooltip({'trigger': 'hover'});
                 $('#list').removeClass('d-none');
                 let data = [
@@ -202,9 +228,10 @@
                 this.form.init();
                 let column = [
                     {name: 'code', value: '采购编号', neglect: true,class: 'text-center'},
+                    {name: '操作', value: '操作', neglect: true,class: 'text-center'},
+                    {name: 'type', value: '单据类型', class: 'text-center'},
                     {name: '采购单状态', value: '采购单状态', neglect: true,class: 'text-center'},
                     {name: 'owner_id', value: '项目', class: 'text-center'},
-                    {name: 'type', value: '单据类型', class: 'text-center'},
                     // {name: 'company_name', value: '采购公司', class: 'text-center'},
                     {name: 'material_code', value: '耗材编号', class: 'text-center'},
                     {name: 'material_name', value: '耗材'},
@@ -212,14 +239,17 @@
                     {name: 'special', value: '特殊要求', class: 'text-center'},
                     {name: 'specification', value: '材质规格', class: 'text-center'},
                     {name: '附件', value: '附件', class: 'text-center'},
-                    {name: 'supplier', value: '供应商', class: 'text-center'},
+                    // {name: 'supplier', value: '供应商', class: 'text-center'},
+                    {name:"price",type:"multi",title:"报价信息",rows:[
+                            {value:"供应商",col:"6"},
+                            {value:"采购单价(元)",col:"6"},
+                        ]},
                     {name: 'quantity', value: '采购数量', neglect: true,class: 'text-center'},
-                    {name: 'offer', value: '采购单价(元)', neglect: true,class: 'text-center'},
+                    // {name: 'offer', value: '采购单价(元)', neglect: true,class: 'text-center'},
                     {name: 'unit_price', value: '销售单价(元)', neglect: true,class: 'text-center'},
                     {name: '送货数量', value: '送货数量', neglect: true,class: 'text-center'},
                     {name: '销售总价', value: '销售总价(元)', neglect: true,class: 'text-center'},
                     {name: '联系方式', value: '联系方式', neglect: true,class: 'text-center'},
-                    {name: '操作', value: '操作', neglect: true,class: 'text-center'},
                 ];
 
                 new Header({
@@ -271,6 +301,20 @@
                         window.tempTip.show("网络错误:" + err);
                     });
                 },
+                unfold(index){
+                    this.$set(this.upList,index,this.upList[index] ? !this.upList[index] : true);
+                    $("#procurement_quotation-"+index).slideToggle();
+                },
+                show(id,$e){
+                    $("#"+id).slideToggle();
+                    let value= $($e.target).html();
+                    if(value=== '点击展开'){
+                        value = '点击收起';
+                    }else if(value === '点击收起'){
+                        value ='点击展开'
+                    }
+                    $($e.target).html(value);
+                },
                 owner_seek: function (e) {
                     let _this = this;
                     let $val = e.target.value;

+ 1 - 2
resources/views/rejected/create.blade.php

@@ -434,7 +434,6 @@
                     @endforeach
                 ],
                 commodityOwnerId:'',
-
             },
             mounted:function () {
                 let _this=this;
@@ -484,7 +483,7 @@
                     let _this=this;
                     let barcode=$(e.target).val();
                     let url='{{"/apiLocal/commodity/getCommodityByBarcode"}}';
-                    axios.post(url,{barcode:barcode}).then(function (response) {
+                    axios.post(url,{barcode:barcode,owner_id:_this.billInputting.id_owner}).then(function (response) {
                         _this.cleanError();
                         if(response.data.success==='true'){
                             if(response.data.commodity){

+ 1 - 0
resources/views/rejected/import.blade.php

@@ -17,6 +17,7 @@
                     <div class="form-group row text-center">
                         <div class="col-12 text-danger">
                             导入表格需要包含以下字段:
+                            货主,
                             退回单号,
                             手机号,
                             快递公司,

+ 10 - 4
resources/views/rejected/search/general.blade.php

@@ -28,8 +28,9 @@
                 @can('退货管理-编辑')
                     <span class="btn btn-sm btn-outline-dark" @click="finishAll" style="cursor: pointer">完结</span>
                 @endcan
-                @cannot('退货管理-客户不可见')
-                    <span class="dropdown">
+                @can('退货管理-查询-一般-修改入库')
+                    @cannot('退货管理-客户不可见')
+                        <span class="dropdown">
                     <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
                             data-toggle="dropdown" title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效">
                         修改入库
@@ -42,7 +43,8 @@
                         <a class="dropdown-item" @click="setIsLoaded_batch(4)" href="javascript:">待确认</a>
                     </div>
                 </span>
-                @endcannot
+                    @endcannot
+                @endcan
 
                 @can('退货管理-编辑')
                     <a class="btn btn-sm btn-outline-dark" href="{{url('rejected/importRejectedNumber')}}" style="cursor: pointer">导入修改</a>
@@ -66,10 +68,14 @@
                         </td>
                         <td class="" :class="[rejectedBill.is_finished==1?'text-success':'text-muted']">@{{rejectedBill.is_finished | yesNo}}</td>
                         <td class="" :class="[rejectedBill.is_loaded==1?'text-success':'text-muted']">
+                            <span>
                             <span v-if="rejectedBill.is_loaded==4">
-                                <button class="btn btn-sm btn-info" @click="confirmBeStored($event,rejectedBill.id)">确定入库</button>
+                            @can('退货管理-查询-一般-修改入库')
+                                    <button class="btn btn-sm btn-info" @click="confirmBeStored($event,rejectedBill.id)">确定入库</button>
+                                @endcan
                             </span>
                             <span v-else>@{{rejectedBill.is_loaded | yesNoIsLoaded}}</span>
+                            </span>
                         </td>
                         <td class="text-muted"><span>@{{rejectedBill.created_at}}</span></td>
                         <td><span v-if="rejectedBill.owner"><span>@{{rejectedBill.owner.name}}</span></span></td>

+ 1 - 1
resources/views/store/checkingReceive/mission.blade.php

@@ -114,7 +114,7 @@
                     {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
                     {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
                         placeholder:['货主','定位或多选货主'],data:_this.owners},
-                    {name:'asn',type:'input',tip:'ASN单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'ASN单号'},
+                    {name:'asn',type:'input',tip:'可支持多ASN单号:模糊搜索可在两侧增加百分号(%)进行',placeholder:'ASN单号'},
                 ]];
 
                 _this.form = new query({

+ 15 - 0
resources/views/store/deliveryAppointment/index.blade.php

@@ -0,0 +1,15 @@
+@extends('layouts.app')
+@section('title')入库预约@endsection
+
+@section('content')
+    <span id="nav2">
+    @component('store.menu')@endcomponent
+    @component('store.deliveryAppointment.menu')@endcomponent
+    </span>
+    <div class="container-fluid" id="container">
+
+    </div>
+@stop
+
+@section("lastScript")
+@stop

+ 1 - 1
resources/views/store/inStorage/index.blade.php

@@ -99,7 +99,7 @@
                     ],
                     [
                         {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
-                        {name:'asn_code',type:'input',tip:'进场编号:支持15天内模糊搜索,15天外精确搜索',placeholder: 'ASN单号'},
+                        {name:'asn_code',type:'input',tip:'可支持多asn编号:支持15天内模糊搜索,15天外精确搜索,模糊搜索可在两侧增加百分号(%)进行',placeholder: 'ASN单号'},
                         {name:'status',type:'select',placeholder: '订单状态',data:[{name:'完全收货',value:'完全收货'},{name:'部分收货',value:'部分收货'},
                                 {name:'已码盘',value:'已码盘'},{name:'订单创建',value:'订单创建'},{name:'ASN关闭',value:'ASN关闭'},{name:'等待释放',value:'等待释放'},{name:'收货取消',value:'收货取消'}]},
                         {name:'stored_method',type:'select',placeholder: '入库类型',data:[{name:'采购入库',value:'采购入库'},{name:'笕尚退货入库单',value:'笕尚退货入库单'},

+ 12 - 8
resources/views/transport/waybill/index.blade.php

@@ -144,6 +144,7 @@
                             </div>@endcan
                         </div>
                     </td>
+                    <td class="td-cool"><span>@{{waybill.ordering_remark}}</span></td>
                     <td class="td-cool"><span>@{{waybill.recipient}}</span></td>
                     <td class="td-cool"><span>@{{waybill.recipient_mobile}}</span></td>
                     <td class="td-cool text-muted"><span>@{{waybill.origination}}</span></td>
@@ -384,19 +385,21 @@
                             placeholder:['货主','定位或多选货主'],data:this.owners},
                         {name:'created_at_start',type:'time',tip:['选择显示指定日期的起始时间','选择显示指定日期的起始时间']},
                         {name:'origination',type:'input',tip:'始发地:可在左侧增加百分号(%)进行模糊搜索',placeholder: '始发地'},
-                        {name:'carrier_bill',type:'input',tip:'承运商单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '承运商单号'},
+                        {name:'carrier_bill',type:'input',tip:'可支持多承运商单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '承运商单号'},
                         {name:'status',type:'select',placeholder: '运单状态',data:this.status},
-                        {name:'source_bill',type:'input',tip: '上游单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '上游单号'},
-                        {name:'recipient',type:'input',tip: '收货人姓名:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人姓名'},
+                        {name:'source_bill',type:'input',tip: '可支持多上游单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '上游单号'},
+                        {name:'recipient',type:'input',tip: '可支持多收货人姓名:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人姓名'},
                         {name:'car_owner_info',type:'input',tip: '车辆信息:可在左侧增加百分号(%)进行模糊搜索',placeholder: '车辆信息'},
                     ],
                     [
-                        {name:'wms_bill_number',type:'input',tip:'WMS单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: 'WMS单号'},
+                        {name:'wms_bill_number',type:'input',tip:'可支持多WMS单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: 'WMS单号'},
                         {name:'created_at_end',type:'time',tip:['选择显示指定日期的结束时间','选择显示指定日期的结束时间']},
                         {name:'destination',type:'input',tip:'目的地:可在两侧增加百分号(%)进行模糊搜索',placeholder: '目的地'},
                         {name:'waybill_number',type:'input',tip:'运单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '运单号'},
-                        {name:'logistic_id',type:'select',placeholder: '承运商',data:this.logistics},
-                        {name:'recipient_mobile',type:'input',tip: '收货人电话:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人电话'},
+                        // {name:'logistic_id',type:'select',placeholder: '承运商',data:this.logistics},
+                        {name:'logistic_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的承运商'],
+                            placeholder:['承运商','定位或多选承运商'],data:this.logistics},
+                        {name:'recipient_mobile',type:'input',tip: '可支持多收货人电话:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人电话'},
                     ],
                 ];
                 let param=[];
@@ -433,6 +436,7 @@
                         {name:'other_charge',value: '其他收费', neglect: true, class:"td-warm"},
                         {name:'other_charge_remark',value: '其他收费备注', class:"td-warm"},
                             @can('运输管理-运单-图片上传'){name:'img',value: '照片', neglect: true, class:"td-warm"},@endcan
+                        {name:'ordering_remark',value: '运单备注', class:"td-cool"},
                         {name:'recipient',value: '收件人', class:"td-cool"},
                         {name:'recipient_mobile',value: '收件人电话', class:"td-cool"},
                         {name:'origination',value: '始发地', class:"td-cool"},
@@ -466,8 +470,8 @@
                         before : [
                             {colspan:'4',value: '', class:"table-header-layer-1"},
                             {colspan:'14',value: '运单信息',font:"fa fa-file-text-o", class:"table-header-layer-1"},
-                            {colspan:'16',value: '运输信息',font:"fa fa-truck", class:"table-header-layer-1"},
-                            {colspan:'5',value: '运输信息',font:"fa fa-rmb", class:"table-header-layer-1"},
+                            {colspan:'17',value: '运输信息',font:"fa fa-truck", class:"table-header-layer-1"},
+                            {colspan:'5',value: '收费信息',font:"fa fa-rmb", class:"table-header-layer-1"},
                                 @can('运输管理-运单-删除'){colspan:'1',value: '',font:"", class:"table-header-layer-1"},@endcan
                         ],
                     }).init();

+ 1 - 0
routes/api/thirdPart/weixin.php

@@ -25,6 +25,7 @@ Route::group(['prefix' => 'procurement','middleware'=>'procurement.auth.api'], f
     Route::get('getProcurementDeliveries', 'ProcurementController@getProcurementDeliveries');
     Route::post('makeProcurementDelivery', 'ProcurementController@makeProcurementDelivery');
     Route::post('finishProductionProcurement', 'ProcurementController@finishProductionProcurement');
+    Route::post('cancelProcurement', 'ProcurementController@cancelProcurement');
     Route::post('getProcurementDeliveryById', 'ProcurementController@getProcurementDeliveryById');
     Route::post('updateProcurementDeliveryAmount', 'ProcurementController@updateProcurementDeliveryAmount');
     Route::get('getProcurementTotalBill', 'ProcurementController@getProcurementTotalBill');

+ 6 - 0
routes/apiLocal.php

@@ -190,3 +190,9 @@ Route::group(['prefix' => 'station'],function(){
         Route::get('getTasks/{id}','CacheShelfController@getTasksApi')->name('station.cacheShelf.getTasksApi');
     });
 });
+
+
+/** 包裹 */
+Route::group(['prefix' => 'package'], function () {
+    Route::put('logistic', 'OrderPackageController@update')->name('orderPackage.update');
+});

+ 1 - 0
routes/web.php

@@ -717,6 +717,7 @@ Route::group(['prefix'=>'order'],function(){
     Route::post('deAllocation','OrderController@deAllocation');
     Route::post('deAllocationAll','OrderController@deAllocationAll');
     Route::post('resetLogisticsGetMark','OrderController@resetLogisticsGetMark');
+    Route::post('resetInterfaceReturnMark','OrderController@resetInterfaceReturnMark');
     Route::post('createRejectedBill','OrderController@createRejectedBill');
     Route::post('isRejectedBillExist','OrderController@isRejectedBillExist');
 });

+ 6 - 0
tests/webApi/thirdPart/haiq/listBoxes.http

@@ -0,0 +1,6 @@
+POST http://58.33.243.164:20000/inventory/location/search?enableTableNameForIdentification=false&pageNo=0&per_page=100
+Content-Type: application/json
+
+{}
+###
+

Некоторые файлы не были показаны из-за большого количества измененных файлов