ソースを参照

复制快递单号改用换行分隔

Zhouzhendong 5 年 前
コミット
5b9941f5c4

+ 31 - 19
app/Http/Controllers/TestController.php

@@ -105,19 +105,9 @@ class TestController extends Controller
             app(BatchUpdateService::class)->batchUpdate('inventory_accounts',$updateParams);
         }
     }
-    public function zui(){
-
-        $d = ["ada","超管","hospital_1","测试","hospital_5"];
-        $a = [];
-        foreach ($d as $item){
-            $arr = explode("_",$item);
-            if (count($arr) === 2 && $arr[0] == 'hospital' && is_numeric($arr[1]))$a[] = $arr[1];
-        }
-        dd($a);
-    }
     public function zzd()
     {
-        $post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
+        /*$post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
             "method"=>"warpText",
             "mergeColumn"=>["column"],
             "mergeRow"=>["row"=>"row"],
@@ -141,8 +131,30 @@ class TestController extends Controller
             "log"=>"log",
             "file"=>""
         ]]);
-        $http = new Client();
-        $response = $http->get("http://localhost:9722", ["type"=>"base","format"=>[
+        if ($post->status() == 500){
+            throw new Exception($post->header("Msg"));
+        }
+        $test = "test";
+        return response($post,200, [
+            "Content-type"=>"application/octet-stream",
+            "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
+        ]);*/
+        $http = new Client(['base_uri' => 'http://localhost:9722','timeout'=>2.0]);
+        /** @var  $response */
+
+        $response = $http->request('POST', '/',[
+            'headers'=>[
+                'Accept'     => 'application/json',
+            ],
+            "json"=>["type"=>"base","data"=>[
+                "row"=>["sql-row"],
+                "list"=>[["sql-list"]],]]
+        ]);
+        return response($response->getBody()->getContents(),200, [
+            "Content-type"=>"application/octet-stream",
+            "Content-Disposition"=>"attachment; filename=测试.xlsx",
+        ]);
+        $response = $http->post("http://localhost:9722", ["form_params"=>["type"=>"base",/*"format"=>[
             "method"=>"warpText",
             "mergeColumn"=>["column"],
             "mergeRow"=>["row"=>"row"],
@@ -157,15 +169,15 @@ class TestController extends Controller
             "charset"=>"char",
             "parsetime"=>"pars",
             "sid"=>"",
-        ],"data"=>[
+        ],*/"data"=>[
             "row"=>["sql-row"],
             "list"=>[["sql-list"]],
-            "sql"=>"sql",
-            "rule"=>["sql"=>"rule"],
-        ],"path"=>[
+            /*"sql"=>"sql",
+            "rule"=>["sql"=>"rule"],*/
+        ]/*,"path"=>[
             "log"=>"log",
             "file"=>""
-        ]]);
+        ]*/]]);
         if ($response->getStatusCode() == 500){
             throw new \Exception($response->getHeader("Msg"));
         }
@@ -178,7 +190,7 @@ class TestController extends Controller
             throw new Exception($post->header("Msg"));
         }
         $test = "test";
-        return response($response->get,200, [
+        return response($response,200, [
             "Content-type"=>"application/octet-stream",
             "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
         ]);

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

@@ -870,7 +870,7 @@
                                 if (order.orderno == code){
                                     if (order.soreference5) {
                                         text += order.soreference5;
-                                        if(i!==this.checkData.length-1)text += ",";
+                                        if(i!==this.checkData.length-1)text += "\r\n";
                                     }
                                     return true;
                                 }

+ 1 - 1
resources/views/rejected/search/general.blade.php

@@ -316,7 +316,7 @@
                         this.rejectedBills.some(bill=>{
                             if (bill.id == id){
                                 text += bill.logistic_number_return;
-                                if (i!==this.rejectedBills_checkBoxes.length-1)text += ",";
+                                if (i!==this.rejectedBills_checkBoxes.length-1)text += "\r\n";
                                 return true;
                             }
                         });