zzr99
2022-03-25 2bf9cfda7325928ff07d3b432a0b47b561405605
墙咔装箱2.0
6个文件已修改
2个文件已添加
3635 ■■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index_Mobile.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/基础资料/Sc_MouldStockBillMain_Temp.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainBillList.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产装箱单/QK_PackedBillList.html 343 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产装箱单/QK_PackingBill.html 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/其他出库/Kf_OtherOutBill_Check.html 1031 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
Diff too large
WebTM/WebTM.csproj
@@ -817,6 +817,7 @@
    <Content Include="views\生产管理\生产汇报单\Sc_Add_ICMOReportBillList.html" />
    <Content Include="views\生产管理\生产物料清单\sc_Gy_ICBomBillMainList.html" />
    <Content Include="views\生产管理\生产组装追溯单\Sc_AssemblyBillList.html" />
    <Content Include="views\生产管理\生产装箱单\QK_PackedBillList.html" />
    <Content Include="views\生产管理\生产装箱单\QK_PackingBill.html" />
    <Content Include="views\生产管理\生产装箱单\Sc_PackUnionBill_Fast.html" />
    <Content Include="views\生产管理\生产退库单\Sc_ProductionReturnList.html" />
@@ -918,6 +919,7 @@
    <Content Include="views\销售管理\销售退货单\Add_Edit_Kf_ICStockBillMainList.html" />
    <Content Include="views\销售管理\销售退货单\Kf_ICStockBillMainList.html" />
    <Content Include="views\销售管理\销售订单\Add_Edit_Xs_SeOrderBillList.html" />
    <Content Include="views\领料发货\其他出库\Kf_OtherOutBill_Check.html" />
    <Content Include="views\领料发货\分步式调出单\Fb_StepFoldOutBillList.html" />
    <Content Include="views\领料发货\委外出库\Kf_EntrustOutBillList.html" />
    <Content Include="views\领料发货\收料入库\Kf_ReciveBill_Fast.html" />
WebTM/views/index_Mobile.html
@@ -328,6 +328,10 @@
                              <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
                              å…¶ä»–出库
                          </a>
                          <a href="领料发货/其他出库/Kf_OtherOutBill_Check.html" target="main_self_frame" style="color: aqua;">
                              <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
                              å…¶ä»–出库校验
                          </a>
                      </dd>
                      <dd>
                          <a href="仓存管理/仓库调拨/Kf_MoveStockBill_Fast.html" target="main_self_frame" style="color: aqua;">
