zzr99
2022-04-19 81ad9c5cd22045e4739d70d8001a0fcf6941dace
Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI
11个文件已添加
11个文件已修改
5625 ■■■■■ 已修改文件
WebTM/HtmlPage1.html 1140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/home/console_Mobile.html 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index_Mobile.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/仓存管理/仓库调拨/Kf_MoveStockBill_Fast.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/Cg_PODemandPlanConfigBillList.html 439 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/Cg_PODemandPlanConfigBill_Add.html 489 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/Gy_WorkWarehouseBillList.html 381 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/Gy_WorkWarehouseBill_Add.html 473 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/JIT_NeedMaterPlanConfigBillList.html 439 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/日计划基础资料/JIT_NeedMaterPlanConfigBill_Add.html 489 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产汇报单/Sc_ICMOReportBill_FastNew.html 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产汇报单/Sc_ICMOReportBill_FastNewList.html 307 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/组托单编辑/Sc_GroupOrderBillEdit_Fast.html 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/其他入库/Kf_OtherInBill_Fast.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/其他入库/Kf_OtherOutBill_CheckList_New.html 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/其他入库/Kf_OtherOutBill_Check_New.html 966 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/外购入库/Kf_POStockInBill_Fast.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/HtmlPage1.html
New file
@@ -0,0 +1,1140 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<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;
        }
    </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" style="display:none;">
                            <div class="layui-col-xs3">
                                <label class="layui-form-label" style="width:60px;padding-left:0px;">MES库位</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HMESSPName" id="HMESSPName" autocomplete="off" class="layui-input">
                                <input type="hidden" name="HMESSPID" id="HMESSPID" value="0" autocomplete="off" class="layui-input">
                                <input type="hidden" name="HExplanation" id="HExplanation" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <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="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                            </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>
                            <li lay-id="4" 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>
                                </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-xs3">
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HWHID-BT">...</button>
                                        </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:30px;padding-left:0px;">仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT">...</button>
                                        </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:45px;padding-left:0px;">供应商</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" autocomplete="off" class="layui-input" disabled="disabled">
                                            <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupID-BT" disabled="disabled">...</button>
                                        </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:30px;padding-left:0px;">保管</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperID-BT">...</button>
                                        </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:30px;padding-left:0px;">验收</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerID-BT">...</button>
                                        </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:30px;padding-left:0px;display:none">制单人</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HBillerID" id="HBillerID" lay-verify="HBillerID" autocomplete="off" class="layui-input">
                                            <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HMakerID" id="HMakerID" lay-verify="HMakerID" value="0" autocomplete="off" class="layui-input" style="display : none">
                                        </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:30px;padding-left:0px;">部门</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptID-BT">...</button>
                                        </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:45px;padding-left:0px;">单据号</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" disabled="disabled" autocomplete="off" class="layui-input mobile">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" disabled="disabled" autocomplete="off" class="layui-input mobile">
                                        </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 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>-->
                    </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>
                </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);
                        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 }
                        , { field: 'HQtyMust', title: '应收数量', sort: true }
                        , { field: 'HMaterNumber', title: '物料代码', sort: true }
                        , { field: 'HMaterName', title: '物料名称', sort: true }
                        , { field: 'HMaterModel', title: '规格型号', sort: true }
                        , { field: 'HSourceInterID', title: '源单主内码', sort: true }
                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true }
                        , { field: 'HSourceBillNo', title: '源单单号', sort: true }
                        , { field: 'HBatchNo', title: '批次', sort: true }
                    ]]
                    , 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);
            }
            //如果修改则走下面 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
            //        , area: ['100%', '100%']
            //        , title: '保管列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            //form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
            //    var sMainStr = JSON.stringify(data.field);
            //    layer.open({
            //        type: 2
            //        , area: ['100%', '100%']
            //        , title: '验收列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            form.on('submit(HKeeperID-BT)', function () {//选择保管
                layer.open({
                    type: 2//弹窗类型
                    , 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: 80 }
                                        , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 100 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                        , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                                    ]]
                                    , 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 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 Flag = sessionStorage["SourceFlag"];
                if (sQty == "") {
                    sQty = 0;
                }
                if (event.keyCode == 13) {
                    //判断条码是否为空  new
                    if (sBarCode == '') {
                        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") {
                            layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return false;
                        }
                    }
                    //if (AllowLoadData(sSubStr, 'HBarCode') != 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": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": '1103', "HOWNERID": sessionStorage["OrganizationID"] },
                        success: function (result) {
                            if (result.count == 1) {
                                if (result.data.HBarType == '仓库条码') {
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-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");
                                        }
                                        else if (result.data.hSourceBillTypeField == "1103") {
                                            $("#HBillType").val("1103");
                                        }
                                        else {
                                            $("#HBillType").val("手工录入");
                                        }
                                        $("#HNote").val(";物料条码");
                                        element.tabChange('tab-POStockInBill', '3');
                                    }
                                }
                                //$("#HSupID").val(result.data.HSupID);
                                //$("#HSupName").val(result.data.HSupName);
                                //$("#HDeptID").val(result.data.HDeptID);
                                //$("#HDeptName").val(result.data.HDeptName);
                                layer.load(3)
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                    , cellMinWidth: 115
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HQty', title: '数量', sort: true }
                                        , { field: 'HQtyMust', title: '应收数量', sort: true }
                                        , { field: 'HMaterNumber', title: '物料代码', sort: true }
                                        , { field: 'HMaterName', title: '物料名称', sort: true }
                                        , { field: 'HMaterModel', title: '规格型号', sort: true }
                                        , { field: 'HSourceInterID', title: '源单主内码', sort: true }
                                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true }
                                        , { field: 'HSourceBillNo', title: '源单单号', sort: true }
                                        , { field: 'HBatchNo', title: '批次', sort: 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");
                        }
                    });
                }
                //else
                //{
                //    layer.msg(result.Message, { icon: 5 });
                //}
                //layer.closeAll("loading");
                //}
            });
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {      //扫源单
                var HSourceBillNo = $('#HSourceBillNo').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                if (event.keyCode == 13) {
                    //判断文本框是否有数据    new
                    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);
                                //$("#HDeptID").val(result.data[0].HDeptID);
                                //$("#HDeptName").val(result.data[0].HDeptName);
                                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 }
                                        , { field: 'HQtyMust', title: '应收数量', sort: true }
                                        , { field: 'HMaterNumber', title: '物料代码', sort: true }
                                        , { field: 'HMaterName', title: '物料名称', sort: true }
                                        , { field: 'HMaterModel', title: '规格型号', sort: true }
                                        , { field: 'HSourceInterID', title: '源单主内码', sort: true }
                                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true }
                                        , { field: 'HSourceBillNo', title: '源单单号', sort: true }
                                        , { 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");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            $('#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");
                        }
                    });
                }
            });
            //以上为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>
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -23,6 +23,9 @@
    <File Include="bin/WebTM.pdb">
      <publishTime>04/13/2022 10:16:48</publishTime>
    </File>
    <File Include="HtmlPage1.html">
      <publishTime>03/14/2022 15:07:22</publishTime>
    </File>
    <File Include="layuiadmin/config.js">
      <publishTime>08/16/2021 17:24:30</publishTime>
    </File>
WebTM/WebTM.csproj
@@ -63,6 +63,7 @@
    <Reference Include="System.EnterpriseServices" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="HtmlPage1.html" />
    <Content Include="layuiadmin\echarts.min.js" />
    <Content Include="layuiadmin\layui\css\global.css" />
    <Content Include="layuiadmin\layui\css\layui - å¤åˆ¶.css" />
@@ -821,6 +822,12 @@
    <Content Include="views\生产管理\报工平台功能页\LineBind.html" />
    <Content Include="views\生产管理\拣料配送单\JIT_ComplementGoodsBill.html" />
    <Content Include="views\生产管理\拣料配送单\JIT_ComplementGoodsList.html" />
    <Content Include="views\生产管理\日计划基础资料\Cg_PODemandPlanConfigBillList.html" />
    <Content Include="views\生产管理\日计划基础资料\Cg_PODemandPlanConfigBill_Add.html" />
    <Content Include="views\生产管理\日计划基础资料\Gy_WorkWarehouseBillList.html" />
    <Content Include="views\生产管理\日计划基础资料\Gy_WorkWarehouseBill_Add.html" />
    <Content Include="views\生产管理\日计划基础资料\JIT_NeedMaterPlanConfigBillList.html" />
    <Content Include="views\生产管理\日计划基础资料\JIT_NeedMaterPlanConfigBill_Add.html" />
    <Content Include="views\生产管理\生产上料单\Sc_MaterToSourceBillList - å¤åˆ¶.html" />
    <Content Include="views\生产管理\生产上料单\Sc_MaterToSourceBillList.html" />
    <Content Include="views\生产管理\生产停工单\Sc_Add_MESStopWorkBillList - å¤åˆ¶.html" />
@@ -837,6 +844,7 @@
    <Content Include="views\生产管理\生产开工单\Sc_Add_MESBeginWorkBillList.html" />
    <Content Include="views\生产管理\生产开工单\Sc_MESBeginWorkBillList.html" />
    <Content Include="views\生产管理\生产拆箱单\Sc_PackSplitBill_Fast.html" />
    <Content Include="views\生产管理\生产汇报单\Sc_ICMOReportBill_FastNewList.html" />
    <Content Include="views\生产管理\生产汇报单\Sc_ICMOReportBill_FastNew.html" />
    <Content Include="views\生产管理\生产汇报单\Sc_Add_ICMOReportBillList.html" />
    <Content Include="views\生产管理\生产物料清单\sc_Gy_ICBomBillMainList.html" />
@@ -845,6 +853,7 @@
    <Content Include="views\生产管理\生产装箱单\QK_PackingBill.html" />
    <Content Include="views\生产管理\生产装箱单\Sc_PackUnionBill_Fast.html" />
    <Content Include="views\生产管理\生产退库单\Sc_ProductionReturnList.html" />
    <Content Include="views\生产管理\组托单编辑\Sc_GroupOrderBillEdit_Fast.html" />
    <Content Include="views\生产管理\组装单\Sc_GroupOrderBillList.html" />
    <Content Include="views\生产管理\质量汇报单\Sc_QualityReportBill.html" />
    <Content Include="views\生产管理\质量汇报单\Sc_QualityReportBillList.html" />
