yusijie
2023-05-31 b94b49249478ac97272aa545439c682e70143e32
其他入库扫码删除
1个文件已修改
399 ■■■■■ 已修改文件
WebTM/views/验收入库/其他入库/Kf_OtherInBill_Fast.html 399 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherInBill_Fast.html
@@ -1107,183 +1107,244 @@
                var sMouldManagerCtl = 'N'
                var sFIFOCtl = 'N'
                var HBillType = '1203'
                //判断条码是否为空  new
                if (sBarCode == '') {
                    playSound();
                    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (sBarCode != "") {
                    $('#HBarCode').val("");
                    //sessionStorage["SourceFlag"] = false;
                }
                //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//非空验证
                $.ajax({
                    //url: "http://localhost:12761/OtherInStockBill/get_InfoByBarCode_Source_Json", //方法所在页面和方法名
                    url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                    type: "GET",
                    data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": HBillType, "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) {
                            if (result.data.hBarTypeField == '仓库条码') {
                                $("#HWHNAME").val(result.data.hWhNameField);
                                $("#HWHID").val(result.data.hWhIDField);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-Kf_OtherInBill', '2');  //跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '仓位条码') {
                                $("#HStockPlaceName").val(result.data.hSPNameField);
                                $("#HStockPlaceID").val(result.data.hSPIDField);
                                $("#HWHNAME").val(result.data.hWhNameField);
                                $("#HWHID").val(result.data.hWhIDField);
                                $("#HNote").val(";一键扫码仓位条码");
                                element.tabChange('tab-Kf_OtherInBill', '2');//跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '部门条码') {
                                $("#HDeptName").val(result.data.hDeptNameField);
                                $("#HDeptID").val(result.data.hDeptIDField);
                                $("#HNote").val(";一键扫码部门条码");
                                element.tabChange('tab-Kf_OtherInBill', '2');//跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '源单条码') {
                                $("#HSupName").val(result.data.hSupNameField);
                                $("#HSupID").val(result.data.hSupIDField);
                                $("#HDeptName").val(result.data.hDeptNameField);
                                $("#HDeptID").val(result.data.hDeptIDField);
                                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                HSourceFlag = true;
                                //获取源单类型、源单单号
                                if (result.data.hSourceBillType == "1241") {
                                    $("#HBillType").val("1241");
                var HDeleteFlag = sBarCode.substring(0, 1);
                if (HDeleteFlag == "*") {
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    var sBarCode_Del = sBarCode.slice(1);
                    $.ajax(
                        {
                            type: "Get",
                            url: GetWEBURL() + "/ProductIn/Delete_Json",
                            async: true,
                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HBarCode": sBarCode_Del },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    playSound1();
                                    table.render({
                                        elem: '#wl-table'
                                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                                        //, toolbar: '#toolbarDemo'
                                        , defaultToolbar: []
                                        , page: true
                                        , limit: 100
                                        , where: { HBillID: sInterID, HBillType: '1203', sWhere: '' }
                                        , cols: [[
                                            { type: 'radio' }
                                            , { field: 'HQty', title: '数量', width: 150 }
                                            , { field: 'HQtyMust', title: '应收数量', width: 150 }
                                            , { 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: 'HBarcodeQtys', title: '条码数量', width: 150 }
                                        ]]
                                        // , data: [linterid]
                                        // , page: true
                                        , height: 500
                                        , done: function () {
                                            layer.closeAll("loading");
                                        }
                                    })
                                    //清空数量
                                    $("#HQty").val("");
                                }
                                else {
                                    $("#HBillType").val("手工录入");
                                    playSound();
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                                $("#HNote").val(";一键扫码源单条码");
                                element.tabChange('tab-Kf_OtherInBill', '3');
                            },
                            error: function (err) {
                                playSound();
                                layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        });
                } else {
                    //判断条码是否为空  new
                    if (sBarCode == '') {
                        playSound();
                        layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                        //sessionStorage["SourceFlag"] = false;
                    }
                    //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//非空验证
                    $.ajax({
                        //url: "http://localhost:12761/OtherInStockBill/get_InfoByBarCode_Source_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                        type: "GET",
                        data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": HBillType, "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) {
                                if (result.data.hBarTypeField == '仓库条码') {
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-Kf_OtherInBill', '2');  //跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.hSPNameField);
                                    $("#HStockPlaceID").val(result.data.hSPIDField);
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HNote").val(";一键扫码仓位条码");
                                    element.tabChange('tab-Kf_OtherInBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '部门条码') {
                                    $("#HDeptName").val(result.data.hDeptNameField);
                                    $("#HDeptID").val(result.data.hDeptIDField);
                                    $("#HNote").val(";一键扫码部门条码");
                                    element.tabChange('tab-Kf_OtherInBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '源单条码') {
                                    $("#HSupName").val(result.data.hSupNameField);
                                    $("#HSupID").val(result.data.hSupIDField);
                                    $("#HDeptName").val(result.data.hDeptNameField);
                                    $("#HDeptID").val(result.data.hDeptIDField);
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    if (result.data.hSourceBillType == "1241") {
                                        $("#HBillType").val("1241");
                                    }
                                    else {
                                        $("#HBillType").val("手工录入");
                                    }
                                    $("#HNote").val(";一键扫码源单条码");
                                    element.tabChange('tab-Kf_OtherInBill', '3');
                                }
                                else {
                                    if (HSourceFlag == true) {
                                        element.tabChange('tab-Kf_OtherInBill', '3');
                                    }
                                    else {
                                        //$("#HSupName").val(result.data.HSupName);
                                        //$("#HSupID").val(result.data.HSupID);
                                        //$("#HDeptName").val(result.data.HDeptName);
                                        //$("#HDeptID").val(result.data.HDeptID);
                                        //$("#HSourceBillNo").val(result.data.HSourceBillNo);
                                        //sessionStorage["SourceFlag"] = true;
                                        //获取源单类型、源单单号
                                        //if (result.data.HSourceBillType == "1241") {
                                        //    $("#HBillType").val("1241");
                                        //}
                                        //else if (result.data.HSourceBillType == "1601") {
                                        //    $("#HBillType").val("1601");
                                        //}
                                        HSourceFlag = true;
                                        $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                        $("#HBillType").val(result.data.hSourceBillTypeField == null ? "1241" : result.data.hSourceBillTypeField);
                                        //获取源单类型、源单单号
                                        if (result.data.hSourceBillTypeField == "1241") {
                                            $("#HBillType").empty();
                                            $("#HBillType").val("1241");
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '入库申请单' + "</option>";
                                            $("#HBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        else {
                                            //$("#HBillType").empty();
                                            $("#HBillType").val("-1");
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                            $("#HBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        $("#HSourceBillNo").attr("readonly", "readonly");
                                        $("#HNote").val(";物料条码");
                                        element.tabChange('tab-Kf_OtherInBill', '3');
                                    }
                                }
                                //$("#HSupID").val(result.data.HSupID);
                                //$("#HSupName").val(result.data.HSupName);
                                //$("#HDeptID").val(result.data.HDeptID);
                                //$("#HDeptName").val(result.data.HDeptName);
                                layer.load(3)
                                //table.render({
                                //    elem: '#wl-table'
                                //    , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                                //    //, toolbar: '#toolbarDemo'
                                //    , where: { HBillID: sInterID, HBillType: '1203', sWhere: '' }
                                //    , cellMinWidth: 90
                                //    , cols: [[
                                //        { type: 'radio' }
                                //        , { field: 'HQty', title: '数量', width: 150 }
                                //        , { field: 'HQtyMust', title: '应收数量', width: 150 }
                                //        , { 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: 'HAuxPropID', title: '辅助属性', width: 150 }
                                //        , { field: 'HMTONo', title: 'MTO号', width: 150 }
                                //    ]]
                                //    , height: 500
                                //    , done: function () {
                                //        layer.closeAll("loading");
                                //    }
                                //});
                                $.ajax({
                                    url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_New_Json1',
                                    type: "GET",
                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: HBillType, sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                    success: function (result) {
                                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                            listOption.data = result.data.list;
                                            table.render(listOption);
                                            listOption1.data = result.data.list2;
                                            table.render(listOption1);
                                            //console.log(result.data.list2);
                                            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");
                                    }
                                });
                                //清空数量
                                $("#HQty").val("");
                            }
                            else {
                                if (HSourceFlag == true) {
                                    element.tabChange('tab-Kf_OtherInBill', '3');
                                }
                                else {
                                    //$("#HSupName").val(result.data.HSupName);
                                    //$("#HSupID").val(result.data.HSupID);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                    //$("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    //sessionStorage["SourceFlag"] = true;
                                    //获取源单类型、源单单号
                                    //if (result.data.HSourceBillType == "1241") {
                                    //    $("#HBillType").val("1241");
                                    //}
                                    //else if (result.data.HSourceBillType == "1601") {
                                    //    $("#HBillType").val("1601");
                                    //}
                                    HSourceFlag = true;
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "1241" : result.data.hSourceBillTypeField);
                                    //获取源单类型、源单单号
                                    if (result.data.hSourceBillTypeField == "1241") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("1241");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '入库申请单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else {
                                        //$("#HBillType").empty();
                                        $("#HBillType").val("-1");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    $("#HSourceBillNo").attr("readonly", "readonly");
                                    $("#HNote").val(";物料条码");
                                    element.tabChange('tab-Kf_OtherInBill', '3');
                                }
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                            //$("#HSupID").val(result.data.HSupID);
                            //$("#HSupName").val(result.data.HSupName);
                            //$("#HDeptID").val(result.data.HDeptID);
                            //$("#HDeptName").val(result.data.HDeptName);
                            layer.load(3)
                            //table.render({
                            //    elem: '#wl-table'
                            //    , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                            //    //, toolbar: '#toolbarDemo'
                            //    , where: { HBillID: sInterID, HBillType: '1203', sWhere: '' }
                            //    , cellMinWidth: 90
                            //    , cols: [[
                            //        { type: 'radio' }
                            //        , { field: 'HQty', title: '数量', width: 150 }
                            //        , { field: 'HQtyMust', title: '应收数量', width: 150 }
                            //        , { 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: 'HAuxPropID', title: '辅助属性', width: 150 }
                            //        , { field: 'HMTONo', title: 'MTO号', width: 150 }
                            //    ]]
                            //    , height: 500
                            //    , done: function () {
                            //        layer.closeAll("loading");
                            //    }
                            //});
                            $.ajax({
                                url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: HBillType, sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        listOption1.data = result.data.list2;
                                        table.render(listOption1);
                                        //console.log(result.data.list2);
                                        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");
                                }
                            });
                            //清空数量
                            $("#HQty").val("");
                            layer.closeAll("loading");
                        }
                        else {
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                        layer.closeAll("loading");
                    }
                });
                    });
                }
            }
            function playSound() {
                //var audio = document.getElementById("cs");