ch
2023-03-03 1c10c76b47807b4de5cbd88710b861baf3e1c287
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBill_Fast.html
@@ -13,6 +13,9 @@
            height: auto;
            white-space: normal;
        }
        .layui-col-xs8 {
            width: 55.666667%;
        }
    </style>
</head>
<body>
@@ -38,8 +41,11 @@
                            <div class="layui-col-xs3">
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                            </div>
                            <div class="layui-col-xs8">
                            <div class="layui-col-xs5">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-col-xs2">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
                            </div>
                        </div>
                    </div>
@@ -73,6 +79,9 @@
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
@@ -102,7 +111,7 @@
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" style="display:none">...</button>
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" >...</button>
                                        </div>
                                    </div>
                                </div>
@@ -157,6 +166,7 @@
                                            <input type="text" name="HBillerID" id="HBillerID" lay-verify="HBillerID" autocomplete="off" class="layui-input">
                                            <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HMakerID" id="HMakerID" lay-verify="HMakerID" value="0" autocomplete="off" class="layui-input" style="display : none">
                                            <input type="hidden" name="HSTOCKORGID" id="HSTOCKORGID" lay-verify="HSTOCKORGID" value="0" autocomplete="off" class="layui-input" style="display : none">
                                        </div>
                                    </div>
                                </div>
@@ -216,6 +226,14 @@
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HBarCode_B" id="HBarCode_B" lay-verify="HBarCode_B" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">数量</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
@@ -307,7 +325,7 @@
                                        <label class="layui-form-label" style="width:60px;padding-left:0px;">条码数量</label>
                                    </div>
                                    <div class="layui-col-xs8 layui-input-inline mobile">
                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" value="0" autocomplete="off" class="layui-input">
                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-row">
@@ -387,6 +405,9 @@
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            $("#HSTOCKORGID").val(sessionStorage["OrganizationID"]);
            $("#HSTOCKORGID").hide();
            var HSourceFlag = sessionStorage["SourceFlag"];
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
@@ -496,7 +517,7 @@
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                    //url: GetWEBURL() + "/Web/UpdatePOInStockBillPrintQty", //方法所在页面和方法名
                    type: "GET",
                    data: { "HBillType": '1201' },
