소스 검색

Merge branch 'zengjun' of ssh://was.baoshi56.com:10022/var/git/bswas into zengjun

 Conflicts:
	config/users.php
LD 5 년 전
부모
커밋
ef4cc26cd0

+ 42 - 0
app/Exports/DefaultExport.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Exports;
+
+use Maatwebsite\Excel\Concerns\FromCollection;
+
+class DefaultExport implements FromCollection
+{
+    private $head;
+    private $body;
+
+    public function __construct($head, $body)
+    {
+        $this->head = $head;
+        $this->body = $body;
+    }
+
+    /**
+     * @return \Illuminate\Support\Collection
+     */
+    public function collection()
+    {
+        $head = $this->head;
+        $body = $this->body;
+
+        // 表头设置
+        foreach ($head[0] as $key=>$value) {
+            $head_arr[] = $key;
+        }
+        // 表数据
+        foreach ($body as $key => &$value) {
+            $js = [];
+            for ($i = 0; $i < count($head_arr); $i++) {
+                $js = array_merge($js,[ $head_arr[$i] => $value[ $head_arr[$i] ] ]);
+
+            }
+            array_push($head, $js);
+            unset($val);
+        }
+        return collect($head);
+    }
+}

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

@@ -59,7 +59,7 @@ class CommodityController extends Controller
     {
         return Validator::make($data, [
             'name' => ['required', 'string', 'max:50'],
-            'barcode' => ['required', 'string', 'max:50', 'unique:commodities'],
+//            'barcode' => ['required', 'string', 'max:50', 'unique:commodities'],
         ]);
     }
     protected function validatorUpdate(array $data)

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

@@ -28,6 +28,6 @@ class HomeController extends Controller
             if(!Gate::allows('运输管理-查询')){ return view('home');}
             return redirect(url('waybill'));
         }
-        return redirect(url('rejected'));
+        return redirect(url('rejected/index/general'));
     }
 }

+ 59 - 2
app/Http/Controllers/RejectedController.php

@@ -2,6 +2,8 @@
 
 namespace App\Http\Controllers;
 
+use App\Exports\DefaultExport;
+use App\Exports\Export;
 use App\Exports\RejectedExport;
 use App\Imports\CommodityImport;
 use App\Imports\RejectedImport;
@@ -9,6 +11,7 @@ use App\Logistic;
 use App\Owner;
 use App\QualityLabel;
 use App\Rejected;
+use App\RejectedAnalyzeOwner;
 use App\RejectedBill;
 use App\RejectedBillItem;
 use Carbon\Carbon;
@@ -35,7 +38,7 @@ class RejectedController extends Controller
      */
     public function index(Request $request)
     {
-        if(!Gate::allows('退货管理-查询')){ return redirect(url('/'));  }
+        if(!Gate::allows('退货管理-查询-一般')){ return redirect(url('/'));  }
         $user=Auth::user();
         $paginate = $request->input('paginate')??50;
         $paginateParams = $this->packFilterParams($request);
@@ -46,7 +49,7 @@ class RejectedController extends Controller
         $rejectedBills=$rejectedQuery->paginate($paginate, ['*'], 'page', $page);
         $owners = Owner::filterAuthorities()->get();
         $qualityLabels = QualityLabel::all();
-        return view('rejected.index',compact('rejectedBills','owners',
+        return view('rejected.search.general',compact('rejectedBills','owners',
             'paginateParams','qualityLabels'));
     }
     public function recycle(Request $request)
@@ -438,4 +441,58 @@ class RejectedController extends Controller
             return '<h1 class="text-danger">失败</h1>'.$e->getMessage();
         }
     }
+
+
+     //generalSearch 一般查询 zengjun
+    public function indexGeneral(Request $request)
+    {
+      return $this->index( $request);
+    }
+
+    //analyzeSearch 统计查询 zengjun
+    public function indexAnalyze(Request $request)
+    {
+        if(!Gate::allows('退货管理-查询-统计')){ return redirect(url('/'));  }
+        $paginateParams = $this->getAnalyzeSearchParams($request);
+        $rejectedBills =  RejectedAnalyzeOwner::findBy($paginateParams);
+        $owners = Owner::filterAuthorities()->get();
+        $qualityLabels = QualityLabel::all();
+        return view('rejected.search.analyze',compact('rejectedBills','owners',
+            'paginateParams','qualityLabels'));
+    }
+
+    // 统计查询参数获取 zengjun
+    private function getAnalyzeSearchParams(Request $request)
+    {
+        $searchParams = [
+            'owner_id' => $request->input('owner_id'),
+            'ids'=> $request->input('ids'),
+            'created_at_start' => $request->input('created_at_start'),
+            'created_at_end' => $request->input('created_at_end')
+        ];
+        return $searchParams;
+    }
+
+    //  导出部分    zengjun
+    public function exportExcelOnParams(Request $request){
+        ini_set('max_execution_time',2500);
+        ini_set('memory_limit','1526M');
+        $row = RejectedAnalyzeOwner::getExcelFromHead();
+        $searchParams = $this->getAnalyzeSearchParams($request);
+        $data = RejectedAnalyzeOwner::getFindBy($searchParams);
+        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+        return Excel::download(new DefaultExport($row,$data),date('YmdHis', time()).'-退货统计记录单.xlsx');
+    }
+
+    // 导出全部     zengjun
+    public function exportAllExcelOnParams(Request $request){
+        ini_set('max_execution_time',2500);
+        ini_set('memory_limit','1526M');
+        $searchParams = $this->getAnalyzeSearchParams($request);
+        $row = RejectedAnalyzeOwner::getExcelFromHead();
+        $data = RejectedAnalyzeOwner::getFindBy($searchParams);
+        $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+        return Excel::download(new DefaultExport($row,$data),date('YmdHis', time()).'-退货统计记录单.xlsx');
+    }
+
 }

+ 139 - 0
app/RejectedAnalyzeOwner.php

