Pārlūkot izejas kodu

子分支提交,切换工作

Zhouzhendong 4 gadi atpakaļ
vecāks
revīzija
b63e2b62df

+ 1 - 548
app/Http/Controllers/TestController.php

@@ -158,93 +158,12 @@ class TestController extends Controller
             dd("方法不存在");
         }
     }
-    function process(Request $request){
-        $token = trim($request->input('token'));
-        $station_id = 'test';
-        $batch_id = 'W211111001514-6';
-
-        $childIndex = null;
-        $arr = explode('-',$batch_id);
-        if (count($arr)==2){
-            $batch_id = $arr[0];
-            $childIndex = (int)$arr[1];
-            $request->offsetSet("batch_id",$batch_id);
-        }
-
-        /** @var Batch|\stdClass $batch */
-        $batch=Batch::query()->where('code',$batch_id)->orderBy('id','desc')->first();
-        $data=[
-            'result'=>'success',
-            'station_id'=>$station_id,
-            'batch_id'=>$batch_id,
-            'orders'=>[]
-        ];
-        if ($childIndex!==null && $batch->split_size){
-            $start = (($childIndex-1)*$batch->split_size)+1;
-            $end = $childIndex*$batch->split_size;
-            $sql = <<<SQL
-SELECT ORDERNO
-FROM (SELECT T.ORDERNO, ROWNUM AS NO
-FROM (SELECT ORDERNO FROM DOC_WAVE_DETAILS WHERE WAVENO = '{$batch_id}' ORDER BY SEQNO) T)
-WHERE NO BETWEEN {$start} AND {$end}
-SQL;
-            dd($sql);
-            $waves = DB::connection("oracle")->select(DB::raw($sql));
-            $codes = array_column($waves,'orderno');
-            $orders = Order::query()->with(["bin","owner","orderCommodities.commodity.barcodes"])->whereIn("code",$codes)->get();
-        }else $orders = $batch->orders()->with(["bin","owner","orderCommodities.commodity.barcodes"])->get();
-
-        $ordersSorted=$orders->sortBy(function(Order $order){
-            return $order->bin->number;
-        });
-        $ordersSorted->each(function(Order $order)use(&$data,$request,$childIndex,$batch){
-            if($order['status']=='取消')return;
-            $orderData=[
-                'order_id'=>$order['code'],
-                'owner'=>$order->owner->code,
-                'status'=>$order['status']=='未处理'?'available':$order['status'],
-                'created_at'=>$order['created_at']->toDateTimeString(),
-                'bin'=>(function()use($order,$childIndex,$batch){
-                    $bin=$order->bin->number??'';
-                    if(!$bin){
-                        $bin=OracleDOCWaveDetails::query()->where('orderno', 'SO201230003574')->get('seqno')->first()['seqno']??'';
-                        LogService::log(__METHOD__,__FUNCTION__,'bin缺失补查:'.$bin.'. order:'.$order->toJson());
-                        return $childIndex!==null ? $bin-(($childIndex-1)*$batch->split_size) : $bin;
-                    }
-                    return $childIndex!==null ? $bin-(($childIndex-1)*$batch->split_size) : $bin;
-                })(),
-                'barcodes'=>[]
-            ];
-            $order->orderCommodities->each(function(OrderCommodity $orderCommodity)use(&$orderData,$request){
-                $commodity=$orderCommodity->commodity;
-                if(!$commodity){
-                    app('LogService')->log(__METHOD__, 'error' . __FUNCTION__, '播种位数据准备出错,找不到订单对应的Commodity id的对象'.$orderCommodity['commodity_id'].',是否表数据在波次生成后丢失?'.json_encode($request->all()));
-                    return;
-                }
-                $barcodeStr=$commodity->barcodes->map(function(CommodityBarcode $barcode){
-                    return $barcode['code'];
-                })->filter(function($code){
-                    return $code&&(!preg_match('/[\x{4e00}-\x{9fa5}]/u',$code));
-                })->join(',');
-                $orderData['barcodes'][]=[
-                    'id'=>$orderCommodity['id']??'',
-                    'barcode_id'=>$barcodeStr??'',
-                    'name'=>$commodity['name']??'',
-                    'sku'=>$commodity['sku']??'',
-                    'amount'=>$orderCommodity['amount']??'',
-                    'location'=>$orderCommodity['location']??'',
-                ];
-            });
-            $data['orders'][]=$orderData;
-        });
-        return $data;
-    }
 
     public function test(Request $request)
     {
         return view("equipment.index");
         $path = '';
-        $id = 109;
+        $id = 181;
 
         $file = fopen($path, "r");
         $user=array();
@@ -270,470 +189,4 @@ SQL;
             ]);
         }
     }
