Selaa lähdekoodia

window.manuallyHairouRequesting=true

LD 5 vuotta sitten
vanhempi
commit
f53ca8f24a
36 muutettua tiedostoa jossa 1236 lisäystä ja 907 poistoa
  1. 66 0
      app/Http/Controllers/PrintPartController.php
  2. 49 0
      app/Http/Controllers/PrintTemplateController.php
  3. 19 0
      app/Http/Controllers/TestController.php
  4. 15 0
      app/PrintPart.php
  5. 14 0
      app/PrintTemplate.php
  6. 4 0
      app/Providers/AppServiceProvider.php
  7. 13 0
      app/Services/PrintPartService.php
  8. 13 0
      app/Services/PrintTemplateService.php
  9. 13 0
      database/factories/PrintPartFactory.php
  10. 13 0
      database/factories/PrintTemplateFactory.php
  11. 33 0
      database/migrations/2021_02_07_095609_create_print_parts_table.php
  12. 33 0
      database/migrations/2021_02_07_095839_create_print_templates_table.php
  13. 18 0
      database/seeds/PrintPartSeeder.php
  14. 18 0
      database/seeds/PrintTemplateSeeder.php
  15. 1 0
      package.json
  16. 11 0
      resources/js/utilities/html2canvas.js
  17. 1 1
      resources/views/layouts/menu.blade.php
  18. 12 0
      resources/views/maintenance/expressPrinting/menu.blade.php
  19. 19 0
      resources/views/maintenance/expressPrinting/part/_table.blade.php
  20. 213 0
      resources/views/maintenance/expressPrinting/part/create.blade.php
  21. 37 0
      resources/views/maintenance/expressPrinting/part/index.blade.php
  22. 12 0
      resources/views/maintenance/expressPrinting/part/menu.blade.php
  23. 149 0
      resources/views/maintenance/expressPrinting/print/index.blade.php
  24. 9 0
      resources/views/maintenance/expressPrinting/print/menu.blade.php
  25. 85 0
      resources/views/maintenance/expressPrinting/template/_compile.blade.php
  26. 35 0
      resources/views/maintenance/expressPrinting/template/_produce.blade.php
  27. 11 0
      resources/views/maintenance/expressPrinting/template/_select.blade.php
  28. 177 0
      resources/views/maintenance/expressPrinting/template/create.blade.php
  29. 52 0
      resources/views/maintenance/expressPrinting/template/index.blade.php
  30. 12 0
      resources/views/maintenance/expressPrinting/template/menu.blade.php
  31. 6 1
      resources/views/maintenance/menu.blade.php
  32. 4 0
      resources/views/station/monitor/show.blade.php
  33. 44 905
      resources/views/test.blade.php
  34. 15 0
      routes/apiLocal.php
  35. 9 0
      routes/web.php
  36. 1 0
      webpack.mix.js

+ 66 - 0
app/Http/Controllers/PrintPartController.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Components\AsyncResponse;
+use App\Order;
+use App\PrintPart;
+use App\PrintTemplate;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Http;
+
+class PrintPartController extends Controller
+{
+    use AsyncResponse;
+    public function index(Request $request)
+    {
+        $printParts = PrintPart::query()->paginate($request['paginate'] ?? 50);
+        return view('/maintenance/expressPrinting/part/index',compact('printParts'));
+    }
+
+    public function create(Request $request)
+    {
+        return view('/maintenance/expressPrinting/part/create');
+    }
+
+    public function storeApi(Request $request): \Illuminate\Http\RedirectResponse
+    {
+        PrintPart::query()->create($request->all());
+        $this->success('添加成功');
+    }
+
+    public function destroyApi(Request $request)
+    {
+        $printPart = PrintPart::query()->find($request['id']);
+        $printPart->delete();
+        $this->success('删除成功');
+    }
+
+    public function print(Request $request)
+    {
+        $template = PrintTemplate::query()->where('name','test-快递单号打印')->first();
+        $items = Order::query()->whereIn('code',["SO190628000378","SO190628000347"])->with('packages')->get();
+        return view("maintenance.expressPrinting.print.index",compact("template",'items'));
+    }
+
+    public function printTemplateApi(Request $request)
+    {
+        $file = $request->file("blob");
+        $content = $file->getContent();
+        $content = base64_encode($content);
+        $files = $request->file("blobs");
+
+        $content = [
+            "type" => "print",
+            "aliasName"=>"admin",
+            "printerName"=>"admin123",
+            "content" => $content
+        ];
+        if(!$files)return Http::post("http://127.0.0.1:3000",$content);
+        $contents = [];
+        foreach ($files as $item) {
+            $contents[] = base64_encode($item->getContent());
+        }
+        return Http::post("http://127.0.0.1:3000",['file'=>$content,'files'=>$contents]);
+    }
+}

+ 49 - 0
app/Http/Controllers/PrintTemplateController.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Components\AsyncResponse;
+use App\PrintPart;
+use App\PrintTemplate;
+use Illuminate\Http\Request;
+
+class PrintTemplateController extends Controller
+{
+    use AsyncResponse;
+    public function index(Request $request)
+    {
+        $templates = PrintTemplate::all();
+        return view('/maintenance/expressPrinting/template/index',compact('templates'));
+    }
+
+    public function create(Request $request)
+    {
+        $printParts = PrintPart::all();
+        return view('/maintenance/expressPrinting/template/create',compact('printParts'));
+    }
+
+
+    public function storeApi(Request $request)
+    {
+        $data = [
+            'name' =>$request['name'],
+            'value'=>json_encode($request['value'])
+        ];
+        $printTemplate = PrintTemplate::query()->create($data);
+        $this->success(['data' => $printTemplate]);
+    }
+
+    public function updateApi(Request $request)
+    {
+
+    }
+
+    public function destroyApi(Request $request)
+    {
+        $printTemplate = PrintTemplate::query()->find($request['id']);
+        $printTemplate->delete();
+        $this->success('删除成功');
+    }
+
+
+}

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

@@ -1503,4 +1503,23 @@ TEXT;
             ]);
         }
     }
+
+    public function testPrint(Request $request)
+    {
+        return (new PrintPartController())->print($request);
+    }
+
+    public function testSendCon(Request $request)
+    {
+        $content = [
+            "type" => "getClients",
+            "aliasName" => "test",
+            "printerName" => "打印机5",
+        ];
+        $post = Http::post("http://127.0.0.1:3000", $content);
+        $body = json_decode($post->body(),true);
+        $body['msg'] = json_decode($body['msg'],true);
+        dd(json_decode($post->body()),$post->body(),$body);
+    }
+
 }

+ 15 - 0
app/PrintPart.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class PrintPart extends Model
+{
+    use ModelLogChanging;
+
+    //
+    protected $fillable = ['name','value'];
+}

+ 14 - 0
app/PrintTemplate.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class PrintTemplate extends Model
+{
+    use ModelLogChanging;
+
+    protected $fillable = ['name','value'];
+}

+ 4 - 0
app/Providers/AppServiceProvider.php

@@ -104,6 +104,8 @@ use App\Services\UserWorkgroupService;
 use App\Services\DischargeTaskService;
 use App\Services\DeliveryAppointmentService;
 use App\Services\StationCacheShelfGridService;
+use App\Services\PrintPartService;
+use App\Services\PrintTemplateService;
 use Illuminate\Queue\Events\JobFailed;
 use Illuminate\Support\Facades\Queue;
 use Illuminate\Support\Facades\Schema;
@@ -230,6 +232,8 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('OwnerStoragePriceModelService',OwnerStoragePriceModelService::class);
         app()->singleton('PackageService',PackageService::class);
         app()->singleton('PackageStatisticsService',PackageStatisticsService::class);
+        app()->singleton('PrintPartService',PrintPartService::class);
+        app()->singleton('PrintTemplateService',PrintTemplateService::class);
         app()->singleton('ProcessMethodService',ProcessMethodService::class);
         app()->singleton('ProcessService',ProcessService::class);
         app()->singleton('ProcessStatisticService',ProcessStatisticService::class);

+ 13 - 0
app/Services/PrintPartService.php

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

+ 13 - 0
app/Services/PrintTemplateService.php

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

+ 13 - 0
database/factories/PrintPartFactory.php

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

+ 13 - 0
database/factories/PrintTemplateFactory.php

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

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

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePrintPartsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('print_parts', function (Blueprint $table) {
+            $table->id();
+            $table->string('name');
+            $table->text('value');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('print_parts');
+    }
+}

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

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePrintTemplatesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('print_templates', function (Blueprint $table) {
+            $table->id();
+            $table->string('name')->index();
+            $table->text('value')->comment('组件id,坐标 等集合');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('print_templates');
+    }
+}

+ 18 - 0
database/seeds/PrintPartSeeder.php

@@ -0,0 +1,18 @@
+<?php
+
+use Illuminate\Database\Seeder;
+use App\PrintPart;
+
+class PrintPartSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        $printParts = factory(PrintPart::class)->times(100)->make()->toArray();
+        PrintPart::query()->insert($printParts);
+    }
+}

+ 18 - 0
database/seeds/PrintTemplateSeeder.php

