From 3425237a2b54ca28fc3e3c5f7c35a7fbef4e15fa Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 29 十二月 2025 09:19:29 +0800
Subject: [PATCH] 1

---
 WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_generateCaseCode.html |  475 ++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 337 insertions(+), 138 deletions(-)

diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\215\225\345\223\201\350\277\207\347\253\231_\345\260\217\345\215\253/Cj_ProcessItemStationPlatform_generateCaseCode.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\215\225\345\223\201\350\277\207\347\253\231_\345\260\217\345\215\253/Cj_ProcessItemStationPlatform_generateCaseCode.html"
index 5f8552f..a1dec96 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\215\225\345\223\201\350\277\207\347\253\231_\345\260\217\345\215\253/Cj_ProcessItemStationPlatform_generateCaseCode.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\215\225\345\223\201\350\277\207\347\253\231_\345\260\217\345\215\253/Cj_ProcessItemStationPlatform_generateCaseCode.html"
@@ -49,8 +49,8 @@
                             <div class="layui-tab-content" style="">
                                 <div class="layui-tab-item  layui-show">
                                     <div class="layui-input-block" style="display: inline-block; margin-left:0px;">
-                                        <label class="layui-form-label" style="padding-left:0px" id="">闇�姹傛暟閲�:</label>
-                                        <input type="text" class="layui-input" name="HNeedQty" lay-verify="HNeedQty" autocomplete="off" id="HNeedQty" value="100" style="width: 100px;float:left">
+                                        <label class="layui-form-label" style="padding-left:0px" id="">鏈�澶х鏁�:</label>
+                                        <input type="text" class="layui-input" name="HNeedQty" lay-verify="HNeedQty" autocomplete="off" id="HNeedQty" value="2" style="width: 100px;float:left" readonly>
 
                                     </div>
                                     <div class="layui-input-block" style="display: inline-block; margin-left:0px;">
@@ -58,14 +58,74 @@
                                         <input type="text" class="layui-input" name="HWeight" lay-verify="HWeight" autocomplete="off" id="HWeight" value="100" style="width: 100px;float:left">
 
                                     </div>
+                                    <div class="layui-input-block" style="display: inline-block; margin-left:0px;">
+                                        <label class="layui-form-label" style="padding-left:0px" id="">鏈�灏忛噸閲�:</label>
+                                        <input type="text" class="layui-input" name="HWeight" lay-verify="HMinWeight" autocomplete="off" id="HMinWeight" value="0" style="width: 100px;float:left">
 
+                                    </div>
+                                    <div class="layui-input-block" style="display: inline-block; margin-left:0px;">
+                                        <label class="layui-form-label" style="padding-left:0px" id="">鏈�澶ч噸閲�:</label>
+                                        <input type="text" class="layui-input" name="HWeight" lay-verify="HMaxWeight" autocomplete="off" id="HMaxWeight" value="101" style="width: 100px;float:left">
+
+                                    </div>
                                     <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
 
                                 </div>
                                 <!--鍏朵粬淇℃伅-->
                                 <div class="layui-tab-item">
                                     <div class="layui-form-item" style="padding-top: 10px;">
+
                                         <div class="layui-row">
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;" id="BT_HProcName">宸ュ簭</label>
+                                                <div class="layui-input-block" style="margin-left: 77px;">
+                                                    <input type="text" class="layui-input" name="HProcName" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly>
+                                                    <input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
+                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HDeptName">褰撳墠杞﹂棿</label>
+                                                <div class="layui-input-block" style="margin-left: 77px;">
+                                                    <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly>
+                                                    <input type="hidden" class="layui-input" lay-verify="HDeptID" name="HDeptID" id="HDeptID">
+                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label" style="width: 85px;padding: 9px 18px;" id="BT_HEmpName">鎿嶄綔鍛�</label>
+                                                <div class="layui-input-block" style="margin-left: 77px;">
+                                                    <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                    <input type="hidden" class="layui-input" lay-verify="HEmpID" name="HEmpID" id="HEmpID" value="0">
+                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HGroupName">鐢熶骇鐝粍</label>
+                                                <div class="layui-input-block" style="margin-left: 77px;">
+                                                    <input type="text" class="layui-input" name="HGroupName" id="HGroupName" lay-verify="HGroupName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                    <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0">
+                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHGroup" id="btnHGroup" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HSourceName">鐢熶骇璧勬簮</label>
+                                                <div class="layui-input-block" style="margin-left: 77px;">
+                                                    <input type="text" class="layui-input" name="HSourceName" id="HSourceName" lay-verify="HSourceName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                    <input type="hidden" class="layui-input" name="HSourceID" lay-verify="HSourceID" id="HSourceID" value="0">
+                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSource" id="btnHSource" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
                                             <div class="layui-inline">
                                                 <label class="layui-form-label" style="width: 85px;">鍒跺崟浜�</label>
                                                 <div class="layui-input-block" style="margin-left: 120px;">
