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

+ 1 - 1
app/Http/Controllers/ReceivingTaskController.php

@@ -28,7 +28,7 @@ class ReceivingTaskController extends Controller
 
     public function index(Request $request,ReceivingTaskFilters $filter)
     {
-        $receivingTasks = ReceivingTask::query()->with(['items','owner','warehouse','file'])->filter($filter)->orderByDesc('created_at')->paginate(50);
+        $receivingTasks = ReceivingTask::query()->with(['items','owner','wareHouse','file','deliveryAppointmentCar'])->filter($filter)->orderByDesc('created_at')->paginate(50);
         $owners = $this->ownerService->getQuery()->select('id','name')->get();
         $warehouses  = Warehouse::query()->get();
         return view("store.receivingTasks.index",compact('receivingTasks','owners','warehouses'));

+ 1 - 1
app/ReceivingTask.php

@@ -36,7 +36,7 @@ class ReceivingTask extends Model
 
     public function wareHouse(): BelongsTo
     {
-        return $this->belongsTo(Warehouse::class);
+        return $this->belongsTo(Warehouse::class,'warehouse_id','id');
     }
 
     public function owner(): BelongsTo

+ 1 - 1
app/Services/ReceivingTaskService.php

@@ -26,7 +26,7 @@ class ReceivingTaskService
 
     public function endTask($receivingTaskNumber)
     {
-        ReceivingTask::query()->where('number', $receivingTaskNumber)->update(['status' => '完成']);
+        ReceivingTask::query()->where('number', $receivingTaskNumber)->update(['status' => '延时完结']);
     }
 
     public function executionTask($receivingTaskNumber)

+ 3 - 1
database/migrations/2021_12_22_153152_create_receiving_tasks_table.php

@@ -30,7 +30,9 @@ class CreateReceivingTasksTable extends Migration
 
             $table->enum('provide_list',['是','否'])->comment("是否提供清单");
             $table->enum('receiving_type',['正常','盲收'])->comment("收货类型");
-            $table->enum('status',['创建','进行中','完成'])->comment('状态');
+            $table->enum('status',['创建','进行中','完成','超时完成'])->comment('状态');
+
+            $table->dateTime('end_at')->comment('完结时间');
             $table->timestamps();
         });
     }

+ 1 - 4
resources/views/store/receivingTasks/_clodop_print.blade.php

@@ -5,13 +5,10 @@
     center>
     <el-form ref="form" :model="print_setting" label-width="80px" class="demo-form-inline" size="small">
         <el-form-item label="打印机" size="small">
-            <el-select v-model="print_setting.printer_index" placeholder="请选择打印机" @change="switchPrinter">
+            <el-select v-model="print_setting.printer_index" placeholder="请选择打印机" >
                 <el-option v-for="printer in printerList" :label="printer.name" :value="printer.value"></el-option>
             </el-select>
         </el-form-item>
-        <el-form-item label="打印纸张">
-            <select id="print-size-select"></select>
-        </el-form-item>
     </el-form>
 
     <span slot="footer" class="dialog-footer">

+ 53 - 53
resources/views/store/receivingTasks/_receiving_task_print.blade.php

@@ -1,55 +1,55 @@
-<div id="print-receiving-task" class=" container print"
-     style="min-height: 450px;min-width: 750px;max-height: 450px;max-width: 750px">
-    <div id="receiving-task-print" class="d-none print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">
-        <table class="table table-sm table-bordered text-center print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">
-            <tr>
-                <td rowspan="2" colspan="4" class="">
-                    <div style="min-width: 100mm;min-height: 25mm">
-                        <svg id="receiving-task-print-code" style="width: 100%;height: 100%" preserveAspectRatio="none">
-                        </svg>
-                    </div>
+{{--<div id="print-receiving-task" class=" container print"--}}
+{{--     style="min-height: 450px;min-width: 750px;max-height: 450px;max-width: 750px">--}}
+{{--    <div id="receiving-task-print" class="d-none print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">--}}
+{{--        <table class="table table-sm table-bordered text-center print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">--}}
+{{--            <tr>--}}
+{{--                <td rowspan="2" colspan="4" class="">--}}
+{{--                    <div style="min-width: 100mm;min-height: 25mm">--}}
+{{--                        <svg id="receiving-task-print-code" style="width: 100%;height: 100%" preserveAspectRatio="none">--}}
+{{--                        </svg>--}}
+{{--                    </div>--}}
 