@@ -0,0 +1,18 @@
+<?php
+
+use Illuminate\Database\Seeder;
+use App\PrintTemplate;
+
+class PrintTemplateSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        $printTemplate = factory(PrintTemplate::class)->times(100)->make()->toArray();
+        PrintTemplate::query()->insert($printTemplate);
+    }
+}

+ 1 - 0
package.json

@@ -29,6 +29,7 @@
     "davidshimjs-qrcodejs": "0.0.2",
     "echarts": "^4.9.0",
     "element-ui": "^2.14.1",
+    "html2canvas": "^1.0.0-rc.7",
     "jquery.cookie": "^1.4.1",
     "js-cookie": "^2.2.1",
     "jsbarcode": "^3.11.3",

+ 11 - 0
resources/js/utilities/html2canvas.js

@@ -0,0 +1,11 @@
+import html2canvas from'html2canvas'
+
+window.canvasImg = function(dom,imageDiv,scale=1,func){
+    html2canvas($(dom)[0],{
+        _backgroundColor:null,
+        useCORS:true,
+        scale:scale
+    }).then(canvas=>{
+        func(canvas);
+    });
+}

+ 1 - 1
resources/views/layouts/menu.blade.php

@@ -53,7 +53,7 @@
                     <span class="fa fa-header" style="color: #72441b"></span>
                     人事管理</a></li> @endcan
         @can('站管理')
-            <li class="nav-item"><a href="{{url("station/index")}}" class="nav-link" target="station/index"
+            <li class="nav-item"><a href="{{url("station/monitor/index")}}" class="nav-link" target="station/monitor/index"
                                     :class="{active:isActive('station',1)}">
                     <span class="fa fa-share-alt-square" style="color: #72441b"></span>
                     站管理</a></li> @endcan

+ 12 - 0
resources/views/maintenance/expressPrinting/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/part" class="nav-link" href="{{url('/maintenance/expressPrinting/part')}}" :class="{active:isActive('part',3)}">组件</a>
+            </li>
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/template" class="nav-link" href="{{url('/maintenance/expressPrinting/template/index')}}" :class="{active:isActive('template',3)}">模板</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 19 - 0
resources/views/maintenance/expressPrinting/part/_table.blade.php

@@ -0,0 +1,19 @@
+<div class="container-fluid">
+    <table class="table table-striped table-sm table-hover" id="print-part-table">
+        <tr class="text-center">
+            <td>序号</td>
+            <td>名称</td>
+            <td>内容</td>
+            <td>操作</td>
+        </tr>
+        <tr  class="text-center" v-for="(printPart,i) in printParts" :key="i">
+            <td>@{{ i+1 }}</td>
+            <td>@{{ printPart.name }}</td>
+            <td>@{{ printPart.value }}</td>
+            <td>
+                <button type="button" class="btn btn-sm btn-danger" @click="destroy(printPart.id,i)">删除</button>
+            </td>
+        </tr>
+    </table>
+    {{$printParts->links()}}
+</div>

+ 213 - 0
resources/views/maintenance/expressPrinting/part/create.blade.php

