ch
2022-11-17 d271cd6aa2c4d76e0dbe34e7aa8a8a498a20fd40
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -395,7 +395,7 @@
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //将session的值赋值给界面控件,session值来源与上一次数据选择
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
@@ -413,10 +413,10 @@
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            var HSourceFlag = sessionStorage["SourceFlag"];
            var HSourceFlag = sessionStorage["SourceFlag"];//源单已标记
            //获取参数
            //获取参数(获取跳转过来的参数)
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
@@ -427,6 +427,8 @@
                }
                return vars;
            }
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
@@ -462,8 +464,7 @@
                //编辑加载数据
                var sInterID = $("#HInterID").val();
                table.render({
                    elem: '#wl-table'
                    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                    elem: '#wl-table'
                    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                    , toolbar: '#toolbarDemo'
                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
@@ -488,8 +489,6 @@
                });
            }
            //动态加载源单类型列表 new
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
@@ -498,12 +497,12 @@
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
            //判断是否新增
            //判断是否新增,如果是新增单据则获取最大单号和最大内码
            if (linterid == null || linterid == 0) {
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                    type: "GET",
                    data: { "HBillType": '1204' },
                    success: function (d) {
@@ -518,7 +517,7 @@
                RoadBillSub(linterid);
            }
            //选择仓库
            //选择仓库(事件)
            form.on('submit(HWHID-BT)', function () {
                layer.open({
                    type: 2
@@ -534,7 +533,8 @@
                    }
                })
            });
            //选择仓库
            //选择仓库(事件)
            form.on('submit(HFIFOWHID-BT)', function () {
                layer.open({
                    type: 2
@@ -550,7 +550,7 @@
                    }
                })
            });
            //选择仓位
            //选择仓位(事件)
            form.on('submit(HSpID-BT)', function () {
                layer.open({
                    type: 2
@@ -566,7 +566,7 @@
                    }
                })
            });
            //选择供应商
            //选择供应商(事件)
            form.on('submit(HSupID-BT)', function () {
                layer.open({
                    type: 2
@@ -583,39 +583,9 @@
                })
            });
            //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//弹窗类型
@@ -638,7 +608,7 @@
                    , btn2: function (index, layero) { }
                })
            });
            //选择发货
            //选择发货(事件)
            form.on('submit(HSecManagerID-BT)', function (data) {
                layer.open({
                    type: 2//弹窗类型
@@ -662,7 +632,7 @@
                })
            });
            //选择部门
            //选择部门(事件)
            form.on('submit(HDeptID-BT)', function () {
                layer.open({
                    type: 2
@@ -679,13 +649,17 @@
                })
            });
            //退出按钮(事件)
            form.on('submit(Cancel)', function () {
                sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    window.history.back();
                });
            })
            //编辑
            //编辑按钮(事件)
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
@@ -705,34 +679,9 @@
                // }
            });
            //$('#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) {
@@ -1016,7 +965,6 @@
                    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 == '仓库条码') {
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
@@ -1133,28 +1081,36 @@
                    }
                });
            }
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80 }
                    , { field: 'HQtyMust', title: '应发数量', width: 80 }
                    , { 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 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
                , totalRow: true
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , page: true
                    , 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();
@@ -1175,6 +1131,8 @@
                if (HPPQty == "") {
                    HPPQty = 0;
                }
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                $.ajax({
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                    type: "GET",
@@ -1185,28 +1143,29 @@
                        $("#HBillType").attr("disabled", "true");
                        element.tabChange('tab-MateOutBill', '2');
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            playSound1();
                            playSound1();//播放声音
                            layer.load(3)
                            table.render({
                                elem: '#wl-table'
                                , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                , toolbar: '#toolbarDemo'
                                , 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 }
                                ]]
                                , height: 500
                                , done: function () {
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1204', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#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);
                                    }
                                    else {
                                        layer.msg(result.Message);
                                    }
                                    layer.closeAll("loading");
                                }
                            });
@@ -1237,6 +1196,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);
@@ -1255,6 +1216,12 @@
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //数字正则(包含小数)
            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 ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;