<?php

use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return redirect('login');
});

Route::any('test/{method}', 'TestController@method'); //测试

/** 称重广播 */
Route::post('package/weigh/measureMonitor/speech','MeasureMonitorController@speech')->middleware("check.token");

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/homeTemp', 'HomeController@home');

/** 密码 */
Route::group(['prefix'=>'password'],function(){
    Route::get('change', 'Auth\PasswordController@change');
    Route::post('update', 'Auth\PasswordController@update');
});

/** 全局 */
Route::get('denied',function (){return view('exception.authority');});
/** 基础设置 */
Route::group(['prefix'=>'maintenance'],function(){

    /** 商品 */
    Route::group(['prefix'=>'commodity'],function(){
        /** 导出 */
        Route::group(['prefix'=>'import'],function(){
            Route::post('excel', 'CommodityController@importExcel');
        });
        Route::get('import', 'CommodityController@import');
        Route::post('syncWMS','CommodityController@syncWMS');
        Route::post('isExist','CommodityController@isExist');
    });
    /** 货主 */
    Route::group(['prefix'=>'owners'],function(){
        Route::get('recycle','OwnerController@recycle');
        Route::post('restoreSelected', 'OwnerController@restoreSelected');
    });
    Route::group(['prefix'=>'owner'],function (){
        Route::post("get","OwnerController@get");
        Route::post("apiStore","OwnerController@apiStore");
    });
    /** 教程 */
    Route::group(['prefix'=>'tutorial'],function(){
        Route::post('showContent/{id}', 'TutorialController@showContent');
    });
    /** 临时工 */
    Route::group(['prefix'=>'userLabor'],function(){
        Route::post('getWorkRecord', 'UserLaborController@getWorkRecord');
        Route::post('getClockRecord', 'UserLaborController@getClockRecord');
        Route::post('relieve', 'UserLaborController@relieve');
    });
    /** 纸箱 */
    Route::group(['prefix'=>'paperBox'],function(){
        /** 首页 */
        Route::group(['prefix'=>'index'],function(){
            Route::get('model', 'PaperBoxController@indexModel');
            Route::get('owner', 'PaperBoxController@indexOwner');
        });
        /** excel */
        Route::group(['prefix'=>'excel'],function(){
            Route::post('import','PaperBoxController@import');
            Route::get('goImport',function (){return view('maintenance.paperBox.import');});
        });
    });
    /** 计费模型 */
    Route::group(['prefix'=>'priceModel'],function() {
        Route::group(['prefix'=>'waybillPriceModel'],function(){
            /** excel */
            Route::group(['prefix'=>'excel'],function(){
                Route::get('goImport',function (){return view('maintenance.priceModel.waybillPriceModel.import');});
            });
            Route::get('cities/{province_id}','WaybillPriceModelController@getCities');
        });
        Route::resource('waybillPriceModel','WaybillPriceModelController');

        Route::group(['prefix'=>'storage'],function(){
            Route::get('create','PriceModelController@storageCreate');
            Route::post('store','PriceModelController@storageStore');
            Route::get('{id}/edit','PriceModelController@storageEdit');
            Route::delete("{id}","PriceModelController@storageDestroy");
            Route::post('update','PriceModelController@storageUpdate');
        });
        Route::get('storage','PriceModelController@storageIndex');

        Route::group(['prefix'=>'operation'],function(){
            Route::get('create','PriceModelController@operationCreate');
            Route::post('getItems','PriceModelController@getItems');
            Route::post('updateItem','PriceModelController@updateItem');
            Route::post('createItem','PriceModelController@createItem');
            Route::post('getFeatures','PriceModelController@getFeatures');
            Route::post('addFeature','PriceModelController@addFeature');
            Route::post('getFeature','PriceModelController@getFeature');
            Route::delete('{id}','PriceModelController@operationDestroy');
            Route::get('{id}/edit','PriceModelController@operationEdit');
            Route::post('{id}/edit','PriceModelController@operationUpdate');
        });
        Route::get('operation','PriceModelController@operationIndex');
        Route::post('operation','PriceModelController@operationStore');

        Route::group(['prefix'=>'express'],function(){
            Route::get('create','PriceModelController@expressCreate');
            Route::post('getDetail','PriceModelController@expressGetDetail');
            Route::post('import','PriceModelController@expressImport');
            Route::post('updateDetail','PriceModelController@expressUpdateDetail');
            Route::post('destroyDetail','PriceModelController@expressDestroyDetail');
            Route::delete('{id}','PriceModelController@expressDestroy');
            Route::get('{id}/edit','PriceModelController@expressEdit');
            Route::post('{id}/edit','PriceModelController@expressUpdate');
            Route::get('export/{id}','PriceModelController@expressExport');
        });
        Route::get('express','PriceModelController@expressIndex');
        Route::post('express','PriceModelController@expressStore');

        Route::group(['prefix'=>'logistic'],function(){
            Route::get('create','PriceModelController@logisticCreate');
            Route::delete('{id}','PriceModelController@logisticDestroy');
            Route::get('{id}/edit','PriceModelController@logisticEdit');
            Route::post('{id}/edit','PriceModelController@logisticUpdate');
            Route::post('getDetail','PriceModelController@logisticGetDetail');
            Route::post('import','PriceModelController@logisticImport');
            Route::post('updateDetail','PriceModelController@logisticUpdateDetail');
            Route::post('destroyDetail','PriceModelController@logisticDestroyDetail');
            Route::get('export/{id}','PriceModelController@logisticExport');
        });
        Route::get('logistic','PriceModelController@logisticIndex');
        Route::post('logistic','PriceModelController@logisticStore');

        Route::group(['prefix'=>'directLogistic'],function(){
            Route::get('create','PriceModelController@directLogisticCreate');
            Route::delete('{id}','PriceModelController@directLogisticDestroy');
            Route::get('{id}/edit','PriceModelController@directLogisticEdit');
            Route::post('{id}/edit','PriceModelController@directLogisticUpdate');
            Route::post('getDetail','PriceModelController@directLogisticGetDetail');
            Route::post('import','PriceModelController@directLogisticImport');
            Route::post('updateDetail','PriceModelController@directLogisticUpdateDetail');
            Route::post('destroyDetail','PriceModelController@directLogisticDestroyDetail');
        });
        Route::get('directLogistic','PriceModelController@directLogisticIndex');
        Route::post('directLogistic','PriceModelController@directLogisticStore');

        //api 录入计费模型
        Route::post('apiStoreStorage','PriceModelController@apiStoreStorage');
        Route::post('apiStoreOperation','PriceModelController@apiStoreOperation');
        Route::post('apiStoreExpress','PriceModelController@apiStoreExpress');
        Route::post('apiStoreLogistic','PriceModelController@apiStoreLogistic');
        Route::post('apiStoreDirectLogistic','PriceModelController@apiStoreDirectLogistic');
        Route::post('apiStoreSystem','PriceModelController@apiStoreSystem');
        //api 获取计费模型
        Route::post('apiGetStorage','PriceModelController@apiGetStorage');
        Route::post('apiGetOperation','PriceModelController@apiGetOperation');
        Route::post('apiGetExpress','PriceModelController@apiGetExpress');
        Route::post('apiGetLogistic','PriceModelController@apiGetLogistic');
        Route::post('apiGetDirectLogistic','PriceModelController@apiGetDirectLogistic');
        //api 删除计费模型
        Route::post('apiDelStorage','PriceModelController@apiDelStorage');
        Route::post('apiDelOperation','PriceModelController@apiDelOperation');
        Route::post('apiDelOperationItem','PriceModelController@apiDelOperationItem');
        Route::post('apiDelExpress','PriceModelController@apiDelExpress');
        Route::post('apiDelExpressItem','PriceModelController@apiDelExpressItem');
        Route::post('apiDelLogistic','PriceModelController@apiDelLogistic');
        Route::post('apiDelLogisticItem','PriceModelController@apiDelLogisticItem');
        Route::post('apiDelDirectLogistic','PriceModelController@apiDelDirectLogistic');
        Route::post('apiDelDirectLogisticItem','PriceModelController@apiDelDirectLogisticItem');
        Route::post('apiDelSystem','PriceModelController@apiDelSystem');
        //审核或恢复计费模型
        Route::post('auditOrRecoverModel','PriceModelController@auditOrRecoverModel');
        //审核对比
        Route::post('getPriceModelAudit','PriceModelController@getPriceModelAudit');
    });
    Route::group(['prefix'=>'unit'],function(){
        Route::post('getUnits','UnitController@getUnits');
        Route::post('save','UnitController@save');
        Route::post('sort','UnitController@sort');
    });
    Route::group(['prefix'=>'province'],function(){
        Route::post('get','ProvincesController@get');
    });
    Route::group(['prefix'=>'city'],function(){
        Route::post('get','CitiesController@get');
    });
    Route::group(['prefix'=>'carType'],function (){
        Route::post('get','CarTypesController@get');
        Route::post('batchInsert','CarTypesController@batchInsert');
    });
    Route::group(['prefix'=>'taxRate'],function (){
        Route::post('get','TaxRateController@get');
        Route::post('save','TaxRateController@save');
        Route::post('destroy','TaxRateController@destroy');
    });
    Route::group(['prefix'=>"log"],function (){
        Route::get("exception",'LogController@exception');
    });
    Route::group(['prefix'=>"logistic"],function (){
        Route::post("get",'LogisticController@get');
    });
    Route::group(['prefix'=>"region"],function (){
        Route::post("get",'RegionController@get');
        Route::post("store",'RegionController@store');
        Route::post("getProvinces",'RegionController@getProvinces');
    });
    /** 耗材 */
    Route::get('material','MaterialController@index');;
    /** 项目耗材 */
    Route::group(['prefix'=>"ownerMaterial"],function (){
        Route::get("/",'OwnerMaterialController@index');
        Route::get('downFile','OwnerMaterialController@downFile');
    });
    /** 供应商 */
    Route::get('supplier','SupplierController@index');
    /** 系统配置 */
    Route::get('configuration','ConfigurationController@index');
    /** 服务商 */
    Route::resource('facilitator','FacilitatorController');

    Route::get('syncRedisLogs','LogController@syncRedisLogs');
    Route::get('region', 'RegionController@index');
    Route::get('taxRate', 'TaxRateController@index');
    Route::resource('log', 'LogController');
    Route::resource('user', 'UserController');
    Route::resource('role', 'RoleController');
    Route::resource('authority', 'AuthorityController');
    Route::resource('owner', 'OwnerController');
    Route::resource('logistic', 'LogisticController');
    Route::resource('qualityLabel', 'QualityLabelController');
    Route::resource('carrier', 'CarriersController');
    Route::resource('carType','CarTypesController');
    Route::resource('unit','UnitController');
    Route::resource('province','ProvincesController');
    Route::resource('city','CitiesController');
    Route::resource('commodity', 'CommodityController');
    Route::resource('measuringMachine', 'MeasuringMachineController');
    Route::resource('userWorkgroup', 'UserWorkgroupController');
    Route::resource('laborCompany', 'LaborCompanyController');
    Route::resource('warehouse', 'WarehouseController');
    Route::resource('tutorial', 'TutorialController');
    Route::resource('userLabor','UserLaborController');
    Route::resource('paperBox', 'PaperBoxController');
    Route::resource('userOwnerGroup', 'UserOwnerGroupController');
    Route::resource('processMethod', 'ProcessMethodController');
    Route::resource('feature', 'FeatureController');
    Route::resource('mail', 'SendEmailsController');
    Route::post('mail/addRole', 'SendEmailsController@addRole')->name('mail.addRole');
    Route::post('mail/deleteRole', 'SendEmailsController@deleteRole')->name('mail.deleteRole');
    Route::post('mail/updateTemplate', 'SendEmailsController@updateTemplate')->name('mail.updateTemplate');
    Route::post('mail/updateRemark', 'SendEmailsController@updateRemark')->name('mail.updateRemark');
    Route::post('mail/active', 'SendEmailsController@active')->name('mail.active');



});
Route::get('maintenance', function () {return view('maintenance.index');});

