yxj
2023-07-05 b98e50f48c720e4f608f19fc573032438ec5a812
销售出库、领料出库、直接调拨扫码模块整理、优化
3个文件已修改
1363 ■■■■ 已修改文件
WebTM/views/仓存管理/仓库调拨/Kf_MoveStockBill_Fast.html 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/销售出库/Kf_SellOutBill_Fast.html 1259 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/领料出库/Kf_MateOutBill_Fast.html 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/²Ö´æ¹ÜÀí/²Ö¿âµ÷²¦/Kf_MoveStockBill_Fast.html
@@ -29,7 +29,7 @@
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                            </div>
                            <div class="layui-col-xs2">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
@@ -41,7 +41,7 @@
                                    <label class="layui-form-label" style="width:40px;padding-left:0px;">数量</label>
                                </div>
                                <div class="layui-col-xs8">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
                                </div>
                            </div>
                        </div>
@@ -83,7 +83,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
@@ -96,7 +96,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">先进先出仓库</label><!--先进先出仓库-->
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" autocomplete="off" class="layui-input">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HFIFOWHID" id="HFIFOWHID" lay-verify="HFIFOWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
@@ -179,7 +179,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">调入仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -193,7 +193,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">调入仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -207,7 +207,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">调出仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSCWHNAME" id="HSCWHNAME" lay-verify="HSCWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSCWHNAME" id="HSCWHNAME" lay-verify="HSCWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSCWHID" id="HSCWHID" lay-verify="HSCWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -221,7 +221,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">调出仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HOutStockPlaceName" id="HOutStockPlaceName" lay-verify="HOutStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HOutStockPlaceName" id="HOutStockPlaceName" lay-verify="HOutStockPlaceName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HOutStockPlaceID" id="HOutStockPlaceID" lay-verify="HOutStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -235,7 +235,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">班组</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HGroupName" id="HGroupName" lay-verify="HGroupName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HGroupName" id="HGroupName" lay-verify="HGroupName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HGroupID" id="HGroupID" lay-verify="HGroupID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -249,7 +249,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">保管</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -263,7 +263,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">验收</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -277,7 +277,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">部门</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
WebTM/views/ÁìÁÏ·¢»õ/ÏúÊÛ³ö¿â/Kf_SellOutBill_Fast.html
@@ -30,7 +30,7 @@
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                            </div>
                            <div class="layui-col-xs2">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
@@ -42,7 +42,7 @@
                                    <label class="layui-form-label" style="width:40px;padding-left:0px;">数量</label>
                                </div>
                                <div class="layui-col-xs8">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
                                </div>
                            </div>
                        </div>
