浏览代码

入库费明细

ANG YU 4 年之前
父节点
当前提交
bdd1de4716
共有 26 个文件被更改,包括 960 次插入166 次删除
  1. 3 1
      app/Http/Controllers/OwnerStoreFeeDetailController.php
  2. 84 0
      app/Http/Controllers/OwnerStoreOutFeeDetailController.php
  3. 13 0
      app/Http/Controllers/TestController.php
  4. 31 0
      app/Interfaces/SettlementBillControllerInterface.php
  5. 30 0
      app/Interfaces/SettlementBillDetailInterface.php
  6. 33 0
      app/Interfaces/SettlementBillReportInterface.php
  7. 7 6
      app/OwnerBillReportArchive.php
  8. 30 0
      app/OwnerStoreOutFeeDetail.php
  9. 2 0
      app/Providers/AppServiceProvider.php
  10. 2 2
      app/Services/NewOrderCountingRecordService.php
  11. 2 2
      app/Services/OwnerLogisticFeeReportService.php
  12. 0 35
      app/Services/OwnerStoreFeeDetailService.php
  13. 1 1
      app/Services/OwnerStoreFeeReportService.php
  14. 68 0
      app/Services/OwnerStoreOutFeeDetailService.php
  15. 1 3
      app/Traits/SettlementBillTrait.php
  16. 26 0
      database/factories/OwnerStoreOutFeeDetailFactory.php
  17. 38 0
      database/migrations/2021_06_23_114058_create_owner_store_out_fee_details_table.php
  18. 26 0
      database/seeds/OwnerStoreOutFeeDetailSeeder.php
  19. 27 26
      resources/views/finance/settlementBills/areaFee/index.blade.php
  20. 30 27
      resources/views/finance/settlementBills/logisticFee/detail/index.blade.php
  21. 26 18
      resources/views/finance/settlementBills/logisticFee/report/index.blade.php
  22. 35 27
      resources/views/finance/settlementBills/storeFee/detail/index.blade.php
  23. 17 18
      resources/views/finance/settlementBills/storeFee/report/index.blade.php
  24. 198 0
      resources/views/finance/settlementBills/storeOutFee/detail/index.blade.php
  25. 221 0
      resources/views/finance/settlementBills/storeOutFee/report/index.blade.php
  26. 9 0
      routes/web.php

+ 3 - 1
app/Http/Controllers/OwnerStoreFeeDetailController.php

@@ -2,6 +2,7 @@
 
 namespace App\Http\Controllers;
 
+use App\Interfaces\SettlementBillControllerInterface;
 use App\Owner;
 use App\OwnerBillReport;
 use App\OwnerBillReportArchive;
@@ -12,7 +13,7 @@ use Illuminate\Http\RedirectResponse;
 use Illuminate\Http\Request;
 use Oursdreams\Export\Export;
 
-class OwnerStoreFeeDetailController extends Controller
+class OwnerStoreFeeDetailController extends Controller implements SettlementBillControllerInterface
 {
     use SettlementBillTrait;
 
@@ -41,6 +42,7 @@ class OwnerStoreFeeDetailController extends Controller
             'counting_month' => $counting_month,
             'owner_id' => $owner_id,
             'type' => $this->service::TYPE,
+            'paginateParams' => $paginateParams,
         ]);
         $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get();
         $owner = Owner::query()->selectRaw("name,id")->find($owner_id);

+ 84 - 0
app/Http/Controllers/OwnerStoreOutFeeDetailController.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Interfaces\SettlementBillControllerInterface;
+use App\Owner;
+use App\OwnerBillReport;
+use App\OwnerBillReportArchive;
+use App\Services\OwnerBillReportArchiveService;
+use App\Services\OwnerStoreOutFeeDetailService;
+use App\Traits\SettlementBillTrait;
+use Illuminate\Http\RedirectResponse;
+use Illuminate\Http\Request;
+use Oursdreams\Export\Export;
+
+class OwnerStoreOutFeeDetailController extends Controller implements SettlementBillControllerInterface
+{
+    use SettlementBillTrait;
+
+    /** @var OwnerStoreOutFeeDetailService $service */
+    private $service;
+
+    /** @var OwnerBillReportArchiveService $archiveService */
+    private $archiveService;
+
+    public function __construct()
+    {
+        $this->service = app('OwnerStoreOutFeeDetailService');
+        $this->archiveService = app('OwnerBillReportArchiveService');
+        $this->middleware('auth');
+    }
+
+    public function index(Request $request)
+    {
+        $paginateParams = $request->input();
+        list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id);
+        $details = $this->service->get([
+            'counting_month' => $counting_month,
+            'owner_id' => $owner_id,
+            'paginateParams' => $paginateParams,
+        ]);
+        $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get();
+        $owner = Owner::query()->selectRaw("name,id")->find($owner_id);
+        $isArchived = $this->archiveService->isArchived($counting_month, $owner_id, $this->service::TYPE);
+        $request = $this->buildRequest($request, $counting_month);
+        return view('finance.settlementBills.storeOutFee.detail.index', compact('details', 'paginateParams', 'owners', 'owner', 'request', 'isArchived'));
+    }
+
+
+    public function confirmBill(Request $request): RedirectResponse
+    {
+        list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id);
+        $billReport = OwnerBillReport::query()
+            ->select('id')
+            ->where('owner_id', $owner_id)
+            ->where('counting_month', $counting_month)
+            ->firstOr(function () {
+                return new OwnerBillReport();
+            });
+        OwnerBillReportArchive::query()->create([
+            'owner_bill_report_id' => $billReport->id ?? null,
+            'owner_id' => $owner_id,
+            'counting_month' => $counting_month,
+            'type' => $this->service::TYPE,
+            'archiver_id' => auth()->id(),
+            'archived_at' => now(),
+            'information' => [],
+        ]);
+        return back()->with('success', '确认成功');
+    }
+
+    public function export(Request $request)
+    {
+        list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id);
+        $query = $this->service->getSql($owner_id, $counting_month);
+        if (!$request->exists('checkAllSign')) {
+            $query->whereIn('id', explode(',', $request['data']));
+        }
+        $details = $query->get();
+        $json = $this->service->buildExport($details);
+        $row = ['作业时间', '作业名称', '上游单号', '订单号', '商品条码', '商品名称', '商品数量', '价格', '合计'];
+        return Export::make($row, $json, "出库费明细");
+    }
+}