@@ -954,6 +963,8 @@
    <Content Include="views\验收入库\产品入库\Kf_ProductInBillList.html" />
    <Content Include="views\验收入库\其他入库\Kf_OtherInBillList.html" />
    <Content Include="views\模治具管理\模治具管理\Kf_ProductInBillList.html" />
    <Content Include="views\验收入库\其他入库\Kf_OtherOutBill_Check_New.html" />
    <Content Include="views\验收入库\其他入库\Kf_OtherOutBill_CheckList_New.html" />
    <Content Include="views\验收入库\外购入库\Add_Edit_Kf_POStockInBillList.html" />
    <Content Include="views\验收入库\外购入库\Kf_POStockInBackBillList.html" />
    <Content Include="views\验收入库\外购入库\Kf_POStockInBillList.html" />
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\Lay-Ui\MESWMS-LayUI\WebTM\Properties\PublishProfiles\JFTM.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>JFTM</NameOfLastUsedPublishProfile>
    <ProjectView>ShowAllFiles</ProjectView>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
WebTM/layuiadmin/Scripts/webConfig.js
@@ -2,6 +2,7 @@
function GetWEBURL() {
    //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:8085/API/";   //zgq本地
    //var WEBURL = "http://localhost:8080/API/";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/lubao";   //颜晓军本地配置
WebTM/views/home/console_Mobile.html
@@ -89,11 +89,41 @@
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../生产管理/生产汇报单/Sc_ICMOReportBill_FastNew.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>生产汇报单</cite>
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../仓存管理/条码库存/KF_ICInventoryByMaterID.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>条码库存</cite>
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../生产管理/组托单编辑/Sc_GroupOrderBillEdit_Fast.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>组托单编辑</cite>
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../验收入库/其他入库/Kf_OtherOutBill_Check_New.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>其他出库单校验</cite>
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../验收入库/其他入库/Kf_OtherOutBill_CheckList_New.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>其他出库单校验缓存列表</cite>
                                  </a>
                              </li>
                              <li class="layui-col-xs3">
                                  <a href="../生产管理/生产汇报单/Sc_ICMOReportBill_FastNewList.html" target="main_self_frame">
                                      <i class="layui-icon layui-icon-find-fill"></i>
                                      <cite>生产汇报单缓存列表</cite>
                                  </a>
                              </li>
                          </ul>
                      </div>
                  </div>
WebTM/views/index.html
@@ -357,6 +357,14 @@
                                        <dd><a lay-href="生产管理/生产包装单/Sc_PackUnionBill.html">组托单维护</a></dd>
                                    </dl>
                                </dd>
                                <dd>
                                    <a>日计划平台</a>
                                    <dl class="layui-nav-child">
                                        <dd><a lay-href="生产管理/日计划基础资料/Gy_WorkWarehouseBillList.html">车间仓库对照列表</a></dd>
                                        <dd><a lay-href="生产管理/日计划基础资料/Cg_PODemandPlanConfigBillList.html">提料计划信息列表</a></dd>
                                        <dd><a lay-href="生产管理/日计划基础资料/JIT_NeedMaterPlanConfigBillList.html">要料计划信息列表</a></dd>
                                    </dl>
                                </dd>
                            </dl>
                        </li>
                        <!-- è½¦é—´ç®¡ç† -->
WebTM/views/index_Mobile.html
@@ -394,6 +394,12 @@
                          </a>
                      </dd>
                      <dd>
                          <a href="生产管理/生产汇报单/Sc_ICMOReportBill_FastNew.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="" target="main_self_frame" style="color: aqua;">
                              <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
                              æ¡ç æŸ¥è¯¢n
WebTM/views/²Ö´æ¹ÜÀí/²Ö¿âµ÷²¦/Kf_MoveStockBill_Fast.html
@@ -1181,6 +1181,7 @@
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            playSound1();
                            HSourceFlag = true;
                            if (result.data[0].HSourceBillType == '1243') {
                                $("#HStockStyle").val(result.data[0].HStockStyle);
                                $("#HStockInOrgID").val(result.data[0].HSTOCKINORGID);
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/Cg_PODemandPlanConfigBillList.html
New file
@@ -0,0 +1,439 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>提料计划信息列表</title>
    <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/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>
</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-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">单据号</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">供应商</label>
                                    <div class="layui-input-block" style="margin-left: 77px;">
                                        <input type="hidden" class="layui-input" lay-verify="HSupplierID" name="HSupplierID" id="HSupplierID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <input type="text" class="layui-input" lay-verify="HSupplierIDName" name="HSupplierIDName" id="HSupplierIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSupplierID" id="btnHSupplierID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                        </button>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">查询</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">物料名称</label>
                                        <div class="layui-input-block" style="margin-left: 77px;">
                                            <input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <input type="text" class="layui-input" lay-verify="HMaterName" name="HMaterName" id="HMaterName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">物料代码</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" readonly>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">规格型号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" readonly>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    var treeCkData = { id: 0 };
    var TagId = "";
    var TagParentId = "";
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util'], function () {
        //#region å…¬ç”¨å˜é‡
        var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , util = layui.util
            , tree = layui.tree
            , util = layui.util
        var sWhere = "";
        var option = [];
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
        //初始化界面
        set_ClearBill();
        //#endregion
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        //#region å¤´å·¥å…·æ äº‹ä»¶
        table.on('toolbar(mainTable)', function (obj) {
            switch (obj.event) {
                //新增
                case 'set_AddNew': set_AddNew();
                    break;
                //编辑
                case 'set_ShowBill': set_ShowBill();
                    break;
                //删除
                case 'set_DeleteBill': set_DeleteBill();
                    break;
            };
        });
        //#endregion
        //#region ä¾›åº”商
        form.on('submit(btnHSupplierID)', function (data) {
            btnHSupplierID();
        });
        //#endregion
        //#region ç‰©æ–™
        form.on('submit(btnHMaterID)', function (data) {
            btnHMaterID();
        });
        //#endregion
        //#region é‡ç½®æŒ‰é’®
        form.on('submit(btnReSearch)', function (data) {
            set_ClearQuery();
        });
        //#endregion
        //#region æŸ¥è¯¢æŒ‰é’®
        form.on('submit(btnSearch)', function (data) {
            get_FastQuery();
        });
        //#endregion
        //#endregion
        //#region æœ¬é¡µé¢è¢«è°ƒç”¨çš„æ‰€æœ‰æ–¹æ³•
        //#region åˆå§‹åŒ–界面
        function set_ClearBill() {
            //初始化表格
            set_InitGrid();
            //查询
            get_Display(sWhere);
        }
        //#endregion
        //#region åˆå§‹åŒ–表格方法
        function set_InitGrid() {
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: 'hmainid', hide: true }
                    , { field: '单据类型', title: '单据类型', width: 120 }
                    , { field: '日期', title: '日期' }
                    , { field: '单据号', title: '单据号' }
                    , { field: '单据状态', title: '单据状态' }
                    //, { field: '表头备注', title: '表头备注' }
                    , { field: '退回人', title: '退回人' }
                    , { field: '退回日期', title: '退回日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '关闭类型', title: '关闭类型' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                    //, { field: '主源单类型', title: '主源单类型' }
                    //, { field: '源单子内码', title: '源单子内码' }
                    //, { field: '源单号', title: '源单号' }
                    //, { field: '打印次数', title: '打印次数' }
                    , { field: '组织', title: '组织' }
                    , { field: '数据状态', title: '数据状态' }
                    , { field: '表体备注', title: '表体备注' }
                    //, { field: '源单单号', title: '源单单号' }
                    //, { field: '源单ID', title: '源单ID' }
                    //, { field: '源单子ID', title: '源单子ID' }
                    //, { field: '子源单类型', title: '子源单类型' }
                    , { field: '供应商名称', title: '供应商名称' }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '规格型号', title: '规格型号' }
                    , { field: 'JIT物料分类', title: 'JIT物料分类' }
                    , { field: 'JIT拉动安全库存量', title: 'JIT拉动安全库存量' }
                    , { field: 'JIT物料需求供货周期', title: 'JIT物料需求供货周期' }
                    , { field: 'JIT提货批量', title: 'JIT提货批量' }
                    , { field: 'JIT提货批量对应周期', title: 'JIT提货批量对应周期' }
                    , { field: 'JIT供货提前期', title: 'JIT供货提前期' }
                    , { field: 'JIT到货前置期', title: 'JIT到货前置期' }
                    , { field: 'JIT送货方式', title: 'JIT送货方式' }
                    , { field: 'JIT送货控制天数', title: 'JIT送货控制天数' }
                ]]
            };
        }
        //#endregion
        //#region æŸ¥è¯¢
        function get_Display(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/PODemandPlanConfigBillList',
                type: "GET",
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (result) {
                    if (result.count == 1) {
                        option.data = result.data;
                        table.render(option);
                        layer.close(ajaxLoad);
                        //layer.alert("查询成功", { icon: 1 });
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.code + result.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //#endregion
        //#region å¿«é€Ÿè¿‡æ»¤
        function get_FastQuery() {
            var HBillNo = $("#HBillNo").val();
            var HSupplierIDName = $("#HSupplierIDName").val();//供应商
            var HMaterName = $("#HMaterName").val();//物料名称
            var HMaterNumber = $("#HMaterNumber").val();//物料代码
            var HMaterModel = $("#HMaterModel").val();//规格型号
            if (HBillNo) {
                sWhere += " and å•据号 like '%" + HBillNo + "%' ";
            }
            if (HSupplierIDName) {
                sWhere += " and ä¾›åº”商名称 = '" + HSupplierIDName + "' ";
            }
            if (HMaterName) {
                sWhere += " and ç‰©æ–™åç§° = '" + HMaterName + "' ";
            }
            if (HMaterNumber) {
                sWhere += " and ç‰©æ–™ä»£ç  = '" + HMaterNumber + "' ";
            }
            if (HMaterModel) {
                sWhere += " and è§„格型号 = '" + HMaterModel + "' ";
            }
            get_Display(sWhere);
            sWhere = "";//调用接口后清空sWhere缓存
        }
        //#endregion
        //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
        function set_ClearQuery() {
            $("#HBillNo").val("");
            $("#HSupplierID").val("");
            $("#HSupplierIDName").val("");
            $("#HMaterID").val("");
            $("#HMaterName").val("");
            $("#HMaterNumber").val("");
            $("#HMaterModel").val("");
            sWhere = "";
        }
        //#endregion
        //供应商列表
        function btnHSupplierID() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '供应商列表'//标题
                , shift: 2//弹出动画
                , content: ['../../Baseset/基础资料/Gy_SupplierList.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('请选择数据');
                    }
                    //获取数据
                    $("#HSupplierID").val(checkStatus.data[0].HItemID);//供应商id
                    $("#HSupplierIDName").val(checkStatus.data[0].HName);//供应商名称
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //物料列表
        function btnHMaterID() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '物料列表'//标题
                , shift: 2//弹出动画
                , content: ['../../Baseset/基础资料/Gy_MaterialList.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('请选择数据');
                    }
                    //获取数据
                    $("#HMaterID").val(checkStatus.data[0].HItemID);//物料id
                    $("#HMaterName").val(checkStatus.data[0].HName);//物料名称
                    $("#HMaterModel").val(checkStatus.data[0].HModel);//物料规格型号
                    $("#HMaterNumber").val(checkStatus.data[0].HNumber);//物料代码
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //删除
        function set_DeleteBill() {
            var CheckStatus = table.checkStatus("mainTable");
            if (CheckStatus.data.length != 1) {
                return layer.msg("请选择一条数据!")
            } else {
                layer.confirm('您确定要删除吗?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                        var HInterID = CheckStatus.data[0].hmainid; //获取编号
                        var HEntryID = CheckStatus.data[0].hsubid; //获取第几条子数据
                        $.ajax({
                            url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/DelPODemandPlanConfigBillList'
                            , type: "GET"
                            , data: { "HInterID": HInterID, "HEntryID": HEntryID, "User": sessionStorage["HUserName"] }
                            , 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();
                                        ////重载tree
                                        //tree.reload('treeDepartment', {});
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }
                        })
                    }
                })
            }
        }
        //#region æ–°å¢ž
        function set_AddNew() {
            layer.open({
                type: 2
                , skin: 'layui-layer-rim' //加上边框
                , area: ['100%', '100%']
                , title: '提料计划信息列表-新增'
                , shift: 0//弹出动画
                , content: '../日计划基础资料/Cg_PODemandPlanConfigBill_Add.html?OperationType=1&linterid=&HSouceBillType=&linteridSub=-1'
                , end: function () {
                    //刷新页面,
                    location.reload();
                }
            })
        }
        //#endregion
        //#region ç¼–辑
        function set_ShowBill() {
            var checkStatus = table.checkStatus('mainTable')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                var linterid = data[0].hmainid;
                var linteridSub = data[0].hsubid;
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '提料计划信息列表-编辑'
                    , shift: 0//弹出动画
                    , content: '../日计划基础资料/Cg_PODemandPlanConfigBill_Add.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=&linteridSub=' + linteridSub
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            } else {
                layer.msg('请选择一行数据编辑!');
            }
        }
            //#endregion
        //#endregion
        //以上是layui模块
    });
