From 157abc191c34e57c1b958ae74fc3de6518ca8a30 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期五, 28 二月 2025 11:06:36 +0800
Subject: [PATCH] 修改客户需求

---
 HTML/views/ASNSetting/LabelPrint.html |  151 +++++++++++++++++++++-----------------------------
 1 files changed, 63 insertions(+), 88 deletions(-)

diff --git a/HTML/views/ASNSetting/LabelPrint.html b/HTML/views/ASNSetting/LabelPrint.html
index 0dc83e6..ddce481 100644
--- a/HTML/views/ASNSetting/LabelPrint.html
+++ b/HTML/views/ASNSetting/LabelPrint.html
@@ -32,10 +32,10 @@
                 <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i
                         class="layui-icon">&#xe654;</i>鐢熸垚鏍囩</button>
             </div> 
-            <div class="layui-inline">
+            <!-- <div class="layui-inline">
                 <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i
                         class="layui-icon">&#xe654;</i>鎵撳嵃</button>
-            </div> 
+            </div>  -->
         </div>
         <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="print"
             style="width: 100%;height:100%; text-align: right;padding-top: 5px;margin-left: 0%;">
@@ -64,7 +64,7 @@
                     </tr>
                     <tr>
                         <td>杩涘巶缂栧彿</td>
-                        <td style="padding: 1px 0px;"></td>
+                        <td id="Lotno"> </td>
                         <td>鐗╂枡浠g爜</td>
                         <td id="SkuNo"> </td>
                     </tr>
@@ -112,89 +112,70 @@
             var laydate = layui.laydate;
             
             var id = getQueryString('Id');
-            var reset = getQueryString('Reset');
+            var reset = getQueryString('IsReset');
             var arriveQty = getQueryString('ArriveQty');
             
             var productionTime = getQueryString('ProductionTime');
             var expirationTime = getQueryString('ExpirationTime');
             var storeTime = getQueryString('StoreTime');  
+
             