-    public function test1()
-    {
-        $a = new \App\Http\Controllers\api\thirdPart\syrius\producer\OrderController();
-        dd($a->createOrder($this->t2())->body());
-    }
-
-
-    public function init_labor_company_dispatch()
-    {
-        $dispatches = LaborCompanyDispatch::all();
-        foreach ($dispatches as $dispatch) {
-            $dispatch->warehouse_id = $dispatch->laborCompany->warehouse_id ?? null;
-            $dispatch->save();
-        }
-    }
-
-    private function t2()
-    {
-        $task = new Task();
-        $task->id = "TEST0004";
-        #$task->batchId = "WTEST0001";
-        $task->warehouseId = "101";
-        $task->type = Task::PUTAWAY;
-        $task->attributes = [
-            "customer" => "幼岚",
-        ];
-        $task->storages = [["serialNo"=>"1635055429594424"]];
-        $task->items = [
-            $this->p1(),
-            $this->p2(),
-        ];
-        return $task->get();
-    }
-    private function p1()
-    {
-        $taskItem = new TaskItem();
-        $taskItem->name = "测试衣服商品名2";
-        $taskItem->barcode = "TEST-013";
-        $taskItem->quantity = (int)1;
-        $taskItem->binLocations = [
-            "G11-133-1",
-        ];
-        $taskItem->attributes = [
-            "storageSerialNo"=>"1635055429594424",
-            "orderLineNo" => "1",
-            "skuLineNo"   => "1",
-            "sku"         => "TEST1",
-            "lotNum"      => "LOT179201",
-            "logisticNumber"=> "圆通",
-        ];
-        return (array)$taskItem->get();
-    }
-    private function p2()
-    {
-        $taskItem = new TaskItem();
-        $taskItem->name = "测试衣服  商品名";
-        $taskItem->barcode = "TEST-012";
-        $taskItem->quantity = (int)1;
-        $taskItem->binLocations = [
-            "G11-099-1",
-        ];
-        $taskItem->attributes = [
-            "storageSerialNo"=>"1635055429594424",
-            "orderLineNo" => "1",
-            "skuLineNo"   => "1",
-            "sku"         => "TEST",
-            "lotNum"      => "LOT17920",
-            "logisticNumber"=> "顺丰",
-        ];
-        return (array)$taskItem->get();
-    }
-
-
-    public function update_order_packages_is_manual_update()
-    {
-        $descriptions = Log::query()
-            ->select('description')
-            ->whereBetween('created_at', ['2021-08-31 10:30:00', '2021-08-31 10:35:00'])
-            ->where('class', 'like', 'https://was.baoshi56.com/package/logistic/batchUpdate%')->pluck('description');
-        foreach ($descriptions as $description) {
-            $description = substr($description, 9);
-            $description = \Illuminate\Support\Str::before($description, "}");
-            $obj = json_decode($description . '}', true);
-            OrderPackage::query()
-                ->whereIn('logistic_number', $obj['logistic_numbers'])
-                ->update([
-                    'status' => '无',
-                    'is_manual_update' => false,
-                ]);
-        }
-    }
-
-    public function testUpdateInv()
-    {
-        ini_set('max_execution_time', 0);
-        ini_set('memory_limit', '4096M');
-        $sql = <<<sql
-select FMLOTNUM,FMLOCATION,PLANTOLOCATION,CREATE_TRANSACTIONID,SKU,CUSTOMERID from TSK_TASKLISTS
-where CUSTOMERID=?
-  AND FMLOCATION= ?
-  AND OPENWHO = ?
-  AND TASKPROCESS = ?
-  AND DOCTYPE = ?
-  AND TASKTYPE = ?
-  AND LOTATT05=?
-  AND LOTATT08=?
-  AND PLANTOID = ?
-  and OPENTIME>=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
-  and OPENTIME<=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
-sql;
-        $CUSTOMERID = 'JIANSHANG';
-        $FMLOCATION = 'STAGEWH02';
-        $OPENWHO = 'WCS';
-        $TASKPROCESS = '00';
-        $DOCTYPE = 'ASN';
-        $TASKTYPE = 'PA';
-        $LOTATT05 = 'MJ-CP';
-        $LOTATT08 = 'ZP';
-        $PLANTOID = '*';
-        $traceid = 'JIANSHANG03';
-        $start = '2021-09-02 23:59:59';
-        $end = '2021-09-03 11:10:00';
-        $res = DB::connection("oracle")->select(DB::raw($sql),
-            [$CUSTOMERID, $FMLOCATION, $OPENWHO, $TASKPROCESS, $DOCTYPE, $TASKTYPE, $LOTATT05, $LOTATT08, $PLANTOID, $start, $end]);
-        $resItems = array_chunk($res, 200);
-        foreach ($resItems as $res) {
-            DB::connection("oracle")->beginTransaction();
-            try {
-                foreach ($res as $re) {
-                    DB::connection("oracle")->table('INV_LOT_LOC_ID')
-                        ->where([
-                            'LOTNUM' => $re->fmlotnum,
-                            'LOCATIONID' => $re->fmlocation,
-                            'CUSTOMERID' => $re->customerid,
-                            'sku' => $re->sku,
-                            'TRACEID' => '*',
-                        ])
-                        ->update([
-                            'TRACEID' => $traceid,
-                            'EDITWHO' => 'WCS_',
-                        ]);
-                    if ($re->fmlocation != $re->plantolocation) {
-                        DB::connection("oracle")->table('INV_LOT_LOC_ID')
-                            ->where([
-                                'LOTNUM' => $re->fmlotnum,
-                                'LOCATIONID' => $re->plantolocation,
-                                'CUSTOMERID' => $re->customerid,
-                                'sku' => $re->sku,
-                                'TRACEID' => '*',
-                            ])
-                            ->update([
-                                'TRACEID' => $traceid,
-                                'EDITWHO' => 'WCS_',
-                            ]);
-                    }
-                    DB::connection("oracle")->commit();
-                }
-                dd(true);
-            } catch (\Exception $e) {
-                DB::connection("oracle")->rollBack();
-                dd($e->getMessage());
-            }
-        }
-    }
-
-    /**
-     * 重置15天内的数据
-     */
-    public function order_packages_init()
-    {
-        OrderPackage::query()
-            ->whereBetween('created_at', [now()->subDays(15), now()])
-            ->update([
-                'is_delay_deliver' => 0,
-                'sync_routes_flag' => 0,
-                'status' => 1,
-                'exception_status' => 0,
-            ]);
-        OrderPackage::query()
-            ->whereBetween('created_at', [now()->subDays(15), now()])
-            ->whereNotNull('received_at')
-            ->update([
-                'status' => 7,
-            ]);
-    }
-
-    public function syncOrderPackage(){
-        ini_set('memory_limit','500M');
-        ini_set('max_execution_time', 0);
-        $orderPackingSummary = OracleDocOrderPackingSummary::query()
-            ->where('editTime','>=','2021-09-11 12:00:00')
-            ->where('editTime','<=','2021-09-12 12:40:00')
-            ->get();
-
-        $orderPackingSummary_chunk = $orderPackingSummary->chunk(200);
-        foreach ($orderPackingSummary_chunk as $orderPackingSummarys) {
-            foreach ($orderPackingSummarys as $orderPackingSummary) {
-                $orderPackage = OrderPackage::query()->where('logistic_number',$orderPackingSummary->traceid)->first();
-                $orderPackage->update([
-                    'uploaded_to_wms'=> true,
-                    'weight'=>$orderPackingSummary->grossweight,
-                    'length'=>$orderPackingSummary->length,
-                    'width'=>$orderPackingSummary->width,
-                    'height'=>$orderPackingSummary->height,
-                    'weighed_at'=>$orderPackingSummary->edittime
-                ]);
-                dispatch(new WeightUpdateInstantBill($orderPackage));
-            }
-        }
-        return ['success' => true];
-    }
-
-    public function collectUpload()
-    {
-        /** @var OrderPackageService $service */
-        $service = app('OrderPackageService');
-       return $service->collectUpload([
-           '75601803541125'
-        ]);
-    }
-
-    public function init_在途异常()
-    {
-        $logistic_numbers = OrderPackage::query()
-            ->select('logistic_number')
-            ->where('exception_status', 5)
-            ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
-            ->pluck('logistic_number');
-        /** @var OrderPackageReceivedSyncService $service */
-        $service = app('OrderPackageReceivedSyncService');
-        $service->syncLogisticRoute(false, $logistic_numbers);
-
-
-//        $logistic_numbers = OrderPackage::query()
-//            ->select(['logistic_number', 'order_id', 'id'])
-//            ->whereIn('order_id', function ($query) {
-//                $query->from('orders')->selectRaw('id')->whereIn('logistic_id', function ($builder) {
-//                    $builder->from('logistics')->selectRaw('id')->where('type', '=', '快递')->whereNotIn('belong_company', ['顺丰', '中通', '韵达', '圆通', '京东']);
-//                });
-//            })
-//            ->where('exception_status', 5)
-//            ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
-//            ->pluck('logistic_number');
-//        $service->syncLogisticRouteByAliJiSu($logistic_numbers);
-    }
-
-    public function store()
-    {
-        ini_set('max_execution_time', 0);
-        ini_set('memory_limit', '1024M');
-//        $now = Carbon::now();
-//        $startDate = $this->getDate();
-        $startDate = '2021-09-25 13:23:14';
-        $diffDay = 1; // 天数
-        for($i = 0;$i<=$diffDay;$i++){
-            $endDate = Carbon::parse($startDate)->addDays(1)->toDateTimeString();
-            $doc_asn_headers = $this->getDocAsnHeader($startDate,$endDate);
-//            if (count($doc_asn_headers)>0){
-//                $this->syncStores($doc_asn_headers);
-//                $this->syncDate($endDate);
-//            }
-            dump($startDate,$endDate);
-            $startDate = $endDate;
-        }
-        $this->clearCache();
-//        ValueStore::query()->updateOrCreate([
-//            'name' => 'last_asn_sync_task_end_at',
-//        ], [
-//            'name' => 'last_asn_sync_task_end_at',
-//            'value' => $now,
-//        ]);
-    }
-
-
-
-    public function getDocAsnHeader($startDate,$endDate)
-    {
-        return OracleDOCASNHeader::query()
-            ->with(['asnType', 'asnStatus'])
-            ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
-            ->where('EditTime', '>=', $startDate)
-            ->where('EditTime', '<=', $endDate)
-            ->whereColumn('EditTime', '<>', 'addTime')
-            ->orderByDesc('EditTime')
-            ->get();
-    }
-
-    public function getDate(){
-        return ValueStore::query()->where('name','asn_last_updated_sync_at')->value('value');
-    }
-
-    public function syncStores($doc_asn_headers){
-        $service = new StoreService();
-        $service->createStore($doc_asn_headers,"update");
-        $service->updateStore($doc_asn_headers);
-        $service->createStoreRejected($doc_asn_headers);
-        unset($doc_asn_headers);
-    }
-
-    public function syncDate($date)
-    {
-        // 同步更新时间
-        ValueStore::query()->updateOrCreate([
-            'name' => 'asn_last_updated_sync_at',
-        ], [
-            'name' => 'asn_last_updated_sync_at',
-            'value' => $date,
-        ]);
-    }
-    public function clearCache()
-    {
-        $service = new StoreService();
-        $update_set = config('sync.asn_sync.cache_prefix.update_set');
-        $update_keys = config('sync.asn_sync.cache_prefix.update_keys');
-        $service->deleteCacheKey($update_set, $update_keys);
-        // 清空保存 ans  号的栈
-        // 清除 更新时间 开始 结束
-    }
-    public function updateStoreItem()
-    {
-        ini_set('max_execution_time', 0);
-        ini_set('memory_limit', '1024M');
-        $storeIds = Store::query()
-            ->where('updated_at', '>=', '2021-09-25 13:21:26')
-            ->whereColumn('updated_at', '<>', 'created_at')
-            ->pluck('id');
-
-        $storeItemMaxIds = StoreItem::query()
-            ->selectRaw('max(id) as max_id')
-            ->whereIn('store_id', $storeIds)
-            ->groupBy(['store_id', 'asn_line_code'])
-            ->get();
-//        dd($storeItemMaxIds->count());
-        $storeItems = StoreItem::query()
-            ->whereIn('store_id', $storeIds)
-            ->whereNotIn('id', $storeItemMaxIds)
-            ->delete();
-    }
-
-    public function init_SettlementBillReportTask()
-    {
-        $this->dispatch(new SettlementBillReportJob('2021-09-01',[]));
-    }
-    public function test2(){
-        $source_file ="E:\OneDrive\桌面\工作目录\文件库\\5.jpg";
-
-        $img = ImageCreateFromJpeg($source_file);
-        imagecolortransparent($img);//将某个颜色设置成透明色
-        imagecolorstotal($img);
-        header('Content-type:image/jpeg');
-        imagejpeg($img);
-        //dd($this->run('E:\OneDrive\桌面\工作目录\文件库\5.jpg', 'E:\OneDrive\桌面\工作目录\文件库\6.jpg'));
-    }
-
-
-    const FILE_NOT_FOUND = '-1';
-    const FILE_EXTNAME_ILLEGAL = '-2';
-
-    public function run($src1, $src2) {
-        if(!is_file($src1) || !is_file($src2)) exit(self::FILE_NOT_FOUND);
-        $hash1 = $this->getHashValue($src1);
-        $hash2 = $this->getHashValue($src2);
-        if(strlen($hash1) !== strlen($hash2)) return false;
-        $count = 0;
-        $len = strlen($hash1);
-        for($i = 0; $i < $len; $i++) if($hash1[$i] !== $hash2[$i]){
-            $count++;
-        }
-        dd($count);
-        return $count <= 10 ? true : false;
-    }
-
-    public function getImage($file) {
-        $extname = pathinfo($file, PATHINFO_EXTENSION);
-        if(!in_array($extname, ['jpg','jpeg','png','gif'])) exit(self::FILE_EXTNAME_ILLEGAL);
-        $img = call_user_func('imagecreatefrom'. ( $extname == 'jpg' ? 'jpeg' : $extname ) , $file);
-        return $img;
-    }
-    public function getHashValue($file) {
-        $w = 32;
-        $h = 32;
-        $img = imagecreatetruecolor($w, $h);
-        list($src_w, $src_h) = getimagesize($file);
-        $src = $this->getImage($file);
-        imagecopyresampled($img, $src, 0, 0, 0, 0, $w, $h, $src_w, $src_h);
-        imagedestroy($src);
-        $total = 0;
-        $array = array();
-        for( $y = 0; $y < $h; $y++) {
-            for ($x = 0; $x < $w; $x++) {
-                $rgb = imagecolorat($img, $x, $y);
-                $gray = $rgb & 0xFF;
-                /*dump([
-                    ($rgb >> 8) & 0xFF,
-                    ($rgb >> 16) & 0xFF,
-                    $rgb & 0xFF,
-                ]);*/
-                if(!isset($array[$y])) $array[$y] = array();
-                $array[$y][$x] = $gray;
-                $total += $gray;
-            }
-        }
-        imagedestroy($img);
-        $average = intval($total / ($w * $h * 2));
-        $hash = '';
-        for($y = 0; $y < $h; $y++) {
-            for($x = 0; $x < $w; $x++) {
-                $hash .= ($array[$y][$x] >= $average) ? '1' : '0';
-            }
-        }
-        dump($hash);
-        return $hash;
-    }
-
-    public function sortTransferStatus()
-    {
-        $orderPackage = OrderPackage::query()->where('logistic_number','75601831068018')->first();
-        app('OrderPackageService')->sortOrderPackageTransferStatus($orderPackage);
-        dd($orderPackage);
-    }
-
-    public function clear_work_space()
-    {
-        \App\LaborApply::query()->truncate();
-
-        LaborCompanyDispatch::query()->truncate();
-
-        \App\LaborCompanyDispatchDetail::query()->truncate();
-    }
-
-    public function testChange()
-    {
-        $last_start_key = config('sync.order_sync.cache_prefix.last_start_at');
-        $last_end_key = config('sync.order_sync.cache_prefix.last_end_at');
-        Cache::put($last_start_key,Carbon::make('2021-10-12 06:23:37'));
-        Cache::put($last_end_key,Carbon::make('2021-10-12 06:23:38'));
-        ValueStore::query()->where('name','order_last_created_sync_at')->update(['value' => '2021-10-12 06:23:37']);
-        ValueStore::query()->where('name','order_last_updated_sync_at')->update(['value' => '2021-10-12 06:23:37']);
-        ValueStore::query()->where('name','last_order_sync_task_start_at')->update(['value' => '2021-10-12 06:23:37']);
-        ValueStore::query()->where('name','last_order_sync_task_end_at')->update(['value' => '2021-10-12 06:23:38']);
-    }
-
-
-    public function syncOrder()
-    {
-        $code = \request("code");
-        $service = new OracleDOCOrderHeaderService();
-        $orderService = new OrderService();
-        $orderHeaders = $service->getQuery()->where('DOC_Order_Header.WaveNo',$code)->get();
-        $orderService->syncOrderByWMSOrderHeaders($orderHeaders);
-        app("OrderCommodityService")->syncOrderCommodity($orderHeaders);
-        dd('同步完成');
-    }
-
-    public function test_sddgdfg()
-    {
-        /** @var OwnerStoreOutFeeReportService $service */
-        $service = app('OwnerStoreOutFeeReportService');
-        $service->recordReport(null, [2]);
-    }
-
-    public function testZhenCang()
-    {
-        $batches=Batch::query()->where('id',161071)->get();
-        BroadcastBatchToZhengCangJob::dispatch($batches);
-    }
 }