@@ -556,13 +577,19 @@
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                    , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceListNew.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择供应商
            form.on('submit(HSupID-BT)', function () {
                layer.open({
@@ -644,9 +671,9 @@
            //退出
            form.on('submit(Cancel)', function () {
                sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    window.close();
                });
            })
            //编辑
            form.on('submit(cmdModify)', function () {
@@ -680,41 +707,42 @@
                var sMTONo = ''
                var sSourceInterID = data[0].HSourceInterID
                var sSourceEntryID = data[0].HSourceEntryID
                var sMouldManagerCtl = 'N'
                var sFIFOCtl = 'N'
                $.ajax(
                    {
                        type: "Get",
                        //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/POStockInBill/Delete_Json",
                        //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
                        async: true,
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": '1103', },
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //layer.msg(data.Message, { icon: 1 });
                                table.render({
                                    elem: '#wl-table'
                                    //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Mate_Webs_Json'
                                    //, url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Mate_Webs_Json'
                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                    , cellMinWidth: 80
                                    , toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 100 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 200 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 200 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                        , { field: 'HBatchNo', title: '批次', width: 200 }
                                        , { field: 'HAuxPropID', title: '辅助属性', width: 200 }
                                        , { field: 'HMTONo', title: '计划跟踪号', width: 200 }
                                    ]]
                                    , height: 500
                                })
                            if (data.count == 1) {
                                $.ajax({
                                    url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_New_Json1',
                                    type: "GET",
                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                    success: function (result) {
                                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                            listOption.data = result.data.list;
                                            table.render(listOption);
                                            var count = 0;
                                            var count1 = 0;
                                            for (var i = 0; i < result.data.list.length; i++) {
                                                count += result.data.list[i].HQty;
                                                count1 += result.data.list[i].HPieceQty;
                                            }
                                            $("#HSumQtys").val(count);
                                            $("#HBarCodeQtys").val(count1);
                                            //return;
                                        }
                                        else {
                                            layer.msg(result.Message);
                                        }
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
@@ -794,8 +822,121 @@
                }
            });
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var sQty = $("#HQty").val();
                if (sQty == "") {
                    sQty = 0;
                }
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageBySourceBillNo();
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                GetMeesageBySourceBillNo();
            });
            //扫仓位
            $('#HStockPlaceName').on('keydown', function (event) {
                var HBarCode = $('#HStockPlaceName').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HStockPlaceName").val(result.data[0].HName);
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HWHID);
                                $("#HWHNAME").val(result.data[0].HWhName);
                                element.tabChange('tab-POStockInBill', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            //刷新明细页签
            table.render({
                elem: '#mx-table'
                // , url: 'http://localhost:8083/POStockInBill/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , height: 500
                , done: function () {
                }
            });
            //扫MES仓位
            $('#HMESSPName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HMESSPName').val();
                if (event.keyCode == 13) {
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) {
                                $("#HMESSPID").val(result.data[0].HWHID);
                                $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
                                $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
                                $.ajax({
                                    url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
                                    type: "GET",
                                    data: { "HERPWHID": result.data[0].HWHID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            $("#HWHID").val(result.data[0].HMESWHID);
                                            $("#HWHNAME").val(result.data[0].HMESWHNAME);
                                            $("#HMESSPName").attr("readonly", "readonly");//MES仓位只读HExplanation
                                            $("#HMESSPName").css("background-color", "#efefef4d");
                                        }
                                        else {
                                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                        }
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //扫条码
            $('#HBarCode').on('keydown', function (event) {  //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var sSubStr = table.cache['wl-table'];
                var sBarCode = $('#HBarCode').val()
                var sInterID = $("#HInterID").val()
@@ -806,12 +947,18 @@
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                // var Flag = sessionStorage["SourceFlag"];
                if (sQty == "") {
                    sQty = 0;
                }
                if (event.keyCode == 13) {
                var HDeleteFlag = sBarCode.substring(0, 1);
                var sBarCodeNew = sBarCode.slice(1);
                    if (sQty == "") {
                        sQty = 0;
                    }
                    //判断条码是否为空  new
                    if (sBarCode == '') {
                        playSound();
@@ -824,17 +971,18 @@
                    if (sQty != "") {
                        $('#HQty').val("");
                    }
                    if (sHWHID == "184154") {
                        if (sHSPID == "0") {
                            playSound();
                            layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return false;
                        }
                    }
                    //if (sHWHID == "184154") {
                    //    if (sHSPID == "0") {
                    //        playSound();
                    //        layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    //        return false;
                    //    }
                    //}
                    $.ajax({
                        url: GetWEBURL() + "/POStockInBill/get_CheckTypeByBarCode_Json",
                        url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                        type: "GET",
                        data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": true, "sSourceBillNo": sSourceBillNo, "sSourceType": '1103', "HOWNERID": sessionStorage["OrganizationID"] },
                        async: false,
                        data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sessionStorage["HUserName"], "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sessionStorage["OrganizationID"], "HScanStyle": "", "HCustom1": "", "HCustom2": "" },
                        success: function (result) {
                            if (result.count == 1) {
                                playSound1();
@@ -864,7 +1012,8 @@
                                    $("#HSupID").val(result.data.HSupID);
                                    $("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    $("#HBillType").val(result.data.hSourceBillTypeField)
                                    sessionStorage["SourceFlag"] = true;
                                    //获取源单类型、源单单号
                                    if (result.data.HSourceBillType == "1102") {
@@ -881,7 +1030,7 @@
                                    element.tabChange('tab-POStockInBill', '3');
                                }
                                else {
                                    if (sessionStorage["SourceFlag"] == "true") {
                                    if (HSourceFlag == true) {
                                        element.tabChange('tab-POStockInBill', '3');
                                    }
                                    else {
@@ -889,64 +1038,64 @@
                                        $("#HSupID").val(result.data.hSupIDField);
                                        //$("#HDeptName").val(result.data.HDept);
                                        //$("#HDeptID").val(result.data.HDeptID);
                                        $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                        sessionStorage["SourceFlag"] = true;
                                        //$("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                        //$("#HBillType").val(result.data.hSourceBillTypeField)
                                        HSourceFlag = true;
                                        //获取源单类型、源单单号
                                        if (result.data.hSourceBillTypeField == "1102") {
                                            $("#HBillType").empty();
                                            $("#HBillType").val("1102");
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '采购订单' + "</option>";
                                            $("#HBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        else if (result.data.hSourceBillTypeField == "1103") {
                                        if (result.data.hSourceBillTypeField == "1103") {
                                            $("#HBillType").empty();
                                            $("#HBillType").val("1103");
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '收料通知单' + "</option>";
                                            $("#HBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        else {
                                            $("#HBillType").val("手工录入");
                                            //$("#HBillType").val("-1");
                                        }
                                        $("#HSourceBillNo").attr("readonly", "readonly");
                                        $("#HNote").val(";物料条码");
                                        element.tabChange('tab-POStockInBill', '3');
                                    }
                                }
                                layer.load(3)
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                    , cellMinWidth: 115
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HQty', title: '数量', sort: true, width: 100 }
                                        , { field: 'HQtyMust', title: '应收数量', sort: true, width: 100 }
                                        , { field: 'HMaterNumber', title: '物料代码', sort: true, width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', sort: true, width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', sort: true, width: 200 }
                                        , { field: 'HSourceInterID', title: '源单主内码', sort: true, width: 200 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true, width: 200 }
                                        , { field: 'HSourceBillNo', title: '源单单号', sort: true, width: 200 }
                                        , { field: 'HBatchNo', title: '批次', sort: true, width: 200 }
                                    ]]
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                $.ajax({
                                    url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                    type: "GET",
                                    data: { HBillID: sInterID, HBillType: '1201', sWhere: '' },
                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                    success: function (result) {
                                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                            listOption.data = result.data.list;
                                            table.render(listOption);
                                            $("#HBarCode_B").val(result.data.list1[0].HBarCode);
                                            $("#HMaterName_B").val(result.data.list1[0].HMaterName);
                                            $("#HMaterModel_B").val(result.data.list1[0].HMaterModel);
                                            $("#HBatchNo_B").val(result.data.list1[0].HBatchNo);
                                            $("#HUnitName_B").val(result.data.list1[0].HUnitName);
                                            $("#HQty_B").val(result.data.list1[0].HQty);
                                            $("#HTMQty_B").val(result.data.list1[0].HTMQty);
                                            $("#HWHName_B").val(result.data.list1[0].HWHName);
                                            $("#HSPName_B").val(result.data.list1[0].HSPName);
                                            //$("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                            //$("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                            //$("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                            //$("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                            //$("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                            //$("#HQty_B").val(result.data.list2[0].HQty);
                                            //$("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                            //$("#HWHName_B").val(result.data.list2[0].HWHName);
                                            //$("#HSPName_B").val(result.data.list2[0].HSPName);
                                            var count = 0;
                                            var count1 = 0;
                                            for (var i = 0; i < result.data.list.length; i++) {
                                                count += result.data.list[i].HQty;
                                                count1 += result.data.list[i].HPieceQty;
                                            }
                                            $("#HSumQtys").val(count);
                                            $("#HBarCodeQtys").val(count1);
                                        }
                                        else {
                                            layer.msg(result.Message);
@@ -962,28 +1111,45 @@
                            layer.closeAll("loading");
                        }
                    });
            }
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , totalRow: true
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 80, totalRow: true}
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    //, { field: 'HBatchNo', title: '批次', width: 150 }
                    , { field: 'HPieceQty', title: '条码数量', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            });
        function playSound() {
            var audio = document.getElementById("cs");
            audio.play();
        }
        function playSound1() {
            var audio = document.getElementById("cs2");
            audio.play();
        }
        //扫源单
        $('#HSourceBillNo').on('keydown', function (event) {      //扫源单
            var HSourceBillNo = $('#HSourceBillNo').val()
            var sInterID = $("#HInterID").val()
            var sBillNo = $("#HBillNo").val()
            var HSourceBillType = $("#HBillType").val()
            if (event.keyCode == 13) {
                //判断文本框是否有数据    new
            }
            function playSound() {
                var audio = document.getElementById("cs");
                audio.play();
            }
            function playSound1() {
                var audio = document.getElementById("cs2");
                audio.play();
            }
            //扫源单
            function GetMeesageBySourceBillNo(obj) {
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                if (HSourceBillNo == "" || sInterID <= 0) {
                    layer.msg("源单号为空,或者内码不存在!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
@@ -998,22 +1164,22 @@
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            $("#HSupID").val(result.data[0].HSupID);
                            $("#HSupName").val(result.data[0].HSupName);
                            //$("#HDeptID").val(result.data[0].HDeptID);
                            //$("#HDeptName").val(result.data[0].HDeptName);
                            sessionStorage["SourceFlag"] = true;
                            layer.load(3);
                            element.tabChange('tab-POStockInBill', '2');
                            table.render({
                                elem: '#wl-table'
                                , cellMinWidth: 80
                                , totalRow: true
                                //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                //, toolbar: '#toolbarDemo'
                                , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HQty', title: '数量', sort: true, width: 100 }
                                    , { field: 'HQtyMust', title: '应收数量', sort: true, width: 100 }
                                    , { field: 'HQty', title: '数量', sort: true, width: 100, totalRow: true}
                                    , { field: 'HQtyMust', title: '应收数量', sort: true, width: 100, totalRow: true}
                                    , { field: 'HMaterNumber', title: '物料代码', sort: true, width: 200 }
                                    , { field: 'HMaterName', title: '物料名称', sort: true, width: 200 }
                                    , { field: 'HMaterModel', title: '规格型号', sort: true, width: 200 }
@@ -1021,6 +1187,7 @@
                                    , { field: 'HSourceEntryID', title: '源单子内码', sort: true, width: 200 }
                                    , { field: 'HSourceBillNo', title: '源单单号', sort: true, width: 200 }
                                    , { field: 'HBatchNo', title: '批次' }
                                    , { field: 'HPieceQty', title:'条码件数', width: 100 }
                                ]]
                                // , data: [linterid]
                                // , page: true
@@ -1038,95 +1205,11 @@
                        layer.closeAll("loading");
                    }
                });
                // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
            }
        });
        //扫仓位
        $('#HStockPlaceName').on('keydown', function (event) {
            var HBarCode = $('#HStockPlaceName').val()
            if (event.keyCode == 13) {
                //判断文本框是否有数据    new
                $.ajax({
                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
                    type: "GET",
                    data: { "HBarCode": HBarCode },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            $("#HStockPlaceName").val(result.data[0].HName);
                            $("#HStockPlaceID").val(result.data[0].HItemID);
                            $("#HWHID").val(result.data[0].HWHID);
                            $("#HWHNAME").val(result.data[0].HWhName);
                            element.tabChange('tab-POStockInBill', '2');
                        }
                        else {
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
                // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
            }
        });
        //刷新明细页签
        table.render({
            elem: '#mx-table'
            // , url: 'http://localhost:8083/POStockInBill/GetHBarCodeShowBillSub'
            //, toolbar: '#toolbarDemo'
            // , where: { sMsg: linterid, sMsg2: lentryid }
            , cols: [[
                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
            ]]
            , page: true
            , height: 500
            , done: function () {
            }
        });
        //扫MES仓位
        $('#HMESSPName').on('keydown', function (event) {      //扫仓位
            var HBarCode = $('#HMESSPName').val();
            if (event.keyCode == 13) {
                $.ajax({
                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
                    type: "GET",
                    data: { "HBarCode": HBarCode },
                    success: function (result) {
                        if (result.count == 1) {
                            $("#HMESSPID").val(result.data[0].HWHID);
                            $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
                            $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
                            $.ajax({
                                url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
                                type: "GET",
                                data: { "HERPWHID": result.data[0].HWHID },
                                success: function (result) {
                                    if (result.count == 1) {
                                        $("#HWHID").val(result.data[0].HMESWHID);
                                        $("#HWHNAME").val(result.data[0].HMESWHNAME);
                                        $("#HMESSPName").attr("readonly", "readonly");//MES仓位只读HExplanation
                                        $("#HMESSPName").css("background-color", "#efefef4d");
                                    }
                                    else {
                                        layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    }
                                    layer.closeAll("loading");
                                }
                            });
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
        });
                //以上为layui模块
            });
        //以上为layui模块
        //此处方法涉及到被外部页面parent.方法名调用的必须放在Layui方法外部
        function GetHWHValue(obj)  //返回调入仓库
        {
@@ -1137,6 +1220,8 @@
        function GetHSpValue(obj) {  //返回调入仓位
            $("#HStockPlaceName").val(obj[0].HName);
            $("#HStockPlaceID").val(obj[0].HItemID);
            $("#HWHNAME").val(obj[0].HWhName);
            $("#HWHID").val(obj[0].HWHID);
        }
        function GetHSupValue(obj) {  //返回供应商
            $("#HSupName").val(obj[0].HName);
@@ -1155,6 +1240,16 @@
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr, bnt) {  //非空验证
            //数字正则(包含小数)
            var reg = /^\d+(\.\d+)?$/;
            //if (reg.test($("#HQty").val()) == false || $("#HQty").val() == '') {
            //    layer.msg("数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            //if (reg.test($("#Qty_B").val()) == false || $("#Qty_B").val() == '') {
            //    layer.msg("数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;