From b478031d19c13092dc5f86e6d4f7fc114ea9a85d Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 11 三月 2024 13:28:29 +0800
Subject: [PATCH] Merge branch 'wxw'

---
 HTML/views/ASNSetting/LabelPrint.html |  206 +++++++++++++++++++++++---------------------------
 1 files changed, 95 insertions(+), 111 deletions(-)

diff --git a/HTML/views/ASNSetting/LabelPrint.html b/HTML/views/ASNSetting/LabelPrint.html
index c1d7a6b..2519584 100644
--- a/HTML/views/ASNSetting/LabelPrint.html
+++ b/HTML/views/ASNSetting/LabelPrint.html
@@ -27,6 +27,16 @@
 
 <body>
     <div style="width:100%;text-align: center;">
+        <div style="padding-top: 10px;text-align: left; margin-left: 5%;" id="button">
+            <div class="layui-inline">
+                <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i
+                        class="layui-icon">&#xe654;</i>鐢熸垚鏍囩</button>
+            </div> 
+            <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 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%;">
             <div>
@@ -44,7 +54,7 @@
                     </tr>
                     <tr>
                         <td>鍝佸悕</td>
-                        <td colspan="3" id="goodName"></td>
+                        <td colspan="3" id="SkuName"></td>
                     </tr>
                     <tr>
                         <td>瑙勬牸/鍨嬪彿</td>
@@ -56,7 +66,7 @@
                         <td>杩涘巶缂栧彿</td>
                         <td style="padding: 1px 0px;"></td>
                         <td>鐗╂枡浠g爜</td>
-                        <td style="padding: 1px 0px;"> </td>
+                        <td id="SkuNo"> </td>
                     </tr>
                     <tr>
                         <td>鍘熷巶鎵瑰彿</td>
@@ -80,49 +90,8 @@
                  
             </div>
             <div style="page-break-after: always;"></div>
-        </div>
-        <hr>
-        <div style="padding-top: 10px;text-align: left;" id="button">
-            <div class="layui-inline" style="margin-right: 10px;">
-                <span style="padding-right: 5px;">鏄惁閲嶇疆鎵规:</span>
-                <span style="padding-right: 5px;">鏄�</span><input type="radio" checked="true" name="isprint" value="1">
-                <span style="padding-right: 5px;">鍚�</span><input type="radio" name="isprint" value="0">
-            </div>
-            <div class="layui-inline">
-                鍒拌揣鏁伴噺锛�<div class="layui-input-inline">
-                    <input type="text"
-                        oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')"
-                        onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')"
-                        name="skuNum" id="skuNum" lay-verify="skuNum" placeholder="" style="width: 100px;"
-                        autocomplete="off" class="layui-input InputCss">
-                </div>&nbsp;&nbsp;
-            </div>
-            <div class="layui-inline">
-                绠辨爣绛炬暟閲忥細<div class="layui-input-inline">
-                    <input type="text" onkeyup="this.value=this.value.replace(/^0{1,}/g,'')"
-                        onafterpaste="this.value=this.value.replace(/^0{1,}/g,'')" name="bQNum" id="bQNum"
-                        lay-verify="bQNum" placeholder="" style="width: 100px;" autocomplete="off"
-                        class="layui-input InputCss">
-                </div>&nbsp;&nbsp;
-            </div>
-
-            <div>
-                <div class="layui-inline" style="padding-top: 5px">
-                    涓�绾ф爣绛惧繀褰曞弬鏁帮細绠卞唴鏁伴噺锛�<div class="layui-input-inline">
-                        <input type="text"
-                            oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')"
-                            onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')"
-                            name="number" id="number" lay-verify="number" placeholder="" style="width: 70px;"
-                            autocomplete="off" class="layui-input InputCss">
-                    </div>&nbsp;&nbsp;
-                </div>
-                <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> 
+        
     </div>
     <script src="../../layuiadmin/layui/layui.js"></script>
     <script src="../../js/public.js"></script>
@@ -141,81 +110,97 @@
                 form = layui.form,
                 layer = layui.layer;
             var laydate = layui.laydate;
-            laydate.render({
-                elem: '#ProductionDate'
-                , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚�
-            });
-            laydate.render({
-                elem: '#InspectTime'
-                , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚�
-            });
-            laydate.render({
-                elem: '#ExpirationTime'
-                , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚�
-            });
-            var id = getQueryString('id');
-            var xun = 0;
+            
+            var id = getQueryString('Id');
+            var reset = getQueryString('IsReset');
+            var arriveQty = getQueryString('ArriveQty');
+            
+            var productionTime = getQueryString('ProductionTime');
+            var expirationTime = getQueryString('ExpirationTime');
+            var storeTime = getQueryString('StoreTime');  
+            
+            var doing = true;
+            // console.log(productionTime);
+            // console.log(expirationTime);
+            // console.log(storeTime);
 
+            //鐢熸垚
+            $('#btnAdd').on('click', function () {
+                if(doing){
+                    doing= false;
+
+                
+                    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: 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) {
                 id = 0;
             }
             else {
-                div(-1, 1, 0);
+                var param = { 
+                    id: id, 
+                }; 
+                synData(IP + "/BllAsn/GetLabelBoxModel", param , 'get', function (res) {
+                    if (res.code == 0) { //鎴愬姛  
+                        $("#SkuName").html(res.data.SkuName); 
+                        $("#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);
+                        
+                        // $("#imgBar").attr("src", res.data[0].imageStr); 
+                    } else { //涓嶆垚鍔�
+                        layer.msg(res.msg, {
+                            icon: 2,
+                            time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                        }, function () { });
+                    }
+                });
+ 
+
             }
 
-
-            // 寰幆鍔犺浇鏍囩
-            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,
@@ -330,13 +315,12 @@
                             time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
                         }, function () { });
                     }
-                });
-            };
-
+                }); 
+            }
             // 鑾峰彇浼犻�掑弬鏁�
             function getQueryString(name) {
                 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-                var r = window.location.search.substr(1).match(reg);
+                var r = window.location.search.substr(1).match(reg); 
                 if (r != null) return unescape(r[2]);
                 return null;
             }

--
Gitblit v1.8.0