@@ -101,12 +161,13 @@
                     <script type="text/html" id="toolbarDemo">
                         <div class="layui-btn-container">
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>瑙g粦</button>
-                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>-->
                         </div>
                     </script>
                     <script type="text/html" id="toolbarDemo2">
                         <div class="layui-btn-container">
-                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>鍒犻櫎</button>
+                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>鍒犻櫎</button>-->
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="refresh" id="refresh"><i class="layui-icon layui-icon-form"></i>鍒锋柊</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn2" id="HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                         </div>
                     </script>
@@ -116,6 +177,9 @@
     </div>
 </body>
 </html>
+<script type="text/html" id="barDemo">
+    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+</script>
 <script>
 
     layui.config({
@@ -135,10 +199,11 @@
 
         //瀹氫箟鍏ㄥ眬鍙橀噺
 
-        var HModName = "Cj_ProcessItemStationPlatform_batch";
-        var HModName2 = "Cj_ProcessItemStationPlatform_batch2";
+        var HModName = "Cj_ProcessItemStationPlatform_CaseCode";
+        var HModName2 = "Cj_ProcessItemStationPlatform_CaseCode2";
         var option = [];
         var option2 = [];
+        var barCodeData = [];//璁板綍SN鏉$爜淇℃伅
         //#endregion
 
         //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -150,11 +215,16 @@
         //#endregion
 
         //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+        table.on('tool(mainTable)', function (obj) {
+            set_GridDelete(obj);   //琛屽唴鍒犻櫎
+        });
+
         //澶村伐鍏锋爮浜嬩欢
         table.on('toolbar(mainTable)', function (obj) {
             switch (obj.event) {
                 //鍒犻櫎鎸夐挳
-                case 'btn-Delete': set_DeleteBill();
+                case 'btn-Delete': btn_Delete();
                     break;
                 //鍒楄缃�
                 case 'set_HideColumn': get_HideColumnNoPage(HModName, sessionStorage["HUserName"], option, get_Display);
@@ -169,62 +239,19 @@
                 //鍒楄缃�
                 case 'set_HideColumn2': get_HideColumnNoPage(HModName2, sessionStorage["HUserName"], option2, get_Display);
                     break;
+                //鍒锋柊
+                case 'refresh': get_Display();
+                    break;
             };
         });
