1
duhe
2023-12-27 647a874bed1dc715370dc0edc59c3a6c4a0b0d9d
WebTM/views/ÑéÊÕÈë¿â/ίÍâÈë¿â/Kf_EntrustInBill_Fast.html
@@ -315,6 +315,35 @@
            $("#HBillerID").hide();
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , limit: 3000
                , totalRow: true
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '应收数量', width: 150, totalRow: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HAuxPropName', title: '辅助属性', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    //, { field: 'HBatchNo', title: '批次', width: 150, hide: true }
                    , { field: 'HPieceQty', title: '条码数量', width: 150, totalRow: true }
                    , { field: 'HMaterID', title: 'HMaterID', width: 150, hide: true }
                    , { field: 'HAuxPropID', title: 'HAuxPropID', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: 'HSourceInterID', width: 150, hide: true }
                    , { field: 'HSourceEntryID', title: 'HSourceEntryID', width: 150, hide: true }
                    //, { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
@@ -337,6 +366,7 @@
            function RoadBillMain(linterid) {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    type: "GET",
                    data: { "HInterID": linterid },
                    success: function (d) {
@@ -408,7 +438,9 @@
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                RoadBillSub(linterid);
                //显示表体明细
                DisBillEntryList();
                //RoadBillSub(linterid);
                HSourceFlag = true;
            }
@@ -577,6 +609,57 @@
                })
            });
            //#region åˆ é™¤
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    layer.confirm("确认要删除吗,删除后将不可恢复!", { title: "删除确认" }, function (index) {
                        var sInterID = $("#HInterID").val()
                        var sBillNo = $("#HBillNo").val()
                        var sMaterID = data[0].HMaterID
                        var sAuxPropID = data[0].HAuxPropID
                        var sMTONo = ''
                        var sSourceInterID = data[0].HSourceInterID
                        var sSourceEntryID = data[0].HSourceEntryID
                        var HBillType = '1210';
                        var sHStockOrgID = sessionStorage["OrganizationID"]
                        layer.load(3)
                        $.ajax(
                            {
                                type: "Get",
                                url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json",
                                async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                                data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "HBillType": HBillType },
                                dataType: "json",
                                success: function (data) {
                                    if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        //显示表体明细
                                        DisBillEntryList();
                                    }
                                    else {
                                        layer.msg(data.Message, { icon: 2 });
                                    }
                                },
                                error: function (err) {
                                    layer.msg('错误' + err, {
                                        icon: 5,
                                        time: 20000
                                    }, function () {
                                    });
                                }
                            });
                        layer.close(index)
                    })
                }
                else {
                    layer.msg('请选择一行记录,进行删除!');
                }
            });
            //#endregion
            //关闭按钮
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
@@ -702,34 +785,37 @@
                                    //清空数量
                                    $("#HQty").val("");
                                    //显示表体明细
                                    layer.load(3);
                                    element.tabChange('tab-Kf_EntrustInBill', '2');
                                    table.render({
                                        elem: '#wl-table'
                                        //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                        , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                        , toolbar: '#toolbarDemo'
                                        , totalRow: true
                                        , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                                        , cols: [[
                                            { type: 'radio' }
                                            , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                                            , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                                        ]]
                                        // , data: [linterid]
                                        // , page: true
                                        , height: 500
                                        , done: function () {
                                            layer.closeAll("loading");
                                        }
                                    });
                                    DisBillEntryList();
                                    ////显示表体明细
                                    //layer.load(3);
                                    //element.tabChange('tab-Kf_EntrustInBill', '2');
                                    //table.render({
                                    //    elem: '#wl-table'
                                    //    //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                    //    , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                    //    , toolbar: '#toolbarDemo'
                                    //    , totalRow: true
                                    //    , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                                    //    , cols: [[
                                    //        { type: 'radio' }
                                    //        , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                                    //        , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                                    //    ]]
                                    //    // , data: [linterid]
                                    //    // , page: true
                                    //    , height: 500
                                    //    , done: function () {
                                    //        layer.closeAll("loading");
                                    //    }
                                    //});
                                }
                                else {
                                    playSound();
@@ -859,34 +945,37 @@
                                    }
                                }
                                //显示表体明细
                                layer.load(3);
                                element.tabChange('tab-Kf_EntrustInBill', '2');
                                table.render({
                                    elem: '#wl-table'
                                    //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                    , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                    , toolbar: '#toolbarDemo'
                                    , totalRow: true
                                    , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                                    , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HQty', title: '数量', width: 150, totalRow: true}
                                    , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                                    ]]
                                    // , data: [linterid]
                                    // , page: true
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                DisBillEntryList();
                                ////显示表体明细
                                //layer.load(3);
                                //element.tabChange('tab-Kf_EntrustInBill', '2');
                                //table.render({
                                //    elem: '#wl-table'
                                //    //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                //    , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                //    , toolbar: '#toolbarDemo'
                                //    , totalRow: true
                                //    , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                                //    , cols: [[
                                //    { type: 'radio' }
                                //    , { field: 'HQty', title: '数量', width: 150, totalRow: true}
                                //    , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                                //    ]]
                                //    // , data: [linterid]
                                //    // , page: true
                                //    , height: 500
                                //    , done: function () {
                                //        layer.closeAll("loading");
                                //    }
                                //});
                                //清空数量
                                $("#HQty").val("");
                            }