Route::group(['prefix'=>'transport'],function(){
    /** 运单 */
    Route::group(['prefix'=>'waybill'],function(){
        /** 置顶 */
        Route::group(['prefix'=>'ontop'],function(){
            Route::post('top','WaybillController@waybillOnTop');
            Route::post('cancel','WaybillController@cancelOnTop');
        });
        /** 判断 */
        Route::group(['prefix'=>'is'],function(){
            Route::post('waybillPriceModel','WaybillController@isWaybillPriceModel');
        });
        Route::post('deleteImg','WaybillController@deleteImg');
        Route::post('seekOrder','WaybillController@seekOrder');
        Route::post('upload','WaybillController@upload');
        Route::get('relating',function (){return view('transport.waybill.menuWaybill');});
        Route::get('recycle', 'WaybillController@recycle');
        Route::post('refreshWaveHouseWeight','WaybillController@refreshWaveHouseWeight');
        Route::get('index','WaybillController@index');
        Route::get('delivering','WaybillController@delivering');
        Route::any('deliveringExport','WaybillController@deliveringExport');
        Route::post('storeCarrierBill','WaybillController@storeCarrierBill');
        Route::post('addCounty','WaybillController@addCounty');
        Route::any('waybillAudit','WaybillController@waybillAudit');
        Route::any('waybillEdit/{id}','WaybillController@waybillEdit');
        Route::any('waybillRetreatAudit','WaybillController@waybillRetreatAudit');
        Route::any('waybillEndAudit','WaybillController@waybillEndAudit');
        Route::any('export','WaybillController@export');
        Route::any('waybillUpdate/{id}','WaybillController@waybillUpdate');
        Route::post('batchUploadImages','WaybillController@batchUploadImages');
        Route::post('dailyBilling','WaybillController@dailyBilling');
        Route::post('countPickUpFee','WaybillController@countPickUpFee');
        Route::resource('waybillFinancialSnapshot','WaybillFinancialSnapshotsController');
        Route::resource('waybillFinancialExcepted','WaybillFinancialExceptedController');
    });
    Route::resource('waybill','WaybillController');

});

