yxj
2023-07-04 988fc11be4fb5278e29d613c147711780c375fd1
PDA领料出库扫码模块优化
6个文件已修改
4952 ■■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2854 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/领料出库/Kf_MateOutBill_Fast.html 2024 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/领料出库/Kf_MateOutBill_FastList.html 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml
@@ -10,7 +10,7 @@
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <PublishProvider>FileSystem</PublishProvider>
    <PublishUrl>D:\网站发布\智云MESWMS\LAYUI</PublishUrl>
    <PublishUrl>E:\网站发布\LAYUI</PublishUrl>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <SiteUrlToLaunchAfterPublish />
  </PropertyGroup>
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
Diff too large
WebTM/WebTM.csproj.user
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <NameOfLastUsedPublishProfile>D:\网站发布\后端代码\MES-WEB-TM\MESWMS-LayUI\WebTM\Properties\PublishProfiles\JFTM.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\GIT仓库\MESWMS-LayUI\WebTM\Properties\PublishProfiles\JFTM.pubxml</NameOfLastUsedPublishProfile>
    <ProjectView>ProjectFiles</ProjectView>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
WebTM/layuiadmin/Scripts/webConfig.js
@@ -3,11 +3,11 @@
    //var WEBURL = "http://192.168.16.80:8011/";          //办公室服务器
    //var WEBURL = "http://localhost:8081/SWEAPI/";       //ch本地*/
    //var WEBURL = "http://61.164.86.218:8099/ABAPI/";
    //var WEBURL = "http://localhost/API/";   //颜晓军本地配置
    var WEBURL = "http://localhost/API/";   //颜晓军本地配置
    //var WEBURL = "http://localhost/WEBAPI/";   //颜家台式机本地配置
    //var WEBURL = "http://localhost:8082/lubao";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //杨乐本地配置
    var WEBURL = "http://localhost:8082/API/";    //杜贺本地配置
    //var WEBURL = "http://localhost:8082/API/";    //杜贺本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //余思杰本地配置
    //var WEBURL = "http://localhost:8088/ARAPI/";    //余思杰本地配置(安瑞)
    //var WEBURL = "http://10.1.4.155/API/";   //江丰客户NEW
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_Fast.html
@@ -46,12 +46,12 @@
                    </div>
                    <div class="layui-tab layui-col-xs12" lay-filter="tab-MateOutBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">源单信息</li>
                            <li lay-id="2" style="padding:1px;">单据信息</li>
                            <li lay-id="3" style="padding:1px;">物料清单</li>
                            <li lay-id="4" style="padding:1px;">明细清单</li>
                            <li lay-id="5" style="padding:1px;min-width: 35px;">库存</li>
                            <li lay-id="6" style="padding:1px;min-width: 35px;">合计</li>
                            <li lay-id="1" style="padding:1px;" class="layui-this">选择源单</li>
                            <li lay-id="2" style="padding:1px;">表头信息</li>
                            <li lay-id="3" style="padding:1px;">明细信息</li>
                            <li lay-id="4" style="padding:1px;">下架信息</li>
                            <li lay-id="5" style="padding:1px;">条码信息</li>
                            <!--<li lay-id="6" style="padding:1px;min-width: 35px;">合计</li>-->
                        </ul>
                        <div class="layui-tab-content">
                            <!--源单信息-->
@@ -59,14 +59,28 @@
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">单据类型</label>
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单类型</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name=" HBillType" id="HBillType">
                                                <option value="3720">生产用料清单</option>
                                                <option value="1214" selected>生产发料通知单</option>
                                                <option value="1214">生产发料通知单</option>
                                                <!--<option value="1214" selected>生产发料通知单</option>-->
                                                <option value="-1">手工录入</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <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();">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
                                        </div>
                                    </div>
                                </div>
@@ -90,14 +104,14 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">配套数量</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HPPQty" id="HPPQty" lay-verify="HPPQty" autocomplete="off" class="layui-input">
                                            <input type="text" name="HPTQty" id="HPTQty" lay-verify="HPTQty" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">FIFOWH</label><!--先进先出仓库-->
                                            <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">
@@ -111,19 +125,16 @@
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                            <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();">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
                                            <input name="HDate" id="HDate" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--单据信息-->
                            <!--表头信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
@@ -222,26 +233,19 @@
                                </div>
                            </div>
                            <!--物料清单-->
                            <!--明细信息-->
                            <div class="layui-tab-item">
                                <!--<div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs4">
                                            <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">
                                        </div>
                                    </div>
                                </div>-->
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                </div>
                                <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                            </div>
                            <!--明细清单-->
                            <!--下架信息-->
                            <div class="layui-tab-item">
                                <!-- <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>-->
                                <table class="layui-hide" id="FIFOlist-table" lay-filter="FIFOlist-table"></table>
                            </div>
                            <!--条码信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding: 0px; margin: 0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
@@ -335,27 +339,11 @@
                            </div>
                            <!--库存-->
                            <div class="layui-tab-item">
                            <!--<div class="layui-tab-item">
                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                            </div>
                            </div>-->
                        </div>
                        <!--<div class="layui-form-item" style="margin-bottom: 20px;">
                            <div class="layui-row">
                                <div class="layui-col-xs3">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">提交</button>
                                </div>
                                <div class="layui-col-xs3">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                                </div>
                                <div class="layui-col-xs3">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                                </div>
                                <div class="layui-col-xs3">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
                                </div>
                            </div>
                        </div>-->
                        <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                    </div>
            <!--</div>
@@ -395,14 +383,24 @@
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //将session的值赋值给界面控件,session值来源与上一次数据选择
            var HInterID = $('#HInterID').val()
            var HBillNo = $('#HBillNo').val()
            var HBillType = '1204'
            var HMaker = sessionStorage["HUserName"]
            var HStockOrgID = sessionStorage["OrganizationID"]
            var HSourceFlag = sessionStorage["SourceFlag"];
            var OperationType = 0;//操作类型
            var option = [];
            //光标默认在源单号位置上
            $("#HSourceBillNo").focus();
            //表头初始化赋值,将session的值赋值给界面控件,session值来源与上一次数据选择
            $("#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"]);
