From 0b7bd8cd736cc7c0182fcf0e46ca0cb0fa3cb00f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 28 十月 2024 19:22:23 +0800
Subject: [PATCH] 包装混箱功能

---
 WebTM/views/车间管理/产线/MES_ProductionLinePackaging.html |  193 ++++++++++++++++++++++++++++-------------------
 1 files changed, 114 insertions(+), 79 deletions(-)

diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\344\272\247\347\272\277/MES_ProductionLinePackaging.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\344\272\247\347\272\277/MES_ProductionLinePackaging.html"
index 98f44f5..fc5861a 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\344\272\247\347\272\277/MES_ProductionLinePackaging.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\344\272\247\347\272\277/MES_ProductionLinePackaging.html"
@@ -102,6 +102,12 @@
                                         <input type="text" style="border-radius: 50px;width: 140%;" name="瀛愪欢鏉$爜" id="SubBarcode" autocomplete="off" placeholder="璇疯緭鍏ュ瓙浠舵潯鐮�" class="layui-input">
                                     </div>
                                 </div>
+                                <div class="">
+                                    <label class="layui-inline" style="width:60px;">鏄惁娣风</label>
+                                    <div class="layui-inline">
+                                        <input type="checkbox" id="HMixedBox" name="HMixedBox" lay-skin="primary" value="" lay-filter="HMixedBox">
+                                    </div>
+                                </div>
                             </div>
                             <div class="layui-inline">
                                 <div class="">
@@ -441,6 +447,7 @@
                             return util.toDateString(time, "yyyy-MM-dd");
                         }
                     }
+                    //, { field: 'HBarCode_Pack', title: '鏉″舰鐮�', width: 145 }
                     , { field: 'HSourceBillNo', title: '鏉″舰鐮�', width: 145 }
                     , { field: 'HBillNo', title: '婧愬崟鍗曞彿', width: 125 }
                     , { field: 'HBarCode', title: '鍞竴鐮�', width: 125 }
@@ -526,7 +533,7 @@
                         return;
                     }
                     //鍒ゆ柇瑁呯鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺
-                    if (zxQty > icmoQtyNow) {
+                    if (zxQty > icmoQtyNow && $("#HMixedBox").val()=="") {
                         playSound();
                         layer.msg("瑁呯鏁伴噺涓嶅厑璁稿ぇ浜庢祦杞崱鍓╀綑鏁伴噺锛佸墿浣欐暟閲忎负" + icmoQtyNow, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
                         return;
@@ -584,6 +591,24 @@
                     }
                 }
             });