/** 运输财务 */
Route::group(['prefix'=>'waybillFinancialSnapshot'],function(){
    Route::any('export','WaybillFinancialSnapshotsController@export');
});

/** 运输计费模型 */
Route::group(['prefix'=>'waybillPriceModel'],function(){
    /** excel */
    Route::group(['prefix'=>'excel'],function(){
        Route::post('import','WaybillPriceModelController@import');
    });
});

/** 退货明细 */
Route::group(['prefix'=>'rejectedBill'],function(){
    Route::post('{rejectedBill}/edit', 'RejectedBillController@edit');
});
Route::resource('rejectedBill', 'RejectedBillController');

/** 退货 */
Route::group(['prefix'=>'rejected'],function(){
    /** 导出 */
    Route::group(['prefix'=>'import'],function(){
        Route::post('excel', 'RejectedController@importExcel');
    });
    /** 主页 */
    Route::group(['prefix'=>'index'],function(){
        Route::any('general','RejectedController@index');
        Route::any('analyze','RejectedController@indexAnalyze');
        Route::get('import', 'RejectedController@import');
    });
    /** 分析 */
    Route::group(['prefix'=>'analyze'],function(){
        Route::post('exportExcelOnParams', 'RejectedController@exportExcelOnParams');
        Route::post('exportAllExcelOnParams', 'RejectedController@exportAllExcelOnParams');
    });

    Route::get('relating', function () {return view('rejected.relating');});
    Route::get('recycle', 'RejectedController@recycle');
    Route::post('ajaxCheck', 'RejectedController@ajaxCheck');
    Route::post('ajaxCheckAll', 'RejectedController@ajaxCheckAll');
    Route::post('ajaxFinishAll', 'RejectedController@ajaxFinishAll');
    Route::any('export', 'RejectedController@export');
    Route::any('exportAnalyze', 'RejectedController@exportAnalyze');
    Route::post('ajaxGetRejected', 'RejectedController@ajaxGetRejected');
    Route::post('changeRejectedBillRemark', 'RejectedController@changeRejectedBillRemark');
    Route::get('importRejectedNumber','RejectedBillController@importRejectedNumber');
});
Route::resource('rejected', 'RejectedController');