@@ -414,10 +412,103 @@
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            var HSourceFlag = sessionStorage["SourceFlag"];//源单已标记
            $("#HDate").val(formatDate(sessionStorage["HDate"]));
            //光标默认显示在源单号位置
            $("#HSourceBillNo").focus();
            // ç¼–辑获取表头时时间格式矫正方式
            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 = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , totalRow: true
                , limit: 100
                , limits: [50, 500, 5000, 20000]
                , page: true
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 80, totalRow: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HBatchNo', title: '批次', width: 150 }
                    , { field: 'HPieceQty', title: '条码数量', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            //下架信息
            var FIFOlistOption = {
                elem: '#FIFOlist-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , limit: 3000
                , totalRow: true
                , cols: [[
                    { field: 'HQty', title: '数量', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '下架数量', width: 150, totalRow: true }
                    , { field: 'HWhName', title: '仓库', width: 150 }
                    , { field: 'HSPName', title: '仓位', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HBatchNo', title: '批次', width: 150 }
                    , { field: 'HAuxPropName', title: '辅助属性', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            //判断是否登录 æœªç™»å½•则跳到登录页
            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();
            }
            //监听当前处于哪一个页签
            element.on('tab(tab-MateOutBill)', function (data) {
@@ -439,23 +530,64 @@
                return vars;
            }
            //var params = getUrlVars();
            //var HInterID_Temp = params[params[0]]; //从参数中获取 å•据内码
            //var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var OperationType = params[params[0]];  //从缓存列表中返回数据类型  1新增  2从缓存列表中返回
            var HInterID_Temp = params[params[1]];  //从缓存列表中返回单据ID
            function RoadBillMain(linterid)//加载表头
            //判断是否新增
            if (HInterID != 0) {
                HSourceFlag = true;
            }
            //从缓存列表编辑功能跳转至单据模块
            else if (OperationType == 2) {
                RoadBillMain(HInterID_Temp);
                $("#HBarCode").select();
                $("#HBarCode").focus();     //获取光标
                //$('#QueDin2').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                //document.getElementById("QueDin2").disabled = true;   //按钮变为不可编辑状态
                //显示表体明细
                DisBillEntryList();
                HSourceFlag = true;
            }
            else {
                OperationType = 1;
                //获取最大单据ID、单据号
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/WEBSController/GetMaxBillNoAndID_Json",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HBillType": HBillType },
                    success: function (d) {
                        if (d.count == 1) {
                            $("#HInterID").val(d.data[0].HInterID);
                            $("#HBillNo").val(d.data[0].HBillNo);
                            $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                            HInterID = $('#HInterID').val()
                            HBillNo = $('#HBillNo').val()
                        }
                        else {
                            layer.msg(d.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }
                });
                HSourceFlag = false;
            }
            function RoadBillMain(HInterID_Temp)//加载表头
            {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
                    type: "GET",
                    data: { "HInterID": linterid },
                    url: GetWEBURL() + '/WEBSController/GetSourceBill_Temp_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    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 ? "3720" : d.data[0].HSourceBillType);
                        //获取源单类型、源单单号
                        //获取源单类型
                        if (d.data[0].HSourceBillType == "3720") {
                            $("#HBillType").empty();
                            $("#HBillType").val("3720");
@@ -483,52 +615,81 @@
                            layui.form.render('select');
                            $("#HBillType").attr("readonly", "readonly");
                        }
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        $("#HSourceBillNo").attr("disabled", "true");
                        //获取计划模式
                        $("#HPlanMode").val(d.data[0].HPlanMode == null ? "0" : d.data[0].HPlanMode);
                        if (d.data[0].HPlanMode == "14035") {
                            $("#HPlanMode").empty();
                            $("#HPlanMode").val("14035");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HPlanMode + "' >" + 'MTO' + "</option>";
                            $("#HPlanMode").append(optionHtml);
                            layui.form.render('select');
                            $("#HPlanMode").attr("readonly", "readonly");
                        }
                        else if (d.data[0].HPlanMode == "14036") {
                            $("#HPlanMode").empty();
                            $("#HPlanMode").val("14036");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HPlanMode + "' >" + 'MTS' + "</option>";
                            $("#HPlanMode").append(optionHtml);
                            layui.form.render('select');
                            $("#HPlanMode").attr("readonly", "readonly");
                        }
                        else {
                            $("#HPlanMode").empty();
                            $("#HPlanMode").val("0");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HPlanMode + "' >" + '全部' + "</option>";
                            $("#HPlanMode").append(optionHtml);
                            layui.form.render('select');
                            $("#HPlanMode").attr("readonly", "readonly");
                        }
                        HSourceFlag = true;
                        //$("#HWHID").val(d.data[0].HWhID);
                        //$("#HKeeperID").val(d.data[0].HKeeperID);
                        //$("#HSecManagerID").val(d.data[0].HSecManagerID);
                        //$("#HDeptID").val(d.data[0].HDeptID);
                        //$("#HBarCode").val(d.data[0].HBarCode);
                        //$("#HQty").val(d.data[0].HQty);
                        $("#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);
                        }
                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                    }
                })
            }
            function RoadBillSub(linterid)//加载表体
            {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                var sInterID = $("#HInterID").val();
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                    //, toolbar: '#toolbarDemo'
                    , page: true
                    , limit: 100
                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HQty', title: '数量', width: 150 }
                        , { field: 'HQtyMust', title: '应发数量', width: 150 }
                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                        , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                        , { field: 'HBatchNo', title: '批次', width: 150 }
                    ]]
                    // , data: [linterid]
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
            //function RoadBillSub(HInterID_Temp)//加载表体
            //{
            //    $("#HInterID").val(HInterID_Temp);//修改时主表ID
            //    //编辑加载数据
            //    var sInterID = $("#HInterID").val();
            //    table.render({
            //        elem: '#wl-table'
            //        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
            //        //, toolbar: '#toolbarDemo'
            //        , page: true
            //        , limit: 100
            //        , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
            //        , cols: [[
            //            { type: 'radio' }
            //            , { field: 'HQty', title: '数量', width: 150 }
            //            , { field: 'HQtyMust', title: '应发数量', width: 150 }
            //            , { field: 'HMaterNumber', title: '物料代码', width: 150 }
            //            , { field: 'HMaterName', title: '物料名称', width: 150 }
            //            , { field: 'HMaterModel', title: '规格型号', width: 150 }
            //            , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
            //            , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
            //            , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
            //            , { field: 'HBatchNo', title: '批次', width: 150 }
            //        ]]
            //        // , data: [HInterID_Temp]
            //        , height: 500
            //        , done: function () {
            //            layer.closeAll("loading");
            //        }
            //    });
            //}
            //动态加载源单类型列表 new
@@ -538,25 +699,25 @@
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
            //判断是否新增,如果是新增单据则获取最大单号和最大内码
            if (linterid == null || linterid == 0) {
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                    type: "GET",
                    data: { "HBillType": '1204' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                RoadBillSub(linterid);
            }
            ////判断是否新增,如果是新增单据则获取最大单号和最大内码
            //if (HInterID_Temp == null || HInterID_Temp == 0) {
            //    $("#HInterID").val("");
            //    $("#HBillNo").val("");
            //    $.ajax({
            //        url: GetWEBURL() + "/Web/GetMAXNumPDA",
            //        type: "GET",
            //        data: { "HBillType": '1204' },
            //        success: function (d) {
            //            //console.log(d.data);
            //            $("#HInterID").val(d.data[0].HInterID);
            //            $("#HBillNo").val(d.data[0].HBillNo);
            //        }
            //    });
            //}
            //else {//如果修改则走下面 new
            //    RoadBillMain(HInterID_Temp);
            //    RoadBillSub(HInterID_Temp);
            //}
            //选择仓库(事件)
            //form.on('submit(HWHID-BT)', function () {
@@ -575,20 +736,6 @@
            //    })
            //});
            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=' + sessionStorage["OrganizationID"] + '', 'yes']
                    , resize: false
                    , cancel: function () {
                    }
                })
            });
            ////选择仓库(事件)
            //form.on('submit(HFIFOWHID-BT)', function () {