+ 13 - 0
app/Http/Controllers/TestController.php

@@ -1714,6 +1714,19 @@ TEXT;
         $service->recordOrder($start, $end, '月');
     }
 
+    public function order_counting_records_init_month()
+    {
+        OrderCountingRecord::query()->where('counting_unit', '月')->delete();
+
+        // 1. 同步2021-01 --  2021-05的月数据
+        $start = now()->startOfYear()->toDateString();
+        $end = now()->subMonth()->endOfMonth()->toDateString();
+
+        /** @var  $service NewOrderCountingRecordService */
+        $service = app('NewOrderCountingRecordService');
+        $service->recordOrder($start, $end, '月');
+    }
+
     public function OwnerLogisticFeeReportService_test()
     {
         /* @var $service OwnerLogisticFeeReportService */

+ 31 - 0
app/Interfaces/SettlementBillControllerInterface.php

@@ -0,0 +1,31 @@
+<?php
+
+
+namespace App\Interfaces;
+
+use Illuminate\Http\RedirectResponse;
+use Illuminate\Http\Request;
+
+interface SettlementBillControllerInterface
+{
+    /**
+     * 首页
+     * @param Request $request
+     * @return mixed
+     */
+    public function index(Request $request);
+
+    /**
+     * 确认账单
+     * @param Request $request
+     * @return RedirectResponse
+     */
+    public function confirmBill(Request $request): RedirectResponse;
+
+    /**
+     * 报表导出
+     * @param Request $request
+     * @return mixed
+     */
+    public function export(Request $request);
+}

+ 30 - 0
app/Interfaces/SettlementBillDetailInterface.php

@@ -0,0 +1,30 @@
+<?php
+
+
+namespace App\Interfaces;
+
+use Illuminate\Database\Eloquent\Builder;
+
+interface SettlementBillDetailInterface
+{
+    /**
+     * @param $owner_id
+     * @param $counting_month
+     * @return Builder
+     */
+    public function getSql($owner_id, $counting_month): Builder;
+
+    /**
+     * @param $type
+     * @return int|mixed
+     */
+    public function switchType($type);
+
+    public function buildExport($details): array;
+
+    /**
+     * @param array $model
+     * @return mixed
+     */
+    public function add(array $model);
+}

+ 33 - 0
app/Interfaces/SettlementBillReportInterface.php

@@ -0,0 +1,33 @@
+<?php
+
+
+namespace App\Interfaces;
+
+use Illuminate\Database\Eloquent\Builder;
+
+interface SettlementBillReportInterface
+{
+    /**
+     * 生成报表数据
+     * 如果参数$counting_month为空 统计上一个月的
+     * 如果参数$counting_month为2021-01-01 则统计2021-01-01 -- 2021-01-31之间的数据
+     * @param null $counting_month 统计月份,默认统计上个月的 2021-05-01
+     */
+    public function recordReport($counting_month = null);
+
+
+    /**
+     * @param $owner_id
+     * @param $counting_month
+     * @return Builder
+     */
+    public function getSql($owner_id, $counting_month): Builder;
+
+    /**
+     * @param $type
+     * @return int|mixed
+     */
+    public function switchType($type);
+
+    public function buildExport($details): array;
+}

+ 7 - 6
app/OwnerBillReportArchive.php

@@ -31,12 +31,13 @@ class OwnerBillReportArchive extends Model
             '快递费-合计' => 3,
             '入库费-明细' => 4,
             '入库费-合计' => 5,
-            '出库费' => 6,
-            '物流费' => 7,
-            '包材费' => 8,
-            '加工费' => 9,
-            '杂项' => 10,
-            '卸货费' => 11,
+            '出库费-明细' => 6,
+            '出库费-合计' => 7,
+            '物流费' => 8,
+            '包材费' => 9,
+            '加工费' => 10,
+            '杂项' => 11,
+            '卸货费' => 12,
         ],
     ];
 

+ 30 - 0
app/OwnerStoreOutFeeDetail.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+
+class OwnerStoreOutFeeDetail extends Model
+{
+    use ModelLogChanging;
+
+    public $fillable = ['owner_fee_detail_id', 'commodity_id', 'owner_id', 'source_bill', 'work_name', 'price', 'remark'];
+
+    public function ownerFeeDetail(): BelongsTo
+    {
+        return $this->belongsTo(OwnerFeeDetail::class);
+    }
+
+    public function commodity(): BelongsTo
+    {
+        return $this->belongsTo(Commodity::class);
+    }
+
+    public function owner(): BelongsTo
+    {
+        return $this->belongsTo(Owner::class);
+    }
+}

+ 2 - 0
app/Providers/AppServiceProvider.php

@@ -150,6 +150,7 @@ use App\Services\OwnerBillReportArchiveService;
 use App\Services\SettlementBillsAreaFeeService;
 use App\Services\OwnerStoreFeeDetailService;
 use App\Services\OwnerStoreFeeReportService;
+use App\Services\OwnerStoreOutFeeDetailService;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -303,6 +304,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('OwnerStoragePriceModelService', OwnerStoragePriceModelService::class);
         app()->singleton('OwnerStoreFeeDetailService',OwnerStoreFeeDetailService::class);
         app()->singleton('OwnerStoreFeeReportService',OwnerStoreFeeReportService::class);