/** 包裹 */
Route::group(['prefix'=>'package'],function(){
    /** 统计 */
    Route::group(['prefix'=>'statistics'],function(){
        Route::any('export','WeighController@statisticsExport');
    });
    /** 异常 */
    Route::group(['prefix'=>'weightExcepted'],function(){
        Route::get('indexCreate','WeighExceptedController@indexCreate');
        Route::get('indexIssued','WeighExceptedController@indexIssued');
        Route::any('export/{type}','WeighExceptedController@export');
    });

    Route::any('export','WeighController@export');
    Route::get('statistics','WeighController@statistics');
    Route::get('relating', function () {return view('package.measureMonitor.menu');});

    Route::resource('measureMonitor','MeasureMonitorController');

    Route::group(['prefix'=>'measureMonitor'],function(){
        Route::post('data','MeasureMonitorController@data');
    });
    Route::group(['prefix' => 'weigh'], function () {
        Route::get('statistics','WeighController@statistics');
        /** 设备 */
        Route::group(['prefix'=>'measureMonitor'],function(){
            Route::post('data','MeasureMonitorController@data');
        });
        /** 统计 */
        Route::group(['prefix'=>'statistics'],function(){
            Route::any('export','WeighController@statisticsExport');
        });
        Route::resource('measureMonitor','MeasureMonitorController');
    });
    Route::get('weigh/index','WeighController@index');
    Route::resource('weigh','WeighController');
    Route::put('logistic/batchUpdate','PackageLogisticController@batchUpdate');
    Route::resource('logistic','PackageLogisticController');
});
Route::resource('package','WeighController');

/** 入库 */
Route::group(['prefix'=>'store'],function(){
    Route::group(['prefix'=>'inStorage'],function() {
        Route::get('index','StoreController@storage');
        Route::get('cacheRackStorage','StoreController@cacheRackStorage');
    });
    Route::group(['prefix'=>'fast'],function() {
        Route::resource('storeItem','StoreItemController');
    });
    Route::resource('fast',"StoreController");

    /** 盲收 */
    Route::group(['prefix'=>'blindReceive'],function(){
        Route::get('/', function () { return view('store.blindReceive.index');});
        Route::get('excels', 'StoreBlindReceiveController@index');
        Route::post('excels/apiStore', 'StoreBlindReceiveController@apiStore');
    });

    /** 盘收 */
    Route::group(['prefix'=>'checkingReceive'],function(){
        Route::group(['prefix'=>'mission'],function(){
            Route::post('import','StoreCheckingReceiveController@import');
            Route::get('export','StoreCheckingReceiveController@export');
            Route::post('resetAmount','StoreCheckingReceiveController@resetAmount');
            Route::post('matchASN','StoreCheckingReceiveController@matchASN');
            Route::post('receipt','StoreCheckingReceiveController@receipt');
            Route::get('{id}','StoreCheckingReceiveController@show');
        });
        Route::post('updateCountedAmount','StoreCheckingReceiveController@updateCountedAmount');
        Route::post('insertItem','StoreCheckingReceiveController@insertItem');
        Route::get('mission','StoreCheckingReceiveController@mission');
        Route::post('destroyItem','StoreCheckingReceiveController@destroyItem');
    });

    /** 入库预约 */
    Route::group(['prefix'=>'deliveryAppointment'],function(){
        Route::get('appointment','DeliveryAppointmentController@appointment');
        Route::post('getCapacity','DeliveryAppointmentController@getCapacity');
        Route::post('submitAppointment','DeliveryAppointmentController@submitAppointment');
        Route::get('showAppointmentInfo','DeliveryAppointmentController@showAppointmentInfo');
        Route::get('list','DeliveryAppointmentController@list');
        Route::get('delivery','DeliveryAppointmentController@delivery');
        Route::get('errMsg','DeliveryAppointmentController@errMsg');
        Route::get('successMsg','DeliveryAppointmentController@successMsg');
        Route::post('delivery','DeliveryAppointmentController@checkAppointment');
        Route::post('cancel','DeliveryAppointmentController@cancel');
        Route::post('unloading','DeliveryAppointmentController@unloading');
        Route::any('export','DeliveryAppointmentController@export');
        Route::post('getExhibitionList','DeliveryAppointmentController@getExhibitionList');
        Route::post('getKey','DeliveryAppointmentController@getKey');
        Route::get('exhibition','DeliveryAppointmentController@exhibition');
        Route::get('qrcode',function (){
            if(!Gate::allows('入库管理-入库预约-二维码')){ return view("exception.authority");  }
            return view("store.deliveryAppointment.qrcode");
        });
        Route::group(['prefix'=>'appointment'],function(){
            Route::post('import','DeliveryAppointmentController@import');
        });
        Route::get('capacityMaintenance','DeliveryAppointmentController@capacityMaintenance');
        Route::post('updateCapacity','DeliveryAppointmentController@updateCapacity');
        Route::post('verifyASN','DeliveryAppointmentController@verifyASN');
        Route::post('updateAppointment','DeliveryAppointmentController@updateAppointment');
        Route::post('qualityInspectionMark','DeliveryAppointmentController@qualityInspectionMark');
    });
});