-            console.log(productionTime);
-            console.log(expirationTime);
-            console.log(storeTime);
+
+            var supplierLot=getQueryString('SupplierLot'); //鍘熷巶鎵瑰彿
+            //$("#SupplierLot").html(supplierLot);
+            //console.log(supplierLot);
+
+            var Lotno=getQueryString('Lotno'); //鍘熷巶鎵瑰彿
+            $("#Lotno").html(Lotno);
+            var doing = true;
+            // console.log(productionTime);
+            // console.log(expirationTime);
+            // console.log(storeTime);
 
             //鐢熸垚
             $('#btnAdd').on('click', function () {
-                var param = {
-                    Id: parseInt(id),
-                    IsReset:reset, 
-                    ArriveQty:arriveQty,  
-                    ProductionTime:productionTime,
-                    ExpirationTime:expirationTime,
-                    StoreTime:storeTime
-                };
-                console.log(param);
-                synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) {
-                    if (res.code == 0) { //鎴愬姛  
-                        layer.msg(res.msg, {
-                            icon: 2,
-                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-                        }, function () {
-                            parent.location.reload();
-                            parent.layer.close(layer.index);
-                        });
-                        
-                    } else { //涓嶆垚鍔�
-                        layer.msg(res.msg, {
-                            icon: 2,
-                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-                        }, function () { });
-                    }
-                });
+                if(doing){
+                    doing= false;
+
+                
+                    var param = {
+                        Id: parseInt(id),
+                        IsReset:reset, 
+                        ArriveQty:arriveQty,  
+                        ProductionTime:productionTime,
+                        ExpirationTime:expirationTime,
+                        StoreTime:storeTime,
+                        SupplierLot:supplierLot//鍘熷巶鎵瑰彿
+                    };
+                    // console.log(param);
+                    synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) {
+                        if (res.code == 0) { //鎴愬姛  
+                            layer.msg(res.msg, {
+                                icon: 1,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () {
+                                parent.location.reload();
+                                parent.layer.close(layer.index);
+                                doing = true;
+                            });
+                            
+                        } else { //涓嶆垚鍔�
+                            layer.msg(res.msg, {
+                                icon: 2,
+                                time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                            }, function () { 
+                                doing = true;
+                            });
+                        }
+                    });
+                }
             });
             //鎵撳嵃
             $('#btnPrint').on('click', function () {
                 var param = {
                     ImportId: id,
                 };
-                if ($("#ProductionDate").val() == "" || $("#ProductionDate").val() == undefined || $("#ProductionDate").val() == null) {
-                    layer.msg("鐢熶骇鏃ユ湡涓嶈兘涓虹┖", {
-                        icon: 2,
-                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-                    }, function () { return; });
-                }
-                if ($("#SupplierName").val() == "" || $("#SupplierName").val() == undefined || $("#SupplierName").val() == null) {
-                    layer.msg("鐢熶骇鍘傚涓嶈兘涓虹┖", {
-                        icon: 2,
-                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-                    }, function () { return; });
-                }
-                if ($("#SupplierLot").val() == "" || $("#SupplierLot").val() == undefined || $("#SupplierLot").val() == null) {
-                    console.log($("#SupplierLot").val())
-                    layer.msg("鍘傚鎵瑰彿涓嶈兘涓虹┖", {
-                        icon: 2,
-                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-                    }, function () { return; });
-                } 
-
-                if ($('#number').val() > 0) {
-
-                    if ($('#bQNum').val() > 0) {
-                        div($('#number').val(), $('input[name="isprint"]:checked').val(), $('#bQNum').val());
-                    } else {
-                        div($('#number').val(), $('input[name="isprint"]:checked').val(), 0);
-                    }
-
-                }
-                else {
-
-                    if ($('#bQNum').val() >= 0) {
-                        div(0, $('input[name="isprint"]:checked').val(), $('#bQNum').val());
-                    } else {
-                        div(0, $('input[name="isprint"]:checked').val(), 0);
-                    }
-
-                }
+                 
             });
 
             if (!id) {
@@ -210,9 +191,11 @@
                         $("#Standard").html(res.data.Standard);
                         $("#PackageStandard").html(res.data.PackageStandard);
                         $("#SkuNo").html(res.data.SkuNo);
-                        $("#SupplierLot").html(res.data.SupplierLot);
+                        
                         $("#ExpirationTime").html(expirationTime);
-                        $("#StoreTime").html( storeTime);
+                        $("#StoreTime").html(storeTime);
+                        $("#SupplierLot").html(res.data.SupplierLot);
+
                         
                         // $("#imgBar").attr("src", res.data[0].imageStr); 
                     } else { //涓嶆垚鍔�
@@ -222,20 +205,13 @@
                         }, function () { });
                     }
                 });
-
-                // div(-1, 1, 0);
+ 
 
             }
 
-
-            // 寰幆鍔犺浇鏍囩
-            function div(number, isprint, bqNum) {
-                GetImportId(number, isprint, bqNum);
-            }
-
-            // 鏍囩鍙橀噺璧嬪��
-            function GetImportId(i, isprint, bqNum) {
-
+            // 鍔犺浇鏍囩
+            function div(i, isprint, bqNum) {
+                             
                 var param1 = {
                     isprint: isprint,
                     ImportId: id,
@@ -260,7 +236,7 @@
                             $("input[name='SupplierName']").val(res.data[0].SupplierName);
                             $("input[name='ProductionDate']").val(res.data[0].ProductionDate);
                             $("input[name='SapSkuNo']").val(res.data[0].SapSkuNo);
-                            $("input[name='Qty']").val(res.data[0].Qty);
+                            $("input[name='Qty']").val(res.data[0].Qty+res.data[0]);
                             $("input[name='Standard']").val(res.data[0].Standard);
                             $("input[name='SupplierLot']").val(res.data[0].SupplierLot);
                             $("input[name='LotNo']").val(res.data[0].LotNo);
@@ -350,9 +326,8 @@
                             time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
                         }, function () { });
                     }
-                });
-            };
-
+                }); 
+            }
             // 鑾峰彇浼犻�掑弬鏁�
             function getQueryString(name) {
                 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

--
Gitblit v1.8.0