@@ -0,0 +1,213 @@
+@extends('layouts.app')
+@section('title')组件创建@endsection
+
+@section('content')
+    <span class="nav">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.part.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none" id="create-print-part">
+        <div class="row">
+            <div class="col-3">
+                <div class="card">
+                    <div class="card-header">
+                        基础设置
+                    </div>
+                    <div class="card-body">
+                        <div class="form-group">
+                            <label for="template-width">宽</label>
+                            <input type="number" id="template-width" v-model="template.width" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for=template-height>高</label>
+                            <input type="number" id="template-height" v-model="template.height" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for="template-border-type">边框类型</label>
+                            <select class="form-control" id="template-border-type" v-model="template.borderStyle">
+                                <option v-for="style in borderStyles" :value="style.value">@{{ style.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-border-weight">边框大小</label>
+                            <input type="number" id="template-border-weight" v-model="template.borderWidth" class="form form-control">
+                        </div>
+                    </div>
+                    <div class="card-footer">
+                        <button type="button" class="btn btn-success" @click="show">保存当前模板</button>
+                    </div>
+                </div>
+            </div>
+            <div class="col-6 justify-content-center align-items-center flex-fill" >
+                {{-- 模板展示--}}
+                <div v-if="template.type==='text'" :style="getStyle()">
+                    <span >@{{ template.text }}</span>
+                </div>
+                {{-- 二维码展示 --}}
+                <svg v-show="template.type!=='text'" :style="{width:template.width,height:template.height}" id="barcodeDiv1">
+                </svg>
+            </div>
+            <div class="col-3">
+                {{-- 属性 --}}
+                <div class="card">
+                    <div class="card-header">
+                        设置
+                    </div>
+                    <div class="card-body">
+                        <div class="form-group">
+                            <label for="template-type">组件类型</label>
+                            <select class="form-control" v-model="template.type" @change="setContent">
+                                <option v-for="type in types" :value="type.value">@{{ type.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text">内容</label>
+                            <textarea id="template-text" class="form-text form-control" cols="5" rows="5" v-model="template.text"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text-align">文本对齐方式</label>
+                            <select name="" id="template-text-align" v-model="template.justifyContent" class="form form-control">
+                                <option v-for="justifyContent in justifyContents" :value="justifyContent.value">@{{ justifyContent.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text-align">文本垂直对齐</label>
+                            <select name="" id="template-text-align" v-model="template.alignItems" class="form form-control">
+                                <option v-for="alignItem in alignItems" :value="alignItem.value">@{{  alignItem.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-font-size">字体大小</label>
+                            <input type="text" id="template-font-size" v-model="template.fontSize" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for="template-font-weight">字体宽</label>
+                            <select id="template-font-weight" v-model="template.fontWeight" class="form-control">
+                                <option v-for="fontWeight in fontWeights" :value="fontWeight.value" >@{{ fontWeight.name }}</option>
+                            </select>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="modal fade" id="saveModal" tabindex="-1"  aria-hidden="true">
+            <div class="modal-dialog">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h5 class="modal-title" id="saveModalLabel">保存组件</h5>
+                        <button type="button" class="close" data-dismiss="modal" aria-label="Close" >
+                            <span aria-hidden="true">&times;</span>
+                        </button>
+                    </div>
+                    <div class="modal-body">
+                        <form>
+                            <div class="form-group">
+                                <label for="recipient-name" class="col-form-label">组件名称</label>
+                                <input type="text" id="recipient-name" class="form-control" v-model="printPart.name">
+                            </div>
+                        </form>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-secondary" data-dismiss="modal" >关闭</button>
+                        <button type="button" class="btn btn-success" @click="create">保存</button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+
+    <script>
+        let vue = new Vue({
+            el:"#create-print-part",
+            data:{
+                printPart:{name:'',value:''},
+                template:{
+                    type:'text',
+                    width:200,
+                    height:100,
+                    borderStyle:'solid',
+                    borderWidth:1,
+                    fontSize:12,
+                    text:'',
+                    fontWeight:'normal',   //normal lighter bold
+                    justifyContent:'',     //文字水平对齐方式
+                    alignItems:'center',         //文字垂直对齐
+                },
+                types:[
+                    {name:"文本框",value:"text"},
+                    {name:"条纹码",value:"StripeCode"},
+                ],
+                fontWeights:[
+                    {name:"正常",value:"normal"},
+                    {name:"细体",value:"lighter"},
+                    {name:"粗体",value:"bold"},
+                ],
+                justifyContents:[
+                    {name:"左对齐",value:""},
+                    {name:"居中",value:"center"},
+                    {name:"右对齐",value:"flex-end"},
+                ],
+                alignItems:[
+                    {name:"顶部",value:""},
+                    {name:"居中",value:"center"},
+                    {name:"底部",value:"flex-end"},
+                ],
+                borderStyles:[
+                    {name:"默认边框",value:"solid"},
+                    {name:"无边框",value:"none"},
+                    {name:"虚线边框",value:"dashed"},
+                ]
+            },
+            mounted() {
+                $("#create-print-part").removeClass('d-none');
+            },
+            methods:{
+                show(){
+                    $('#saveModal').modal('show');
+                },
+                getStyle(){
+                    return {
+                        'display':'flex',
+                        'width':this.template.width+'px',
+                        'height':this.template.height+'px',
+                        'border-style':this.template.borderStyle,
+                        'border-width':this.template.borderWidth+'px',
+                        'font-size':this.template.fontSize+'px',
+                        'font-weight':this.template.fontWeight,
+                        'justify-content':this.template.justifyContent,
+                        'align-items':this.template.alignItems,
+                    };
+                },
+                create(){
+                    tempTip.setDuration(3000);
+                    tempTip.setIndex(2000);
+                    let value = JSON.stringify(this.template);
+                    let data = {name:this.printPart.name,value:value};
+                    window.axios.post('{{url('apiLocal/maintenance/expressPrinting/part/create')}}',data).then(res=>{
+                        if(res.data.success){
+                            tempTip.showSuccess(res.data.data);
+                            $('#saveModal').modal('hide');
+                            return;
+                        }
+                        tempTip.show(res.data.message);
+                    }).catch(err=>{
+                        tempTip.show('网络异常:'+err);
+                    });
+                },
+                setContent(){
+                    if(this.template.type === "text")return;
+                    this.template.borderStyle = 'none';
+                    let div = $("#barcodeDiv1");
+                    window.setBarcode("0123456789","#barcodeDiv1",2,50,true)
+                    this.template.width = div.width();
+                    this.template.height = div.height();
+                }
+            }
+        });
+    </script>
+@endsection

+ 37 - 0
resources/views/maintenance/expressPrinting/part/index.blade.php

@@ -0,0 +1,37 @@
+@extends('layouts.app')
+@section('title')组件@endsection
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.part.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none" id="print_part">
+        @include('maintenance.expressPrinting.part._table')
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        let vue = new Vue({
+            el:"#print_part",
+            data:{
+                printParts:{!! $printParts->toJson() !!}['data'],
+            },
+            mounted(){
+                $('#print_part').removeClass('d-none');
+            },
+            methods:{
+                destroy(id,index){
+                    if (!confirm('是否删除当前组件')) return;
+                    tempTip.setDuration(3000);
+                    window.tempTip.postBasicRequest('{{url('apiLocal/maintenance/expressPrinting/part/destroy')}}',{id:id},res=>{
+                        tempTip.showSuccess(res);
+                        this.$delete(this.printParts,index);
+                    });
+                }
+            }
+        });
+    </script>
+@endsection

+ 12 - 0
resources/views/maintenance/expressPrinting/part/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/part" class="nav-link" href="{{url('/maintenance/expressPrinting/part')}}" :class="{active:isActive('part',3)}">查询</a>
+            </li>
+            <li class="nav-item">
+                <a target="/maintenance/expressPrinting/part/create" class="nav-link" href="{{url('/maintenance/expressPrinting/part/create')}}" :class="{active:isActive('create',4)}">创建</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 149 - 0
resources/views/maintenance/expressPrinting/print/index.blade.php

@@ -0,0 +1,149 @@
+@extends("layouts.app")
+@section("title","打印")
+
+@section("content")
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.print.menu')@endcomponent
+    </span>
+    <div class="container" id="print">
+        <div class="row">
+            <div class="container">
+                <div class="input-group">
+                    <label for="scaleNumber" class="col-form-label-sm">缩放比例</label>
+                    <input id="scaleNumber" type="number" v-model="scaleNumber" class="form-control-sm">
+                    <button class="btn btn-success" @click="printImage">打印</button>
+                </div>
+            </div>
+        </div>
+        <div class="row p-0 m-0" id="img-div">
+        </div>
+        <div class="container m-0 p-0" id="print-div" :style="getByWidth(template)"  >
+            <div class="position-relative border-1 row p-0 m-0 bg-white border print-template" v-for="(item,i) in items" :style="getBgStyle(template)">
+                <div class="position-absolute" v-for="(part,index) in parts" :style="getStyle(part)">
+                    <svg v-if="isSvg(part)" :style="getSvgStyle(part)" :id="'svg'+i"  class="StripeCode">
+                        @{{ getContent(part,item) }}
+                    </svg>
+                    <span v-else>@{{ getContent(part,item) }}</span>
+                </div>
+            </div>
+        </div>
+
+    </div>
+@endsection
+
+@section("lastScript")
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/utilities/html2canvas.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            el:"#print",
+            data:{
+                template:{!! $template !!},
+                items:{!! $items !!},
+                parts:[],
+                index:0,
+                scaleNumber:1,
+            },
+            created() {
+                this.parts = JSON.parse(this.template.value);
+            },
+            mounted() {
+                $.each(this.items,(index,item)=>{
+                    window.setBarcode('123456',"#svg"+index,2,50,true);
+                    $("#svg"+index).find("svg");
+                });
+            },
+            methods:{
+                isSvg(part){
+                    return part.type==="StripeCode";
+                },
+                printingTemplate(template,items){
+                    let _this = this;
+                    $.each(items,function(i,item){
+                        _this.paddingPrintDiv(template,item);
+                    });
+                },
+                getBgStyle(template){
+                    if (this.parts === []) this.parts = JSON.parse(template.value);
+                    let style  = {};
+                    this.parts.forEach((item)=>{
+                        if(item.type==="bg"){
+                            style =  {
+                                width:item.width+'px',
+                                height:item.height+'px'
+                            }
+                        }
+                    });
+                    return style;
+                },
+                getByWidth(){
+                    if (this.parts === []) this.parts = JSON.parse(template.value);
+                    let style  = {};
+                    this.parts.forEach((item)=>{
+                        if(item.type==="bg"){
+                            style =  {
+                                width:item.width+'px',
+                                transform: "scale(" +this.scaleNumber +")",
+                                transformOrigin: "left top",
+                            }
+                        }
+                    });
+                    return style;
+                },
+                getSvgStyle(item){
+                    return {
+                        width:item.width+'px',
+                        height:item.height+'px',
+                    };
+                },
+                getStyle(item){
+                    let style = JSON.parse(JSON.stringify(item));
+                    style.display = 'flex';
+                    style['border-style'] = style.borderStyle;
+                    style['border-width'] = style.borderWidth+'px';
+                    style['font-size'] = style.fontSize+'px';
+                    style['font-weight'] = style.fontWeight;
+                    style['justify-content'] = style.justifyContent;
+                    style['align-items'] = style.alignItems;
+                    style.width+='px';
+                    style.height+='px';
+                    style.left+='px';
+                    style.top+='px';
+                    style['white-space'] = 'pre';              // 字体换行
+                    return style;
+                },
+                getContent(part,item){  // 组件内容
+                    return part.text;
+                    if(part.text.indexOf("$")===-1)return part.text;
+                    if(part.text.indexOf("+$")!==-1){
+                        let arr = part.text.split("+$");
+                        return arr[0]+item[ arr[1]];
+                    }
+                    if(part.text.indexOf("$")!==-1){
+                        let arr = part.text.split("$");
+                        return arr[0]+item[arr[1]];
+                    }
+                },
+                printImage(){
+                    let _this = this;
+                     window.canvasImg("#print-div","#img-div",this.scaleNumber,function(canvas){
+                        let data = canvas.toBlob(function (blob){
+                            let formData =new FormData();
+                            formData.append("blob",blob);
+                            _this.printData(formData);
+                        },"image/png");
+                    });
+                },
+                printData(data){
+                    window.axios.post("{{url("apiLocal/maintenance/expressPrinting/part/printTemplate")}}",data).then(res=>{
+                        tempTip.showSuccess(res);
+                    }).catch(err=>{
+                        tempTip.showSuccess(err);
+                    });
+                }
+            }
+        })
+    </script>
+@endsection

+ 9 - 0
resources/views/maintenance/expressPrinting/print/menu.blade.php

@@ -0,0 +1,9 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/print/index" class="nav-link" href="{{url('/maintenance/expressPrinting/print/index')}}" :class="{active:isActive('index',4)}">打印</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 85 - 0
resources/views/maintenance/expressPrinting/template/_compile.blade.php

@@ -0,0 +1,85 @@
+<div class="container-fluid">
+    <div class="card">
+        <form class="form">
+            <div class="card-header">
+                <button type="button" class="btn btn-success"  @click="showSaveModal">保存当前打印模板</button>
+            </div>
+            <div class="card-header" v-show="selectProducePanel">
+                <span>背景版编辑</span>
+            </div>
+            <div class="card-body" v-show="selectProducePanel">
+                <div class="form-group m-0">
+                    <label for="producePanel-width" class="col-form-label">宽</label>
+                    <input type="text" id="producePanel-width" class="form-control form-control-sm" v-model="producePanel.width">
+                </div>
+                <div class="form-group m-0">
+                    <label for="producePanel-height" class="col-form-label">高</label>
+                    <input type="text" id="producePanel-height" class="form-control form-control-sm" v-model="producePanel.height">
+                </div>
+            </div>
+            <div class="card-header">
+                <span>编辑面板</span>
+            </div>
+            <div class="card-body" v-if="productionParts.editPart">
+                <div class="form-group m-0">
+                    <label for="compile-text" class="col-form-label">文本内容</label>
+                    <textarea class="form-control" id="compile-text" cols="30" rows="5" v-model="productionParts.editPart.text"></textarea>
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-left" class="col-form-label">left</label>
+                    <input type="text" id="compile-left" class="form-control form-control-sm" v-model="productionParts.editPart.left">
+                </div>
+
+                <div class="form-group m-0">
+                    <label for="compile-top" class="col-form-label">top</label>
+                    <input type="text" id="compile-top" class="form-control form-control-sm" v-model="productionParts.editPart.top">
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-width" class="col-form-label">宽</label>
+                    <input type="text" id="compile-width" class="form-control form-control-sm" v-model="productionParts.editPart.width">
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-height" class="col-form-label text-sm-right">高</label>
+                    <input type="text" id="compile-height" class="form-control form-control-sm" v-model="productionParts.editPart.height">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-font-size" class="col-form-label text-sm-right">字体大小</label>
+                    <input type="text" id="compile-font-size" class="form-control form-control-sm" v-model="productionParts.editPart.fontSize">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-font-weight" class="col-form-label text-sm-right">字体粗细</label>
+                    <select class="form-control" id="compile-font-weight" v-model="productionParts.editPart.fontWeight">
+                        <option  value="normal">正常</option>
+                        <option  value="lighter">细体</option>
+                        <option  value="bold">粗体</option>
+                    </select>
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-z-index" class="col-form-label text-sm-right">图层</label>
+                    <input type="text" id="compile-z-index" class="form-control form-control-sm" v-model="productionParts.editPart.z_index">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-justify-content" class="col-form-label text-sm-right">文本水平对齐方式</label>
+                    <select class="form-control-sm form-control" id="compile-justify-content" v-model="productionParts.editPart.justifyContent">
+                        <option value="">左对齐</option>
+                        <option value="center">居中对齐</option>
+                        <option value="flex-end">右对齐</option>
+                    </select>
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-text-align" class="col-form-label text-sm-right">文本垂直对齐方式</label>
+                    <select class="form-control-sm form-control " id="compile-text-align" v-model="productionParts.editPart.alignItems">
+                        <option value="">顶部</option>
+                        <option value="center">垂直居中</option>
+                        <option value="flex-end">顶部</option>
+                    </select>
+                </div>
+            </div>
+            <div class="card-footer" v-show="!selectProducePanel">
+                <button type="button" class="btn btn-outline-secondary" v-show="productionParts.editPart" @click="_removePartToProductionPanel(productionParts.editPart)">删除</button>
+            </div>
+
+        </form>
+    </div>
+
+</div>

+ 35 - 0
resources/views/maintenance/expressPrinting/template/_produce.blade.php

@@ -0,0 +1,35 @@
+<div class="position-relative border-1 row p-0 m-0 bg-white border" id="produce-panel" @click="editProducePanel" :style="getProducePanelStyle()" >  <!--position-relative--> <!--position-absolute-->
+    <div class="position-absolute print-part"
+         draggable="true"
+         v-for="(item,i) in productionParts.printParts"
+         @click.stop="productionParts.editPart = item"
+         @dragstart="_dragstart(item,$event)"             {{--开始拖动元素时触发--}}
+         @dragend="_dragend(item,$event)"                 {{--拖动结束--}}
+         :style="getPrintPartStyle(item)"
+         :key="i" >
+        <svg v-if="item.type ==='StripeCode'" :style="{width:item.width,height:item.height}" :id="item.id" @click.stop="productionParts.editPart = item"></svg>
+        <span v-else>@{{ item.text }}</span>
+    </div>
+</div>
+<div class="modal fade" id="saveModal" tabindex="-1"  aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title" id="saveModalLabel">保存打印模板</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="productionParts.addPart.name = null">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label for="recipient-name" class="col-form-label">模板名称</label>
+                    <input type="text" id="recipient-name" class="form-control" v-model="productionParts.addPart.name">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal" @click="productionParts.addPart.name = null">关闭</button>
+                <button type="button" class="btn btn-success" @click="_savePrintTemplate">保存</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 11 - 0
resources/views/maintenance/expressPrinting/template/_select.blade.php

@@ -0,0 +1,11 @@
+<div class="container-fluid p-0"  id="select-panel" style="cursor: pointer; overflow-y: scroll;border-radius:5px;" >
+    <input type="text" class="form-control" placeholder="输入组件名称进行搜索" @change="_searchPrintPart($event)">
+    <ul class="list-group" >
+        <li class="list-group-item align-text-top hover"
+            v-for="(printPart,i) in filterPrintParts"
+            @dblclick="_addPartToProductionPanel(printPart)">
+            @{{ printPart.name }}
+            <span class="text-right float-right">添加</span>
+        </li>
+    </ul>
+</div>

+ 177 - 0
resources/views/maintenance/expressPrinting/template/create.blade.php

@@ -0,0 +1,177 @@
+@extends('layouts.app')
+@section('title')模板@endsection
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.template.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none row m-1" id="print-template">
+        <div class="col-lg-2 col-sm-3 p-0"  id="part_panel">
+            {{--  组件选择面板 --}}
+            @include('maintenance.expressPrinting.template._select')
+        </div>
+        <div class="col-lg-8 col-sm-6 p-0" id="production_panel">
+            {{--  模板制作面板 --}}
+            @include('maintenance.expressPrinting.template._produce')
+        </div>
+        <div class="col-lg-2 col-sm-3 p-0" id="compile_panel">
+            {{-- 模板编辑页面 --}}
+            @include('maintenance.expressPrinting.template._compile')
+        </div>
+    </div>
+@endsection
+
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            el:"#print-template",
+            data:{
+                printParts:{!! $printParts !!},
+                filterPrintParts:[],
+                producePanel:{},              // 背景版
+                selectProducePanel:false,              // 是否选中背景版
+                productionParts:{
+                    printParts:[],                  // 组件s
+                    editPart: null,                    // 编辑中的组件
+                    editIndex:{},                   // 编辑中组件的下标
+                    addPart:{},                     // 添加模板
+                },
+                partIsSelected:false,               // 表示模块被选中
+                selectPrintPart:{},                 // 选中模块
+                selectPrintPartPoint:{x:'',y:''},   // 选中模块时模块 point
+                mousePointStart:{x:'',y:''},        // 开始拖动时的 point
+                mousePointEnd:{x:'',y:''},          // 结束拖动时的 point
+                selectPrintPartOffset:{left:'',top:''},     // 选中时的left 和 top
+                z_index:10,
+            },
+            mounted(){
+                this.initProductionParts();
+                $('.navbar,.nav1,.nav2').hide();
+                $('.nav3').on('mouseenter', function () {
+                    $('.navbar,.nav1,.nav2').show();
+                });
+                $('.body').on('mouseenter', function () {
+                    $('.navbar,.nav1,.nav2').hide();
+                });
+                $("#print-template").removeClass('d-none');
+            },
+            methods:{
+                _addPartToProductionPanel(printPart){
+                    let _clone = JSON.parse(JSON.stringify(printPart));
+                    let print_part = JSON.parse(_clone.value);
+                    print_part.left = 0;
+                    print_part.top = 0;
+                    print_part.index = this.productionParts.printParts.length;
+                    print_part.z_index = this.z_index++;
+                    print_part.id = "id"+this.z_index;
+                    print_part.text = null;
+                    this.productionParts.printParts.push(print_part);
+                    if(print_part.type ==="StripeCode"){
+                        setTimeout(function(){
+                            window.setBarcode("0123456789","#"+print_part.id,2,50,true)
+                        },100);
+                    }
+                },
+                _removePartToProductionPanel(editPart){
+                    this.productionParts.editPart = null;
+                    let index = this.productionParts.printParts.indexOf(editPart);
+                    this.productionParts.printParts.splice(index,1);
+                },
+                _alignContentToProductionPanel(){
+                    this.productionParts.printParts.splice(this.productionParts.editIndex,1);
+                    this.$forceUpdate();
+                },
+                _searchPrintPart(event){
+                    let value = $(event.target).val();
+                    this.filterPrintParts = this.printParts.filter(function(printPart){
+                        return printPart.name.includes(value);
+                    });
+                    if(value===null || value=== '') this.filterPrintParts = JSON.parse(JSON.stringify(this.printParts));
+                },
+                showSaveModal(){
+                    $('#saveModal').modal('show');
+                },
+                _savePrintTemplate(){
+                    tempTip.setDuration(3000);
+                    tempTip.setIndex(1999);
+                    let printTemplate =JSON.parse(JSON.stringify(this.productionParts.printParts));
+                    let bg = {
+                        type:'bg',
+                        'width':this.producePanel.width,
+                        'height':this.producePanel.height,
+                    }
+                    printTemplate.push(bg);
+                    let data = {
+                        name:this.productionParts.addPart.name,
+                        value:printTemplate
+                    };
+                    window.axios.post("{{url('apiLocal/maintenance/expressPrinting/template/create')}}",data).then(res=>{
+                        if(res.data.success){
+                            tempTip.showSuccess('保存成功!');
+                            $('#saveModal').modal('hide');
+                            return ;
+                        }
+                        tempTip.show(res.data.message);
+                    }).catch(err=>{
+                        tempTip.show(err);
+                    });
+                },
+                initProductionParts(){
+                    this.productionParts = {printParts:[], editPart:null, addPart:{}};
+                    this.filterPrintParts=JSON.parse(JSON.stringify(this.printParts));
+                    let height = (window.innerHeight-120)+'px';
+                    $("#production_panel,#part_panel,#compile_panel,#select-panel,#produce-panel").css({height:height});
+                    let produce_panel = $("#produce-panel");
+                    produce_panel.css({height:height});
+                },
+                getPrintPartStyle(item){
+                    let style = JSON.parse(JSON.stringify(item));
+                    style['border-style'] = style.borderStyle;
+                    style['border-width'] = style.borderWidth+'px';
+                    if(style.borderStyle === 'none'){
+                        style['border-style'] = 'dotted';
+                        style['border-width'] = '1px';
+                    }
+                    style.display = 'flex';
+                    style['font-size'] = style.fontSize+'px';
+                    style['font-weight'] = style.fontWeight;
+                    style['justify-content'] = style.justifyContent;
+                    style['align-items'] = style.alignItems;
+                    style.width+='px';
+                    style.height+='px';
+                    style.left+='px';
+                    style.top+='px';
+                    style['white-space'] = 'pre';              // 字体换行
+                    return style;
+                },
+                _dragstart(item,$event){
+                    {{--开始拖动元素时触发--}}
+                    this.selectPrintPartPoint  = {x:parseInt(item.left),y:parseInt(item.top)};
+                    this.mousePointStart = {x:$event.offsetX, y:$event.offsetY};
+                },
+                _dragend(item,$event){
+                    {{--结束拖动元素时触发--}}
+                        this.mousePointEnd =  {x:$event.offsetX, y:$event.offsetY};
+                    let left  = item.left - (this.mousePointStart.x - this.mousePointEnd.x);
+                    let top = item.top - (this.mousePointStart.y - this.mousePointEnd.y);
+                    item.left = left >0 ? left:0;
+                    item.top =  top > 0 ? top:0;
+                },
+                editProducePanel(){
+                    this.selectProducePanel =!this.selectProducePanel;
+                },
+                getProducePanelStyle(){
+                    return {
+                        width:this.producePanel.width+'px',
+                        height:this.producePanel.height+'px',
+                    }
+                }
+            }
+        });
+    </script>
+@endsection
+

+ 52 - 0
resources/views/maintenance/expressPrinting/template/index.blade.php

@@ -0,0 +1,52 @@
+@extends('layouts.app')
+
+@section('title','查询')
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.template.menu')@endcomponent
+    </span>
+    <div class="container-fluid" id="part-template">
+        <table class="table table-striped table-sm table-hover">
+            <tr>
+                <th>序号</th>
+                <th>名称</th>
+                <th>内容</th>
+                <th>操作</th>
+            </tr>
+            <tr v-for="(template,i) in templates">
+                <td>@{{ i+1 }}</td>
+                <td>@{{ template.name }}</td>
+                <td>@{{ template.value }}</td>
+                <td>
+                    <button type="button" class="btn btn-danger" @click="destroy(template.id,i)">删除</button>
+                </td>
+            </tr>
+        </table>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        let vue = new Vue({
+            el:'#part-template',
+            data:{
+                templates:{!! $templates !!},
+            },
+            methods:{
+                destroy(id,i){
+                    if (!confirm('是否删除当前模板')) return;
+                    tempTip.setDuration(3000);
+                    window.tempTip.postBasicRequest("{{url('apiLocal/maintenance/expressPrinting/template/destroy')}}",{id:id},res=>{
+                        tempTip.showSuccess('删除成功');
+                        this.$delete(this.templates,i);
+                    });
+                }
+            }
+        });
+    </script>
+@endsection
+
+

+ 12 - 0
resources/views/maintenance/expressPrinting/template/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/template/index" class="nav-link" href="{{url('/maintenance/expressPrinting/template/index')}}" :class="{active:isActive('index',4)}">查询</a>
+            </li>
+            <li class="nav-item">
+                <a target="/maintenance/expressPrinting/template/create" class="nav-link" href="{{url('/maintenance/expressPrinting/template/create')}}" :class="{active:isActive('create',4)}">创建</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 6 - 1
resources/views/maintenance/menu.blade.php

@@ -122,7 +122,12 @@
             @canany(['系统配置','基础设置-系统配置'])
                 <li class="nav-item">
                     <a class="nav-link text-muted" href="{{url('maintenance/configuration')}}" :class="{active:isActive('configuration',2)}">系统配置</a>
-                </li>@endcanany
+                </li>
+
+                    <li class="nav-item">
+                        <a class="nav-link text-muted" href="{{url('maintenance/expressPrinting/part')}}" :class="{active:isActive('expressPrinting',2)}">快递打印</a>
+                    </li>
+                @endcanany
             @canany(['装卸队','基础设置-装卸队'])
                 <li class="nav-item">
                     <a class="nav-link text-muted" href="{{url('maintenance/facilitator')}}" :class="{active:isActive('facilitator',2)}">装卸队</a>

+ 4 - 0
resources/views/station/monitor/show.blade.php

@@ -403,6 +403,10 @@
                         this.current_stationTaskBatch.runningStatus=''
                 },
                 manuallyTakeBoxOut(){
+                    if(typeof(window.manuallyHairouRequesting)!='undefined'
+                        &&window.manuallyHairouRequesting===false){
+                        window.manuallyHairouRequesting=true;
+                    }
                     let text = this.inputs.manuallyTakeBox.text.trim();
                     if(!text){
                         alert('请输入料箱号')

+ 44 - 905
resources/views/test.blade.php

@@ -1,916 +1,55 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>table</title>
-    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
-    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.0-beta2/css/bootstrap-grid.css" rel="stylesheet">
-    <style type="text/css">
-        #test th{
-            position: sticky;
-            position: -webkit-sticky;
-            top: 0;
-            z-index:999;
-            background-color: white;
-        }
-    </style>
-    <link href="{{ mix('css/app.css') }}" rel="stylesheet">
-</head>
-<body onload="a()">
-<button></button>
-<table id="table" cellspacing="0" cellpadding="2" width="100%" border="1">
-    <tr id="test" style="white-space: nowrap !important;">
-        <th >用户编号</th>
-        <th>试用时间</th>
-        <th>转正时间</th>
-        <th>生日时间</th>
-        <th>民族</th>
-        <th>身高</th>
-    </tr>
-    <tr>
-        <td style="overflow-x: hidden">200004512312312321321</td>
-        <td><div>2001-2-15</div></td>
-        <td><div>2001-2-15</div></td>
-        <td>1978-8-5</td>
-        <td>汉</td>
-        <td>162</td>
-    </tr>
-</table>
-<div class="modal fade" tabindex="-1" role="dialog" id="auditOrRecover">
-    <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal">&times;</button>
-            </div>
-            <div class="modal-body">
-                <div class="row" v-if="showAuditPiece.C">
-                    <label class="col-1 text-right h4"><span class="badge badge-success">新增</span></label>
-                    <label class="col-1 h3 text-success" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10 border-bottom border-success">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.counting_type }}-@{{ s.using_type }})</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.operation_type }}-@{{ s.strategy }})</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.C">
-                            <div><b>@{{ s.name }}</b></div>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.C">
-                            <div><b>@{{ s.name }}</b></div>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div>使用费:¥<b>@{{ auditList.system.C.usage_fee }}</b></div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row" v-if="showAuditPiece.D">
-                    <label class="col-1 text-right h4"><span class="badge badge-danger">删除</span></label>
-                    <label class="col-1 h3 text-danger" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10 border-bottom border-danger">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.D">
-                            <table class="table table-sm">
-                                <tr class="text-center">
-                                    <th>名称</th>
-                                    <th>计费类型</th>
-                                    <th>用仓类型</th>
-                                    <th>最低起租面积</th>
-                                    <th>减免类型</th>
-                                    <th>减免值</th>
-                                    <th>单位</th>
-                                    <th>计时单位</th>
-                                    <th>数量-单价</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.counting_type }}</td>
-                                    <td>@{{ s.using_type }}</td>
-                                    <td>@{{ s.minimum_area }}</td>
-                                    <td>@{{ s.discount_type }}</td>
-                                    <td>@{{ s.discount_value }}</td>
-                                    <td>@{{ s.unit_id }}</td>
-                                    <td>@{{ s.time_unit_id }}</td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}(@{{ s.price[i] }}元)<br></span>
-                                            <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+(@{{ s.price[s.amount_interval.length-1] }}元)<br></span>
-                                        </div>
-                                    </td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>作业类型</th>
-                                    <th>策略</th>
-                                    <th>特征</th>
-                                    <th>按单价</th>
-                                    <th>按单减免单价</th>
-                                    <th>减免值</th>
-                                    <th>类型</th>
-                                    <th>附加费</th>
-                                    <th>附加费单位</th>
-                                    <th>封顶费</th>
-                                    <th>备注</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.operation_type }}</td>
-                                    <td>@{{ s.strategy }}</td>
-                                    <td>@{{ s.feature }}</td>
-                                    <td>@{{ s.total_price }}</td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.total_discount_price">@{{ a }}元<br></span>
-                                        </div>
-                                    </td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.discount_count" v-if="i!=s.discount_count.length-1">@{{ a }}-@{{ s.discount_count[i+1] }}<br></span>
-                                            <span>@{{ s.discount_count[s.discount_count.length-1] }}&nbsp;+<br></span>
-                                        </div>
-                                    </td>
-                                    <td>@{{ s.type_mark }}</td>
-                                    <td>@{{ s.surcharge }}</td>
-                                    <td>@{{ s.surcharge_unit_id }}</td>
-                                    <td>@{{ s.max_fee }}</td>
-                                    <td>@{{ s.remark }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>首重</th>
-                                    <th>续重</th>
-                                    <th>数量-重量</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.initial_weight }}</td>
-                                    <td>@{{ s.additional_weight }}</td>
-                                    <td>
-                                        <span v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}/单(
-                                            <span v-for="(w,j) in s.weight_interval[i]" v-if="j!=s.weight_interval[i].length">@{{ w }}-@{{ s.weight_interval[i][j+1] }}/KG,</span>
-                                            @{{ s.weight_interval[i][s.weight_interval[i].length-1] }}&nbsp;+/KG)<br></span>
-                                        <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+/单(
-                                            <span v-for="(w,j) in s.weight_interval[s.amount_interval.length-1]" v-if="j!=s.weight_interval[s.amount_interval.length-1].length">@{{ w }}-@{{ s.weight_interval[s.amount_interval.length-1][j+1] }}/KG,</span>
-                                            @{{ s.weight_interval[s.amount_interval.length-1][s.weight_interval[s.amount_interval.length-1].length-1] }}&nbsp;+/KG)<br></span>
-                                    </td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>单位一</th>
-                                    <th>单位一区间</th>
-                                    <th>单位二</th>
-                                    <th>单位二区间</th>
-                                    <th>提货费</th>
-                                    <th>燃油附加费</th>
-                                    <th>服务费</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.unit_id }}</td>
-                                    <td>
-                                        <span class="small" v-for="u in s.unit_range">@{{ u }}<br></span>
-                                    </td>
-                                    <td>@{{ s.other_unit_id }}</td>
-                                    <td>
-                                        <span class="small" v-for="u in s.other_unit_range">@{{ u }}<br></span>
-                                    </td>
-                                    <td>@{{ s.pick_up_price }}</td>
-                                    <td>@{{ s.fuel_price }}</td>
-                                    <td>@{{ s.service_price }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>起步公里数</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.base_km }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div>使用费:<b>@{{ auditList.system.D.usage_fee }}</b></div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row" v-if="showAuditPiece.U">
-                    <label class="col-1 text-right h4"><span class="badge badge-primary">修改</span></label>
-                    <label class="col-1 h3 text-primary" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.storage">@{{ val }}</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.storage" v-html="s[key]"></td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.items.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'" v-html="s[key]"></td>
-                                    <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">
-                                                <td v-for="(val,key) in auditList.mapping.operation.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.express" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.express" v-if="key!='child'" v-html="s[key]"></td>
-                                    <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">
-                                                <td v-for="(val,key) in auditList.mapping.express.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'" v-html="s[key]"></td>
-                                    <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">
-                                                <td v-for="(val,key) in auditList.mapping.logistic.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'" v-html="s[key]"></td>
-                                    <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">
-                                                <td v-for="(val,key) in auditList.mapping.directLogistic.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div v-if="auditList.system.H.usage_fee!=auditList.system.U.usage_fee">
-                                <div class="float-left">使用费:</div>
-                                <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.usage_fee }}</div>
-                                <div class="float-left mt-1 mr-4">
-                                    <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
-                                    <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.usage_fee }}</div>
-                                </div>
-                            </div>
-                            <div v-if="auditList.system.H.tax_rate_id!=auditList.system.U.tax_rate_id">
-                                <div class="float-left">税率:</div>
-                                <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.tax_rate_id }}</div>
-                                <div class="float-left mt-1">
-                                    <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
-                                    <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.tax_rate_id }}</div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="modal-footer">
+@extends('layouts.app')
 
