YL
2022-02-15 400728b318589a0638de1b815c79a7320f760dbc
WebTM/views/ÁìÁÏ·¢»õ/ÏúÊÛ³ö¿â/Kf_SellOutBill_Fast.html
@@ -237,6 +237,16 @@
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs" hidden controls>
                            <source src="../../video/jingbao.wav" type="audio/ogg">
                        </audio>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs2" hidden controls>
                            <source src="../../video/success.wav" type="audio/ogg">
                        </audio>
                    </div>
                </form>
            </div>
        </div>
@@ -381,6 +391,8 @@
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HBillType").val(d.data[0].HSourceBillType);
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        HSourceFlag = true;
                        //$("#HWHID").val(d.data[0].HWhID);
                        //$("#HStockPlaceID").val(d.data[0].HSPID);
                        //$("#HKeeperID").val(d.data[0].HKeeperID);
@@ -436,6 +448,7 @@
                    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                    , toolbar: '#toolbarDemo'
                    , defaultToolbar: []
                    , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                    , cols: [[
                        { type: 'radio' }
@@ -701,6 +714,7 @@
                                   , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                   , cellMinWidth: 80
                                   , toolbar: '#toolbarDemo'
                                   , defaultToolbar: []
                                   , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                   , cols: [[
                                      { type: 'radio' }
@@ -807,7 +821,12 @@
            //扫条码-直接调webservice
            $('#HBarCode').on('keydown', function (event) {
                var sBarCode = $('#HBarCode').val()//条码
                var sOldBarCode = $('#HBarCode').val()
                var HDeleteFlag = sOldBarCode.substring(0, 1);
                var sBarCode = sOldBarCode.slice(1);
                //var sBarCode = $('#HBarCode').val()//条码
                var sInterID = $("#HInterID").val()//单据号ID
                var sBillType = '1205'
                var sBillNo = $("#HBillNo").val()//单据号
@@ -818,71 +837,114 @@
                //var SourceFlag = sessionStorage["SourceFlag"];
                var sSourceBillNo = $("#HSourceBillNo").val();//源单号
                var sHBillType = $("#HBillType").val()  //源单类型-发货通知单:1402,销售订单1401
                var sBillType = '1205'
                if (sQty == "") {
                    sQty = 0;
                }
                if (event.keyCode == 13) {
                    if (sBarCode == '') {
                        layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                        return false;
                    }
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    $.ajax({
                        url: GetWEBURL() + "/SellOut/get_CheckTypeByBarCode_Json",
                        type: "GET",
                        data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sMaker, "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);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-Kf_SellOutBill', '3');  //跳转页签
                                }
                                else if (result.data.HBarType == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.HSPName);
                                    $("#HStockPlaceID").val(result.data.HSPID);
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                    $("#HNote").val(";一键扫码仓位条码");
                                    element.tabChange('tab-Kf_SellOutBill', '3');//跳转页签
                                }
                                else if (result.data.HBarType == '部门条码') {
                                    $("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HNote").val(";一键扫码部门条码");
                                    element.tabChange('tab-Kf_SellOutBill', '3');//跳转页签
                                }
                                else if (result.data.HBarType == '源单条码') {
                                    //$("#HSupName").val(result.data.HSupName);
                                    $("#HSupID").val(result.data.HSupID);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    if (result.data.HSourceBillType == "1402") {
                                        $("#HBillType").val("1402");
                    if (HDeleteFlag == "*") {
                        if (sBarCode != "") {
                            $('#HBarCode').val("");
                        }
                        $.ajax(
                            {
                                type: "Get",
                                url: GetWEBURL() + "/ProductIn/Delete_Json",
                                async: true,
                                data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode },
                                dataType: "json",
                                success: function (data) {
                                    if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                        playSound1();
                                        table.render({
                                            elem: '#wl-table'
                                            // , url: 'http://61.130.49.162:9090/WMSAPI///OtherInStockBill/DisBillEntryList_Webs_Json'
                                            , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                            , toolbar: '#toolbarDemo'
                                            , defaultToolbar: []
                                            , where: { HBillID: sInterID, HBillType: '1205', 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 }
                                                , { field: 'HInterID', title: '单据ID', width: 150, hide: true }
                                                , { field: 'HBilltype', title: '单据类型', width: 150, hide: true }
                                                , { field: 'Hbarcode', title: '条码编号', width: 150, hide: true }
                                                , { field: 'HSCWHID', title: '调出仓库ID', width: 150, hide: true }
                                                , { field: 'HSCSPID', title: '调出仓位ID', width: 150, hide: true }
                                                , { field: 'HAuxPropID', title: '辅助属性ID', width: 150, hide: true }
                                                , { field: 'HMTONo', title: 'MTO号', width: 150, hide: true }
                                                , { field: 'HMaterID', title: '物料ID', width: 150, hide: true }
                                            ]]
                                            // , data: [linterid]
                                            // , page: true
                                            //, height: 500
                                            , done: function () {
                                                layer.closeAll("loading");
                                            }
                                        })
                                    }
                                    else {
                                        playSound();
                                        layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    }
                                    else if (result.data.HSourceBillType == "1401") {
                                        $("#HBillType").val("1401");
                                    }
                                    else {
                                        $("#HBillType").val("手工录入");
                                    }
                                    $("#HNote").val(";一键扫码源单条码");
                                    element.tabChange('tab-Kf_SellOutBill', '3');
                                },
                                error: function (err) {
                                    playSound();
                                    layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                                else {
                                    if (HSourceFlag == "true") {
                                        element.tabChange('tab-Kf_SellOutBill', '3');
                            });
                    }
                    else {
                        var sBarCode = $('#HBarCode').val()
                        if (sBarCode == '') {
                            //
                            playSound();
                            layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                            //11
                            return false;
                        }
                        if (sBarCode != "") {
                            $('#HBarCode').val("");
                        }
                        $.ajax({
                            url: GetWEBURL() + "/SellOut/get_CheckTypeByBarCode_Json",
                            type: "GET",
                            data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sMaker, "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                            success: function (result) {
                                playSound1();
                                if (result.count == 1) {
                                    if (result.data.HBarType == '仓库条码') {
                                        $("#HWHNAME").val(result.data.HWhName);
                                        $("#HWHID").val(result.data.HWhID);
                                        $("#HStockPlaceName").val("");
                                        $("#HNote").val(";一键扫码仓库条码");
                                        element.tabChange('tab-Kf_SellOutBill', '3');  //跳转页签
                                    }
                                    else {
                                    else if (result.data.HBarType == '仓位条码') {
                                        $("#HStockPlaceName").val(result.data.HSPName);
                                        $("#HStockPlaceID").val(result.data.HSPID);
                                        $("#HWHNAME").val(result.data.HWhName);
                                        $("#HWHID").val(result.data.HWhID);
                                        $("#HNote").val(";一键扫码仓位条码");
                                        element.tabChange('tab-Kf_SellOutBill', '3');//跳转页签
                                    }
                                    else if (result.data.HBarType == '部门条码') {
                                        $("#HDeptName").val(result.data.HDeptName);
                                        $("#HDeptID").val(result.data.HDeptID);
                                        $("#HNote").val(";一键扫码部门条码");
                                        element.tabChange('tab-Kf_SellOutBill', '3');//跳转页签
                                    }
                                    else if (result.data.HBarType == '源单条码') {
                                        //$("#HSupName").val(result.data.HSupName);
                                        $("#HSupID").val(result.data.HSupID);
                                        //$("#HDeptName").val(result.data.HDeptName);
@@ -897,65 +959,119 @@
                                        else if (result.data.HSourceBillType == "1401") {
                                            $("#HBillType").val("1401");
                                        }
                                        //else if (result.data.HSourceBillType == "1601") {
                                        //    $("#HBillType").val("1601");
                                        //}
                                        $("#HNote").val(";物料条码");
                                        else {
                                            $("#HBillType").val("手工录入");
                                        }
                                        $("#HNote").val(";一键扫码源单条码");
                                        element.tabChange('tab-Kf_SellOutBill', '3');
                                    }
                                    else {
                                        if (HSourceFlag == "true") {
                                            element.tabChange('tab-Kf_SellOutBill', '3');
                                        }
                                        else {
                                            //$("#HSupName").val(result.data.HSupName);
                                            $("#HSupID").val(result.data.HSupID);
                                            //$("#HDeptName").val(result.data.HDeptName);
                                            $("#HDeptID").val(result.data.HDeptID);
                                            $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                            HSourceFlag = true;
                                            //获取源单类型、源单单号
                                            if (result.data.HSourceBillType == "1402") {
                                                $("#HBillType").val("1402");
                                            }
                                            else if (result.data.HSourceBillType == "1401") {
                                                $("#HBillType").val("1401");
                                            }
                                            //else if (result.data.HSourceBillType == "1601") {
                                            //    $("#HBillType").val("1601");
                                            //}
                                            $("#HNote").val(";物料条码");
                                            element.tabChange('tab-Kf_SellOutBill', '3');
                                        }
                                    }
                                    //$("#HSupID").val(result.data.HSupID);
                                    //$("#HSupName").val(result.data.HSupName);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    layer.load(3)
                                    table.render({
                                        elem: '#wl-table'
                                        // , url: 'http://61.130.49.162:9090/WMSAPI///OtherInStockBill/DisBillEntryList_Webs_Json'
                                        , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                        , toolbar: '#toolbarDemo'
                                        , defaultToolbar: []
                                        , where: { HBillID: sInterID, HBillType: '1205', 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 }
                                            , { field: 'HInterID', title: '单据ID', width: 150, hide: true }
                                            , { field: 'HBilltype', title: '单据类型', width: 150, hide: true }
                                            , { field: 'Hbarcode', title: '条码编号', width: 150, hide: true }
                                            , { field: 'HSCWHID', title: '调出仓库ID', width: 150, hide: true }
                                            , { field: 'HSCSPID', title: '调出仓位ID', width: 150, hide: true }
                                            , { field: 'HAuxPropID', title: '辅助属性ID', width: 150, hide: true }
                                            , { field: 'HMTONo', title: 'MTO号', width: 150, hide: true }
                                            , { field: 'HMaterID', title: '物料ID', width: 150, hide: true }
                                        ]]
                                        // , data: [linterid]
                                        // , page: true
                                        //, height: 500
                                        , done: function () {
                                            layer.closeAll("loading");
                                        }
                                    });
                                }
                                //$("#HSupID").val(result.data.HSupID);
                                //$("#HSupName").val(result.data.HSupName);
                                //$("#HDeptID").val(result.data.HDeptID);
                                //$("#HDeptName").val(result.data.HDeptName);
                                layer.load(3)
                                table.render({
                                    elem: '#wl-table'
                                    // , url: 'http://61.130.49.162:9090/WMSAPI///OtherInStockBill/DisBillEntryList_Webs_Json'
                              , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                              , toolbar: '#toolbarDemo'
                              , where: { HBillID: sInterID, HBillType: '1205', 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 }
                                  , { field: 'HInterID', title: '单据ID', width: 150, hide: true }
                                  , { field: 'HBilltype', title: '单据类型', width: 150, hide: true }
                                  , { field: 'Hbarcode', title: '条码编号', width: 150, hide: true }
                                  , { field: 'HSCWHID', title: '调出仓库ID', width: 150, hide: true }
                                  , { field: 'HSCSPID', title: '调出仓位ID', width: 150, hide: true }
                                  , { field: 'HAuxPropID', title: '辅助属性ID', width: 150, hide: true }
                                  , { field: 'HMTONo', title: 'MTO号', width: 150, hide: true }
                                  , { field: 'HMaterID', title: '物料ID', width: 150, hide: true }
                              ]]
                                    // , data: [linterid]
                                    // , page: true
                              //, height: 500
                              , done: function () {
                                  layer.closeAll("loading");
                              }
                                });
                                else {
                                    // $("#verifycode").click();
                                    //layer.msg(result.Message, { icon: 5 });
                                    //
                                    playSound();
                                    layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    //11
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                playSound();
                                layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                //11
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
                        });
                    }
                }
            });
            function playSound() {
                console.log("playSound");
                //var audio = document.getElementById("cs");
                //$("appendAut").html("");
                //if (audio == null)
                //$("appendAut").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
                //$("appendAut").attr("src","../../video/jingbao.wav")
                var audio = document.getElementById("cs");
                audio.play();
            }
            function playSound1() {
                console.log("playSound1");
                //var audio = document.getElementById("cs");
                //$("appendAut").html("");
                //if (audio == null)
                //$("appendAut").append('<audio id="cs" hidden controls> <source src = "../../video/success.wav" type = "audio/ogg"> </audio >');
                //$("appendAut").attr("src", "../../video/success.wav")
                var audio = document.getElementById("cs2");
                audio.play();
            }
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
@@ -1087,7 +1203,8 @@
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                  , toolbar: '#toolbarDemo'
                                    , toolbar: '#toolbarDemo'
                                    , defaultToolbar: []
                                  , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                  , cols: [[
                                      { type: 'radio' }