+ 49 - 0
resources/js/utilities/toast.js

@@ -0,0 +1,49 @@
+window.toast={
+    container : function (){
+        let div = $("<div style='position: absolute;top:0;width: 100%;z-index: 9999'></div>");
+        $("body").append(div);
+        return div;
+    }(),
+    setIndex : function (num){
+        this.container.css("z-index",num);
+    },
+    build:function (model,msg,duration){
+        let div = $("<div class='d-flex justify-content-center align-items-center p-2'></div>");
+        let toast = $("<div class='toast hide'></div>");
+        toast.attr("role","alert");
+        toast.attr("aria-live","assertive");
+        toast.attr("aria-atomic","true");
+        toast.attr("data-delay",duration);
+        let info = $("<div style='min-width: 400px'></div>")
+        let txt = $("<div class='ml-3'></div>");
+        let i = $("<i></i>");
+        switch (model){
+            case "success":
+                info.css("background","RGB(240,249,235)");
+                info.addClass("toast-body text-success");
+                i.addClass("fa fa-chevron-circle-down text-success");
+                break;
+            case "fail":
+                info.css("background","RGB(255,240,240)");
+                info.addClass("toast-body text-danger");
+                i.addClass("fa fa-times-circle text-danger");
+        }
+        txt.append(i);
+        txt.append(msg);
+        info.append(txt);
+        toast.append(info);
+        div.append(toast);
+        this.container.append(div);
+        toast.toast("show");
+        toast.on("hidden.bs.toast",function (){
+            div.remove();
+        });
+    },
+    success : function (msg = "SUCCESS!",duration = 2000){
+        this.build("success",msg,duration)
+    },
+    error : function (msg = "ERROR!",duration = 3000){
+        this.build("fail",msg,duration)
+    },
+};
+module.exports=toast;