-        //鎵规鐮佸洖杞︽柟娉�
-        $('#HBarCode_Batch').on('keydown', function (event) {
-            var HBarCode = $('#HBarCodeSN').val();
-            var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val();
-            if (event.keyCode == 13) {
-                if (!HBardCodeProcExchBillNo) {
-                    layer.msg(get_MessageError("[0000-2-034]璇峰厛鎵祦杞崱锛�", sessionStorage["HTranSlate"]))
-                    return;
-                } else {
-                    HBarCode = HBarCode.toUpperCase();
-                    if (!HBarCode) {
-                        layer.msg(get_MessageError("[0000-2-019]鏉″舰鐮佷笉鑳戒负绌猴紒", sessionStorage["HTranSlate"]))
-                        return;
-                    } else {
-                        if (HBarCode.length != 29 && HBarCode.length != 50) {
-                            layer.alert(get_MessageError("[3791-2-012]瀛愪欢鏉$爜闀垮害涓嶄负29浣嶆垨50浣�!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]閫�鍑�', sessionStorage["HTranSlate"])], time: 100000, offset: 't' });
-                            return;
-                        }
-
-                        if (HBarCode.match(/[^\x00-\xff]/g) != null) {
-                            layer.alert(get_MessageError("[3791-2-013]蹇呴』鏄崐瑙掑瓧绗�!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]閫�鍑�', sessionStorage["HTranSlate"])], time: 100000, offset: 't' });
-                            return;
-                        }
-                    }
-                }
-                for (var i = 0; i < option.data.length; i++) {
-                    if (option.data[i]["HBatchNo"] == "") {
-                        layer.msg(get_MessageError("[3791-2-014]褰撳墠宸ュ簭鎵规涓嶈兘涓虹┖锛�", sessionStorage["HTranSlate"]))
-                        return;
-                    }
-                }
-                txtHBarCode_KeyDown(HBarCode);
-            }
-        });
+        
       
         //闀洉鐮佸洖杞︽柟娉�
         $('#HBarCode_SN').on('keydown', function (event) {
-            var HBarCode = $('#HBardCodeProcExchBillNo').val();
+            var HBarCode_SN = $('#HBarCode_SN').val();
             if (event.keyCode == 13) {
-                if (!HBarCode) {
-                    layer.msg(get_MessageError("[0000-1-057]娴佽浆鍗′笉鑳戒负绌猴紒", sessionStorage["HTranSlate"]))
-                    return;
-                }
-                setIntervalIndex = setInterval(setIntervalList, 30000);
-                get_BomList(HBarCode);
-                //if (option.data != 0) {
-                //    //淇濆瓨鍒颁复鏃惰〃
-                //    get_AddBomTempList();
-                //}
-                //鏌ヨ涓嶈壇璁板綍
-                get_BadRecords();
-                //鏌ヨ鍚堟牸璁板綍
-                get_HGRecords();
-
+                
+                txtHBarCode_KeyDown(HBarCode_SN);
                
             }
         });
@@ -264,7 +291,10 @@
                 Pub_Close(2);
             }
         });
-
+        //鎻愪氦
+        form.on('submit(btnSave)', function (data) {
+            set_getCaseCode();
+        });
 
         //#endregion
 
@@ -273,7 +303,7 @@
         //鍒濆鍖栫晫闈�
         function set_ClearBill() {
             //杩涘叆椤甸潰榛樿鍏夋爣鍦ㄦ祦杞崱涓�
-            $("#HBardCodeProcExchBillNo").focus();
+            $("#HBarCode_SN").focus();
             //鍒跺崟浜�
             $("#HMaker").val(sessionStorage["HUserName"]);
             $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
@@ -282,7 +312,13 @@
             //鍒濆鍖栬〃鏍�
             set_InitGrid();
             //
-            //get_Display();
+            get_Display();
+            var data = localStorage.getItem("CaseCodeDataCache");
+            if (data != null) {
+
+                option.data = JSON.parse(data);
+                table.render(option);
+            }
         }
 
         //#region 閫氳繃鐧诲綍鐢ㄦ埛鑾峰彇榛樿鍊�
@@ -317,13 +353,13 @@
                 }
             })
         }
-            //#endregion
+        //#endregion
 