WebTM/views/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Sc_MouldStockBillMain_Temp.html
@@ -147,6 +147,7 @@
                        , { field: '物料规格', title: '物料规格' }
                        , { field: '器具条码', title: '器具条码' }
                        , { field: '数量', title: '数量' }
                        , { field: '盘点单位', title: '盘点单位' }
                        , { field: '实际位置类型', title: '实际位置类型' }
                        , { field: '实际位置', title: '实际位置' }
                        , { field: '制单人', title: '制单人' }
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldMaintainBillList.html
@@ -100,7 +100,6 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
WebTM/views/Éú²ú¹ÜÀí/Éú²ú×°Ïäµ¥/QK_PackedBillList.html
New file
@@ -0,0 +1,343 @@
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>已装箱单据列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">条码号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBarCode" id="HBarCode" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">物料名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HMaterName" id="HMaterName" style="width:190px;">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HDate" style="width:190px;">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">装箱子类</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            // #region å…¨å±€å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , table1 = layui.table
                , table2 = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var option1 = [];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //初始化界面
             set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //删除
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) {
                var datas = obj.data; //获得当前行数据
                var HBarCode = datas.HBarCode;
                $.ajax({
                    url: GetWEBURL() + 'Sc_ICMOBillController/QK_GetPackingBillListByMainID',
                    type: "GET",
                    data: { "HInterID": HBarCode },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option1.data = data1.data;
                            table1.render(option1);
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            });
            // æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
            // é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
         //#endregion
           //#region å½“前页面加载所有方法
           // åˆå§‹åŒ–界面
           function set_ClearBill() {
               $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
               //初始化表格(主表)
                set_InitGrid();
                //初始化表格(子表)
                set_InitGrid1();
                //查询
                get_Display(sWhere);
            }
            //初始化表格(主)
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: '400'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                        , { field: 'hmainid', title: '单据ID', width: 200, hide: true }
                        , { field: 'HBarCode', title: '条形码', width: 200 }
                        , { field: 'HBarCodeType', title: '条码类型', width: 200 }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                        , { field: 'HUnitID', title: 'HUnitID', width: 200, hide: true }
                        , { field: 'HUnitName', title: '单位名称', width: 200 }
                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                        , { field: 'HEmpName', title: '业务员', width: 200 }
                        , { field: 'HQty', title: '数量', width: 200 }
                        , { field: '制单人', title: '制单人', width: 200 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
                table.render(option);
            }
            //初始化表格(子表)
            function set_InitGrid1()
            {
                var ajaxLoad = layer.load();
                option1 = {
                    elem: '#mainTable1'
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                        , { field: 'hmainid', title: '单据ID', width: 200, hide: true }
                        , { field: 'HBarCode_Pack', title: '托条码', width: 200 }
                        , { field: 'HBarCode', title: '条形码', width: 200 }
                        , { field: 'HBarCodeType', title: '条码类型', width: 200 }
                        , { field: 'HBillType', title: '单据类型', width: 200, hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                        , { field: 'HUnitID', title: 'HUnitID', width: 200, hide: true }
                        , { field: 'HUnitName', title: '单位名称', width: 200 }
                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                        , { field: 'HEmpName', title: '业务员', width: 200 }
                        , { field: 'HQty', title: '数量', width: 200 }
                    ]]
                };
                option1.data = [];
                table1.render(option1);
                layer.close(ajaxLoad);
            }
            //查询
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                var HDate = $("#HDate").val();//结束日期
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),制单日期, 23) >= '" + HDate + "'";
                }
                //进入页面显示的缓存列表
                $.ajax({
                    url: GetWEBURL() + '/Sc_ICMOBillController/QK_GetPackingBillList',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //快速过滤
            function get_FastQuery() {
                var HBarCode = $("#HBarCode").val();//单据号
                var HMaterName = $("#HMaterName").val();
                var HDate = $("#HDate").val();//结束制单时间
                if (HBarCode) {
                    sWhere += " and HBarCode like '%" + HBarCode + "%'";
                }
                if (HMaterName) {
                    sWhere += " and HMaterName like '%" + HMaterName + "%'";
                }
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),制单日期, 23) >= '" + HDate + "'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //重置过滤条件方法
            function set_ClearQuery() {
                $("#HBarCode").val("");//单据号
                $("#HMaterName").val("");//单据号
                $("#HDate").val("");//时间
                sWhere = "";
                get_Display(sWhere);
            }
            //删除
            function set_DeleteBill()
            {
                var flag = 0;
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var cache=table.cache['mainTable1']
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].hmainid.toString();
                    if (cache.length!=0) {
                        flag = 1;
                    }
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "/Sc_ICMOBillController/DeleteQK_GetPackingBillList", //方法所在页面和方法名
                            data: { "HInterID": HInterID, "Flag": flag },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        });
                    })
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //刷新
            function get_Refresh() {
                set_ClearQuery();
            }
            //#endregion
            //以上是layui模块
        });
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/Éú²ú×°Ïäµ¥/QK_PackingBill.html
@@ -9,14 +9,13 @@
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -35,6 +34,7 @@
                                    <label class="layui-form-label" style="width: 100px">生产任务单号:</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="HBillNo" id="HBillNo" placeholder="请输入后回车" class="layui-input" value="" style="float:left;width:260px;">
                                        <input type="text" name="HBillNo1" id="HBillNo1" style="display:none">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnPack" id="btnPack" style="padding: 0 30px; margin-left: 150px">整装生成</button>
@@ -110,12 +110,43 @@
            //整箱生成
            form.on('submit(btnPack)', function (data) {
                var flag = "ZZ";
                SavePack(flag);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                SavePack(flag, sSubStr);
            });
            //拼箱生成
            form.on('submit(btnAssembly)', function (data) {
                var flag = "PZ";
                SavePack(flag);
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length > 1) {
                    var sSubStr = JSON.stringify(table.checkStatus('mainTable').data);
                    SavePack(flag,sSubStr);
                }
                else {
                    layer.msg('请最少选择2行数据!');
                }
            });
            //监听单元格编辑  å•元格编辑后 å˜æ›´
            table.on('edit(mainTable)', function (obj) {
                // å•元格编辑之前的值
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                switch (field) {
                    case "HMinQty":  //最小包装数
                        value = parseInt(isNaN(value) ? 0 : value);
                        var HPlanQty = parseInt(isNaN(data.HPlanQty) ? 0 : data.HPlanQty);
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMinQty: value,                          //最小包装数
                            HTotalQty: Math.floor(HPlanQty / value),     //生成包装数=数量/最小包装数
                            HSpsQty: HPlanQty % value               //剩余数量=数量%最小包装数
                        });
                        break;
                    default:
                }
            });
            //#endregion
