Zhouzhendong 5 年之前
父节点
当前提交
61a35ddc70

+ 2 - 0
app/Http/Controllers/OrderController.php

@@ -63,6 +63,8 @@ class OrderController extends Controller
         if ($notes){
             if ($addtime&&$addtime!=0)$sql.=" and addtime >= '".date('Y-m-d H:i:s',strtotime("-".$addtime." day"))."'";
             $sql.=" and notes like '%".$notes."%'";
+        }else{
+            unset($request->addtime);
         }
         if ($soreference5){
             $arr=array_filter(preg_split('/[,, ]+/is', $soreference5));

+ 9 - 56
app/Http/Controllers/PackageController.php

@@ -215,65 +215,18 @@ class PackageController extends Controller
         return $logistics;
     }
 
-    /**
-     * Display the specified resource.
-     *
-     * @param  \App\Package  $packages
-     * @return \Illuminate\Http\Response
-     */
-    public function show(Package $packages)
-    {
-        //
-    }
-
-    /**
-     * Show the form for editing the specified resource.
-     *
-     * @param  \App\Package  $packages
-     * @return \Illuminate\Http\Response
-     */
-    public function edit(Package $packages)
-    {
-        //
-    }
-
-    /**
-     * Update the specified resource in storage.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \App\Package  $packages
-     * @return \Illuminate\Http\Response
-     */
-    public function update(Request $request, Package $packages)
-    {
-        //
-    }
-
-    /**
-     * Remove the specified resource from storage.
-     *
-     * @param  \App\Package  $packages
-     * @return \Illuminate\Http\Response
-     */
-    public function destroy(Package $packages)
-    {
-        //
-    }
-
-    public function export($id,Request $request){
+    public function export(Request $request){
         if(!Gate::allows('称重管理-查询')){ return '没有权限';  }
         ini_set('max_execution_time',3500);
         ini_set('memory_limit','3526M');
-        if ($id==-1){
-            $id=[];
-            $packages=Package::select('id');
+        $packages=Package::query();
+        if ($request->checkAllSign){
             $packages=$this->conditionQuery($request,$packages);
             $packages=$packages->get();
-            foreach ($packages as $package){
-                array_push($id,$package->id);
-            }
-        }else $id = explode( ',',$id);
-        if (!$id)return ;
+        }else{
+            $id = explode( ',',$request->data);
+            $packages=$packages->whereIn('id',$id)->get();
+        }
         $row=[[
             'id'=>'ID',
             'owner_name'=>'货主',
@@ -295,8 +248,8 @@ class PackageController extends Controller
             'status'=>'状态',
         ]];
         $list=[];
-        for ($i=0; $i<count($id);$i++){
-            $package=Package::find($id[$i]);
+        for ($i=0; $i<count($packages);$i++){
+            $package=$packages[$i];
             $w=[
                 'id'=>isset($package->id)?$package->id:'',
                 'owner_name'=>isset($package->owner_name)?$package->owner_name:'',

+ 4 - 3
app/Http/Controllers/WaybillsController.php

@@ -624,18 +624,19 @@ class WaybillsController extends Controller
         return ['success'=>true];
     }
 
-    public function waybillExport($id,Request $request){
+    public function waybillExport(Request $request){
         if(!Gate::allows('运输管理-查询')){ return '没有权限';  }
         ini_set('max_execution_time',2500);
         ini_set('memory_limit','1526M');
+        $exportType=$request->exportType;
         $waybills=Waybill::with(['owner', 'waybillAuditLogs' => function ($query) {
             $query->with('user');
         }]);
-        if ($id==-1){
+        if ($exportType=='all'){
             $waybills=$this->conditionQuery($request,$waybills);
             $waybills=$waybills->get();
         }else {
-            $id = explode( ',',$id);
+            $id = explode( ',',$request->data);
             $waybills=$waybills->whereIn('id',$id)->get();
         };
         $row=[[

+ 5 - 0
package-lock.json

@@ -5805,6 +5805,11 @@
                 "webpack-sources": "^1.1.0"
             }
         },
+        "layer": {
+            "version": "0.1.0",
+            "resolved": "https://registry.npm.taobao.org/layer/download/layer-0.1.0.tgz",
+            "integrity": "sha1-dvirzO7Cfw+vtsUjYndJxrTsihw="
+        },
         "lcid": {
             "version": "2.0.0",
             "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-2.0.0.tgz",

+ 123 - 0
public/js/app.js

@@ -26029,6 +26029,127 @@ var Echo = /*#__PURE__*/function () {
 /* harmony default export */ __webpack_exports__["default"] = (Echo);
 
 
+/***/ }),
+
+/***/ "./node_modules/layer/index.js":
+/*!*************************************!*\
+  !*** ./node_modules/layer/index.js ***!
+  \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var layer = {};
+
+if ( true && module.exports) layer._isNode = true;
+(layer._isNode) ? layer._default_context = {} : layer._default_context = this;
+
+layer._find_context = function(context, actual) {
+  var props = Object.keys(context);
+  for (var i = 0, l = props.length; i < l; i++) {
+    var orig = context[props[i]];
+    if (orig && orig === actual) {
+      //var orig_arg_len = context[props[i]].length;
+      return [context, props[i]];
+    }
+  }
+  throw new Error('Unable to find context');
+}
+
+layer._call = function(ctx, fn, args) {
+  var ret;
+  switch(args.length) {
+    case 0:
+      ret = fn.call(ctx);
+      break;
+    case 1:
+      ret = fn.call(ctx, args[0]);
+      break;
+    case 2:
+      ret = fn.call(ctx, args[0], args[1]);
+      break;
+    case 3:
+      ret = fn.call(ctx, args[0], args[1], args[2]);
+      break;
+    case 4:
+      ret = fn.call(ctx, args[0], args[1], args[2], args[3]);
+      break;
+    default:
+      ret = fn.apply(ctx, args);
+      break;
+  }
+  return ret;
+}
+
+layer.set = function(context, actual, proxy) {
+  var completed = false;
+  if (!context) context = layer._default_context;
+  var ctx = this._find_context(context, actual, this._context_level);
+  if (ctx) {
+    var orig = ctx[0][ctx[1]];
+    ctx[0][ctx[1]] = function () {
+      var fns = [proxy, orig];
+      return function() {
+        var idx, args = arguments, ret;
+        function next() {
+          var r;
+          if (idx === undefined) {
+            idx = 0;
+          } else {
+            idx += 1;
+            args = arguments;
+          }
+          // last stop
+          if (fns.length === idx + 1) {
+            r = layer._call(ctx[0], fns[idx], args);
+          } else {
+            // avoid using array slice, this is faster
+            var alen = args.length;
+            args[alen] = next;
+            args.length = alen + 1;
+            r = layer._call(ctx[0], fns[idx], args);
+          }
+          if (r) ret = r;
+        };
+        next();
+        return ret;
+      }
+    }();
+    ctx[0][ctx[1]].skip = orig;
+    ctx[0][ctx[1]].skip._context = ctx[0];
+    completed = true;
+  }
+  if (!completed) throw new Error('Could not set proxy');
+}
+
+layer.unset = function(proxy) {
+  var completed = false;
+  var orig = proxy.skip;
+  if (proxy.skip && proxy.skip._context) {
+    var ctx = this._find_context(proxy.skip._context, proxy, this._context_level);
+    if (ctx) {
+      if (orig._context) delete(orig._context);
+      ctx[0][ctx[1]] = orig;
+      completed = true;
+    }
+  }
+  if (!completed) throw new Error('Could not unset proxy');
+}
+
+layer.replace = function(context, actual, newFn) {
+  var completed = false;
+  var ctx = this._find_context(context, actual, this._context_level);
+  if (ctx) {
+    ctx[0][ctx[1]] = newFn;
+    completed = true;
+  }
+  if (!completed) throw new Error('Could not replace function');
+}
+
+if (layer._isNode) module.exports = layer;
+
 /***/ }),
 
 /***/ "./node_modules/lodash/lodash.js":
@@ -61628,6 +61749,8 @@ module.exports = yeast;
 
 __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
 
+__webpack_require__(/*! layer */ "./node_modules/layer/index.js");
+
 window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
 window.tempTip = __webpack_require__(/*! ./utilities/tempTip */ "./resources/js/utilities/tempTip.js");
 window.getGetVal = __webpack_require__(/*! ./utilities/getGetVal */ "./resources/js/utilities/getGetVal.js");

+ 43 - 41
resources/js/queryForm/queryForm.js

@@ -1,8 +1,6 @@
-//let cookie = require('jquery.cookie');
-
 const query = function getQueryForm(data) {
     {
-        this.el = data.el || '#from_div';
+        this.el = data.el || '#form_div';
         this.form = data.form;
         this.method = data.method || 'get';
         this.url = data.url || getPathname();
@@ -12,15 +10,19 @@ const query = function getQueryForm(data) {
         this.selectChange = data.selectChange || undefined;
         this.searchClick = data.searchClick || undefined;
         this.selectfun = data.selectfun || undefined;
-        this._onsubmit = data._onsubmit || true;
+        this._onsubmit = data._onsubmit || undefined;
         this.keydownSearch = data.keydownSearch || true;
         this.selectChangeSearch = data.selectChangeSearch || true;
         this.tip = data.tip || '';
-        this.nextPage = nextPage();
-        this.pervPage = pervPage();
-
+        this.nextPage = nextPage;
+        this.pervPage = pervPage;
+        this.getSearchData = getSearchData;
+        this.autoSubmit = (data.autoSubmit === false) ? false : true ;
         // 提交表单
         this.onsubmit = function () {
+            if(!this.autoSubmit){
+                return;
+            }
             saveSearchOnCookie();
             let form = $("<form method=" + _this.method + " ></form>");
             for (const key in _data) {
@@ -49,7 +51,7 @@ const query = function getQueryForm(data) {
     let _data = {};
     let _form = [];
     let _table = null;
-    let _clearBtn = null;
+    let _clearTr = null;
     let _pagination = null;
     let _baseData = data;
     let _searchBtn = null;
@@ -138,11 +140,11 @@ const query = function getQueryForm(data) {
             conditions.forEach(function (condition, index, array) {
                 if (['input', 'select', 'dataTime', 'input_select'].includes(condition.type)) {
                     _width += 260;
-                } else if (['dataTime_DataTime', 'input_input'].includes(condition.type)) {
+                } else if (['dataTime_dataTime', 'input_input'].includes(condition.type)) {
                     _width += 330;
                 } else if (['select_multiple_select','search_select'].includes(condition.type)) {
                     _width += 280;
-                } else if (['check'].includes(condition.type)) {
+                } else if (['checkbox'].includes(condition.type)) {
                     _width += 260;
                 } else if (['time', 'dataTime_select'].includes(condition.type)) {
                     _width += 320;
@@ -165,15 +167,14 @@ const query = function getQueryForm(data) {
 
     // 清空过滤条件按钮
     function crateClearBtn() {
-        let label = $("<label class='col-form-label col-sm-2 p-0'></label>");
-        _clearBtn = $("<span class='btn btn-warning text-dark invisible'>清除过滤条件</span>");
-        _clearBtn.click(function () {
+        let clearbtn = $("<button type='button' class='btn btn-warning text-dark '>清除过滤条件</button>");
+        clearbtn.click(function () {
             clearData();
             visibleClearBtn();
         })
-        let tr = $("<tr ><td colspan='10'  style='height: 45px'></td></tr>");
-        tr.find('td').append(label);
-        label.append(_clearBtn);
+        let tr = $("<tr ><td colspan='10'></td></tr>");
+        tr.find('td').append(clearbtn);
+        _clearTr  = tr;
         return tr;
     }
 
@@ -183,14 +184,14 @@ const query = function getQueryForm(data) {
         let div = $("<div class='form-inline'></div>");
         div.append(_searchBtn);
         _searchBtn.click(function () {
-
             if (controlJsType(_this.searchClick, 'fun')) {
                 _this.searchClick();
             }
-            if (_this._onsubmit) {
+            if (controlJsType(_this._onsubmit, 'fun')) {
+                _this._onsubmit();
+            }else{
                 _this.onsubmit();
             }
-            _this.onsubmit();
         })
         return div;
     }
@@ -306,7 +307,7 @@ const query = function getQueryForm(data) {
 
     // input
     function getInput(condition) {
-        let input = $("<input name='" + condition.name + "' class='form-control form-control-sm' style='vertical-align: middle; max-width: 200px;' placeholder='" + condition.placeholder + "' data-toggle='tooltip' data-placement='top' >");
+        let input = $("<input name='" + condition.name + "' class='form-control form-control-sm' style='vertical-align: middle; max-width: 200px;' placeholder='" + condition.placeholder + "' autocomplete='off' data-toggle='tooltip' data-placement='top' >");
         input.attr('title', condition.tip === undefined ? '' : condition.tip);
         input.on('input', function () {
             let dom = {name: condition.name, type: 'input', value: this.value, mold: 'input'}
@@ -364,7 +365,7 @@ const query = function getQueryForm(data) {
     // input_select
     function getInputSelect(condition) {
         let div = $("<div class='form-inline'></div>");
-        let input = $("<input class='form-control form-control-sm' name='" + condition.name[0] + "' placeholder='" + condition.placeholder[0] + "' autocomplete='off' style='max-width: 100px;' data-toggle='tooltip' data-placement='top' >");
+        let input = $("<input class='form-control form-control-sm' name='" + condition.name[0] + "' placeholder='" + condition.placeholder[0] + "' autocomplete='off' style='max-width: 120px;' data-toggle='tooltip' data-placement='top' >");
         input.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
         let select = $("<select class='form-control form-control-sm ml-2' name='" + condition.name[1] + "'  style='max-width: 200px;' title='" + condition.tip[1] + "''>");
         fillSelectOption(select, condition.data);
@@ -381,7 +382,7 @@ const query = function getQueryForm(data) {
 
     // datTime
     function getDataTime(condition) {
-        let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='max-width: 200px' data-toggle='tooltip' data-placement='top' title='" + condition.tip + "' style='width: 200px'>");
+        let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name + "'  style='max-width: 150px' data-toggle='tooltip' data-placement='top' title='" + condition.tip + "' style='width: 200px'>");
         dataTime.attr('title', controlJsType(condition.tip, 'undefined') ? '' : condition.tip);
         dataTime.bind('input propertychange', function () {
             let dom = {name: condition.name, type: 'dataTime', value: this.value, mold: 'dataTime'};
@@ -411,8 +412,8 @@ const query = function getQueryForm(data) {
                 return;
             }
 
-            let value = ['null', 'undefined', ''].includes(dataTime.val()) ? '' : dataTime + ' ' + min.val();
-            // let value = dataTime.value !== '' ? dataTime.value + ' ' + (min.value === '' ? '00:00' : min. value) : '';
+            let value = ['null', 'undefined', ''].includes(dataTime.val()) ? '' : dataTime.val() + ' ' + min.val();
+            //let value = dataTime.value !== '' ? dataTime.value + ' ' + (min.value === '' ? '00:00' : min. value) : '';
             let dom = {name: condition.name, type: 'time', value: value, mold: 'time'};
             modifyData(dom);
         })
@@ -464,7 +465,7 @@ const query = function getQueryForm(data) {
         let dataTime = $("<input type='date' class='form-control form-control-sm' name='" + condition.name[0] + "'  style='max-width: 150px;' data-toggle='tooltip' data-placement='top' >");
         dataTime.attr('title', controlJsType(condition.tip[0], 'undefined') ? '' : condition.tip[0]);
 
-        let select = $("<select name='" + condition.name[1] + "' class='form-control form-control-sm ' data-toggle='tooltip' data-placement='top' style='max-width: 75px'></select>");
+        let select = $("<select name='" + condition.name[1] + "' class='form-control form-control-sm ml-2' data-toggle='tooltip' data-placement='top' style='max-width: 100px'></select>");
         select.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
 
         fillSelectOption(select, condition.data)
@@ -559,7 +560,7 @@ const query = function getQueryForm(data) {
         condition.data.forEach(function (map, index) {
             let div = $('<div class="custom-control custom-control-inline custom-checkbox"></div>');
             let checkbox = $("<input type='checkbox' name='" + condition.name + "' class='custom-control-input' id='" + condition.name + index + "' value='" + map.name + "' >");
-            let label = $("<label class='custom-control-label' for='" + condition.name + index + "'>" + map.value + "</label>")
+            let label = $("<label class='custom-control-label text-left font-weight-norma' for='" + condition.name + index + "'>" + map.value + "</label>")
             div1.append(div.append(checkbox).append(label));
             checkbox.click(function () {
                 let value = [];
@@ -586,7 +587,7 @@ const query = function getQueryForm(data) {
             select.append(option);
         }
         data.forEach(function (map) {
-            let option = $("<option value='" + map.name + "'>" + map.value + "</optio>");
+            let option = $("<option value='" + map.value + "'>" + map.name + "</optio>");
             select.append(option);
         })
         if (data !== undefined) {
@@ -661,7 +662,7 @@ const query = function getQueryForm(data) {
         for (const key in _data) {
             if (!['', null, undefined].includes(_data[key].value)) {
                 if (controlJsType(_data[key].value, 'array') && _data[key].value.length === 0) {
-                    console.log(key);
+                    //console.log(key);
                     continue;
                 }
                 saveData[key] = {
@@ -720,7 +721,7 @@ const query = function getQueryForm(data) {
     }
 
     // get search data
-    this.getSearchData = function (type = 'array') {
+    function getSearchData(type = 'array') {
         let data = {};
         if (type === 'array') {
             for (let key in _data) {
@@ -766,7 +767,7 @@ const query = function getQueryForm(data) {
             }
         } else {
             $(_form).find("select[name='" + key + "']").val(value);
-            console.log(value === _this.paginations[0]);
+            //console.log(value === _this.paginations[0]);
             if (key === 'paginate' && value == _this.paginations[0]) {
                 return;
             }
@@ -856,10 +857,10 @@ const query = function getQueryForm(data) {
             }
         }
         if (bool) {
-            _clearBtn.addClass('visible').removeClass('invisible');
+            _clearTr.show();
 
         } else {
-            _clearBtn.addClass('invisible').removeClass('visible');
+            _clearTr.hide();
         }
     }
 
@@ -909,7 +910,7 @@ const query = function getQueryForm(data) {
     function switchData() {
         _this.condition.forEach(function (conditions) {
             conditions.forEach(function (condition) {
-                if (['input', 'select', 'dataTime', 'search_select', 'time', 'select_multiple_select'].includes(condition.type)) {
+                if (['input', 'select', 'dataTime', 'search_select', 'time', 'select_multiple_select','checkbox'].includes(condition.type)) {
                     if (!condition.select) {
                         condition.select = '';
                     }
@@ -959,7 +960,7 @@ const query = function getQueryForm(data) {
     }
 
     function rendererOptionOnCookie() {
-        console.log('rendererSearchFromOnCookie');
+        //console.log('rendererSearchFromOnCookie');
         let data = fetchCookie();
         if (data === undefined) {
             return;
@@ -982,7 +983,7 @@ const query = function getQueryForm(data) {
     }
 
     function rendererSearchFormOn_data() {
-        console.log('rendererSearchFormOn_data', _data);
+        // console.log('rendererSearchFormOn_data', _data);
 
         for (let key in _data) {
             let value = _data[key].value, type = _data[key].type, mold = _data[key].mold;
@@ -1056,6 +1057,9 @@ const query = function getQueryForm(data) {
             data = (data.substr(1)).split('&');
             data = convertArrayToObj(data);
             for (const key in data) {
+                if(!data[key]){
+                    continue;
+                }
                 if (key === 'paginate') {
                     _data[key] = {
                         name: key,
@@ -1068,7 +1072,7 @@ const query = function getQueryForm(data) {
                 } else {
                     _data[key].value = data[key];
                 }
-                console.log('key', key, typeof key);
+                // console.log('key', key, typeof key);
             }
         }
     }
@@ -1111,7 +1115,7 @@ const query = function getQueryForm(data) {
 
     //  paginate
     function pervPage() {
-        let obj = getSearchObj();
+        let obj = getSearchData();
         if(!!obj['page'] && obj['page']>1){
             obj['page'] = obj['page']-1;
         }
@@ -1119,7 +1123,7 @@ const query = function getQueryForm(data) {
     }
 
     function nextPage() {
-        let obj = getSearchObj();
+        let obj = getSearchData();
         if(!!obj['page'] ){
             obj['page'] = obj['page']+1;
         }else{
@@ -1159,7 +1163,7 @@ const query = function getQueryForm(data) {
     function getSearchUri(obj){
         let string = "?";
         for (const key in obj) {
-            if(controlJsType(obj[key],'string')){
+            if(controlJsType(obj[key],['string','number'])){
                 string+= key + "=" + obj[key]+'&';
             }else if( controlJsType(obj[key],'array')&&obj[key].length > 0){
                 obj[key].forEach(function(value){
@@ -1171,5 +1175,3 @@ const query = function getQueryForm(data) {
     }
 
 };
-
-//module.exports = query;

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

@@ -10,7 +10,7 @@
     <title>@yield('title') {{ config('app.name', '宝时WAS') }}</title>
     @yield('head')
     <!-- Styles -->
-    <link href="{{ asset('css/app200708.css') }}" rel="stylesheet">
+    <link href="{{ asset('css/app200721.css') }}" rel="stylesheet">
 </head>
 <body>
 <div id="app">

+ 3 - 1
resources/views/order/index/delivering.blade.php

@@ -46,6 +46,7 @@
                                 <div class="form-inline">
                                     <input style="max-width: 200px" name="notes" title="右侧选择查询范围,默认为一天内" v-model="filterData.notes" class="form-control form-control-sm tooltipTarget" placeholder="备注" autocomplete="off" :class="filterData.notes?'bg-warning':''">
                                     <select style="max-width: 100px" title="查询范围,范围越短搜索越快"  name="addtime" v-model="filterData.addtime" class="form-control form-control-sm tooltipTarget">
+                                        <option value="1">一天内</option>
                                         <option value="31">近一月</option>
                                         <option value="92">近三月</option>
                                         <option value="183">近半年</option>
@@ -255,7 +256,7 @@
             data:{
                 filterData:{
                     paginate:50,ordertime_start:'',orderdate_start:'',orderdate_end:'',ordertime_end:'',customerid:'',orderno:'',soreference5:'',codename_c:'',
-                    carriername:'',issuepartyname:'',soreference1:'',notes:'',addtime:'31',alternate_sku1:'',waveno:'',edisendflag2:'',
+                    carriername:'',issuepartyname:'',soreference1:'',notes:'',addtime:'1',alternate_sku1:'',waveno:'',edisendflag2:'',
                 },
                 page:Number('{{$page}}'),
                 maxPage:1,
@@ -361,6 +362,7 @@
                     if (this.filterData.alternate_sku1)url+="&alternate_sku1="+this.filterData.alternate_sku1;
                     if (this.filterData.waveno)url+="&waveno="+this.filterData.waveno;
                     if (this.filterData.edisendflag2) url+="&edisendflag2="+this.filterData.edisendflag2;
+
                     window.location.href=url;
                 },
                 //提交表单

+ 83 - 182
resources/views/weight/package/index.blade.php

@@ -10,141 +10,78 @@
     <div class="d-none" id="list">
         <div class="container-fluid">
             <div id="form_div"></div>
-            <div class="">
-                <div>
-                    <form  method="GET" action="{{url('package/')}}" id="optionSubmit">
-                        <table class="table  table-sm table-bordered text-nowrap mb-0">
-                            <tr v-if="isBeingFilterConditions">
-                                <td colspan="10"><div class="col" style="padding:0">
-                                        <a  href="{{url('package')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
-                                    </div></td>
-                            </tr>
-                            <tr>
-                                <td  colspan="9">
-                                    <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control-sm" style="vertical-align: middle" @change="setPaginate">
-                                        <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 >
-                                    <input style="width: 150px" name="created_at_start" type="date" v-model="filterData.created_at_start" :class="filterData.created_at_start?'bg-warning':''" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的起始时间">
-
-                                </td>
-                                <td>
-                                    <div class="form-inline">
-                                    <input type="text" class="form-control form-control-sm tooltipTarget" placeholder="客户"
-                                           style="width:70px" @input="owner_seek"
-                                           title="输入关键词快速定位下拉列表,回车确定">
-                                    <select name="owner_id" id="owner_id" :class="filterData.owner_id?'bg-warning':''" v-model="filterData.owner_id" @change="setOwner"
-                                            class="form-control form-control-sm tooltipTarget"  title="选择要显示的客户">
-                                        @foreach($owners as $owner)
-                                            <option value="{{$owner->id}}">{{$owner->name}}</option>
-                                        @endforeach
-                                    </select>
-                                    </div>
-                                </td>
-
-                                <td>
-                                    <input :class="filterData.logistic_number?'bg-warning':''" type="text" placeholder="快递单号" title="快递单号:支持15内模糊搜索与15天外精确搜索" name="logistic_number" class="form-control form-control-sm  tooltipTarget" v-model="filterData.logistic_number" style="vertical-align: middle;max-width: 200px" ></td>
-                                {{--<td >
-                                    <input :class="filterData.delivery_number?'bg-warning':''" type="text" title="支持15内模糊搜索与15天外精确搜索" name="delivery_number" class="form-control-sm  tooltipTarget" v-model="filterData.delivery_number" style="vertical-align: middle" placeholder="发货单号"></td>--}}
-                                <td colspan="6"></td>
-                            </tr>
-                            <tr>
-                                <td>
-                                    <input style="width: 150px" type="date" name="created_at_end" v-model="filterData.created_at_end" :class="filterData.created_at_end?'bg-warning':''" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的结束时间">
-                                </td>
-                                <td >
-                                    <input type="text" title="波次号:支持15内模糊搜索与15天外精确搜索" placeholder="波次号" name="batch_number" class="form-control form-control-sm  tooltipTarget" v-model="filterData.batch_number"  :class="filterData.batch_number?'bg-warning':''" style="vertical-align: middle;max-width: 200px" ></td>
-                                <td>
-                                    <button class="btn btn-sm btn-outline-dark pull-left" type="submit">按条件搜索</button>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan="9">
-                                    <span class="dropdown">
-                                        <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
-                                                data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
-                                            导出Excel
-                                        </button>
-                                        <div class="dropdown-menu">
-                                            <a class="dropdown-item" @click="packageExport(1)" href="javascript:">导出勾选内容</a>
-                                            <a class="dropdown-item" @click="packageExport(2)" href="javascript:">导出所有页</a>
-                                        </div>
-                                    </span>
-                                    <input hidden type="submit" >
-                                </td>
-                            </tr>
-                        </table>
-                    </form>
-                </div>
-                <div class="">
-                    <table class="table table-striped table-sm text-nowrap table-hover">
-                        <tr>
-                            <th>
-                                <label for="all">
-                                    <input id="all" type="checkbox" @click="checkAll($event)">全选
-                                </label>
-                            </th>
-                            <th>序号</th>
-                            <th>ID</th>
-                            <th>货主</th>
-                            <th>快递单号</th>
-                            <th>波次号</th>
-                            <th>订单号</th>
-                            <th>物流公司</th>
-                            <th>设备</th>
-                            <th>重(KG)</th>
-                            <th>长*宽*高(cm)</th>
-                            <th>体积(cm³)</th>
-                            <th>纸箱</th>
-                            <th>状态</th>
-                            <th>波次规则</th>
-                            <th>称重时间</th>
-                            <th>收件人</th>
-                            <th>收件人电话</th>
-                        </tr>
-                        <tr v-for="(package,i) in packages">
-                            <td>
-                                <input class="checkItem" type="checkbox" :value="package.id" v-model="checkData">
-                            </td>
-                            <td>@{{ i+1  }}</td>
-                            <td class="text-muted">@{{package.id}}</td>
-                            <td>@{{package.ownerName}}</td>
-                            <td>@{{package.logisticNumber}}</td>
-                            <td class="text-muted">@{{package.batchNumber}}</td>
-                            <td>@{{package.order_code}}</td>
-                            <td class="text-muted">@{{package.logisticName}}</td>
-                            <td class="text-muted">@{{package.measuringMachineName}}</td>
-                            <td>@{{package.weight}}</td>
-                            <td>@{{package.length}}<a v-if="package.length" class="text-primary">*</a>@{{package.width}}<a class="text-primary" v-if="package.width">*</a>@{{package.height}}</td>
-                            <td>@{{package.bulk}}</td>
-                            <td>@{{package.paperBoxName}}</td>
-                            <td :class="[package.status==='已上传'?'text-success':'']">@{{package.status}}</td>
-                            <td class="text-muted">@{{package.batchRule}}</td>
-                            <td class="text-muted">@{{package.weighed_at}}</td>
-                            <td class="text-muted">@{{package.recipient}}</td>
-                            <td class="text-muted">@{{package.recipientMobile}}</td>
-                        </tr>
-                    </table>
-                    <div class="text-info h5 btn btn">{{$packages->count()}}/{{$packages->total()}}</div>
-                    @if(isset($request))
-                        {{$packages->appends($request)->links()}}
-                    @else
-                        {{$packages->links()}}
-                    @endif
+            <span class="dropdown">
+                <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget mt-1 mb-1" :class="[checkData.length>0?'btn-dark text-light':'']"
+                        data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
+                    导出Excel
+                </button>
+                <div class="dropdown-menu">
+                    <a class="dropdown-item" @click="packageExport(1)" href="javascript:">导出勾选内容</a>
+                    <a class="dropdown-item" @click="packageExport(2)" href="javascript:">导出所有页</a>
                 </div>
+            </span>
+            <div class="">
+                <table class="table table-striped table-sm text-nowrap table-hover">
+                    <tr>
+                        <th>
+                            <label for="all">
+                                <input id="all" type="checkbox" @click="checkAll($event)">全选
+                            </label>
+                        </th>
+                        <th>序号</th>
+                        <th>ID</th>
+                        <th>货主</th>
+                        <th>快递单号</th>
+                        <th>波次号</th>
+                        <th>订单号</th>
+                        <th>物流公司</th>
+                        <th>设备</th>
+                        <th>重(KG)</th>
+                        <th>长*宽*高(cm)</th>
+                        <th>体积(cm³)</th>
+                        <th>纸箱</th>
+                        <th>状态</th>
+                        <th>波次规则</th>
+                        <th>称重时间</th>
+                        <th>收件人</th>
+                        <th>收件人电话</th>
+                    </tr>
+                    <tr v-for="(package,i) in packages">
+                        <td>
+                            <input class="checkItem" type="checkbox" :value="package.id" v-model="checkData">
+                        </td>
+                        <td>@{{ i+1  }}</td>
+                        <td class="text-muted">@{{package.id}}</td>
+                        <td>@{{package.ownerName}}</td>
+                        <td>@{{package.logisticNumber}}</td>
+                        <td class="text-muted">@{{package.batchNumber}}</td>
+                        <td>@{{package.order_code}}</td>
+                        <td class="text-muted">@{{package.logisticName}}</td>
+                        <td class="text-muted">@{{package.measuringMachineName}}</td>
+                        <td>@{{package.weight}}</td>
+                        <td>@{{package.length}}<a v-if="package.length" class="text-primary">*</a>@{{package.width}}<a class="text-primary" v-if="package.width">*</a>@{{package.height}}</td>
+                        <td>@{{package.bulk}}</td>
+                        <td>@{{package.paperBoxName}}</td>
+                        <td :class="[package.status==='已上传'?'text-success':'']">@{{package.status}}</td>
+                        <td class="text-muted">@{{package.batchRule}}</td>
+                        <td class="text-muted">@{{package.weighed_at}}</td>
+                        <td class="text-muted">@{{package.recipient}}</td>
+                        <td class="text-muted">@{{package.recipientMobile}}</td>
+                    </tr>
+                </table>
+                <div class="text-info h5 btn btn">{{$packages->count()}}/{{$packages->total()}}</div>
+                @if(isset($request))
+                    {{$packages->appends($request)->links()}}
+                @else
+                    {{$packages->links()}}
+                @endif
             </div>
         </div>
     </div>
 @endsection
 
 @section('lastScript')
-    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200720c.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/queryForm/queryForm200720n.js')}}"></script>
     <script>
             @if(isset($request))
         let request={!! json_encode($request) !!};
@@ -165,35 +102,32 @@
                 ],
                 i:0,
                 owners:[
-                        @foreach($owners as $owner)
-                    {id:'{{$owner->id}}',name:'{{$owner->name}}'},
+                    @foreach($owners as $owner)
+                    {value:'{{$owner->id}}',name:'{{$owner->name}}'},
                     @endforeach
                 ],
-                filterData:
-                    {paginate:'50',created_at_start:'',created_at_end:'',logistic_number:'',delivery_number:'',owner_id: '',batch_number:''},
                 checkData:[],
                 form:'',
+                sum:{!! $packages->total() !!},
             },
             mounted:function(){
                 this.initInputs();
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#list').removeClass('d-none');
+                let _this = this;
                 let data = [[
                     {name:'create_at_start',type:'dataTime',tip:'选择显示指定日期的起始时间'},
-                    {name:'owner_id',type:'search_select',tip:['',''],placeholder:['',''],data:[{name:'123',value:'123'},{name:'10',value:'12113'},{name:'12',value:'1212'},{name:'11',value:'1231'},]},
-                    {name:'data',type:'time',tip:'',placeholder:'',data:[{name:'',value:''}]},
-                    {name:'data1',type:'checkbox',tip:'',placeholder:'',data:[{name:'',value:''}]},
-                    {name:'aa',type:'select_multiple_select',tip:'',placeholder:'',data:[{name:'123',value:'123'},{name:'10',value:'12113'},{name:'12',value:'1212'},{name:'11',value:'1231'},]}
+                    {name:'owner_id',type:'search_select',tip:['',''],placeholder:['',''],data:_this.owners},
+                    {name:'logistic_number',type:'input',tip:'快递单号:支持15内模糊搜索与15天外精确搜索',placeholder:'快递单号'},
                 ],[
-
+                    {name:'create_at_end',type:'dataTime',tip:'选择显示指定日期的结束时间'},
+                    {name:'batch_number',type:'input',tip:'波次号:支持15内模糊搜索与15天外精确搜索',placeholder:'波次号'},
                 ]];
 
-                let _this = this;
                 _this.form = new query({
                     el:'#form_div',
                     condition:data,
                 });
-
                 _this.form.init();
             },
             watch:{
@@ -208,19 +142,6 @@
                     deep:true
                 }
             },
-            computed:{
-                isBeingFilterConditions:function(){
-
-                    for(let key in this.filterData){
-                        if(this.filterData[key]){
-                            if(key==='paginate')continue;
-                            return true
-                        }
-                    }
-                    return false;
-                },
-
-            },
             methods:{
                 initInputs:function(){
                     let data=this;
@@ -232,20 +153,9 @@
                             let key = pair[0], val = pair[1];
                             $('input[name="'+key+'"]').val(val);
                             $('select[name="'+key+'"]').val(val);
-                            decodeURI(data.filterData[key]=val);
                         });
                     }
                 },
-                setPaginate:function(e){
-                    this.filterData.paginate=e.target.value;
-                    var form = document.getElementById("optionSubmit");
-                    form.submit();
-                },
-                setOwner:function (e){
-                    this.filterData.owner_id=e.target.value;
-                    var form = document.getElementById("optionSubmit");
-                    form.submit();
-                },
                 checkAll(e){
                     if (e.target.checked){
                         this.packages.forEach((el,i)=>{
@@ -258,33 +168,24 @@
                     }
                 },
                 packageExport(e){
-                    let val=e;
-                    let data=this.filterData;
-                    if (val==1){
+                    if (e==1){
                         if (this.checkData&&this.checkData.length<=0){
                             tempTip.setDuration(4000);
                             tempTip.showSuccess('没有勾选任何记录');
                         }else{
-                            location.href="{{url('package/export').'/'}}"+this.checkData;
+                            location.href="{{url('package/export').'?data='}}"+this.checkData;
                         }
                     } else {
-                        location.href="{{url('package/export/-1?created_at_start=')}}"+
-                            data.created_at_start+"&created_at_end="+data.created_at_end+"&logistic_number="+
-                            data.logistic_number+"&delivery_number="+data.delivery_number+"&owner_id="+data.owner_id+
-                            "&batch_number="+data.batch_number;
+                        if (this.sum > 10000){
+                            if (!confirm('导出条数超过一万条,耗时可能过长,您确定继续吗?'))return;
+                        }
+                        let url=document.URL;
+                        let parameter=url.split('?',2);
+                        url="{{url('package/export')}}"+"?checkAllSign=true";
+                        if (parameter[1])url+="&"+parameter[1];
+                        location.href=url;
                     }
                 },
-                owner_seek:function (e) {
-                    let _this=this;
-                    let $val=e.target.value;
-                    if($val==='')_this.filterData.owner_id='';
-                    else
-                        _this.owners.forEach(function (owner) {
-                            if (owner.name.includes($val)){
-                                _this.filterData.owner_id=owner.id;
-                            }
-                        });
-                },
             },
         });
     </script>

+ 2 - 4
routes/web.php

@@ -91,15 +91,13 @@ Route::get('waybill/index','WaybillsController@index');
 Route::get('waybill/delivering','WaybillsController@delivering');
 Route::post('waybill/storeCarrierBill','WaybillsController@storeCarrierBill');
 Route::resource('waybill','WaybillsController');
-Route::get('waybill/index/ZF','WaybillsController@indexZF');
-Route::get('waybill/index/ZX','WaybillsController@indexZX');
 Route::post('waybill/is/waybillPriceModel','WaybillsController@isWaybillPriceModel');
 Route::post('waybill/addCounty','WaybillsController@addCounty');
 Route::any('waybill/waybillAudit','WaybillsController@waybillAudit');
 Route::any('waybill/waybillEdit/{id}','WaybillsController@waybillEdit');
 Route::any('waybill/waybillRetreatAudit','WaybillsController@waybillRetreatAudit');
 Route::any('waybill/waybillEndAudit','WaybillsController@waybillEndAudit');
-Route::any('waybillExport/{id}','WaybillsController@waybillExport');
+Route::get('waybillExport','WaybillsController@waybillExport');
 Route::any('waybill/waybillUpdate/{id}','WaybillsController@waybillUpdate');
 
 
@@ -130,7 +128,7 @@ Route::get('maintenance/', function () {return view('maintenance.index');});
 Route::any('package/measureMonitor/speech','MeasureMonitorController@speech');
 Route::post('package/measureMonitor/data','MeasureMonitorController@data');
 Route::resource('package/measureMonitor','MeasureMonitorController');
-Route::get('package/export/{id}','PackageController@export');
+Route::get('package/export','PackageController@export');
 Route::get('package/statistics','PackageController@statistics');
 Route::get('package/statisticExport','PackageController@statisticExport');
 Route::get('package/relating', function () {return view('weight.menuWeight');});

+ 2 - 2
webpack.mix.js

@@ -12,7 +12,7 @@ const mix = require('laravel-mix');
  */
 
 mix.js('resources/js/app.js', 'public/js')
-    .sass('resources/sass/app.scss', 'public/css/app200708.css');
+    .sass('resources/sass/app.scss', 'public/css/app200721.css');
 mix.js('resources/js/singles/rejectedIndex.js', 'public/js/singles/rejectedIndex200710.js');
 mix.js('resources/js/singles/searchAnalyze.js', 'public/js/singles/searchAnalyze200513.js');
 
@@ -22,4 +22,4 @@ mix.copy('resources/images','public/images');
 mix.copy('resources/icon/faviconc.ico','public/faviconc.ico');
 mix.js('resources/js/trix.js','public/js/trix.js');
 mix.copy('resources/sass/trix.css','public/css/trix.css');
-mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm200720c.js');
+mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm200720n.js');