-                </td>
-            </tr>
-            <tr></tr>
-            <tr>
-                <td style="max-width: 120px;width:120px">收货任务号</td>
-                <td colspan="3" rowspan="1" v-text="receiving_task_print.number" class="text-left"></td>
-            </tr>
+{{--                </td>--}}
+{{--            </tr>--}}
+{{--            <tr></tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">收货任务号</td>--}}
+{{--                <td colspan="3" rowspan="1" v-text="receiving_task_print.number" class="text-left"></td>--}}
+{{--            </tr>--}}
 
-            <tr>
-                <td style="max-width: 120px;width:120px">仓库</td>
-                <td v-text="receiving_task_print.warehouse" class="text-left" class="text-left"></td>
-                <td style="max-width: 120px;width:120px">投单员</td>
-                <td v-text="receiving_task_print.for_single_member" class="text-left" class="text-left"></td>
-            </tr>
-            <tr>
-                <td style="max-width: 120px;width:120px">司机姓名</td>
-                <td v-text="receiving_task_print.driver_name" class="text-left" class="text-left"></td>
-                <td style="max-width: 120px;width:120px">司机电话</td>
-                <td v-text="receiving_task_print.driver_phone" class="text-left" class="text-left"></td>
-            </tr>
-            <tr>
-                <td style="max-width: 120px;width:120px">车号牌</td>
-                <td v-text="receiving_task_print.plate_number" class="text-left"></td>
-                <td style="max-width: 120px;width:120px">驾驶证号</td>
-                <td v-text="receiving_task_print.driving_license_no" class="text-left"></td>
-            </tr>
-            <tr>
-                <td style="max-width: 120px;width:120px">是否提供清单</td>
-                <td v-text="receiving_task_print.provide_list" class="text-left"></td>
-                <td style="max-width: 120px;width:120px">收货类型</td>
-                <td v-text="receiving_task_print.receiving_type" class="text-left"></td>
-            </tr>
-            <tr>
-                <td style="max-width: 120px;width:120px">货主</td>
-                <td v-text="receiving_task_print.owner" class="text-left"></td>
-                <td style="max-width: 120px;width:120px">预约号</td>
-                <td v-text="receiving_task_print.appointment_number" class="text-left"></td>
-            </tr>
-        </table>
-    </div>
-    <div style="width: 100%;height: 100%;" class="d-none" id="receiving-task-print-image">
-        <img src="" alt="">
-    </div>
-</div>
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">仓库</td>--}}
+{{--                <td v-text="receiving_task_print.warehouse" class="text-left" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">投单员</td>--}}
+{{--                <td v-text="receiving_task_print.for_single_member" class="text-left" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">司机姓名</td>--}}
+{{--                <td v-text="receiving_task_print.driver_name" class="text-left" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">司机电话</td>--}}
+{{--                <td v-text="receiving_task_print.driver_phone" class="text-left" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">车号牌</td>--}}
+{{--                <td v-text="receiving_task_print.plate_number" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">驾驶证号</td>--}}
+{{--                <td v-text="receiving_task_print.driving_license_no" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">是否提供清单</td>--}}
+{{--                <td v-text="receiving_task_print.provide_list" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">收货类型</td>--}}
+{{--                <td v-text="receiving_task_print.receiving_type" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">货主</td>--}}
+{{--                <td v-text="receiving_task_print.owner" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">预约号</td>--}}
+{{--                <td v-text="receiving_task_print.appointment_number" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--        </table>--}}
+{{--    </div>--}}
+{{--    <div style="width: 100%;height: 100%;" class="d-none" id="receiving-task-print-image">--}}
+{{--        <img src="" alt="">--}}
+{{--    </div>--}}
+{{--</div>--}}

+ 31 - 124
resources/views/store/receivingTasks/create.blade.php

@@ -3,7 +3,6 @@
 @section('head')
     <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
     <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
-    <link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.7/lib/theme-chalk/index.css">
 @endsection
 
 @section('content')
@@ -346,12 +345,12 @@
                         </el-table-column>
                     </el-table>
                 </div>
-                <div class="form-group ">
+                <div class="form-group">
                     <el-button type="primary" class="col-12" @click="submit" v-if="!submit_loading">提交</el-button>
                     <el-button type="primary" class="col-12" :loading="true" v-if="submit_loading">提交中</el-button>
                 </div>
-                <div class="form-group ">
-                    <el-button type="primary" class="col-12" @click="print">打印</el-button>
+                <div class="form-group">
+                    <el-button type="primary" class="col-12" @click="printLodop">打印</el-button>
                 </div>
                 @include("store.receivingTasks._receiving_task_print")
                 @include("store.receivingTasks._clodop_print")
@@ -364,8 +363,6 @@
 
     <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
     <script type="text/javascript" src="{{ mix('js/element-ui.js') }}"></script>
-    <script type="text/javascript" src="{{ mix('js/utilities/barcode.js') }}"></script>
-    <script type="text/javascript" src="{{mix('js/utilities/html2canvas.js')}}"></script>
     <script src="https://unpkg.com/element-ui/lib/index.js"></script>
     <script type="text/javascript" src="{{mix('js/lodop/LodopFuncs.js')}}"></script>
 
@@ -442,10 +439,8 @@
                 clodop:null,
                 clodopPrintDialogVisible: false,
                 printerList: [],
-                print_size_list:[],
                 print_setting: {
                     printer_index: 0,
-                    print_size:'',
                 }
             },
             mounted() {
@@ -621,70 +616,6 @@
                     else if (this.receiving_task.driving_license_no) return true;
                     return false;
                 },
-                setBarcode() {
-                    window.setBarcode("123123", "#receiving-task-print-code", 2, 50, true);
-                    $("#receiving-task-print-code").width("600px").height("120px");
-                },
-                printReceivingTask(task) {
-                    this.receiving_task_print = task;
-                    this.setBarcode();
-                    setTimeout(() => {
-                        this.printLodop();
-                    }, 500);
-                },
-                {{--formPrint(){--}}
-                    {{--    let iframe=document.getElementById("print-iframe");--}}
-                    {{--    this.infoShow=true;--}}
-                    {{--    if(!iframe){--}}
-                    {{--        iframe = document.createElement('IFRAME');--}}
-                    {{--        iframe.setAttribute("id", "print-iframe");--}}
-                    {{--        // iframe.setAttribute('style', 'position:absolute;width:0;height:0;left:-500px;top:-500px;');--}}
-                    {{--        iframe.setAttribute('style', 'min-height: 450px;min-width: 750px;max-height: 450px;max-width: 750px');--}}
-                    {{--        document.body.appendChild(iframe);--}}
-                    {{--    }else iframe.contentWindow.document.getElementById("iframe-content").remove();--}}
-                    {{--    let doc = iframe.contentWindow.document;--}}
-                    {{--    let el = document.getElementById("print-receiving-task");--}}
-                    {{--    doc.write('<LINK rel="stylesheet" type="text/css" href="{{ asset(mix("css/app.css")) }}">');--}}
-                    {{--    doc.write('<div id="iframe-content">' + el.innerHTML + '</div>');--}}
-                    {{--    doc.close();--}}
-                    {{--    iframe.contentWindow.focus();--}}
-                    {{--    this.infoShow=false;--}}
-                    {{--    setTimeout(function () {--}}
-                    {{--        iframe.contentWindow.print();--}}
-                    {{--        if (navigator.userAgent.indexOf("MSIE") > 0){--}}
-                    {{--            document.body.removeChild(iframe);--}}
-                    {{--        }--}}
-                    {{--    },200);--}}
-                    {{--},--}}
-                print() {
-                    $("#receiving-task-print").removeClass("d-none");
-                    this.printReceivingTask({
-                        number: 123123123,
-                        warehouse: 123123123,
-                        for_single_member: 123123123,
-                        driver_name: 123123123,
-                        driver_phone: 123123123,
-                        plate_number: 123123123,
-                        driving_license_no: 123123123,
-                        provide_list: 123123123,
-                        receiving_type: 123123123,
-                        owner: 123123123,
-                        appointment_number: 123123123,
-                    });
-                },
-                transformCode() {
-                    let item = document.getElementById('receiving-task-print-code');
-                    let scale = item.scale;
-                    let height = item.offsetHeight;
-                    let width = item.offsetWidth;
-                    // style.transform =  `scale(${scale},${scale})`;
-                    // style.transform =  `translate(50px,100px);`;
-                },
-                htmlToImage() {
-                    window.html2canvas("#print-receiving-task").then((canvas) => {
-                        let imagUri = canvas.toDataURL();
-                    });
-                },
                 scrollToTop() {
                     const c = document.documentElement.scrollTop || document.body.scrollTop;
                     if (c > 0) {
@@ -736,11 +667,11 @@
                     let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
                     window.open(url, '_target');
                 },
-                showPrintDialog() {
+                showPrintDialog() { //
                     this.getPrinterList();
                     this.clodopPrintDialogVisible = true;
                 },
-                getPrinterList() {
+                getPrinterList() {  // 获取打印机列表
                     this.printerList = [];
                     let count = this.clodop.GET_PRINTER_COUNT();
                     for (let i = 0; i < count; i++) {
@@ -750,13 +681,22 @@
                         });
                     }
                 },
-                switchPrinter(){
-                    let {printer_index} = this.print_setting;
-                    let print_size_select = document.getElementById('print-size-select');
-                    this.clodop.Create_PageSize_List(print_size_select,printer_index);
-                },
                 clodopPrint(){
-                    this.clodop.PRINT_INITA(0,0,490,285,"");
+                    let {
+                        number,               // 收货任务号
+                        warehouse,             // 仓库
+                        for_single_member,    // 投单员
+                        driver_name,          // 司机姓名
+                        driver_phone,         // 司机电话
+                        plate_number,          // 车号牌
+                        driving_license_no,    // 驾驶证号
+                        provide_list,         // 是否提供清单
+                        receiving_type,       // 收货类型
+                        owner,                // 货主
+                        appointment_number, // 预约号
+                    } = this.receiving_task_print;
+                    this.clodop.PRINT_INITA(2,0,0,0,"");
+                    this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
                     this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39","123456789012");
                     this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
                     this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
@@ -798,53 +738,20 @@
                     this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
                     this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
                     this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,"SH210211228001");
+                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,"1234566554646"); // number
                     this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
                     this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
                     this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
-                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,"新加文本15");
-                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,"新加文本16");
-                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,"新加文本17");
-                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,"新加文本18");
-                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,"新加文本19");
-                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,"新加文本20");
-                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,"新加文本21");
-                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,"123456789012345678");
-                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,"新加文本23");
-                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,"新加文本24");
-
-
-
-
-
-                    // this.clodop.SET_PRINT_MODE("PRINT_NOCOLLATE",1);
-                    // this.clodop.ADD_PRINT_BARCODE(15,70,350,55,"Code39","123456789012");
-                    // this.clodop.SET_PRINT_STYLEA(0,"GroundColor","#ffffff");
-                    // this.clodop.ADD_PRINT_TEXT(95,15,100,20,"收货任务号");
-                    // this.clodop.SET_PRINT_STYLEA(0,"SpacePatch",1);
-                    // this.clodop.ADD_PRINT_TEXT(95,116,150,20,"-收货任务号");
-                    // this.clodop.ADD_PRINT_TEXT(125,15,100,20,"仓库");
-                    // this.clodop.ADD_PRINT_TEXT(155,15,100,20,"司机姓名");
-                    // this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
-                    // this.clodop.ADD_PRINT_TEXT(225,15,100,20,"是否提供清单");
-                    // this.clodop.ADD_PRINT_TEXT(260,15,100,20,"货主");
-                    // this.clodop.ADD_PRINT_TEXT(125,260,100,20,"投单员");
-                    // this.clodop.ADD_PRINT_TEXT(155,260,100,20,"司机电话");
-                    // this.clodop.ADD_PRINT_TEXT(190,260,100,20,"驾驶证号");
-                    // this.clodop.ADD_PRINT_TEXT(225,260,100,20,"收货类型");
-                    // this.clodop.ADD_PRINT_TEXT(260,260,100,20,"预约号");
-                    // this.clodop.ADD_PRINT_TEXT(125,115,130,20,"-仓库");
-                    // this.clodop.ADD_PRINT_TEXT(155,115,130,20,"-司机姓名");
-                    // this.clodop.ADD_PRINT_TEXT(190,115,130,20,"-车牌号");
-                    // this.clodop.ADD_PRINT_TEXT(225,115,130,20,"-是否提供清单");
-                    // this.clodop.ADD_PRINT_TEXT(260,115,130,20,"-货主");
-                    // this.clodop.ADD_PRINT_TEXT(125,360,130,20,"-投单员");
-                    // this.clodop.ADD_PRINT_TEXT(155,360,130,20,"-司机电话");
-                    // this.clodop.ADD_PRINT_TEXT(190,361,130,20,"-驾驶证号");
-                    // this.clodop.ADD_PRINT_TEXT(225,360,130,20,"-收货类型");
-                    // this.clodop.ADD_PRINT_TEXT(260,360,130,20,"-预约号");
-                    // this.clodop.SET_PRINTER_INDEXA(document.getElementById("print-size-select").value);
-                    // this.clodop.SET_PRINT(document.getElementById("print-size-select").value);
+                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,"-仓库号");  // warehouse
+                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,"-司机姓名"); //driver_name
+                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,"-车号牌");  //plate_number
+                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,"-是否提供清单"); //provide_list
+                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,"-货主");  // owner
+                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,"-投单员");  // for_single_member
+                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,"-司机电话"); // driver_phone
+                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,"-驾驶证号"); // driving_license_no
+                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,"-收货类型");  // receiving_type
+                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,"-预约号"); //appointment_number
                     this.clodop.PREVIEW();
                 }
             }