+ 15 - 14
resources/views/equipment/_detailInfo.blade.php

@@ -1,48 +1,49 @@
-<div class="modal fade" id="detailInfo" tabindex="-1" role="dialog" :data-backdrop="isNotEdit ? 'true' : 'static'" data-keyboard="false" aria-hidden="true">
+<div class="modal fade" id="detailInfo" tabindex="-1" role="dialog" data-keyboard="false" aria-hidden="true"
+     :data-backdrop="current.eqId ? 'true' : 'static'" >
     <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
         <div class="modal-content">
             <div class="modal-header row m-0">
                 <div class="col-5 form-inline h-5 font-weight-bold">
-                    设备编号:<input class="form-control"></input>
+                    设备编号:<input class="form-control" :class="error.code ? 'is-invalid' : ''" v-model="current.code"></input>
                 </div>
                 <div class="col-5">
                     <div class="form-inline h-50">
-                        设备宽度/M:<input class="form-control form-control-sm" type="number" step="0.01"></input>
+                        设备宽度/M:<input class="form-control form-control-sm" :class="error.width ? 'is-invalid' : ''" type="number" step="0.01" v-model="current.width"></input>
                     </div>
                     <div class="form-inline h-50 mt-1">
-                        设备深度/M:<input class="form-control form-control-sm" type="number" step="0.01"></input>
+                        设备深度/M:<input class="form-control form-control-sm" :class="error.depth ? 'is-invalid' : ''" type="number" step="0.01" v-model="current.depth"></input>
                     </div>
                 </div>
                 <div class="col-2">
                     所属库区