@@ -78,7 +78,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
@@ -106,7 +106,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">先进先出仓库</label><!--先进先出仓库-->
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" autocomplete="off" class="layui-input">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HFIFOWHID" id="HFIFOWHID" lay-verify="HFIFOWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
@@ -133,7 +133,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -147,7 +147,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -161,7 +161,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">客户</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -175,7 +175,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">保管</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -189,7 +189,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">发货</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -215,7 +215,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">部门</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -347,26 +347,47 @@
            //光标默认在源单号位置上
            $("#HSourceBillNo").focus();
            //源单找货列表
            var ZHOption = {
                elem: '#zh-table'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , limit: 100
                , cellMinWidth: 90
                , cols: [[
                    { field: '在库状态', title: '在库状态', width: 180 }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '批次', title: '批次' }
                    , { field: '数量', title: '数量' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '规格型号', title: '规格型号' }
                ]]
                , text: {
                    none: '暂无相关数据,请先扫描源单号!'
                }
            };
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
            $("#HStockPlaceName").val(sessionStorage["HSPName"]);
            $("#HDeptID").val(sessionStorage["HDeptID"]);
            $("#HDeptName").val(sessionStorage["HDept"]);
            $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
            $("#HSecManager").val(sessionStorage["HSecManager"]);
            $("#HKeeperID").val(sessionStorage["HKeeperID"]);
            $("#HKeeper").val(sessionStorage["HKeeper"]);
            $("#HMaker").val(sessionStorage["HUserName"]);
            $("#HMaker").hide();
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            $("#HDate").val(formatDate(sessionStorage["HDate"]));
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            //初始化表单插件
            set_InitFrom();
            //初始化表单插件
            function set_InitFrom() {
                //常规用法
                laydate.render({
                    elem: '#HDate'
                });
            }
            //明细信息
            var listOption = {
@@ -419,110 +440,24 @@
                }
            }
            var listOption1 = {
                elem: '#mx-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 150 }
                    , { field: 'HBarCode', title: '条码编号', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HBatchNo', title: '批号', width: 150 }
                    //, { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                    //, { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            //初始加载表格
            ZHOption.data = [];
            table.render(ZHOption);
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
            //$("#HWHID").val(sessionStorage["HWHID"]);
            //$("#HWHNAME").val(sessionStorage["HWHName"]);
            //$("#HStockPlaceID").val(sessionStorage["HSPID"]);
            //$("#HStockPlaceName").val(sessionStorage["HSPName"]);
            //$("#HSupID").val(sessionStorage["HSupID"]);
            //$("#HSupName").val(sessionStorage["HSupName"]);
            $("#HDeptID").val(sessionStorage["HDeptID"]);
            $("#HDeptName").val(sessionStorage["HDept"]);
            $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
            $("#HSecManager").val(sessionStorage["HSecManager"]);
            $("#HKeeperID").val(sessionStorage["HKeeperID"]);
            $("#HKeeper").val(sessionStorage["HKeeper"]);
            $("#HMaker").val(sessionStorage["HUserName"]);
            $("#HMaker").hide();
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            $("#HDate").val(formatDate(sessionStorage["HDate"]));
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            //初始化明细表格
            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: 'HAuxQty', 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: true
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , limit: 500 //每页默认显示的数量
                    , done: function (res, curr, count) {
                    }
                };
            }
            //判断是否登录 æœªç™»å½•则跳到登录页
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
                    icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
                }, function () { window.location.href = "../../user/login.html"; });
            }
            //失败提示音
            function playSound() {
                console.log("playSound");
                var audio = document.getElementById("cs");
                audio.play();
            }
            //成功提示音
            function playSound_OK() {
                console.log("playSound_OK");
                var audio = document.getElementById("cs2");
                audio.play();
            }
            //获取参数