/** 二次加工 */
Route::group(['prefix'=>'process'],function(){
    /** 统计 */
    Route::group(['prefix'=>'statistic'],function(){
        Route::any("export",'ProcessStatisticController@export');
    });

    Route::get('relating',function (){return view('process.menuProcess');});
    Route::get("statistic",'ProcessStatisticController@index');
    Route::post('getDailyParticipant','ProcessController@getDailyParticipant');
    Route::post('reject/{id}','ProcessController@reject');
    Route::post('receive/{id}','ProcessController@receive');
    Route::post('accomplish','ProcessController@accomplish');
    Route::post('updateDailyOutput','ProcessController@updateDailyOutput');
    Route::post('storeProcessDailyParticipant','ProcessController@storeProcessDailyParticipant');
    Route::post('verifyUserName','ProcessController@verifyUserName');
    Route::post('updateProcessDailyParticipant','ProcessController@updateProcessDailyParticipant');
    Route::post('processDailyParticipantAudit/{id}','ProcessController@processDailyParticipantAudit');
    Route::post('getTutorials/{id}','ProcessController@getTutorials');
    Route::post('selectedTutorial','ProcessController@selectedTutorial');
    Route::post('deleteTutorial','ProcessController@deleteTutorial');
    Route::post('ownerGetTutorials/{owner_id}','ProcessController@ownerGetTutorials');
    Route::post('rollback','ProcessController@rollback');
    Route::get('recycle','ProcessController@recycle');
    Route::post('recover','ProcessController@recover');
    Route::post('audit','ProcessController@audit');
    Route::post('processAccomplish','ProcessController@processAccomplish');
    Route::post('checkAndAccept','ProcessController@checkAndAccept');
    Route::post('updateUnitPrice','ProcessController@updateUnitPrice');
    Route::post('workGroupVerify','ProcessController@workGroupVerify');
    Route::post('accountantVerify','ProcessController@accountantVerify');
    Route::post('updateStartDate','ProcessController@updateStartDate');
    Route::post('updateEndDate','ProcessController@updateEndDate');
    Route::delete('destroyDailyParticipant/{id}','ProcessController@destroyDailyParticipant');
    Route::post('importPasteData','ProcessController@importPasteData');
    Route::any('export','ProcessController@export');
    Route::post('deleteProcessContent/{id}','ProcessController@deleteProcessContent');
});
Route::resource('process','ProcessController');


/** 人事 */
Route::group(['prefix'=>'personnel'],function(){
    /** 绩效 */
    Route::group(['prefix'=>'report'],function(){
        Route::match(['GET','POST'],'export','CustomerController@projectReportExport');
    });
    Route::get('report','CustomerController@projectReport');
    /** 打卡 */
    Route::group(['prefix'=>'checking-in'],function(){
        /** 打卡记录 */
        Route::group(['prefix'=>'userDutyCheck'],function(){
            Route::get('importAndExportClock','UserDutyCheckController@importAndExportClock');
            Route::get('clock','UserDutyCheckController@clock');
            Route::any('storeClock','UserDutyCheckController@storeClock');
            Route::post('绑定临时工并进组','UserDutyCheckController@绑定临时工并进组');
            Route::post('importGroupClock','UserDutyCheckController@importGroupClock');
            Route::get('createUserDetail/{mobile_phone}','UserDutyCheckController@createUserDetail');
            Route::get('updateUserLaborCompanies/{mobile_phone}','UserDutyCheckController@updateUserLaborCompanies');
            Route::any('storeUserDetail','UserDutyCheckController@storeUserDetail');
            Route::any('storeUpdateUserLaborCompanies','UserDutyCheckController@storeUpdateUserLaborCompanies');
        });

        Route::get('goGetQRCode','QRCodeController@goGetQRCode');
        Route::get('QRCode','QRCodeController@QRCode');
        Route::get('importAndExportQRCode','QRCodeController@importAndExportQRCode');
        Route::post('refreshQRCode','QRCodeController@refreshQRCode');
        Route::get('createReplenishClock','PersonnelController@createReplenishClock');
        Route::post('checkUserLabors','PersonnelController@checkUserLabors');
        Route::post('storeReplenishClock','PersonnelController@storeReplenishClock');
        Route::get('clockAudit','PersonnelController@clockAudit');
        Route::get('missionAudit','PersonnelController@missionAudit');
        Route::post('storeClockAudit','PersonnelController@storeClockAudit');
        Route::post('updateDutyCheckType','PersonnelController@updateDutyCheckType');
        Route::post('storeGroupAudit','PersonnelController@storeGroupAudit');
        Route::post('isException','PersonnelController@isException');
        Route::post('storeMissionAudit','PersonnelController@storeMissionAudit');
    });

    Route::get('relating',function (){return view('personnel/menuPersonnel');});

    Route::resource('laborReport','LaborReportController');
    Route::group(['prefix'=>'discharge'],function(){
        /** 卸货任务 */
        Route::group(['prefix'=>'task'],function(){
            Route::get('index','DischargeTaskController@index');
            Route::any('export','DischargeTaskController@export');
            Route::any('receipt','DischargeTaskController@receipt');
        });
        /** 结算报表 */
        Route::group(['prefix'=>'statement'],function(){
            Route::get('index','DischargeTaskController@statementIndex');
            Route::any('export','DischargeTaskController@exportStatements');
        });
        /** 服务商  对账单*/
        Route::group(['prefix'=>'facilitator'],function(){
            Route::get('index','FacilitatorController@statementIndex');
            Route::any('export','FacilitatorController@exportStatement');
            Route::get('qrCode','FacilitatorController@getQrCode');
            Route::group(['prefix'=> 'external'],function(){
                Route::get('{id}/index','FacilitatorExternalController@index');
                Route::any('{id}/export','FacilitatorExternalController@export');
            });
        });
    });
});