@@ -0,0 +1,139 @@
+<?php
+
+namespace App;
+
+use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Illuminate\Support\Facades\DB;
+
+class RejectedAnalyzeOwner extends Model
+{
+
+    /**
+     * @var string[]
+     * id_owner:货主id
+     * owner_name:货主姓名
+     * bounce_amount:退件数
+     * check_amount:审核数
+     * in_storage_count:入库数
+     * created_at:创建时间
+     *
+     */
+    protected $appends = ['id_owner', 'owner_name', 'bounce_amount', 'check_amount', 'in_storage_count'];
+
+    // 按条件查询    zengjun
+    public static function findBy($array = null)
+    {
+        $sql = RejectedAnalyzeOwner::getQuerySQL($array);
+
+        $resultSet = DB::select($sql);
+        $collection = array();
+        foreach ($resultSet as $result) {
+            $rao = new RejectedAnalyzeOwner();
+            $rao->id_owner = $result->id_owner;
+            $rao->owner_name = $result->name;
+            $rao->bounce_amount = $result->bounce_amount;
+            $rao->check_amount = $result->check_amount;
+            $rao->in_storage_count = $result->in_storage_count;
+            $collection[] = $rao;
+        }
+        return $collection;
+    }
+
+    // 按条件查询    zengjun
+    public static function getFindBy($array){
+        $sql = RejectedAnalyzeOwner::getQuerySQL($array);
+        $resultSet = DB::select($sql);
+        $list = [];
+        foreach ($resultSet as $result) {
+            $rao =[
+                    'id_owner' => $result->id_owner,
+                    'owner_name'=>  $result->name,
+                    'bounce_amount'=>$result->bounce_amount,
+                    'check_amount'=>$result->check_amount,
+                    'in_storage_count'=>$result->in_storage_count,
+            ];
+            $list[] = $rao;
+        }
+        return $list;
+    }
+
+    public static function getExcelFromHead($array = null){
+        $arr = [[
+            'id_owner'=>'货主编号',
+            'owner_name'=>'货主名',
+            'bounce_amount'=>'退件单数',
+            'check_amount'=>'审核单数',
+            'in_storage_count'=>'入库单数',
+        ]];
+        return $arr;
+    }
+
+    // 拼接条件 没有ids     zengjun
+    public static function getCondition($array)
+    {
+        $condition = '';
+        if (!is_null($array)) {
+            foreach ($array as $key => $value) {
+                if (!is_null($value)) {
+                    if ($key == 'owner_id' and $value!= '' and $value!='null' and $value!= '""') {
+                        $condition .= ' and id_owner = ';
+                        $condition .= $value;
+                    }
+                    if($key == 'ids'){
+                        $sql=RejectedAnalyzeOwner::getSqlToIDs($value);
+                        $condition.=$sql;
+                    }
+                    if ($key == 'created_at_start' and !is_null($value) and $value!= "null" and $value!= '""') {
+                        $value =  str_replace('"','',$value);
+                        $condition .= ' and created_at > "';$condition .= $value;$condition .= '"';
+                    }
+                    if ($key == 'created_at_end' and !is_null($value) and $value!= "null" and $value!= '""') {
+                        $value =  str_replace('"','',$value);
+                        $condition .= ' and created_at < "';$condition .= $value;$condition .= '"';
+                    }
+                }
+            }
+        }
+        $condition .= ' group by id_owner';
+        return $condition;
+    }
+
+    public static function getSqlToIDs($ids):string
+    {
+        $sql = '';
+        if(!is_null($ids) && $ids !='' ) {
+            $ids = str_replace('[','(',$ids);
+            $ids = str_replace(']',')',$ids);
+            $ids = str_replace('"','',$ids);
+            $sql = $sql.' and id_owner in '.$ids;
+        }
+        return $sql;
+    }
+
+    // 返回sql    zengjun
+    public static  function getQuerySQL($array= null){
+        $condition = RejectedAnalyzeOwner::getCondition($array);// 条件
+        $sql = 'select distinct rao.id_owner,owners.name,sum(bounce_amount) bounce_amount,sum(check_amount) check_amount,sum(in_storage_count) in_storage_count from';
+        $sql .= '(';
+        // 退件单数
+        $sql .= ' select  distinct id_owner,count(1) bounce_amount,0 check_amount,0 in_storage_count from rejected_bills  where 1=1 ';
+        $sql .= $condition;
+        $sql .= ' UNION ';
+        // 审核单数
+        $sql .= ' select  distinct id_owner,0 bounce_amount,count(1) check_amount,0 in_storage_count from rejected_bills where is_checked = 1 ';
+        $sql .= $condition;
+        $sql .= ' UNION ';
+        // 入库单数
+        $sql .= ' select  distinct id_owner,0 bounce_amount,0 check_amount,count(1) in_storage_count from rejected_bills  where is_loaded = 1 ';
+        $sql .= $condition;
+        $sql .= ') rao ';
+
+        $sql .= ' left join owners on owners.id = rao.id_owner ';
+        $sql .= ' group by rao.id_owner ';
+        return  $sql;
+    }
+
+
+}

+ 0 - 7
bootstrap/cache/packages.php

@@ -92,11 +92,4 @@
       0 => 'Te7aHoudini\\LaravelTrix\\LaravelTrixServiceProvider',
     ),
   ),
-  'yajra/laravel-oci8' => 
-  array (
-    'providers' => 
-    array (
-      0 => 'Yajra\\Oci8\\Oci8ServiceProvider',
-    ),
-  ),
 );

+ 10 - 14
bootstrap/cache/services.php

@@ -34,13 +34,11 @@
     30 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
     31 => 'Overtrue\\LaravelPinyin\\ServiceProvider',
     32 => 'Te7aHoudini\\LaravelTrix\\LaravelTrixServiceProvider',
