duhe
2025-09-15 adebb0660a3414da01ca04e44bd6be4e23e1c664
WebTM/views/WMSɨÂëÄ£¿é/ÆäËûÈë¿â/Kf_OtherInBill_Check_PDA.html
@@ -92,14 +92,14 @@
                                                <label class="layui-form-label" style="width:60px;padding-left:0px;">单据号</label>
                                            </div>
                                            <div class="layui-col-xs9">
                                                <div class="layui-col-xs8">
                                                <div class="layui-col-xs10">
                                                    <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                                </div>
                                                <div class="layui-col-xs2">
                                                <!--<div class="layui-col-xs2">
                                                    <button type="button" lay-submit="" lay-filter="cmdHBillNo" class="layui-btn" id="cmdHBillNo" style="width: 45px; margin-left: 10px; padding-left: 12px">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-2px;"></i>
                                                    </button>
                                                </div>
                                                </div>-->
                                                <div class="layui-col-xs2" style="float: right;">
                                                    <button type="button" lay-submit="" lay-filter="HBillNo-BT" class="layui-btn" id="HBillNo-BT" style="width: 45px; margin-left: -5px;padding-left:12px">OK</button>
                                                </div>
@@ -298,7 +298,7 @@
            var listOption = [];
            var columns = "";
            var HModName = "Kf_OtherInBill_Check_PDA";
            var ModRightName = "CE_OtherIn";    //模块权限参数
            var ModRightName = "CE_OtherInCheck";    //模块权限参数
            var titleData = [];                 //不需要显示的字段
            var params = get_UrlVars();
            var OperationType = params[params[0]] == null ? 1 : params[params[0]];  //从缓存列表中返回数据类型(1新增、2从缓存列表中返回)
@@ -330,7 +330,7 @@
                        }
                        else {
                            layer.msg(d.Message, {
                                icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            }, function () { parent.location.href = "../../../views/index_Mobile.html"; });
                        }
                    },
@@ -429,48 +429,41 @@
            })
            //#endregion
            //#region  ç›‘听网格表体事件
            table.on('tool(wl-table)', function (obj) {
                var data = obj.data;
                //物料代码超链接
                if (obj.event == '物料代码') {                      //检查 obj.event æ˜¯å¦ç­‰äºŽå­—符串 '物料代码'。如果等于,则执行if循环
                    var HMaterNumber = data.物料代码.toString();    //声明变量HMaterNumber ä¸º data.物料代码
                    layer.open({                                    //使用 layer的open打开弹出 å±‚
                        type: 2                                     //表示弹出层的内容是一个 iframe
                        , area: ['100%', '100%']
                        , title: '及时库存信息'                     //设置弹出层的名字和变量
                        , closeBtn: 1                               //显示关闭按钮
                        , shade: 0.6                                //遮罩透明度
                        , maxmin: false                              //允许全屏最小化
                        , anim: 0                                   //0-6的动画形式,-1不开启
                        , content: '../../WMS扫码模块/库存查询/KF_ICInventoryByCLD_PDA.html?OperationType=2&HMaterNumber=' + HMaterNumber  //设置 iframe çš„ URL,URL ä¸­åŒ…含了查询参数,来调用所需要的值
                        , resize: false,                            //是否允许用户调整弹出大小
                        end: function () {  //当关闭时调用
                        }
                        , cancel: function () {  //点击取消时使用回调
                        }
                    })
                }
            });
             //#endregion
            //从缓存列表编辑功能跳转至单据模块
            if (OperationType == 2) {
                RoadBillMain(HBillNo_Temp);
                $("#HBillNo").val(HBillNo_Temp);
                GetMeesageByBillNo();
                $("#HBarCode").select();
                $("#HBarCode").focus();     //获取光标
                //显示表体明细
                DisBillEntryList();
                element.tabChange('tab-Kf_OtherInBill_Check_PDA', '2');
            }
            function RoadBillMain(HBillNo_Temp)//加载表头
            {
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + '/WEBSController/GetSourceBillList_BillCheck_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HBillNo": HBillNo_Temp, "HBillType": HBillType },
                    success: function (result) {
                        if (result.count == 1) {
                            $("#HInterID").val(result.data[0].HInterID);
                            $("#HBillNo").val(result.data[0].HBillNo);
                            $("#HBillNo").attr("disabled", "disabled");
                            $('#HBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                            $('#cmdHBillNo').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                            HInterID = $('#HInterID').val()
                            HBillNo = $('#HBillNo').val()
                        }
                        else {
                            layer.msg(result.Message, {
                                icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            }, function () {
                            });
                        }
                    },
                    complete: function (XHR, TS) { XHR = null },//回收资源
                    error: function (err) {
                        layer.msg("错误!" + err, {
                            icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                        });
                    }
                })
            }
            //#endregion