Route::get('getLaborReport','LaborReportController@getDailyLabor');

/** 临时工报表 */
Route::group(['prefix'=>'laborReport'],function(){
    Route::post('recover','LaborReportController@recover');
    Route::get('recycle','LaborReportController@recycle');
    Route::post('guardClockAudit','LaborReportController@guardClockAudit');
    Route::post('groupClockAudit','LaborReportController@groupClockAudit');
    Route::post('addRemarkAndGroupClock','LaborReportController@addRemarkAndGroupClock');
    Route::post('groupExport','LaborReportController@groupExport');
    Route::post('groupExportEnsure','LaborReportController@groupExportEnsure');
    Route::any('export','LaborReportController@export');
    Route::post('updateLaborCompany','LaborReportController@updateLaborCompany');
    Route::any('删除/{id}','LaborReportController@删除');
    Route::post('changeLaborReportRemark', 'LaborReportController@changeLaborReportRemark');
});

/** 库存 */
Route::group(['prefix'=>'inventory'],function(){
    /** 说明 */
    Route::group(['prefix'=>'statement'],function(){
        /** 动库报表 */
        Route::group(['prefix'=>'changeInventory'],function(){
            Route::any('export','InventoryController@exportData');
            Route::get('downLoadExcel','InventoryController@downLoadExcel');
            Route::post('deleteExcel','InventoryController@deleteExcel');
        });
        Route::get('changeInventory','InventoryController@changeInventory');
        /** 全部库存 */
        Route::group(['prefix'=>'allInventory'],function(){
            Route::any('export','InventoryController@exportAllInventory');
        });
        Route::get('allInventory','InventoryController@allInventory');
        /** 每日记录 */
        Route::group(['prefix'=>'dailyLog'],function(){
            Route::any('export','InventoryController@exportDailyLog');
            Route::post('getLoggingOwner','InventoryController@getLoggingOwner');
            Route::post('addLoggingOwner','InventoryController@addLoggingOwner');
        });
        Route::get('dailyLog','InventoryController@dailyLog');

        Route::get('inventoryCompare','InventoryCompareController@inventoryCompare');
        Route::any('inventoryCompare/export','InventoryCompareController@exportInventoryCompare');
    });
    /** 库存盘点 */
    Route::group(['prefix'=>'stockInventory'],function(){
        Route::get('mission','InventoryAccountController@mission');
        Route::any('enterStockInventory/{id}','InventoryAccountController@enterStockInventory');
        Route::any('inventoryAccountMission/export','InventoryAccountController@exportInventoryAccountMission');
        Route::get('mission','InventoryAccountController@mission');
        Route::post('createStockInventoryMission','InventoryAccountController@createStockInventoryMission');
        Route::post('searchCommodityByBarcode','InventoryAccountController@searchCommodityByBarcode');
        Route::get('blindReceive/{id}','InventoryAccountController@enterBlindReceive');
        Route::post('baseOnBlindReceive','InventoryAccountController@baseOnBlindReceive');
        Route::post('batchStockByLocation','InventoryAccountController@batchStockByLocation');
    });
    /** 库存比对 */
    Route::group(['prefix'=>'inventoryCompare'],function(){
        /** excel */
        Route::group(['prefix'=>'import'],function(){
            Route::post('excel','InventoryCompareController@importExcel');
        });
    });

    Route::get('syncOwners','InventoryAccountController@syncOwners');
    Route::post('inventoryChecked','InventoryAccountController@inventoryChecked');
    Route::any('删除盘点记录','InventoryAccountController@删除盘点记录');
    Route::post('跳过盘点记录','InventoryAccountController@跳过盘点记录');
    Route::post('确认盘点差异','InventoryAccountController@确认盘点差异');
    Route::post('批量跳过或确认差异','InventoryAccountController@批量跳过或确认差异');
    Route::get('完结盘点任务/{id}','InventoryAccountController@完结盘点任务');
    Route::post('修改质量状态','InventoryAccountController@修改质量状态');
    Route::post('增加系统之外的盘点记录','InventoryAccountController@增加系统之外的盘点记录');
    Route::post('盘点选中任务','InventoryAccountController@盘点选中任务');
    Route::post('stockInventoryEnd','InventoryAccountController@stockInventoryEnd');
    Route::any('deleteStockInventoryMission/{id}','InventoryAccountController@deleteStockInventoryMission');
    Route::any('stockInventoryExport','InventoryAccountController@stockInventoryExport');
    Route::any('stockInventory','InventoryAccountController@stockInventory');
    Route::post('searchStockInventoryRecord','InventoryAccountController@searchStockInventoryRecord');
});


