zzr99
2022-08-30 ac1336081a0d918319aed41b64a004161300a5f2
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherInBill_Fast.html
@@ -207,7 +207,7 @@
                        </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" id="Saver" lay-filter="Saver">提交</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
@@ -688,64 +688,106 @@
            });
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                // console.log(data);
                var sInterID = $('#HInterID').val()
                var sMaterID = data[0].HMaterID
                var sBillType = '1203'
                var sAuxPropID = data[0].HAuxPropID
                //var sMTONo = data[0].HMTONo
                var sMTONo = ''
                var sSourceInterID = data[0].HSourceInterID
                var sSourceEntryID = data[0].HSourceEntryID
                $.ajax(
                    {
                        type: "Get",
                        //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/OtherInBill/Delete_Json",
                        async: true,
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                                    , toolbar: '#toolbarDemo'
                                    , 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 }
                                    ]]
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                                //do something
                            });
                        }
                    });
                //var checkStatus = table.checkStatus('wl-table')
                //    , data = checkStatus.data;
                //// console.log(data);
                //var sInterID = $('#HInterID').val()
                //var sMaterID = data[0].HMaterID
                //var sBillType = '1203'
                //var sAuxPropID = data[0].HAuxPropID
                ////var sMTONo = data[0].HMTONo
                //var sMTONo = ''
                //var sSourceInterID = data[0].HSourceInterID
                //var sSourceEntryID = data[0].HSourceEntryID
                //$.ajax(
                //    {
                //        type: "Get",
                //        //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                //        url: GetWEBURL() + "/OtherInBill/Delete_Json",
                //        async: true,
                //        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                //        dataType: "json",
                //        success: function (data) {
                //            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                //                table.render({
                //                    elem: '#wl-table'
                //                    , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                //                    , toolbar: '#toolbarDemo'
                //                    , 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 }
                //                    ]]
                //                    , height: 500
                //                    , done: function () {
                //                        layer.closeAll("loading");
                //                    }
                //                });
                //            }
                //            else {
                //                layer.msg(data.Message, { icon: 2 });
                //            }
                //        },
                //        error: function (err) {
                //            layer.msg('错误' + err, {
                //                icon: 5,
                //                time: 20000
                //            }, function () {
                //                //do something
                //            });
                //        }
                //    });
            });
            //form.on('submit(Saver)', function (data) {//提交
            //    //灰度提交按钮Saver
            //    document.getElementById("Saver").disabled = true;
            //    //debugger;
            //    data.field.HSTOCKORGID = sessionStorage["OrganizationID"];//组织
            //    var sMainStr = JSON.stringify(data.field);
            //    //var hOrgID = sessionStorage["OrganizationID"];
            //    var sMain = sMainStr;
            //    var sSubStr = table.cache['wl-table'];
            //    var sSourceType = $("#HBillType").val();
            //    $.ajax(
            //        {
            //            type: "POST",
            //            url: GetWEBURL() + "/OtherInStockBill/set_SaveOtherInStockBill_Json",
            //            //url: "http://localhost:12761/OtherInStockBill/set_SaveOtherInStockBill_Json", //方法所在页面和方法名
            //            async: true,
            //            data: { "oMain": sMain },
            //            dataType: "json",
            //            success: function (data) {
            //                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
            //                    layer.msg(data.Message , { icon: 1 });
            //                    //
            //                    //Sub_ClearBill();
            //                    //
            //                    //灰度提交按钮Saver
            //                    document.getElementById("Saver").disabled = false;
            //                }
            //                else {
            //                    layer.msg(data.Message, { icon: 5 });
            //                    //灰度提交按钮Saver
            //                    document.getElementById("Saver").disabled = false;
            //                }
            //                layer.closeAll("loading");
            //            },
            //            error: function (err) {
            //                layer.msg("错误:" + err, { icon: 5 });
            //                //灰度提交按钮Saver
            //                document.getElementById("Saver").disabled = false;
            //            }
            //        });
            //});
            form.on('submit(Saver)', function (data) {//提交
                //灰度提交按钮Saver
@@ -757,36 +799,47 @@
                var sMain = sMainStr;
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/OtherInStockBill/set_SaveOtherInStockBill_Json",
                        //url: "http://localhost:12761/OtherInStockBill/set_SaveOtherInStockBill_Json", //方法所在页面和方法名
                        async: true,
                        data: { "oMain": sMain },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message , { icon: 1 });
                                //
                                //Sub_ClearBill();
                                //
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/OtherInStockBill/set_SaveOtherInStockBill_Json",
                            //url: "http://localhost:12761/OtherInStockBill/set_SaveOtherInStockBill_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.layui.admin.events.closeThisTabs();关闭页签
                                            //window.close();//关闭页面,浏览器有效,PDA无效
                                            parent.location.href = "../../../views/index.html"
                                        }//关闭
                                    }, function () { window.location.reload(); });//新增
                                }
                                else {
                                    layer.msg(data.Message, { icon: 5 });
                                    //灰度提交按钮Saver
                                    document.getElementById("Saver").disabled = false;
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.msg("错误:" + err, { icon: 5 });
                                //灰度提交按钮Saver
                                document.getElementById("Saver").disabled = false;
                            }
                            else {
                                layer.msg(data.Message, { icon: 5 });
                                //灰度提交按钮Saver
                                document.getElementById("Saver").disabled = false;
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.msg("错误:" + err, { icon: 5 });
                            //灰度提交按钮Saver
                            document.getElementById("Saver").disabled = false;
                        }
                    });
                        });
                }
                else {
                    layer.msg("数据不完整,不允许提交:", { icon: 5 });
                    //灰度提交按钮Saver
                    document.getElementById("Saver").disabled = false;
                }
            });
@@ -1048,9 +1101,12 @@
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                ,limit:3000
                , totalRow: true
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150 }
                    , { field: 'HQty', title: '重量', width: 150, totalRow: true }
                    , { field: 'HAuxQty', title: '箱数', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '应收数量', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
@@ -1213,6 +1269,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;