-    33 => 'Yajra\\Oci8\\Oci8ServiceProvider',
-    34 => 'Yajra\\Oci8\\Oci8ServiceProvider',
-    35 => 'App\\Providers\\AppServiceProvider',
-    36 => 'App\\Providers\\AuthServiceProvider',
-    37 => 'App\\Providers\\BroadcastServiceProvider',
-    38 => 'App\\Providers\\EventServiceProvider',
-    39 => 'App\\Providers\\RouteServiceProvider',
+    33 => 'App\\Providers\\AppServiceProvider',
+    34 => 'App\\Providers\\AuthServiceProvider',
+    35 => 'App\\Providers\\BroadcastServiceProvider',
+    36 => 'App\\Providers\\EventServiceProvider',
+    37 => 'App\\Providers\\RouteServiceProvider',
   ),
   'eager' => 
   array (
@@ -64,13 +62,11 @@
     17 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
     18 => 'Overtrue\\LaravelPinyin\\ServiceProvider',
     19 => 'Te7aHoudini\\LaravelTrix\\LaravelTrixServiceProvider',
-    20 => 'Yajra\\Oci8\\Oci8ServiceProvider',
-    21 => 'Yajra\\Oci8\\Oci8ServiceProvider',
-    22 => 'App\\Providers\\AppServiceProvider',
-    23 => 'App\\Providers\\AuthServiceProvider',
-    24 => 'App\\Providers\\BroadcastServiceProvider',
-    25 => 'App\\Providers\\EventServiceProvider',
-    26 => 'App\\Providers\\RouteServiceProvider',
+    20 => 'App\\Providers\\AppServiceProvider',
+    21 => 'App\\Providers\\AuthServiceProvider',
+    22 => 'App\\Providers\\BroadcastServiceProvider',
+    23 => 'App\\Providers\\EventServiceProvider',
+    24 => 'App\\Providers\\RouteServiceProvider',
   ),
   'deferred' => 
   array (

+ 0 - 1
config/app.php

@@ -161,7 +161,6 @@ return [
         Illuminate\Translation\TranslationServiceProvider::class,
         Illuminate\Validation\ValidationServiceProvider::class,
         Illuminate\View\ViewServiceProvider::class,
-        Yajra\Oci8\Oci8ServiceProvider::class,
 
         /*
          * Package Service Providers...

+ 1 - 1
config/users.php

@@ -3,7 +3,7 @@
 return [
 
 
-    'superAdmin' => ['ldaaww','baoshi56','zhouyaping','shiyao','zhouzhendong','胡浩','阿珺'],
+    'superAdmin' => ['ldaaww','baoshi56','zhouyaping','shiyao','zhouzhendong','胡浩','zengjun','阿珺'],
     'token_expire_minutes'=>7200,
     'token_check_in_expire_minutes'=>7200, //打卡过期时间,单位为分钟
 ];

+ 35 - 0
database/migrations/2020_06_11_112028_change_rejected_bills_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeRejectedBillsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     * rejected_bills表 is_loaded,is_checked 字段添加索引
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('rejected_bills',function (Blueprint $table){
+            $table->index('is_loaded');
+            $table->index('is_checked');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+        Schema::table('rejected_bills',function (Blueprint $table){
+            $table->dropIndex('is_loaded');
+            $table->dropIndex('is_checked');
+        });
+    }
+}

+ 3 - 0
resources/js/singles/rejectedIndex.js

@@ -339,6 +339,8 @@ let vueList=new Vue({
                 }
                 form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
                 form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
+                form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.created_at_start)+'\'/>');
+                form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.created_at_end)+'\'/>');
             }
             if(parseInt(val)===2){
                 if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
@@ -347,6 +349,7 @@ let vueList=new Vue({
                 }
                 form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
                 form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(_this.filterParams)+'\'/>');
+
             }
             form.append(csrfInput);
             $('#list').append(form);

+ 396 - 0
resources/js/singles/searchAnalyze.js

@@ -0,0 +1,396 @@
+
+let vueList=new Vue({
+    el:"#list",
+    data:{
+        filterParams:{created_at:'',owner_id:'',
+            //,order_number:'',logistic_number_return:'',mobile_sender:'',barcode_goods:'',
+            //is_checked:'',
+            created_at_start:'',created_at_end:'',
+            //id_quality_label:'',
+            //is_loaded:'',
+            //checked_numbers:'',
+           // paginate:'50'
+        },
+        checkBoxAll:[],
+        rejectedBills:rejectedBills,
+        rejectedBills_checkBoxes:[],
+        owners:owners,
+        qualityLabels:qualityLabels,
+    },
+    mounted:function(){
+        $(".tooltipTarget").tooltip({'trigger':'hover'});
+        this.initInputs();
+        $('#list').removeClass('d-none');
+    },
+    methods:{
+        filterRun:function(){
+            let form=$("<form method='get'></form>");
+            this.filterParams['page']='';
+            for(let key in this.filterParams){
+                if(this.filterParams[key]){
+                    form.append($("<input type='hidden' name='"+key+"' value='"+this.filterParams[key]+"'>"));
+                }
+            }
+            $("body").append(form);
+            form.submit();
+        },
+        searchByFilters:function(e){
+            this.filterRun();
+        },
+        created_at_startChange:function(e){
+            this.filterParams.created_at_start=e.target.value;
+            this.filterRun();
+        },
+        created_at_endChange:function(e){
+            this.filterParams.created_at_end=e.target.value;
+            this.filterRun();
+        },
+        owner_idChange:function(e){
+            this.filterParams.owner_id=e.target.value;
+            this.filterRun();
+        },
+        is_checkedChange:function(e){
+            this.filterParams.is_checked=e.target.value;
+            this.filterRun();
+        },
+        id_quality_labelChange:function(e){
+            this.filterParams.id_quality_label=e.target.value;
+            this.filterRun();
+        },
+        is_loadedChange:function(e){
+            this.filterParams.is_loaded=e.target.value;
+            this.filterRun();
+        },
+        initInputs:function(){
+            let data=this;
+            let uriParts = decodeURI(location.href).split("?");
+            if(uriParts.length>1){
+                let params = uriParts[1].split('&');
+                params.forEach(function(paramPair){
+                    let pair=paramPair.split('=');
+                    let key = pair[0], val = pair[1];
+                    $('input[name="'+key+'"]').val(val);
+                    $('select[name="'+key+'"]').val(val);
+                    data.filterParams[key]=val;
+                });
+            }
+            for(let key in paginateParams){
+                let val = paginateParams[key];
+                $('input[name="'+key+'"]').val(val);
+                $('select[name="'+key+'"]').val(val);
+                data.filterParams[key]=val;
+            }
+
+        },
+        // edit:function(e){
+        //     let id = $(e.target).parents('tr').attr('data-id');
+        //     let editFullUri = editUrl+id+"/edit";
+        //     // location.href = editFullUri;
+        //     let form=$('<form action=\"'+editFullUri+'\" method="post" target="_blank"></form>');
+        //     form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(this.filterParams)+'\'/>');
+        //     form.append(csrfInput);
+        //     $('body').append(form);
+        //     form.submit();
+        // },
+        // destroy:function(rejectedBill){
+        //     if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
+        //     let data=this;
+        //     let url = destroyUrl+rejectedBill.id;
+        //     axios.delete(url,{id:rejectedBill.id})
+        //         .then(function (response) {
+        //             if(response.data.success){
+        //                 for (let i = 0; i < data.rejectedBills.length; i++) {
+        //                     if (data.rejectedBills[i].id===rejectedBill.id){
+        //                         data.rejectedBills.splice(i,1);
+        //                         break;
+        //                     }
+        //                 }
+        //                 tempTip.setDuration(1000);
+        //                 tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
+        //             }else{
+        //                 tempTip.setDuration(1000);
+        //                 tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
+        //             }
+        //         })
+        //         .catch(function (err) {
+        //             tempTip.setDuration(3000);
+        //             tempTip.show('删除退货信息失败!'+'网络错误:' + err);
+        //             console.log(err);
+        //         });
+        // },
+        submitFilterOnEnter:function(e){
+            if(e.key==='Enter'){
+                this.filterRun();
+            }
+        },
+        created_at_startEntering:function(e){
+            if(e.key==='Enter'){
+                this.created_at_startChange(e)
+            }
+        },
+        created_at_endEntering:function(e){
+            if(e.key==='Enter'){
+                this.created_at_endChange(e)
+            }
+        },
+        owner_idEntering:function(e){
+            if(e.key==='Enter'){
+                e.target.value=$('#owner_id').val();
+                this.owner_idChange(e);
+                e.target.value='';
+            }
+        },
+        locateOwner:function (e) {
+            str = e.target.value.trim()
+            if (str==='')return ;
+            $("#owner_id option").attr("selected",false);
+            let selectingOption=$("#owner_id").find("option:contains("+str+")").eq(0);
+            selectingOption.attr("selected",true);
+            this.filterParams.owner_id=selectingOption.val();
+        },
+        // mobile_senderEntering:function(e){
+        //     this.filterParams.mobile_sender=e.target.value;
+        //     if(e.key==='Enter'){
+        //         this.filterRun();
+        //     }
+        // },
+        // order_numberEntering:function(e){
+        //     this.filterParams.order_number=e.target.value;
+        //     if(e.key==='Enter'){
+        //         this.filterRun();
+        //     }
+        // },
+        // barcode_goodsEntering:function(e){
+        //     this.filterParams.barcode_goods=e.target.value;
+        //     if(e.key==='Enter'){
+        //         this.filterRun();
+        //     }
+        // },
+        // checked_numbersEntering:function(e){
+        //     this.filterParams.checked_numbers=e.target.value;
+        //     if(e.key==='Enter'){
+        //         this.filterRun();
+        //     }
+        // },
+        logistic_number_returnEntering:function(e){
+            this.filterParams.logistic_number_return=e.target.value;
+            if(e.key==='Enter'){
+                this.filterRun();
+            }
+        },
+        logistic_numberEntering:function(e){
+            this.filterParams.logistic_number=e.target.value;
+            if(e.key==='Enter'){
+                this.filterRun();
+            }
+        },
+        cancelCheckConfirmAll:function(){
+            $('#checkConfirmingAll').tooltip('hide');
+            setTimeout(function () {
+                $(".tooltipTarget").tooltip({'trigger':'hover'})
+            }, 10);
+            this.checkBoxAll=false;
+            this.rejectedBills.forEach(function(rejectedBill){
+                if(rejectedBill.is_checked===-1)
+                    rejectedBill.is_checked='0';
+            })
+        },
+        // setIsLoaded_batch:function(val){
+        //     let _this=this;
+        //     if(_this.rejectedBills_checkBoxes.length===0){
+        //         tempTip.show('没有勾选记录');
+        //         $(e.target).val("");
+        //         return;
+        //     }
+        //     let is_loaded=0;
+        //     let is_loadedLabel='否';
+        //     if(parseInt(val)===1){
+        //         is_loaded=1;
+        //         is_loadedLabel='是';
+        //     }else if(parseInt(val)===2){
+        //         is_loaded=2;
+        //         is_loadedLabel='待推单';
+        //     }else if(parseInt(val)===4){
+        //         is_loaded=4;
+        //         is_loadedLabel='待确认';
+        //     }else if(val==="null"){
+        //         is_loaded='null';
+        //         is_loadedLabel='无需入库';
+        //     }
+        //     if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
+        //     axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
+        //         if(response.data.success){
+        //             _this.rejectedBills_checkBoxes.forEach(function(id){
+        //                 _this.rejectedBills.forEach(function(bill){
+        //                     if(bill.id===id){
+        //                         bill.is_loaded=is_loaded;
+        //                     }
+        //                 });
+        //             });
+        //             tempTip.setDuration(1000);
+        //             tempTip.showSuccess('修改勾选记录的入库状态成功');
+        //         }else{
+        //             tempTip.setDuration(2500);
+        //             tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
+        //         }
+        //     }).catch(function (e) {
+        //         alert('网络连接错误:'+e);
+        //         tempTip.setDuration(2500);
+        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
+        //         console.log(e);
+        //     });
+        //     $(e.target).val("")
+        // },
+        checkBoxAllToggle:function(e){
+            let _this=this;
+            if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
+                _this.rejectedBills_checkBoxes=[];
+                _this.checkBoxAll=[];
+            }
+            else{
+                _this.rejectedBills_checkBoxes=[];
+                this.rejectedBills.forEach(function(bill){
+                    _this.rejectedBills_checkBoxes.push(bill.id);
+                    _this.checkBoxAll=[1];
+                });
+            }
+        },
+        // checkAll:function(){
+        //     let _this=this;
+        //     if(_this.rejectedBills_checkBoxes.length===0){
+        //         tempTip.show('没有勾选记录');
+        //         return
+        //     }
+        //     if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
+        //     axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
+        //         if(response.data.success){
+        //             response.data.rejecteds.forEach(function (rejected) {
+        //                 _this.rejectedBills.forEach(function(rejectedBill){
+        //                     if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
+        //                         rejectedBill.is_checked=1;
+        //                         rejectedBill.checked_numbers=rejected.checked_numbers;
+        //                     }
+        //                 });
+        //             });
+        //             tempTip.setDuration(1000);
+        //             tempTip.showSuccess('审核勾选内容成功');
+        //         }else{
+        //             tempTip.setDuration(2500);
+        //             tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
+        //         }
+        //     }).catch(function (e) {
+        //         alert('网络连接错误:'+e);
+        //         tempTip.setDuration(2500);
+        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
+        //         console.log(e);
+        //     })
+        // },
+        // confirmBeStored:function($e,id){
+        //     let _this=this;
+        //     axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
+        //         if(response.data.success){
+        //             _this.rejectedBills.forEach(function(rejectedBill){
+        //                 if(rejectedBill.id===id){
+        //                     rejectedBill.is_loaded=1;
+        //                 }
+        //             });
+        //             tempTip.setDuration(1000);
+        //             tempTip.showSuccess('确认入库成功');
+        //         }else{
+        //             tempTip.setDuration(2500);
+        //             tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
+        //         }
+        //     }).catch(function (e) {
+        //         alert('确认失败,网络连接错误:'+e);
+        //         tempTip.setDuration(2500);
+        //         tempTip.show('确认失败,网络连接错误:'+e);
+        //         console.log(e);
+        //     })
+        // },
+        // finishAll:function(){
+        //     let _this=this;
+        //     if(_this.rejectedBills_checkBoxes.length===0){
+        //         tempTip.show('没有勾选记录');
+        //         return
+        //     }
+        //     if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
+        //     axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
+        //         if(response.data.success){
+        //             _this.rejectedBills.forEach(function(rejectedBill){
+        //                 _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
+        //                     if(rejectedBill.id===checkedId){
+        //                         rejectedBill.is_finished=1;
+        //                     }
+        //                 });
+        //             });
+        //             tempTip.setDuration(1000);
+        //             tempTip.showSuccess('标记勾选内容为完结成功');
+        //         }else{
+        //             tempTip.setDuration(2500);
+        //             tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
+        //         }
+        //     }).catch(function (e) {
+        //         alert('网络连接错误:'+e);
+        //         tempTip.setDuration(2500);
+        //         tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
+        //         console.log(e);
+        //     })
+        // },
+        exportExcel:function(val){
+            let _this=this;
+            let form;
+             if(parseInt(val)===1){
+                if(_this.rejectedBills_checkBoxes.length===0){
+                    tempTip.show('没有勾选记录');
+                    return;
+                }
+                form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
+                form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
+            }
+            if(parseInt(val)===2){
+                if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
+               /* if(total>100000){
+                    tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录','知道了')
+                }*/
+                form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
+                form.append('<input type="hidden" name="owner_id" value=\''+JSON.stringify(_this.filterParams.owner_id)+'\'/>');
+            }
+            form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.filterParams.created_at_start)+'\'/>');
+            form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.filterParams.created_at_end)+'\'/>');
+            form.append(csrfInput);
+            $('#list').append(form);
+            form.submit();
+            tempTip.setDuration(5000);
+            tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截")
+        },
+    },
+    computed:{
+        isBeingFilterConditions:function(){
+            for(let key in this.filterParams){
+                if(this.filterParams[key]){
+                    if(key==='paginate')continue;
+                    if(key==='page')continue;
+                    return true
+                }
+            }
+            return false;
+        }
+    },
+    // filters:{
+    //     yesNo:function (val) {
+    //         if(!val||val===0||val==='0'){return '否'}
+    //         return '是'
+    //     },
+    //     yesNoIsLoaded:function (val) {
+    //         switch(val){
+    //             case 0:case '0':return '否';
+    //             case 1:case '1':return '是';
+    //             case 2:case '2':return '待推单';
+    //             case 3:case '3':return '交互异常';
+    //             case 4:case '4':return '待确认';
+    //             case null:case 'null':return '无需入库';
+    //         }
+    //         return '';
+    //     }
+    // }
+});

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