@@ -607,350 +754,24 @@
            //    })
            //});
            //选择先进先出仓库
            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_WarehouseListNew.html?Type=HFIFOWHID&HOrgID=' + sessionStorage["OrganizationID"] + '', '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_SupplierList.html', '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_SupplierList.html', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            //选择保管(事件)
            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 () {
                HSourceFlag = false;
                //parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                });
            })
            //编辑按钮(事件)
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '明细列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
                // }
            });
            //扫仓位条码事件
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        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-ProductlnBill', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //扫仓库
            $('#HWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HWHNAME').val()
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg('无仓库条码信息!');
                        return;
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        type: "GET",
                        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-MateOutBill', '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 });
                }
            });
            //删除
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('wl-table')
                    , data = checkStatus.data;
                // console.log(data);
                var sInterID = $('#HInterID').val()
                var sMaterID = data[0].HMaterID
                var sBillType = '1204'
                var sAuxPropID = data[0].HAuxPropID
                //var sMTONo = data[0].HMTONo
                var sMTONo = ''
                var sSourceInterID = data[0].HSourceInterID
                var sSourceEntryID = data[0].HSourceEntryID
                $.ajax(
                    {
                        type: "Get",
                        url: GetWEBURL() + "/MateOutBill/Delete_Json",
                        async: true,
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
                                    //, cellMinWidth: 80
                                    //, toolbar: '#toolbarDemo'
                                    , page: true
                                    , limit: 100
                                    , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HSNO', title: '序号', width: 60 }
                                        , { field: 'HQty', title: '数量', width: 80 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                        , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                                    ]]
                                    , height: 500
                                })
                            }
                            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: "温馨提示" });
                        }
                    });
            });
            //提交
            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)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/MateOut/set_SaveMateOutBill_Json",
                            async: true,
                            data: { "oMain": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    layer.confirm(data.Message, {
                                    //layer.confirm("生成领料出库单" + data.Message + $("#HBillNo").val(), {
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                        btn2: function () {
                                            //parent.layui.admin.events.closeThisTabs();关闭页签
                                            //window.close();//关闭页面,浏览器有效,PDA无效
                                            parent.location.href = "../../../views/index.html"
                                        }//关闭
                                    }, function () { window.location.reload(); });//新增
                                }
                                else {
                                    layer.msg(data.Message, { icon: 5, 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: "温馨提示" });
                            }
                        });
                    return false;
                }
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //扫条码
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (HPPQty == "") {
                    HPPQty = 0;
                }
                if (event.keyCode == 13) {
                    GetMeesageBySourceBillNo();
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                GetMeesageBySourceBillNo();
            });
            ////扫源单测试用
            //$('#HSourceBillNo').on('keydown', function (event) {      //扫源单
            //    var sInterID = $('#HInterID').val();
@@ -1002,7 +823,7 @@
            //                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
            //                        , { field: 'HBatchNo', title: '批次', width: 150 }
            //                      ]]
            //                        // , data: [linterid]
            //                        // , data: [HInterID_Temp]
            //                        // , page: true
            //                      , height: 500
            //                      , done: function () {
@@ -1026,7 +847,7 @@
                elem: '#mx-table'
                // , url: 'http://61.130.49.162:9090/WMSAPI///MateOut/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                // , where: { sMsg: HInterID_Temp, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