@@ -544,16 +479,6 @@
            var HInterID_Temp = params[params[1]];  //从缓存列表中返回单据ID
            //初始化表单插件
            set_InitFrom();
            //初始化表单插件
            function set_InitFrom() {
                //常规用法
                laydate.render({
                    elem: '#HDate'
                });
            }
            //判断是否新增
            if (HInterID != 0) {
@@ -596,17 +521,17 @@
            function RoadBillMain(HInterID_Temp)//加载表头
            {
                layer.load(3)
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Web/GetPonderationBill",
                    url: GetWEBURL() + '/WEBSController/GetSourceBill_Temp_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HInterID": HInterID_Temp },
                    data: { "HInterID": HInterID_Temp, "HBillType": HBillType },
                    success: function (d) {
                        // console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HBillType").val(d.data[0].HSourceBillType == null ? "1402" : d.data[0].HSourceBillType);
                        //获取源单类型、源单单号
                        //获取源单类型
                        if (d.data[0].HSourceBillType == "1402") {
                            $("#HBillType").empty();
                            $("#HBillType").val("1402");
@@ -626,60 +551,157 @@
                            $("#HBillType").attr("readonly", "readonly");
                        }
                        else {
                            //$("#HBillType").val("-1");
                            $("#HBillType").empty();
                            $("#HBillType").val("-1");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '手工录入' + "</option>";
                            $("#HBillType").append(optionHtml);
                            layui.form.render('select');
                            $("#HBillType").attr("readonly", "readonly");
                        }
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        $("#HSourceBillNo").attr("disabled", "true");
                        HSourceFlag = true;
                        $("#HDeptID").val(d.data[0].HDeptID);
                        $("#HDeptName").val(d.data[0].HDeptName);
                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                        //$("#HWHID").val(d.data[0].HWhID);
                        //$("#HStockPlaceID").val(d.data[0].HSPID);
                        //$("#HKeeperID").val(d.data[0].HKeeperID);
                        //$("#HSecManagerID").val(d.data[0].HSecManagerID);
                        RoadSup();
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        if (d.data[0].HMulSourceBill == 0) {
                            $("#HSourceBillNo").attr("readonly", "readonly");
                        }
                        if (d.data[0].HDeptID != 0) {
                            $("#HDeptID").val(d.data[0].HDeptID);
                            $("#HDeptName").val(d.data[0].HDeptName);
                        }
                        $("#HSupID").val(d.data[0].HCusID);
                        $("#HSupName").val(d.data[0].HCusName);
                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                    }
                })
                layer.closeAll("loading");
            }
            function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·
            {
                //var sInterID = $("#HInterID").val()
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                //判断文本框是否有数据    new
                if (HSourceBillNo == "" || sInterID <= 0) {
                    layer.msg($('#HSourceBillNo').val(), { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
            //源单找货列表
            var ZHOption = {
                elem: '#zh-table'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , limit: 100
                , cellMinWidth: 90
                , cols: [[
                    { field: '在库状态', title: '在库状态', width: 180 }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '批次', title: '批次' }
                    , { field: '数量', title: '数量' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '规格型号', title: '规格型号' }
                ]]
                , text: {
                    none: '暂无相关数据,请先扫描源单号!'
                }
                else {
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/SellOut/get_GetXs_SeOutStockBillList",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HSupID").val(result.data[0].HSupID);
                                $("#HSupName").val(result.data[0].HSupName);
                                $("#HDeptID").val(result.data[0].HDeptID);
                                $("#HDeptName").val(result.data[0].HDeptName);
                                //sessionStorage["SourceFlag"] = true;
                                element.tabChange('tab-SellOutBill', '2');
                                layer.load(3);
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
            };
            var listOption1 = {
                elem: '#mx-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 150 }
                    , { field: 'HBarCode', title: '条码编号', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HBatchNo', title: '批号', width: 150 }
                    //, { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                    //, { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            //初始加载表格
            ZHOption.data = [];
            table.render(ZHOption);
            //初始化明细表格
            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: 'HAuxQty', 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: true
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , limit: 500 //每页默认显示的数量
                    , done: function (res, curr, count) {
                    }
                };
            }
            //function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·
            //{
            //    //var sInterID = $("#HInterID").val()
            //    var HSourceBillNo = $('#HSourceBillNo').val()
            //    var sInterID = $("#HInterID").val()
            //    var sBillNo = $("#HBillNo").val()
            //    var HSourceBillType = $("#HBillType").val()
            //    //判断文本框是否有数据    new
            //    if (HSourceBillNo == "" || sInterID <= 0) {
            //        layer.msg($('#HSourceBillNo').val(), { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //        return;
            //    }
            //    else {
            //        $.ajax({
            //            type: "GET",
            //            url: GetWEBURL() + "/SellOut/get_GetXs_SeOutStockBillList",
            //            async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
            //            data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
            //            success: function (result) {
            //                if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
            //                    $("#HSupID").val(result.data[0].HSupID);
            //                    $("#HSupName").val(result.data[0].HSupName);
            //                    $("#HDeptID").val(result.data[0].HDeptID);
            //                    $("#HDeptName").val(result.data[0].HDeptName);
            //                    //sessionStorage["SourceFlag"] = true;
            //                    element.tabChange('tab-SellOutBill', '2');
            //                    layer.load(3);
            //                }
            //                else {
            //                    layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //                }
            //                layer.closeAll("loading");
            //            }
            //        });
            //    }
            //}
            //function RoadBillSub(HInterID_Temp)//加载表体
            //{
@@ -780,21 +802,6 @@
            //    //RoadBillSub(HInterID_Temp);
            //}
            form.on('submit(HWHID-BT)', function () {//选择仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseListNew.html?Type=HWHID&HOrgID=' + HStockOrgID + '', 'yes']
                    , resize: false
                    , cancel: function () {
                    }
                })
            });
            //form.on('submit(HWHID-BT)', function () {//选择仓库
            //    layer.open({
            //        type: 2
@@ -810,52 +817,7 @@
            //        }
            //    })
            //});
            form.on('submit(HFIFOWHID-BT)', function () {//选择先进先出仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HFIFOWHID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(HSpID-BT)', function () {//选择仓位
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓位列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(HSupID-BT)', function () {//选择客户
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '客户列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_CustomerList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //form.on('submit(HKeeperID-BT)', function () {//选择保管
            //    layer.open({
            //        type: 2
@@ -887,99 +849,6 @@
            //        }
            //    })
            //});
            form.on('submit(HKeeperID-BT)', function () {//选择保管
                layer.open({
                    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) {//选择发货
                layer.open({
                    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
                    , area: ['100%', '100%']
                    , title: '部门列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //退出按钮
            form.on('submit(Cancel)', function () {
                var sInterID = $("#HInterID").val()
                var HBillType = '1205'
                $.ajax(
                    {
                        type: "Get",
                        url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HInterID": sInterID, "HBillType": HBillType },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                            });
                        }
                    });
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                });
            })
            //编辑
            //form.on('submit(cmdModify)', function () {//编辑
@@ -1017,223 +886,6 @@
            //        layer.msg('请选择一行数据编辑!');
            //    }
            //})
            form.on('submit(cmdModify)', function () {//编辑
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '明细列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?HInterID=' + data[0].HInterID + '&HMaterID =' + data[0].HMaterID + '&HBillType =' + data[0].HBillType, 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                    , end: function () {
                        //显示表体明细
                        DisBillEntryList();
                    }
                })
                }
                else {
                    layer.msg('请先选择一行记录,进行编辑!');
                }
                // }
            });
            //删除功能控件
            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 = '1205';
                        var sHStockOrgID = sessionStorage["OrganizationID"]
                        $.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('请选择一行记录,进行删除!');
                }
            });
            //提交
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    //var flage = true;
                    //for (var i = 0; i < sSubStr.length; i++) {
                    //    if (sSubStr[i].HQty == 0) {
                    //        flage = false;
                    //    }
                    //}
                    //if (!flage) {
                    //    layer.confirm('实际扫描卷数为0小于找货单数量!是否继续提交?', {
                    //        btn: ['ç»§ç»­', '取消'], skin: 'layui-layer-lan', title: "温馨提示"
                    //    }, function () {
                    //        Saver(sMainStr);
                    //    }, function () {
                    //        layer.closeAll("loading");
                    //    });
                    //} else {
                        Saver(sMainStr);
                    //}
                }
            });
            //提交方法调用的ajax
            function Saver(sMainStr) {
                layer.load(1);
                $.ajax(
                    {
                        type: "POST",
                        // url: "http://61.130.49.162:9090/WMSAPI///SellOut/set_SaveSellOutBill_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/SellOut/set_SaveSellOutBill_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "oMain": sMainStr },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                layer.confirm(data.Message, {
                                    icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                    btn2: function () {
                                        //parent.layui.admin.events.closeThisTabs();关闭页签
                                        //window.close();//关闭页面,浏览器有效,PDA无效
                                        parent.location.href = "../../../views/index.html";
                                    }//关闭
                                }, function () {
                                    //sessionStorage["SourceFlag"] = false;
                                    //window.location.reload();
                                    location.replace('Kf_SellOutBill_Fast.html?OperationType=1&HInterID=0');
                                });//新增
                            }
                            else {
                                layer.msg(data.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: "温馨提示" });
                        }
                    });
            }
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HStockPlaceName").val(result.data[0].HName);
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HWHID);
                                $("#HWHNAME").val(result.data[0].HWhName);
                                element.tabChange('tab-SellOutBill', '2');
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //扫仓库
            $('#HWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HWHNAME').val()
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg('无仓库条码信息!');
                        return;
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //$("#HStockPlaceName").val(result.data[0].HName);
                                //$("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HItemID);
                                $("#HWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-SellOutBill', '3');
                                //扫源单成功后,光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            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");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            ////扫条码
            //$('#HBarCode').on('keydown', function (event) {
@@ -1310,7 +962,6 @@
            //    }
            //});
            //刷新明细页签
            table.render({
                elem: '#mx-table'
@@ -1355,7 +1006,6 @@
            //    }
            //});
            //扫源单查货
            function GetSellOutFindSP() {
                var HSourceBillNo = $('#HSourceBillNo').val();
@@ -1382,9 +1032,448 @@
            //#region åŸºç¡€èµ„料选择
            //#region å…ˆè¿›å…ˆå‡ºä»“库
            //扫描先进先出仓库
            $('#HFIFOWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HFIFOWHNAME').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HFIFOWHID").val(result.data[0].HItemID);
                                $("#HFIFOWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-SellOutBill', '1');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //选择先进先出仓库
            form.on('submit(HFIFOWHID-BT)', function () {//选择先进先出仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HFIFOWHID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //#endregion
            //#region ä»“库
            //扫仓库
            $('#HWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HWHNAME').val()
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg('无仓库条码信息!');
                        return;
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //$("#HStockPlaceName").val(result.data[0].HName);
                                //$("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HItemID);
                                $("#HWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-SellOutBill', '2');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            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");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            form.on('submit(HWHID-BT)', function () {//选择仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseListNew.html?Type=HWHID&HOrgID=' + HStockOrgID + '', 'yes']
                    , resize: false
                    , cancel: function () {
                    }
                })
            });
            //#endregion
            //#region ä»“位
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HStockPlaceName").val(result.data[0].HName);
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HWHID);
                                $("#HWHNAME").val(result.data[0].HWhName);
                                element.tabChange('tab-SellOutBill', '2');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            form.on('submit(HSpID-BT)', function () {//选择仓位
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓位列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //#endregion
            //#region å®¢æˆ·
            form.on('submit(HSupID-BT)', function () {//选择客户
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '客户列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_CustomerList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //#endregion
            //#region ä¿ç®¡
            form.on('submit(HKeeperID-BT)', function () {//选择保管
                layer.open({
                    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) { }
                })
            });
            //#endregion
            //#region å‘è´§
            form.on('submit(HSecManagerID-BT)', function (data) {//选择发货
                layer.open({
                    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) { }
                })
            });
            //#endregion
            //#region éƒ¨é—¨
            form.on('submit(HDeptID-BT)', function () {//选择部门
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '部门列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //#endregion
            //#endregion
            //#region åŠŸèƒ½æŽ§ä»¶
            //#region æäº¤
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    //var flage = true;
                    //for (var i = 0; i < sSubStr.length; i++) {
                    //    if (sSubStr[i].HQty == 0) {
                    //        flage = false;
                    //    }
                    //}
                    //if (!flage) {
                    //    layer.confirm('实际扫描卷数为0小于找货单数量!是否继续提交?', {
                    //        btn: ['ç»§ç»­', '取消'], skin: 'layui-layer-lan', title: "温馨提示"
                    //    }, function () {
                    //        Saver(sMainStr);
                    //    }, function () {
                    //        layer.closeAll("loading");
                    //    });
                    //} else {
                    Saver(sMainStr);
                    //}
                }
            });
            //提交方法调用的ajax
            function Saver(sMainStr) {
                layer.load(3);
                $.ajax(
                    {
                        type: "POST",
                        // url: "http://61.130.49.162:9090/WMSAPI///SellOut/set_SaveSellOutBill_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/SellOut/set_SaveSellOutBill_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "oMain": sMainStr },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                layer.confirm(data.Message, {
                                    icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                    btn2: function () {
                                        //parent.layui.admin.events.closeThisTabs();关闭页签
                                        //window.close();//关闭页面,浏览器有效,PDA无效
                                        parent.location.href = "../../../views/index.html";
                                    }//关闭
                                }, function () {
                                    //sessionStorage["SourceFlag"] = false;
                                    //window.location.reload();
                                    location.replace('Kf_SellOutBill_Fast.html?OperationType=1&HInterID=0');
                                });//新增
                            }
                            else {
                                layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        },
                        error: function (err) {
                            layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
                layer.closeAll("loading");
            }
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //#endregion
            //#region ç¼–辑
            form.on('submit(cmdModify)', function () {//编辑
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '明细列表'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?HInterID=' + data[0].HInterID + '&HMaterID =' + data[0].HMaterID + '&HBillType =' + data[0].HBillType, 'yes']
                        , resize: false
                        , cancel: function () {
                            //$(".layui-btn").removeClass("layui-btn-disabled");
                        }
                        , end: function () {
                            //显示表体明细
                            DisBillEntryList();
                        }
                    })
                }
                else {
                    layer.msg('请先选择一行记录,进行编辑!');
                }
            });
            //#endregion
            //#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 = '1205';
                        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
            //#region é€€å‡º
            //退出按钮
            form.on('submit(Cancel)', function () {
                var sInterID = $("#HInterID").val()
                var HBillType = '1205'
                $.ajax(
                    {
                        type: "Get",
                        url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_FIFO_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HInterID": sInterID, "HBillType": HBillType },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                            });
                        }
                    });
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                });
            })
            //#endregion
            //#endregion
            //#region æ‰«ææºå•条码