/** 订单 */
Route::group(['prefix'=>'order'],function(){
    /** 主页 */
    Route::group(['prefix'=>'index'],function(){
        Route::get('delivering','OrderController@delivering');
        Route::get('commodityAssign','OrderCommodityAssignController@index');
        Route::match(['get','post'],'export','OrderController@export');

        Route::group(['prefix'=>'commodityAssign'],function(){
            Route::post('import','OrderCommodityAssignController@import');
        });

        Route::group(['prefix'=>'freeze'],function(){
            Route::post('delFreeze','OrderFreezeController@delFreeze');
        });
        Route::resource('freeze','OrderFreezeController');
    });
    /** 创建 */
    Route::group(['prefix'=>'create'],function(){
        Route::post('batchComments','OrderController@batchComments');
    });
    /** 波次 */
    Route::group(['prefix'=>'wave'],function(){
        Route::get('index','WaveController@index');
        Route::post('cancelPrinting','WaveController@cancelPrinting');
        Route::any('exportExcel','WaveController@exportExcelOnParams');
        Route::post('repairBatch','WaveController@repairBatch');
    });
    /** 问题件 */
    Route::group(['prefix'=>'issue'],function(){
        /** 工作量 */
        Route::group(['prefix'=>'workLoad'],function(){
            Route::get('index','OrderIssuePerformanceController@workLoadPage');
            Route::any('export','OrderIssuePerformanceController@exportWorkLoad');
        });
        /** 绩效 */
        Route::group(['prefix'=>'orderIssuePerformance'],function(){
            Route::get('index','OrderIssuePerformanceController@index');
            Route::any('export','OrderIssuePerformanceController@export');
        });

        Route::get('index','OrderIssueController@index');
        Route::get('create','OrderIssueController@create');
        Route::post('store','OrderIssueController@store');
        Route::post('batchImport','OrderIssueController@batchImport');
        Route::get('excelImport','OrderIssueController@excelImport');
        Route::get('edit/{id}','OrderIssueController@edit');
        Route::get('recycle','OrderIssueController@recycleBin');
//        Route::match(['get','post'],'export','OrderIssueController@exportOrderIssue');
        Route::match(['get','post'],'export','OrderIssueController@exportJsonExcel');
    });
    /** 跟踪 */
    Route::group(['prefix'=>'tracking'],function(){
        Route::get('index',"OrderTrackingController@index");
        Route::any('export',"OrderTrackingController@export");
        Route::get('update','OrderTrackingController@updateApi');
        Route::post('upload','OrderTrackingController@upload');
        Route::post('destroyImg','OrderTrackingController@destroyImg');
    });

    Route::post('freeze','OrderController@freeze');
    Route::post('freezeAll','OrderController@freezeAll');
    Route::post('thaw','OrderController@thaw');
    Route::post('deAllocation','OrderController@deAllocation');
    Route::post('deAllocationAll','OrderController@deAllocationAll');
    Route::post('resetLogisticsGetMark','OrderController@resetLogisticsGetMark');
    Route::post('resetInterfaceReturnMark','OrderController@resetInterfaceReturnMark');
    Route::post('createRejectedBill','OrderController@createRejectedBill');
    Route::post('isRejectedBillExist','OrderController@isRejectedBillExist');
});

/** 结算 */
Route::group(['prefix'=>'finance'],function(){
    Route::group(['prefix'=>'instantBill'],function(){
        Route::match(['GET','POST'],'export','CustomerController@financeInstantBillExport');
    });
    Route::get('instantBill','CustomerController@financeInstantBill');
    Route::group(['prefix'=>'billConfirmation'],function(){
        Route::match(['GET','POST'],'export','CustomerController@financeBillConfirmationExport');
    });
    Route::get('billConfirmation','CustomerController@financeBillConfirmation');
    Route::post('updateBillReport','CustomerController@updateBillReport');
    Route::post('billConfirm','CustomerController@billConfirm');
});

