yangle
2022-11-30 3b5b27c8efa2bfb66eec07a1efd7a1f47cc029e6
WebTM/views/ÁìÁÏ·¢»õ/Éú²ú²¹ÁÏ/Kf_MateReplenishOutBill_Check_New.html
@@ -219,16 +219,29 @@
                $.ajax({
                    url: GetWEBURL() + "/WEBSController/GetSourceBillList_BillCheck_Json",
                    type: "GET",
                    data: { "HBillNo": lBillNo, "HBillType": '1254' },
                    data: { "HBillNo": lBillNo, "HBillType": HBillType },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                            $("#HWHID").val(result.data.hWhIDField);
                            $("#HWHNAME").val(result.data.hWhNameField);
                            $("#HStockPlaceName").val(result.data.hSPNameField);
                            $("#HStockPlaceID").val(result.data.hSPIDField);
                            if (result.data.hSPFlagField == "false") {
                                $("#HStockPlaceName").attr("readonly", "readonly");
                                $("#HSpID-BT").attr("disabled", "disabled");
                                //document.getElementById("HSpID-BT").disabled = false;
                            }
                            else {
                                $("#HStockPlaceName").removeAttr("readonly");
                                $("#HSpID-BT").removeAttr("disabled", "disabled");
                            }
                            $('#HInterID').val(result.data.hInterIDField)
                            $('#HBillNo').val(result.data.hBillNoField)
                            var HBillID = $('#HInterID').val()
                            $("#HBillNo").attr("readonly", "readonly");
                            HInterID = $('#HInterID').val()
                            HBillNo = $('#HBillNo').val()
                            element.tabChange('tab-Kf_MateReplenishOutBillCheck', '2');
                            //显示表体明细
@@ -281,15 +294,15 @@
                                $("#HStockPlaceID").val(result.data.hSPIDField);
                                $("#HStockPlaceName").val(result.data.hSPNameField);
                                //if (result.data.hSPFlagField == false) {
                                //    $("#HStockPlaceName").attr("readonly", "readonly");
                                //    $("#HSpID-BT").attr("disabled", "disabled");
                                //    //document.getElementById("HSpID-BT").disabled = false;
                                //}
                                //else {
                                //    $("#HStockPlaceName").removeAttr("readonly");
                                //    $("#HSpID-BT").removeAttr("disabled", "disabled");
                                //}
                                if (result.data.hSPFlagField == "false") {
                                    $("#HStockPlaceName").attr("readonly", "readonly");
                                    $("#HSpID-BT").attr("disabled", "disabled");
                                    //document.getElementById("HSpID-BT").disabled = false;
                                }
                                else {
                                    $("#HStockPlaceName").removeAttr("readonly");
                                    $("#HSpID-BT").removeAttr("disabled", "disabled");
                                }
                                $('#HInterID').val(result.data.hInterIDField)
                                $('#HBillNo').val(result.data.hBillNoField)
@@ -499,76 +512,40 @@
                var sMainStr = JSON.stringify(data.field);
                var sMain = sMainStr;
                var sSubStr = table.cache['wl-table'];
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json",
                            async: true,
                            data: { "oMain": sMain },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.confirm("生产补料单检验成功!" + data.Message + $("#HBillNo").val(), {
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                        btn2: function () {
                                            parent.location.href = "../../../views/index.html"
                                        }//关闭
                                    }, function () { window.location.reload(); });//新增
                                }
                                else {
                                    layer.msg(data.Message, { icon: 5 });
                                    //灰度提交按钮cmdSaver
                                    document.getElementById("Saver").disabled = false;
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.msg("错误:" + err, { icon: 5 });
                                //灰度提交按钮cmdSaver
                                document.getElementById("cmdSaver").disabled = false;
                layer.load(3);
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json",
                        async: true,
                        data: { "oMain": sMain },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.confirm("生产补料单检验成功!" + data.Message, {
                                    icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                    btn2: function () {
                                        parent.location.href = "../../../views/index.html"
                                    }//关闭
                                }, function () {
                                    linterid = 0;
                                    window.location.reload();
                                });//新增
                            }
                        });
                }
                else {
                    layer.msg("数据不完整,不允许提交:", { icon: 5 });
                    //灰度提交按钮cmdSaver
                    document.getElementById("Saver").disabled = false;
                }
            });
            //#endregion
            //#region ä¸Šä¼ å‰åˆ¤æ–­
            function AllowLoadData(sSubStr) {  //非空验证
                if ($("#HBillNo").val() == '') {
                    layer.msg("错误的单据号!", { icon: 5 });
                    return false;
                }
                if ($("#HInterID").val() == '') {
                    layer.msg("错误的单据内码!", { icon: 5 });
                    return false;
                }
                if (sSubStr == '' || sSubStr.length == 0) {
                    layer.msg("没有物料明细记录!", { icon: 5 });
                    return false;
                }
                if (sSubStr != '') {
                    for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                        if (parseFloat(sSubStr[i].HQty) > 0) {
                            s = 1;
                            else {
                                layer.msg(data.Message, { icon: 5 });
                                //灰度提交按钮cmdSaver
                                document.getElementById("Saver").disabled = false;
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.msg("错误:" + err, { icon: 5 });
                            //灰度提交按钮cmdSaver
                            document.getElementById("cmdSaver").disabled = false;
                        }
                    }
                    if (s == 0) {
                        layer.msg("生产补料记录未扫码!", { icon: 5 });
                        return false;
                    }
                }
                else {
                    return true;
                }
            }
                    });
            });
            //#endregion
            //#endregion