@@ -1037,292 +858,1021 @@
                }
            });
            //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var sBarCode = $('#HBarCode').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var sQty = $("#HQty").val()
                var sHBillType = $("#HBillType").val()  //源单类型
                var sBillType = '1204'
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                if (sHBillType == '-1') {
                    sSourceBillNo = ''
                }
                if (sBarCode == '') {
                    playSound();
                    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (sBarCode != "") {
                    $('#HBarCode').val("");
                }
                if (sQty == "") {
                    sQty = 0;
                }
                if (sHWHID == "184154") {
                    if (sHSPID == "0") {
                        playSound();
                        layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
            //#region åŸºç¡€èµ„料选择
            //#region å…ˆè¿›å…ˆå‡ºä»“库
            //选择先进先出仓库
            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_WarehouseListNew.html?Type=HFIFOWHID&HOrgID=' + sessionStorage["OrganizationID"] + '', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                }
                $.ajax({
                    url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                    type: "GET",
                    data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sessionStorage["HUserName"], "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sessionStorage["OrganizationID"], "HScanStyle": "", "HCustom1": "", "HCustom2": "" },
                    //url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                    //type: "GET",
                    ////data: { "sCode": '1001456360', "sInterID": 122554, "HBillType": '1204', "sBillNo": 'MATO00000055', "sMaker": sessionStorage["HUserName"], "WhID": 484080, "SPID": 0, "sQty": 0, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": 'PPBOM202112226', "sSourceType": '3720', "HOWNERID": sessionStorage["OrganizationID"] },
                    //data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data.hBarTypeField == '仓库条码') {
                                $("#HWHNAME").val(result.data.hWhNameField);
                                $("#HWHID").val(result.data.hWhIDField);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-MateOutBill', '2');  //跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '仓位条码') {
                                $("#HStockPlaceName").val(result.data.hSPNameField);
                                $("#HStockPlaceID").val(result.data.hSPIDField);
                                $("#HWHNAME").val(result.data.hWhNameField);
                                $("#HWHID").val(result.data.hWhIDField);
                                $("#HNote").val(";一键扫码仓位条码");
                                element.tabChange('tab-MateOutBill', '2');//跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '部门条码') {
                                $("#HDeptName").val(result.data.hDeptNameField);
                                $("#HDeptID").val(result.data.hDeptIDField);
                                $("#HNote").val(";一键扫码部门条码");
                                element.tabChange('tab-MateOutBill', '2');//跳转页签
                                return;
                            }
                            else if (result.data.hBarTypeField == '源单条码') {
                                $("#HSupName").val(result.data.hSupNameField);
                                $("#HSupID").val(result.data.hSupIDField);
                                if (result.data.hDeptIDField != 0) {
                                    $("#HDeptID").val(result.data.hDeptIDField);
                                    $("#HDeptName").val(result.data.hDeptNameField);
                                }
                                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                HSourceFlag = true;
                                //获取源单类型、源单单号
                                $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3720" : result.data.hSourceBillTypeField);
                                if (result.data.hSourceBillTypeField == "3720") {
                                    $("#HBillType").empty();
                                    $("#HBillType").val("3720");
                                    var optionHtml = '';
                                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                                    $("#HBillType").append(optionHtml);
                                    layui.form.render('select');
                                    $("#HBillType").attr("readonly", "readonly");
                                }
                                else if (result.data.hSourceBillTypeField == "1214") {
                                    $("#HBillType").empty();
                                    $("#HBillType").val("1214");
                                    var optionHtml = '';
                                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产发料通知单' + "</option>";
                                    $("#HBillType").append(optionHtml);
                                    layui.form.render('select');
                                    $("#HBillType").attr("readonly", "readonly");
                                }
                                else {
                                    //$("#HBillType").empty();
                                    $("#HBillType").val("-1");
                                    var optionHtml = '';
                                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                    $("#HBillType").append(optionHtml);
                                    layui.form.render('select');
                                    $("#HBillType").attr("readonly", "readonly");
                                }
                                $("#HSourceBillNo").attr("readonly", "readonly");
                                $("#HNote").val(";一键扫码源单条码");
                })
            });
            //#endregion
            //#region ä»“库
            //扫仓库
            $('#HWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HWHNAME').val()
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg('无仓库条码信息!');
                        return;
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        type: "GET",
                        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-MateOutBill', '3');
                                //扫源单成功后,光标显示到条码上
                                $("#HBarCode").focus();
                            }
                            else {
                                if (HSourceFlag == true) {
                                // $("#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=' + sessionStorage["OrganizationID"] + '', 'yes']
                    , resize: false
                    , cancel: function () {
                    }
                })
            });
            //#endregion
            //#region ä»“位
            //扫仓位条码事件
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        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-ProductlnBill', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                            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(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)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/MateOut/set_SaveMateOutBill_Json",
                            async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                            data: { "oMain": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    layer.confirm(data.Message, {
                                        //layer.confirm("生成领料出库单" + data.Message + $("#HBillNo").val(), {
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                        btn2: function () {
                                            //parent.layui.admin.events.closeThisTabs();关闭页签
                                            //window.close();//关闭页面,浏览器有效,PDA无效
                                            parent.location.href = "../../../views/index.html"
                                        }//关闭
                                    }, function () {
                                        //window.location.reload();
                                        location.replace('Kf_MateOutBill_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: "温馨提示" });
                            }
                        });
                    return false;
                }
            });
            //监听提交
            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('请先选择一行记录,进行编辑!');
                }
                // }
            });
            ////编辑按钮(事件)
            //form.on('submit(cmdModify)', function () {//编辑
            //    var sSubStr = table.cache['wl-table'];
            //    //if (AllowLoadData(sSubStr) != false) {//非空验证
            //    layer.open({
            //        type: 2
            //        , area: ['100%', '100%']
            //        , title: '明细列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //    // }
            //});
            //#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 = '1204';
                        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(cmdDelete)', function () {//删除
            //    var checkStatus = table.checkStatus('wl-table')
            //        , data = checkStatus.data;
            //    // console.log(data);
            //    var sInterID = $('#HInterID').val()
            //    var sMaterID = data[0].HMaterID
            //    var sBillType = '1204'
            //    var sAuxPropID = data[0].HAuxPropID
            //    //var sMTONo = data[0].HMTONo
            //    var sMTONo = ''
            //    var sSourceInterID = data[0].HSourceInterID
            //    var sSourceEntryID = data[0].HSourceEntryID
            //    $.ajax(
            //        {
            //            type: "Get",
            //            url: GetWEBURL() + "/MateOutBill/Delete_Json",
            //            async: true,
            //            data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
            //            dataType: "json",
            //            success: function (data) {
            //                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
            //                    table.render({
            //                        elem: '#wl-table'
            //                        , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json'
            //                        //, cellMinWidth: 80
            //                        //, toolbar: '#toolbarDemo'
            //                        , page: true
            //                        , limit: 100
            //                        , where: { HBillID: sInterID, HBillType: '1204', sWhere: '' }
            //                        , cols: [[
            //                            { type: 'radio' }
            //                            , { field: 'HSNO', title: '序号', width: 60 }
            //                            , { field: 'HQty', title: '数量', width: 80 }
            //                            , { field: 'HQtyMust', title: '应收数量', width: 80 }
            //                            , { field: 'HMaterNumber', title: '物料代码', width: 150 }
            //                            , { field: 'HMaterName', title: '物料名称', width: 150 }
            //                            , { field: 'HMaterModel', title: '规格型号', width: 150 }
            //                            , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
            //                            , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
            //                            , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
            //                            , { field: 'HBatchNo', title: '批次', width: 100 }
            //                            , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
            //                            , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
            //                        ]]
            //                        , height: 500
            //                    })
            //                }
            //                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: "温馨提示" });
            //            }
            //        });
            //});
            //#endregion
            //#region é€€å‡º
            form.on('submit(Cancel)', function () {
                var sInterID = $("#HInterID").val()
                var HBillType = '1204'
                $.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(Cancel)', function () {
            //    HSourceFlag = false;
            //    //parent.location.href = "../../../views/index.html"
            //    //window.close();//关闭当前页
            //    layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
            //        parent.location.href = "../../../views/index_Mobile.html";
            //    });
            //})
            //#endregion
            //#endregion
            //#region æ‰«ææºå•条码
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageBySourceBillNo();
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                GetMeesageBySourceBillNo();
            });
            //扫描源单条码
            function GetMeesageBySourceBillNo(obj) {
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HBillType = '1204'
                var HSourceBillNo = $('#HSourceBillNo').val()
                var HSourceBillType = $("#HBillType").val()
                var HMaker = sessionStorage["HUserName"]
                var sHStockOrgID = sessionStorage["OrganizationID"];
                var HFIFOWhID = $("#HFIFOWHID").val()
                var HPTQty = $("#HPTQty").val()
                var HPlanMode = $("#HPlanMode").val()
                if (HPTQty == "") {
                    HPTQty = 0;
                }
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/WEBSController/Get_SourceBarCode_MateOut_Json",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "HMaker": HMaker, "HPTQty": HPTQty, "HPlanMode": HPlanMode, "HFIFOWhID": HFIFOWhID, "HStockOrgID": sHStockOrgID },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            playSound_OK();
                            HSourceFlag = true;
                            if (result.data.hDeptIDField != 0) {
                                $("#HDeptID").val(result.data.hDeptIDField);
                                $("#HDeptName").val(result.data.hDeptNameField);
                            }
                            $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                            $("#HBillType").attr("disabled", "disabled");
                            $("#HPlanMode").attr("disabled", "disabled");
                            form.render('select');
                            if (result.data.hMulSourceFlagField == 0) {
                                $("#HSourceBillNo").attr("readonly", "readonly");
                            }
                            layer.load(3);
                            element.tabChange('tab-MateOutBill', '2');
                            //扫源单成功后,光标显示到仓库上
                            $("#HWHNAME").focus();
                            //显示表体明细
                            DisBillEntryList();
                        }
                        else {
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            //原调用方法
            ////扫源单
            //function GetMeesageBySourceBillNo(obj) {
            //    var sInterID = $("#HInterID").val()
            //    var sBillNo = $("#HBillNo").val()
            //    var HSourceBillNo = $('#HSourceBillNo').val()
            //    var HSourceBillType = $("#HBillType").val()
            //    var HPPQty = $("#HPPQty").val()
            //    var HFIFOWHID = $("#HFIFOWHID").val()
            //    var HPlanMode = $("#HPlanMode").val()
            //    if (HPPQty == "") {
            //        HPPQty = 0;
            //    }
            //    var sMouldManagerCtl = "N";  //是否启用器具管理
            //    var sFIFOCtl = "N";          //是否启用先进先出管理
            //    $.ajax({
            //        type: "GET",
            //        url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
            //        data: { "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1204', "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "sMaker": sessionStorage["HUserName"], "sPPQty": HPPQty, "sPlanMode": HPlanMode, "sFIFOWHID": HFIFOWHID, "HOWNERID": sessionStorage["OrganizationID"] },
            //        //url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
            //        //data: { "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1204', "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "sMaker": sessionStorage["HUserName"], "sPPQty": HPPQty, "sPlanMode": HPlanMode, "sFIFOWHID": HFIFOWHID, "HOWNERID": sessionStorage["OrganizationID"] },
            //        success: function (result) {
            //            HSourceFlag = true;
            //            $("#HPlanMode").attr("disabled", "true");
            //            $("#HBillType").attr("disabled", "true");
            //            $("#HBillType").attr("disabled", "disabled");
            //            form.render('select');
            //            if (result.data.hMulSourceFlagField == 0) {
            //                $("#HSourceBillNo").attr("readonly", "readonly");
            //            }
            //            element.tabChange('tab-MateOutBill', '2');
            //            //扫源单成功后,光标显示到仓库上
            //            //$("#HWHNAME").focus();
            //            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
            //                playSound1();//播放声音
            //                layer.load(3)
            //                $.ajax({
            //                    url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
            //                    type: "GET",
            //                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1204', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
            //                    success: function (result) {
            //                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
            //                            listOption.data = result.data.list;
            //                            table.render(listOption);
            //                            $("#HBarCode_B").val(result.data.list2[0].HBarCode);
            //                            $("#HMaterName_B").val(result.data.list2[0].HMaterName);
            //                            $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
            //                            $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
            //                            $("#HUnitName_B").val(result.data.list2[0].HUnitName);
            //                            $("#HQty_B").val(result.data.list2[0].HQty);
            //                            $("#HTMQty_B").val(result.data.list2[0].HTMQty);
            //                            $("#HWHName_B").val(result.data.list2[0].HWHName);
            //                            $("#HSPName_B").val(result.data.list2[0].HSPName);
            //                        }
            //                        else {
            //                            layer.msg(result.Message);
            //                        }
            //                        layer.closeAll("loading");
            //                    }
            //                });
            //            }
            //            else {
            //                playSound();
            //                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //            }
            //            layer.closeAll("loading");
            //        }
            //    });
            //}
            //#endregion
            //#region æ‰«æç‰©æ–™æ¡ç 
            //扫条码
            $('#HBarCode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
            //扫条码
            function GetMeesageByBarCode(obj) {
                var sOldBarCode = $('#HBarCode').val()
                var HDeleteFlag = sOldBarCode.substring(0, 1);
                var sBarCode = sOldBarCode.slice(1);
                var sInterID = $("#HInterID").val()
                var sBillType = '1204'
                var sBillNo = $("#HBillNo").val()
                var sMaker = sessionStorage["HUserName"];
                var sHStockOrgID = sessionStorage["OrganizationID"];
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sQty = $("#HQty").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sHBillType = $("#HBillType").val()  //源单类型
                if (HDeleteFlag == "*") {
                    if (sBarCode == "") {
                        layer.msg("请扫描要删除的条码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    else {
                        $('#HBarCode').val("");
                    }
                    $.ajax(
                        {
                            type: "GET",
                            url: GetWEBURL() + "/ProductIn/Delete_Json",
                            async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    playSound_OK();
                                    //清空数量
                                    $("#HQty").val("");
                                    //显示表体明细
                                    DisBillEntryList();
                                }
                                else {
                                    playSound();
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                            },
                            error: function (err) {
                                playSound();
                                layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        });
                }
                else {
                    var sBarCode = $('#HBarCode').val()
                    if (sBarCode == '') {
                        playSound();
                        layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    if (sQty == "") {
                        sQty = 0;
                    }
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sMaker, "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sHStockOrgID, "HScanStyle": "", "HCustom1": "", "HCustom2": "" },
                        success: function (result) {
                            if (result.count == 1) {
                                playSound_OK();
                                if (result.data.hBarTypeField == '仓库条码') {
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-MateOutBill', '2');  //跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.hSPNameField);
                                    $("#HStockPlaceID").val(result.data.hSPIDField);
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HNote").val(";一键扫码仓位条码");
                                    element.tabChange('tab-MateOutBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '部门条码') {
                                    $("#HDeptName").val(result.data.hDeptNameField);
                                    $("#HDeptID").val(result.data.hDeptIDField);
                                    $("#HNote").val(";一键扫码部门条码");
                                    element.tabChange('tab-MateOutBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.hBarTypeField == '源单条码') {
                                    $("#HSupName").val(result.data.hSupNameField);
                                    $("#HSupID").val(result.data.hSupIDField);
                                    if (result.data.hDeptIDField != 0) {
                                        $("#HDeptID").val(result.data.hDeptIDField);
                                        $("#HDeptName").val(result.data.hDeptNameField);
                                    }
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3720" : result.data.hSourceBillTypeField);
                                    if (result.data.hSourceBillTypeField == "3720") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("3720");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else if (result.data.hSourceBillTypeField == "1214") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("1214");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产发料通知单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else {
                                        //$("#HBillType").empty();
                                        $("#HBillType").val("-1");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    $("#HSourceBillNo").attr("readonly", "readonly");
                                    $("#HNote").val(";一键扫码源单条码");
                                    element.tabChange('tab-MateOutBill', '3');
                                }
                                else {
                                    //$("#HSupName").val(result.data.HSupName);
                                    //$("#HSupID").val(result.data.HSupID);
                                    //$("#HDeptName").val(result.data.HDept);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                    //$("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    //$("#HBillType").val(result.data.hSourceBillTypeField)
                                    HSourceFlag = true;
                                    ////获取源单类型、源单单号
                                    //if (result.data.HSourceBillType == "3720") {
                                    //    ("#HBillType").empty();
                                    //    $("#HBillType").val("3720");
                                    //    var optionHtml = '';
                                    //    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                                    //    $("#HBillType").append(optionHtml);
                                    //    layui.form.render('select');
                                    //    $("#HBillType").attr("readonly", "readonly");
                                    //}
                                    //else if (result.data.HSourceBillType == "1601") {
                                    //    $("#HBillType").val("1601");
                                    //}
                                    $("#HNote").val(";物料条码");
                                    element.tabChange('tab-MateOutBill', '3');
                                }
                            }
                            //$("#HSupID").val(result.data.HSupID);
                            //$("#HSupName").val(result.data.HSupName);
                            //$("#HDeptID").val(result.data.HDeptID);
                            //$("#HDeptName").val(result.data.HDeptName);
                            layer.load(3)
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1204', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                        $("#HQty_B").val(result.data.list2[0].HQty);
                                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                        $("#HWHName_B").val(result.data.list2[0].HWHName);
                                        $("#HSPName_B").val(result.data.list2[0].HSPName);
                                    if (HSourceFlag == "true") {
                                        element.tabChange('tab-MateOutBill', '3');
                                    }
                                    else {
                                        layer.msg(result.Message);
                                        HSourceFlag = true;
                                        $("#HNote").val(";物料条码");
                                        element.tabChange('tab-MateOutBill', '3');
                                    }
                                    layer.closeAll("loading");
                                }
                            });
                            //清空数量
                            $("#HQty").val("");
                        }
                        else {
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , totalRow: true
                , limit: 100
                , limits: [50, 500, 5000, 20000]
                , page: true
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HSNO', title: '序号', width: 60 }
                        , { field: 'HQty', title: '数量', width: 80, totalRow: true}
                        , { field: 'HQtyMust', title: '应发数量', width: 80, totalRow: true}
                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                        , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                        , { field: 'HBatchNo', title: '批次', width: 150 }
                        , { field: 'HPieceQty', title: '条码数量', width: 150 }
                    ]]
                        , height: 500
                            , done: function () {
                                layer.closeAll("loading");
                                //显示表体明细
                                DisBillEntryList();
                                //清空数量
                                $("#HQty").val("");
                            }
            }
                            else {
                                playSound();
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            playSound();
                            layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    });
                }
            function playSound() {
                var audio = document.getElementById("cs");
                audio.play();
                //if (sHBillType == '-1') {
                //    sSourceBillNo = ''
                //}
                //if (sBarCode == '') {
                //    playSound();
                //    layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return false;
                //}
                //if (sBarCode != "") {
                //    $('#HBarCode').val("");
                //}
                //if (sQty == "") {
                //    sQty = 0;
                //}
                //if (sHWHID == "184154") {
                //    if (sHSPID == "0") {
                //        playSound();
                //        layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //        return false;
                //    }
                //}
                //$.ajax({
                //    url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                //    type: "GET",
                //    data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sessionStorage["HUserName"], "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sessionStorage["OrganizationID"], "HScanStyle": "", "HCustom1": "", "HCustom2": "" },
                //    //url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                //    //type: "GET",
                //    ////data: { "sCode": '1001456360', "sInterID": 122554, "HBillType": '1204', "sBillNo": 'MATO00000055', "sMaker": sessionStorage["HUserName"], "WhID": 484080, "SPID": 0, "sQty": 0, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": 'PPBOM202112226', "sSourceType": '3720', "HOWNERID": sessionStorage["OrganizationID"] },
                //    //data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                //    success: function (result) {
                //        if (result.count == 1) {
                //            if (result.data.hBarTypeField == '仓库条码') {
                //                $("#HWHNAME").val(result.data.hWhNameField);
                //                $("#HWHID").val(result.data.hWhIDField);
                //                $("#HStockPlaceName").val("");
                //                $("#HNote").val(";一键扫码仓库条码");
                //                element.tabChange('tab-MateOutBill', '2');  //跳转页签
                //                return;
                //            }
                //            else if (result.data.hBarTypeField == '仓位条码') {
                //                $("#HStockPlaceName").val(result.data.hSPNameField);
                //                $("#HStockPlaceID").val(result.data.hSPIDField);
                //                $("#HWHNAME").val(result.data.hWhNameField);
                //                $("#HWHID").val(result.data.hWhIDField);
                //                $("#HNote").val(";一键扫码仓位条码");
                //                element.tabChange('tab-MateOutBill', '2');//跳转页签
                //                return;
                //            }
                //            else if (result.data.hBarTypeField == '部门条码') {
                //                $("#HDeptName").val(result.data.hDeptNameField);
                //                $("#HDeptID").val(result.data.hDeptIDField);
                //                $("#HNote").val(";一键扫码部门条码");
                //                element.tabChange('tab-MateOutBill', '2');//跳转页签
                //                return;
                //            }
                //            else if (result.data.hBarTypeField == '源单条码') {
                //                $("#HSupName").val(result.data.hSupNameField);
                //                $("#HSupID").val(result.data.hSupIDField);
                //                if (result.data.hDeptIDField != 0) {
                //                    $("#HDeptID").val(result.data.hDeptIDField);
                //                    $("#HDeptName").val(result.data.hDeptNameField);
                //                }
                //                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                //                HSourceFlag = true;
                //                //获取源单类型、源单单号
                //                $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3720" : result.data.hSourceBillTypeField);
                //                if (result.data.hSourceBillTypeField == "3720") {
                //                    $("#HBillType").empty();
                //                    $("#HBillType").val("3720");
                //                    var optionHtml = '';
                //                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                //                    $("#HBillType").append(optionHtml);
                //                    layui.form.render('select');
                //                    $("#HBillType").attr("readonly", "readonly");
                //                }
                //                else if (result.data.hSourceBillTypeField == "1214") {
                //                    $("#HBillType").empty();
                //                    $("#HBillType").val("1214");
                //                    var optionHtml = '';
                //                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产发料通知单' + "</option>";
                //                    $("#HBillType").append(optionHtml);
                //                    layui.form.render('select');
                //                    $("#HBillType").attr("readonly", "readonly");
                //                }
                //                else {
                //                    //$("#HBillType").empty();
                //                    $("#HBillType").val("-1");
                //                    var optionHtml = '';
                //                    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                //                    $("#HBillType").append(optionHtml);
                //                    layui.form.render('select');
                //                    $("#HBillType").attr("readonly", "readonly");
                //                }
                //                $("#HSourceBillNo").attr("readonly", "readonly");
                //                $("#HNote").val(";一键扫码源单条码");
                //                element.tabChange('tab-MateOutBill', '3');
                //            }
                //            else {
                //                if (HSourceFlag == true) {
                //                    element.tabChange('tab-MateOutBill', '3');
                //                }
                //                else {
                //                    //$("#HSupName").val(result.data.HSupName);
                //                    //$("#HSupID").val(result.data.HSupID);
                //                    //$("#HDeptName").val(result.data.HDept);
                //                    //$("#HDeptID").val(result.data.HDeptID);
                //                    //$("#HSourceBillNo").val(result.data.hSourceBillNoField);
                //                    //$("#HBillType").val(result.data.hSourceBillTypeField)
                //                    HSourceFlag = true;
                //                    ////获取源单类型、源单单号
                //                    //if (result.data.HSourceBillType == "3720") {
                //                    //    ("#HBillType").empty();
                //                    //    $("#HBillType").val("3720");
                //                    //    var optionHtml = '';
                //                    //    optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产用料清单' + "</option>";
                //                    //    $("#HBillType").append(optionHtml);
                //                    //    layui.form.render('select');
                //                    //    $("#HBillType").attr("readonly", "readonly");
                //                    //}
                //                    //else if (result.data.HSourceBillType == "1601") {
                //                    //    $("#HBillType").val("1601");
                //                    //}
                //                    $("#HNote").val(";物料条码");
                //                    element.tabChange('tab-MateOutBill', '3');
                //                }
                //            }
                //            //$("#HSupID").val(result.data.HSupID);
                //            //$("#HSupName").val(result.data.HSupName);
                //            //$("#HDeptID").val(result.data.HDeptID);
                //            //$("#HDeptName").val(result.data.HDeptName);
                //            layer.load(3)
                //            $.ajax({
                //                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                //                type: "GET",
                //                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1204', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                //                success: function (result) {
                //                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                //                        listOption.data = result.data.list;
                //                        table.render(listOption);
                //                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
                //                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
                //                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                //                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                //                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
                //                        $("#HQty_B").val(result.data.list2[0].HQty);
                //                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
                //                        $("#HWHName_B").val(result.data.list2[0].HWHName);
                //                        $("#HSPName_B").val(result.data.list2[0].HSPName);
                //                    }
                //                    else {
                //                        layer.msg(result.Message);
                //                    }
                //                    layer.closeAll("loading");
                //                }
                //            });
                //            //清空数量
                //            $("#HQty").val("");
                //        }
                //        else {
                //            playSound();
                //            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //        }
                //        layer.closeAll("loading");
                //    }
                //});
            }
            function playSound1() {
                var audio = document.getElementById("cs2");
                audio.play();
            }
            //扫源单
            function GetMeesageBySourceBillNo(obj) {
                var HSourceBillNo = $('#HSourceBillNo').val()
            //#endregion
            //#region æ˜¾ç¤ºç‰©æ–™åˆ—表信息
            function DisBillEntryList() {
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                var HPPQty = $("#HPPQty").val()
                var HFIFOWHID = $("#HFIFOWHID").val()
                var HPlanMode = $("#HPlanMode").val()
                if (HPPQty == "") {
                    HPPQty = 0;
                }
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                var HBillType = '1204'
                var sHStockOrgID = sessionStorage["OrganizationID"];
                //刷新列表信息
                $.ajax({
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                    type: "GET",
                    data: { "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1204', "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "sMaker": sessionStorage["HUserName"], "sPPQty": HPPQty, "sPlanMode": HPlanMode, "sFIFOWHID": HFIFOWHID, "HOWNERID": sessionStorage["OrganizationID"] },
                    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HStockOrgID": sHStockOrgID },
                    success: function (result) {
                        HSourceFlag = true;
                        $("#HPlanMode").attr("disabled", "true");
                        $("#HBillType").attr("disabled", "true");
                        $("#HBillType").attr("disabled", "disabled");
                        form.render('select');
                        if (result.data.hMulSourceFlagField == 0) {
                            $("#HSourceBillNo").attr("readonly", "readonly");
                        }
                        element.tabChange('tab-MateOutBill', '2');
                        //扫源单成功后,光标显示到仓库上
                        //$("#HWHNAME").focus();
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            playSound1();//播放声音
                            layer.load(3)
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1204', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                        $("#HQty_B").val(result.data.list2[0].HQty);
                                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                        $("#HWHName_B").val(result.data.list2[0].HWHName);
                                        $("#HSPName_B").val(result.data.list2[0].HSPName);
                                    }
                                    else {
                                        layer.msg(result.Message);
                                    }
                                    layer.closeAll("loading");
                                }
                            });
                            listOption.data = result.data.Materlist;
                            table.render(listOption);
                            FIFOlistOption.data = result.data.FIFOlist;
                            table.render(FIFOlistOption);
                            $("#HBarCode_B").val(result.data.BarCodeDetailslist[0].HBarCode);
                            $("#HMaterName_B").val(result.data.BarCodeDetailslist[0].HMaterName);
                            $("#HMaterModel_B").val(result.data.BarCodeDetailslist[0].HMaterModel);
                            $("#HBatchNo_B").val(result.data.BarCodeDetailslist[0].HBatchNo);
                            $("#HUnitName_B").val(result.data.BarCodeDetailslist[0].HUnitName);
                            $("#HQty_B").val(result.data.BarCodeDetailslist[0].HQty);
                            $("#HTMQty_B").val(result.data.BarCodeDetailslist[0].HTMQty);
                            $("#HWHName_B").val(result.data.BarCodeDetailslist[0].HWHName);
                            $("#HSPName_B").val(result.data.BarCodeDetailslist[0].HSPName);
                            ////console.log(result.data.list2);
                            //var count = 0;
                            //var count1 = 0;
                            //for (var i = 0; i < result.data.Materlist.length; i++) {
                            //    count += result.data.Materlist[i].HQty;
                            //    count1 += result.data.Materlist[i].HPieceQty;
                            //}
                            //$("#HSumQtys").val(count);
                            //$("#HBarcodeQtys").val(count1);
                            ////return;
                        }
                        else {
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            layer.msg(result.Message);
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            //#endregion
        });
        //以上为Layui模块
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBill_FastList.html
@@ -139,26 +139,60 @@
            }); 
            //window.close();//关闭当前页
        })
         //编辑
        //编辑
        form.on('submit(cmdModify)', function () {
            var checkStatus = table.checkStatus('dj-table')
                     , data = checkStatus.data;
            //ajaxLabelData = data;
            //layer.alert(rows);
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '领料单'
                , shade: 0.6 //遮罩透明度
                , maxmin: false //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../领料发货/领料出库/Kf_MateOutBill_Fast.html?linterid=' + data[0].HInterID, 'yes']
                , resize: false
                , cancel: function () {
                    $(".layui-btn").removeClass("layui-btn-disabled");
                , data = checkStatus.data;
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/WEBSController/TempList_Modify_Json",
                async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                data: { "HInterID": data[0].HInterID, "HBillNo": data[0].HBillNo, "HBillType": sBillType },
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        layer.open({
                            type: 2
                            , area: ['100%', '100%']
                            , title: '领料出库单'
                            , shade: 0.6 //遮罩透明度
                            , maxmin: false //允许全屏最小化
                            , anim: 0 //0-6的动画形式,-1不开启
                            , content: ['../../领料发货/领料出库/Kf_MateOutBill_Fast.html?OperationType=2&HInterID=' + data[0].HInterID, 'yes']
                            , resize: false
                            , cancel: function () {
                                $(".layui-btn").removeClass("layui-btn-disabled");
                            }
                        })
                    }
                    else {
                        layer.msg(result.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: "温馨提示" });
                }
            })
            });
        });
        // //编辑
        //form.on('submit(cmdModify)', function () {
        //    var checkStatus = table.checkStatus('dj-table')
        //             , data = checkStatus.data;
        //    //ajaxLabelData = data;
        //    //layer.alert(rows);
        //    layer.open({
        //        type: 2
        //        , area: ['100%', '100%']
        //        , title: '领料单'
        //        , shade: 0.6 //遮罩透明度
        //        , maxmin: false //允许全屏最小化
        //        , anim: 0 //0-6的动画形式,-1不开启
        //        , content: ['../../领料发货/领料出库/Kf_MateOutBill_Fast.html?linterid=' + data[0].HInterID, 'yes']
        //        , resize: false
        //        , cancel: function () {
        //            $(".layui-btn").removeClass("layui-btn-disabled");
        //        }
        //    })
        //});
        //刷新
        form.on('submit(cmdRefresh)', function () {
            //动态列-刷新缓存列表