+ 204 - 9
resources/views/store/receivingTasks/index.blade.php

@@ -1,16 +1,27 @@
 @extends('layouts.app')
 @section('title')开单入库-查询@endsection
+@section('head')
+    <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
+    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+@endsection
+
 
 @section('content')
     <div id="list" class="d-none">
         <div class="container-fluid">
             <div id="form_div" style="min-width: 1220px;"></div>
+            <div class="ml-3 form-inline" id="btn">
+                    <button type="button"
+                            class="ml-2 btn  btn-sm btn-outline-success "
+                            @click="printReceivingTask" >打印任务清单
+                    </button>
+            </div>
             <div>
                 <table class="table  table-bordered" id="table">
                     <tbody>
-                    <tr v-for="(item,i) in receivingTasks" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
+                    <tr v-for="(item,i) in receiving_tasks" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
                         <td>
-                            <label><input type="checkbox" :value="item.id"></label>
+                            <label><input class="checkItem" type="checkbox" :value="item.id"></label>
                         </td>
                         <td v-text="i+1"></td>
                         <td v-text="item.number"></td>
@@ -34,16 +45,21 @@
                 {{ $receivingTasks->withQueryString()->links() }}
             </div>
         </div>
+        @include('store.receivingTasks._clodop_print')
     </div>
 @endsection
 @section('lastScript')
     <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
     <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