/** 客户 */
Route::group(['prefix'=>'customer'],function(){
    /** 项目 */
    Route::group(['prefix'=>'project'],function(){
        Route::group(['prefix'=>'index'],function(){
            Route::match(['GET','POST'],'export','CustomerController@projectIndexExport');
        });
        Route::get('index','CustomerController@projectIndex');
        Route::get('create','CustomerController@projectCreate');
        Route::group(['prefix'=>'area'],function(){
            Route::match(['GET','POST'],'export','CustomerController@projectAreaExport');
        });
        Route::get('area','CustomerController@projectArea');
        Route::get('{id}/edit','CustomerController@projectEdit');
        Route::post('projectUpdate','CustomerController@projectUpdate');
        Route::post('getOwnerPriceModel','CustomerController@getOwnerPriceModel');
        Route::post('updateArea','CustomerController@updateArea');
        Route::post('verify','CustomerController@verifyProject');
        Route::post('areaReportAudit','CustomerController@areaReportAudit');

        //获取现有计费模型
        Route::post('getPriceModel','PriceModelController@getPriceModel');

        //手动生成账单
        Route::post("createReport","CustomerController@createReport");
        Route::post("createAreaReport","CustomerController@createAreaReport");
        //手动重置账单数据
        Route::post("resetInstantBill","CustomerController@resetInstantBill");
        Route::post("resetBillConfirmation","CustomerController@resetBillConfirmation");

    });
    Route::get('relating',function (){return view('customer.relating');});
    Route::group(['prefix' => 'customer'], function () {
        Route::get('customerLogStatus', 'CustomerLogStatusController@index');
        Route::post('getLog', 'CustomerLogController@get');
        Route::post('editLog', 'CustomerLogController@update');
        Route::post('getLogStatus', 'CustomerLogStatusController@get');
        Route::post('storeLog', 'CustomerLogController@store');
        Route::post('relatedOwner', 'CustomerBaseController@relatedOwner');
        Route::post('addTag', 'CustomerBaseController@addTag');
        Route::post('delTag', 'CustomerBaseController@delTag');
        Route::post('destroyLog', 'CustomerBaseController@destroyLog');
        Route::group(['prefix' => 'customerLogStatus'], function () {
            Route::post('save', 'CustomerLogStatusController@save');
            Route::post('destroy', 'CustomerLogStatusController@destroy');
        });
        Route::group(['prefix' => 'customerTag'], function () {
            Route::post('save', 'CustomerTagController@save');
            Route::post('get', 'CustomerTagController@get');
        });
        Route::resource('customerTag', 'CustomerTagController',['only' => ['index',"destroy"]]);
        Route::resource('customerLog', 'CustomerLogController', ['only' => ['index', 'show', 'create', 'store', 'update', 'edit', 'destroy']]);
    });
    Route::group(['prefix' => 'ownerContract'], function () {
        Route::post('store', 'OwnerContractController@store');
        Route::get('down', 'OwnerContractController@downFile');
    });
    Route::resource('customer', 'CustomerBaseController');

});

/** 站管理 */
Route::group(['prefix'=>'station'],function(){
    Route::get('index','StationController@monitorIndex');
    /** 监视器 */
    Route::group(['prefix'=>'monitor'],function(){
        Route::get('/','StationController@monitorIndex');
        Route::get('/index','StationController@monitorIndex');
        Route::get('/{station}','StationController@monitorShow');
    });
    /** 缓存架 */
    Route::group(['prefix'=>'cachingShelf'],function(){
        Route::get('/index','CacheShelfController@index');
    });
    /** 栈规则 */
    Route::group(['prefix'=>'rule'],function(){
        Route::get('/index','StationRuleBatchController@index');
    });
});
/** 控制台 */
Route::group(['prefix'=>'control'],function () {
   Route::get('panel/menu','ControlPanelController@index') ;
});
/** 采购管理 */
Route::group(['prefix'=>'procurement'],function () {
    /** 采购 */
    Route::group(['prefix'=>'procurement'],function(){
        Route::get('index','ProcurementController@index');
        Route::get('create','ProcurementController@create');
        Route::post('store','ProcurementController@store');
        Route::post('getOwnerMaterial','ProcurementController@getOwnerMaterial');
        Route::post('createProcurement','ProcurementController@createProcurement');
        Route::post('createEnquiry','ProcurementController@createEnquiry');
        Route::post('createProof','ProcurementController@createProof');
        Route::any('procurementExport','ProcurementController@procurementExport');
        Route::get('cancel/{id}','ProcurementController@cancel');
        Route::post('initiateProcurement','ProcurementController@initiateProcurement');
        Route::post('submitProcurement','ProcurementController@submitProcurement');
        Route::post('createAnew','ProcurementController@createAnew');
    });
    /** 财务 */
    Route::group(['prefix'=>'finance'],function(){
        Route::get('checkBill','ProcurementController@checkBill');
        Route::get('procurementBill','ProcurementController@procurementBill');
        Route::get('monthlyBillReport','ProcurementController@monthlyBillReport');
        Route::post('fillInvoice','ProcurementController@fillInvoice');
        Route::any('procurementTotalBillExport','ProcurementController@procurementTotalBillExport');
        Route::any('procurementBillExport','ProcurementController@procurementBillExport');
        Route::any('checkBillExport','ProcurementController@checkBillExport');
        Route::post('costPrice','ProcurementController@costPrice');
        Route::post('getCheckBillMonth','ProcurementController@getCheckBillMonth');
    });
    Route::get('relating',function (){return view('procurement.menuProcurement');});
});

/** 需求管理 */
Route::group(['prefix'=>'demand'],function (){
    Route::get('/','DemandController@index');
});