</script>
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/Cg_PODemandPlanConfigBill_Add.html
New file
@@ -0,0 +1,489 @@
<!DOCTYPE html>
<html>
<head>
    <meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <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>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
            height: 30px;
            line-height: 30px;
        }
        .btn-title {
            font-size: 16px;
        }
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
        .layui-form-item .layui-inline {
            margin-top: 5px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
        .layui-form-label {
            width: 25%;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <div class="layui-tab-content">
                            <!--基本信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">单据号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">组织</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HPRDORGID" id="HPRDORGID" lay-verify="HPRDORGID">
                                                    <!--动态渲染组织-->
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                        </div>
                    </script>
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //初始表格数据
            var rowdata = [{
                "HSupplierID": "", "HSupplierNumber": "", "HSupplierName": "", "HMaterID": "","HMaterNumber":"", "HMaterName": "", "HMaterModel": ""
                , "HJITMaterGroup": "", "HJITSafeStock": "", "HJITMaterDemand": "", "HJITBatchQty": "", "HDeliveryPeriod": ""
                , "HLeadTime": "", "HLeadTime_Sec": "", "HDeliveryMode": "", "HDeliveryDaysCtrl": "", "HRemark": ""
            }];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //加载组织
            get_Organ();
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var linteridSub = params[params[3]];  //从参数获取 å­è¡¨çº§åˆ«
            //判断是否新增
            if (linterid == null || linterid == 0) {
                linteridSub = -1;
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '4611' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid, linteridSub);
                //RoadBillSub(linterid);
            }
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-170'
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HSupplierID', title: 'HSupplierID', hide: true }
                    , { field: 'HSupplierNumber', title: '供应商', edit: 'text', event: "HSupplierID" }
                    , { field: 'HSupplierName', title: '供应商名称' }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号'}
                    , { field: 'HJITMaterGroup', title: 'JIT物料分类', edit: 'text' }
                    , { field: 'HJITSafeStock', title: 'JIT拉动安全库存量', edit: 'text', width: 200 }
                    , { field: 'HJITMaterDemand', title: 'JIT物料需求供货周期', edit: 'text', width:200}
                    , { field: 'HJITBatchQty', title: 'JIT提货批量', edit: 'text' }
                    , { field: 'HDeliveryPeriod', title: 'JIT提货批量对应周期(天)', edit: 'text', width: 200}
                    , { field: 'HLeadTime', title: 'JIT供货提前期(天)', edit: 'text', width: 200 }
                    , { field: 'HLeadTime_Sec', title: 'JIT到货前置期(天)', edit: 'text', width: 200}
                    , { field: 'HDeliveryMode', title: 'JIT送货方式', edit: 'text' }
                    , { field: 'HDeliveryDaysCtrl', title: 'JIT送货控制天数', edit: 'text', width: 200 }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            table.render(option);
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HSupplierID": "","HSupplierNumber":"", "HSupplierName": "", "HMaterID": "","HMaterNumber":"", "HMaterName": "", "HMaterModel": ""
                    , "HJITMaterGroup": "", "HJITSafeStock": "", "HJITMaterDemand": "", "HJITBatchQty": "", "HDeliveryPeriod": ""
                    , "HLeadTime": "", "HLeadTime_Sec": "", "HDeliveryMode": "", "HDeliveryDaysCtrl": "", "HRemark": ""
                };
                switch (obj.event) {
                    case 'btn-AddLine':
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        form.render('select');
                        form.render('checkbox');
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.msg("请选择需要复制的一行!");
                        }
                        else if (data.length > 1) {
                            layer.msg("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            form.render('select');
                            form.render('checkbox');
                        }
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            //退出
            form.on('submit(Cancel)', function () {
                if ((OperationType == 1 && linteridSub == -1) || OperationType == 3) {
                    Pub_Close(1);
                } else {
                    Pub_Close(2);
                }
            })
            //保存提交
            form.on('submit(btnSave)', function (data) {//提交
                set_AddNew(data);
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //组织选择页面
            function get_Organ() {
                //获取登录页组织列
                var Organization = '';
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HPRDORGID").append(Organization);
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            //获取参数
            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;
            }
            //行内删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
            }
            //行快捷键
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        //供应商
                        if (obj.event == "HSupplierID") {
                            //打开供应商小窗体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "供应商列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_SupplierList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HSupplierID": checkStatus.data[0].HItemID
                                        , "HSupplierNumber": checkStatus.data[0].HNumber
                                        , "HSupplierName": checkStatus.data[0].HName
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        //物料
                        if (obj.event == "HMaterID") {
                            //打开物料  å°çª—体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "物料列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_MaterialList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HMaterID": checkStatus.data[0].HItemID
                                        , "HMaterNumber": checkStatus.data[0].HNumber
                                        , "HMaterName": checkStatus.data[0].HName
                                        , "HMaterModel": checkStatus.data[0].HModel
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        return false;
                    }
                })
            }
            //编辑 é¡µé¢èµ‹å€¼
            function RoadBillMain(linterid, linteridSub)//加载表头
            {
                var sWhere = " and hmainid='" + linterid + "' and hsubid='" + linteridSub + "'";
                $.ajax({
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/PODemandPlanConfigBillList",
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (d) {
                        //主表
                        form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            "HBillNo": d.data[0].单据号
                            , "HInterID": d.data[0].hmainid
                            , "HPRDORGID": d.data[0].组织
                        });
                        //子表  èµ‹å€¼
                        var rowdata = [{
                            "HSupplierID": d.data[0].HSupplierID, "HSupplierNumber": d.data[0].供应商代码, "HSupplierName": d.data[0].供应商名称, "HMaterID": d.data[0].HMaterID, "HMaterNumber": d.data[0].物料代码, "HMaterName": d.data[0].物料名称, "HMaterModel": d.data[0].规格型号
                            , "HJITMaterGroup": d.data[0].JIT物料分类, "HJITSafeStock": d.data[0].JIT拉动安全库存量, "HJITMaterDemand": d.data[0].JIT物料需求供货周期, "HJITBatchQty": d.data[0].JIT提货批量, "HDeliveryPeriod": d.data[0].JIT提货批量对应周期
                            , "HLeadTime": d.data[0].JIT供货提前期, "HLeadTime_Sec": d.data[0].JIT到货前置期, "HDeliveryMode": d.data[0].JIT送货方式, "HDeliveryDaysCtrl": d.data[0].JIT送货控制天数, "HRemark": d.data[0].表体备注
                        }];
                        option.data = rowdata;
                        table.render(option);
                        form.render('select');
                    }
                })
            }
            //保存HMaker
            function set_AddNew(data) {
                //删除子表数据 ä¼šå ç”¨æ•°ç»„的位置,需要重新排一下顺序
                var num = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        num.push(table.cache["mainTable"][i])
                    }
                }
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                var hentryid = linteridSub;//子表 æŽ’序id
                var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/AddPODemandPlanConfigBillList",
                    async: true,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            layer.close(index);
                            layer.msg("保存成功");
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
        });
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/Gy_WorkWarehouseBillList.html
New file
@@ -0,0 +1,381 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>车间仓库对照列表</title>
    <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/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>
