Zhouzhendong 5 роки тому
батько
коміт
789aae2283
2 змінених файлів з 9 додано та 4 видалено
  1. 4 4
      app/Imports/UpdatePickZone.php
  2. 5 0
      resources/js/queryForm/export.js

+ 4 - 4
app/Imports/UpdatePickZone.php

@@ -84,16 +84,16 @@ class UpdatePickZone implements ToCollection,WithHeadingRow
                 $max = null;
                 $map = [];
                 foreach ($lot as $i => $l){
-                    $qty = (int)$l->quty;
+                    $qty = (int)$l->qty;
                     $map[$qty] = $i;
-                    if ($qty >= (int)$item["数量"] && $qty<=$max)$max = $qty;
-                    if ($qty < (int)$item["数量"] && $qty>=$min)$min = $qty;
+                    if (($qty >= (int)$item["数量"] && $qty<=$max) || $max===null)$max = $qty;
+                    if (($qty < (int)$item["数量"] && $qty>=$min) || $min===null)$min = $qty;
                 }
                 if ($max !== null)$result = $lot[$map[$max]];
                 else $result = $lot[$map[$min]];
             }
             if (count($lot) == 1)$result = $lot[0];
-            if ($result){dd($result);
+            if ($result){
                 try{
                     $detail->update([
                         "lotnum" => $result->lotnum,

+ 5 - 0
resources/js/queryForm/export.js

@@ -4,6 +4,11 @@ function excelExport(checkAllSign,checkData,url,sum,token,reservation = null) {
         if (sum > 10000){
             if (!confirm('导出条数超过一万条,耗时可能过长,您确定继续吗?'))return;
         }
+        if (sum > 1000000){
+            tempTip.setDuration(3000);
+            tempTip.showSuccess('导出条数超过百万条,超出最大执行条目!');
+            return;
+        }
         let thisUrl=document.URL;
         let parameter=thisUrl.split('?',2);
         url += "?checkAllSign=true";