@@ -491,7 +484,7 @@
                        $("#HStockPlaceName").removeAttr("disabled");
                        $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                        layer.msg("仓库条码为空!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                            $("#HWHName").select();
                            $("#HWHName").focus();
@@ -519,7 +512,6 @@
                                    $("#HStockPlaceName").removeAttr("disabled");
                                    $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                }
                                element.tabChange('tab-Kf_OtherInBill_Check_PDA', '2');
                                //光标显示到条码上
                                $("#HBarCode").select();
                                $("#HBarCode").focus();
@@ -533,7 +525,7 @@
                                $("#HStockPlaceName").removeAttr("disabled");
                                $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                layer.msg(result.Message, {
                                    icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                    icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                }, function () {
                                    $("#HWHName").select();
                                    $("#HWHName").focus();
@@ -582,7 +574,7 @@
                        $("#HStockPlaceID").val("0");
                        $("#HStockPlaceName").val("");
                        layer.msg("仓位条码为空!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                            $("#HStockPlaceName").select();
                            $("#HStockPlaceName").focus();
@@ -602,7 +594,6 @@
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHName").val(result.data[0].HWhName);
                                $("#HWHID").val(result.data[0].HWHID);
                                element.tabChange('tab-Kf_OtherInBill_Check_PDA', '2');
                                //光标显示到条码上
                                $("#HBarCode").select();
                                $("#HBarCode").focus();
@@ -614,7 +605,7 @@
                                $("#HStockPlaceID").val("0");
                                $("#HStockPlaceName").val("");
                                layer.msg(result.Message, {
                                    icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                    icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                }, function () {
                                    $("#HStockPlaceName").select();
                                    $("#HStockPlaceName").focus();
@@ -658,8 +649,7 @@
            form.on('submit(cmdSaver)', function (data) {
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = table.cache['wl-table'];
                //拼接序列化的数据
                var sMainSub = sMainStr + ';' + HSourceBarCodeCtl;
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    layer.load(3);
@@ -668,7 +658,7 @@
                            type: "POST",
                            url: GetWEBURL() + "/WEBSController/set_SaveOtherInBill_BillCheck_Json",
                            async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                            data: { "oMain": sMainSub },
                            data: { "oMain": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
@@ -676,7 +666,7 @@
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增','关闭'],
                                        btn2: function () {
                                            if (OperationType == 2) {
                                                parent.location.href = "../../WMS扫码模块/其他入库/Kf_OtherInBillList_PDA.html";
                                                parent.location.href = "../../WMS扫码模块/其他入库/Kf_OtherInBill_CheckList_PDA.html";
                                            }
                                            else {
                                                parent.location.href = "../../../views/index_Mobile.html";
@@ -688,12 +678,12 @@
                                        });//新增
                                }
                                else {
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                            },
                            complete: function (XHR, TS) { XHR = null },//回收资源
                            error: function (err) {
                                layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        });
                    layer.closeAll("loading");
@@ -762,12 +752,12 @@
                                    }
                                    else {
                                        playSound();
                                        layer.msg(data.Message, { icon: 2, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                        layer.msg(data.Message, { icon: 2, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                                    }
                                },
                                complete: function (XHR, TS) { XHR = null },//回收资源
                                error: function (err) {
                                    layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                            });
                        layer.closeAll("loading");
@@ -834,7 +824,7 @@
                if ($('#HBillNo').val() == '') {
                    playSound();
                    layer.msg("单据号为空,无法重新同步单据!", {
                        icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                    }, function () {
                        $("#HBillNo").select();
                        $("#HBillNo").focus();
@@ -919,7 +909,7 @@
                                            else {
                                                playSound();
                                                layer.msg(result.Message, {
                                                    icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                                    icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                                }, function () {
                                                    element.tabChange('tab-Kf_OtherInBill_Check_PDA', '1');
                                                    $("#HBillNo").select();
@@ -929,7 +919,7 @@
                                        },
                                        complete: function (XHR, TS) { XHR = null },//回收资源
                                        error: function (err) {
                                            layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                            layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                                        }
                                    });
                                });//清空
@@ -938,7 +928,7 @@
                        else {
                            playSound();
                            layer.msg(result.Message, {
                                icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            }, function () {
                                element.tabChange('tab-Kf_OtherInBill_Check_PDA', '1');
                                $("#HBillNo").select();
@@ -993,7 +983,7 @@
                    if (HSourceBarCodeCtl == "Y") {
                        playSound();
                        layer.msg("校验条码,无需删除!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                            $("#HBarCode").select();
                            $("#HBarCode").focus();
@@ -1003,7 +993,7 @@
                    else if (sBarCode == "") {
                        playSound();
                        layer.msg("请扫描要删除的条码!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                            $("#HBarCode").select();
                            $("#HBarCode").focus();
@@ -1033,7 +1023,7 @@
                                else {
                                    playSound();
                                    layer.msg(data.Message, {
                                        icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                        icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                    }, function () {
                                        $("#HBarCode").select();
                                        $("#HBarCode").focus();
@@ -1044,7 +1034,7 @@
                            error: function (err) {
                                playSound();
                                layer.msg('错误' + err, {
                                    icon: 2, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                    icon: 2, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                }, function () {
                                    $("#HBarCode").select();
                                    $("#HBarCode").focus();
@@ -1059,7 +1049,7 @@
                    if (sBarCode == '') {
                        playSound();
                        layer.msg("条码为空,请扫描条码!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            icon: 0, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                        }, function () {
                            $("#HBarCode").select();
                            $("#HBarCode").focus();
@@ -1094,7 +1084,6 @@
                                        $("#HStockPlaceName").removeAttr("disabled");
                                        $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                    }
                                    element.tabChange('tab-Kf_OtherInBill_Check_PDA', '2');  //跳转页签
                                    return;//结束
                                }
                                else if (result.data.hBarTypeField == '仓位条码') {
@@ -1102,7 +1091,6 @@
                                    $("#HStockPlaceID").val(result.data.hSPIDField);
                                    $("#HWHName").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    element.tabChange('tab-Kf_OtherInBill_Check_PDA', '2');//跳转页签
                                    return;//结束
                                }
                                else if (result.data.hBarTypeField == '源单条码') {
@@ -1147,7 +1135,7 @@
                                                    else {
                                                        playSound();
                                                        layer.msg(result.Message, {
                                                            icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                                            icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                                        }, function () {
                                                        });
                                                    }
@@ -1170,7 +1158,7 @@
                            else {
                                playSound();
                                layer.msg(result.Message, {
                                    icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                    icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                }, function () {
                                    $("#HBarCode").select();
                                    $("#HBarCode").focus();
@@ -1181,7 +1169,7 @@
                        error: function (err) {
                            playSound();
                            layer.msg("错误!" + err, {
                                icon: 5, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                                icon: 5, time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            }, function () {
                                $("#HBarCode").select();
                                $("#HBarCode").focus();
@@ -1223,19 +1211,26 @@
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                } else if (data[i].name == '物料代码') {
                                    col.push({
                                        field: data[i].id, title: data[i].name, align: 'left', sort: true, width: 120, event: '物料代码', event: '物料代码', templet: function (d) {
                                            return '<span style="color: blue;">' + d.物料代码 + '</span>'
                                        }, style: 'cursor: pointer;'
                                    });
                                } else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            col.push({ field: data[i].id, title: data[i].name, align: 'left', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 });
                                            break;
                                        default:
                                        if (data[i].name == '数量' || data[i].name == '单据数量' || data[i].name == '条码个数') {
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', totalRow: true });
                                            col.push({ field: data[i].id, title: data[i].name, align: 'left', totalRow: true });
                                        } else if (data[i].name == '物料名称' || data[i].name == '规格型号') {
                                            col.push({ field: data[i].id, title: data[i].name, align: 'left', width: 180 });
                                        } else {
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center' });
                                            col.push({ field: data[i].id, title: data[i].name, align: 'left', width: 150 });
                                        }
                                    }
                                }
@@ -1352,15 +1347,15 @@
        //单据上传前判断
        function AllowLoadData(sSubStr) {
            if (HInterID == 0) {
                layer.msg("没有扫码信息,请先扫描单据条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                layer.msg("没有扫码信息,请先扫描单据条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (HBillNo == '') {
                layer.msg("没有扫码信息,请先扫描单据条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                layer.msg("没有扫码信息,请先扫描单据条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (sSubStr.length == 0) {
                layer.msg("没有扫码信息,请先扫描条码,确认无误后再提交!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                layer.msg("没有扫码信息,请先扫描条码,确认无误后再提交!", { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //判断是否已扫描物料条码
@@ -1372,7 +1367,7 @@
                    }
                }
                if (s == 0) {
                    layer.msg("没有扫描物料条码,请先扫描物料条码,确认无误后再提交!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    layer.msg("没有扫描物料条码,请先扫描物料条码,确认无误后再提交!", { icon: 5, btn: ['确认'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
            }