wtt
2025-12-15 43fccc99f020ca4e495753650d7508110899d1b7
小卫过站控制添加
7个文件已修改
474 ■■■■■ 已修改文件
WebTM/WebTM.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_KeyElement_Sec.html 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_batch.html 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_batchKeyElement.html 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_checkPackage_Sec.html 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_checkSN.html 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站_小卫/Cj_ProcessItemStationPlatform_generateSNCode.html 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj.user
@@ -3,7 +3,7 @@
  <PropertyGroup>
    <NameOfLastUsedPublishProfile>D:\智云迈思\MES\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\智云迈思\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <ProjectView>ShowAllFiles</ProjectView>
    <ProjectView>ProjectFiles</ProjectView>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
    <Use64BitIISExpress />
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_KeyElement_Sec.html
@@ -80,6 +80,12 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;"placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="display:none">
                                            <label class="layui-form-label" style="width: 85px;">追溯单号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#EDEDED;" readonly>
@@ -294,6 +300,7 @@
        var option = [];
        var option2 = [];
        var rowarr = [];//关键件清单
        var previousHBarCode = "";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -341,6 +348,9 @@
                if ($('#HProcExchBillNo').val() == "") {
                    $('#HBarCode_SN').val("");
                    return layer.alert("请先选择流转卡")
                }
                if (!checkHSNAndDate(HBarCode_SN)) {
                    return
                }
@@ -708,7 +718,74 @@
            });
            return result;
        }
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
            // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        //加载历史过站清单信息
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_batch.html
@@ -55,6 +55,12 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="display:none">
                                            <label class="layui-form-label" style="width: 85px;" id="">当前批次:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBatchNo" lay-verify="HBatchNo" id="HBatchNo" style="background-color:#efefef4d;" readonly>