@@ -14,7 +14,7 @@
 </head>
 <body>
 <div id="app">
-    <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
+    <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm" style="padding: 0;height: 50px" >
         <div class="container-fluid">
             <a class="navbar-brand" href="{{ url('/') }}" title="宝时 Warehouse Assistance System" style="vertical-align: text-bottom">
                 <img src="{{asset('icon/logo100b.png')}}" alt="宝时 Warehouse Assistance System" height="30" >

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

@@ -1,8 +1,8 @@
-<div class="collapse navbar-collapse" id="navbarSupportedContent">
+<div class="collapse navbar-collapse" id="navbarSupportedContent" style="height: 50px">
     <!-- Left Side Of Navbar -->
-    <ul class="navbar-nav mr-auto nav-tabs nav font-weight-bold" id="nav1">
+    <ul class="navbar-nav mr-auto nav-tabs nav font-weight-bold" id="nav1" style="padding-top: 10px">
         @can('退货管理')
-            <li class="nav-item"><a href="{{url("rejected/")}}" class="nav-link"
+            <li class="nav-item"><a href="{{url("rejected/index/general")}}" class="nav-link"
                                     :class="{active:isActive('rejected',1)}">
                     <span class="fa fa-recycle" style="color: #721b6e"></span>
                     退货管理</a></li> @endcan

