Просмотр исходного кода

Merge branch 'zzd'

# Conflicts:
#	resources/views/rejected/recycle.blade.php
LD 5 лет назад
Родитель
Сommit
144f2927d5

+ 9 - 1
app/Http/Controllers/InventoryController.php

@@ -75,7 +75,15 @@ class InventoryController extends Controller
         if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
         if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
         if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
-        if ($descr_c)$sql.=" and 货主 ='".$descr_c."' ";
+        if ($descr_c){
+            $sql .= ' and 货主 in (';
+            $descr_cs = explode(',',$descr_c);
+            foreach ($descr_cs as $index => $descr_c){
+                if ($index != 0)$sql .= ',';
+                $sql .= "'".$descr_c."'";
+            }
+            $sql .= ') ';
+        }
         if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
         if ($page&&$paginate)$sql.="  and ROWNUM<='".$page*$paginate."'";
         $sql.=' )  ';

+ 4 - 15
app/Http/Controllers/RejectedController.php

@@ -471,32 +471,21 @@ class RejectedController extends Controller
     {
         $searchParams = [
             'owner_id' => $request->input('owner_id'),
-            'ids'=> $request->input('ids'),
+            'data'=> $request->input('data'),
             '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){
+    //统计页导出
+    public function exportAnalyze(Request $request){
         ini_set('max_execution_time',2500);
         ini_set('memory_limit','1526M');
-        $searchParams = $this->getAnalyzeSearchParams($request);
         $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');
     }
 

+ 28 - 25
app/RejectedAnalyzeOwner.php

@@ -76,28 +76,27 @@ class RejectedAnalyzeOwner extends Model
         return $arr;
     }
 
-    // 拼接条件 没有ids     zengjun
+    // 拼接条件     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 .= '"';
+        if (isset($array['data'])){
+            $condition=RejectedAnalyzeOwner::getSqlToIDs($array['data']);
+        }else{
+            $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 .= RejectedAnalyzeOwner::getSqlToIDs($value);
+                        }
+                        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 .= '"';
+                        }
                     }
                 }
             }
@@ -108,12 +107,16 @@ class RejectedAnalyzeOwner extends Model
 
     public static function getSqlToIDs($ids):string
     {
-        $sql = '';
+        $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;
+            $ids = explode(',',$ids);
+            $sql = ' and id_owner in (';
+            foreach ($ids as $index => $id){
+                if ($index!=0)
+                    $sql .=',';
+                $sql .= $id;
+            }
+            $sql .= ') ';
         }
         return $sql;
     }

+ 1 - 1
app/Services/WaybillService.php