@@ -128,30 +159,25 @@
                    , { field: 'HInterID', title: 'HInterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HBillNo', title: 'HBillNo', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '物料代码', edit: 'text', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', edit: 'text', width: 100 }
                    , { field: 'HMaterNumber', title: 'HMaterNumber', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterName', title: '物料名称', edit: 'false', width: 100 }
                    , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true }
                    , { field: 'HUnitName', title: '计量单位', edit: 'text', width: 100 }
                    , { field: 'HWeight', title: '净重', edit: 'text', width: 100 }
                    , { field: 'HMWeight', title: '毛重', edit: 'text', width: 100 }
                    , { field: 'HPWeight', title: '皮重', edit: 'text', width: 100 }
                    , { field: 'HUnitName', title: '计量单位', edit: 'false', width: 100 }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 100 }
                    , { field: 'HPlanQty', title: '数量', edit: 'false', width: 100 }
                    , { field: 'HMinQty', title: '最小包装数', edit: 'text', event: 'HMinQty', width: 100 }
                    , { field: 'HTotalQty', title: '生成条数', edit: 'text', width: 100 }
                    , { field: 'HSpsQty', title: '剩余数量', edit: 'text', width: 100 }
                    , { field: 'HAddress', title: '交货地点', edit: 'text', width: 100 }
                    , { field: 'HDate', title: '交货日期',  width: 100, templet: "<div>{{d.HDate ==null ?'':layui.util.toDateString(d.HDate, 'yyyy-MM-dd')}}</div>"}
                    , { field: 'HOutStockQty', title: '出库数量', edit: 'text', width: 100 }
                    , { field: 'HInvoiceQty', title: '开票数量', edit: 'text', width: 100 }
                    , { field: 'HTaxPrice', title: '含税单价', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '不含税单价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HTotalQty', title: '生成条数', edit: 'false', width: 100 }
                    , { field: 'HSpsQty', title: '剩余数量', edit: 'false', width: 100 }
                    , { field: 'HCusID', title: 'HCusID', edit: 'text', width: 100, hide: true }
                    , { field: 'HCusName', title: '客户', edit: 'text',  width: 100 }
                    , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true}
                    , { field: 'HEmpName', title: '业务员', edit: 'text', width: 100 }
                    , { field: 'HCusName', title: '客户', edit: 'false', width: 100 }
                    , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true }
                    , { field: 'HEmpName', title: '业务员', edit: 'false', width: 100 }
                    , { field: 'HDeptID', title: 'HDeptID', edit: 'text', width: 100, hide: true }
                    , { field: 'HDeptName', title: '生产车间', edit: 'false', width: 100 }
                    , { field: 'HPlanEndDate', title: '计划完工日期', width: 100, templet: "<div>{{d.HPlanEndDate ==null ?'':layui.util.toDateString(d.HPlanEndDate, 'yyyy-MM-dd')}}</div>"}
                ];
                option = {
                    id: 'mainTable'
@@ -165,12 +191,11 @@
                    , done: function (res, curr, count) {
                    }
                };
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HUnitID": 0, "HUnitName": "", "HWeight": 0, "HMWeight": 0,"HPWeight":0,"HQty": 0, "HMinQty": 0, "HTotalQty": 0, "HSpsQty": 0, "HAddress": "", "HDate": "", "HOutStockQty": 0, "HInvoiceQty": 0, "HTaxPrice": 0, "HPrice": 0, "HMoney": 0, "HCusID": 0, "HCusName": "", "HEmpID": 0, "HEmpName": "" }];
                option.data = [{ "HMaterID": 0, "HMaterName": "", "HUnitID": 0, "HUnitName": "", "HPlanQty": 0, "HMinQty": 0, "HTotalQty": 0, "HSpsQty": 0, "HCusID": 0, "HCusName": "", "HEmpID": 0, "HEmpName": "", "HDeptID": 0, "HDeptName": "","HPlanEndDate":"" }];
                table.render(option);
            }
            //整箱生成
            function SavePack(flag) {
                var sSubStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + flag;
            //生成
            function SavePack(flag, sSubStr) {
                if (!AllowLoadData(sSubStr))//数据验证
                {
                    return false;
@@ -180,14 +205,12 @@
                        type: "POST",
                        url: GetWEBURL() + "/Sc_ICMOBill/QK_PackingBillSavePack", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sSubStr},
                        data: { "msg": sSubStr + ";" + sessionStorage["HUserName"] + ";" + flag + ";" + sessionStorage["OrganizationID"]},
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭
                                    set_InitGrid();//重新加载表格
                                });
                            }
                            else {
WebTM/views/ÁìÁÏ·¢»õ/ÆäËû³ö¿â/Kf_OtherOutBill_Check.html
New file
@@ -0,0 +1,1031 @@
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>其他出库校验</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style>
        .layui-table-cell {
            height: auto;
            white-space: normal;
        }
        .layui-col-xs8 {
            width: 55.666667%;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding:0">
        <div class="layui-card" style="padding: 1px">
            <div class="layui-card-body" style="padding: 5px; height:800px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;"><i class="layui-icon layui-icon-form"></i>其他出库校验</span>
                    </div>
                    <div class="layui-form-item" style="padding:15px;margin:0px">
                        <div class="layui-row">
                            <div class="layui-col-xs3">
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-col-xs5">
                                <label class="layui-form-label" style="width:40px;padding-left:0px;">数量</label>
                                <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-col-xs2">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab layui-col-xs12" lay-filter="tab-POStockInBill">
                        <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>
                        </ul>
                        <div class="layui-tab-content">
                            <!--源单信息-->
                            <div class="layui-tab-item layui-show">
                                <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">
                                            <select name="HBillType" id="HBillType">
                                                <option value="1103">收料通知单</option>
                                                <option value="1102">采购订单</option>
                                            </select>
                                        </div>
                                    </div>
                                    <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">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--物料清单-->
                            <div class="layui-tab-item">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <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:40px;padding-left:0px;">数量</label>
                                                </div>
                                                <div class="layui-col-xs8">
                                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                                </div>
                                            </div>
                                        </div>
                                        <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                                    </div>
                                </div>
                            </div>
                            <!--合计信息-->
                            <div class="layui-tab-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 layui-input-inline mobile">
                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" value="0" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <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 layui-input-inline mobile">
                                        <input type="text" name="HSumQtys" id="HSumQtys" lay-verify="HSumQtys" value="0" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <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 layui-input-inline mobile">
                                        <input type="text" name="HNote" id="HNote" lay-verify="HNote" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">提交</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs" hidden controls>
                            <source src="../../video/jingbao.wav" type="audio/ogg">
                        </audio>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs2" hidden controls>
                            <source src="../../video/success.wav" type="audio/ogg">
                        </audio>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //清空界面  new
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
            $("#HStockPlaceName").val(sessionStorage["HSPName"]);
            //$("#HSupID").val(sessionStorage["HSupID"]);
            //$("#HSupName").val(sessionStorage["HSupName"]);
            $("#HDeptID").val(sessionStorage["HDeptID"]);
            $("#HDeptName").val(sessionStorage["HDept"]);
            $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
            $("#HSecManager").val(sessionStorage["HSecManager"]);
            $("#HKeeperID").val(sessionStorage["HKeeperID"]);
            $("#HKeeper").val(sessionStorage["HKeeper"]);
            $("#HMaker").val(sessionStorage["HUserName"]);
            $("#HMaker").hide();
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
            //获取参数
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            //加载表头
            function RoadBillMain(linterid) {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
                    type: "GET",
                    data: { "HInterID": linterid },
                    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);
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        //$("#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);
                        HSourceFlag = true;
                        RoadSup();
                    }
                })
            }
            //根据源单类型及源单号 åŠ è½½ä¾›åº”å•†
            function RoadSup() {
                //var sInterID = $("#HInterID").val()
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                //判断文本框是否有数据    new
                if (HSourceBillNo == "" || sInterID <= 0) {
                    layer.msg($('#HSourceBillNo').val(), { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                else {
                    $.ajax({
                        url: GetWEBURL() + "/POStockInBill/get_GetCg_POOrderBillList",
                        type: "GET",
                        data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                $("#HSupID").val(result.data[0].HSupID);
                                $("#HSupName").val(result.data[0].HSupName);
                                $("#HDeptID").val(result.data[0].HDeptID);
                                $("#HDeptName").val(result.data[0].HDeptName);
                                sessionStorage["SourceFlag"] = true;
                                element.tabChange('tab-POStockInBill', '2');
                                layer.load(3);
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            }
            //加载表体
            function RoadBillSub(linterid) {
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                    , where: { HBillID: linterid, HBillType: '1201', sWhere: '' }
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HQty', title: '数量', sort: true, width: 100 }
                        , { field: 'HQtyMust', title: '应收数量', sort: true, width: 100 }
                        , { field: 'HMaterNumber', title: '物料代码', sort: true, width: 200 }
                        , { field: 'HMaterName', title: '物料名称', sort: true, width: 200 }
                        , { field: 'HMaterModel', title: '规格型号', sort: true, width: 200 }
                        , { field: 'HSourceInterID', title: '源单主内码', sort: true, width: 200 }
                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true, width: 200 }
                        , { field: 'HSourceBillNo', title: '源单单号', sort: true, width: 200 }
                        , { field: 'HBatchNo', title: '批次', sort: true, width: 200 }
                    ]]
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
            //动态加载源单类型列表 new
            //判断是否新增
            if (linterid == null || linterid == 0) {
                //获取最大单据号 new
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    //url: GetWEBURL() + "/Web/UpdatePOInStockBillPrintQty", //方法所在页面和方法名
                    type: "GET",
                    data: { "HBillType": '1201' },
                    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);
                RoadSup();
            }
            //如果修改则走下面 new
            //进入物料明细页签、条码框 å…‰æ ‡ç„¦ç‚¹   new
            if (1 == 2) {
                element.tabChange('tab-POStockInBill', '3');
                var pFocus = $("#HBarCode");
                pFocus.focus();
                pFocus.select();
            }
            else {
                element.tabChange('tab-POStockInBill', '1');
                var pFocus = $("#HSourceBillNo");
                pFocus.focus();
                pFocus.select();
            }
            //
            ////选择调入仓库
            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_WarehouseList.html?Type=HWHID', '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(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 () {
                sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            //编辑
            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");
                    }
                })
                // }
            });
            //删除
            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 = '1201'
                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: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/POStockInBill/Delete_Json",
                        async: true,
                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": '1103', },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //layer.msg(data.Message, { icon: 1 });
                                table.render({
                                    elem: '#wl-table'
                                    //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Mate_Webs_Json'
                                    //, url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Mate_Webs_Json'
                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                    , cellMinWidth: 80
                                    , toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 100 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 200 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 200 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                        , { field: 'HBatchNo', title: '批次', width: 200 }
                                        , { field: 'HAuxPropID', title: '辅助属性', width: 200 }
                                        , { field: 'HMTONo', title: '计划跟踪号', width: 200 }
                                    ]]
                                    , 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) {//提交
                if ($("#HExplanation").val() == "") {
                    if ($("#HWHNAME").val() == "宽幅成品仓NEW" || $("#HWHNAME").val() == "样本仓NEW") {
                        $("#HWHNAME").val("");
                        $("#HWHID").val("");
                        layer.msg("请扫MES库位码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                }
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr, 'Saver') != false)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/set_SavePOStockInBill_Json", //方法所在页面和方法名
                            url: GetWEBURL() + "/POStockInBill/set_SavePOStockInBill_Json",
                            async: true,
                            data: { "oMain": sMainStr },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    sessionStorage["SourceFlag"] = false;
                                    layer.confirm("收料" + data.Message + $("#HBillNo").val(), {
                                        icon: 1,
                                        skin: 'layui-layer-lan',
                                        closeBtn: 0,
                                        btn: ['确认'],
                                        btn2: function () {
                                            //parent.layui.admin.events.closeThisTabs();关闭页签
                                            //window.close();//关闭页面,浏览器有效,PDA无效
                                            //window.location.reload();//新增
                                            parent.location.href = "../../../views/index.html"
                                        }//关闭
                                    }
                                        , function () { parent.location.href = "../../../views/index.html"; }//新增
                                    );
                                }
                                else {
                                    //layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                                layer.closeAll("loading");
                                layui.form.render();
                            },
                            error: function (err) {
                                //layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                                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) {
                var sQty = $("#HQty").val();
                if (sQty == "") {
                    sQty = 0;
                }
                if (event.keyCode == 13) {
                    GetMeesageByBarCode();
                }
            });
            //确定
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageBySourceBillNo();
                }
            });
            //确定
            form.on('submit(QueDin2)', function (data) {
                GetMeesageBySourceBillNo();
            });
            //扫仓位
            $('#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-POStockInBill', '2');
                            }
                            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 });
                }
            });
            //刷新明细页签
            table.render({
                elem: '#mx-table'
                // , url: 'http://localhost:8083/POStockInBill/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , height: 500
                , done: function () {
                }
            });
            //扫MES仓位
            $('#HMESSPName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HMESSPName').val();
                if (event.keyCode == 13) {
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
                        type: "GET",
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) {
                                $("#HMESSPID").val(result.data[0].HWHID);
                                $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
                                $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
                                $.ajax({
                                    url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
                                    type: "GET",
                                    data: { "HERPWHID": result.data[0].HWHID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            $("#HWHID").val(result.data[0].HMESWHID);
                                            $("#HWHNAME").val(result.data[0].HMESWHNAME);
                                            $("#HMESSPName").attr("readonly", "readonly");//MES仓位只读HExplanation
                                            $("#HMESSPName").css("background-color", "#efefef4d");
                                        }
                                        else {
                                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                        }
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                }
            });
            //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var sSubStr = table.cache['wl-table'];
                var sBarCode = $('#HBarCode').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var sQty = $("#HQty").val()
                var sHBillType = $("#HBillType").val()  //源单类型
                var sBillType = '1201'
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                if (sQty == "") {
                    sQty = 0;
                }
                //判断条码是否为空  new
                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 != "") {
                    $('#HQty').val("");
                }
                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() + "/POStockInBill/get_CheckTypeByBarCode_Json",
                    type: "GET",
                    data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": true, "sSourceBillNo": sSourceBillNo, "sSourceType": '1103', "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            playSound1();
                            if (result.data.HBarType == '仓库条码') {
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-POStockInBill', '2');  //跳转页签
                            }
                            else if (result.data.HBarType == '仓位条码') {
                                $("#HStockPlaceName").val(result.data.HSPName);
                                $("#HStockPlaceID").val(result.data.HSPID);
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HNote").val(";一键扫码仓位条码");
                                element.tabChange('tab-POStockInBill', '2');//跳转页签
                            }
                            else if (result.data.HBarType == '部门条码') {
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HNote").val(";一键扫码部门条码");
                                element.tabChange('tab-POStockInBill', '2');//跳转页签
                            }
                            else if (result.data.HBarType == '源单条码') {
                                $("#HSupName").val(result.data.HSupName);
                                $("#HSupID").val(result.data.HSupID);
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                sessionStorage["SourceFlag"] = true;
                                //获取源单类型、源单单号
                                if (result.data.HSourceBillType == "1102") {
                                    $("#HBillType").val("1102");
                                }
                                else if (result.data.HSourceBillType == "1103") {
                                    $("#HBillType").val("1103");
                                }
                                else {
                                    $("#HBillType").val("手工录入");
                                }
                                $("#HNote").val(";一键扫码源单条码");
                                element.tabChange('tab-POStockInBill', '3');
                            }
                            else {
                                if (sessionStorage["SourceFlag"] == "true") {
                                    element.tabChange('tab-POStockInBill', '3');
                                }
                                else {
                                    $("#HSupName").val(result.data.hSupNameField);
                                    $("#HSupID").val(result.data.hSupIDField);
                                    //$("#HDeptName").val(result.data.HDept);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    sessionStorage["SourceFlag"] = true;
                                    //获取源单类型、源单单号
                                    if (result.data.hSourceBillTypeField == "1102") {
                                        $("#HBillType").val("1102");
                                    }
                                    $("#HNote").val(";物料条码");
                                    element.tabChange('tab-POStockInBill', '3');
                                }
                            }
                            layer.load(3)
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#HBarCode_B").val(result.data.list1[0].HBarCode);
                                        $("#HMaterName_B").val(result.data.list1[0].HMaterName);
                                        $("#HMaterModel_B").val(result.data.list1[0].HMaterModel);
                                        $("#HBatchNo_B").val(result.data.list1[0].HBatchNo);
                                        $("#HUnitName_B").val(result.data.list1[0].HUnitName);
                                        $("#HQty_B").val(result.data.list1[0].HQty);
                                        $("#HTMQty_B").val(result.data.list1[0].HTMQty);
                                        $("#HWHName_B").val(result.data.list1[0].HWHName);
                                        $("#HSPName_B").val(result.data.list1[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");
                    }
                });
            }
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , 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: 150 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HBatchNo', title: '批次', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            function playSound() {
                var audio = document.getElementById("cs");
                audio.play();
            }
            function playSound1() {
                var audio = document.getElementById("cs2");
                audio.play();
            }
            //扫源单
            function GetMeesageBySourceBillNo(obj) {
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                if (HSourceBillNo == "" || sInterID <= 0) {
                    layer.msg("源单号为空,或者内码不存在!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                //
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
                    url: GetWEBURL() + "/POStockInBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
                    type: "GET",
                    data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            $("#HSupID").val(result.data[0].HSupID);
                            $("#HSupName").val(result.data[0].HSupName);
                            sessionStorage["SourceFlag"] = true;
                            layer.load(3);
                            element.tabChange('tab-POStockInBill', '2');
                            table.render({
                                elem: '#wl-table'
                                , cellMinWidth: 80
                                //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                //, toolbar: '#toolbarDemo'
                                , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HQty', title: '数量', sort: true, width: 100 }
                                    , { field: 'HQtyMust', title: '应收数量', sort: true, width: 100 }
                                    , { field: 'HMaterNumber', title: '物料代码', sort: true, width: 200 }
                                    , { field: 'HMaterName', title: '物料名称', sort: true, width: 200 }
                                    , { field: 'HMaterModel', title: '规格型号', sort: true, width: 200 }
                                    , { field: 'HSourceInterID', title: '源单主内码', sort: true, width: 200 }
                                    , { field: 'HSourceEntryID', title: '源单子内码', sort: true, width: 200 }
                                    , { field: 'HSourceBillNo', title: '源单单号', sort: true, width: 200 }
                                    , { field: 'HBatchNo', title: '批次' }
                                ]]
                                // , data: [linterid]
                                // , page: true
                                , height: 500
                                , done: function () {
                                    layer.closeAll("loading");
                                }
                            });
                        }
                        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");
                    }
                });
            }
        });
        //以上为layui模块
        //此处方法涉及到被外部页面parent.方法名调用的必须放在Layui方法外部
        function GetHWHValue(obj)  //返回调入仓库
        {
            $("#HWHNAME").val(obj[0].HName);
            //sessionStorage["HWHID"] = obj[0].HItemID;
            $("#HWHID").val(obj[0].HItemID);
        }
        function GetHSpValue(obj) {  //返回调入仓位
            $("#HStockPlaceName").val(obj[0].HName);
            $("#HStockPlaceID").val(obj[0].HItemID);
        }
        function GetHSupValue(obj) {  //返回供应商
            $("#HSupName").val(obj[0].HName);
            $("#HSupID").val(obj[0].HItemID);
        }
        function GetHKeeperValue(obj) {  //返回保管
            $("#HKeeper").val(obj[0].HName);
            $("#HKeeperID").val(obj[0].HItemID);
        }
        function GetHSecManagerValue(obj) {  //返回验收
            $("#HSecManager").val(obj[0].HName);
            $("#HSecManagerID").val(obj[0].HItemID);
        }
        function GetHDeptNameValue(obj) {   //返回部门
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr, bnt) {  //非空验证
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            if ($("#HDeptName").val() == '') {
                layer.msg("部门没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HSecManager").val() == '') {
                layer.msg("验收人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HKeeper").val() == '') {
                layer.msg("保管人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //if ($("#HSupName").val() == '') {
            //    layer.msg("供应商没有选择", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
            //    return false;
            //}
            //if ($("#HWHNAME").val() == '') {
            //    layer.msg("仓库没有选择!", { icon: 5 });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (typeof (sSubStr) == "undefined") {
                //layer.msg("没有物料明细记录", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (bnt == 'Saver') {
                if (!typeof (sSubStr) == "undefined") {
                    //for (var i = 0; i <= sSubStr.length - 1; i++) {  //判断扫码数量不能大于应收数量
                    //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
                    //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust)) {
                    //            layer.msg("数量不能大于应收数量", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                    //            return false;
                    //        }
                    //    }
                    //}
                    for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                        if (parseFloat(sSubStr[i].HQty) > 0) {
                            s = 1;
                        }
                    }
                    if (s == 0) {
                        layer.msg("外购入库记录未扫码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                }
            }
            else {
                return true;
            }
        }
    </script>
</body>
</html>