-            </div>
+@section('content')
+    <div class="container" id="container">
+        <div class="form-group">
+            <input id="file" type="file" class="form-control-file">
+            <button class="btn btn-primary" type="button" @click="uploadFile">上传</button>
         </div>
-    </div>
+        <svg id="barcodeDiv" style="width: 2px;height: 200px">
+        </svg>
+        <svg id="barcodeDiv1" style="width: 2px;height: 200px">
 
-</div>
-<div id="app">
+        </svg>
+        <div><img src="{{asset('icon/faviconc.ico')}}" alt=""></div>
 
-</div>
-<script type="text/javascript" src="{{mix("js/app.js")}}"></script>
-<script type="text/javascript">
-    function a(){
-        let url = "{{url('maintenance/priceModel/getPriceModelAudit')}}";
-        let type = 'directLogistic';
-        window.tempTip.postBasicRequest(url,{type:type,"owner_id":86},res=>{
-            console.log(res);
-        });
-        return;
-        //$("#auditOrRecover").modal("show");
-        let video = document.createElement("video");
-        let canvas = document.createElement("canvas");
-        let arr=["{{asset("1.mp4")}}"];
-        let result = [];
-        arr.forEach(url=>{
-            video.setAttribute('src',url);
-            document.getElementById("app").appendChild(video);
-            canvas.style.width = video.clientWidth+"px";
-            canvas.style.height = video.clientHeight+"px";
-            document.getElementById("app").appendChild(canvas);
-            canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
-            result.push(canvas.toDataURL("image/png"));
-        });
-        console.log(result)
-    }
+        <button class="btn btn-primary" @click="deduction">截图</button>
 