@@ -1062,33 +1151,37 @@
                            HSourceFlag = true;
                            layer.load(3);
                            element.tabChange('tab-Kf_EntrustInBill', '2');
                            table.render({
                                elem: '#wl-table'
                                //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                                , toolbar: '#toolbarDemo'
                                , totalRow: true
                                , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                                    , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                                ]]
                                // , data: [linterid]
                                // , page: true
                                , height: 500
                                , done: function () {
                                    layer.closeAll("loading");
                                }
                            });
                            //显示表体明细
                            DisBillEntryList();
                            //table.render({
                            //    elem: '#wl-table'
                            //    //, url: 'http://61.130.49.162:9090/WMSAPI///Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                            //    , url: GetWEBURL() + '/Kf_EntrustInBill/DisBillEntryList_Webs_Json'
                            //    , toolbar: '#toolbarDemo'
                            //    , totalRow: true
                            //    , where: { HBillID: sInterID, HBillType: '1210', sWhere: '' }
                            //    , cols: [[
                            //        { type: 'radio' }
                            //        , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                            //        , { field: 'HQtyMust', title: '应收数量', width: 150, 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 }
                            //    ]]
                            //    // , data: [linterid]
                            //    // , page: true
                            //    , height: 500
                            //    , done: function () {
                            //        layer.closeAll("loading");
                            //    }
                            //});
                        }
                        else {
                            // $("#verifycode").click();
@@ -1101,6 +1194,45 @@
                });
            }
            //#region æ˜¾ç¤ºç‰©æ–™åˆ—表信息
            function DisBillEntryList() {
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HBillType = '1210'
                var sHStockOrgID = sessionStorage["OrganizationID"];
                //刷新列表信息
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HStockOrgID": sHStockOrgID },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            listOption.data = result.data.Materlist;
                            table.render(listOption);
                            //console.log(result.data.list2);
                            var count = 0;
                            var count1 = 0;
                            for (var i = 0; i < result.data.Materlist.length; i++) {
                                count += result.data.Materlist[i].HQty;
                                count1 += result.data.Materlist[i].HPieceQty;
                            }
                            $("#HSumQtys").val(count);
                            $("#HBarcodeQtys").val(count1);
                            //return;
                        }
                        else {
                            layer.msg(result.Message);
                        }
                    }
                });
            }
            //#endregion
        });
        //以上为layui模块
        function GetHWHValue(obj)  //返回调入仓库