@@ -1392,13 +1481,17 @@
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    layer.load(3)
                    GetMeesageBySourceBillNo();
                    layer.closeAll("loading");
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                layer.load(3)
                GetMeesageBySourceBillNo();
                layer.closeAll("loading");
            });
            //扫描源单条码
@@ -1411,6 +1504,7 @@
                var HMaker = sessionStorage["HUserName"]
                var sHStockOrgID = sessionStorage["OrganizationID"];
                var HFIFOWhID = $("#HFIFOWHID").val()
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/WEBSController/Get_SourceBarCode_SellOut_Json",
@@ -1418,7 +1512,7 @@
                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "HMaker": HMaker, "HFIFOWhID": HFIFOWhID, "HOWNERID": sHStockOrgID },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            playSound1();
                            playSound_OK();
                            HSourceFlag = true;
                            $("#HSupName").val(result.data.hSupNameField);
                            $("#HSupID").val(result.data.hSupIDField);
@@ -1436,7 +1530,7 @@
                            layer.load(3);
                            element.tabChange('tab-SellOutBill', '2');
                            //扫源单成功后,光标显示到仓库上
                            $("#HWHNAME").focus();
                            $("#HBarCode").focus();
                            //显示表体明细
                            DisBillEntryList();
                        }
@@ -1444,7 +1538,6 @@
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
@@ -1554,13 +1647,17 @@
            //扫条码
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    layer.load(3)
                    GetMeesageByBarCode();
                    layer.closeAll("loading");
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                layer.load(3)
                GetMeesageByBarCode();
                layer.closeAll("loading");
            });
            //扫条码