+        app()->singleton('OwnerStoreOutFeeDetailService',OwnerStoreOutFeeDetailService::class);
         app()->singleton('PackageService', PackageService::class);
         app()->singleton('PackageStatisticsService', PackageStatisticsService::class);
         app()->singleton('PrintPartService',PrintPartService::class);

+ 2 - 2
app/Services/NewOrderCountingRecordService.php

@@ -670,11 +670,11 @@ class NewOrderCountingRecordService
             $end = now()->subMonth()->endOfDay();
         }
         $endDate = Carbon::parse($end)->endOfDay()->toDateString();
-        $records = OrderCountingRecord::query()
+        OrderCountingRecord::query()
             ->selectRaw("owner_id,warehouse_id,logistic_id,sum(amount) as amount_sum,month,year,date_target")
             ->whereBetween('date_target', [$startDate, $endDate])
             ->where('counting_unit', '日')
-            ->groupBy('owner_id', 'warehouse_id', 'logistic_id', 'month', 'date_target')
+            ->groupBy('owner_id', 'warehouse_id', 'logistic_id', 'month')
             ->chunk(1000, function ($records) use ($unit) {
                 $insertData = [];
                 foreach ($records as $record) {

+ 2 - 2
app/Services/OwnerLogisticFeeReportService.php

@@ -71,7 +71,7 @@ class OwnerLogisticFeeReportService
      * @param $paginateParams
      * @return LengthAwarePaginator
      */
-    private function getRecordPagination($owner_id, string $counting_month, $paginateParams): LengthAwarePaginator
+    private function getPagination($owner_id, string $counting_month, $paginateParams): LengthAwarePaginator
     {
         return $this->getSql($owner_id, $counting_month)
             ->paginate($paginateParams['paginate'] ?? 50);
@@ -87,7 +87,7 @@ class OwnerLogisticFeeReportService
             $recordTotal = $archived->information['recordTotal'];
         } else {
             $recordTotal = $this->getRecordTotal($kvPairs['owner_id'], $kvPairs['counting_month']);
-            $reports = $this->getRecordPagination($kvPairs['owner_id'], $kvPairs['counting_month'], $kvPairs['paginateParams']);
+            $reports = $this->getPagination($kvPairs['owner_id'], $kvPairs['counting_month'], $kvPairs['paginateParams']);
         }
         return array($reports, $recordTotal);
     }

+ 0 - 35
app/Services/OwnerStoreFeeDetailService.php

@@ -20,43 +20,8 @@ class OwnerStoreFeeDetailService
     /** @var  $archiveService OwnerBillReportArchiveService */
     private $archiveService;
 
-    /**
-     * OwnerStoreFeeDetailService constructor.
-     */
-    public function __construct()
-    {
-    }
-
-
-//    public function export(array $kvPairs)
-//    {
-//        $this->archiveService = app('OwnerBillReportArchiveService');
-//        if ($this->archiveService->isArchived($kvPairs['counting_month'], $kvPairs['owner_id'], $kvPairs['type']) == 1) {
-//            //TODO
-//            $archivedResponse = $this->archiveService->get($kvPairs);
-//            return collect($archivedResponse->information['storeFeeDetails']);
-//        } else {
-//            //TODO 在数据库中查询详情
-//            //TODO 商家编码 商品条码 商品名称关联表
-//            $builder = $this->getSql($kvPairs['counting_month'], $kvPairs['owner_id']);
-//            if (!$kvPairs['checkAllSign']) {
-//            }
-//            $storeFeeDetails = $builder
-//                ->get();
-//        }
-//        return $storeFeeDetails;
-//    }
-
     public function get(array $kvPairs)
     {
-//        $this->archiveService = app('OwnerBillReportArchiveService');
-//        if ($this->archiveService->isArchived($kvPairs['counting_month'], $kvPairs['owner_id'], $kvPairs['type']) == 1) {
-//            //TODO
-//            $archivedResponse = $this->archiveService->get($kvPairs);
-//            return $archivedResponse->information['details'];
-//
-//        } else {
-        //        }
         return $this->getSql($kvPairs['counting_month'], $kvPairs['owner_id'])
             ->paginate($kvPairs['paginateParams']['paginate'] ?? 50);
 

+ 1 - 1
app/Services/OwnerStoreFeeReportService.php

@@ -96,7 +96,7 @@ class OwnerStoreFeeReportService
         return array($reports, $totalAmount, $totalFee, $newFee, $backFee);
     }
 
-    private function getReportPaginate($owner_id, $counting_month, $paginateParams): LengthAwarePaginator
+    public function getPaginate($owner_id, $counting_month, $paginateParams): LengthAwarePaginator
     {
         return $this->getSql($owner_id, $counting_month)
             ->paginate($paginateParams['paginate'] ?? 50);

+ 68 - 0
app/Services/OwnerStoreOutFeeDetailService.php

@@ -0,0 +1,68 @@
+<?php
+
+namespace App\Services;
+
+use App\Interfaces\SettlementBillDetailInterface;
+use App\Traits\ServiceAppAop;
+use App\OwnerStoreOutFeeDetail;
+use Carbon\Carbon;
+use Illuminate\Contracts\Pagination\LengthAwarePaginator;
+use Illuminate\Database\Eloquent\Builder;
+
+class OwnerStoreOutFeeDetailService implements SettlementBillDetailInterface
+{
+    const  TYPE = '出库费-明细';
+    use ServiceAppAop;
+
+    protected $modelClass = OwnerStoreOutFeeDetail::class;
+
+    /**
+     * 详情的查询不管是否却认都是原始数据且分页
+     * @param array $kvPairs
+     * @return LengthAwarePaginator
+     */
+    public function get(array $kvPairs): LengthAwarePaginator
+    {
+        return $this->getSql($kvPairs['owner_id'],$kvPairs['counting_month'])->paginate($kvPairs['paginateParams']['paginate']??50);
+    }
+
+    public function getSql($owner_id, $counting_month): Builder
+    {
+        $start = Carbon::parse($counting_month)->startOfMonth()->startOfDay()->toDateTimeString();
+        $end = Carbon::parse($counting_month)->endOfMonth()->endOfDay()->toDateTimeString();
+        return OwnerStoreOutFeeDetail::query()
+            ->with(['commodity:id,name,sku', 'ownerFeeDetail:id,worked_at,commodity_amount,operation_bill,work_fee'])
+            ->where('owner_id', $owner_id)
+            ->whereBetween('created_at', [$start, $end]);
+    }
+
+    public function switchType($type)
+    {
+        // TODO: Implement switchType() method.
+    }
+
+    public function buildExport($details): array
+    {
+        $result = [];
+
+        foreach ($details as $detail) {
+            $result[] = [
+                $detail->ownerFeeDetail->worked_at,
+                $detail->work_name,
+                $detail->source_bill,
+                $detail->ownerFeeDetail->operation_bill,
+                $detail->commodity->sku,
+                $detail->commodity->name,
+                $detail->ownerFeeDetail->commodity_amount,
+                $detail->price,
+                $detail->ownerFeeDetail->work_fee,
+            ];
+        }
+        return $result;
+    }
+
+    public function add(array $model)
+    {
+        // TODO: Implement add() method.
+    }
+}

+ 1 - 3
app/Traits/SettlementBillTrait.php

@@ -17,9 +17,7 @@ trait SettlementBillTrait
      */
     public function getRequestParams($year, $month, $owner_id): array
     {
-        $this->service = app('OwnerLogisticFeeReportService');
-        $this->userService = app('UserService');
-        $permittingOwnerIds = $this->userService->getPermittingOwnerIds(auth()->user());
+        $permittingOwnerIds = app('UserService')->getPermittingOwnerIds(auth()->user());
         if (is_null($year)) {
             $year = now()->subMonth()->year;
         }

+ 26 - 0
database/factories/OwnerStoreOutFeeDetailFactory.php

@@ -0,0 +1,26 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\OwnerStoreOutFeeDetail;
+use Faker\Generator as Faker;
+
+$factory->define(OwnerStoreOutFeeDetail::class, function (Faker $faker) {
+    return [
+        'owner_fee_detail_id' => random_int(1, 100),
+
+        'commodity_id' => random_int(1, 100),
+
+        'owner_id' => random_int(1, 100),
+
+        'source_bill' => $faker->uuid,
+
+        'work_name' => $faker->title,
+
+        'price' => random_int(1, 100),
+
+        'remark' => $faker->sentence,
+        'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
+        'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
+    ];
+});

+ 38 - 0
database/migrations/2021_06_23_114058_create_owner_store_out_fee_details_table.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerStoreOutFeeDetailsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_store_out_fee_details', function (Blueprint $table) {
+            $table->id();
+            $table->integer('owner_fee_detail_id');
+            $table->integer('commodity_id');
+            $table->integer('owner_id');
+            $table->string('source_bill')->comment('上游单号');
+            $table->string('work_name')->comment('作业名称');
+            $table->string('price')->comment('单价');
+            $table->string('remark')->comment('价格描述');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_store_out_fee_details');
+    }
+}

+ 26 - 0
database/seeds/OwnerStoreOutFeeDetailSeeder.php

@@ -0,0 +1,26 @@
+<?php
+
+use App\Commodity;
+use App\OwnerFeeDetail;
+use App\OwnerStoreOutFeeDetail;
+use Illuminate\Database\Seeder;
+
+class OwnerStoreOutFeeDetailSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+        OwnerStoreOutFeeDetail::query()->truncate();
+        OwnerFeeDetail::query()->truncate();
+        Commodity::query()->truncate();
+
+        factory(OwnerStoreOutFeeDetail::class)->times(100)->create(['owner_id'=>8]);
+        factory(OwnerFeeDetail::class)->times(100)->create(['owner_id'=>8]);
+        factory(Commodity::class)->times(100)->create(['owner_id'=>8]);
+    }
+}