@@ -93,7 +93,7 @@ Class WaybillService
         if (!$request->destination) $request->offsetSet('destination', $waybill->destination);
         if ($request->destination_city_id && $waybill->destination_city_id != $request->destination_city_id) {
             $city = app(CityService::class)->find($request->destination_city_id);
-            if ($city && (mb_strpos($request->destination, $city->name) === false || mb_strpos($request->destination, $city->province_name) === false)) {
+            if ($city && $city->province_name && (mb_strpos($request->destination, $city->name) === false || mb_strpos($request->destination, $city->province_name) === false)) {
                 if (mb_strpos($request->destination, $city->name) === false && mb_strpos($request->destination, $city->province_name) === false) {
                     $request->offsetSet('destination', $city->province_name . $city->name . $request->destination);
                     goto sign;

+ 1 - 1
resources/js/queryForm/export.js

@@ -11,7 +11,7 @@ function excelExport(checkAllSign,checkData,url,sum,token) {
         location.href=url;
     }else {
         if (checkData && checkData.length <= 0) {
-            tempTip.setDuration(4000);
+            tempTip.setDuration(3000);
             tempTip.showSuccess('没有勾选任何记录');
         } else {
             let form=$('<form hidden method="post" target="_blank" action="'+url+'">' +

+ 3 - 35
resources/js/queryForm/queryForm.js

@@ -6,6 +6,7 @@ const query = function getQueryForm(data) {
         this.url = data.url || getPathname();
         this.condition = data.condition;
         this.paginations = [50, 100, 200, 500,1000] || data.paginations;
+        this.isPaginations = data.isPaginations;
         this.keydownfun = data.keydownfun || undefined;
         this.selectChange = data.selectChange || undefined;
         this.searchClick = data.searchClick || undefined;
@@ -20,7 +21,6 @@ const query = function getQueryForm(data) {
         this.autoSubmit = (data.autoSubmit === false) ? false : true ;
         this.param = data.param || [];
 
-
         // 提交表单
         this.onsubmit = function () {
             if(!this.autoSubmit){
@@ -202,7 +202,8 @@ const query = function getQueryForm(data) {
 
     // create _pagination
     function createPagination() {
-        _pagination = $("<select id='paginate' name='paginate' class='form-control form-control-sm' style='vertical-align: middle; max-width: 150px;'></select>");
+        let isPaginations = _this.isPaginations ? '' : 'hidden';
+        _pagination = $("<select id='paginate' "+isPaginations+" name='paginate' class='form-control form-control-sm' style='vertical-align: middle; max-width: 150px;'></select>");
         let tr = $("<tr ><td colspan='10'><div class='col p-0' style='height: 100%'></div></td></tr>");
         tr.find('div').append(_pagination);
         _this.paginations.forEach(function (map) {
@@ -1030,39 +1031,6 @@ const query = function getQueryForm(data) {
                 $(_form).find("input[name='" + key + "']").val(value.substr(0, 10));
                 $(_form).find("input[id='" + key + "_min']").val(value.substr(11, value.length));
             }
-
-            /*  if (['input', 'dataTime', 'input_input', 'dataTime_dataTime'].includes(type)) {
-                  rendererSearchFormOnInput(key,value,mold);
-              } else if (['select', 'input_select', 'dataTime_select'].includes(type)) {
-                  if (mold === 'select') {
-                      rendererSearchFormOnSelect(key,value,mold)
-                  } else if (mold === 'input') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  } else if (mold === 'dataTime') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  }
-              } else if (['input_select_text'].includes(type)) {
-                  if (mold === 'input') {
-                      rendererSearchFormOnInput(key,value,mold);
-                  } else if (mold === 'select') {
-                      rendererSearchFormOnSelect(key,value,mold)
-                  }
-              } else if (['checkbox'].includes(type)) {
-                  if (controlJsType(value, 'array')) {
-                      value.forEach(function (map) {
-                          $(_form).find("input[type='checkbox'][name='" + key + "'][value='" + map + "']").attr("checked", true);
-                      })
-                  }
-              } else if (['select_multiple_select'].includes(type)) {
-                  if (controlJsType(value, ['array','string']) ) {
-                      let ul = $(_form).find("ul[name='" + key + "']");
-                      redenerUl(ul);
-                      rendererSearchFormOnMultipleSelect(key,value,mold);
-                  }
-              } else if (['time'].includes(type) && value !== undefined) {
-                  $(_form).find("input[name='"+key+"']").val(value.substr(0,10));
-                  $(_form).find("input[id='"+key+"_min']").val(value.substr(11,value.length));
-              }*/
         }
         if ([undefined, null, ''].includes(data['paginate'])) {
             return;

+ 14 - 7
resources/views/process/index.blade.php

@@ -358,8 +358,8 @@
                                             class="btn btn-sm btn-outline-dark">@{{ dateTextMap.end_date }}</button>
                                     <div v-if="is_update_date">
                                         <input type="date" class="form-control form-control-sm" :class="is_update_date=='start_date' ? 'text-info border-info':''"
-                                               style="width: 137px" v-model="date" :max="today"
-                                               :min="is_update_date=='end_date' ? processDailyParticipants[(processDailyParticipants.length)-1].date : ''">
+                                               style="width: 137px" v-model="date" :max="is_update_date=='start_date'&&processDailyParticipants.length>0 ? processDailyParticipants[0].date : ''"
+                                               :min="is_update_date=='end_date'&&processDailyParticipants.length>0 ? processDailyParticipants[(processDailyParticipants.length)-1].date : ''">
                                         <button type="button" @click="update_process_date(processDailyParticipants[0])" class="btn btn-sm btn-outline-success">确定</button>
                                         <button type="button" @click="is_update_date='';dateTextMap.end_date='终';dateTextMap.start_date='起'" class="btn btn-sm btn-outline-danger">取消</button>
                                     </div>
@@ -385,7 +385,7 @@
                                 <td v-if="processDailyParticipant.rowspan"  :rowspan="processDailyParticipant.rowspan">
                                     <div  class="form-inline">
                                         <input :readonly="processDailyParticipant.readonly" v-model="processDailyParticipant.submitOutput"
-                                               class="form-control col-sm-5 " @click="processDailyParticipant.id?processDailyParticipant.readonly=false:processDailyParticipant.readonly=true" type="text" />
+                                               class="form-control col-sm-5 " @click="updateOutput(processDailyParticipant)" type="text" />
                                         @can("二次加工管理-登记工时")<button class="btn btn-sm btn-success" v-if="! processDailyParticipant.readonly" @click="submitOutputData(processDailyParticipant.daily_id,processDailyParticipant.submitOutput,processDailyParticipant.id)">确定</button>
                                         <button class="btn btn-sm btn-danger" v-if="! processDailyParticipant.readonly" @click="processDailyParticipant.readonly=true;processDailyParticipant.submitOutput=processDailyParticipant.output">取消</button>
                                         @endcan
@@ -520,7 +520,6 @@
                 signs:[],
                 is_update_date:false,
                 date:'',
-                today:'',
                 dateTextMap:{'start_date':'起','end_date':'终'},
                 sum:{!! $processes->total() !!},
             },
@@ -540,8 +539,6 @@
                 this.resetProcessData();
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#process').removeClass('d-none');
-                let today=new Date();
-                this.today = today.getFullYear() + "-" + ((today.getMonth() + 1) < 10 ? "0"+(today.getMonth() + 1) : (today.getMonth() + 1)) + "-" + today.getDate();
                 function focusin() {
                     if(isJustBack())location.reload();
                 }
@@ -1431,7 +1428,7 @@
                             if (response.data.success) {
                                 process.signs.push(response.data.sign);
                                 process.is_update_unit_price = false;
-                                process.unit_price = unit_price;
+                                process.signUnitPrice = unit_price;
                                 tempTip.setDuration(2000);
                                 tempTip.showSuccess('“' + process.code + "”价格修改成功,确认通过后生效!");
                                 return;
@@ -1464,6 +1461,7 @@
                                     _this.signs[process.code]=[];
                                     process.signs=[];
                                     process.unit_price = process.signUnitPrice;
+                                    process.signUnitPrice = '';
                                 }
                                 if (process.is_update_unit_price)process.is_update_unit_price = false;
                                 tempTip.setDuration(2000);
@@ -1568,6 +1566,15 @@
                     let newValue=Number(processDailyParticipantOne.dinner_duration) / 60;
                     processDailyParticipantOne.hour_count += (oldValue-newValue);
                 },
+                //修改每日产量
+                updateOutput(processDailyParticipant){
+                    if (processDailyParticipant.id) processDailyParticipant.readonly=false;
+                    else {
+                        tempTip.setDuration(3000);
+                        tempTip.show('该日无参与人加工信息,请先录入参与人加工信息!');
+                        processDailyParticipant.readonly=true;
+                    }
+                }
             },
         });
     </script>

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

@@ -257,7 +257,7 @@
                         order_number:'{{$rejectedBill->order_number}}',sender:'{{$rejectedBill->sender}}',
                         is_hide:false,
                         mobile_sender:'{{$rejectedBill->mobile_sender}}',logistic_number:'{{$rejectedBill->logistic_number}}',
-                        logistic_number_return:'{{$rejectedBill->logistic_number_return}}',logistic:{!!$rejectedBill->logistic??''!!},
+                        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}}',

+ 112 - 139
resources/views/rejected/search/analyze.blade.php

@@ -6,150 +6,123 @@
         @component('rejected.menu')@endcomponent
         @component('rejected.search.menu')@endcomponent
     </div>
-    <div class="container-fluid">
-        <div >
-            <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 class="text-muted">退件数</th>
-                        <th class="text-success font-weight-bold">审核数</th>
-                        <th>未审核数</th>
-                        <th class="text-success font-weight-bold">入库数</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.owner_name }}
-                        </td>
-                        <td class="text-muted">
-                            @{{ rejectedBill.bounce_amount }}
-                        </td>
-                        <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.check_amount }}
-                        </td>
-                        <td>
-                            @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
-                        </td>
-                        <td class="text-success font-weight-bold">
-                            @{{ rejectedBill.in_storage_count }}
-                        </td>
-                        <td>
-                            @{{ rejectedBill.not_in_storage_count }}
-                        </td>
-                    </tr>
-                </table>
+    <div class="container-fluid" id="list">
+        <div id="form_div"></div>
+        <span class="dropdown m-1">
+            <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(false)"
+                   href="javascript:">导出勾选内容</a>
+                <a class="dropdown-item" @click="exportExcel(true)"
+                   href="javascript:">导出所有页</a>
             </div>
-        </div>
+        </span>
+        <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 class="text-muted">退件数</th>
+                <th class="text-success font-weight-bold">审核数</th>
+                <th>未审核数</th>
+                <th class="text-success font-weight-bold">入库数</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_owner">
+                </td>
+                <td class="text-muted" style="opacity:0.7">
+                    @{{ index+1 }}
+                </td>
+                <td>
+                    @{{ rejectedBill.owner_name }}
+                </td>
+                <td class="text-muted">
+                    @{{ rejectedBill.bounce_amount }}
+                </td>
+                <td class="text-success font-weight-bold">
+                    @{{ rejectedBill.check_amount }}
+                </td>
+                <td>
+                    @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
+                </td>
+                <td class="text-success font-weight-bold">
+                    @{{ rejectedBill.in_storage_count }}
+                </td>
+                <td>
+                    @{{ rejectedBill.not_in_storage_count }}
+                </td>
+            </tr>
+        </table>
     </div>
 @endsection
 
 @section('lastScript')
+    <script src="{{asset('js/queryForm/export.js')}}"></script>
+    <script src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
     <script>
-        // 数据
-        let rejectedBills = {!! $rejectedBills !!};
-
-        //  客户
-        let owners = {!! $owners !!};
-        let qualityLabels = {!! $qualityLabels !!};
-            @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>
+        new Vue({
+            el:"#list",
+            data:{
+                rejectedBills : {!! $rejectedBills !!},
+                checkBoxAll:[],
+                sum : '{{count($rejectedBills)}}',
+                rejectedBills_checkBoxes:[],
+                owners:[
+                    @foreach($owners as $owner)
+                    {name:'{{$owner->id}}',value:'{{$owner->name}}'},
+                    @endforeach
+                ],
+            },
+            mounted:function(){
+                $(".tooltipTarget").tooltip({'trigger':'hover'});
+                $('#list').removeClass('d-none');
+                let data=[
+                    [
+                        {name:'created_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
+                        {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
+                            placeholder:['货主','定位或多选货主'],data:this.owners},
+                    ],[
+                        {name:'created_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                    ]
+                ];
+                this.form=new query({
+                    el:"#form_div",
+                    condition:data,
+                    isPaginations:false,
+                });
+                this.form.init();
+            },
+            methods:{
+                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_owner);
+                            _this.checkBoxAll=[1];
+                        });
+                    }
+                },
+                exportExcel:function(checkAllSign){
+                    let url = '{{url('rejected/exportAnalyze')}}';
+                    let token='{{ csrf_token() }}';
+                    excelExport(checkAllSign,this.rejectedBills_checkBoxes,url,this.sum,token);
+                },
+            },
+        });
     </script>
-    <script src="{{asset('js/singles/searchAnalyze200513.js')}}"></script>
 @endsection

+ 2 - 3
routes/web.php

@@ -109,11 +109,10 @@ Route::post('rejected/ajaxCheck', 'RejectedController@ajaxCheck');
 Route::post('rejected/ajaxCheckAll', 'RejectedController@ajaxCheckAll');
 Route::post('rejected/ajaxFinishAll', 'RejectedController@ajaxFinishAll');
 Route::any('rejected/export', 'RejectedController@export');
-Route::resource('rejected', 'RejectedController');
 Route::any('rejected/index/general','RejectedController@index');  // 一般查询
 Route::any('rejected/index/analyze','RejectedController@indexAnalyze');  // 统计查询
-Route::post('rejected/analyze/exportExcelOnParams', 'RejectedController@exportExcelOnParams');
-Route::post('rejected/analyze/exportAllExcelOnParams', 'RejectedController@exportAllExcelOnParams');
+Route::any('rejected/exportAnalyze', 'RejectedController@exportAnalyze');
+Route::resource('rejected', 'RejectedController');