@@ -1576,20 +1673,17 @@
                var sHWHID = $("#HWHID").val();//仓库ID
                var sHSPID = $("#HStockPlaceID").val();//仓位ID
                var sQty = $("#HQty").val()//数量
                var sMouldManagerCtl = 'N'
                var sFIFOCtl = 'N'
                if (sQty == "") {
                    sQty = 0;
                }
                //var SourceFlag = sessionStorage["SourceFlag"];
                var sSourceBillNo = $("#HSourceBillNo").val();//源单号
                var sHBillType = $("#HBillType").val()  //源单类型-发货通知单:1402,销售订单1401
                var sBillType = '1205'
                var HScanStyle = $("#HScanStyle").val();
                if (HDeleteFlag == "*") {
                    if (sBarCode == "") {
                        playSound();
                        layer.msg("请扫描要删除的条码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
@@ -1605,7 +1699,7 @@
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    playSound1();
                                    playSound_OK();
                                    //清空数量
                                    $("#HQty").val("");
                                    //table.reload('wl-table', {
@@ -1648,7 +1742,6 @@
                                else {
                                    playSound();
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                            },
                            error: function (err) {
@@ -1721,10 +1814,8 @@
                else {
                    var sBarCode = $('#HBarCode').val()
                    if (sBarCode == '') {
                        //
                        playSound();
                        layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                        //11
                        return false;
                    }
                    if (sBarCode != "") {
@@ -1748,8 +1839,8 @@
                        //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"], "HScanStyle": HScanStyle },
                        success: function (result) {
                            playSound1();
                            if (result.count == 1) {
                                playSound_OK();
                                if (result.data.hBarTypeField == '仓库条码') {
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
@@ -1857,7 +1948,6 @@
                                //        layer.closeAll("loading");
                                //    }
                                //});
                                playSound1();
                                //清空数量
                                $("#HQty").val("");
                            }
@@ -1865,7 +1955,6 @@
                                playSound();
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            playSound();
@@ -1913,33 +2002,11 @@
                        else {
                            layer.msg(result.Message);
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            //#endregion
            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();
            }
        });
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -29,7 +29,7 @@
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                            </div>
                            <div class="layui-col-xs2">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
@@ -40,7 +40,7 @@
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">数量</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                <input type="text" name="HQty" id="HQty" lay-verify="HQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
                            </div>
                        </div>
                    </div>
@@ -77,7 +77,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
@@ -104,7 +104,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">配套数量</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HPTQty" id="HPTQty" lay-verify="HPTQty" autocomplete="off" class="layui-input">
                                            <input type="text" name="HPTQty" id="HPTQty" lay-verify="HPTQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
                                        </div>
                                    </div>
                                </div>
@@ -114,7 +114,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">先进先出仓库</label><!--先进先出仓库-->
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" autocomplete="off" class="layui-input">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HFIFOWHID" id="HFIFOWHID" lay-verify="HFIFOWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
@@ -142,7 +142,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -156,7 +156,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -170,7 +170,7 @@
                                            <label class="layui-form-label" style="width:45px;padding-left:0px;">发料人</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -184,7 +184,7 @@
                                            <label class="layui-form-label" style="width:45px;padding-left:0px;">领料人</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -210,7 +210,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">部门</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -396,7 +396,7 @@
            //光标默认在源单号位置上
            $("#HSourceBillNo").focus();
            //表头初始化赋值,将session的值赋值给界面控件,session值来源与上一次数据选择
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户)
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
@@ -537,7 +537,7 @@
            var OperationType = params[params[0]];  //从缓存列表中返回数据类型  1新增  2从缓存列表中返回
            var HInterID_Temp = params[params[1]];  //从缓存列表中返回单据ID
            //判断是否新增
            //判断是否新增,获取最大单据号
            if (HInterID != 0) {
                HSourceFlag = true;
            }
@@ -862,6 +862,32 @@
            //#region åŸºç¡€èµ„料选择
            //#region å…ˆè¿›å…ˆå‡ºä»“库
            //扫描先进先出仓库
            $('#HFIFOWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HFIFOWHNAME').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HFIFOWHID").val(result.data[0].HItemID);
                                $("#HFIFOWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-MateOutBill', '1');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //选择先进先出仓库
            form.on('submit(HFIFOWHID-BT)', function () {//选择调出仓库
@@ -893,8 +919,9 @@
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
@@ -902,8 +929,8 @@
                                //$("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HItemID);
                                $("#HWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-MateOutBill', '3');
                                //扫源单成功后,光标显示到条码上
                                element.tabChange('tab-MateOutBill', '2');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
@@ -941,8 +968,9 @@
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
@@ -950,7 +978,9 @@
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HWHID").val(result.data[0].HWHID);
                                $("#HWHNAME").val(result.data[0].HWhName);
                                element.tabChange('tab-ProductlnBill', '2');
                                element.tabChange('tab-MateOutBill', '2');
                                //光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
                                // $("#verifycode").click();
@@ -1092,12 +1122,12 @@
                                else {
                                    layer.msg(data.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: "温馨提示" });
                            }
                        });
                    layer.closeAll("loading");
                    return false;
                }
            });
@@ -1182,6 +1212,7 @@
                        var sSourceEntryID = data[0].HSourceEntryID
                        var HBillType = '1204';
                        var sHStockOrgID = sessionStorage["OrganizationID"]
                        layer.load(3)
                        $.ajax(
                            {
                                type: "Get",
@@ -1327,13 +1358,17 @@
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    layer.load(3)
                    GetMeesageBySourceBillNo();
                    layer.closeAll("loading");
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                layer.load(3)
                GetMeesageBySourceBillNo();
                layer.closeAll("loading");
            });
            //扫描源单条码
@@ -1375,7 +1410,7 @@
                            layer.load(3);
                            element.tabChange('tab-MateOutBill', '2');
                            //扫源单成功后,光标显示到仓库上
                            $("#HWHNAME").focus();
                            $("#HBarCode").focus();
                            //显示表体明细
                            DisBillEntryList();
                        }
@@ -1383,7 +1418,6 @@
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
@@ -1467,12 +1501,16 @@
            //扫条码
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    layer.load(3)
                    GetMeesageByBarCode();
                    layer.closeAll("loading");
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                layer.load(3)
                GetMeesageByBarCode();
                layer.closeAll("loading");
            });
            //扫条码
@@ -1633,7 +1671,6 @@
                                playSound();
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            playSound();
@@ -1861,7 +1898,6 @@
                        else {
                            layer.msg(result.Message);
                        }
                        layer.closeAll("loading");
                    }
                });
            }