-        //鍏抽敭浠舵竻鍗�
+        //褰╃洅娓呭崟
         function set_InitGrid() {
             option= {
                 elem: '#mainTable'
-                , toolbar: '#toolbarDemo'
+                //, toolbar: '#toolbarDemo'
                 , page: false
                 , totalRow: true
                 , cellMinWidth: 120
@@ -331,21 +367,21 @@
                 , height: 285
                 , limit: 10
                 , cols: [[
-                    { type: 'numbers', title: '搴忓彿' }
-                    , { field: '鏃ユ湡', title: '鏃ユ湡' }
-                    , { field: '閰嶄欢浠g爜', title: '閰嶄欢浠g爜' }
-                    , { field: '閰嶄欢鍚嶇О', title: '閰嶄欢鍚嶇О' }
-                    , { field: '閰嶄欢瑙勬牸', title: '閰嶄欢瑙勬牸' }
-                    , { field: '閰嶄欢鏁伴噺', title: '閰嶄欢鏁伴噺', totalRow: true}
-                    , { field: 'HBatchNo', title: '褰撳墠鎵规' }
+                    { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' }
+                    , { type: 'numbers', title: '搴忓彿' }
+                    , { field: 'HItemID', title: 'HItemID', hide: true }
+                    , { field: 'HBarCode', title: '浜у搧SN鐮�' }
+                    , { field: 'HMaterID', title: 'HMaterID', hide: true  }
+                    , { field: 'HMaterNumber', title: '鐗╂枡浠g爜' }
+                    , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', totalRow: true}
+                    , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿' }
                     , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
                     , { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
-                    , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
-                    , { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
-                    , { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
-                    , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
-                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
-                    , { field: 'HBarCode', title: 'HBarCode', hide: true }
+                    , { field: 'HICMOBillNo', title: '鐢熶骇璁㈠崟鍙�', hide: true }
+                    , { field: 'HInterID', title: 'HInterID', hide: true }
+                    , { field: 'HWeight', title: '閲嶉噺' }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 66 }
+                    
                 ]]
             }
             option2 = {
@@ -381,75 +417,158 @@
         
         //鏉$爜鍥炶溅鏌ヨ
         function txtHBarCode_KeyDown(HBarCode) {
+            getHBarCodeData(HBarCode);
+            //娓呯┖SN闀洉鐮佸唴瀹�
+            $("#HBarCode_SN").val("");
+            $("#HBarCode_SN").focus();
+        }
 
-            var HProcExchBillNo = $("#HProcExchBillNo").val();
-            var indexs = layer.load();
+        function getHBarCodeData(HBarCode) {
+            indexs = layer.load();
+            //鑾峰彇瀵瑰簲涓昏〃淇℃伅
             $.ajax({
                 type: "GET",
-                url: GetWEBURL() + "/Cj_SingleStation/SNHBardCodeList",
+                url: GetWEBURL() + "/Cj_SingleStation/checkHBarCode_Batch",
                 async: false,
-                data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] },
+                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] },
                 dataType: "json",
                 success: function (data1) {
                     if (data1.count == 1) {
                         layer.close(indexs);
-                        var index = layer.load();
-
-                        $.ajax({
-                            type: "GET",
-                            url: GetWEBURL() + "/Cj_SingleStation/HBardCodeSNList",
-                            async: false,
-                            data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
-                            dataType: "json",
-                            success: function (data1) {
-                                if (data1.count == 1) {
-                                    layer.close(index);
-                                    $("#HBarCode_P").val(HBarCode);
-                                    if (AllowLoadData()) {
-                                        //淇濆瓨鏁版嵁
-                                        set_AddAssemblyBill();
-                                    }
-                                }
-                                else {
-                                    layer.close(index);
-                                    layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]纭', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]娓╅Θ鎻愮ず", sessionStorage["HTranSlate"]) });
-                                }
-                                $("#HBarCodeSN").val("");
-                            },
-                            error: function (err) {
-                                layer.close(index);
-                                layer.msg(get_MessageError("閿欒:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]纭', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]娓╅Θ鎻愮ず", sessionStorage["HTranSlate"]) });
-                            }
-                        });
+                        barCodeData = data1.data[0];
+                        //$("#HMinWeight").val();鑾峰彇鏈�澶ф暟閲忔渶灏忛噸閲忔渶澶х鏁�
+                        //$("#HMaxWeight").val();
+                        //$("#HNeedQty").val();
+                        if (AllowLoadData()) {
+                            set_SaveBill(HBarCode);
+                        }
                     }
                     else {
                         layer.close(indexs);
-                        layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"]));
+                        
+                        layer.confirm(data1.Message);
                     }
-                    //鍏夋爣璺宠浆鍒癝N鏉$爜鏂囨湰妗嗕笂
-                    //$("#HBarCodeSN").focus();
-                    $("#HBarCodeSN").val("");
+
                 },
                 error: function (err) {
                     layer.close(indexs);
+                    
                     layer.msg(get_MessageError("閿欒:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]纭', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]娓╅Θ鎻愮ず", sessionStorage["HTranSlate"]) });
                 }
             });
         }
 