-                    <select class="form-control form-control-sm">
-                        <option>1</option>
+                    <select class="form-control form-control-sm" v-model="current.repository" :class="error.repositoryId ? 'is-invalid' : ''">
+                        <option v-for="repository in repositories" :value="repository.id">@{{ repository.code+'('+repository.name+')' }}</option>
                     </select>
                 </div>
             </div>
             <div class="modal-body row">
                 <div class="col-6" style="border-right: 1px #D3D3D3 solid">
-                    <div v-for="layer in 5" style="border: 1px #000000 solid;height: 70px;cursor: pointer" @click="nextDetail()"
-                        :style="[layer===1 ? {borderTop:'none'} : '',layer===5 ? {borderBottom:'none'} : '',{width:100*2+'px'}]">
+                    <div v-for="layer in current.layer" style="border: 1px #000000 solid;height: 70px;cursor: pointer" @click="nextDetail(layer)"
+                        :style="[layer===1 ? {borderTop:'none'} : '',layer===current.layer ? {borderBottom:'none'} : '',{width:100*(current.grid)+'px'}]">
                         <span class="h-100 w-100 el-center">@{{ layer<10 ? '0'+layer : layer }}</span>
                     </div>
                 </div>
-                <div class="col-6 p-0">
-                    <div v-for="layer in 5" class="row m-0" style="border-bottom: 1px #D3D3D3 solid;height: 70px">
+                <div class="col-6 p-0" :style="[error.children ? {border: '2px red solid'} : '']">
+                    <div v-for="(item,i) in current.children" class="row m-0" style="border-bottom: 1px #D3D3D3 solid;height: 70px">
                         <div class="col-4">
-                            设备高度/M:<input class="form-control" type="number" step="0.01"></input>
+                            设备高度/M:<input class="form-control" type="number" step="0.01" :class="error['children['+i+'].height'] ? 'is-invalid' : ''" v-model="item.height"></input>
                         </div>
                         <div class="col-4">
-                            库位行数:<input class="form-control" type="number" step="1"></input>
+                            库位行数:<input class="form-control" :disabled="current.eqId!==undefined" type="number" step="1" :class="error['children['+i+'].row'] ? 'is-invalid' : ''" v-model="item.row"></input>
                         </div>
                         <div class="col-4">
-                            库位列数:<input class="form-control" type="number" step="1"></input>
+                            库位列数:<input class="form-control" :disabled="current.eqId!==undefined" type="number" step="1" :class="error['children['+i+'].column'] ? 'is-invalid' : ''" v-model="item.column"></input>
                         </div>
                     </div>
                 </div>
             </div>
             <div class="modal-footer">
-                <button class="pull-right btn btn-success" >保存设备信息</button>
+                <button class="pull-right btn btn-success" @click="saveOrUpdate()">保存设备信息</button>
             </div>
         </div>
     </div>

+ 32 - 10
resources/views/equipment/_location.blade.php

@@ -1,24 +1,46 @@
-<div class="modal fade" id="locationModal" tabindex="1" role="dialog" aria-hidden="true">
+<div class="modal fade" id="locationModal" v-if="currentEqChildIndex!==null" tabindex="1" role="dialog" aria-hidden="true">
     <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h1 class="offset-5">A-1025-01</h1>
+                <h1 class="offset-5">@{{ current.code+'-'+((currentEqChildIndex+1)<10 ? '0'+(currentEqChildIndex+1) : (currentEqChildIndex+1)) }}</h1>
                 <button type="button" class="close" data-dismiss="modal">&times;</button>
             </div>
             <div class="modal-body p-0">
                 <div class="text-center h1" v-if="isLoadLocation">
                     <i class="fa fa-spinner fa-pulse"></i>
                 </div>
-                <table class="table table-bordered w-100 m-0" v-else>
-                    <tr v-for="row in 5">
-                        <td v-for="column in 5" class="p-0">
-                            @{{ ((row-1)*5)+column }}
-                        </td>
-                    </tr>
-                </table>
+                <div class="w-100" v-else>
+                    <table class="table table-bordered w-100 h-100 m-0"
+                        v-if="current.children[currentEqChildIndex].row>0 && current.children[currentEqChildIndex].column>0">
+                        <tr v-for="row in current.children[currentEqChildIndex].row">
+                            <td v-for="column in current.children[currentEqChildIndex].column" v-if="locations[row-1] && locations[row-1][column-1]"
+                                class="p-0 text-center">
+                                <div style="border: 2px darkgray solid;" class="el-center w-100 h-100 text-secondary font-weight-bold">
+                                    @{{ locations[row-1][column-1].code }}</div>
+                            </td>
+                        </tr>
+                    </table>
+                    <div class="w-100 mt-5 row" v-else>
+                        <div class="input-group m-3 col-5">
+                            <input type="number" step="1" class="form-control" placeholder="构建行数" v-model="buildPool.row">
+                            <div class="input-group-append">
+                                <span class="input-group-text">行</span>
+                            </div>
+                        </div>
+                        <div class="col-1 mt-4 h5 font-weight-bold">×</div>
+                        <div class="input-group m-3 col-5">
+                            <input type="number" step="1" class="form-control" placeholder="构建列数" v-model="buildPool.column">
+                            <div class="input-group-append">
+                                <span class="input-group-text">列</span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
             </div>
             <div class="modal-footer">
