WebTM/views/WMSɨÂëÄ£¿é/¿Í»§ÌõÂëɨÃè/Gy_getCusBarCodeBill_PDA.html
@@ -92,6 +92,9 @@
                                    <div class="layui-col-xs8 layui-input-inline mobile">
                                        <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-col-xs2">
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdHBillNoChange">修改</button>
                                    </div>
                                </div>
                                <div class="layui-row">
                                    <div class="layui-col-xs3">
@@ -154,6 +157,8 @@
            var HMaker = sessionStorage["HUserName"]
            var HStockOrgID = sessionStorage["OrganizationID"]
            var option = [];
            var HLength_BarCode = 0;        //条码长度验证,取扫码的第一个条码的长度作为条码长度
            //条码统一前缀设置标记
            var HBarCode_Pre_Flag = 0;      //统一前缀设置标记[0:未设置,1已设置]
@@ -253,15 +258,25 @@
                    layer.msg("条码不能为空,请扫描条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (HLength_BarCode != 0 && HLength_BarCode != sBarCode.length) {
                    playSound();
                    layer.msg("条码长度不一致,请重新扫描条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    $('#HBarCode').val("");
                    return false;
                }
                if (HBarCode_Pre == "" || HBarCode_Pre_Flag != 1) {
                    playSound();
                    layer.msg("统一前缀不能为空,请设置统一前缀并确认!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    $('#HBarCode').val("");
                    return false;
                }
                if (sBarCode.indexOf(HBarCode_Pre) != 0) {
                    playSound();
                    layer.msg("条码前缀不为统一前缀,请检查条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    $('#HBarCode').val("");
                    return false;
                }
@@ -348,7 +363,7 @@
                            $("#HQty_Total").val(data1.data.length);
                            var data_Temp = [];                     //存放子表需要显示的数据
                            var data_temp_length = 20;              //通过缓存列表或新增进入页面时,子表显示的最大记录数
                            var data_temp_length = 10;              //通过缓存列表或新增进入页面时,子表显示的最大记录数
                            if (data1.data.length < data_temp_length) {
                                data_temp_length = data1.data.length;
                            }
@@ -365,6 +380,12 @@
                            option.data = data_Temp;
                            table.cache['wl-table'] = null;         //清空表格缓存数据
                            ins = table.render(option);
                            //获取当前单据第一个扫码成功的条码的长度
                            if (data1.data.length > 0) {
                                HLength_BarCode = data1.data[0]["HBarCode"].length;
                            }
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
@@ -400,6 +421,73 @@
            //#endregion
            //#endregion
            //#region ä¿®æ”¹å•据号
            //#region ä¿®æ”¹å•据号
            form.on('submit(cmdHBillNoChange)', function (data) {
                layer.prompt({ formType: 2, title: "请输入单据号!", value: HBillNo },
                    function (value, index) {
                        if (option.data!=null&& option.data.length > 0) {
                            layer.msg("当前单据已经存在扫码记录,不可以修改单据号!", { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                            return;
                        }
                        if (value == "") {
                            layer.msg("单据号不可以为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                            return;
                        }
                        if (judgeHBillNoIsInTempList(value)) {
                            HBillNo = value;
                            $("#HBillNo").val(HBillNo);
                        }
                        layer.close(index);
                    });
            });
            //#endregion
            //#region åˆ¤æ–­å•据号是否为缓存列表中的单据号,是则修改成功并设置统一前缀,否则修改失败。
            function judgeHBillNoIsInTempList(value) {
                //判断结果
                var judgeFlag = false;
                $.ajax({
                    type: "GET",
                    async: false,
                    url: GetWEBURL() + "/WEBSController/Gy_getCusBarCodeBill_judgeHBillNoIsInTempList",
                    data: { "HInterID": HInterID, "HBillType": HBillType, "HBillNo": value, "HMaker": HMaker, "HStockOrgID": HStockOrgID },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data == null) {
                            } else {
                                var data = result.data;
                                $("#HBarCode_Pre").val(data[0]["HBarCode_Pre"]);
                                HBarCode_Pre_Flag = 1;
                                //禁用确认按钮
                                $('#cmdHBarCode_Pre').addClass("layui-btn-disabled").attr("disabled", true);//按钮变为不可编辑状态
                                //禁用 ç»Ÿä¸€å‰ç¼€ æ–‡æœ¬æ¡†
                                $('#HBarCode_Pre').prop('disabled', true);                     //统一前缀 æ–‡æœ¬æ¡†ä¸å¯ç¼–辑
                            }
                            judgeFlag = true;
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, time: 100000, offset: 't', btn: ['确认'] }, function () { $("#HBarCode").focus(); });
                            judgeFlag = false;
                        }
                        layer.closeAll("loading");
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
                return judgeFlag;
            }
            //#endregion
            //#endregion
            //#region åŠŸèƒ½æŽ§ä»¶
            //#region æäº¤ä¸Šä¼ åŠŸèƒ½æŽ§ä»¶
            form.on('submit(cmdLoadData)', function (data) {