+ 27 - 26
resources/views/finance/settlementBills/areaFee/index.blade.php

@@ -18,16 +18,34 @@
                     </span>
             </div>
             <div class="row">
-                <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
-                <span class="ml-4 mt-2">
-                                <h5 class="font-weight-bold">{{ $owner->name }}</h5>
-                                <p class="text-muted">货主</p>
-                            </span>
-                <span v-if="(isArchived===1)" class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true"
-                      style="color: #4c2584;opacity: 0.3"></span>
-                <span v-if="(isArchived===1)" class="ml-4 mt-2">
-                                <h5 class="font-weight-bold">已确认</h5>
+                <div  class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2"><h5 class="font-weight-bold">{{ $owner->name }}</h5><p class="text-muted">货主</p></span>
+                    </div>
+                </div>
+                <div v-if="(isArchived===1)"  class="col-3">
+                    <div class="row pt-2">
+                        <span  class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true" style="color: #4c2584;opacity: 0.3"></span>
+                        <span  class="ml-4 mt-2"><h5 class="font-weight-bold">已确认</h5></span>
+                    </div>
+                </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'areaFee/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
                             </span>
+                        </form>
+                    </div>
+                </div>
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover table-bordered" id="table">
                 <tr>
@@ -59,23 +77,6 @@
                 </tr>
             </table>
         </div>
-        <div class="container" v-if="!(isArchived===1)">
-            <div class="row">
-                <div class="col-10"></div>
-                <div class="col-2">
-                    <form action="{{ 'areaFee/confirmBill' }}" method="post" style="display: inline-block;"
-                          onsubmit="return confirm('您确定要确认金额吗?');">
-                        {{ csrf_field() }}
-                        <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
-                        <input type="hidden" name="year" value="{{ $request['year']??'' }}">
-                        <input type="hidden" name="month" value="{{ $request['month']??''}}">
-                        <button type="submit" class="btn btn-outline-success btn-sm">
-                            <i class="far fa-trash-alt"></i> 确认金额
-                        </button>
-                    </form>
-                </div>
-            </div>
-        </div>
     </div>
 @endsection
 @section('lastScript')