+
+
+            form.on('checkbox(HMixedBox)', function (obj) {
+                if (icmoQtyNow == 0) {
+                    playSound();
+                    layer.msg("鍓╀綑鏁伴噺涓�" + icmoQtyNow + ",涓嶅厑璁告贩绠憋紒", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                    $("input[name='HMixedBox']").prop("checked", false);
+                    form.render('checkbox');
+                    return;
+                }
+                if (obj.value == "") {
+                    $("#HMixedBox").val("1");
+                } else {
+                    $("#HMixedBox").val("");
+                }
+
+            });
+           
 
             //瀛愪欢鏉$爜鍥炶溅鏂规硶
             $('#SubBarcode').on('keydown', function (event) {   //鎵潯褰㈢爜
@@ -688,7 +713,7 @@
                         url: GetWEBURL() + "/LEMS/SNBarcodeProcCtrl",
                         type: "GET",
                         async: false,
-                        data: { "SubBarcode": SubBarcode, "HProcExchBillNo": HProcExchBillNo },
+                        data: { "SubBarcode": SubBarcode, "HProcExchBillNo": HProcExchBillNo, "HMixedBox": $("#HMixedBox").val(), "HBillNo": HBillNo2 },
                         success: function (result) {
                             if (result.count == 0) {
                                 a = 1;
@@ -730,86 +755,93 @@
                                             layer.alert("鍖呰鏁伴噺宸茬瓑浜庢祦杞崱鏁伴噺锛佷笉鍏佽鎵爜锛�", { icon: 1 });
                                             return;
                                         } else {
-                                            $.ajax({//琛ㄤ綋瀛榯emp琛�
-                                                url: GetWEBURL() + "/LEMS/SaveSubBarcode_Json",
-                                                type: "GET",
-                                                async: false,
-                                                data: {
-                                                    "HBillNo": HBillNo
-                                                    , "SubBarcode": SubBarcode
-                                                    , "HInterID": HInterID
-                                                    , "HBillNo2": HBillNo2
-                                                    , "HBillType": HBillType
-                                                    , "sMaker": sMaker
-                                                    , "HBarCode": $("#HBarCode_wym").val()
-                                                    , "HNumber": $("#HNumber").val()
-                                                    , "HName": $("#HMaterName").val()
-                                                    , "HModel": $("#HModel").val()
-                                                },
-                                                success: function (result) {
-                                                    var data = result.data;
-                                                    if (result.Message == "璇ュ瓙浠舵潯鐮佸凡瀛樺湪") {
-                                                        playSound();
-                                                        layer.alert("璇ュ瓙浠舵潯鐮佸凡瀛樺湪", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                                                    } else {
-                                                        if (data[0].Column1 == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                                                            $('#SubBarcode').val("");
-                                                            $("#SubBarcode").focus();
-                                                            table.reload('smjl-table', {
-                                                                url: GetWEBURL1() + '/LEMS/Update_HBillNo_SubBarcodeList_Json'
-                                                                , where: {
-                                                                    HBillNo: HBillNo2
-                                                                    , HBarCode: HBillNo
-                                                                }
-                                                            });
-                                                            zxQtyFlag++;
-                                                            pcmQtyFlag++
-                                                            $("#zxQty").val("" + zxQtyFlag + "/" + zxQty + "");
-                                                            $("#pcmQty").val("" + pcmQtyFlag + "/" + pcmQty + "");
-                                                            layer.msg("鎵弿鎴愬姛", { time: 5000, icon: 6 });
-                                                            $.ajax({//鏌ヨ鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶
-                                                                url: GetWEBURL() + "/LEMS/Select_Gy_BarCodeBill_HQty",
-                                                                type: "GET",
-                                                                async: false,
-                                                                data: {
-                                                                    "HBarCode": $("#HBarCode_wym").val()
-                                                                },
-                                                                success: function (result) {
-                                                                    var HQty = result.data[0].HQty;
-                                                                    HQty++;
-                                                                    $.ajax({//鏇存柊鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶
-                                                                        url: GetWEBURL() + "/LEMS/Update_Gy_BarCodeBill_HQty",
-                                                                        type: "GET",
-                                                                        async: false,
-                                                                        data: {
-                                                                            "HBarCode": $("#HBarCode_wym").val(),
-                                                                            "HQty": HQty
-                                                                        },
-                                                                        success: function (result) {
-                                                                            var HQty = result.data;
-                                                                            ZJTMFlag = true;
-                                                                        }, error: function () {
-                                                                            playSound();
-                                                                            layer.alert("鏇存柊鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶鍙戠敓閿欒!", { icon: 5 });
-                                                                        }
-                                                                    });
-                                                                }, error: function () {
-                                                                    playSound();
-                                                                    layer.alert("鏌ヨ鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶鍙戠敓閿欒!", { icon: 5 });
-                                                                }
-                                                            });
-                                                        } else {
+                                            //鍒ゆ柇瑁呯鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺
+                                            if (AllHqty > icmoQtyNow && $("#HMixedBox").val() == "") {
+                                                playSound();
+                                                layer.msg("瑁呯鏁伴噺涓嶅厑璁稿ぇ浜庢祦杞崱鍓╀綑鏁伴噺锛佸墿浣欐暟閲忎负" + icmoQtyNow, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                                                return;
+                                            } else {
+                                                $.ajax({//琛ㄤ綋瀛榯emp琛�
+                                                    url: GetWEBURL() + "/LEMS/SaveSubBarcode_Json",
+                                                    type: "GET",
+                                                    async: false,
+                                                    data: {
+                                                        "HBillNo": HBillNo
+                                                        , "SubBarcode": SubBarcode
+                                                        , "HInterID": HInterID
+                                                        , "HBillNo2": HBillNo2
+                                                        , "HBillType": HBillType
+                                                        , "sMaker": sMaker
+                                                        , "HBarCode": $("#HBarCode_wym").val()
+                                                        , "HNumber": $("#HNumber").val()
+                                                        , "HName": $("#HMaterName").val()
+                                                        , "HModel": $("#HModel").val()
+                                                    },
+                                                    success: function (result) {
+                                                        var data = result.data;
+                                                        if (result.Message == "璇ュ瓙浠舵潯鐮佸凡瀛樺湪") {
                                                             playSound();
-                                                            // $("#verifycode").click();
-                                                            //layer.msg(result.Message, { icon: 5 });
-                                                            layer.alert("鎻掑叆缂撳瓨琛ㄥけ璐�", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                                                            layer.alert("璇ュ瓙浠舵潯鐮佸凡瀛樺湪", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                                                        } else {
+                                                            if (data[0].Column1 == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                                                $('#SubBarcode').val("");
+                                                                $("#SubBarcode").focus();
+                                                                table.reload('smjl-table', {
+                                                                    url: GetWEBURL1() + '/LEMS/Update_HBillNo_SubBarcodeList_Json'
+                                                                    , where: {
+                                                                        HBillNo: HBillNo2
+                                                                        , HBarCode: HBillNo
+                                                                    }
+                                                                });
+                                                                zxQtyFlag++;
+                                                                pcmQtyFlag++
+                                                                $("#zxQty").val("" + zxQtyFlag + "/" + zxQty + "");
+                                                                $("#pcmQty").val("" + pcmQtyFlag + "/" + pcmQty + "");
+                                                                layer.msg("鎵弿鎴愬姛", { time: 5000, icon: 6 });
+                                                                $.ajax({//鏌ヨ鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶
+                                                                    url: GetWEBURL() + "/LEMS/Select_Gy_BarCodeBill_HQty",
+                                                                    type: "GET",
+                                                                    async: false,
+                                                                    data: {
+                                                                        "HBarCode": $("#HBarCode_wym").val()
+                                                                    },
+                                                                    success: function (result) {
+                                                                        var HQty = result.data[0].HQty;
+                                                                        HQty++;
+                                                                        $.ajax({//鏇存柊鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶
+                                                                            url: GetWEBURL() + "/LEMS/Update_Gy_BarCodeBill_HQty",
+                                                                            type: "GET",
+                                                                            async: false,
+                                                                            data: {
+                                                                                "HBarCode": $("#HBarCode_wym").val(),
+                                                                                "HQty": HQty
+                                                                            },
+                                                                            success: function (result) {
+                                                                                var HQty = result.data;
+                                                                                ZJTMFlag = true;
+                                                                            }, error: function () {
+                                                                                playSound();
+                                                                                layer.alert("鏇存柊鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶鍙戠敓閿欒!", { icon: 5 });
+                                                                            }
+                                                                        });
+                                                                    }, error: function () {
+                                                                        playSound();
+                                                                        layer.alert("鏌ヨ鏉$爜妗f琛ㄩ噷鐨勯暛闆曟潯鐮佺殑鍚堣鏁伴噺鏂规硶鍙戠敓閿欒!", { icon: 5 });
+                                                                    }
+                                                                });
+                                                            } else {
+                                                                playSound();
+                                                                // $("#verifycode").click();
+                                                                //layer.msg(result.Message, { icon: 5 });
+                                                                layer.alert("鎻掑叆缂撳瓨琛ㄥけ璐�", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                                                            }
                                                         }
+                                                    }, error: function () {
+                                                        playSound();
+                                                        layer.alert("瀛愪欢鏉$爜鏂规硶鍙戠敓閿欒!", { icon: 5 });
                                                     }
-                                                }, error: function () {
-                                                    playSound();
-                                                    layer.alert("瀛愪欢鏉$爜鏂规硶鍙戠敓閿欒!", { icon: 5 });
-                                                }
-                                            });
+                                                });
+                                            }
                                         }
                                     }, error: function () {
                                         playSound();
@@ -994,6 +1026,9 @@
                     //娓呯┖鎵弿璁板綍鐨勮绠辨暟閲�
                     zxQtyFlag = 0;
                     pcmQtyFlag = 0;
+                    $("#HMixedBox").val("");
+                    $("input[name='HMixedBox']").prop("checked", false);
+                    form.render('checkbox');
                     //鑾峰彇鍗曟嵁鍙�
                     getBillno();
                     //鎵弿鏉$爜

--
Gitblit v1.9.1