loustwo 4 лет назад
Родитель
Сommit
be52488b48

+ 85 - 0
app/Http/Controllers/ReceivingTaskController.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\ReceivingTask;
+use Illuminate\Http\Request;
+
+class ReceivingTaskController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * Show the form for creating a new resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return \Illuminate\Http\Response
+     */
+    public function store(Request $request)
+    {
+        //
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  \App\ReceivingTask  $receivingTask
+     * @return \Illuminate\Http\Response
+     */
+    public function show(ReceivingTask $receivingTask)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\ReceivingTask  $receivingTask
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(ReceivingTask $receivingTask)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\ReceivingTask  $receivingTask
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, ReceivingTask $receivingTask)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\ReceivingTask  $receivingTask
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(ReceivingTask $receivingTask)
+    {
+        //
+    }
+}

+ 85 - 0
app/Http/Controllers/ReceivingTaskItemController.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\ReceivingTaskItem;
+use Illuminate\Http\Request;
+
+class ReceivingTaskItemController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * Show the form for creating a new resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return \Illuminate\Http\Response
+     */
+    public function store(Request $request)
+    {
+        //
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function show(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+}

+ 5 - 1
app/Providers/AppServiceProvider.php

@@ -205,6 +205,8 @@ use App\Services\WorkOrderDamageService;
 use App\Services\WorkOrderLossService;
 use App\Services\AndroidInventoryService;
 use App\Services\WorkOrderCancelInterceptService;
+use App\Services\ReceivingTaskService;
+use App\Services\ReceivingTaskItemService;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -233,7 +235,6 @@ class AppServiceProvider extends ServiceProvider
 
     private function loadingService(){
         app()->singleton('AllInventoryService',AllInventoryService::class);
-        app()->singleton('InventoryAccountService',InventoryAccountService::class);
         app()->singleton('AndroidInventoryService',AndroidInventoryService::class);
         app()->singleton('AuthorityService',AuthorityService::class);
         app()->singleton('BatchService',BatchService::class);
@@ -269,6 +270,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('HengLiWeightService',HengLiWeightService::class);
         app()->singleton('InventoryAccountMissionService', InventoryAccountMissionService::class);
         app()->singleton('InventoryAccountMissionService',InventoryAccountMissionService::class);
+        app()->singleton('InventoryAccountService',InventoryAccountService::class);
         app()->singleton('InventoryCompareService', InventoryCompareService::class);
         app()->singleton('InventoryDailyLogService', InventoryDailyLogService::class);
         app()->singleton('JDDeliveryService',JDDeliveryService::class);
@@ -360,6 +362,8 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('ProcurementWeiXinSendMessageService', ProcurementWeiXinSendMessageService::class);
         app()->singleton('ProvinceService', ProvinceService::class);
         app()->singleton('RealtimePendingOrdersService', RealtimePendingOrdersService::class);
+        app()->singleton('ReceivingTaskItemService',ReceivingTaskItemService::class);
+        app()->singleton('ReceivingTaskService',ReceivingTaskService::class);
         app()->singleton('RegionService', RegionService::class);
         app()->singleton('RejectedBillItemService', RejectedBillItemService::class);
         app()->singleton('RejectedBillService', RejectedBillService::class);

+ 44 - 0
app/ReceivingTask.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+
+class ReceivingTask extends Model
+{
+    use ModelLogChanging;
+
+    protected $fillable = [
+        'number',
+        'warehouse_id',
+        'owner_id',
+        'delivery_appointment_id',
+        'driver_name',
+        'driver_phone',
+        "for_single_member",
+        'plate_number',
+        'driving_license_no',
+        'logistics_single_number',
+        'provide_list',
+        'receiving_type',
+        'status',
+    ];
+
+    public function wareHouse(): HasOne
+    {
+        return $this->hasOne(Warehouse::class);
+    }
+
+    public function owner(): HasOne
+    {
+        return $this->hasOne(Owner::class);
+    }
+
+    public function deliveryAppointment(): HasOne
+    {
+        return $this->hasOne(DeliveryAppointment::class);
+    }
+}

+ 26 - 0
app/ReceivingTaskItem.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use Illuminate\Database\Eloquent\Relations\HasOne;
+
+class ReceivingTaskItem extends Model
+{
+
+    protected $fillable = [
+        'receiving_task_id','asn_no',
+    ];
+
+    public function receivingTask(): HasOne
+    {
+        return $this->hasOne(ReceivingTask::class);
+    }
+
+    public function docASNHeader(): HasOne
+    {
+        return $this->hasOne(OracleDOCASNHeader::class,'asn_no','asnno');
+    }
+
+}

+ 7 - 0
app/Services/AuthorityService.php

@@ -12,6 +12,8 @@ use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Cache;
 use App\Traits\ServiceAppAop;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Gate;
+
 
 
 class AuthorityService
@@ -149,4 +151,9 @@ class AuthorityService
             });
         })->orWhereIn("name",config("users.superAdmin"))->get();
     }