+ 30 - 27
resources/views/finance/settlementBills/logisticFee/detail/index.blade.php

@@ -19,16 +19,35 @@
                     </span>
             </div>
             <div class="row">
-                <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
-                <span class="ml-4 mt-2">
-                                <h5 class="font-weight-bold">{{ $owner->name }}</h5>
-                                <p class="text-muted">货主</p>
-                            </span>
-                <span v-if="(isArchived===1)" class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true"
-                      style="color: #4c2584;opacity: 0.3"></span>
-                <span v-if="(isArchived===1)" class="ml-4 mt-2">
-                                <h5 class="font-weight-bold">已确认</h5>
+                <div  class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2"><h5 class="font-weight-bold">{{ $owner->name }}</h5><p class="text-muted">货主</p></span>
+                    </div>
+                </div>
+                <div  v-if="(isArchived===1)" class="col-3">
+                    <div class="row pt-2">
+                      <span  class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true" style="color: #4c2584;opacity: 0.3"></span>
+                      <span  class="ml-4 mt-2"><h5 class="font-weight-bold">已确认</h5></span>
+                    </div>
+                </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'detail/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
                             </span>
+
+                        </form>
+                    </div>
+                </div>
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover table-bordered" id="table">
                 <tr v-for="(detail,i) in details"
@@ -48,27 +67,11 @@
                     <td>@{{ detail.logistic_fee }}</td>
                 </tr>
             </table>
-            <div class="container" v-if="!(isArchived===1) && details.length>0">
-                <div class="row">
-                    <div class="col-10"></div>
-                    <div class="col-2">
-                        <form action="{{ 'detail/confirmBill' }}" method="post" style="display: inline-block;"
-                              onsubmit="return confirm('您确定要确认金额吗?');">
-                            {{ csrf_field() }}
-                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
-                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
-                            <input type="hidden" name="month" value="{{ $request['month']??''}}">
-                            <button type="submit" class="btn btn-outline-success btn-sm">
-                                <i class="far fa-trash-alt"></i> 确认金额
-                            </button>
-                        </form>
-                    </div>
-                </div>
-            </div>
             <div class="text-info h5 btn btn">{{$details->count()}}/{{$details->total()}}</div>
             {{$details->appends($paginateParams)->links()}}
         </div>
-        <textarea id="clipboardDiv" style="opacity:0"></textarea>
+        <textarea hidden id="clipboardDiv" style="opacity:0"></textarea>
+
     </div>
 @endsection
 @section('lastScript')

+ 26 - 18
resources/views/finance/settlementBills/logisticFee/report/index.blade.php

@@ -58,6 +58,23 @@
                             </span>
                     </div>
                 </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'report/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
+                            </span>
+
+                        </form>
+                    </div>
+                </div>
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover table-bordered" id="table">
                 <tr v-for="(report,i) in reports"
@@ -77,23 +94,14 @@
                     <td>@{{ report.fee }}</td>
                 </tr>
             </table>
-            <div class="container" v-if="!(isArchived===1) && reports.length>0">
-                <div class="row">
-                    <div class="col-10"></div>
-                    <div class="col-2">
-                        <form action="{{ 'report/confirmBill' }}" method="post" style="display: inline-block;"
-                              onsubmit="return confirm('您确定要确认金额吗?');">
-                            {{ csrf_field() }}
-                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
-                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
-                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
-                            <button type="submit" class="btn btn-outline-success btn-sm">
-                                <i class="far fa-trash-alt"></i> 确认金额
-                            </button>
-                        </form>
-                    </div>
-                </div>
-            </div>
+{{--            <div class="container" v-if="!(isArchived===1) && reports.length>0">--}}
+{{--                <div class="row">--}}
+{{--                    <div class="col-10"></div>--}}
+{{--                    <div class="col-2">--}}
+{{--                   --}}
+{{--                    </div>--}}
+{{--                </div>--}}
+{{--            </div>--}}
 <!--不是存档的展示分页            -->
             @if($isArchived===2 )
                 <div class="text-info h5 btn btn">{{$reportPaginator->count()??''}}
@@ -101,7 +109,7 @@
                 <span>{{$reportPaginator->appends($paginateParams)->links()??''}}</span>
             @endif
         </div>
-        <textarea id="clipboardDiv" style="opacity:0"></textarea>
+        <textarea hidden id="clipboardDiv" style="opacity:0"></textarea>
     </div>
 @endsection
 @section('lastScript')

+ 35 - 27
resources/views/finance/settlementBills/storeFee/detail/index.blade.php

@@ -19,16 +19,41 @@
                     </span>
             </div>
             <div class="row">
-                <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
-                <span class="ml-4 mt-2">
+                <div class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
                                 <h5 class="font-weight-bold">{{ $owner->name }}</h5>
                                 <p class="text-muted">货主</p>
                             </span>
-                <span v-if="(isArchived===1)" class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true"
-                      style="color: #4c2584;opacity: 0.3"></span>
-                <span v-if="(isArchived===1)" class="ml-4 mt-2">
+                    </div>
+                </div>
+                <div v-if="(isArchived===1)" class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true"
+                                      style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
                                 <h5 class="font-weight-bold">已确认</h5>
                             </span>
+                    </div>
+                </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'detail/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
+                            </span>
+
+                        </form>
+                    </div>
+                </div>
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover table-bordered" id="table">
                 <tr v-for="(detail,i) in details"
@@ -46,27 +71,10 @@
                     <td>@{{ detail.owner_fee_detail.work_fee }}</td>
                 </tr>
             </table>
