<?php

use App\Menu;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class SeedMenusLevel2 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Menu::create([
            'name'=>'查询',
            'level'=>2,
            'parent_id'=>1,
            'route'=>'rejected/index/general',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'录入',
            'level'=>2,
            'parent_id'=>1,
            'route'=>'rejected/create',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>1,
            'route'=>'rejected/relating',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'回收站',
            'level'=>2,
            'parent_id'=>1,
            'route'=>'rejected/recycle',
            'sequence'=>4,
        ]);

        Menu::create([
            'name'=>'盘收一体',
            'level'=>2,
            'parent_id'=>2,
            'route'=>'store/checkingReceive/mission',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'快速入库',
            'level'=>2,
            'parent_id'=>2,
            'route'=>'store/fast/create',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'盲收',
            'level'=>2,
            'parent_id'=>2,
            'route'=>'store/blindReceive/excels',
            'sequence'=>3,
        ]);

        Menu::create([
            'name'=>'订单',
            'level'=>2,
            'parent_id'=>3,
            'route'=>'order/index/delivering',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'波次',
            'level'=>2,
            'parent_id'=>3,
            'route'=>'order/wave/index/',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'问题件',
            'level'=>2,
            'parent_id'=>3,
            'route'=>'order/issue/index?addtime=15',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'跟踪',
            'level'=>2,
            'parent_id'=>3,
            'route'=>'order/tracking/index',
            'sequence'=>4,
        ]);

        //运输
        Menu::create([
            'name'=>'查询',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/index',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'录入',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/create?type=ZX',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'发运',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/delivering',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/relating',
            'sequence' => 4,
        ]);
        Menu::create([
            'name'=>'财务报表',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/waybillFinancialSnapshot',
            'sequence'=>5,
        ]);
        Menu::create([
            'name'=>'异常报表',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/waybillFinancialExcepted',
            'sequence'=>6,
        ]);
        Menu::create([
            'name'=>'回收站',
            'level'=>2,
            'parent_id'=>4,
            'route'=>'waybill/recycle',
            'sequence'=>7,
        ]);
        //称重
        Menu::create([
            'name'=>'记录',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'设备',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/measureMonitor',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'统计',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/statistics',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'手动录入',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/create',
            'sequence'=>4,
        ]);
        Menu::create([
            'name'=>'异常记录',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/weightExcepted/indexCreate',
            'sequence'=>5,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>5,
            'route'=>'package/relating',
            'sequence'=>6,
        ]);
        //库存管理
        Menu::create([
            'name'=>'库存',
            'level'=>2,
            'parent_id'=>6,
            'route'=>'inventory/statement/changeInventory?range=1',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'盘点',
            'level'=>2,
            'parent_id'=>6,
            'route'=>'inventory/stockInventory/mission',
            'sequence'=>2,
        ]);
        //二次加工
        Menu::create([
            'name'=>'查询',
            'level'=>2,
            'parent_id'=>7,
            'route'=>'process/',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'录入',
            'level'=>2,
            'parent_id'=>7,
            'route'=>'process/create',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'统计',
            'level'=>2,
            'parent_id'=>7,
            'route'=>'process/statistic',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'回收站',
            'level'=>2,
            'parent_id'=>7,
            'route'=>'process/recycle',
            'sequence'=>4,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>7,
            'route'=>'process/relating',
            'sequence'=>5,
        ]);
        //客户管理
        Menu::create([
            'name'=>'项目',
            'level'=>2,
            'parent_id'=>8,
            'route'=>'customer/project/area',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'财务',
            'level'=>2,
            'parent_id'=>8,
            'route'=>'customer/finance/instantBill',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>8,
            'route'=>'customer/relating',
            'sequence'=>3,
        ]);
        //人事管理
        Menu::create([
            'name'=>'临时工报表',
            'level'=>2,
            'parent_id'=>9,
            'route'=>'personnel/laborReport',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'打卡相关',
            'level'=>2,
            'parent_id'=>9,
            'route'=>'personnel/checking-in/createReplenishClock',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'相关设置',
            'level'=>2,
            'parent_id'=>9,
            'route'=>'personnel/relating',
            'sequence'=>3,
        ]);


        //基础设置
        Menu::create([
            'name'=>'用户',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/user',
            'sequence'=>1,
        ]);
        Menu::create([
            'name'=>'角色',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/role',
            'sequence'=>2,
        ]);
        Menu::create([
            'name'=>'权限',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/authority',
            'sequence'=>3,
        ]);
        Menu::create([
            'name'=>'工作组',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/userWorkgroup',
            'sequence'=>4,
        ]);
        Menu::create([
            'name'=>'项目组',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/userOwnerGroup',
            'sequence'=>5,
        ]);
        Menu::create([
            'name'=>'仓库',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/warehouse',
            'sequence'=>6,
        ]);
        Menu::create([
            'name'=>'客户',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/customer',
            'sequence'=>7,
        ]);
        Menu::create([
            'name'=>'货主',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/owner',
            'sequence'=>8,
        ]);
        Menu::create([
            'name'=>'品质标签',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/qualityLabel',
            'sequence'=>9,
        ]);
        Menu::create([
            'name'=>'作业类型',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/processMethod',
            'sequence'=>10,
        ]);
        Menu::create([
            'name'=>'商品信息',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/commodity',
            'sequence'=>11,
        ]);
        Menu::create([
            'name'=>'计量单位',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/unit',
            'sequence'=>12,
        ]);
        Menu::create([
            'name'=>'省份',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/province',
            'sequence'=>13,
        ]);
        Menu::create([
            'name'=>'城市',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/city',
            'sequence'=>14,
        ]);
        Menu::create([
            'name'=>'物流公司',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/logistic',
            'sequence'=>15,
        ]);
        Menu::create([
            'name'=>'承运商',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/carrier',
            'sequence'=>16,
        ]);
        Menu::create([
            'name'=>'车型',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/carType',
            'sequence'=>17,
        ]);
        Menu::create([
            'name'=>'作业类型',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/jobType',
            'sequence'=>18,
        ]);
        Menu::create([
            'name'=>'特征',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/feature',
            'sequence'=>19,
        ]);
        Menu::create([
            'name'=>'计费模型',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/priceModel/waybillPriceModel',
            'sequence'=>20,
        ]);
        Menu::create([
            'name'=>'纸箱',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/paperBox/index/model',
            'sequence'=>21,
        ]);
        Menu::create([
            'name'=>'测量设备',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/measuringMachine',
            'sequence'=>22,
        ]);
        Menu::create([
            'name'=>'教程',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/tutorial',
            'sequence'=>23,
        ]);
        Menu::create([
            'name'=>'临时工',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/userLabor',
            'sequence'=>24,
        ]);
        Menu::create([
            'name'=>'劳务所',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/laborCompany',
            'sequence'=>25,
        ]);
        Menu::create([
            'name'=>'日志',
            'level'=>2,
            'parent_id'=>10,
            'route'=>'maintenance/log',
            'sequence'=>26,
        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Menu::query()->where('level',2)->delete();
    }
}