-                <button class="pull-right btn btn-danger">解除该设备库位绑定</button>
+                <button v-if="current.children[currentEqChildIndex].row>0 && current.children[currentEqChildIndex].column>0" @click="removeLocationBind()"
+                        class="pull-right btn btn-danger">解除该设备库位绑定</button>
+                <button v-else @click="locationBind()" class="pull-right btn btn-success">根据行列自动构建库位</button>
             </div>
         </div>
     </div>

+ 306 - 40
resources/views/equipment/index.blade.php

@@ -47,6 +47,9 @@
             -o-transform:rotate(-90deg); /* Opera */
             filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
             font-family: "Microsoft YaHei Light","sans-serif";
+            font-size: 10px;
+            white-space:nowrap;
+            font-weight:bold;
         }
         /*opacity是设置遮罩透明度的,可以自己调节*/
         #loading{position:fixed;top:0;left:0;width:100%;height:100%;background:#f8f8f8;opacity:0.6;z-index:15000;}
@@ -169,7 +172,7 @@
             </div>
             <button @click="clickEditOrSave()" :class="isNotEdit ? 'btn-info' : 'btn-success'"
                     style="position:absolute;bottom: 20px;cursor: pointer" class="btn col-10 text-white">
-                <span v-if="isNotEdit">开启编辑</span>
+                <span v-if="isNotEdit">开启场景编辑</span>
                 <span v-else>保存更改</span>
             </button>
         </div>
@@ -194,13 +197,15 @@
                         <div :class="coordsMapping[element.coords]">@{{ element.name }}</div>
                     </vue-drag-resize>
                     <vue-drag-resize style="border-width:1px;border-color: #0070C0;border-style: dashed;cursor: pointer"
-                                     v-for="(element,index) in equipmentElements"
+                                     v-for="(element,index) in equipmentElements" @clicked="showDetail(element)"
                                      :is-resizable="false" :snap-to-grid="grid" :grid-x="40" :grid-y="30"
                                      :style="[{backgroundColor:element.color}]"
+                                     @activated="onActivated(element)"
+                                     @dragging="equipmentDrag"
                                      :key="'eq-'+index" :prevent-active-behavior="isNotEdit"
-                                     :parent-limitation="true" :w="element.width" :h="element.height"
+                                     :parent-limitation="true" :w="element.w" :h="element.h"
                                      :x="element.x" :y="element.y" :z="90">
-                        <div class="h-100 re w-100 el-center">@{{ element.name }}</div>
+                        <div class="h-100 re w-100 el-center">@{{ element.code }}</div>
                     </vue-drag-resize>
                 </div>
             </div>
@@ -215,11 +220,13 @@
 </div>
 </body>
 <script src="{{ mix('js/app.js') }}"></script>
