Ver Fonte

Merge branch 'waybill_ZD'

LD há 6 anos atrás
pai
commit
971cf4ee89
1 ficheiros alterados com 22 adições e 18 exclusões
  1. 22 18
      resources/views/weight/package/statistics.blade.php

+ 22 - 18
resources/views/weight/package/statistics.blade.php

@@ -252,6 +252,7 @@
                 initInputs:function(){
                     let data=this;
                     let uriParts =decodeURI(location.href).split("?");
+                    let isLogistic=true;
                     if(uriParts.length>1){
                         let params = uriParts[1].split('&');
                         params.every(function(paramPair){
@@ -288,6 +289,25 @@
                                         return  true;
                                     });
                                 }
+                                {{--URL有参数且有logistic字段 --}}
+                                let logistics=data.selectedLogistics;
+                                if (logistics.length>0){
+                                    for (let i=0;i<logistics.length;i++){
+                                        data.logisticsAll.every(function (logistic) {
+                                            if (logistic.id==logistics[i]){
+                                                data.logistics[logistic.id]=logistic.name;
+                                                return false;
+                                            }
+                                            return  true;
+                                        });
+                                    }
+                                }else{
+                                    data.logisticsAll.every(function (logistic) {
+                                        data.logistics[logistic.id]=logistic.name;
+                                        return true;
+                                    });
+                                };
+                                isLogistic=false;
                             }
                             if (key=='date_start'){
                                 strs=str.split("+");
@@ -303,25 +323,9 @@
                             }
                             return true;
                         });
-                        let logistics=data.selectedLogistics;
-                        if (logistics.length>0){
-                            for (let i=0;i<logistics.length;i++){
-                                data.logisticsAll.every(function (logistic) {
-                                    if (logistic.id==logistics[i]){
-                                        data.logistics[logistic.id]=logistic.name;
-                                        return false;
-                                    }
-                                    return  true;
-                                });
-                            }
-                        }else{
-                            data.logisticsAll.every(function (logistic) {
-                                data.logistics[logistic.id]=logistic.name;
-                                return true;
-                            });
-                        }
                     }
-                    if (uriParts.length<=1){
+                    {{--URL无参数以packages所存在物流公司为显示标准 --}}
+                    if (uriParts.length<=1 || isLogistic){
                         data.packages.every(function (package) {
                             data.logisticsAll.every(function (logistic) {
                                 if (package.logistic_id==logistic.id){