+ 1 - 0
resources/views/rejected/index.blade.php

@@ -4,6 +4,7 @@
 @section('content')
     <div id="nav2">
         @component('rejected.menu')@endcomponent
+        @component('rejected.search.menu')@endcomponent
     </div>
     <div class="container-fluid">
         <div style="min-width: 2070px;">

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

@@ -4,7 +4,7 @@
         <ul class="nav nav-pills">
             @can('退货管理-查询')
                 <li class="nav-item">
-                    <a class="nav-link" href="{{url('rejected')}}" :class="{active:isActive('',2)}">查询</a>
+                    <a class="nav-link" href="{{url('rejected/index/general')}}" :class="{active:isActive('index',2)}">查询</a>
                 </li> @endcan
             @can('退货管理-录入')
                 <li class="nav-item">

+ 169 - 0
resources/views/rejected/search/analyze.blade.php

@@ -0,0 +1,169 @@
+@extends('layouts.app')
+@section('title')退货管理@endsection
+
+@section('content')
+    <div id="nav2">
+        @component('rejected.menu')@endcomponent
+        @component('rejected.search.menu')@endcomponent
+    </div>
+    <div class="container-fluid">
+        <div style="min-width: 2070px;">
+            <div class="d-none" id="list">
+                @if(Session::has('successTip'))
+                    <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
+                @endif
+                <div class="col-12" style="background: #fff;">
+                    <div class="row">
+                        <div class="col" v-if="isBeingFilterConditions">
+                            <label for="">
+                                <a href="{{url('rejected/index/analyze')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
+                            </label>
+                        </div>
+                        <table class="table table-sm table-bordered m-0">
+                            <tr>
+                                <td colspan="9">
+                                    <div class="form-control-sm tooltipTarget"></div>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="2">
+                                    <input type="date" name="created_at_start" class="form-control-sm tooltipTarget"
+                                           style="width:140px"
+                                           :class="filterParams.created_at_start?'bg-warning':''"
+                                           v-model="filterParams.created_at_start"
+                                           @keypress="created_at_startEntering" @change="created_at_startChange"
+                                           title="选择显示指定日期的起始时间">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="客户"
+                                           style="width:70px" @input="locateOwner" @keypress="owner_idEntering"
+                                           title="客户:输入关键词快速定位下拉列表,回车确定">
+                                    <select name="owner_id" id="owner_id" class="form-control-sm tooltipTarget"
+                                            :class="filterParams.owner_id?'bg-warning':''"
+                                            v-model="filterParams.owner_id"
+                                            title="选择要显示的客户" @change="owner_idChange">
+                                        <option value="" selected>全部客户</option>
+                                        <option v-for="owner in owners" :value="owner.id">@{{ owner.name }}</option>
+                                    </select>
+                                </td>
+                                <td width="36%"></td>
+                            </tr>
+                            <tr>
+                                <td colspan="2">
+                                    <input type="date" name="created_at_end" class="form-control-sm tooltipTarget"
+                                           style="width:140px"
+                                           :class="filterParams.created_at_end?'bg-warning':''"
+                                           @keypress="created_at_endEntering" @change="created_at_endChange"
+                                           title="选择显示指定日期的结束时间">
+                                </td>
+                                <td><input type="button" class="btn btn-outline-dark btn-sm" @click="searchByFilters"
+                                           value="按条件搜索"/></td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    <span class="dropdown">
+                                        <button
+                                            class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                                            :class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
+                                            data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
+                                            导出Excel
+                                        </button>
+                                        <div class="dropdown-menu">
+                                            <a class="dropdown-item" @click="exportExcel(1)"
+                                               href="javascript:">导出勾选内容</a>
+                                            <a class="dropdown-item" @click="exportExcel(2)"
+                                               href="javascript:">导出所有页</a>
+                                        </div>
+                                    </span>
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
+
+                <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
+                    <tr>
+                        <th>
+                            <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
+                                   id="checkSelectingAll" @click="checkBoxAllToggle" v-model="checkBoxAll" value="1">
+                        </th>
+                        <th>序号</th>
+                        <th>货主</th>
+                        <th>退件数</th>
+                        <th>审核数</th>
+                        <th>入库数</th>
+                    </tr>
+                    <tr v-for="(rejectedBill,index) in rejectedBills " :data-id="rejectedBill.id">
+                        <td>
+                            <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id">
+                        </td>
+                        <td class="text-muted" style="opacity:0.7">
+                            @{{ index+1 }}
+                        </td>
+                        <td>
+                            @{{ rejectedBill.ownerName }}
+                        </td>
+                        <td>
+                            @{{ rejectedBill.bounceAmount }}
+                        </td>
+                        <td>
+                            @{{ rejectedBill.checkAmount }}
+                        </td>
+                        <td>
+                            @{{ rejectedBill.inStorageCount }}
+                        </td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        // 数据
+        let rejectedBills = [
+            @foreach($rejectedBills as $rejectedBill)
+            {
+                id: '{{$rejectedBill->id_owner}}',
+                ownerName: '{{$rejectedBill->owner_name}}',
+                bounceAmount: '{{$rejectedBill->bounce_amount}}',
+                checkAmount: '{{$rejectedBill->check_amount}}',
+                inStorageCount: '{{$rejectedBill->in_storage_count}}',
+            },
+            @endforeach
+        ];
+
+        //  客户
+        let owners = [
+            @foreach($owners as $owner)
+            {
+                id: '{{$owner->id}}', name: '{{$owner->name}}'
+            },
+            @endforeach
+        ];
+        let qualityLabels = [
+            @foreach($qualityLabels as $qualityLabel)
+            {
+                id: '{{$qualityLabel->id}}', name: '{{$qualityLabel->name}}'
+            },
+            @endforeach
+        ];
+            @if(isset($paginateParams))
+        let paginateParams ={!! json_encode($paginateParams) !!};
+            @endif
+        let total = rejectedBills.length;
+        let editUrl = "{{url('rejectedBill')}}/";
+        let destroyUrl = "{{url('rejectedBill')}}/";
+        let ajaxConfirmBeStoredUrl = '{{url("apiLocal/rejectedBill/apiConfirmBeStored")}}';
+        let ajaxCheckUrl = '{{url("apiLocal/rejectedBill/apiSetIsLoadedAll")}}';
+        let ajaxCheckAllURL = '{{url("rejected/ajaxCheckAll")}}';
+        let ajaxFinishAllUrl = '{{url("rejected/ajaxFinishAll")}}';
+        let exportExcelURL = '{{url("rejected/analyze/exportExcelOnParams")}}';
+        let exportExcelOnFilterParamsURL = '{{url("rejected/analyze/exportAllExcelOnParams")}}';
+        let csrfInput = '@csrf';
+    </script>
+    <script>
+    </script>
+    <script src="{{asset('js/singles/searchAnalyze200513.js')}}"></script>
+@endsection

