zzr99
2021-09-27 538c6b96405095762f49964c6cdd9d9113563de8
器具编辑改制出库列表+编辑
5个文件已修改
1个文件已添加
1717 ■■■■ 已修改文件
WebTM/WebTM.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldRepairInBillEdit.html 186 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldRepairInBillList.html 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldRepairOutBillEdit.html 1136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具仓库管理/Sc_MouldRepairOutBillList.html 350 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj
@@ -569,6 +569,7 @@
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldProdInBillList.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldProdMoveBill.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairInBillEdit.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairOutBillEdit.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairOutBillList.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldRepairInBillList.html" />
    <Content Include="views\模治具管理\模治具仓库管理\Sc_MouldScrapInBill_PDA.html" />
WebTM/layuiadmin/Scripts/webConfig.js
@@ -2,11 +2,11 @@
function GetWEBURL() {
    //var WEBURL = "http://192.168.16.80:8011/";          //办公室服务器
    //var WEBURL = "http://localhost:8081/SWEAPI/";       //ch本地
    var WEBURL = "http://localhost:8085/API/";   //zgq本地
    //var WEBURL = "http://localhost:8085/API/";   //zgq本地
    //var WEBURL = "http://localhost:8080/API/";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/lubao";   //颜晓军本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //杨露本地配置
    //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //章紫柔本地配置
    var WEBURL = "http://localhost:8082/LuBaoAPI/";    //章紫柔本地配置
    //var WEBURL = "http://10.1.4.155/API/";   //江丰客户NEW
    //var WEBURL = "http://47.96.97.237/API/";   //智云服务器
    //var WEBURL = "http://183.129.128.86:9090/API/";   //凯贝奈特客户服务器外网
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldRepairInBillEdit.html
@@ -87,7 +87,7 @@
                                            <div class="layui-input-inline">
                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
@@ -97,7 +97,7 @@
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSupName" id="HSupName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
@@ -117,9 +117,9 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label">负责人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HMangerName" id="HMangerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HMangerID" id="HMangerID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
                                                <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
@@ -254,8 +254,6 @@
                    <script type="text/html" id="xuhao">
                        {{d.LAY_TABLE_INDEX+1}}
                    </script>
                    <!--隐藏字段-->
                    <input type="hidden" name="HInnerBillNo" id="HInnerBillNo" value="">
                </form>
            </div>
        </div>
@@ -373,13 +371,50 @@
                    }
                });
            });
            //表头信息仓管员弹窗
            form.on('submit(HKeeperList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓管员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    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('请选择数据');
                        }
                        $("#HKeeperName").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息验收员弹窗
            form.on('submit(HSecManagerList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    title: '验收员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
@@ -410,13 +445,13 @@
                    }
                });
            });
            //表头信息保管员弹窗
            form.on('submit(HKeeperList)', function () {
            //表头信息业务员弹窗
            form.on('submit(HEmpList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    title: '业务员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
@@ -431,8 +466,8 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HKeeperName").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        $("#HEmpName").val(checkStatus.data[0].HName);
                        $("#HEmpID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -447,13 +482,13 @@
                    }
                });
            });
            //表头信息业务员弹窗
            form.on('submit(HEmpList)', function () {
            //表头信息负责人弹窗
            form.on('submit(HManagerList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    title: '负责人列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
@@ -468,8 +503,45 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HKeeperName").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        $("#HManagerName").val(checkStatus.data[0].HName);
                        $("#HManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息维修单位弹窗
            form.on('submit(HSupList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '维修单位列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/SupplierInformation.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('请选择数据');
                        }
                        $("#HSupName").val(checkStatus.data[0].HName);
                        $("#HSupID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -543,7 +615,7 @@
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/Sc_MouldProdInHouseBill/SaveGetMouldProdInHouseBillList", //方法所在页面和方法名
                        url: GetWEBURL() + "/Sc_MouldRepairInBill/SaveGetMouldRepairInBillList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
@@ -568,6 +640,76 @@
                            console.log("Reason" + sMainStr);
                        }
                    });
            });
            //审核
            form.on('submit(set_CheckBill)', function (data) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var user = sessionStorage["HUserName"];
                    //逻辑删除方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldRepairInBill/set_CheckBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserName": user },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            });
            //反审核
            form.on('submit(set_AbandonCheck)', function (data) {//
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var user = sessionStorage["HUserName"];
                    //逻辑删除方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldRepairInBill/set_AbandonCheck", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserName": user },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            });
            //退出
            form.on('submit(Exit)', function (data) {//
@@ -755,10 +897,10 @@
                                , "HKeeperName": data.保管员
                                , "HSupID": data.HSupID
                                , "HSupName": data.维修单位
                                , "HSecManagerID": data.hsecmanagerid    //验收员ID
                                , "HSecManagerID": data.HSecManagerID    //验收员ID
                                , "HSecManagerName": data.验收员         //验收员名称
                                , "HMangerID": data.HMangerID
                                , "HMangerName": data.负责人
                                , "HManagerID": data.HManagerID
                                , "HManagerName": data.负责人
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                  //部门名称
                                , "RepairType": ""                       //维修类型
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldRepairInBillList.html
@@ -129,6 +129,12 @@
                    //删除
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //审核
                    case 'btn-CheckBill': set_CheckBill();
                        break;
                    //反审核
                    case 'btn-AbandonCheck': set_AbandonCheck();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
@@ -173,16 +179,16 @@
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: '单据类型', title: '单据类型', width: 110, hide: true }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '领料人代码', title: '领料人代码', width: 180 }
                        , { field: '领料人', title: '领料人', width: 125 }
                        , { field: '领料人代码', title: '领料人代码', width: 180, hide: true }
                        , { field: '领料人', title: '领料人', width: 125, hide: true }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '发料人代码', title: '发料人代码', width: 180 }
                        , { field: '发料人', title: '发料人', width: 125 }
                        , { field: '发料人代码', title: '发料人代码', width: 180, hide: true}
                        , { field: '发料人', title: '发料人', width: 125, hide: true }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
@@ -195,24 +201,24 @@
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        , { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        , { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        , { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125, hide: true }
                        , { field: '计量单位', title: '计量单位', width: 125, hide: true }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '仓位代码', title: '仓位代码', width: 125, hide: true }
                        , { field: '仓位', title: '仓位', width: 125, hide: true }
                        , { field: '应收数量', title: '应收数量', width: 125 }
                        , { field: '实收数量', title: '实收数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125, hide: true }
                        , { field: '金额', title: '金额', width: 125, hide: true}
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125, hide: true}
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldRepairOutBillEdit.html
New file
@@ -0,0 +1,1136 @@
<!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/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 type="text/css">
        /*begin æ­¤æ ·å¼ç”¨äºŽæ¶ˆé™¤è¡Œå…ƒç´ ä¸­å¸ƒå±€å®½åº¦ä¸å¤Ÿçš„问题*/
        .layui-form-item .layui-inline {
            margin-top: 5px;
            margin-bottom: 5px;
            margin-right: 0px;
        }
        /*end*/
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 15px;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="component-form-group" style="background-color:white;">
                    <div class="layui-card-header">
                        <div class="layui-btn-group">
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">新增</button>
                            <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">审核</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">反审核</button>
                            <!--<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_DeleteBill" id="set_DeleteBill">删除</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="get_PrintReport" id="get_PrintReport">预览</button>-->
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                        </div>
                    </div>
                    <div class="layui-tab" 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>
                        </ul>
                        <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">单据号</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" readonly="readonly" autocomplete="off">
                                                <input id="HInterID" name="HInterID" type="hidden" />
                                            </div>
                                        </div>
                                        <div class=" layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">内部单据号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HInnerBillNo" id="HInnerBillNo" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">仓库</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HWHName" id="HWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="WareHouse" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class=" layui-inline">
                                            <label class="layui-form-label">仓管员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class=" layui-inline">
                                            <label class="layui-form-label">维修单位</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSupName" id="HSupName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class=" layui-inline">
                                            <label class="layui-form-label">送修人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">负责人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">维修部门</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="Department" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">维修类型</label>
                                            <div class="layui-input-inline">
                                                <select name="RepairType" id="RepairType">
                                                    <option value="0" selected="selected">内部维修</option>
                                                    <option value="1">外部维修</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">业务员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">摘要</label>
                                        <div class="layui-input-inline">
                                            <textarea placeholder="请输入摘要" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">备注</label>
                                        <div class="layui-input-inline">
                                            <textarea placeholder="请输入维备注" class="layui-textarea" name="HRemark" id="HRemark"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--制单信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">制单人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">审核人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">关闭人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">制单日期</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">审核日期</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">关闭日期</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">修改人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">作废人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">修改日期</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">作废日期</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
                                            </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" id="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine" id="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                        </div>
                    </script>
                    <script type="text/html" id="xuhao">
                        {{d.LAY_TABLE_INDEX+1}}
                    </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>
        //获取参数
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
        }
        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
                , laydate = layui.laydate
                , element = layui.element;
            //查询条件
            var option = [];
            var sWhere = "";
            var sBillType = "3825";
            TabRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HRemark": "" };
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            //初始化表单插件
            set_InitFrom();
            //初始化表格
            set_InitGrid();
            //判断操作类型
            if (OperationType == 1) {//无源新增
                set_AddFNew();
            }
            else if (OperationType == 3) {//编辑
                set_EditFromGrid(linterid);
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
            //#region ç‚¹å‡»äº‹ä»¶ï¼ŒåŒ…括on和form事件
            //头工具栏
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = TabRow;
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
                        break;
                    //复制一行
                    case 'btn-CopyLine': btnCopyLine(data);
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            //表头信息仓库弹窗
            form.on('submit(WareHouse)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓库列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/WareHouseInformation.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('请选择数据');
                        }
                        $("#HWHName").val(checkStatus.data[0].HName);
                        $("#HWHID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息仓管员弹窗
            form.on('submit(HKeeperList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '仓管员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    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('请选择数据');
                        }
                        $("#HKeeperName").val(checkStatus.data[0].HName);
                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息验收员弹窗
            form.on('submit(HSecManagerList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '验收员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    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('请选择数据');
                        }
                        $("#HSecManagerName").val(checkStatus.data[0].HName);
                        $("#HSecManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息业务员弹窗
            form.on('submit(HEmpList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '业务员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    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('请选择数据');
                        }
                        $("#HEmpName").val(checkStatus.data[0].HName);
                        $("#HEmpID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息负责人弹窗
            form.on('submit(HManagerList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '负责人列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    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('请选择数据');
                        }
                        $("#HManagerName").val(checkStatus.data[0].HName);
                        $("#HManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息维修单位弹窗
            form.on('submit(HSupList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '维修单位列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/SupplierInformation.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('请选择数据');
                        }
                        $("#HSupName").val(checkStatus.data[0].HName);
                        $("#HSupID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息部门弹窗
            form.on('submit(Department)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '部门列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/DeptInformation.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('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //保存
            form.on('submit(Saver)', function (data) {
                var refSav = "";
                if (linterid == "" || linterid == null) {
                    refSav = "Add";
                }
                if (linterid != "" && linterid != null) {
                    refSav = "Update";
                }
                //debugger;
                data.field.HMaker = sessionStorage["HUserName"];//制单人
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav;
                if (!AllowLoadData(sSubStr))//数据验证
                {
                    return false;
                }
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/Sc_MouldRepairOutHouseBill/SaveGetMouldRepairOutHouseBillList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                                });
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
            });
            //审核
            form.on('submit(set_CheckBill)', function (data) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var user = sessionStorage["HUserName"];
                    //逻辑删除方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldRepairOutBill/set_CheckBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserName": user },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            });
            //反审核
            form.on('submit(set_AbandonCheck)', function (data) {//
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var user = sessionStorage["HUserName"];
                    //逻辑删除方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldRepairOutBill/set_AbandonCheck", //方法所在页面和方法名
                        data: { "HInterID": InterID, "CurUserName": user },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            });
            //退出
            form.on('submit(Exit)', function (data) {//
                Pub_Close(1);
            });
            //打印Printing
            form.on("submit(print)", function (data) {
                layer.alert("我是打印按钮!单据主ID是:" + hID);
                //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                window.open("HBarPlanPrint.html?linterid=" + hID + "&Type=HDepartMent" + "&OpenTmp=b");
            });
            //关闭当前页
            form.on('submit(Cancel)', function () {
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            //监听单元格编辑  å•元格编辑后 å˜æ›´
            table.on('edit(mainTable)', function (obj) {
                // å•元格编辑之前的值
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                //layer.msg('[ID: ' + data.id + '] ' + field + ' å­—段更改为:' + value);
                switch (field) {
                    case "HDesignLife":  //设计寿命
                        value = isNaN(value) ? 0 : value;
                        var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HDesignLife: value,                          //设计寿命
                            HLeaveLife: value - HUseLife,           //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HLeaveLife":  //剩余寿命
                        var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                        var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                        //同步更新表格和缓存对应的值
                        obj.tr.find('td[data-field=HLeaveLife] input').val(HDesignLife - HUseLife);
                        obj.update({
                            HLeaveLife: HDesignLife - HUseLife,   //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HUseLife":    //使用寿命
                        var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                        value = isNaN(value) ? 0 : value;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HLeaveLife: HDesignLife - value, //剩余寿命=设计寿命-使用寿命
                        });
                        break;
                    case "HQty":        //实收数量
                        value = isNaN(value) ? 0 : value;
                        var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: value * HPrice, //金额=实收数量*单价
                        });
                        break;
                    case "HPrice":      //单价
                        value = isNaN(value) ? 0 : value;
                        var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: value * HQty, //金额=实收数量*单价
                        });
                        break;
                    case "HMoney":     //金额
                        var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                        var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: HPrice * HQty, //金额=实收数量*单价
                        });
                        break;
                    default:
                }
            });
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            //初始化表单插件
            function set_InitFrom() {
                laydate.render({
                    elem: '#HDate'
                    , elem: '#HMakeDate'
                });
            }
            //初始化表格
            function set_InitGrid() {
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '模具代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '模具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
                    , { field: 'HUseLife', title: '使用寿命', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应收数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实收数量', edit: 'text', width: 100 }
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: 'HWHCode', title: '收料仓库代码', edit: 'text', event: 'HWHCode', width: 100 }
                    , { field: 'HWHName', title: '收料仓库名称', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , limit: 500 //每页默认显示的数量
                    , done: function (res, curr, count) {
                    }
                };
            }
            //无源单新增
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [TabRow];
                table.render(option);
            }
            //获取最大单据号
            function get_MAXNum() {
                //获取最大单据号 new
                $("#HInterID").val("0");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": sBillType },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HInterID").val(0);
                    }
                });
            }
            //编辑
            function set_EditFromGrid(linterid) {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [TabRow];
                table.render(option);
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldRepairOutBill/Sc_MouldRepairOutHouseBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": linterid
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldRepairOutBillList[0];
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                , "HDate": formatDate(data.日期)
                                , "HInnerBillNo": data.内部单据号
                                , "HWHID": data.HWHID                    //仓库ID
                                , "HWHName": data.仓库               //仓库名称
                                , "HKeeperID": data.HKeeperID
                                , "HKeeperName": data.保管员
                                , "HSupID": data.HSupID
                                , "HSupName": data.维修单位
                                , "HSecManagerID": data.HSecManagerID    //验收员ID
                                , "HSecManagerName": data.验收员         //验收员名称
                                , "HManagerID": data.HManagerID
                                , "HManagerName": data.负责人
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                  //部门名称
                                , "RepairType": ""                       //维修类型
                                , "HEmpID": data.HEmpID
                                , "HEmpName": data.业务员
                                , "HSourceBillType": data.源单类型        //源单类型
                                , "XDH": ""                               //选单号
                                , "HExplanation": data.摘要              //摘要
                                , "HRemark": data.备注                    //备注
                            });
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            //编辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldRepairOutBill/Sc_MouldRepairOutBillListCheckDetai1',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //日期格式化
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            //增加一行
            function btnAddLine(NewRow) {
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
            }
            //复制一行
            function btnCopyLine(data) {
                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);//将数据渲染到表格上
                }
            }
            // è¡¨æ ¼è¡Œå†…事件删除
            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();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
                            layer.close(index);
                        }
                    });
                }
            }
            //表格行内事件快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        //模具信息  å¦‚果在模具代码列 æŒ‰F7
                        if (obj.event === 'HMaterCode')  //模具信息  å¦‚果在模具代码列 æŒ‰F7
                        {
                            //页面层-自定义  //F7选择模具
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '模具列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/MouldInformation.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HMaterID: checkStatus.data[0].HItemID,
                                        HMaterCode: checkStatus.data[0].HNumber,
                                        HMaterName: checkStatus.data[0].HName,
                                        HMaterSpec: checkStatus.data[0].HModel,
                                        HDesignLife: 0,  //设计寿命
                                        HLeaveLife: 0,   //剩余寿命
                                        HQty: 1,         //实收数量
                                        HMoney: 0,       //金额
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        //仓库代码
                        if (obj.event === 'HWHCode')  //仓库代码
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '仓库列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/WareHouseInformation.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('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HWHID: checkStatus.data[0].HItemID,
                                        HWHCode: checkStatus.data[0].HNumber,
                                        HWHName: checkStatus.data[0].HName,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
            }
            //?
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
            //非空验证
            function AllowLoadData(sSubStr) {
                var Result = true;
                if ($("#HSecManagerID").val() == '' || $("#HSecManagerID").val() == null) {
                    layer.msg("验收员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HKeeperID").val() == '' || $("#HKeeperID").val() == null) {
                    layer.msg("保管员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if (typeof (sSubStr) == "undefined" || sSubStr == "") {
                    layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") {
                    sSubStr = JSON.parse(sSubStr);
                    for (var i = 0; i < sSubStr.length; i++) {
                        if (sSubStr[i].HMaterID == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,模具信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                    }
                }
                else {
                    return Result = true;
                }
                return Result;
            }
            //#endregion
        });
    </script>