</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-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">单据号</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产车间</label>
                                    <div class="layui-input-block" style="margin-left: 77px;">
                                        <input type="hidden" class="layui-input" lay-verify="HWorkShopID" name="HWorkShopID" id="HWorkShopID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <input type="text" class="layui-input" lay-verify="HWorkShopIDName" name="HWorkShopIDName" id="HWorkShopIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHWorkShopID" id="btnHWorkShopID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                        </button>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">查询</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">重置</button>
                                <!--<div class="layui-colla-content">
                <div class="layui-inline">
                    <div class="layui-inline">
                        <span>其他条件></span>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 85px;">物料代码</label>
                    <div class="layui-input-block" style="margin-left: 120px;">
                        <input type="text" class="layui-input" name="物料代码" id="物料代码">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 85px;">资源代码</label>
                    <div class="layui-input-block" style="margin-left: 120px;">
                        <input type="text" class="layui-input" name="资源代码" id="资源代码">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 85px;">部门代码</label>
                    <div class="layui-input-block" style="margin-left: 120px;">
                        <input type="text" class="layui-input" name="部门代码" id="部门代码">
                    </div>
                </div>
            </div>-->
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    var treeCkData = { id: 0 };
    var TagId = "";
    var TagParentId = "";
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util'], function () {
        //#region å…¬ç”¨å˜é‡
        var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , util = layui.util
            , tree = layui.tree
            , util = layui.util
        var sWhere = "";
        var option = [];
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
        //初始化界面
        set_ClearBill();
        //#endregion
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        //#region å¤´å·¥å…·æ äº‹ä»¶
        table.on('toolbar(mainTable)', function (obj) {
            switch (obj.event) {
                //新增
                case 'set_AddNew': set_AddNew();
                    break;
                //编辑
                case 'set_ShowBill': set_ShowBill();
                    break;
                //删除
                case 'set_DeleteBill': set_DeleteBill();
                    break;
            };
        });
        //#endregion
        //#region ç”Ÿäº§è½¦é—´
        form.on('submit(btnHWorkShopID)', function (data) {
            btnHWorkShopID();
        });
        //#endregion
        //#region é‡ç½®æŒ‰é’®
        form.on('submit(btnReSearch)', function (data) {
            set_ClearQuery();
        });
        //#endregion
        //#region æŸ¥è¯¢æŒ‰é’®
        form.on('submit(btnSearch)', function (data) {
            get_FastQuery();
        });
        //#endregion
        //#endregion
        //#region æœ¬é¡µé¢è¢«è°ƒç”¨çš„æ‰€æœ‰æ–¹æ³•
        //#region åˆå§‹åŒ–界面
        function set_ClearBill() {
            //初始化表格
            set_InitGrid();
            //查询
            get_Display(sWhere);
        }
        //#endregion
        //#region åˆå§‹åŒ–表格方法
        function set_InitGrid() {
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: 'hmainid', hide: true }
                    , { field: '单据类型', title: '单据类型', width: 120 }
                    , { field: '日期', title: '日期' }
                    , { field: '单据号', title: '单据号' }
                    , { field: '单据状态', title: '单据状态' }
                    //, { field: '表头备注', title: '表头备注' }
                    , { field: '退回人', title: '退回人' }
                    , { field: '退回日期', title: '退回日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '关闭类型', title: '关闭类型' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                    //, { field: '主源单类型', title: '主源单类型' }
                    //, { field: '源单子内码', title: '源单子内码' }
                    //, { field: '源单号', title: '源单号' }
                    //, { field: '打印次数', title: '打印次数' }
                    , { field: '组织', title: '组织' }
                    , { field: '数据状态', title: '数据状态' }
                    , { field: '表体备注', title: '表体备注' }
                    //, { field: '源单单号', title: '源单单号' }
                    //, { field: '源单ID', title: '源单ID' }
                    //, { field: '源单子ID', title: '源单子ID' }
                    //, { field: '子源单类型', title: '子源单类型' }
                    , { field: '车间代码', title: '车间代码' }
                    , { field: '车间名称', title: '车间名称' }
                    , { field: '仓库代码', title: '仓库代码' }
                    , { field: '仓库名称', title: '仓库名称' }
                ]]
            };
        }
        //#endregion
        //#region æŸ¥è¯¢
        function get_Display(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/ComplementGoodBillList',
                type: "GET",
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (result) {
                    if (result.count == 1) {
                        option.data = result.data;
                        table.render(option);
                        layer.close(ajaxLoad);
                        //layer.alert("查询成功", { icon: 1 });
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.code + result.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //#endregion
        //#region å¿«é€Ÿè¿‡æ»¤
        function get_FastQuery() {
            var HBillNo = $("#HBillNo").val();
            var HWorkShopIDName = $("#HWorkShopIDName").val();
            if (HBillNo) {
                sWhere += " and å•据号 like '%" + HBillNo + "%'";
            }
            if (HWorkShopIDName) {
                sWhere += " and è½¦é—´åç§° = '" + HWorkShopIDName + "'";
            }
            get_Display(sWhere);
            sWhere = "";//调用接口后清空sWhere缓存
        }
        //#endregion
        //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
        function set_ClearQuery() {
            $("#HWorkShopIDName").val("");
            $("#HBillNo").val("");
            $("#HWorkShopID").val("");
            sWhere = "";
        }
        //#endregion
        //生产车间列表
        function btnHWorkShopID() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '生产车间列表'//标题
                , shift: 2//弹出动画
                , content: ['../../Baseset/基础资料/Gy_DepartmentList.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('请选择数据');
                    }
                    //获取数据
                    $("#HWorkShopID").val(checkStatus.data[0].HItemID);//车间id
                    $("#HWorkShopIDName").val(checkStatus.data[0].HName);//车间名称
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //删除
        function set_DeleteBill() {
            var CheckStatus = table.checkStatus("mainTable");
            if (CheckStatus.data.length != 1) {
                return layer.msg("请选择一条数据!")
            } else {
                layer.confirm('您确定要删除吗?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                        var HInterID = CheckStatus.data[0].hmainid; //获取编号
                        var HEntryID = CheckStatus.data[0].hsubid; //获取第几条子数据
                        $.ajax({
                            url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/DelComplementGoodBillList'
                            , type: "GET"
                            , data: { "HInterID": HInterID, "HEntryID": HEntryID, "User": sessionStorage["HUserName"] }
                            , 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();
                                        ////重载tree
                                        //tree.reload('treeDepartment', {});
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }
                        })
                    }
                })
            }
        }
        //#region æ–°å¢ž
        function set_AddNew() {
            layer.open({
                type: 2
                , skin: 'layui-layer-rim' //加上边框
                , area: ['100%', '100%']
                , title: '车间仓库对照列表-新增'
                , shift: 0//弹出动画
                , content: '../日计划基础资料/Gy_WorkWarehouseBill_Add.html?OperationType=1&linterid=&HSouceBillType=&linteridSub=-1'
                , end: function () {
                    //刷新页面,
                    location.reload();
                }
            })
        }
            //#endregion
        //#region ç¼–辑
        function set_ShowBill() {
            var checkStatus = table.checkStatus('mainTable')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                var linterid = data[0].hmainid;
                var linteridSub = data[0].hsubid;
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '车间仓库对照列表-编辑'
                    , shift: 0//弹出动画
                    , content: '../日计划基础资料/Gy_WorkWarehouseBill_Add.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=&linteridSub=' + linteridSub
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            } else {
                layer.msg('请选择一行数据编辑!');
            }
        }
            //#endregion
        //#endregion
        //以上是layui模块
    });
</script>
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/Gy_WorkWarehouseBill_Add.html
New file
@@ -0,0 +1,473 @@
<!DOCTYPE html>
<html>
<head>
    <meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <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>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
            height: 30px;
            line-height: 30px;
        }
        .btn-title {
            font-size: 16px;
        }
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
        .layui-form-item .layui-inline {
            margin-top: 5px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
        .layui-form-label {
            width: 25%;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <div class="layui-tab-content">
                            <!--基本信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">单据号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">组织</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HPRDORGID" id="HPRDORGID" lay-verify="HPRDORGID">
                                                    <!--动态渲染组织-->
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                        </div>
                    </script>
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //初始表格数据
            var rowdata = [{
                "HWorkShopID": "", "HWorkShopNumber": "", "HWorkShopName": "", "HWHID": "","HWHNumber":"", "HWHName": "", "HRemark": ""
            }];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //加载组织
            get_Organ();
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var linteridSub = params[params[3]];  //从参数获取 å­è¡¨çº§åˆ«
            //判断是否新增
            if (linterid == null || linterid == 0) {
                linteridSub = -1;
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '4612' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid, linteridSub);
                //RoadBillSub(linterid);
            }
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-170'
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HWorkShopID', title: 'HWorkShopID', hide: true }
                    , { field: 'HWorkShopNumber', title: '生产车间', edit: 'text', event: "HWorkShopID" }
                    , { field: 'HWorkShopName', title: '车间名称' }
                    , { field: 'HWHID', title: 'HWHID', hide: true }
                    , { field: 'HWHNumber', title: '仓库', edit: 'text', event: "HWHID" }
                    , { field: 'HWHName', title: '仓库名称' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            table.render(option);
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HWorkShopID": "", "HWorkShopNumber": "", "HWorkShopName": "", "HWHID": "","HWHNumber":"", "HWHName": "", "HRemark": ""
                };
                switch (obj.event) {
                    case 'btn-AddLine':
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        form.render('select');
                        form.render('checkbox');
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.msg("请选择需要复制的一行!");
                        }
                        else if (data.length > 1) {
                            layer.msg("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            form.render('select');
                            form.render('checkbox');
                        }
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            //退出
            form.on('submit(Cancel)', function () {
                if ((OperationType == 1 && linteridSub == -1) || OperationType == 3) {
                    Pub_Close(1);
                } else {
                    Pub_Close(2);
                }
            })
            //保存提交
            form.on('submit(btnSave)', function (data) {//提交
                set_AddNew(data);
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //组织选择页面
            function get_Organ() {
                //获取登录页组织列
                var Organization = '';
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HPRDORGID").append(Organization);
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            //获取参数
            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;
            }
            //行内删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
            }
            //行快捷键
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        //生产车间
                        if (obj.event == "HWorkShopID") {
                            //打开生产车间小窗体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "生产车间列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_DepartmentList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HWorkShopID": checkStatus.data[0].HItemID
                                        , "HWorkShopNumber": checkStatus.data[0].HNumber
                                        , "HWorkShopName": checkStatus.data[0].HName
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        //仓库
                        if (obj.event == "HWHID") {
                            //打开仓库  å°çª—体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "仓库列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_WarehouseList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HWHID": checkStatus.data[0].HItemID
                                        , "HWHNumber": checkStatus.data[0].HNumber
                                        , "HWHName": checkStatus.data[0].HName
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        return false;
                    }
                })
            }
            //编辑 é¡µé¢èµ‹å€¼
            function RoadBillMain(linterid, linteridSub)//加载表头
            {
                var sWhere = " and hmainid='" + linterid + "' and hsubid='" + linteridSub + "'";
                $.ajax({
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/ComplementGoodBillList",
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (d) {
                        //主表
                        form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            "HBillNo": d.data[0].单据号
                            , "HInterID": d.data[0].hmainid
                            , "HPRDORGID": d.data[0].组织
                        });
                        //子表  èµ‹å€¼
                        var rowdata = [{
                            "HWorkShopID": d.data[0].HWorkShopID, "HWorkShopNumber": d.data[0].车间代码, "HWorkShopName": d.data[0].车间名称, "HWHID": d.data[0].HWHID
                            , "HWHNumber": d.data[0].仓库代码, "HWHName": d.data[0].仓库名称, "HRemark": d.data[0].表体备注
                        }];
                        option.data = rowdata;
                        table.render(option);
                        form.render('select');
                    }
                })
            }
            //保存HMaker
            function set_AddNew(data) {
                //删除子表数据 ä¼šå ç”¨æ•°ç»„的位置,需要重新排一下顺序
                var num = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        num.push(table.cache["mainTable"][i])
                    }
                }
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                var hentryid = linteridSub;//子表 æŽ’序id
                var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/AddComplementGoodBillList",
                    async: true,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            layer.close(index);
                            layer.msg("保存成功");
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
        });
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/JIT_NeedMaterPlanConfigBillList.html
New file
@@ -0,0 +1,439 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>要料计划信息列表</title>
    <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/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>