-        //鍔犺浇缃戞牸
-        function get_Display() {
-            var ajaxLoad = layer.load();
+
+        //#region 杩囩珯淇濆瓨鏂规硶
+        function set_SaveBill(HBarCode) {
+            var data = {
+                "field": {
+                    "HProcID": $("#HProcID").val(), "HBatchNo": "", "HWeight": $("#HWeight").val(),
+                    "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(),
+                    "HPRDOrgID": sessionStorage["OrganizationID"],
+                    "HEmpID": $("#HEmpID").val(), "HDeptID": $("#HDeptID").val()
+                }
+            };
+            var sMainStr = JSON.stringify(data.field);
+            var sSubStr = HBarCode;
+            var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"];
+            var indexs = layer.load();
             $.ajax({
-                url: GetWEBURL() + '/Cg_POOrderBill/list',
+                type: "POST",
+                url: GetWEBURL() + "/Cj_SingleStation/AddStationOutBillList",
+                async: false,
+                data: { "sMainSub": sMainSub },
+                dataType: "json",
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        layer.close(indexs);
+                        //娓呭崟鍐呭瀛樺叆
+                        barCodeData.HInterID = data1.data//鑾峰彇瀵瑰簲鍑烘垬姹囨姤浣嗗唴鐮�
+                        barCodeData.HWeight = $("#HWeight").val()//閲嶉噺
+                        option.data.push(barCodeData);
+                        table.render(option)
+                        //鏈湴瀛樺偍
+                        localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data));
+                        //绠辨暟瓒冲鑷姩鎻愪氦
+                        if (option.data.length == $("#HNeedQty").val()) {
+                            set_getCaseCode()
+                        }
+
+                        $("#HReturnMessage").text("鎴愬姛鎵爜涓�涓�:" + HBarCode);
+                        get_Display();
+                    }
+                    else {
+                        
+                        layer.close(indexs);
+                        layer.msg(data1.Message, { icon: 5, btn: ["纭"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "鍑虹幇閿欒" });
+                    }
+
+                },
+                error: function (err) {
+                    
+                    layer.close(indexs);
+                    layer.msg(get_MessageError("閿欒:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]纭', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]娓╅Θ鎻愮ず", sessionStorage["HTranSlate"]) });
+                }
+            });
+        }
+        //#endregion
+
+        //#region 涓鐮佺敓鎴�
+        function set_getCaseCode() {
+            const hitmidString = option.data.map(item => item.HItemID).join(",");
+            var sMainSub = hitmidString + ';' + sessionStorage["HUserName"];
+            var indexs = layer.load();
+            $.ajax({
+                type: "POST",
+                url: GetWEBURL() + "/Cj_SingleStation/AddCaseCode",
+                async: false,
+                data: { "sMainSub": sMainSub },
+                dataType: "json",
+                success: function (data1) {
+                    if (data1.count == 1) {
+                        layer.close(indexs);
+                        //娓呭崟鍐呭瀛樺叆
+                        option.data = [];
+                        table.render(option)
+                        //鏈湴瀛樺偍
+                        localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data));
+
+                        $("#HReturnMessage").text("鎴愬姛鐢熸垚涓�涓�:" + data1.data);
+                        get_Display();
+                    }
+                    else {
+
+                        layer.close(indexs);
+                        layer.msg(data1.Message, { icon: 5, btn: ["纭"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "鍑虹幇閿欒" });
+                    }
+
+                },
+                error: function (err) {
+
+                    layer.close(indexs);
+                    layer.msg(get_MessageError("閿欒:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]纭', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]娓╅Θ鎻愮ず", sessionStorage["HTranSlate"]) });
+                }
+            });
+        }
+        //#endregion
+
+
+        //鍔犺浇鍘嗗彶杩囩珯娓呭崟淇℃伅
+        function get_Display(sWhere = '') {
+            var ajaxLoad = layer.load();
+            var HProcID = $("#HProcID").val();
+            var HSourceID = $("#HSourceID").val();
+            sWhere += ` and HProcID = ${HProcID} and HSourceID = ${HSourceID}`
+            $.ajax({
+                url: GetWEBURL() + '/Cj_SingleStation/SingleStationOutBillList',
                 async: false,
                 type: "GET",
-                data: { "sWhere": '', "user": sessionStorage["HUserName"] },
+                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                 success: function (data1) {
                     if (data1.count == 1) {
                         var data = [];//鍒楀瓧娈垫暟鎹�
                         var col = [];
-                        var titleData=[]
+                        var titleData = []
                         var totalArray = ["鏁伴噺", "鍏宠仈鏁伴噺", "鏈叧鑱旀暟閲�", "鎵撳嵃鏉$爜鏁伴噺", "鏈墦鍗版潯鐮佹暟閲�", "瀹炴敹鏁伴噺", "閲戦"];
                         //缁欑┖鐨勬暟缁勮祴鍊�
                         for (var key in data1.list) {
@@ -487,15 +606,15 @@
                                 }
                             }
                         }
-                        option.cols = [col]
-                        option.data = data1.data;
+                        option2.cols = [col]
+                        option2.data = data1.data;
 
-                        
+
 
                         //鍒锋柊琛ㄦ牸鏁版嵁
-                        DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, []);
+                        DisPlay_HideColumn(HModName2, sessionStorage["HUserName"], option2, []);
 
-                        table.render(option);
+                        table.render(option2);
                         layer.close(ajaxLoad);
                         //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
                     } else {
@@ -508,6 +627,80 @@
                 }
             });
         }