+
+    public function checkAllOwner(): bool
+    {
+        return Gate::allows("货主-可见全部");
+    }
 }

+ 1 - 1
app/Services/OwnerService.php

@@ -582,7 +582,7 @@ sql;
     {
         if (!$userId)$userId = Auth::id();
         $query = Owner::query()->select("owners.id");
-        if (!app("UserService")->checkAdminIdentity($userId)){
+        if (!app("UserService")->checkAdminIdentity($userId) && !app("AuthorityService")->checkAllOwner()){
             $query->whereHas("roles",function ($query)use($userId){
                 $query->whereHas("users",function ($query)use($userId){
                     $query->where("users.id",$userId);

+ 13 - 0
app/Services/ReceivingTaskItemService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services;
+
+use App\Traits\ServiceAppAop;
+use App\ReceivingTaskItem;
+
+class ReceivingTaskItemService
+{
+    use ServiceAppAop;
+    protected $modelClass=ReceivingTaskItem::class;
+
+}

+ 13 - 0
app/Services/ReceivingTaskService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services;
+
+use App\Traits\ServiceAppAop;
+use App\ReceivingTask;
+
+class ReceivingTaskService
+{
+    use ServiceAppAop;
+    protected $modelClass=ReceivingTask::class;
+
+}

+ 12 - 0
database/factories/ReceivingTaskFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\ReceivingTask;
+use Faker\Generator as Faker;
+
+$factory->define(ReceivingTask::class, function (Faker $faker) {
+    return [
+        //
+    ];
+});

+ 11 - 0
database/factories/ReceivingTaskItemFactory.php

@@ -0,0 +1,11 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\ReceivingTaskItem;
+use Faker\Generator as Faker;
+
+$factory->define(ReceivingTaskItem::class, function (Faker $faker) {
+    return [
+    ];
+});

+ 47 - 0
database/migrations/2021_12_22_153152_create_receiving_tasks_table.php

@@ -0,0 +1,47 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateReceivingTasksTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('receiving_tasks', function (Blueprint $table) {
+            $table->id();
+            $table->String('number')->index()->comment('收货任务清单');
+            $table->integer('warehouse_id')->index()->comment('仓库');
+            $table->integer('owner_id')->index()->comment('货主');
+            $table->String("for_single_member")->comment('投单员');
+            $table->integer('delivery_appointment_id')->index()->comment('预约号');
+
+            $table->String('driver_name')->comment('司机姓名');
+            $table->String('driver_phone')->comment('司机号码');
+
+            $table->String('plate_number')->comment('车牌号');
+            $table->String('driving_license_no')->comment('驾驶证号');
+            $table->String('logistics_single_number')->comment('物流单号');
+
+            $table->enum('provide_list',['是','否'])->comment("是否提供清单");
+            $table->enum('receiving_type',['正常','盲收'])->comment("收货类型");
+            $table->enum('status',['创建','进行中','完成'])->comment('状态');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('receiving_tasks');
+    }
+}

+ 33 - 0
database/migrations/2021_12_22_163154_create_receiving_task_items_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateReceivingTaskItemsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('receiving_task_items', function (Blueprint $table) {
+            $table->id();
+            $table->integer('receiving_task_id')->index()->comment('收货任务');
+            $table->String('asn_no')->comment('asn单号');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('receiving_task_items');
+    }
+}

+ 16 - 0
database/seeds/ReceivingTaskItemSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class ReceivingTaskItemSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}

+ 16 - 0
database/seeds/ReceivingTaskSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class ReceivingTaskSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}

+ 184 - 0
resources/views/store/receivingTasks/create.blade.php

@@ -0,0 +1,184 @@
+@extends('layouts.app')
+@section('title')开单入库-查询@endsection
+
+@section('content')
+    <div id="list" class="d-none">
+        <div class="container-fluid">
+            <div class="card row">
+                <div class="card-body">
+                    <form name="receiving-task-form" id="receiving-task-form">
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right"  for="warehouse">仓库</label>
+                                <div class="form-inline col-8">
+                                    <select class="form-control form-control-sm" name="warehouse" id="warehouse">
+                                        <option value=""></option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="for_single_member">投单员</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" id="for_single_member">
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="owner">货主</label>
+                                <div class="form-inline col-8">
+                                    <select class="form-control form-control-sm" name="owner" id="owner">
+                                        <option value=""></option>
+                                    </select>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="driver_name">司机姓名</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="driver_name" id="driver_name">
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="driver-phone">司机电话</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="driver-phone" id="driver-phone">
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="delivery_appointment_number">预约单号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="delivery_appointment_number" id="delivery_appointment_number">
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="plate_number">车牌号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="plate_number" id="plate_number">
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="driving_license_no">驾驶证号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="driving_license_no" id="driving_license_no">
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right" for="logistics_single_number">物流单号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control" placeholder="" name="logistics_single_number" id="logistics_single_number">
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="card-body">
+                            <div class="card">
+
+                            </div>
+                        </div>
+
+                    </form>
+                </div>
+
+                <div class="card-body">
+                    <table class="table table-hover text-center table-bordered" id="asn-header">
+                        <thead>
+                        <tr>
+                            <td></td>
+                            <td>货主</td>
+                            <td>ANS号</td>
+                            <td>ANS类型</td>
+                            <td>订单状态</td>
+                            <td>上游单号</td>
+                            <td>预期总数</td>
+                            <td>参考编号1</td>
+                            <td>参考编号2</td>
+                            <td>参考编号3</td>
+                            <td>接口接受时间</td>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td><input type="radio" class="form-control radio"></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <div class="form-group row">
+                    <table class="table table-bordered table-hover" id="asn-details">
+                        <thead>
+                        <tr>
+                            <td>行状态</td>
+                            <td>产品名称</td>
+                            <td>条码1</td>
+                            <td>条码2</td>
+                            <td>条码3</td>
+                            <td>预期数量</td>
+                            <td>已收数量</td>
+                        </tr>
+                        </thead>
+                    </table>
+                </div>
+            </div>
+        </div>
+
+    </div>
+@endsection
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            data:{
+                receiving_task:{
+                    warehouse_id:null,
+                    owner_id:null,
+                    delivery_appointment_id:null,
+                    driver_name:null,
+                    driver_phone:null,
+                    for_single_member:null,
+                    plate_number:null,
+                    driving_license_no:null,
+                    logistics_single_number:null,
+                    provide_list:null,
+                    receiving_type:null,
+                    status:null,
+                },
+                driving_license_image:null,
+                asn_header:[],
+                asn_details:[],
+            },
+            methods:{
+                submit(){
+                    let url = "{{route("store.receivingMask.storeApi")}}";
+                    let form = document.getElementById("receiving-task-form");
+                    let formData = new FormData(form);
+                    this.asn_header.forEach(e=>{
+                        if (e.selected)formData.append('asn_nodes',e.asn_no);
+                    });
+                    window.axios.post(url,formData,{
+                        'Content-Type':'multipart/form-data'
+                    }).then(res=>{
+                        if (res.data.success){
+                        }
+                    }).catch(err=>{
+                    })
+                }
+
+            }
+        })
+    </script>
+@endsection

+ 52 - 0
resources/views/store/receivingTasks/index.blade.php

@@ -0,0 +1,52 @@
+@extends('layouts.app')
+@section('title')开单入库-查询@endsection
+
+@section('content')
+    <div id="list" class="d-none">
+        <div class="container-fluid">
+        </div>
+        <div>
+            <table class="table">
+                <thead>
+                <tr>
+                    <td>序号</td>
+                    <td>收货任务号</td>
+                    <td>ASN单号</td>
+                    <td>投单时间</td>
+                    <td>仓库</td>
+                    <td>预约号</td>
+                    <td>驾驶证号</td>
+                    <td>收货类型</td>
+                </tr>
+                </thead>
+                <tbody>
+                <tr v-for="(item,i) in receivingTasks">
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+@endsection
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            data:{
+                receivingTasks:[],
+
+            },
+            methods:{
+
+            }
+        })
+    </script>
+@endsection

+ 7 - 0
routes/apiLocal.php

@@ -62,6 +62,13 @@ Route::group(['prefix' => 'personnel'], function () {
         });
     });
 });
+// 开单入库
+Route::prefix('store')->group(function(){
+    Route::prefix('receivingMask')->group(function(){
+        Route::get("/createApi","ReceivingTaskController@storeApi")->name("store.receivingMask.storeApi");
+    });
+});
+
 
 Route::group(['prefix' => 'order'], function () {
     Route::group(['prefix'=>'issue'],function(){

+ 7 - 0
routes/web.php

@@ -32,6 +32,13 @@ Route::post('package/weigh/measureMonitor/data', 'MeasureMonitorController@data'
 Route::get('package/measureMonitor', 'MeasureMonitorController@index');
 Route::get('package/weigh/measureMonitor', 'MeasureMonitorController@index');
 
+Route::prefix('store')->group(function(){
+    Route::prefix('receivingMask')->group(function(){
+        Route::get("/index","ReceivingTaskController@index");
+        Route::get("/create","ReceivingTaskController@create");
+    });
+});
+
 //入库预约终端
 Route::get('store/deliveryAppointment/exhibition', 'DeliveryAppointmentController@exhibition');
 //入库预约预约码输入