ch
2022-11-17 d271cd6aa2c4d76e0dbe34e7aa8a8a498a20fd40
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -35,6 +35,14 @@
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs3">
                                <label class="layui-form-label" style="width:40px;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>
                    <div class="layui-tab layui-col-xs12" lay-filter="tab-MateOutBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
@@ -226,14 +234,6 @@
                                    </div>
                                </div>-->
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:40px;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>
                                <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                            </div>
@@ -357,8 +357,8 @@
                        </div>-->
                        <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                    </div>
            </div>
        </div>
            <!--</div>
        </div>-->
        <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
            <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">提交</button>
            <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
@@ -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) {
@@ -868,12 +817,6 @@
            //扫条码
            $('#HBarCode').on('keydown', function (event) {
                if (sQty == "") {
                    sQty = 0;
                }
                if (sHBillType == '-1') {
                    sSourceBillNo = ''
                }
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
@@ -994,7 +937,9 @@
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                if (sHBillType == '-1') {
                    sSourceBillNo = ''
                }
                if (sBarCode == '') {
                    playSound();
                    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
@@ -1020,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);
@@ -1047,11 +991,18 @@
                                $("#HSupID").val(result.data.HSupID);
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                sessionStorage["SourceFlag"] = true;
                                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                $("#HBillType").val(result.data.hSourceBillTypeField)
                                HSourceFlag = true;
                                //获取源单类型、源单单号
                                if (result.data.HSourceBillType == "3720") {
                                    $("#HBillType").empty();
                                    $("#HBillType").val("3720");
                                    var optionHtml = '';
                                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                                    $("#HBillType").append(optionHtml);
                                    layui.form.render('select');
                                    $("#HBillType").attr("readonly", "readonly");
                                }
                                else {
@@ -1061,7 +1012,7 @@
                                element.tabChange('tab-Kf_MateOutBill', '3');
                            }
                            else {
                                if (sessionStorage["SourceFlag"] == "true") {
                                if (HSourceFlag == true) {
                                    element.tabChange('tab-Kf_MateOutBill', '3');
                                }
                                else {
@@ -1069,11 +1020,18 @@
                                    //$("#HSupID").val(result.data.HSupID);
                                    $("#HDeptName").val(result.data.HDept);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    sessionStorage["SourceFlag"] = true;
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    $("#HBillType").val(result.data.hSourceBillTypeField)
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    if (result.data.HSourceBillType == "3720") {
                                        ("#HBillType").empty();
                                        $("#HBillType").val("3720");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    //else if (result.data.HSourceBillType == "1601") {
@@ -1123,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();
@@ -1162,38 +1128,44 @@
                var HPPQty = $("#HPPQty").val()
                var HFIFOWHID = $("#HFIFOWHID").val()
                var HPlanMode = $("#HPlanMode").val()
                if (HPPQty == "") {
                    HPPQty = 0;
                }
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                $.ajax({
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                    type: "GET",
                    data: { "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1204', "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "sMaker": sessionStorage["HUserName"], "sPPQty": HPPQty, "sPlanMode": HPlanMode, "sFIFOWHID": HFIFOWHID, "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        sessionStorage["SourceFlag"] = true;
                        HSourceFlag = true;
                        $("#HPlanMode").attr("disabled", "true");
                        $("#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");
                                }
                            });
@@ -1224,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);
@@ -1242,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;