</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-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">单据号</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">车间</label>
                                    <div class="layui-input-block" style="margin-left: 77px;">
                                        <input type="hidden" class="layui-input" lay-verify="HWorkShopID" name="HWorkShopID" id="HWorkShopID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <input type="text" class="layui-input" lay-verify="HWorkShopIDName" name="HWorkShopIDName" id="HWorkShopIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHHWorkShopID" id="btnHSupplierID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                        </button>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">查询</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">重置</button>
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">物料名称</label>
                                        <div class="layui-input-block" style="margin-left: 77px;">
                                            <input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <input type="text" class="layui-input" lay-verify="HMaterName" name="HMaterName" id="HMaterName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterID" id="btnHMaterID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">物料代码</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" readonly>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">规格型号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" readonly>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    var treeCkData = { id: 0 };
    var TagId = "";
    var TagParentId = "";
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util'], function () {
        //#region å…¬ç”¨å˜é‡
        var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , util = layui.util
            , tree = layui.tree
            , util = layui.util
        var sWhere = "";
        var option = [];
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
        //初始化界面
        set_ClearBill();
        //#endregion
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        //#region å¤´å·¥å…·æ äº‹ä»¶
        table.on('toolbar(mainTable)', function (obj) {
            switch (obj.event) {
                //新增
                case 'set_AddNew': set_AddNew();
                    break;
                //编辑
                case 'set_ShowBill': set_ShowBill();
                    break;
                //删除
                case 'set_DeleteBill': set_DeleteBill();
                    break;
            };
        });
        //#endregion
        //#region è½¦é—´
        form.on('submit(btnHHWorkShopID)', function (data) {
            btnHHWorkShopID();
        });
        //#endregion
        //#region ç‰©æ–™
        form.on('submit(btnHMaterID)', function (data) {
            btnHMaterID();
        });
        //#endregion
        //#region é‡ç½®æŒ‰é’®
        form.on('submit(btnReSearch)', function (data) {
            set_ClearQuery();
        });
        //#endregion
        //#region æŸ¥è¯¢æŒ‰é’®
        form.on('submit(btnSearch)', function (data) {
            get_FastQuery();
        });
        //#endregion
        //#endregion
        //#region æœ¬é¡µé¢è¢«è°ƒç”¨çš„æ‰€æœ‰æ–¹æ³•
        //#region åˆå§‹åŒ–界面
        function set_ClearBill() {
            //初始化表格
            set_InitGrid();
            //查询
            get_Display(sWhere);
        }
        //#endregion
        //#region åˆå§‹åŒ–表格方法
        function set_InitGrid() {
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: 'hmainid', hide: true }
                    , { field: '单据类型', title: '单据类型', width: 120 }
                    , { field: '日期', title: '日期' }
                    , { field: '单据号', title: '单据号' }
                    , { field: '单据状态', title: '单据状态' }
                    //, { field: '表头备注', title: '表头备注' }
                    , { field: '退回人', title: '退回人' }
                    , { field: '退回日期', title: '退回日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '关闭类型', title: '关闭类型' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                    //, { field: '主源单类型', title: '主源单类型' }
                    //, { field: '源单子内码', title: '源单子内码' }
                    //, { field: '源单号', title: '源单号' }
                    //, { field: '打印次数', title: '打印次数' }
                    , { field: '组织', title: '组织' }
                    , { field: '数据状态', title: '数据状态' }
                    , { field: '表体备注', title: '表体备注' }
                    //, { field: '源单单号', title: '源单单号' }
                    //, { field: '源单ID', title: '源单ID' }
                    //, { field: '源单子ID', title: '源单子ID' }
                    //, { field: '子源单类型', title: '子源单类型' }
                    , { field: '车间名称', title: '车间名称' }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '规格型号', title: '规格型号' }
                    , { field: 'JIT物料分类', title: 'JIT物料分类' }
                    , { field: 'JIT拉动安全库存量', title: 'JIT拉动安全库存量' }
                    , { field: 'JIT物料需求供货周期', title: 'JIT物料需求供货周期' }
                    , { field: 'JIT提货批量', title: 'JIT提货批量' }
                    , { field: 'JIT提货批量对应周期', title: 'JIT提货批量对应周期' }
                    , { field: 'JIT供货提前期', title: 'JIT供货提前期' }
                    , { field: 'JIT到货前置期', title: 'JIT到货前置期' }
                    , { field: 'JIT送货方式', title: 'JIT送货方式' }
                    , { field: 'JIT送货控制天数', title: 'JIT送货控制天数' }
                ]]
            };
        }
        //#endregion
        //#region æŸ¥è¯¢
        function get_Display(sWhere) {
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/NeedMaterPlanConfigBillList',
                type: "GET",
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (result) {
                    if (result.count == 1) {
                        option.data = result.data;
                        table.render(option);
                        layer.close(ajaxLoad);
                        //layer.alert("查询成功", { icon: 1 });
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.code + result.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //#endregion
        //#region å¿«é€Ÿè¿‡æ»¤
        function get_FastQuery() {
            var HBillNo = $("#HBillNo").val();
            var HWorkShopIDName = $("#HWorkShopIDName").val();//车间
            var HMaterName = $("#HMaterName").val();//物料名称
            var HMaterNumber = $("#HMaterNumber").val();//物料代码
            var HMaterModel = $("#HMaterModel").val();//规格型号
            if (HBillNo) {
                sWhere += " and å•据号 like '%" + HBillNo + "%' ";
            }
            if (HWorkShopIDName) {
                sWhere += " and è½¦é—´åç§° = '" + HWorkShopIDName + "' ";
            }
            if (HMaterName) {
                sWhere += " and ç‰©æ–™åç§° = '" + HMaterName + "' ";
            }
            if (HMaterNumber) {
                sWhere += " and ç‰©æ–™ä»£ç  = '" + HMaterNumber + "' ";
            }
            if (HMaterModel) {
                sWhere += " and è§„格型号 = '" + HMaterModel + "' ";
            }
            get_Display(sWhere);
            sWhere = "";//调用接口后清空sWhere缓存
        }
        //#endregion
        //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
        function set_ClearQuery() {
            $("#HBillNo").val("");
            $("#HWorkShopID").val("");
            $("#HWorkShopIDName").val("");
            $("#HMaterID").val("");
            $("#HMaterName").val("");
            $("#HMaterNumber").val("");
            $("#HMaterModel").val("");
            sWhere = "";
        }
        //#endregion
        //车间列表
        function btnHHWorkShopID() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '车间列表'//标题
                , shift: 2//弹出动画
                , content: ['../../Baseset/基础资料/Gy_DepartmentList.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('请选择数据');
                    }
                    //获取数据
                    $("#HSupplierID").val(checkStatus.data[0].HItemID);//车间id
                    $("#HSupplierIDName").val(checkStatus.data[0].HName);//车间名称
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //物料列表
        function btnHMaterID() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '物料列表'//标题
                , shift: 2//弹出动画
                , content: ['../../Baseset/基础资料/Gy_MaterialList.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('请选择数据');
                    }
                    //获取数据
                    $("#HMaterID").val(checkStatus.data[0].HItemID);//物料id
                    $("#HMaterName").val(checkStatus.data[0].HName);//物料名称
                    $("#HMaterModel").val(checkStatus.data[0].HModel);//物料规格型号
                    $("#HMaterNumber").val(checkStatus.data[0].HNumber);//物料代码
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //删除
        function set_DeleteBill() {
            var CheckStatus = table.checkStatus("mainTable");
            if (CheckStatus.data.length != 1) {
                return layer.msg("请选择一条数据!")
            } else {
                layer.confirm('您确定要删除吗?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                        var HInterID = CheckStatus.data[0].hmainid; //获取编号
                        var HEntryID = CheckStatus.data[0].hsubid; //获取第几条子数据
                        $.ajax({
                            url: GetWEBURL() + '/Sc_JIT_ComplementGoodBill/DelNeedMaterPlanConfigBillList'
                            , type: "GET"
                            , data: { "HInterID": HInterID, "HEntryID": HEntryID, "User": sessionStorage["HUserName"] }
                            , 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();
                                        ////重载tree
                                        //tree.reload('treeDepartment', {});
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }
                        })
                    }
                })
            }
        }
        //#region æ–°å¢ž
        function set_AddNew() {
            layer.open({
                type: 2
                , skin: 'layui-layer-rim' //加上边框
                , area: ['100%', '100%']
                , title: '要料计划信息列表-新增'
                , shift: 0//弹出动画
                , content: '../日计划基础资料/JIT_NeedMaterPlanConfigBill_Add.html?OperationType=1&linterid=&HSouceBillType=&linteridSub=-1'
                , end: function () {
                    //刷新页面,
                    location.reload();
                }
            })
        }
        //#endregion
        //#region ç¼–辑
        function set_ShowBill() {
            var checkStatus = table.checkStatus('mainTable')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                var linterid = data[0].hmainid;
                var linteridSub = data[0].hsubid;
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '要料计划信息列表-编辑'
                    , shift: 0//弹出动画
                    , content: '../日计划基础资料/JIT_NeedMaterPlanConfigBill_Add.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=&linteridSub=' + linteridSub
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            } else {
                layer.msg('请选择一行数据编辑!');
            }
        }
            //#endregion
        //#endregion
        //以上是layui模块
    });
