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>
@@ -256,7 +266,11 @@
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element;
                , element = layui.element;
            var option = [];
            //源单找货列表
            var ZHOption = {
@@ -302,6 +316,44 @@
            $("#HBillerID").hide();
            var HSourceFlag = sessionStorage["SourceFlag"];
            //初始化明细表格
            function set_InitGrid() {
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { 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 }
                ];
                option = {
                    id: 'wl-table'
                    , elem: '#wl-table'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , limit: 500 //每页默认显示的数量
                    , done: function (res, curr, count) {
                    }
                };
            }
            //判断是否登录 æœªç™»å½•则跳到登录页
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
@@ -327,7 +379,7 @@
        
            
            function  RoadBillMain(linterid)//加载表头-----不会走
            function  RoadBillMain(linterid)//加载表头
            {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
@@ -339,18 +391,18 @@
                        $("#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);
                        //$("#HSecManagerID").val(d.data[0].HSecManagerID);
                        //$("#HDeptID").val(d.data[0].HDeptID);
                        //$("#HBarCode").val(d.data[0].HBarCode);
                        //$("#HQty").val(d.data[0].HQty);
                        RoadSup();
                    }
                })
            }
            function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·-----不会走
            function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·
            {
                //var sInterID = $("#HInterID").val()
                var HSourceBillNo = $('#HSourceBillNo').val()
@@ -372,7 +424,7 @@
                                $("#HSupID").val(result.data[0].HSupID);
                                $("#HSupName").val(result.data[0].HSupName);
                                $("#HDeptID").val(result.data[0].HDeptID);
                                //$("#HDeptName").val(result.data[0].HDeptName);
                                $("#HDeptName").val(result.data[0].HDeptName);
                                //sessionStorage["SourceFlag"] = true;
                                element.tabChange('tab-SellOutBill', '2');
                                layer.load(3);
@@ -386,30 +438,37 @@
                }
            }
            function RoadBillSub(linterid)//加载表体-----不会走
            function RoadBillSub(linterid)//加载表体
            {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                var sInterID = $("#HInterID").val();
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                    , cellMinWidth: 80
                    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                    , toolbar: '#toolbarDemo'
                    , where: { HBillID: linterid, HBillType: '1205', sWhere: '' }
                    , defaultToolbar: []
                    , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                    , cols: [[
                        { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 80 }
                    , { field: 'HQtyMust', title: '应收数量', width: 80 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HBatchNo', title: '批次', width: 100 }
                    , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                    , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                        , { 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
                })
                    // , data: [linterid]
                    // , page: true
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
             
            //动态加载源单类型列表 new
@@ -435,6 +494,7 @@
                        $("#HBillNo").val(d.data[0].HBillNo);
                        //$("#HInterID").val('132522535');
                        //$("#HBillNo").val('421458026');
                        set_InitGrid();
                    }
                }); 
            }
@@ -490,37 +550,83 @@
                    }
                })
            });
            //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
                    , 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");
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '职员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../PublicPage/UserInformation.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HKeeper").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
            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");
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '职员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../PublicPage/UserInformation.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSecManager").val(checkStatus.data[0].HName);
                        $("#HSecManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
            form.on('submit(HDeptID-BT)', function () {//选择部门
                layer.open({
                    type: 2
@@ -545,8 +651,22 @@
            //编辑
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].HInterID.toString();
                    var HMaterID = data[0].HMaterID.toString();
                    var HAuxPropID = data[0].HAuxPropID.toString();
                    var HMTONo = data[0].HMTONo.toString();
                    var HWhID = data[0].HWhID.toString();
                    var HSPID = data[0].HSPID.toString();
                    var HSCWHID = data[0].HSCWHID.toString();
                    var HSCSPID = data[0].HSCSPID.toString();
                    var HBatchNo = data[0].HBatchNo.toString();
                    var HSourceInterID = data[0].HSourceInterID.toString();
                    var HSourceEntryID = data[0].HSourceEntryID.toString();
                    var HBillType = '1205';
                    var HBarCode = data[0].HBarCode.toString();
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
@@ -554,14 +674,17 @@
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?HInterID=' + HInterID + '&HMaterID = ' + HMaterID + '&HAuxPropID = ' + HAuxPropID + '& HMTONo = ' + HMTONo + '&HWhID = ' + HWhID + '&HSPID = ' + HSPID + '&HSCWHID = ' + HSCWHID + '&HSCSPID= ' + HSCSPID + '&HBatchNo= ' + HBatchNo + '&HSourceInterID= ' + HSourceInterID + '&HSourceEntryID= ' + HSourceEntryID + '&HBillType=  ' + HBillType + '&HBarCode=  ' + HBarCode + ''
                        , 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
                // }
            });
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            })
            //删除
            form.on('submit(cmdDelete)', function () {//删除
@@ -591,6 +714,7 @@
                                   , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                   , cellMinWidth: 80
                                   , toolbar: '#toolbarDemo'
                                   , defaultToolbar: []
                                   , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                   , cols: [[
                                      { type: 'radio' }
@@ -605,6 +729,7 @@
                                    , { field: 'HBatchNo', title: '批次', width: 100 }
                                    , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                    , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                                    , { field: 'HWHID', title: 'ck', width: 100 }
                                   ]]
                                    //, height: 500
                               })
@@ -696,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()//单据号
@@ -707,72 +837,115 @@
                //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": 0 },
                        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 {
                                        $("#HSupName").val(result.data.HSupName);
                                    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);
@@ -786,57 +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 }
                              ]]
                                    // , 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()
@@ -968,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' }
@@ -1055,7 +1291,7 @@
                        if (result.count == 1) {
                            ZHOption.data = result.data;
                            table.render(ZHOption);
                            layer.close(index);
                           // layer.close(index);
                            element.tabChange('tab-SellOutBill', '5');
                        }
                        else {