-            <div class="container" v-if="!(isArchived===1) && details.length>0">
-                <div class="row">
-                    <div class="col-10"></div>
-                    <div class="col-2">
-                        <form action="{{ 'detail/confirmBill' }}" method="post" style="display: inline-block;"
-                              onsubmit="return confirm('您确定要确认金额吗?');">
-                            {{ csrf_field() }}
-                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
-                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
-                            <input type="hidden" name="month" value="{{ $request['month']??''}}">
-                            <button type="submit" class="btn btn-outline-success btn-sm">
-                                <i class="far fa-trash-alt"></i> 确认金额
-                            </button>
-                        </form>
-                    </div>
-                </div>
-            </div>
             <div class="text-info h5 btn btn">{{$details->count()}}/{{$details->total()}}</div>
             {{$details->appends($paginateParams)->links()}}
         </div>
-        <textarea id="clipboardDiv" style="opacity:0"></textarea>
+        <textarea hidden id="clipboardDiv" style="opacity:0"></textarea>
     </div>
 @endsection
 @section('lastScript')
@@ -182,10 +190,10 @@
                     if (sign) {
                         excelExport(true, checkData, url, this.total, token);
                     } else {
-                        excelExport(false, checkData, url, null, token,{
-                            owner_id:this.owner.id,
-                            year:this.request.year,
-                            month:this.request.month,
+                        excelExport(false, checkData, url, null, token, {
+                            owner_id: this.owner.id,
+                            year: this.request.year,
+                            month: this.request.month,
                         });
                     }
                 },

+ 17 - 18
resources/views/finance/settlementBills/storeFee/report/index.blade.php

@@ -54,6 +54,23 @@
                             </span>
                     </div>
                 </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'report/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
+                            </span>
+
+                        </form>
+                    </div>
+                </div>
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover table-bordered">
                 <tr>
@@ -83,25 +100,7 @@
                         :rowspan="calRowspan('退货入库')">{{ $backFee }}</td>
                 </tr>
             </table>
-            <div class="container" v-if="!(isArchived===1) && reports.length>0">
-                <div class="row">
-                    <div class="col-10"></div>
-                    <div class="col-2">
-                        <form action="{{ 'report/confirmBill' }}" method="post" style="display: inline-block;"
-                              onsubmit="return confirm('您确定要确认金额吗?');">
-                            {{ csrf_field() }}
-                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
-                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
-                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
-                            <button type="submit" class="btn btn-outline-success btn-sm">
-                                <i class="far fa-trash-alt"></i> 确认金额
-                            </button>
-                        </form>
-                    </div>
-                </div>
-            </div>
         </div>
-        <textarea id="clipboardDiv" style="opacity:0"></textarea>
     </div>
 @endsection
 @section('lastScript')

+ 198 - 0
resources/views/finance/settlementBills/storeOutFee/detail/index.blade.php

@@ -0,0 +1,198 @@
+@extends('layouts.app')
+
+@section('content')
+    @include('shared._messages')
+    @include('shared._error')
+    <div id="list" class="d-none">
+        <div class="container-fluid">
+            <div id="form_div"></div>
+            <div class="ml-3 form-inline" id="btn">
+                    <span class="dropdown">
+                        <button type="button"
+                                class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                                data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
+                        </button>
+                        <div class="dropdown-menu">
+                            <a class="dropdown-item" @click="detailExport(false)" href="javascript:">导出勾选内容</a>
+                            <a class="dropdown-item" @click="detailExport(true)" href="javascript:">导出所有页</a>
+                        </div>
+                    </span>
+            </div>
+            <div class="row">
+                <div  class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2"><h5 class="font-weight-bold">{{ $owner->name }}</h5><p class="text-muted">货主</p></span>
+                    </div>
+                </div>
+                <div  v-if="(isArchived===1)" class="col-3">
+                    <div class="row pt-2">
+                        <span  class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true" style="color: #4c2584;opacity: 0.3"></span>
+                        <span  class="ml-4 mt-2"><h5 class="font-weight-bold">已确认</h5></span>
+                    </div>
+                </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'detail/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
+                            </span>
+
+                        </form>
+                    </div>
+                </div>
+            </div>
+            <table class="table table-striped table-sm text-nowrap table-hover table-bordered" id="table">
+                <tr v-for="(detail,i) in details"
+                    @click="selectTr===i+1?selectTr=0:selectTr=i+1"
+                    :class="selectTr===i+1?'focusing' : ''">
+                    <td><input class="checkItem" type="checkbox" :value="detail.id"></td>
+                    <td>@{{ i+1 }}</td>
+                    <td>@{{ detail.owner_fee_detail.worked_at }}</td>
+                    <td>@{{ detail.work_name }}</td>
+                    <td>@{{ detail.source_bill }}</td>
+                    <td>@{{ detail.owner_fee_detail.operation_bill }}</td>
+                    <td>@{{ detail.commodity.sku }}</td>
+                    <td>@{{ detail.commodity.name }}</td>
+{{--                    <td>@{{ detail.amount}}</td>--}}
+                    <td>@{{ detail.owner_fee_detail.commodity_amount}}</td>
+                    <td>@{{ detail.price }}</td>
+                    <td>@{{ detail.owner_fee_detail.work_fee }}</td>
+                </tr>
+            </table>
+            <div class="text-info h5 btn btn">{{$details->count()}}/{{$details->total()}}</div>
+            {{$details->appends($paginateParams)->links()}}
+        </div>
+        <textarea hidden id="clipboardDiv" style="opacity:0"></textarea>
+    </div>
+@endsection
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                owner: {!! $owner !!},
+                details: [@foreach($details as $detail){!! $detail !!}, @endforeach],
+                owners: [@foreach($owners as $owner){name: '{{ $owner->id }}', value: '{{ $owner->name}}'},@endforeach],
+                isArchived: {!! $isArchived !!},
+                request: {!! $request !!},
+                selectTr: 0,
+            },
+            created() {
+            },
+            mounted() {
+                $('#list').removeClass('d-none');
+                let _this = this;
+                $(".up").slideUp();
+                let data = [
+                    [
+                        {
+                            name: 'owner_id',
+                            type: 'select',
+                            tip: ['多货主权限选择查看指定货主,默认为权限下的第一个货主'],
+                            placeholder: ['货主'],
+                            data: _this.owners,
+                        },
+                        {
+                            name: 'year',
+                            type: 'select',
+                            tip: ['默认为时间上一个月所属年份'],
+                            placeholder: ['年'],
+                            data: [
+                                {name: 2021, value: 2021},
+                                {name: 2022, value: 2022},
+                                {name: 2023, value: 2023},
+                                {name: 2024, value: 2024},
+                                {name: 2025, value: 2025},
+                                {name: 2026, value: 2026},
+                                {name: 2027, value: 2027},
+                                {name: 2028, value: 2028},
+                                {name: 2029, value: 2029},
+                                {name: 2030, value: 2030},
+                                {name: 2031, value: 2031},
+                                {name: 2032, value: 2032},
+                                {name: 2033, value: 2033},
+                                {name: 2034, value: 2034},
+                                {name: 2035, value: 2035},
+                                {name: 2036, value: 2036},
+
+                            ],
+                        },
+                        {
+                            name: 'month',
+                            type: 'select',
+                            tip: ['默认为上一月'],
+                            placeholder: ['月'],
+                            data: [
+                                {name: 1, value: 1},
+                                {name: 2, value: 2},
+                                {name: 3, value: 3},
+                                {name: 4, value: 4},
+                                {name: 5, value: 5},
+                                {name: 6, value: 6},
+                                {name: 7, value: 7},
+                                {name: 8, value: 8},
+                                {name: 9, value: 9},
+                                {name: 10, value: 10},
+                                {name: 11, value: 11},
+                                {name: 12, value: 12},
+                            ],
+                        },
+                    ]
+                ];
+                _this.form = new query({
+                    el: '#form_div',
+                    condition: data,
+                    appendDom: "btn",
+                });
+                _this.form.init();
+                let column = [
+                    {name: 'index', value: '序号', neglect: true},
+                    {name: 'worked_at', value: '作业时间'},
+                    {name: 'work_type', value: '作业名称'},
+                    {name: 'source_bill', value: '上游单号'},
+                    {name: 'operation_bill', value: '订单号'},
+                    {name: 'sku', value: '商品条码'},
+                    {name: 'commodity_name', value: '商品名称'},
+                    {name: 'amount', value: '商品数量'},
+                    {name: 'price', value: '价格'},
+                    {name: 'fee', value: '合计'},
+                ];
+                new Header({
+                    el: "table",
+                    name: "detail",
+                    column: column,
+                    data: this.details,
+                    restorationColumn: 'addtime',
+                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
+                }).init();
+            },
+            methods: {
+                detailExport(sign) {
+                    let url = '{{url('finance/settlementBills/storeOutFee/detail/export')}}';
+                    let token = '{{ csrf_token() }}';
+                    if (sign) {
+                        excelExport(true, checkData, url, this.total, token);
+                    } else {
+                        excelExport(false, checkData, url, null, token,{
+                            owner_id:this.owner.id,
+                            year:this.request.year,
+                            month:this.request.month,
+                        });
+                    }
+                },
+            },
+            filters: {},
+        });
+    </script>
+@endsection