</script>
WebTM/views/Éú²ú¹ÜÀí/Èռƻ®»ù´¡×ÊÁÏ/JIT_NeedMaterPlanConfigBill_Add.html
New file
@@ -0,0 +1,489 @@
<!DOCTYPE html>
<html>
<head>
    <meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <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>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
            height: 30px;
            line-height: 30px;
        }
        .btn-title {
            font-size: 16px;
        }
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
        .layui-form-item .layui-inline {
            margin-top: 5px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
        .layui-form-label {
            width: 25%;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <div class="layui-tab-content">
                            <!--基本信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">单据号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">组织</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HPRDORGID" id="HPRDORGID" lay-verify="HPRDORGID">
                                                    <!--动态渲染组织-->
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                        </div>
                    </script>
                </form>
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            //初始表格数据
            var rowdata = [{
                "HWorkShopID": "", "HWorkShopNumber": "", "HWorkShopName": "", "HMaterID": "","HMaterNumber":"", "HMaterName": "", "HMaterModel": ""
                , "HJITMaterGroup": "", "HJITSafeStock": "", "HJITMaterDemand": "", "HJITBatchQty": "", "HDeliveryPeriod": ""
                , "HLeadTime": "", "HLeadTime_Sec": "", "HDeliveryMode": "", "HDeliveryDaysCtrl": "", "HRemark": ""
            }];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //加载组织
            get_Organ();
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var linteridSub = params[params[3]];  //从参数获取 å­è¡¨çº§åˆ«
            //判断是否新增
            if (linterid == null || linterid == 0) {
                linteridSub = -1;
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '4611' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid, linteridSub);
                //RoadBillSub(linterid);
            }
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-170'
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HWorkShopID', title: 'HWorkShopID', hide: true }
                    , { field: 'HWorkShopNumber', title: '车间', edit: 'text', event: "HWorkShopID" }
                    , { field: 'HWorkShopName', title: '车间名称' }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号'}
                    , { field: 'HJITMaterGroup', title: 'JIT物料分类', edit: 'text' }
                    , { field: 'HJITSafeStock', title: 'JIT拉动安全库存量', edit: 'text', width: 200 }
                    , { field: 'HJITMaterDemand', title: 'JIT物料需求供货周期', edit: 'text', width:200}
                    , { field: 'HJITBatchQty', title: 'JIT提货批量', edit: 'text' }
                    , { field: 'HDeliveryPeriod', title: 'JIT提货批量对应周期(天)', edit: 'text', width: 200}
                    , { field: 'HLeadTime', title: 'JIT供货提前期(天)', edit: 'text', width: 200 }
                    , { field: 'HLeadTime_Sec', title: 'JIT到货前置期(天)', edit: 'text', width: 200}
                    , { field: 'HDeliveryMode', title: 'JIT送货方式', edit: 'text' }
                    , { field: 'HDeliveryDaysCtrl', title: 'JIT送货控制天数', edit: 'text', width: 200 }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            table.render(option);
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HWorkShopID": "", "HWorkShopNumber": "", "HWorkShopName": "", "HMaterID": "","HMaterNumber":"", "HMaterName": "", "HMaterModel": ""
                    , "HJITMaterGroup": "", "HJITSafeStock": "", "HJITMaterDemand": "", "HJITBatchQty": "", "HDeliveryPeriod": ""
                    , "HLeadTime": "", "HLeadTime_Sec": "", "HDeliveryMode": "", "HDeliveryDaysCtrl": "", "HRemark": ""
                };
                switch (obj.event) {
                    case 'btn-AddLine':
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        form.render('select');
                        form.render('checkbox');
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.msg("请选择需要复制的一行!");
                        }
                        else if (data.length > 1) {
                            layer.msg("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            form.render('select');
                            form.render('checkbox');
                        }
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            //退出
            form.on('submit(Cancel)', function () {
                if ((OperationType == 1 && linteridSub == -1) || OperationType == 3) {
                    Pub_Close(1);
                } else {
                    Pub_Close(2);
                }
            })
            //保存提交
            form.on('submit(btnSave)', function (data) {//提交
                set_AddNew(data);
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //组织选择页面
            function get_Organ() {
                //获取登录页组织列
                var Organization = '';
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HPRDORGID").append(Organization);
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            //获取参数
            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;
            }
            //行内删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
                        }
                    });
                }
            }
            //行快捷键
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        //车间
                        if (obj.event == "HWorkShopID") {
                            //打开车间小窗体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "车间列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_DepartmentList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HWorkShopID": checkStatus.data[0].HItemID
                                        ,"HWorkShopNumber": checkStatus.data[0].HNumber
                                        , "HWorkShopName": checkStatus.data[0].HName
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        //物料
                        if (obj.event == "HMaterID") {
                            //打开物料  å°çª—体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "物料列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_MaterialList.html", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HMaterID": checkStatus.data[0].HItemID
                                        , "HMaterNumber": checkStatus.data[0].HNumber
                                        , "HMaterName": checkStatus.data[0].HName
                                        , "HMaterModel": checkStatus.data[0].HModel
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        return false;
                    }
                })
            }
            //编辑 é¡µé¢èµ‹å€¼
            function RoadBillMain(linterid, linteridSub)//加载表头
            {
                var sWhere = " and hmainid='" + linterid + "' and hsubid='" + linteridSub + "'";
                $.ajax({
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/NeedMaterPlanConfigBillList",
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (d) {
                        //主表
                        form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            "HBillNo": d.data[0].单据号
                            , "HInterID": d.data[0].hmainid
                            , "HPRDORGID": d.data[0].组织
                        });
                        //子表  èµ‹å€¼
                        var rowdata = [{
                            "HWorkShopID": d.data[0].HWorkShopID, "HWorkShopNumber": d.data[0].车间编码, "HWorkShopName": d.data[0].车间名称, "HMaterID": d.data[0].HMaterID, "HMaterNumber": d.data[0].物料代码, "HMaterName": d.data[0].物料名称, "HMaterModel": d.data[0].规格型号
                            , "HJITMaterGroup": d.data[0].JIT物料分类, "HJITSafeStock": d.data[0].JIT拉动安全库存量, "HJITMaterDemand": d.data[0].JIT物料需求供货周期, "HJITBatchQty": d.data[0].JIT提货批量, "HDeliveryPeriod": d.data[0].JIT提货批量对应周期
                            , "HLeadTime": d.data[0].JIT供货提前期, "HLeadTime_Sec": d.data[0].JIT到货前置期, "HDeliveryMode": d.data[0].JIT送货方式, "HDeliveryDaysCtrl": d.data[0].JIT送货控制天数, "HRemark": d.data[0].表体备注
                        }];
                        option.data = rowdata;
                        table.render(option);
                        form.render('select');
                    }
                })
            }
            //保存HMaker
            function set_AddNew(data) {
                //删除子表数据 ä¼šå ç”¨æ•°ç»„的位置,需要重新排一下顺序
                var num = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        num.push(table.cache["mainTable"][i])
                    }
                }
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                var hentryid = linteridSub;//子表 æŽ’序id
                var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_JIT_ComplementGoodBill/AddNeedMaterPlanConfigBillList",
                    async: true,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            layer.close(index);
                            layer.msg("保存成功");
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
        });
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/Éú²ú»ã±¨µ¥/Sc_ICMOReportBill_FastNew.html
@@ -60,8 +60,7 @@
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name="HBillType" id="HBillType">
                                                <option value="1103">收料通知单</option>
                                                <option value="1102">采购订单</option>
                                                <option value="3710">生产订单</option>
                                            </select>
                                        </div>
                                    </div>
@@ -293,7 +292,7 @@
                    //$("#HDeptID").val(d.data[0].HDeptID);
                    //$("#HBarCode").val(d.data[0].HBarCode);
                    //$("#HQty").val(d.data[0].HQty);
                    RoadSup();
                    //RoadSup();
                }
            })
        }