-    new Vue({
-        el:"#auditOrRecover",
-        data:{
-            auditList:{
-                storage:{
-                    "C":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"},{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"}],
-                    "U":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                        minimum_area:"200",price:["0.2"],discount_type:"无减免",target_id:"10",
-                        discount_value:"20",unit_id:"1",time_unit_id:"2",tax_rate_id:"1",amount_interval:["2"]}],
-                    "D":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                        minimum_area:"200",price:["0.2","0.1"],discount_type:"无减免",
-                        discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}],
-                    "H":{10:{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                            minimum_area:"200",price:["0.1","0.2"],discount_type:"无减免",
-                            discount_value:"20",unit_id:"2",time_unit_id:"1",tax_rate_id:"2",amount_interval:["2","5"]}},
-                },
-                operation:{
-                    "C":[{name:"笕尚入库",operation_type:"入库",strategy:"特征"},{name:"笕尚入库",operation_type:"入库",strategy:"特征"}],
-                    "D":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%"}],
-                    "U":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%",target_id:"10",
-                        items:[{id:"2",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"5",owner_price_operation_id:"5",strategy:"特征",amount:"22",unit_id:"8",unit_price:"9",feature:"13",priority:"0",discount_price:[5,6,7],odd_price:"5"},]}],
-                    "H":{10:{name:"笕尚入库1",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2,5],total_price:"222",total_discount_price:[1,2,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"T",max_fee:"7771",tax_rate_id:"3%",
-                        items:[{id:"1",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"3",owner_price_operation_id:"5",strategy:"起步",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"4",owner_price_operation_id:"5",strategy:"特征",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                        ]}},
-                },
-                express:{
-                    "C":[{name:"笕尚快递"}],
-                    "D":[{name:"笕尚快递",initial_weight:"包仓",additional_weight:"恒温",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%"}],
-                    "U":[{name:"笕尚快递",initial_weight:"1",additional_weight:"3",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%",target_id:10,
-                    details:[{province_id:"河南",initial_weight_price:[[4]],additional_weight_price:[[5]]}]}],
-                    "H":{10:{name:"笕尚快递",initial_weight:"1",additional_weight:"2",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%",
-                            details:[{province_id:"河南",initial_weight_price:[[5]],additional_weight_price:[[5]]}]}},
-                },
-                logistic:{
-                    "C":[{name:"笕尚物流"}],
-                    "D":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"20%"},
-                        ]}],
-                    "U":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",target_id:10,details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"20%"},
-                        ]}],
-                    "H":{10:{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"21%"},
-                        ]}},
-                },
-                directLogistic:{
-                    "C":[{name:"笕尚直发",base_km:"10"}],
-                    "D":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%"}],
-                    "U":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%",target_id:"10",details:[
-                            {car_type_id:"碰碰车",base_fee:"30",additional_fee:"50"}
-                        ]}],
-                    "H":{10:{name:"笕尚直发",base_km:"101",tax_rate_id:"32%",details:[
-                            {car_type_id:"碰碰车",base_fee:"301",additional_fee:"50"}
-                        ]}},
-                },
-                system:{
-                    "C":[{usage_fee:"500"}],
-                    "D":[{usage_fee:"500"}],
-                    "U":{usage_fee:"510",tax_rate_id:20},
-                    "H":{usage_fee:"500",tax_rate_id:21},
-                },
-                mapping:{
-                    "storage":{
-                        "name":"名称",
-                        "counting_type":"计费类型",
-                        "using_type":"用仓类型",
-                        "minimum_area":"最低起租面积",
-                        "discount_type":"减免类型",
-                        "discount_value":"减免值",
-                        "unit_id":"单位",
-                        "time_unit_id":"计时单位",
-                        "amount_interval":"数量-单价",
-                        "tax_rate_id":"税率",
-                    },
-                    "operation":{
-                        name:"名称",
-                        operation_type:"作业类型",
-                        strategy:"策略",
-                        feature:"特征",
-                        total_price:"按单价",
-                        total_discount_price:"按单减免单价",
-                        discount_count:"减免值",
-                        type_mark:"类型",
-                        surcharge:"附加费",
-                        surcharge_unit_id:"附加费单位",
-                        max_fee:"封顶费",
-                        remark:"备注",
-                        tax_rate_id:"税率",
-                        child:{
-                            strategy:"子策略",
-                            amount:"起步数",
-                            unit_id:"单位",
-                            unit_price:"单价",
-                            feature:"特征",
-                            discount_price:"减免单价",
-                            odd_price:"零头价",
-                        }
-                    },
-                    "express":{
-                        name:"名称",
-                        initial_weight:"首重",
-                        additional_weight:"续重",
-                        weight_interval:"数量-重量",
-                        tax_rate_id:"税率",
-                        child:{
-                            province_id:"省",
-                            initial_weight_price:"初始单价",
-                            additional_weight_price:"续重单价",
-                        },
-                    },
-                    "logistic":{
-                        name:"名称",
-                        unit_id:"单位一",
-                        unit_range:"单位一区间",
-                        other_unit_id:"单位二",
-                        other_unit_range:"单位二区间",
-                        pick_up_price:"提货费",
-                        fuel_price:"燃油附加费",
-                        service_price:"服务费",
-                        tax_rate_id:"税率",
-                        child:{
-                            unit_id:"单位",
-                            range:"区间",
-                            province_id:"省份",
-                            city_id:"城市",
-                            unit_price:"单价",
-                            delivery_fee:"送货费",
-                            initial_fee:"起始计费",
-                            initial_amount:"起始计数",
-                            rate:"费率",
-                        },
-                    },
-                    "directLogistic":{
-                        name:"名称",
-                        base_km:"起步公里数",
-                        tax_rate_id:"税率",
-                        child:{
-                            car_type_id:"车型",
-                            base_fee:"起步费",
-                            additional_fee:"续费(元/KM)"
-                        }
-                    },
-                },
-            },
-            selectedAudit:"system",
-            poolMapping:{
-                units:{1:"T",2:"G"},
-                taxRates:{1:"2",2:"3"},
-            },
-            showAuditPiece:{
-                "C":true,"D":true,"U":true
-            }
-        },
-        mounted(){
-            let temp = {"name":"名称"};
-            let font = "<div class='float-left'><span class='float-left fa fa-arrow-right text-info ml-2 mr-2'></span>";
-            this.auditList.storage.U.forEach(data=>{
-                let tar = this.auditList.storage.H[data.target_id];
-                for (let key in this.auditList.mapping.storage){
-                    if (String(data[key])!==String(tar[key])){
-                        if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
-                        data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
-                    }else data[key] = this.transformData(data,key);
-                }
-                if (String(data["price"])!==String(tar["price"]) && String(data["amount_interval"])===String(tar["amount_interval"])){
-                    data["amount_interval"] = this.transformData(tar,"amount_interval")+font+this.transformData(data,"amount_interval",true)+"</div>";
-                }
-            });
-            this.auditList.mapping.storage = temp;
-            temp={"name":"名称",child:{strategy:"子策略"}};
-            this.auditList.operation.U.forEach(data=>{
-                let tar = this.auditList.operation.H[data.target_id];
-                for (let key in this.auditList.mapping.operation){
-                    if (String(data[key])!==String(tar[key])){
-                        if (!temp[key]) temp[key] = this.auditList.mapping.operation[key];
-                        data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
-                    }else data[key] = this.transformData(data,key);
-                }
-                let itemTem = {};
-                tar.items.forEach(item=>{
-                    if (!itemTem[item.strategy])itemTem[item.strategy] = [];
-                    itemTem[item.strategy].push(item);
-                });
-                let items = [];
-                let amount = 0;
+    </div>
+@endsection
 
-                data.items.forEach(item=>{
-                    if (itemTem[item.strategy]){
-                        let mark = true;
-                        for (let i=0;i<itemTem[item.strategy].length;i++){
-                            for (let key in this.auditList.mapping.operation.child){
-                                let oldStr = itemTem[item.strategy][i][key];
-                                let newStr = item[key];
-                                if (String(newStr)!==String(oldStr)){
-                                    mark = false;break;
-                                }
-                            }
-                            if (mark){
-                                item.operation = "H";
-                                itemTem[item.strategy].splice(i,1);
-                                if (itemTem[item.strategy].length===0)itemTem[item.strategy] = null;
-                                break;
-                            }
-                        }
-                    }//去重
-                });
-                data.items.forEach(item=>{
-                    if (item.operation!=='H'){
-                        if (!itemTem[item.strategy]){
-                            for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
-                            item.operation = "C";
-                            items.unshift(item);
-                            amount++;
-                        }else{
-                            let tar = item.strategy;
-                            for (let key in this.auditList.mapping.operation.child){
-                                if (String(item[key])!==String(itemTem[tar][0][key])){
-                                    if (!temp.child[key]) temp.child[key] = this.auditList.mapping.operation.child[key];
-                                    item[key] = this.transformData(itemTem[tar][0],key)+font+this.transformData(item,key,true)+"</div>";
-                                }else item[key] = this.transformData(item,key);
-                            }
-                            item.operation = "U";
-                            items.push(item);
-                            itemTem[tar].splice(0,1);
-                            if (itemTem[tar].length===0) itemTem[tar] = null;
-                        }
-                    }
-                });
-                for (let key in itemTem){
-                    if (itemTem[key]){
-                        itemTem[key].forEach(item=>{
-                            for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
-                            item.operation = "D";
-                            items.splice(amount,0,item);
-                            amount++;
-                        });
-                    }
-                }
-                data.items = items;
-            });
-            this.auditList.mapping.operation = temp;
-            temp={"name":"名称",child:{province_id:"省"}};
-            this.auditList.express.U.forEach(data=> {
-                let tar = this.auditList.express.H[data.target_id];
-                for (let key in this.auditList.mapping.express) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.express[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                    if (String(data["amount_interval"])!==String(tar["amount_interval"]) && String(data["weight_interval"])===String(tar["weight_interval"])){
-                        data["weight_interval"] = this.transformData(tar,"weight_interval")+font+this.transformData(data,"weight_interval",true)+"</div>";
-                    }
-                }
-                let itemTem = {};
-                tar.details.forEach(item => {itemTem[item.province_id] = item;});
-                let items = [];
-                let amount = 0;
-                data.details.forEach(item=>{
-                    if (!itemTem[item.province_id]){
-                        for (let key in this.auditList.mapping.express.child)item[key] = this.transformData(item,key);
-                        item.operation = "C";
-                        items.unshift(item);
-                        amount++;
-                    }else{
-                        let mark = true;
-                        for (let key in this.auditList.mapping.express.child){
-                            if (String(item[key])!==String(itemTem[item.province_id][key])){
-                                mark = false;break;
-                            }
-                        }
-                        if (!mark){
-                            let tar = item.province_id;
-                            for (let key in this.auditList.mapping.express.child) {
-                                if (String(item[key]) !== String(itemTem[tar][key])) {
-                                    if (!temp.child[key]) temp.child[key] = this.auditList.mapping.express.child[key];
-                                    item[key] = this.transformData(itemTem[tar], key) + font + this.transformData(item, key, true) + "</div>";
-                                } else item[key] = this.transformData(item, key);
-                            }
-                            item.operation = "U";
-                            items.push(item);
-                            delete itemTem[tar];
-                        }else delete itemTem[item.province_id];
+@section("lastScript")
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/html2canvas/0.5.0-beta4/html2canvas.js"></script>
+    <script>
+        let vue = new Vue({
+            el:"#container",
+            data:{
 
-                    }
-                });
-                for (let key in itemTem){
-                    for (let k in this.auditList.mapping.express.child)itemTem[key][k] = this.transformData(itemTem[key],k);
-                    itemTem[key].operation = "D";
-                    items.splice(amount,0,itemTem[key]);
-                    amount++;
-                }
-                data.details = items;
-            });
-            this.auditList.mapping.express = temp;
-            temp={name:"名称",child:{province_id:"省份",city_id:"城市"}};
-            this.auditList.logistic.U.forEach(data=> {
-                let tar = this.auditList.logistic.H[data.target_id];
-                for (let key in this.auditList.mapping.logistic) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.logistic[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                }
-                let itemTem = this.logisticDataFormat(tar);
-                let dataTem = this.logisticDataFormat(data);
-                let items = [];
-                for (let key in itemTem){
-                    if (dataTem[key]){
-                        for (let key2 in itemTem[key]){
-                            if (dataTem[key][key2]){
-                                for (let key3 in itemTem[key][key2]){
-                                    if (dataTem[key][key2][key3]){
-                                        for (let key4 in itemTem[key][key2][key3]){
-                                            if (dataTem[key][key2][key3][key4]){
-                                                let mark = true;
-                                                for (let key5 in this.auditList.mapping.logistic.child){
-                                                    if (String(dataTem[key][key2][key3][key4][key5]) !== String(itemTem[key][key2][key3][key4][key5])){
-                                                        if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
-                                                        mark=false;
-                                                        if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
-                                                        dataTem[key][key2][key3][key4][key5] = this.transformData(itemTem[key][key2][key3][key4], key5) + font + this.transformData(dataTem[key][key2][key3][key4], key5, true) + "</div>";
-                                                    } else dataTem[key][key2][key3][key4][key5] = this.transformData(dataTem[key][key2][key3][key4], key5);
-                                                }
-                                                if (!mark){
-                                                    dataTem[key][key2][key3][key4].operation = "U";
-                                                    items.push(dataTem[key][key2][key3][key4])
-                                                }
-                                                delete dataTem[key][key2][key3][key4];
-                                                delete itemTem[key][key2][key3][key4];
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                dataTem = this.logisticDataRestore(dataTem,"C");
-                dataTem.push.apply(dataTem,this.logisticDataRestore(itemTem,"D"));
-                dataTem.push.apply(dataTem,items);
-                data.details = dataTem;
-            });
-            this.auditList.mapping.logistic = temp;
-            temp={name:"名称",child:{car_type_id:"车型"}};
-            this.auditList.directLogistic.U.forEach(data=> {
-                let tar = this.auditList.directLogistic.H[data.target_id];
-                for (let key in this.auditList.mapping.directLogistic) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.directLogistic[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                }
-                let itemTem = {};
-                tar.details.forEach(item => {itemTem[item.car_type_id] = item;});
-                let items = [];
-                let amount = 0;
-                data.details.forEach(item => {
-                    if (itemTem[item.car_type_id]){
-                        let car = item.car_type_id;
-                        let mark = true;
-                        for (let key in this.auditList.mapping.directLogistic.child) {
-                            if (String(item[key]) !== String(itemTem[car][key])) {
-                                mark = false;
-                                if (!temp.child[key]) temp.child[key] = this.auditList.mapping.directLogistic.child[key];
-                                item[key] = this.transformData(itemTem[car], key) + font + this.transformData(item, key, true) + "</div>";
-                            } else item[key] = this.transformData(item, key);
-                        }
-                        if (!mark){
-                            item.operation = "U";
-                            items.push(item);
-                        }
-                        delete itemTem[car];
-                    }else{
-                        item.operation = "C";
-                        items.unshift(item);
-                        amount++;
-                    }
-                    for (let key in itemTem){
-                        for (let k in this.auditList.mapping.directLogistic.child)itemTem[key][k] = this.transformData(itemTem[key],k);
-                        itemTem[key].operation = "D";
-                        items.splice(amount,0,itemTem[key]);
-                        amount++;
-                    }
-                    data.details = items;
-                });
-            });
-            this.auditList.mapping.directLogistic = temp;
-        },
-        methods:{
-            {{--@include("customer.customer.project.part._auditComparisonVue")--}}
-            transformData(data,key,font=false){
-                if (!data[key])return;
-                let html = '<div class="float-left small ';
-                if (font)html += "text-primary font-weight-bold";
-                else html += "text-secondary";
-                html+='">';
-                switch (key) {
-                    case "amount_interval":
-                        data[key].forEach((am,i)=>{
-                            if (i!==data[key].length-1) html += "<span>"+am+"-"+data[key][i+1]+"("+data["price"][i]+"元)<br></span>";
-                        });
-                        html += "<span>"+data[key][data[key].length-1]+" +("+data["price"][data[key].length-1]+"元)<br></span></div>";
-                        return html;
-                    case "total_discount_price":
-                        data[key].forEach(am=>{
-                            html += '<span>'+am+'元<br></span>'
-                        });
-                        return html+"</div>";
-                    case "discount_price":
-                        data[key].forEach(am=>{
-                            html += '<span>'+am+'元<br></span>'
-                        });
-                        return html+"</div>";
-                    case "discount_count":
-                        data[key].forEach((am,i)=>{
-                            if (i!==data[key].length-1)html += '<span>'+am+'-'+data[key][i+1]+'<br></span>'
-                        });
-                        html += '<span>'+data[key][data[key].length-1]+'&nbsp;+<br></span>';
-                        return html+"</div>";
-                    case "weight_interval":
-                        data[key].forEach((arr,i)=>{
-                            if (i!==data[key].length-1) html += '<span>'+data.amount_interval[i]+'-'+data.amount_interval[i+1]+'/单(';
-                            arr.forEach((w,j)=>{
-                                if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
-                            });
-                            html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
-                        });
-                        html += '<span>'+data.amount_interval[data.amount_interval.length-1]+'&nbsp;+/单(';
-                        let arr = data.weight_interval[data.weight_interval.length-1];
-                        arr.forEach((w,j)=>{
-                            if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
-                        });
-                        html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
-                        return html;
-                    case "initial_weight_price":
-                        data[key].forEach(arr=>{
-                            html += "<div class='float-left'>"+arr+"<br></div>";
-                        });
-                        return html;
-                    case "additional_weight_price":
-                        data[key].forEach(arr=>{
-                            html += "<div class='float-left'>"+arr+"<br></div>";
-                        });
-                        return html;
-                    case "unit_range":
-                        data[key].forEach(r=>{
-                            html += '<span class="small">'+r+'<br></span>';
-                        });
-                        return html;
-                    case "other_unit_range":
-                        data[key].forEach(r=>{
-                            html += '<span class="small">'+r+'<br></span>';
-                        });
-                        return html;
-                }
-                return html+= data[key]+"</div>";
             },
-            logisticDataFormat(tar){
-                let obj={};
-                tar.details.forEach(item => {
-                    if (obj[item.province_id]){
-                        if (obj[item.province_id][item.city_id]){
-                            if (obj[item.province_id][item.city_id][item.unit_id]){
-                                obj[item.province_id][item.city_id][item.unit_id][item.range] = item;
-                            }else{
-                                let arr1={};
-                                arr1[item.range] = item;
-                                obj[item.province_id][item.city_id][item.unit_id] = arr1;
-                            }
-                        }else{
-                            let arr1={};
-                            arr1[item.range] = item;
-                            let arr2={};
-                            arr2[item.unit_id] = arr1;
-                            obj[item.province_id][item.city_id] = arr2;
-                        }
-                    }else{
-                        let arr1={};
-                        arr1[item.range] = item;
-                        let arr2={};
-                        arr2[item.unit_id] = arr1;
-                        let arr3={};
-                        arr3[item.city_id] = arr2;
-                        obj[item.province_id] = arr3;
-                    }
-                });
-                return obj;
+            mounted() {
+                window.setBarcode("0123456789","#barcodeDiv1",2,50,false)
             },
-            logisticDataRestore(tar,type,items=[],count=0){
-                if (count===4){
-                    tar["operation"] = type;
-                    items.push(tar);
-                } else{
-                    count++;
-                    for (let key in tar){
-                        this.logisticDataRestore(tar[key],type,items,count);
-                    }
+            methods:{
+                uploadFile(){
+                    let formData = new FormData();
+                    //第一个参数key和表单中的name的值是一个意思canvascanvas
+                    //第二个参数是文件的数据对象
+                    formData.append('file',document.getElementById('file').files[0]);
+                    window.axios.post("http://127.0.0.1:3000",formData).then(res=>{
+                        console.log(res);
+                    }).catch(err=>{
+                        console.log(err);
+                    })
+                },
+                deduction(){
+                    html2canvas(document.body).then(function(canvas) {
+                        document.body.appendChild(canvas);
+                    });
                 }
-                return items;
-            },
-            这样(){
-                let video = document.createElement("video");
-                let canvas = document.createElement("canvas");
-                let arr=["url1","url2","url3"];
-                let result = [];
-                arr.forEach(url=>{
-                    video.setAttribute('src',url);
-                    canvas.width = video.clientWidth+"px";
-                    canvas.height = video.clientHeight+"px";
-                    canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
-                    result.push(canvas.toDataURL("image/png"));
-                });
-                console.log(result);
+
             },
-        },
-    });
-</script>
-</body>
-</html>
+
+        })
+    </script>
+@stop

+ 15 - 0
routes/apiLocal.php

@@ -116,6 +116,17 @@ Route::group(['prefix'=>'maintenance'],function (){
     Route::group(['prefix'=>'owner'],function (){
         Route::post('getOwners','OwnerController@getOwners');
     });
+    Route::group(['prefix'=>'expressPrinting'],function (){
+        Route::group(['prefix'=>'part'],function(){
+            Route::post('create','PrintPartController@storeApi');
+            Route::post('destroy','PrintPartController@destroyApi');
+            Route::post('printTemplate','PrintPartController@printTemplateApi');
+        });
+        Route::group(['prefix'=>'template'],function(){
+            Route::post('create','PrintTemplateController@storeApi');
+            Route::post('destroy','PrintTemplateController@destroyApi');
+        });
+    });
 });
 
 /** 控制台 */
@@ -206,3 +217,7 @@ Route::group(['prefix' => 'station'],function(){
 Route::group(['prefix' => 'package'], function () {
     Route::put('logistic', 'OrderPackageController@update')->name('orderPackage.update');
 });
+/** 快递打印 */
+Route::group(['prefix' => 'print'],function (){
+    Route::post('template/store','PrintTemplateController@storeAi');
+});

+ 9 - 0
routes/web.php

@@ -230,6 +230,15 @@ Route::group(['prefix'=>'maintenance'],function(){
     Route::get('configuration','ConfigurationController@index');
     /** 服务商 */
     Route::resource('facilitator','FacilitatorController');
+    /** 快递打印 */
+    Route::group(['prefix'=>'expressPrinting'],function(){
+        Route::get('/part','PrintPartController@index');
+        Route::get('/part/create','PrintPartController@create');
+        Route::group(['prefix'=>'template'],function(){
+            Route::get('/index','PrintTemplateController@index');
+            Route::get('/create','PrintTemplateController@create');
+        });
+    });
 
     Route::get('syncRedisLogs','LogController@syncRedisLogs');
     Route::get('region', 'RegionController@index');

+ 1 - 0
webpack.mix.js

@@ -25,6 +25,7 @@ mix.copy('resources/js/queryForm/export.js','public/js/queryForm/export.js');
 mix.js('resources/js/queryForm/header.js','public/js/queryForm/header.js');
 mix.js('resources/js/utilities/barcode.js','public/js/utilities/barcode.js');
 mix.js('resources/js/utilities/qrcode.js','public/js/utilities/qrcode.js');
+mix.js('resources/js/utilities/html2canvas.js','public/js/utilities/html2canvas.js');
 
 mix.copy('resources/sound/','public/sound');
 mix.js('resources/js/elementUi.js','public/js/element-ui.js')