+ 333 - 0
resources/views/rejected/search/general.blade.php

@@ -0,0 +1,333 @@
+@extends('layouts.app')
+@section('title')退货管理@endsection
+
+@section('content')
+    <div id="nav2">
+        @component('rejected.menu')@endcomponent
+        @component('rejected.search.menu')@endcomponent
+    </div>
+    <div class="container-fluid">
+        <div style="min-width: 2070px;">
+            <div class="d-none" id="list">
+                @if(Session::has('successTip'))
+                    <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
+                @endif
+
+                <div class="col-12" style="background: #fff;">
+                    <div class="row">
+                        <div class="col" v-if="isBeingFilterConditions">
+                            <label for="">
+                                <a :href="'{{url('rejected').'?paginate='}}'+filterParams.paginate"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
+                            </label>
+                        </div>
+                        <table class="table table-sm table-bordered m-0">
+                            <tr>
+                                <td colspan="9">
+                                    <select name="" id="setPaginate" class="tooltipTarget form-control-sm" style="vertical-align: middle"
+                                            @change="setPaginate" v-model="filterParams.paginate">
+                                        <option value="50">每页显示50条</option>
+                                        <option value="100">每页显示100条</option>
+                                        <option value="200">每页显示200条</option>
+                                        <option value="500">每页显示500条</option>
+                                        <option value="1000">每页显示1000条</option>
+                                    </select>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td colspan="2">
+                                    <input type="date" name="created_at_start" class="form-control-sm tooltipTarget" style="width:140px"
+                                           :class="filterParams.created_at_start?'bg-warning':''" v-model="filterParams.created_at_start"
+                                           @keypress="created_at_startEntering" @change="created_at_startChange" title="选择显示指定日期的起始时间">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="客户"
+                                           style="width:70px" @input="locateOwner" @keypress="owner_idEntering"
+                                           title="客户:输入关键词快速定位下拉列表,回车确定">
+                                    <select name="owner_id" id="owner_id" class="form-control-sm tooltipTarget"
+                                            :class="filterParams.owner_id?'bg-warning':''" v-model="filterParams.owner_id"
+                                            title="选择要显示的客户" @change="owner_idChange">
+                                        <option value="" selected>全部客户</option>
+                                        <option v-for="owner in owners" :value="owner.id">@{{ owner.name }}</option>
+                                    </select>
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="订单号" name="order_number"
+                                           :class="filterParams.order_number?'bg-warning':''" v-model="filterParams.order_number"
+                                           @input="order_numberEntering" @keypress="submitFilterOnEnter" title="订单号:15天以内的支持模糊搜索,回车提交">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="退回单号" name="logistic_number_return"
+                                           :class="filterParams.logistic_number_return?'bg-warning':''"
+                                           @input="logistic_number_returnEntering" @keypress="submitFilterOnEnter" title="退回单号:支持查找多个以逗号或空格分隔的单号,15天以内的支持模糊搜索,回车提交">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="原单单号" name="logistic_number"
+                                           :class="filterParams.logistic_number?'bg-warning':''"
+                                           @input="logistic_numberEntering" @keypress="submitFilterOnEnter" title="原单单号:15天以内的支持模糊搜索,回车提交">
+                                </td>
+                                <td>
+                                    <select name="is_checked" class="form-control-sm tooltipTarget" @change="is_checkedChange" title="审核"
+                                            :class="filterParams.is_checked?'bg-warning':''">
+                                        <option value="">是否审核</option>
+                                        <option value="1">已审核</option>
+                                        <option value="0">未审核</option>
+                                    </select>
+                                </td>
+                                <td width="36%"></td>
+                            </tr>
+                            <tr>
+                                <td colspan="2">
+                                    <input type="date" name="created_at_end" class="form-control-sm tooltipTarget" style="width:140px"
+                                           :class="filterParams.created_at_end?'bg-warning':''"
+                                           @keypress="created_at_endEntering" @change="created_at_endChange" title="选择显示指定日期的结束时间">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" placeholder="商品条码" name="barcode_goods"
+                                           :class="filterParams.barcode_goods?'bg-warning':''" title="商品条码:可模糊匹配右边未填完的部分,按回车提交"
+                                           @input="barcode_goodsEntering" @keypress="submitFilterOnEnter">
+                                </td>
+                                <td>
+                                    <select name="id_quality_label" id="id_quality_label" class="form-control-sm tooltipTarget"
+                                            :class="filterParams.id_quality_label?'bg-warning':''"
+                                            title="是否正品:正品仅显示全部是正品的退单,但残次显示的是包含有残次的退单" @change="id_quality_labelChange">
+                                        <option value="" selected>是否正品</option>
+                                        <option v-for="qualityLabel in qualityLabels" :value="qualityLabel.id">@{{ qualityLabel.name }}</option>
+                                    </select>
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" name="mobile_sender" placeholder="寄件人手机"
+                                           :class="filterParams.mobile_sender?'bg-warning':''"
+                                           @input="mobile_senderEntering" @keypress="submitFilterOnEnter" title="寄件人手机:输入完成敲回车提交">
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control-sm tooltipTarget" name="checked_numbers" placeholder="审核批次号"
+                                           :class="filterParams.checked_numbers?'bg-warning':''"
+                                           @input="checked_numbersEntering" @keypress="submitFilterOnEnter" title="审核批次号:支持右位留空的模糊搜索">
+                                </td>
+                                <td>
+                                    <select name="is_loaded" id="is_loaded" class="form-control-sm"
+                                            :class="filterParams.is_loaded?'bg-warning':''"
+                                            title="是否入库" @change="is_loadedChange">
+                                        <option value="" selected>是否入库</option>
+                                        <option value="1">是</option>
+                                        <option value="0">否</option>
+                                        <option value="null">无需入库</option>
+                                        <option value="2">待推单</option>
+                                        <option value="4">待确认</option>
+                                    </select>
+                                </td>
+                                <td><input type="button" class="btn btn-outline-dark btn-sm" @click="searchByFilters" value="按条件搜索"/></td>
+                            </tr>
+                            <tr>
+                                <td colspan="9">
+                                    @can('退货管理-审核')
+                                        <span class="btn btn-sm" @click="checkAll" style="cursor: pointer"
+                                              :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">审核</span>
+                                    @endcan
+                                    @can('退货管理-编辑')
+                                        <span class="btn btn-sm" @click="finishAll" style="cursor: pointer"
+                                              :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">完结</span>
+                                    @endcan
+                                    {{--                                    <select name="" class="tooltipTarget form-control-sm" style="vertical-align: middle"--}}
+                                    {{--                                            @change="exportExcel" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出"--}}
+                                    {{--                                            :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">--}}
+                                    {{--                                        <option value="">导出Excel</option>--}}
+                                    {{--                                        <option value="1">导出勾选内容</option>--}}
+                                    {{--                                        <option value="2">导出所有页</option>--}}
+                                    {{--                                    </select>--}}
+                                    <span class="dropdown">
+                                        <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
+                                                data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
+                                            导出Excel
+                                        </button>
+                                        <div class="dropdown-menu">
+                                            <a class="dropdown-item" @click="exportExcel(1)" href="javascript:">导出勾选内容</a>
+                                            <a class="dropdown-item" @click="exportExcel(2)" href="javascript:">导出所有页</a>
+                                        </div>
+                                    </span>
+                                    @can('退货管理-编辑')
+                                        {{--                                        <select name="" class="tooltipTarget form-control-sm" style="vertical-align: middle"--}}
+                                        {{--                                                title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效" @change="setIsLoaded_batch"--}}
+                                        {{--                                                :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">--}}
+                                        {{--                                            <option value="">修改入库</option>--}}
+                                        {{--                                            <option value="1">设定为是</option>--}}
+                                        {{--                                            <option value="0">设定为否</option>--}}
+                                        {{--                                            <option value="null">无需入库</option>--}}
+                                        {{--                                            <option value="2">待推单</option>--}}
+                                        {{--                                        </select>--}}
+                                        <span class="dropdown">
+                                        <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
+                                                data-toggle="dropdown" title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效">
+                                            修改入库
+                                        </button>
+                                        <div class="dropdown-menu">
+                                            <a class="dropdown-item" @click="setIsLoaded_batch(1)" href="javascript:">设定为是</a>
+                                            <a class="dropdown-item" @click="setIsLoaded_batch(0)" href="javascript:">设定为否</a>
+                                            <a class="dropdown-item" @click="setIsLoaded_batch('null')" href="javascript:">无需入库</a>
+                                            <a class="dropdown-item" @click="setIsLoaded_batch(2)" href="javascript:">待推单</a>
+                                            <a class="dropdown-item" @click="setIsLoaded_batch(4)" href="javascript:">待确认</a>
+                                        </div>
+                                    </span>
+                                    @endcan
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
+
+
+                <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
+                    <tr>
+                        <th>
+                            <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
+                                   id="checkSelectingAll" @click="checkBoxAllToggle" v-model="checkBoxAll" value="1">
+                        </th>
+                        <th>序号</th>
+                        <th>是否审核</th>
+                        <th>是否完结</th>
+                        <th>是否入库</th>
+                        <th>创建时间</th>
+                        <th>客户名称</th>
+                        <th>退回单号</th>
+                        <th>退回公司</th>
+                        <th>订单号</th>
+                        <th>姓名</th>
+                        <th>电话</th>
+                        <th>原单单号</th>
+                        <th>到付费用</th>
+                        <th>商品总数</th>
+                        <th>商品条码</th>
+                        <th>商品名称</th>
+                        <th>数量</th>
+                        <th>是否正品</th>
+                        <th>批次号</th>
+                        <th>生产日期</th>
+                        <th>效期</th>
+                        <th>备注</th>
+                        <th>退单备注</th>
+                        <th>录入人</th>
+                        @can('退货管理-编辑','退货管理-删除')
+                            <th>操作</th>
+                        @endcan
+                    </tr>
+
+                    <tr v-for="(rejectedBill,i) in rejectedBills" :data-id="rejectedBill.id">
+                        <td>
+                            <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id"/>
+                        </td>
+                        <td class="text-muted" style="opacity:0.7">
+                            @{{ i+1 }}
+                        </td>
+                        <td class="text-muted">
+                            <span v-if="rejectedBill.is_checked==1" class="text-success">
+                                <span class="fa fa-check-square"></span> @{{ rejectedBill.checked_numbers }}
+                            </span>
+                            <span v-else>
+                                未审核
+                            </span>
+                        </td>
+                        <td class="" :class="[rejectedBill.is_finished!=0?'text-success':'text-muted']">@{{rejectedBill.is_finished | yesNo}}</td>
+                        <td class="" :class="[rejectedBill.is_loaded==1?'text-success':'text-muted']">
+                            <span v-if="rejectedBill.is_loaded==4">
+                                <button class="btn btn-sm btn-info" @click="confirmBeStored($event,rejectedBill.id)">确定入库</button>
+                            </span>
+                            <span v-else>@{{rejectedBill.is_loaded | yesNoIsLoaded}}</span>
+                        </td>
+                        <td class="text-muted">@{{rejectedBill.created_at}}</td>
+                        <td>@{{rejectedBill.owner.name}}</td>
+                        <td>@{{rejectedBill.logistic_number_return}}</td>
+                        <td class="text-muted">@{{rejectedBill.logistic.name}}</td>
+                        <td>@{{rejectedBill.order_number}}</td>
+                        <td class="text-muted">@{{rejectedBill.sender}}</td>
+                        <td class="text-muted">@{{rejectedBill.mobile_sender}}</td>
+                        <td>@{{rejectedBill.logistic_number}}</td>
+                        <td class="text-muted">@{{rejectedBill.fee_collected}}</td>
+                        <td class="text-muted">@{{rejectedBill.goods_amount}}</td>
+                        <td colspan="8">
+                            <div class="text-center" v-if="rejectedBill.detailFolding && rejectedBill.items.length>1">
+                                <a href="javascript:;" @click="rejectedBill.detailFolding=false">@{{rejectedBill.goods_amount}}件商品,点击展开明细</a></div>
+                            <table class="table table-sm" v-else>
+                                <tr v-for="item in rejectedBill.items">
+                                    <td style="width: 140px">@{{item.barcode_goods}}</td>
+                                    <td style="width: 140px">@{{item.name_goods}}</td>
+                                    <td style="width: 30px">@{{item.amount}}</td>
+                                    <td class="text-muted">@{{item.quality_label}}</td>
+                                    <td class="text-muted">@{{item.batch_number}}</td>
+                                    <td class="text-muted">@{{item.made_at}}</td>
+                                    <td class="text-muted">@{{item.validity_at}}</td>
+                                    <td class="text-muted">@{{item.remark}}</td>
+                                </tr>
+                                <tr v-if="!rejectedBill.detailFolding && rejectedBill.items.length>1">
+                                    <td colspan="8" class="text-center">
+                                        <a href="javascript:;" @click="rejectedBill.detailFolding=true">点击收起明细</a>
+                                    </td>
+                                </tr>
+                            </table>
+                        </td>
+                        <td class="text-muted" style="max-width: 190px">@{{rejectedBill.remark}}</td>
+                        <td class="text-muted">@{{rejectedBill.operator_name}}</td>
+                        @can('退货管理-编辑')
+                            <td>
+                                <span v-if="rejectedBill.is_finished==0">
+                                @can('退货管理-编辑')
+                                        <button class="btn btn-outline-info btn-sm tooltipTarget" @click="edit">改</button>
+                                    @endcan
+                                    @can('退货管理-删除')
+                                        <button
+                                            class="btn btn-outline-danger btn-sm tooltipTarget" @click="destroy(rejectedBill)">删</button>
+                                    @endcan
+                                </span>
+                                <span v-else class="text-muted">已完结</span>
+                            </td>
+                        @endcan
+                    </tr>
+                </table>
+                <div class="text-info h5 btn btn">{{$rejectedBills->count()}}/{{$rejectedBills->total()}}</div>
+                {{$rejectedBills->appends($paginateParams)->links()}}
+            </div>
+        </div>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        let rejectedBills=[
+                @foreach( $rejectedBills as $rejectedBill )
+            {
+                id:'{{$rejectedBill->id}}',is_checked:'{{$rejectedBill->is_checked}}',checked_numbers:'{{$rejectedBill->checked_numbers}}',
+                created_at:'{{$rejectedBill->created_at->format("Y-m-d H:i")}}',owner:{!! $rejectedBill->owner !!},
+                order_number:'{{$rejectedBill->order_number}}',sender:'{{$rejectedBill->sender}}',
+                mobile_sender:'{{$rejectedBill->mobile_sender}}',logistic_number:'{{$rejectedBill->logistic_number}}',
+                logistic_number_return:'{{$rejectedBill->logistic_number_return}}',logistic:{!!$rejectedBill->logistic!!},
+                fee_collected:'{{$rejectedBill->fee_collected}}',goods_amount:'{{$rejectedBill->goods_amount}}',
+                is_loaded:'{{$rejectedBill->is_loaded_null}}',operator_name:'{{$rejectedBill->operator_name}}',detailFolding:true,
+                items:{!! $rejectedBill->items !!},is_finished:'{{$rejectedBill->is_finished}}',remark:'{{$rejectedBill->remark}}'
+            },
+            @endforeach
+        ];
+        let owners=[
+                @foreach($owners as $owner)
+            {id:'{{$owner->id}}',name:'{{$owner->name}}'},
+            @endforeach
+        ];
+        let qualityLabels=[
+                @foreach($qualityLabels as $qualityLabel)
+            {id:'{{$qualityLabel->id}}',name:'{{$qualityLabel->name}}'},
+            @endforeach
+        ];
+            @if(isset($paginateParams))
+        let paginateParams={!! json_encode($paginateParams) !!};
+            @endif
+        let total='{{$rejectedBills->total()}}';
+        let editUrl = "{{url('rejectedBill')}}/";
+        let destroyUrl = "{{url('rejectedBill')}}/";
+        let ajaxConfirmBeStoredUrl = '{{url("apiLocal/rejectedBill/apiConfirmBeStored")}}';
+        let ajaxCheckUrl = '{{url("apiLocal/rejectedBill/apiSetIsLoadedAll")}}';
+        let ajaxCheckAllURL = '{{url("rejected/ajaxCheckAll")}}';
+        let ajaxFinishAllUrl='{{url("rejected/ajaxFinishAll")}}';
+        let exportExcelURL = '{{url("rejected/exportExcel")}}';
+        let exportExcelOnFilterParamsURL='{{url("rejected/exportExcelOnFilterParams")}}';
+        let csrfInput='@csrf';
+    </script>
+    <script src="{{asset('js/singles/rejectedIndex200513.js')}}"></script>
+@endsection

+ 14 - 0
resources/views/rejected/search/menu.blade.php

@@ -0,0 +1,14 @@
+<div class="container-fluid nav3">
+    <div class="card menu-third">
+        <ul class="nav nav-pills">
+            @can('退货管理-一般')
+                <li class="nav-item">
+                    <a class="nav-link" href="{{url('rejected/index/general')}}" :class="{active:isActive('general',3)}">一般</a>
+                </li> @endcan
+            @can('退货管理-统计')
+                <li class="nav-item">
+                    <a class="nav-link" href="{{url('rejected/index/analyze')}}" :class="{active:isActive('analyze',3)}">统计</a>
+                </li> @endcan
+        </ul>
+    </div>
+</div>

+ 6 - 0
routes/web.php

@@ -107,6 +107,12 @@ Route::post('rejected/ajaxFinishAll', 'RejectedController@ajaxFinishAll');
 Route::post('rejected/exportExcel', 'RejectedController@exportExcel');
 Route::post('rejected/exportExcelOnFilterParams', 'RejectedController@exportExcelOnFilterParams');
 Route::resource('rejected', 'RejectedController');
+Route::any('rejected/index/general','RejectedController@indexGeneral');  // 一般查询
+Route::any('rejected/index/analyze','RejectedController@indexAnalyze');  // 统计查询
+Route::post('rejected/analyze/exportExcelOnParams', 'RejectedController@exportExcelOnParams');
+Route::post('rejected/analyze/exportAllExcelOnParams', 'RejectedController@exportAllExcelOnParams');
+
+
 
 Route::get('maintenance/', function () {return view('maintenance.index');});
 Route::any('package/measureMonitor/speech','MeasureMonitorController@speech');

+ 2 - 0
webpack.mix.js

@@ -14,6 +14,8 @@ const mix = require('laravel-mix');
 mix.js('resources/js/app.js', 'public/js')
     .sass('resources/sass/app.scss', 'public/css/app200519b.css');
 mix.js('resources/js/singles/rejectedIndex.js', 'public/js/singles/rejectedIndex200513.js');
+mix.js('resources/js/singles/searchAnalyze.js', 'public/js/singles/searchAnalyze200513.js');
+
 mix.copy('resources/sass/fonts/','public/fonts');
 mix.copy('resources/icon','public/icon');
 mix.copy('resources/images','public/images');