zzr99
2022-01-10 fdc31c8893b84e965b8af4bfff3edfad471df9b9
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -251,6 +251,7 @@
        $("#HMakerID").hide();
        $("#HBillerID").val(sessionStorage["HBillerID"]);
        $("#HBillerID").hide();
        var HSourceFlag = sessionStorage["SourceFlag"];
        //获取参数
@@ -280,6 +281,8 @@
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HBillType").val(d.data[0].HSourceBillType);
                    $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                    HSourceFlag = true;
                    //$("#HWHID").val(d.data[0].HWhID);
                    //$("#HKeeperID").val(d.data[0].HKeeperID);
                    //$("#HSecManagerID").val(d.data[0].HSecManagerID);
@@ -293,24 +296,26 @@
        function RoadBillSub(linterid)//加载表体
        {
            $("#HInterID").val(linterid);//修改时主表ID
            //编辑加载数据
            var sInterID = $("#HInterID").val();
            table.render({
                elem: '#wl-table'
                , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                //, cellMinWidth: 80
                //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillID: linterid, HBillType: '1204', sWhere: '' }
                , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                , cols: [[
                  { type: 'radio' }
                , { field: 'HSNO', title: '序号', width: 60 }
                , { field: 'HQty', title: '数量', width: 80 }
                , { field: 'HQtyMust', title: '应收数量', width: 80 }
                , { field: 'HMaterName', title: '物料名称', width: 90 }
                , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                , { field: 'HMaterModel', title: '规格型号', width: 90 }
                , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                , { field: 'HBatchNo', title: '批次', width: 90 }
                    { 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 }
                ]]
                // , data: [linterid]
                // , page: true
@@ -396,37 +401,87 @@
                }
            })
        });
        //form.on('submit(HKeeperID-BT)', function () {//选择保管
        //    layer.open({
        //        type: 2
        //        , area: ['100%', '100%']
        //        , title: '领料人列表'
        //        , shade: 0.6 //遮罩透明度
        //        , maxmin: true //允许全屏最小化
        //        , anim: 0 //0-6的动画形式,-1不开启
        //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
        //        , resize: false
        //        , cancel: function () {
        //            //$(".layui-btn").removeClass("layui-btn-disabled");
        //        }
        //    })
        //});
        //form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
        //    var sMainStr = JSON.stringify(data.field);
        //    layer.open({
        //        type: 2
        //        , area: ['100%', '100%']
        //        , title: '发料人列表'
        //        , shade: 0.6 //遮罩透明度
        //        , maxmin: true //允许全屏最小化
        //        , anim: 0 //0-6的动画形式,-1不开启
        //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
        //        , resize: false
        //        , cancel: function () {
        //            //$(".layui-btn").removeClass("layui-btn-disabled");
        //        }
        //    })
        //});
        form.on('submit(HKeeperID-BT)', function () {//选择保管
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '领料人列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: '职员列表'//标题
                , shift: 2//弹出动画
                , content: ['../../PublicPage/UserInformation.html', 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero) {//按钮【按钮一】的回调
                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                    if (checkStatus.data.length === 0) {
                        return layer.msg('请选择数据');
                    }
                    $("#HKeeper").val(checkStatus.data[0].HName);
                    $("#HKeeperID").val(checkStatus.data[0].HItemID);
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
        form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
            var sMainStr = JSON.stringify(data.field);
        form.on('submit(HSecManagerID-BT)', function (data) {//选择发货
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '发料人列表'
                , shade: 0.6 //遮罩透明度
                , maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
                , resize: false
                , cancel: function () {
                    //$(".layui-btn").removeClass("layui-btn-disabled");
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: '职员列表'//标题
                , shift: 2//弹出动画
                , content: ['../../PublicPage/UserInformation.html', 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero) {//按钮【按钮一】的回调
                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                    if (checkStatus.data.length === 0) {
                        return layer.msg('请选择数据');
                    }
                    $("#HSecManager").val(checkStatus.data[0].HName);
                    $("#HSecManagerID").val(checkStatus.data[0].HItemID);
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        });
        form.on('submit(HDeptID-BT)', function () {//选择部门
            layer.open({
                type: 2
@@ -470,12 +525,39 @@
        });
        //$('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
        //    var HBarCode = $('#HStockPlaceName').val()
        //    if (event.keyCode == 13) {
        //        //判断文本框是否有数据    new
        //        $.ajax({
        //            url: GetWEBURL() + "/Web/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-MateOutBill', '2');
        //                }
        //                else {
        //                    layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
        //                }
        //                layer.closeAll("loading");
        //            }
        //        });
        //    }
        //});
        //扫仓位
        $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
            var HBarCode = $('#HStockPlaceName').val()
            if (event.keyCode == 13) {
                //判断文本框是否有数据    new
                $.ajax({
                    url: GetWEBURL() + "/Web/GetSpName_Json",
                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
                    type: "GET",
                    data: { "HBarCode": HBarCode },
                    success: function (result) {
@@ -484,10 +566,12 @@
                            $("#HStockPlaceID").val(result.data[0].HItemID);
                            $("#HWHID").val(result.data[0].HWHID);
                            $("#HWHNAME").val(result.data[0].HWhName);
                            element.tabChange('tab-MateOutBill', '2');
                            element.tabChange('tab-ProductlnBill', '2');
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                        layer.closeAll("loading");
                    }
@@ -519,7 +603,7 @@
                       if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                           table.render({
                               elem: '#wl-table' 
                               , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                               , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                               //, cellMinWidth: 80
                               , toolbar: '#toolbarDemo'
                               , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
@@ -622,6 +706,7 @@
            }
            if (event.keyCode == 13) {
                if (sBarCode == '') {
                    playSound();
                    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
@@ -633,6 +718,7 @@
                }
                if (sHWHID == "184154") {
                    if (sHSPID == "0") {
                        playSound();
                        layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
@@ -640,7 +726,8 @@
                $.ajax({
                    url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                    type: "GET",
                    data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
                    //data: { "sCode": '1001456360', "sInterID": 122554, "HBillType": '1204', "sBillNo": 'MATO00000055', "sMaker": sessionStorage["HUserName"], "WhID": 484080, "SPID": 0, "sQty": 0, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": 'PPBOM202112226', "sSourceType": '3720', "HOWNERID": sessionStorage["OrganizationID"] },
                    data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data.HBarType == '仓库条码') {
@@ -712,7 +799,7 @@
                            layer.load(3)
                            table.render({
                                elem: '#wl-table' 
                          , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                          , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                          , toolbar: '#toolbarDemo'
                          , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                          , cellMinWidth: 90
@@ -738,6 +825,7 @@
                            });
                        }
                        else {
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
@@ -745,6 +833,15 @@
                });
            }
        });
        function playSound() {
            var audio = document.getElementById("cs");
            if (audio == null)
                $("body").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
            var audio = document.getElementById("cs");
            audio.play();
        }
        //扫源单
        $('#HSourceBillNo').on('keydown', function (event) {
@@ -764,7 +861,7 @@
                            layer.load(3)
                            table.render({
                                elem: '#wl-table' 
                                , url: GetWEBURL1() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                              , toolbar: '#toolbarDemo'
                              , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                              , cols: [[