+ 221 - 0
resources/views/finance/settlementBills/storeOutFee/report/index.blade.php

@@ -0,0 +1,221 @@
+@extends('layouts.app')
+
+@section('content')
+    @include('shared._messages')
+    @include('shared._error')
+    <div id="list" class="d-none">
+        <div class="container-fluid">
+            <div id="form_div"></div>
+            <div class="ml-3 form-inline" id="btn">
+                    <span class="dropdown">
+                        <button type="button"
+                                class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                                data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
+                        </button>
+                        <div class="dropdown-menu">
+                            <a class="dropdown-item" @click="reportExport(true)" href="javascript:">导出所有页</a>
+                        </div>
+                    </span>
+            </div>
+            <div class="row">
+                <div class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-user fa-4x offset-md-3" style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
+                                <h5 class="font-weight-bold">@{{ owner.name }}</h5>
+                                <p class="text-muted">货主</p>
+                            </span>
+                    </div>
+                </div>
+                <div class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-cubes fa-4x offset-md-3" style="color: #9fcdff;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
+                                <h5 class="font-weight-bold">{{ $totalAmount }}</h5>
+                                <p class="text-muted">单量合计</p>
+                            </span>
+                    </div>
+                </div>
+                <div class="col-3">
+                    <div class="row pt-2">
+                        <span class="fa fa-jpy fa-4x offset-md-3" style="color: #2ca02c;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
+                        <h5 class="font-weight-bold">{{ $totalFee }}</h5>
+                        <p class="text-muted">总金额</p>
+                        </span>
+                    </div>
+                </div>
+                <div v-if="(isArchived===1)" class="col-3">
+                    <div class="row pt-2">
+                       <span class="fa fa-check-circle  fa-4x offset-md-3" aria-hidden="true"
+                             style="color: #4c2584;opacity: 0.3"></span>
+                        <span class="ml-4 mt-2">
+                                <h5 class="font-weight-bold">已确认</h5>
+                            </span>
+                    </div>
+                </div>
+                <div v-else class="col-3">
+                    <div class="row pt-2">
+                        <form action="{{ 'report/confirmBill' }}" method="post" style="display: inline-block;"
+                              onsubmit="return confirm('您确定要确认金额吗?');">
+                            {{ csrf_field() }}
+                            <input type="hidden" name="owner_id" value="{{ $request['owner_id']??'' }}">
+                            <input type="hidden" name="year" value="{{ $request['year']??'' }}">
+                            <input type="hidden" name="month" value="{{ $request['month']??'' }}">
+                            <span class="ml-4 mt-2">
+                              <button type="submit" class="btn btn-success btn-lg">
+                                <i class="far fa-trash-alt"></i> 确认金额
+                            </button>
+                            </span>
+
+                        </form>
+                    </div>
+                </div>
+            </div>
+            <table class="table table-striped table-sm text-nowrap table-hover table-bordered">
+                <tr>
+                    <th>名称</th>
+                    <th>单价</th>
+                    <th>数量</th>
+                    <th>合计</th>
+                </tr>
+                <tr v-for="(report,i) in reports"
+                    @click="selectTr===i+1?selectTr=0:selectTr=i+1"
+                    :class="selectTr===i+1?'focusing' : ''">
+                    <td class="text-center pt-4 bg-light"
+                        v-if="(i==0 || report.type!== reports[i-1].type)&&report.type==='新品入库'"
+                        :rowspan="calRowspan('新品入库')">@{{ report.type }}
+                    </td>
+                    <td class="text-center pt-4 bg-light"
+                        v-if="(i==0 || report.type!== reports[i-1].type)&&report.type==='退货入库'"
+                        :rowspan="calRowspan('退货入库')">@{{ report.type }}
+                    </td>
+                    <td>@{{ report.unit_price }}(元/@{{ report.unit.name }})</td>
+                    <td>@{{ report.amount }}</td>
+                    <td class="text-center pt-4 bg-light"
+                        v-if="(i==0 || report.type!== reports[i-1].type)&&report.type==='新品入库'"
+                        :rowspan="calRowspan('新品入库')">{{ $newFee }}</td>
+                    <td class="text-center pt-4 bg-light"
+                        v-if="(i==0 || report.type!== reports[i-1].type)&&report.type==='退货入库'"
+                        :rowspan="calRowspan('退货入库')">{{ $backFee }}</td>
+                </tr>
+            </table>
+        </div>
+    </div>
+@endsection
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                owner: {!! $owner !!},
+                reports: {!! $reports !!},
+                owners: [@foreach($owners as $owner){name: '{{ $owner->id }}', value: '{{ $owner->name}}'},@endforeach],
+                isArchived: {!! $isArchived !!},
+                request: {!! $request !!},
+                selectTr: 0,
+            },
+            created() {
+            },
+            mounted() {
+                $('#list').removeClass('d-none');
+
+                let map = [];
+                this.reports.forEach(function (item) {
+                    if (!map[item.type]) map[item.type] = 0
+                    map[item.type]++;
+                })
+
+                let _this = this;
+                $(".up").slideUp();
+                let data = [
+                    [
+                        {
+                            name: 'owner_id',
+                            type: 'select',
+                            tip: ['多货主权限选择查看指定货主,默认为权限下的第一个货主'],
+                            placeholder: ['货主'],
+                            data: _this.owners,
+                        },
+                        {
+                            name: 'year',
+                            type: 'select',
+                            tip: ['默认为时间上一个月所属年份'],
+                            placeholder: ['年'],
+                            data: [
+                                {name: 2021, value: 2021},
+                                {name: 2022, value: 2022},
+                                {name: 2023, value: 2023},
+                                {name: 2024, value: 2024},
+                                {name: 2025, value: 2025},
+                                {name: 2026, value: 2026},
+                                {name: 2027, value: 2027},
+                                {name: 2028, value: 2028},
+                                {name: 2029, value: 2029},
+                                {name: 2030, value: 2030},
+                                {name: 2031, value: 2031},
+                                {name: 2032, value: 2032},
+                                {name: 2033, value: 2033},
+                                {name: 2034, value: 2034},
+                                {name: 2035, value: 2035},
+                                {name: 2036, value: 2036},
+
+                            ],
+                        },
+                        {
+                            name: 'month',
+                            type: 'select',
+                            tip: ['默认为上一月'],
+                            placeholder: ['月'],
+                            data: [
+                                {name: 1, value: 1},
+                                {name: 2, value: 2},
+                                {name: 3, value: 3},
+                                {name: 4, value: 4},
+                                {name: 5, value: 5},
+                                {name: 6, value: 6},
+                                {name: 7, value: 7},
+                                {name: 8, value: 8},
+                                {name: 9, value: 9},
+                                {name: 10, value: 10},
+                                {name: 11, value: 11},
+                                {name: 12, value: 12},
+                            ],
+                        },
+                    ]
+                ];
+                _this.form = new query({
+                    el: '#form_div',
+                    condition: data,
+                    appendDom: 'btn'
+                });
+                _this.form.init();
+            },
+            methods: {
+                isShowColumn(preType, type, targetType, i) {
+                    return (i === 0 || type !== preType) && type === targetType
+                },
+                calRowspan(type) {
+                    return this.reports.filter(item => item.type === type).length;
+                },
+                reportExport(sign) {
+                    let url = '{{url('finance/settlementBills/storeFee/report/export')}}';
+                    let token = '{{ csrf_token() }}';
+                    if (sign) {
+                        excelExport(true, checkData, url, this.total, token);
+                    } else {
+                        excelExport(false, checkData, url, null, token, {
+                            owner_id: this.owner.id,
+                            year: this.request.year,
+                            month: this.request.month,
+                        });
+                    }
+                },
+            },
+            filters: {},
+        });
+    </script>
+@endsection

+ 9 - 0
routes/web.php

@@ -805,6 +805,15 @@ Route::group(['prefix'=>'finance'],function(){
             Route::get('detail', 'OwnerStoreFeeDetailController@index');
             Route::get('report', 'OwnerStoreFeeReportController@index');
         });
+
+        Route::group(['prefix' => 'storeOutFee'], function () {
+            Route::post('detail/confirmBill', 'OwnerStoreOutFeeDetailController@confirmBill');
+//            Route::post('report/confirmBill', 'OwnerStoreFeeReportController@confirmBill');
+            Route::any('detail/export', 'OwnerStoreOutFeeDetailController@export');
+//            Route::any('report/export', 'OwnerStoreFeeReportController@export');
+            Route::get('detail', 'OwnerStoreOutFeeDetailController@index');
+//            Route::get('report', 'OwnerStoreFeeReportController@index');
+        });
     });
 });