@@ -339,7 +338,7 @@
            table.render({
                elem: '#wl-table'
                , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                , where: { HBillID: linterid, HBillType: '1201', sWhere: '' }
                , where: { HBillID: linterid, HBillType: '3711', sWhere: '' }
                , cols: [[
                    { type: 'radio' }
                , { field: 'HQty', title: '数量', sort: true }
@@ -812,7 +811,7 @@
                                            layer.load(3)
                                            table.render({
                                                    elem: '#wl-table'
                                                , url: GetWEBURL() + '/ICMOReportBill/DisBillEntryList_Webs_Json'
                                                , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                                  , where: { HBillID: sInterID, HBillType: '3711', sWhere: '' }
                                                  , cellMinWidth : 115
                                                  , cols: [[
@@ -880,7 +879,7 @@
                                elem: '#wl-table'
                                , cellMinWidth: 80
                              //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/ICMOReportBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                              //, toolbar: '#toolbarDemo'
                              , where: { HBillID: sInterID, HBillType: '3711', sWhere: '' }
                              , cols: [[
WebTM/views/Éú²ú¹ÜÀí/Éú²ú»ã±¨µ¥/Sc_ICMOReportBill_FastNewList.html
New file
@@ -0,0 +1,307 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<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">
</head>
<body>
    <div class="layui-fluid">
        <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-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-xs7">
                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off"  class="layui-input">
                            </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-xs7">
                                <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                            </div>
                            </div>
                    </div>-->
                    <div class="layui-tab" lay-filter="tab-POStockInBillList">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1">缓存列表</li>
                            <li lay-id="2">已上传列表</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item  layui-show">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="dj-table" lay-filter="dj-table"></table>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="yd-table" lay-filter="yd-table"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
                            <div class="layui-row">
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRescind">撤销</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <!--<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdAdd">新增</button>-->
                                </div>
                            </div>
                        </div>
                    </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
        //加载源单类型
        //读取单据列表
        //
        form.on('submit(Cancel)', function () {
            parent.location.href = "../../../views/index.html"
            //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: ['../../生产管理/生产汇报单/Sc_ICMOReportBill_FastNew.html?linterid=' + data[0].HInterID, 'yes']
                , resize: false
                , cancel: function () {
                    $(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        form.on('submit(cmdRefresh)', function () {//
            var sBillType = '3711'
            table.render({
                elem: '#dj-table'
                    ,url: GetWEBURL() + '/Web/DisBillEntryList_Mate_Webs_Json'
                    ,toolbar: '#toolbarDemo'
                    , where: { HBillType: sBillType,sWhere:''}
                    , cols: [[
                          { type: 'radio' }
                        , { field: 'HInterID', title: '单据内码', width: 80 }
                        , { field: 'HBillNo', title: '单据号', width: 80 }
                        , { field: 'HMaker', title: '制单人', width: 100 }
                        , { field: 'HMakeDate', title: '制单日期', width: 100 }
                        , { field: 'HQty', title: '数量', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                        , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    ]]
                      , height: 500
                      , done: function () {
                          layer.closeAll("loading");
                      }
            });
        });
        //撤销功能
        form.on('submit(cmdRescind)', function () {
            var checkStatus = table.checkStatus('yd-table')
                , data = checkStatus.data;
            var sInterID = data[0].HInterID
            var sBillNo = data[0].HBillNo
            var sBillType = '3711'
            $.ajax(
                {
                    type: "Get",
                    url: GetWEBURL() + "/Web/Rescind_Json",
                    async: true,
                    data: { "sHInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType },
                    dataType: "json",
                    success: function (data) {
                        if (data.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.msg(data.Message, { icon: 2 });
                        }
                    },
                    error: function (err) {
                        layer.msg('错误' + err, {
                            icon: 5,
                            time: 20000
                        }, function () {
                            //do something
                        });
                    }
                });
        });
        form.on('submit(cmdDelete)', function () {//删除
            var checkStatus = table.checkStatus('dj-table')
            , data = checkStatus.data;
            var sInterID = data[0].HInterID
            $.ajax(
               {
                   type: "Get",
                   url: GetWEBURL() + "/Web/Delete_Json",
                   async: true,
                   data: { "sHInterID": sInterID },
                   dataType: "json",
                   success: function (data) {
                       if (data.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.msg(data.Message, { icon: 2 });
                       }
                   },
                   error: function (err) {
                       layer.msg('错误' + err, {
                           icon: 5,
                           time: 20000
                       }, function () {
                           //do something
                       });
                   }
               });
        });
        var sBillType = '3711'
        table.render({
            elem: '#dj-table'
            , url: GetWEBURL() + '/Web/chanpinruk'
            , toolbar: '#toolbarDemo'
            , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
            , cols: [[
                { type: 'radio' }
                , { field: 'HInterID', title: '单据内码', width: 80 }
                , { field: 'HBillNo', title: '单据号', width: 80 }
                , { field: 'HMaker', title: '制单人', width: 100 }
                , { field: 'HMakeDate', title: '制单日期', width: 100 }
                , { field: 'HQty', title: '数量', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
            ]]
            , height: 500
            , done: function () {
                layer.closeAll("loading");
            }
        })
        //已上传列表
            table.render({
                elem: '#yd-table'
                , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HOrgID', title: '组织', width: 100 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            })
        //刷新明细页签
        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 () {
         }
        });
    });
    //清空表头
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/×éÍе¥±à¼­/Sc_GroupOrderBillEdit_Fast.html
New file
@@ -0,0 +1,197 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<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">
</head>
<body>
    <div class="layui-fluid" style="padding:0">
        <div class="layui-card">
            <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:60px;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>
                    <table class="" id="wl-table" lay-filter="wl-table"></table>
                    <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>-->
                        <input type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify" value="修改"/>
                        <input type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete" value="删除"/>
                        <input type="button" lay-submit="" class="layui-btn" lay-filter="Cancel" value="退出"/>
                    </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;
            var option = {
                id: 'wl-table'
                , elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , page: false
                , cellMinWidth: 120
                , height: 200
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HBarCode', title: '子条码编号', width: 150 }
                    , { field: 'HQty', title: '数量', width: 150,edit:true }
                ]]
                , limit: 500 //每页默认显示的数量
                , done: function (res, curr, count) {
                }
            };
            option.data = [];
            table.render(option);
            //清空界面  new
            $("#HBarCode").focus();
        //编辑
        form.on('submit(cmdModify)', function () {//编辑
        //获取网格当前选中行的条码、数量   ä¿®æ”¹æ¡ç æ¡£æ¡ˆæ•°é‡   ç»„托单子表数量  é‡æ–°æ‰§è¡Œç”Ÿæˆsum表存储过程
        //var sSubStr = table.cache['wl-table'];
            var checkStatus = table.checkStatus('wl-table');
            var data = checkStatus.data;
            if (data.length === 0) {
                layer.msg("请选中一行数据修改");
                return;
            }
            var sQty = data[0].HQty
            var HBarCode = data[0].HBarCode
            $.ajax({
                type: "Get",
                url: GetWEBURL() + "/GroupOrderBill/Edit",
                async: true,
                data: { "HBarCode1": HBarCode, "HQty": sQty},
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        layer.alert(data.Message, { icon: 1, closeBtn: false }, function () {
                            window.location.reload();
                        });
                    }
                    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(Cancel)', function () {
            //sessionStorage["SourceFlag"] = false;
            parent.location.href = "../../../views/index.html"
            //window.close();//关闭当前页
        })
        //删除
        form.on('submit(cmdDelete)', function () {//删除
            var checkStatus = table.checkStatus('wl-table')
            , data = checkStatus.data;
            //var sInterID = $('#HInterID').val()
            var HBarCode = data[0].HBarCode
            $.ajax(
               {
                   type: "Get",
                    url: GetWEBURL() + "/GroupOrderBill/Delete",
                   async: true,
                    data: {"HBarCode1": HBarCode},
                   dataType: "json",
                   success: function (data) {
                       if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                           layer.alert(data.Message, { icon: 1, closeBtn: false }, function () {
                               window.location.reload();
                           });
                       }
                       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: "温馨提示" });
                   }
               });
        });
        //扫描托条码
            $('#HBarCode').on('keydown', function (event) {  //扫描托条码
                var HBarCode = $('#HBarCode').val()
                if (event.keyCode == 13) {
                    var HBarCode = $('#HBarCode').val()
                    if (HBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    $.ajax({
                        url: GetWEBURL() + '/GroupOrder/GetBillEntry_TmpListGroupOrder',
                        type: "GET",
                        data: { HBarCode: HBarCode },
                        success: function (result) {
                            if (result.count === 1) {
                                option.data = result.data;
                                table.render(option);
                            }
                        }
                    });
                    return false;
                }
            });
    });
    </script>
</body>
</html>
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherInBill_Fast.html
@@ -727,6 +727,7 @@
                                $("#HStockPlaceName").val(result.data[0].HName);
                                $("#HWHID").val(result.data[0].HWHID);
                                $("#HWHNAME").val(result.data[0].HWhName);
                                $("#HStockPlaceID").val(result.data[0].HItemID);
                                element.tabChange('tab-POStockInBill', '2');
                            }
                            else {
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherOutBill_CheckList_New.html
New file
@@ -0,0 +1,228 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<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">
</head>
<body>
    <div class="layui-fluid">
        <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-tab" lay-filter="tab-POStockInBillList">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1">单据列表</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item  layui-show">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="dj-table" lay-filter="dj-table"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
                            <div class="layui-row">
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                </div>
                            </div>
                        </div>
                    </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
        //加载源单类型
        //读取单据列表
        //
        form.on('submit(Cancel)', function () {
            parent.location.href = "../../../views/index.html"
            //window.close();//关闭当前页
        })
        form.on('submit(cmdModify)', function () {
            var checkStatus = table.checkStatus('dj-table')
                , data = checkStatus.data;
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '其他出库校验'
                , shade: 0.6 //遮罩透明度
                , maxmin: false //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../验收入库/其他入库/Kf_OtherOutBill_Check_New.html?linterid=' + data[0].HInterID + '&lBillNo=' + data[0].HBillNo, 'yes']
                , resize: false
                , cancel: function () {
                    $(".layui-btn").removeClass("layui-btn-disabled");
                }
            })
        });
        var option = {
            elem: '#dj-table'
            , toolbar: '#toolbarDemo'
            , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
            , cols: [[
                { type: 'radio' }
                , { field: 'HInterID', title: '单据内码', width: 80 }
                , { field: 'HBillNo', title: '单据号', width: 80 }
                , { field: 'HMaker', title: '制单人', width: 100 }
                , { field: 'HMakeDate', title: '制单日期', width: 100 }
                , { field: 'HQty', title: '数量', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
            ]]
            , height: 500
            , done: function () {
                layer.closeAll("loading");
            }
        }
        // url: GetWEBURL() + '/Web/chanpinruk',
        form.on('submit(cmdRefresh)', function () {//刷新
            table.render({
                elem: '#dj-table'
                ,url: GetWEBURL() + '/Web/chanpinruk'
                , toolbar: '#toolbarDemo'
                , defaultToolbar: []
                , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            })
        });
        form.on('submit(cmdDelete)', function () {//删除
            var checkStatus = table.checkStatus('dj-table')
            , data = checkStatus.data;
            var sInterID = data[0].HInterID
            $.ajax(
               {
                   type: "Get",
                   url: GetWEBURL() + "/ProductInBillList/Delete_Json",
                   async: true,
                   data: { "sHInterID": sInterID },
                   dataType: "json",
                   success: function (data) {
                       if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†,
                           layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                               // å¾—到frame索引
                               var index = layer.getFrameIndex(window.name);
                               //关闭当前frame
                               layer.close(index);
                               //修改为功后刷新界面
                               window.location.reload();
                           });
                       }
                       else {
                           layer.msg(data.Message, { icon: 2 });
                       }
                   },
                   error: function (err) {
                       layer.msg('错误' + err, {
                           icon: 5,
                           time: 20000
                       }, function () {
                           //do something
                       });
                   }
               });
        });
        var sBillType = '1206'
                table.render({
                    elem: '#dj-table'
                    , url: GetWEBURL() + '/OtherOutBill_Check_New/DisPonderationBillMain_TempList_BillCheck'
                    , toolbar: '#toolbarDemo'
                    , defaultToolbar: []
                    , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"]}
                    , cols: [[
                          { type: 'radio' }
                        , { field: 'HInterID', title: '单据内码', width: 80 }
                        , { field: 'HBillNo', title: '单据号', width: 80 }
                        , { field: 'HMaker', title: '制单人', width: 100 }
                        , { field: 'HMakeDate', title: '制单日期', width: 100 }
                        , { field: 'HOWNERName', title: '组织', width: 100 }
                        ]]
                      , height: 500
                      , done: function () {
                          layer.closeAll("loading");
                      }
                })
        //刷新明细页签
        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 () {
         }
        });
    });
    //清空表头
    </script>
</body>
</html>
WebTM/views/ÑéÊÕÈë¿â/ÆäËûÈë¿â/Kf_OtherOutBill_Check_New.html
New file
@@ -0,0 +1,966 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<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-col-xs4 {
            width: 12.333333%
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <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-tab" lay-filter="tab-Kf_OtherInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <!-- <li lay-id="1">源单信息</li>-->
                            <li lay-id="1">表头信息</li>
                            <li lay-id="2">物料信息</li>
                            <li lay-id="3">合计信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item">
                                <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:30px;padding-left:0px;">仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HSTOCKORGID" id="HSTOCKORGID" lay-verify="HSTOCKORGID">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HWHID-BT">...</button>
                                        </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:30px;padding-left:0px;">仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT">...</button>
                                        </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:45px;padding-left:0px;">单据号</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input mobile">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" disabled="disabled" autocomplete="off" class="layui-input mobile">
                                        </div>
                                    </div>
                                </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 class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">确定</button>
                                        </div>
                                    </div>
                                </div>
                                <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="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 class="layui-tab-item">
                                <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>
                            </div>
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                            </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" id="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>
                    </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
            $("#HWHID").val(sessionStorage["HWHID"]);
            $("#HWHNAME").val(sessionStorage["HWHName"]);
            $("#HStockPlaceID").val(sessionStorage["HSPID"]);
            $("#HStockPlaceName").val(sessionStorage["HSPName"]);
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 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 lBillNo = params[params[1]];  //从单据获取 æºå•类型
            function RoadBillMain(linterid)//加载表头
            {
                $.ajax({
                    url: GetWEBURL() + "/OtherOutBill_Check_New/bj",
                    type: "GET",
                    data: { "HBillNo": lBillNo, "HBillType": '1206'},
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            //console.log(JSON.stringify(result.data.hItemIDField))
                            //return;
                            $("#HStockPlaceName").val(result.data.hSPNameField);
                            $("#HWHID").val(result.data.hWhIDField);
                            $("#HWHNAME").val(result.data.hWhNameField);
                            $('#HInterID').val(result.data.hInterIDField)
                            $('#HBillNo').val(result.data.hBillNoField)
                            var HBillID = $('#HInterID').val()
                            element.tabChange('tab-Kf_OtherInBill', '2');
                            table.render({
                                elem: '#wl-table'
                                , url: GetWEBURL() + '/OtherOutBill_Check_New/DisBillEntryList_Webs_Json1'
                                , toolbar: '#toolbarDemo'
                                , where: { HBillID: HBillID, HBillType: '1206', sWhere: '' }
                                , cellMinWidth: 90
                                , 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: 'HBatchNo', title: '批次', width: 150 }
                                    , { field: 'HAuxPropName', title: '辅助属性', width: 150 }
                                    , { field: 'HWHName', title: '仓库', width: 150 }
                                    , { field: 'HSPName', title: '仓位', width: 150 }
                                    , { field: 'HMTONo', title: 'MTO号', width: 150 }
                                    , { field: 'HSourceBillNo', title: '单据号', width: 150 }
                                ]]
                                , height: 500
                                , done: function () {
                                    layer.closeAll("loading");
                                }
                            });
                        }
                        else {
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            //function RoadBillSub(linterid)//加载表体
            //{
            //    table.render({
            //        elem: '#wl-table'
            //        , url: GetWEBURL() + '/OtherOutBill_Check_New/DisBillEntryList_Webs_Json'
            //        , toolbar: '#toolbarDemo'
            //        , where: { HBillID: linterid, HBillType: '1206', 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 }
            //        ]]
            //        , height: 500
            //        , done: function () {
            //            layer.closeAll("loading");
            //        }
            //    });
            //}
            //动态加载源单类型列表 new
            //判断是否新增
            if (linterid == null || linterid == 0) {
                //获取最大单据号 new
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '1206' },
                    success: function (d) {
                        //console.log(d.data);
                        //$("#HInterID").val(d.data[0].HInterID);
                        //$("#HBillNo").val(d.data[0].HBillNo);
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
            }
            if (1 == 2) {
                element.tabChange('tab-Kf_OtherInBill', '2');
                var pFocus = $("#HBarCode");
                pFocus.focus();
                pFocus.select();
            }
            else {
                element.tabChange('tab-Kf_OtherInBill', '1');
                var pFocus = $("#HBillNo");
                pFocus.focus();
                pFocus.select();
            }
            //
            function Sub_ClearBill() {
                //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
                $("#HWHID").val(sessionStorage["HWHID"]);
                $("#HWHNAME").val(sessionStorage["HWHName"]);
                $("#HStockPlaceID").val(sessionStorage["HSPID"]);
                $("#HStockPlaceName").val(sessionStorage["HSPName"]);
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMaker").hide();
                $("#HMakerID").hide();
                //设置单据号
                $("#HInterID").val("");
                $("#HBillNo").val("");
                //$.ajax({
                //    url: GetWEBURL() + "/Web/GetMAXNum",
                //    type: "GET",
                //    data: { "HBillType": '1206' },
                //    success: function (d) {
                //        $("#HInterID").val(d.data[0].HInterID);
                //        $("#HBillNo").val(d.data[0].HBillNo);
                //    }
                //});
                //焦点
                //刷新
                var sInterID = $("#HInterID").val()
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                    , toolbar: '#toolbarDemo'
                    , where: { HBillID: linterid, HBillType: '1203', 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 }
                    ]]
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
            //
            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
            //        , area: ['100%', '100%']
            //        , title: '保管列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            //form.on('submit(HSecManagerID-BT)', function (data) {//选择验收
            //    var sMainStr = JSON.stringify(data.field);
            //    layer.open({
            //        type: 2
            //        , area: ['100%', '100%']
            //        , title: '验收列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            form.on('submit(HKeeperID-BT)', function () {//选择保管
                layer.open({
                    type: 2//弹窗类型
                    , 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 = '1203'
                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() + "/OtherInBill/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() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                                    , toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1203', 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 }
                                    ]]
                                    , height: 500
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
                            }
                        },
                        error: function (err) {
                            layer.msg('错误' + err, {
                                icon: 5,
                                time: 20000
                            }, function () {
                                //do something
                            });
                        }
                    });
            });
            form.on('submit(Saver)', function (data) {//提交
                //灰度提交按钮Saver
                document.getElementById("Saver").disabled = true;
                data.field.HSTOCKORGID = sessionStorage["OrganizationID"];//组织
                var sMainStr = JSON.stringify(data.field);
                var sMain = sMainStr;
                var sSubStr = table.cache['wl-table'];
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    layer.load(3);
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/OtherOutBill_Check_New/set_SaveOtherOutBill_Check_New_Json",
                            async: true,
                            data: { "oMain": sMain },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    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 });
                                    //灰度提交按钮Saver
                                    document.getElementById("Saver").disabled = false;
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.msg("错误:" + err, { icon: 5 });
                                //灰度提交按钮Saver
                                document.getElementById("Saver").disabled = false;
                            }
                        });
                }
                else {
                    layer.msg("数据不完整,不允许提交:", { icon: 5 });
                    //灰度提交按钮Saver
                    document.getElementById("Saver").disabled = false;
                }
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //扫单据号
            $('#HBillNo').on('keydown', function (event) {
                var HBillNo = $('#HBillNo').val()
                //var HBillID = $('#HInterID').val()
                var HBillType = '1206'
                if (event.keyCode == 13) {
                    $.ajax({
                        url: GetWEBURL() + "/ProductIn/BillNo",
                        type: "GET",
                        data: { "HBillNo": HBillNo, "HBillType": HBillType, "HMaker": sessionStorage["HUserName"], "HOwnerID": sessionStorage["OrganizationID"]},
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //console.log(JSON.stringify(result.data.hItemIDField))
                                //return;
                                $("#HStockPlaceName").val(result.data.hSPNameField);
                                $("#HWHID").val(result.data.hWhIDField);
                                $("#HWHNAME").val(result.data.hWhNameField);
                                $('#HInterID').val(result.data.hInterIDField)
                                $('#HBillNo').val(result.data.hBillNoField)
                                var HBillID = $('#HInterID').val()
                                element.tabChange('tab-Kf_OtherInBill', '2');
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/OtherOutBill_Check_New/DisBillEntryList_Webs_Json1'
                                    , toolbar: '#toolbarDemo'
                                    , where: { HBillID: HBillID, HBillType: HBillType, sWhere: '' }
                                    , cellMinWidth: 90
                                    , 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: 'HBatchNo', title: '批次', width: 150 }
                                        , { field: 'HAuxPropName', title: '辅助属性', width: 150 }
                                        , { field: 'HWHName', title: '仓库', width: 150 }
                                        , { field: 'HSPName', title: '仓位', width: 150 }
                                        , { field: 'HMTONo', title: 'MTO号', width: 150 }
                                        , { field: 'HSourceBillNo', title: '单据号', width: 150 }
                                    ]]
                                    , 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' });
                            }
                            layer.closeAll("loading");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                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();
            });
            table.render({
                elem: '#mx-table'
                // , url: 'http://localhost:8083/OtherInStockBill/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , height: 500
                , done: function () {
                }
            });
            //扫条码
            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()
                if (sQty == "") {
                    sQty = 0;
                }
                var sHBillType = '1206'
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var HOrgID = $("#HOrgID").val();//组织
                //判断条码是否为空  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("");
                }
                $.ajax({
                    //url: "http://localhost:12761/OtherInStockBill/get_InfoByBarCode_Source_Json", //方法所在页面和方法名
                    url: GetWEBURL() + "/OtherOutBill_Check_New/get_InfoByBarCode_Source_Json",
                    type: "GET",
                    data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sHBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data.HBarType == '仓库条码') {
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-Kf_OtherInBill', '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-Kf_OtherInBill', '2');//跳转页签
                            }
                            else {
                                element.tabChange('tab-Kf_OtherInBill', '2');
                            }
                            layer.load(3)
                            table.render({
                                elem: '#wl-table'
                                , url: GetWEBURL() + '/OtherOutBill_Check_New/DisBillEntryList_Webs_Json1'
                                , toolbar: '#toolbarDemo'
                                , where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
                                , cellMinWidth: 90
                                , 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: 'HBatchNo', title: '批次', width: 150 }
                                    , { field: 'HAuxPropName', title: '辅助属性', width: 150 }
                                    , { field: 'HWHName', title: '仓库', width: 150 }
                                    , { field: 'HSPName', title: '仓位', width: 150 }
                                    , { field: 'HMTONo', title: 'MTO号', width: 150 }
                                    , { field: 'HSourceBillNo', title: '单据号', width: 150 }
                                ]]
                                , 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' });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
            function playSound() {
                var audio = document.getElementById("cs");
                if (audio == null)
                    $("body").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
                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()
                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///OtherInStockBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
                    url: GetWEBURL() + "/OtherInStockBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
                    type: "GET",
                    data: { "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.load(3)
                            table.render({
                                elem: '#wl-table'
                                //, url: 'http://61.130.49.162:9090/WMSAPI///OtherInStockBill/DisBillEntryList_Webs_Json'
                                , url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_Json'
                                , toolbar: '#toolbarDemo'
                                , where: { HBillID: sInterID, HBillType: '1203', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HQty', title: '数量', width: 150 }
                                    , { field: 'HQtyMust', title: '应收数量', width: 150 }
                                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                                    , { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                                    , { field: 'HBatchNo', title: '批次', width: 150 }
                                ]]
                                // , data: [linterid]
                                // , page: true
                                , height: 500
                                , done: function () {
                                    layer.closeAll("loading");
                                }
                            });
                        }
                        else {
                            // $("#verifycode").click();
                            //layer.msg(result.Message, { icon: 5 });
                            layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                        layer.closeAll("loading");
                    }
                });
            }
        });
        //以上为 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) {  //非空验证
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            //if($("#HDeptName").val()=='')
            //{
            //    layer.msg("部门没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HSecManager").val() == '') {
            //    layer.msg("验收人没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HKeeper").val() == '') {
            //    layer.msg("保管人没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HSupName").val() == '') {
            //    layer.msg("供应商没有选择!", { icon: 5 });
            //    return false;
            //}
            //if ($("#HWHNAME").val() == '') {
            //    layer.msg("仓库没有选择!", { icon: 5 });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号!", { icon: 5 });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码!", { icon: 5 });
                return false;
            }
            if (sSubStr == '' || sSubStr.length == 0) {
                layer.msg("没有物料明细记录!", { icon: 5 });
                return false;
            }
            if (sSubStr != '') {
                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 });
                            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 });
                    return false;
                }
            }
            else {
                return true;
            }
        }
    </script>
</body>
</html>
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBill_Fast.html
@@ -111,7 +111,7 @@
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" style="display:none">...</button>
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" >...</button>
                                        </div>
                                    </div>
                                </div>
@@ -1110,6 +1110,7 @@
                            sessionStorage["SourceFlag"] = true;
                            layer.load(3);
                            element.tabChange('tab-POStockInBill', '2');
                            table.render({
                                elem: '#wl-table'
                                , cellMinWidth: 80