+<script src="{{ mix('js/utilities/toast.js') }}"></script>
 <script type="text/javascript">
     var vue = new Vue({
         el:"#container",
         data:{
             warehouses:[], //仓库描述
+            repositories:[],                                            //库区
             selected:"",                                                //当前选中的仓库ID
             container:{width:1950,height:1125},                         //容器初始大小
             name:"",                                                    //当前选中的仓库NAME
@@ -237,13 +244,13 @@
             clientCoords:{},                                            //坐标系记录
             scale:100,                                                  //缩放值
             equipments:[                                                //备选设备池
-                {id:1,w:22.5,h:45,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
-                {id:2,w:22.5,h:45,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
-                {id:3,w:22.5,h:45,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
-                {id:4,w:22.5,h:45,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
-                {id:5,w:22.5,h:30,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
-                {id:6,w:22.5,h:30,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
-                {id:7,w:22.5,h:30,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
+                {id:1,w:22.5,h:45,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
+                {id:2,w:22.5,h:45,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
+                {id:3,w:22.5,h:45,grid:1,layer:3,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
+                {id:4,w:22.5,h:45,grid:2,layer:3,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
+                {id:5,w:22.5,h:30,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
+                {id:6,w:22.5,h:30,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
+                {id:7,w:22.5,h:30,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
             ],
             currentEq:{                                                 //选中的设备
                 el:null,
@@ -253,17 +260,48 @@
             grid:true,                                                  //设备拖拽是否开启网格
             isLoadLocation:false,                                       //开启加载库位
             baseUrl:"http://127.0.0.1:8112/",
+            current:{},                                                 //当前操作的设备
+            error:{},
+            locations:[],
+            currentEqChildIndex:null,
+            buildPool:{},
         },
         mounted() {
             this.initPage();
         },
         methods:{
             clickEditOrSave(){
-                if(this.isNotEdit){
-                    this.isNotEdit = false;
-                    return;
-                }
-                console.log("保存更改");
+                if(this.isNotEdit){this.isNotEdit = false;return;}
+                let equipments = [];
+                this.equipmentElements.forEach(equipment=>{
+                    if (equipment.updateCoords){
+                        equipments.push({
+                            id:equipment.eqId,
+                            info:JSON.stringify({x:equipment.x,y:equipment.y,id:equipment.id})
+                        });
+                    }
+                });
+                $.ajax({
+                    url : this.baseUrl+"warehouse/saveScene",
+                    type : "POST",
+                    headers:{'Content-Type':'application/json;charset=utf8'},
+                    data:JSON.stringify({id:this.selected,warehouse:JSON.stringify(this.elements),equipment:equipments}),
+                    success : (res,status)=>{
+                        if (res.code===200){
+                            this.isNotEdit = true;
+                            window.toast.success("场景更改保存成功");
+                        }else window.toast.error(res.message);
+                    },
+                    error : (err,status)=>{
+                        window.tempTip.show("加载失败");
+                    },
+                    complete:(req,status)=>{
+                        if (status==='timeout'){
+                            window.toast.error("服务器响应超时");
+                        }
+                    },
+                    timeout:10000,
+                })
             },
             initPage(){
                 $.ajax({
@@ -321,20 +359,20 @@
                 if (this.isNotEdit)return;
                 if (this.currentEq.obj===null)return;
                 this.currentEq.el.remove();
-                this.currentEq.el = null;
-
+                setTimeout(()=>{
+                    this.currentEq.el.remove();
+                    this.currentEq.el = null;
+                },20);
                 let content = document.getElementById("canvasApp");
                 let toolWid = document.getElementById("tool").offsetWidth;
                 let x = event.clientX-toolWid+content.scrollLeft;
                 let y = event.clientY+content.scrollTop;
                 if (x>=0 && y>=0){
-                    this.equipmentElements.push({
-                        x:x, y:y,
-                        width:this.currentEq.obj.w,
-                        height:this.currentEq.obj.h,
-                        name:"test",
-                        color:this.currentEq.obj.color,
-                    });
+                    let children = [];
+                    for (let i=0;i<this.currentEq.obj.layer;i++)children.push({});
+                    this.equipmentElements.push(Object.assign({children:children,x:x,y:y}, this.currentEq.obj));
+                    this.current = this.equipmentElements[this.equipmentElements.length-1];
+                    $("#detailInfo").modal("show");
                 }
                 this.currentEq.obj = null;
             },
@@ -375,6 +413,14 @@
                 if (this.isNotEdit)return;
                 this.currentEl.x=newRect.left;
                 this.currentEl.y=newRect.top;
+                $("#canvas").focus();
+            },
+            equipmentDrag(newRect){
+                if (this.isNotEdit)return;
+                this.currentEl.x=newRect.left;
+                this.currentEl.y=newRect.top;
+                this.currentEl.updateCoords = true;
+                $("#canvas").focus();
             },
             //仓库切换
             selectedWarehouse(warehouse){
@@ -387,7 +433,26 @@
                     dataType : "JSON",
                     data : {id:warehouse.id},
                     success : (res,status)=>{
-                        if (res.data)this.elements = JSON.parse(res.data);
+                        if (res.data[0])this.elements = JSON.parse(res.data[0]);
+                        if(res.data[1] && res.data[1].length>0){
+                            let equipmentElements = [];
+                            res.data[1].forEach(eq=>{
+                                let coords = JSON.parse(eq.info);
+                                let selfInfo = this.equipments[coords.id-1];
+                                equipmentElements.push(Object.assign({
+                                    eqId:eq.id,
+                                    code:eq.code,
+                                    width:eq.width,
+                                    depth:eq.depth,
+                                    repository:eq.repositoryId,
+                                    x:coords.x,
+                                    y:coords.y,
+                                },selfInfo));
+                            });
+                            this.equipmentElements = equipmentElements;
+                        }
+                        this.repositories = res.data[2];
+                        this.isNotEdit = true;
                     },
                     error : (err,status)=>{
                         window.tempTip.show("坐标信息加载失败");
@@ -404,22 +469,223 @@
                 this.currentEl[key] = event.target.value ? parseFloat(event.target.value) : 0;
             },
             //子设备选定时的库位加载
-            nextDetail(layer){
-                let parentDom = document.getElementById("detailInfo").firstChild.firstChild;
-                let childDom = document.getElementById("locationModal").firstChild.firstChild;
-                childDom.style.minWidth = parentDom.offsetWidth+'px';
-                childDom.style.minHeight = parentDom.offsetHeight+'px';
-                $("#locationModal").modal("show");
+            nextDetail(index){
+                this.currentEqChildIndex = index-1;
                 this.isLoadLocation = true;
+                setTimeout(function (){
+                    let parentDom = document.getElementById("detailInfo").firstChild.firstChild;
+                    let childDom = document.getElementById("locationModal").firstChild.firstChild;
+                    childDom.style.minWidth = parentDom.offsetWidth+'px';
+                    childDom.style.minHeight = parentDom.offsetHeight+'px';
+                    $("#locationModal").modal("show");
+                },20);
+                let children = this.current.children[this.currentEqChildIndex];
+                $.ajax({
+                    url : this.baseUrl+"location/get",
+                    type : "post",
+                    dataType : "JSON",
+                    data : {id:children.id},
+                    success : (res)=>{
+                        switch (res.code){
+                            case 200:
+                                this.locations = this._chunkArr(res.data,children.column);
+                                this.isLoadLocation = false;
+                                setTimeout(()=>{
+                                    let parentDom = document.getElementById("detailInfo").firstChild.firstChild;
+                                    let childDom = document.getElementById("locationModal").firstChild.firstChild;
+                                    childDom.children[1].firstChild.style.height = parentDom.children[1].offsetHeight+'px';
+                                },10);
+                                break;
+                            default:
+                                alert("未知响应");
+                        }
+                    },
+                    error : (err)=>{
+                        window.tempTip.setIndex(999);
+                        window.tempTip.show("网络错误");
+                    },
+                    timeout:3000,
+                })
+            },
+            _chunkArr(arr, size){
+                let result = [];
+                let item = [];
+                for (let i=0;i<arr.length;i++){
+                    if (i!==0 && i%size===0){
+                        result.push(item);
+                        item = [];
+                    }
+                    item.push(arr[i]);
+                }
+                if (item.length!==0)result.push(item);
+                console.log(result);
+                return result;
+            },
+            showDetail(equipment){
+                if (!this.isNotEdit)return;
+                this.current = equipment;
                 setTimeout(()=>{
-                    this.isLoadLocation = false;
-                    setTimeout(()=>{
-                        childDom.children[1].firstChild.style.height = parentDom.children[1].offsetHeight+'px';
-                    },10);
-                },2000);
-                //开启隐去现DIV动画,加载新DIV,加载数据
-                //请求加载
-                //关闭动画
+                    $("#detailInfo").modal("show");
+                    this.contentOnmouseup();
+                },20);
+                $.ajax({
+                    url : this.baseUrl+"equipment/getChildren",
+                    type : "post",
+                    dataType : "JSON",
+                    data : {id:this.current.eqId},
+                    success : (res)=>{
+                        switch (res.code){
+                            case 200:
+                                res.data.forEach(eq=>{
+                                    let tab = eq.location_tab.split("-");
+                                    eq.row = Number(tab[0]);
+                                    eq.column = Number(tab[1]);
+                                });
+                                this.$set(this.current,"children",res.data);
+                                break;
+                            default:
+                                window.toast.error("服务器错误");
+                        }
+                    },
+                    error : (err)=>{
+                        window.tempTip.setIndex(999);
+                        window.tempTip.show("网络错误");
+                    },
+                    timeout:3000,
+                })
+            },
+            saveOrUpdate(){
+              this.error = {};
+              let error = this._checkEquipmentData(this.current);
+              if (JSON.stringify(error)!=="{}"){
+                  this.error = error;return;
+              }
+              let params = this._formatEquipmentData(this.current);
+              $.ajax({
+                  url : this.baseUrl+"equipment/saveOrUpdate",
+                  type : "post",
+                  dataType : "JSON",
+                  headers:{'Content-Type':'application/json;charset=utf8'},
+                  data : JSON.stringify(params),
+                  success : (res)=>{
+                      switch (res.code){
+                          case 200:
+                              this.current.eqId = res.data[0];
+                              this.current.children.forEach((item,index)=>{
+                                  item.id = res.data[1][index];
+                              })
+                              $("#detailInfo").modal("hide");
+                              window.toast.success("保存成功");
+                              break;
+                          case 701:
+                              this.error = res.data;
+                              break;
+                          case 414:
+                              this.error = {"code":"设备编码重复"};
+                              this.toast.error(this.error.code);
+                              break;
+                          default:
+                              window.toast.error("服务器错误:"+res.message);
+                      }
+                  },
+                  error : (err)=>{
+                      window.tempTip.setIndex(999);
+                      window.tempTip.show("网络错误");
+                  },
+                  timeout:3000,
+              })
+            },
+            _checkEquipmentData(equipment){
+                let error = {};
+                if (!equipment.code)error.code = "设备编号未填写";
+                if (!equipment.width)error.width = "设备宽度未填写";
+                if (!equipment.depth)error.depth = "设备深度未填写";
+                if (!equipment.repository)error.repositoryId = "设备库区未选定";
+                if (equipment.layer !== equipment.children.length)error.children = "设备绑定错误";
+                for (let i=0;i<equipment.layer;i++){
+                    if (!equipment.children[i].height)error["children["+i+"].height"] = "设备高度不得为空"
+                    if (!equipment.children[i].column)error["children["+i+"].column"] = "库位列数不得为空"
+                    if (!equipment.children[i].row)error["children["+i+"].row"] = "库位行数不得为空"
+                }
+                return error;
+            },
+            _formatEquipmentData(equipment){
+                let eq = {};
+                eq.id = equipment.eqId;
+                eq.code = equipment.code;
+                eq.repositoryId = equipment.repository;
+                eq.info = JSON.stringify({'x':equipment.x,'y':equipment.y,'id':equipment.id});
+                eq.depth = equipment.depth;
+                eq.width = equipment.width;
+                eq.children = equipment.children;
+                return eq;
+            },
+            removeLocationBind(){
+                if (this.isLoadLocation)return;
+                this.isLoadLocation = true;
+                $.ajax({
+                    url : this.baseUrl+"location/removeLocationBind",
+                    type : "post",
+                    dataType : "JSON",
+                    data : {id:this.current.children[this.currentEqChildIndex].id},
+                    success : (res)=>{
+                        switch (res.code){
+                            case 200:
+                                this.current.children[this.currentEqChildIndex].row = 0;
+                                this.current.children[this.currentEqChildIndex].column = 0;
+                                this.locations = [];
+                                window.toast.success("解除成功!");
+                                break;
+                            default:
+                                window.toast.error("库位无法释放,解除失败");
+                        }
+                    },
+                    error : (err)=>{
+                        window.tempTip.setIndex(999);
+                        window.tempTip.show("网络错误");
+                    },
+                    complete:()=>{
+                        this.isLoadLocation = false;
+                    },
+                    timeout:3000,
+                })
+            },
+            locationBind(){
+                if (this.isLoadLocation)return;
+                let eq = this.current.children[this.currentEqChildIndex];
+                let code = this.current.code+'-'+((this.currentEqChildIndex+1)<10 ? '0'+(this.currentEqChildIndex+1) : (this.currentEqChildIndex+1));
+                this.isLoadLocation = true;
+                $.ajax({
+                    url : this.baseUrl+"location/locationBind",
+                    type : "post",
+                    dataType : "JSON",
+                    data : {id:eq.id,row:this.buildPool.row,column:this.buildPool.column,code:code},
+                    success : (res)=>{
+                        switch (res.code){
+                            case 200:
+                                this.locations = this._chunkArr(res.data,Number(this.buildPool.column));
+                                window.toast.success("构建成功!");
+                                this.current.children[this.currentEqChildIndex].row = Number(this.buildPool.row);
+                                this.current.children[this.currentEqChildIndex].column = Number(this.buildPool.column);
+                                this.buildPool = {};
+                                this.$forceUpdate();
+                                break;
+                            default:
+                                window.toast.error("库位建立失败,服务器错误");
+                        }
+                    },
+                    error : (err)=>{
+                        window.tempTip.setIndex(999);
+                        window.tempTip.show("网络错误");
+                    },
+                    complete:(req,status)=>{
+                        this.isLoadLocation = false;
+                        if (status==='timeout'){
+                            window.toast.error("库位建立失败,响应超时");
+                        }
+                    },
+                    timeout:3000,
+                })
             },
         },
     });

+ 1 - 0
webpack.mix.js

@@ -34,6 +34,7 @@ mix.js('resources/js/elementUi.js','public/js/element-ui.js')
     .sass('resources/sass/elementUi.scss', 'public/css/element-ui.css');
 mix.copy("resources/sass/animation.css",'public/css/animation.css');
 mix.js("resources/js/marked.js", "public/js/marked.js");
+mix.js("resources/js/utilities/toast.js", "public/js/utilities/toast.js");
 
 //德邦快递
 mix.js('resources/js/lodop/jquery.PrintArea.js','public/js/lodop/jquery.PrintArea.js')