+    <script type="text/javascript" src="{{ mix('js/element-ui.js') }}"></script>
+    <script type="text/javascript" src="{{mix('js/lodop/LodopFuncs.js')}}"></script>
+    <script src='http://localhost:18000/CLodopfuncs.js?name=CLODOPA'></script>
+
     <script>
         let vue = new Vue({
             el: "#list",
             data: {
-                receivingTasks: [],
+                receiving_tasks: [],
                 total: 0,
                 selectTr:0,
                 owners: [
@@ -60,12 +76,31 @@
                     },
                     @endforeach
                 ],
+                receiving_task_print:{
+                    number:null,
+                    warehouse:null,
+                    for_single_member:null,
+                    driver_name:null,
+                    driver_phone:null,
+                    plate_number:null,
+                    driving_license_no:null,
+                    provide_list:null,
+                    receiving_type:null,
+                    owner:null,
+                    appointment_number:null,
+                },
+                clodop:null,
+                clodopPrintDialogVisible: false,
+                printerList: [],
+                print_setting: {
+                    printer_index: 0,
+                }
             },
             mounted() {
-                let receivingTasks = {!! $receivingTasks->toJson() !!}['data'];
+                let receiving_tasks = {!! $receivingTasks->toJson() !!}['data'];
                 this.total = {!! $receivingTasks->toJson() !!}['total'];
                 $("#list").removeClass('d-none');
-                this.receivingTasks = this.sortReceivingTasks(receivingTasks);
+                this.receiving_tasks = this.sortReceivingTasks(receiving_tasks);
 
                 let data = [[
                     {name: 'created_at_start', type: 'dateTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
@@ -116,6 +151,20 @@
                 }).init();
             },
             methods: {
+                waitingTempTip(message) {
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.waitingTip(message);
+                },
+                successTempTip(message) {
+                    window.tempTip.setDuration(1500);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.showSuccess(message);
+                },
+                errorTempTip(message) {
+                    window.tempTip.setDuration(2000);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.show(message);
+                },
                 sortReceivingTasks(tasks) {
                     return tasks.map(e => this.sortReceivingTask(e));
                 },
@@ -123,16 +172,25 @@
                     let asn_nos = this.sortAsnNos(task);
                     let driving_license_no = this.getDrivingLicenseNo(task);
                     let appointment_number = this.getAppointmentNumber(task);
+                    let warehouse = this.getWarehouseName(task);
+                    let owner = this.getOwnerName(task);
+                    console.log(task);
                     return {
                         number: task.number,
                         status: task.status,
                         asn_nos: asn_nos,
                         created_at: task.created_at,
-                        warehouse: task.warehouse ? task.warehouse.name : '',
+                        warehouse: warehouse,
+                        for_single_member: task.for_single_member,
+                        driver_name: task.driver_name,
+                        driver_phone: task.driver_phone,
+                        plate_number: task.plate_number,
+                        provide_list: task.provide_list,
+                        owner: owner,
                         appointment_number: appointment_number,
                         driving_license_no: driving_license_no,
                         receiving_type: task.receiving_type,
-                    }
+                    };
                 },
                 sortAsnNos(task) {
                     let items = task.items;
@@ -148,8 +206,145 @@
                     return delivery_appointment_car ? delivery_appointment_car.appointment_number : '';
                 },
                 getWarehouseName(task) {
-                    let {warehouse} = task;
-                    return warehouse ? warehouse.name : '';
+                    let {ware_house} = task;
+                    return ware_house ? ware_house.name : '';
+                },
+                getOwnerName(task) {
+                    let {owner} = task;
+                    return owner ? owner.name : '';
+                },
+                printReceivingTask(){
+                    let message =null;
+                    if (checkData.length > 1){
+                        message = '进行单个任务打印';
+                    }else if (checkData.length === 1){
+                        message = '请勾选收货任务';
+                    }
+                    if (message){
+                        this.errorTempTip(message);
+                        return ;
+                    }
+                    let id = checkData[0];
+                    this.receiving_task_print = this.receiving_tasks.find(e=>e.id===id);
+                    this.printLodop();
+                },
+                printLodop() {
+                    this.clodop = null;
+                    try {
+                        this.clodop = getLodop();
+                        if ((this.clodop != null) && (typeof (this.clodop.VERSION) != "undefined")) {
+                            this.showPrintDialog();
+                        } else {
+                            this.downloadClodopConfirm();
+                        }
+                    } catch (err) {
+                        this.errorTempTip('getLodop error');
+                    }
+                },
+                downloadClodopConfirm() {
+                    this.$confirm('打印组件确实,是否下在?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        // 下载
+                        this.downloadLodop();
+                    }).catch(() => {
+                        // 取消下载
+                    });
+                },
+                downloadLodop() {
+                    let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
+                    window.open(url, '_target');
+                },
+                showPrintDialog() { //
+                    this.getPrinterList();
+                    this.clodopPrintDialogVisible = true;
+                },
+                getPrinterList() {  // 获取打印机列表
+                    this.printerList = [];
+                    let count = this.clodop.GET_PRINTER_COUNT();
+                    for (let i = 0; i < count; i++) {
+                        this.printerList.push({
+                            name: this.clodop.GET_PRINTER_NAME(i),
+                            value: i,
+                        });
+                    }
+                },
+                clodopPrint(){
+                    let {
+                        number,               // 收货任务号
+                        warehouse,             // 仓库
+                        for_single_member,    // 投单员
+                        driver_name,          // 司机姓名
+                        driver_phone,         // 司机电话
+                        plate_number,          // 车号牌
+                        driving_license_no,    // 驾驶证号
+                        provide_list,         // 是否提供清单
+                        receiving_type,       // 收货类型
+                        owner,                // 货主
+                        appointment_number, // 预约号
+                    } = this.receiving_task_print;
+                    console.log(number);
+                    this.clodop.PRINT_INITA(2,0,0,0,"");
+                    this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
+                    this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39",number);
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,number); // number
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,warehouse);  // warehouse
+                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,driver_name); //driver_name
+                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,plate_number);  //plate_number
+                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,provide_list); //provide_list
+                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,owner);  // owner
+                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,for_single_member);  // for_single_member
+                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,driver_phone); // driver_phone
+                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,driving_license_no); // driving_license_no
+                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,receiving_type);  // receiving_type
+                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,appointment_number); //appointment_number
+                    this.clodop.PREVIEW();
+                    this.clodopPrintDialogVisible = false;
                 }
             },
         })