+
+        //鍒犻櫎鍗曟嵁
+        function btn_Delete() {
+            var checkStatus = table.checkStatus('mainTable')
+                , data = checkStatus.data;
+            if (checkStatus.data.length === 1) {
+                layer.confirm(get_MessageError('[0000-1-003]纭畾鍒犻櫎' + data[0].HBarCode + '鍚楋紵', sessionStorage["HTranSlate"]), function (index) {
+                    var ajaxLoad = layer.load();
+                    //閫昏緫鍒犻櫎鏂规硶
+                    $.ajax({
+                        url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBill',
+                        type: "GET",
+                        data: { "HInterID": data[0].HInterID, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                get_Display();
+                                layer.close(ajaxLoad);
+                            } else {
+                                layer.close(ajaxLoad);
+                                layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.close(ajaxLoad);
+                            layer.alert(get_MessageError("[0000-1-002]鎺ュ彛璇锋眰澶辫触!", sessionStorage["HTranSlate"]), { icon: 5 });
+                        }
+                    });
+                    layer.close(index);
+                });
+            } else {
+                layer.msg(get_MessageError('[0000-1-001]璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒', sessionStorage["HTranSlate"]));
+            }
+        }
+
+        //琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
+        function set_GridDelete(obj) {
+            var data = obj.data;
+            var rowIndex = $(obj.tr).attr("data-index");
+            if (obj.event === 'del') {
+                layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+
+                    var wait = layer.load();
+                    //閫昏緫鍒犻櫎鏂规硶
+                    $.ajax({
+                        url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBill',
+                        type: "GET",
+                        data: { "HInterID": data.HInterID, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                // 鍒犻櫎 id=2 鐨勫璞★紙Bob锛�
+                                debugger
+                                const index = option.data.findIndex(item => item.HInterID === data.HInterID);
+                                if (index !== -1) {
+                                    option.data.splice(index, 1); // 浠� index 寮�濮嬪垹闄� 1 涓厓绱�
+                                }
+                                //鏈湴瀛樺偍
+                                localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data));
+                                
+                                get_Display();
+                                table.render(option);
+                                layer.close(wait);
+                            } else {
+                                layer.close(wait);
+                                layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.close(wait);
+                            layer.alert(get_MessageError("[0000-1-002]鎺ュ彛璇锋眰澶辫触!", sessionStorage["HTranSlate"]), { icon: 5 });
+                        }
+                    });
+
+                });
+            }
+        }
+
 
         //鍛樺伐閫夋嫨椤甸潰
         function btnHEmp() {
@@ -644,23 +837,29 @@
         //闈炵┖楠岃瘉
         function AllowLoadData() {
 
-            var HBarCode = $("#HBarCode_P").val();
-            if (HBarCode == "") {
-                layer.msg(get_MessageError("[0000-2-019]浜у搧SN涓嶈兘涓虹┖!", sessionStorage["HTranSlate"]))
+            let HMinWeight = +$("#HMinWeight").val();
+            let HMaxWeight = +$("#HMaxWeight").val();
+            let HWeight = +$("#HWeight").val();
+            //绗竴娆℃壂闀洉鐮�
+            if (option.data.length === 0) {
+                if (HWeight < HMinWeight || HWeight > HMaxWeight) {
+                    layer.confirm("閲嶉噺鏍¢獙澶辫触")
+                    return false;
+                }
+            } else {
+                if (HWeight < HMinWeight || HWeight > HMaxWeight) {
+                    layer.confirm("閲嶉噺鏍¢獙澶辫触")
+                    return false;
+                }
+                if (option.data[0].HMaterID != barCodeData.HMaterID) {
+                    return false;
+                }
+            }
+            if (option.data.length >= $("#HNeedQty").val()) {
+                layer.confirm("绠辨暟宸叉弧璇锋彁浜�")
                 return false;
             }
-
-            var HEmpID2 = $("#HEmpID2").val();
-            if (HEmpID2 == 0) {
-                layer.msg(get_MessageError("[0000-2-030]鎿嶄綔鍛樹笉鑳戒负绌�!", sessionStorage["HTranSlate"]))
-                return false;
-            }
-
-            //var HBadReasonID = $("#HBadReasonID").val();
-            //if (HBadReasonID == 0) {
-            //    layer.msg("涓嶈壇鍘熷洜涓嶈兘涓虹┖!")
-            //    return false;
-            //}
+           
             return true;
         }
 

--
Gitblit v1.9.1