@@ -237,6 +243,7 @@
        var params = get_UrlVars();
        var HModName = "Cj_ProcessItemStationPlatform_batch";
        var option = [];
        var previousHBarCode = "";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -281,6 +288,9 @@
                if ($("#HBarCode_Batch").val() == "" || $("#HBarCode_Batch").val() == null) {
                    layer.msg("未扫批次码请先扫码");
                    $("#HBarCode_Batch").focus();
                    return
                }
                if (!checkHSNAndDate(HBarCode_SN)) {
                    return
                }
                if (HBarCode_SN) {
@@ -530,6 +540,75 @@
            });
        }
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
            // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        //删除单据
        function btn_Delete() {
            var checkStatus = table.checkStatus('mainTable')
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_batchKeyElement.html
@@ -64,11 +64,17 @@
                                                <input type="text" class="layui-input" name="HBarCode_BatchSec" lay-verify="HBarCode_BatchSec" id="HBarCode_BatchSec" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                        <div class="layui-inline" style="display: none">
                                            <label class="layui-form-label" style="width: 85px;">追溯单号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#EDEDED;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;"placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <!--<div class="layui-inline">
@@ -288,6 +294,7 @@
        var HModName2 = "Cj_ProcessItemStationPlatform_batchKeyElement2";
        var option = [];
        var option2 = [];
        var previousHBarCode = "";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -365,6 +372,9 @@
                if ($("#HBarCode_Batch").val() == "" || $("#HBarCode_Batch").val() == null) {
                    layer.msg("未扫批次码请先扫码");
                    $("#HBarCode_Batch").focus();
                    return
                }
                if (!checkHSNAndDate(HBarCode_SN)) {
                    return
                }
                if (HBarCode_SN) {
@@ -862,6 +872,74 @@
        }
        //#endregion
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
             // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        function get_Display(sWhere = '') {
            var ajaxLoad = layer.load();
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_checkPackage_Sec.html
@@ -80,6 +80,12 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;"placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="display:none">
                                            <label class="layui-form-label" style="width: 85px;">追溯单号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#EDEDED;" readonly>
@@ -294,6 +300,7 @@
        var option = [];
        var option2 = [];
        var rowarr = [];//关键件清单
        var previousHBarCode = "";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -342,7 +349,9 @@
                    $('#HBarCode_SN').val("");
                    return layer.alert("请先选择流转卡")
                }
                if (!checkHSNAndDate(HBarCode_SN)) {
                    return
                }
                if (HBarCode_SN) {
                    txtHBarCodeSN_KeyDown(HBarCode_SN);
@@ -709,7 +718,74 @@
            return result;
        }
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
            // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        //加载历史过站清单信息
        function get_Display(sWhere = '') {
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_checkSN.html
@@ -86,6 +86,12 @@
                                                <input type="text" class="layui-input" name="HSNNo" lay-verify="HSNNo" id="HSNNo" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;"placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <!--<div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px; color: red; ">打印模板</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
@@ -273,6 +279,7 @@
        var HModName = "Cj_ProcessItemStationPlatform_checkSN";
        //var HModName2 = "Cj_ProcessItemStationPlatform_batch2";
        var option = [];
        var previousHBarCode = "";
        //var option2 = [];
        //#endregion
@@ -304,6 +311,9 @@
        $('#HBarCode_SN').on('keydown', function (event) {
            var HBarCode = $('#HBarCode_SN').val();
            if (event.keyCode == 13) {
                if (!checkHSNAndDate(HBarCode)) {
                    return
                }
                //如果镭雕码不为空
                if (HBarCode) {
                    txtHBarCode_KeyDown(HBarCode);
@@ -563,6 +573,74 @@
            });
        }
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
            // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        //加载网格根据绑定工序和生产资源
        function get_Display(sWhere = '') {
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾_СÎÀ/Cj_ProcessItemStationPlatform_generateSNCode.html
@@ -84,6 +84,12 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;" id="">校验年月:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" placeholder="请输入年月格式如2501(共四位前两位代表年份后两位代表月份)">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">模板名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HPrintTemplate" id="HPrintTemplate" class="ForFilteringSchemes" lay-filter="HPrintTemplate"
@@ -270,6 +276,7 @@
        var HModName = "Cj_ProcessItemStationPlatform_generateSN";
        //var HModName2 = "Cj_ProcessItemStationPlatform_batch2";
        var option = [];
        var previousHBarCode = "";
        //var option2 = [];
        //#endregion
@@ -328,6 +335,10 @@
            if (event.keyCode == 13) {
                var HBarCode = $('#HBarCode_SN').val();
                if (event.keyCode == 13) {
                    if (!checkHSNAndDate(HBarCode)) {
                        return
                    }
                    //如果镭雕码不为空
                    if (HBarCode) {
                        txtHBarCode_KeyDown(HBarCode);
@@ -632,6 +643,75 @@
        }
        //校验 äº§å“å’Œå¹´æœˆ
        function checkHSNAndDate(HBarCode) {
            // 1. æ ¡éªŒHBarCode长度
            if (!HBarCode || HBarCode.length < 20) {
                layer.confirm("HBarCode长度不足20位");
                return false;
            }
            // 2. è§£æžHBarCode的年月日
            const yearLastDigit = HBarCode[12]; // ç¬¬13位(索引12),年份最后一位
            const monthCode = HBarCode[13].toUpperCase(); // ç¬¬14位,月份(N-Z)
            // è®¡ç®—年份(假设当前世纪,如2020-2029)
            const year = yearLastDigit;
            // è®¡ç®—月份(N=1, ..., Z=12)
            const validChars = "NPQRSTUVWXYZ";
            if (!validChars.includes(monthCode)) {
                layer.confirm("字符必须是 N, P-Z ä¹‹ä¸€ï¼ˆè·³è¿‡ O)");
                return false;
            }
            // è®¡ç®—月份:N=1, P=2, ..., Z=12
            const month = validChars.indexOf(monthCode) + 1;
            // 3. èŽ·å–è¾“å…¥æ¡†çš„å¹´æœˆï¼ˆæ ¼å¼NNMM,如2307表示2023å¹´7月)
            const checkDateInput = document.getElementById("HCheckDate");
            if (!checkDateInput) {
                layer.confirm("找不到HCheckDate输入框");
                return false;
            }
            const inputValue = checkDateInput.value.trim();
            if (!/^\d{4}$/.test(inputValue)) {
                layer.confirm("输入框格式错误(必须是NNMM,如2307)");
                return false;
            }
            const inputYear = inputValue.substring(1, 2); // NN(如23)
            const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MM(如07)
            // 4. æ ¡éªŒå¹´æœˆæ˜¯å¦ä¸€è‡´
            if (year !== inputYear || month !== inputMonth) {
                layer.confirm(
                    `年月不匹配:HBarCode=${year}å¹´${month}月,输入框=${inputYear}å¹´${inputMonth}月`
                );
                return false;
            }
            // 5. æ ¡éªŒå‰äº”位是否与上一次一致
            const currentFirstFive = HBarCode.substring(0, 5);
            if (previousHBarCode) {
                const previousFirstFive = previousHBarCode.substring(0, 5);
                if (currentFirstFive !== previousFirstFive) {
                    layer.confirm(
                        `前五位不一致:当前=${currentFirstFive},上一次=${previousFirstFive}`
                    );
                    return false;
                }
            }
            // 6. æ›´æ–°ä¸Šä¸€æ¬¡çš„HBarCode
            previousHBarCode = HBarCode;
            $("#HCheckDate").prop("readonly", true);
            console.log("校验通过");
            return true;
        }
        //加载网格根据绑定工序和生产资源
        function get_Display(sWhere = '') {
            var ajaxLoad = layer.load();