Browse Source

新增批次优化

qiuenguang 1 year ago
parent
commit
56f0100689

+ 4 - 6
application/admin/controller/QcodeAdd.php

@@ -29,7 +29,7 @@ class QcodeAdd extends Backend
         $product = new QcodeProduct();
         $userinfo = Session::get('admin');
         $data = [
-            'nickname' => $userinfo['nickname'],
+            'nickname' => $userinfo['company_name'],
             'postcode' => $userinfo['postcode'],
             'mobile' => $userinfo['mobile'],
             'company_address' => $userinfo['company_address']
@@ -78,7 +78,6 @@ class QcodeAdd extends Backend
             $row['flow'] = $flow['l_flow']+1;
             $row['bach'] = $flow['bach_num']+1;
         }
-
         return json(['code'=>1,'data'=>$row]);
     }
 
@@ -132,7 +131,7 @@ class QcodeAdd extends Backend
         }
         $batchList = [
             'supplier_name' => $data['company_name'],
-            'supplier_code' => '',
+            'supplier_code' => $userinfo['printer_code'],
             'supplier_id' => $userinfo['id'],
             'matter_name' => $productList['product_name'],
             'matter_no' => $productList['product_code'],
@@ -162,11 +161,10 @@ class QcodeAdd extends Backend
             $this->error('添加失败');
         }
         $flow = [
-            'product_id' => $batchList['matter_id'],
-            'l_flow' => $batchList['larger_num'],
+            'l_flow' => (int)$batchList['l_flow'],
             'bach_num' => $batchList['bach_num'],
         ];
-        $resetFlow->save($flow);
+        $resetFlow->name($userinfo['company'].'_'."reset_flow")->where('product_id',$batchList['matter_id'])->update($flow);
         $last_id = $bach->getLastInsID();
         if ($last_id){
             //插入大小二维码数据

+ 2 - 2
application/admin/view/qcode_add/index.html

@@ -125,13 +125,13 @@
             <tr>
                 <td><span>生产日期</span></td>
                 <td>
-                    <input class="datetimepicker" id="c-manufacture_date" data-date-use-current="true" name="manufacture_date" data-date-format="YYYY-MM-DD">
+                    <input class="" id="c-manufacture_date" value="{:date('Y-m-d')}" style="width: 180px;" name="manufacture_date" type="date" >
                 </td>
             </tr>
             <tr>
                 <td><span>打码日期</span></td>
                 <td>
-                    <input class="datetimepicker" id="c-print_date" data-date-use-current="true" name="print_date" data-date-format="YYYY-MM-DD">
+                    <input class="" type="date" id="c-print_date" style="width: 180px"  name="print_date" value="{:date('Y-m-d')}">
                 </td>
             </tr>
             <tr>

+ 0 - 5
public/assets/js/backend/qcode_add.js

@@ -3,11 +3,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
     var Controller = {
         index: function () {
-            $(document).ready(function () {
-               var dateTime = new Date();
-               $('#c-manufacture_date').val(dateTime);
-               $('#c-print_date').val(dateTime);
-            });
             //选择产品获取产品编码、单位
             $('#c-product_name').change(function () {
                var product_code = $('#c-product_name').val();