Browse Source

发货单发货数量优化

qiuenguang 1 year ago
parent
commit
7b65681566
2 changed files with 8 additions and 4 deletions
  1. 8 3
      application/admin/controller/Deliver.php
  2. 0 1
      public/assets/js/backend/deliver.js

+ 8 - 3
application/admin/controller/Deliver.php

@@ -220,15 +220,20 @@ class Deliver extends Backend
             'large_num' => $lager_num,
             'small_num' => $n,
             'status' => 0,
-            'num' => $bachDetail['box_num'],
             'bach_num' => $bachDetail['bach_num'],
-            'mater_type' => $mater_type,
             'note' => '',
             'user_id' => $userinfo['id'],
             'create_time' => time(),
             'file_dir' => $file_dir,
             'company_id' => $userinfo['company'],
         ];
+        if ($bachDetail['box_num'] != 1){
+            $row['num'] = $bachDetail['box_num'];
+            $row['mater_type'] = 1;
+        }else{
+            $row['num'] = $bachDetail['s_weight'];
+            $row['mater_type'] = 2;
+        }
         $res = $export->save($row);
         if ($res === false){
             $this->error('发货失败');
@@ -666,7 +671,7 @@ class Deliver extends Backend
                     $large_weight = $large_weight + $value['l_weight'];
                 }
                 $data[$k]['l_num'] = $large_num/10000;
-                $data[$k]['l_weight'] = $large_weight/100;
+                $data[$k]['l_weight'] = $large_weight;
             }
             $good_list['address'] = $userinfo['company_address'];
             $good_list['data'] = $data;

+ 0 - 1
public/assets/js/backend/deliver.js

@@ -61,7 +61,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                   },function (data,res) {
                       if (res.code == 1){
                           window.location.href = '/'+res.data;
-                          // console.log('/'+res.url);
                           table.bootstrapTable('refresh');
                       }
                       return false;