</body>
</html>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldRepairOutBillList.html
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>器具改制出库单据维护</title>
    <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">
@@ -32,10 +32,10 @@
                        <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">
                                    <span>更多</span>
                                </div>
                            </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
@@ -59,13 +59,13 @@
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <!--<div class="layui-colla-content">
                                <div class="layui-inline">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                        <span>其他条件></span>
                                    </div>
                                </div>
                                </div>-->
                            </div>-->
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
@@ -93,6 +93,7 @@
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -105,37 +106,62 @@
            //查询条件
            var sWhere = "";
            var option = [];
            //初始化界面
            set_ClearBill();
            var columns = "";
            var DataList;
            var Name = "MouldRepairOutBillList";
            //#endregion
            //#region é‡ç½®æŒ‰é’®
            //#region åˆå§‹åŒ–界面
            set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    //新增
                    case 'btn-Add': set_AddNew();
                        break;
                    //编辑
                    case 'btn-Edit': set_ShowBill();
                        break;
                    //删除
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                //清空过滤条件
                set_ClearQuery();
            });
            //#endregion
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
            });
            //#endregion
            //#region åˆå§‹åŒ–界面
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            //初始化界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                //进入页面显示的缓存列表
                get_Display(sWhere);
            }
            //#endregion
            //#region åˆå§‹åŒ–表格方法
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            //初始化表格方法
            function set_InitGrid() {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
@@ -147,21 +173,21 @@
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 125, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 195 }
                        , { field: '单据类型', title: '单据类型', width: 110 }
                        , { field: '单据类型', title: '单据类型', width: 110, hide: true }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSecManagerID', title: 'HSecManagerID', width: 200, hide: true }
                        , { field: '领料人代码', title: '领料人代码', width: 180 }
                        , { field: '领料人', title: '领料人', width: 125 }
                        , { field: '领料人代码', title: '领料人代码', width: 180, hide: true }
                        , { field: '领料人', title: '领料人', width: 125, hide: true }
                        , { field: 'HKeeperID', title: 'HKeeperID', width: 200, hide: true }
                        , { field: '发料人代码', title: '发料人代码', width: 180 }
                        , { field: '发料人', title: '发料人', width: 125 }
                        , { field: '发料人代码', title: '发料人代码', width: 180, hide: true }
                        , { field: '发料人', title: '发料人', width: 125, hide: true }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门', title: '部门', width: 125 }
                        , { field: '摘要', title: '摘要', width: 125 }
                        , { field: '表头备注', title: '表头备注', width: 125 }
                        , { field: '备注', title: '备注', width: 125 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
@@ -169,24 +195,24 @@
                        , { field: '模具名称', title: '模具名称', width: 125 }
                        , { field: '规格型号', title: '规格型号', width: 125 }
                        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125 }
                        , { field: '计量单位', title: '计量单位', width: 125 }
                        , { field: 'HWHSonID', title: 'HWHSonID', width: 200, hide: true }
                        , { field: '发料仓库代码', title: '发料仓库代码', width: 125 }
                        , { field: '发料仓库', title: '发料仓库', width: 125 }
                        , { field: '计量单位代码', title: '计量单位代码', width: 125, hide: true }
                        , { field: '计量单位', title: '计量单位', width: 125, hide: true }
                        , { field: 'HWHID', title: 'HWHID', width: 200, hide: true }
                        , { field: '仓库代码', title: '仓库代码', width: 125 }
                        , { field: '仓库', title: '仓库', width: 125 }
                        , { field: 'HSPID', title: 'HSPID', width: 200, hide: true }
                        , { field: '仓位代码', title: '仓位代码', width: 125 }
                        , { field: '仓位', title: '仓位', width: 125 }
                        , { field: '应发数量', title: '应发数量', width: 125 }
                        , { field: '实发数量', title: '实发数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125 }
                        , { field: '金额', title: '金额', width: 125 }
                        , { field: '仓位代码', title: '仓位代码', width: 125, hide: true }
                        , { field: '仓位', title: '仓位', width: 125, hide: true }
                        , { field: '应收数量', title: '应收数量', width: 125 }
                        , { field: '实收数量', title: '实收数量', width: 125 }
                        , { field: '单价', title: '单价', width: 125, hide: true }
                        , { field: '金额', title: '金额', width: 125, hide: true }
                        , { field: '设计寿命', title: '设计寿命', width: 125 }
                        , { field: '累积使用寿命', title: '累积使用寿命', width: 125 }
                        , { field: '剩余寿命', title: '剩余寿命', width: 125 }
                        , { field: '关联数量', title: '关联数量', width: 125 }
                        , { field: '表体备注', title: '表体备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125 }
                        , { field: '子备注', title: '子备注', width: 125 }
                        , { field: '红蓝单标记', title: '红蓝单标记', width: 125, hide: true }
                        , { field: '制单人', title: '制单人', width: 125 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 125 }
@@ -210,7 +236,7 @@
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldRepairOutBillList/GetMouldRepairOutBillList',
                    url: GetWEBURL() + '/Sc_MouldRepairOutBill/Get_MouldRepairOutBillList',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
@@ -228,126 +254,7 @@
                    }
                });
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增器具改制出库',
                            closeBtn: 1,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../模治具仓库管理/Sc_Add_MouldProdOutBillList.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = data[0].hmainid.toString();
                            //if (AllowLoadData(sSubStr) != false) {//非空验证
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '编辑器具改制出库'
                                , closeBtn: 1
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../模治具仓库管理/Sc_Add_MouldProdOutBillList.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var InterID = data[0].hmainid.toString();
                            //逻辑删除方法
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Sc_MouldProdOutBill/DeltetMouldProdOutBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            ////进入页面显示的缓存列表
            //$.ajax({
            //    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
            //    url: GetWEBURL() + '/Sc_MouldProdOutBill/GetMouldProdOutBill',
            //    type: "GET",
            //    data: { "sWhere": sWhere},
            //    success: function (data1) {
            //        if (data1.count == 1) {
            //            option.data = data1.data;
            //            table.render(option);
            //            layer.close(index);
            //        } else {
            //            layer.close(index);
            //            layer.alert(data1.code + data1.Message, { icon: 5 });
            //        }
            //    }, error: function () {
            //        layer.close(index);
            //        layer.alert("接口请求失败!", { icon: 5 });
            //    }
            //});
            //#region å¿«é€Ÿè¿‡æ»¤
            //快速过滤
            function get_FastQuery(table, option) {
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
@@ -364,38 +271,106 @@
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶
            //重置过滤条件
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                sWhere = "";
                get_Display(sWhere);
            }
            //#endregion
            //新增
            function set_AddNew() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '新增模具改制出库单',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    content: '../模治具仓库管理/Sc_MouldRepairOutBillEdit.html?OperationType=1&linterid=&HSouceBillType=',
                    end: function () {
                        //刷新页面,
                        location.reload();
                    },
                    success: function (layero, index) {
            //#region åˆ·æ–°
                    }
                });
            }
            //修改
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].hmainid.toString();
                    //if (AllowLoadData(sSubStr) != false) {//非空验证
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '编辑模具改制出库单'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../模治具仓库管理/Sc_MouldRepairOutBillEdit.html?OperationType=3&linterid=' + hID + '&HSouceBillType='
                        , resize: false,
                        end: function () {
                            //刷新页面,
                            location.reload();
                        }
                        , cancel: function () {
                            //$(".layui-btn").removeClass("layui-btn-disabled");
                        }
                    })
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            //删除
            function set_DeleteBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "Sc_MouldRepairOutBill/set_DeleteBill", //方法所在页面和方法名
                            data: { "HInterID": InterID },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        });
                    })
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //刷新
            function get_Refresh() {
                set_ClearQuery();
                get_Display(sWhere);
            }
            //#endregion
            ////监听行双击事件
            //table.on('rowDouble(mainTable)', function (obj) {
            //    layer.alert("双击事件", { icon: 1 });
            //});
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //以上是layui模块
        });
@@ -403,6 +378,7 @@
    </script>
</body>