zhangrg
2024-01-02 00a88abf340904065aa7882c7555fc7b65164f5e
WebTM/views/Éú²ú¹ÜÀí/Éú²úÍ£¹¤µ¥/Sc_MESStopWorkBillList.html
@@ -36,11 +36,23 @@
                                        <input type="date" class="layui-input" id="HDate1">
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">订单跟踪号</label>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">生产资源</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HSource" id="HSource">
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                      <label class="layui-form-label">订单跟踪号</label>
                                      <div class="layui-input-block">
                                          <input type="text" class="layui-input" name="HOrderProcNO" id="HOrderProcNO">
                                      </div>
                                </div>-->
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
@@ -53,23 +65,20 @@
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">单据号</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm layui-btn-disabled" lay-event="btn-Print"><i class="layui-icon layui-icon-print"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm layui-btn-disabled" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
                    </form>
@@ -81,12 +90,20 @@
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script>
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        }
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
             //#region å‚æ•°
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
@@ -97,192 +114,52 @@
            , laydate = layui.laydate
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var option = [];
            //#endregion
            var option = {
                elem: '#mainTable'
                ,toolbar: '#toolbarDemo'
                ,height: 'full-50'
                , page: true
                ,cellMinWidth: 90
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                    , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '单据号', title: '单据号' }
                    , { field: 'HBillType', title: 'HBillType', hide: true }
                    , { field: '任务单号', title: '任务单号' }
                    , { field: '工序计划单号', title: '工序计划单号' }
                    , { field: '工序流转卡号', title: '工序流转卡号' }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '规格型号', title: '规格型号' }
                    , { field: 'HProcID', title: 'HProcID', hide: true }
                    , { field: '工序代码', title: '工序代码' }
                    , { field: '工序名称', title: '工序名称' }
                    , { field: '任务单数量', title: '任务单数量' }
                    , { field: '计划数量', title: '计划数量' }
                    , { field: '开始停工时间', title: '开始停工时间', templet: "<div>{{d.开始停工时间 ==null ?'':layui.util.toDateString(d.开始停工时间, 'yyyy-MM-dd HH:mm:ss')}}</div>"  }
                    , { field: '结束停工时间', title: '结束停工时间', templet: "<div>{{d.结束停工时间 ==null ?'':layui.util.toDateString(d.结束停工时间, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: 'HSourceID', title: 'HSourceID', hide: true }
                    , { field: '生产资源代码', title: '生产资源代码' }
                    , { field: '生产资源', title: '生产资源' }
                    , { field: 'HGroupID', title: 'HGroupID', hide: true }
                    , { field: '生产班组代码', title: '生产班组代码' }
                    , { field: '生产班组', title: '生产班组' }
                    , { field: 'HDeptID', title: 'HDeptID', hide: true }
                    , { field: '生产车间代码', title: '生产车间代码' }
                    , { field: '生产车间', title: '生产车间' }
                    , { field: 'HEmpID', title: 'HEmpID', hide: true }
                    , { field: '申请停工人员代码', title: '申请停工人员代码' }
                    , { field: '申请停工人员', title: '申请停工人员' }
                    , { field: '停工原因', title: '停工原因' }
                    , { field: '停工汇报类型', title: '停工汇报类型' }
                    , { field: '条形码', title: '条形码' }
                    , { field: '机器地址', title: '机器地址' }
                    , { field: '扫描人', title: '扫描人' }
                    , { field: '扫描日期', title: '扫描日期', templet: "<div>{{d.扫描日期 ==null ?'':layui.util.toDateString(d.扫描日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '备注', title: '备注' }
                    , { field: '制单人', title: '制单人', width: 200 }
                    , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '审核人', title: '审核人', width: 200 }
                    , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '修改人', title: '修改人', width: 200 }
                    , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '关闭人', title: '关闭人', width: 200 }
                    , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    , { field: '作废人', title: '作废人', width: 200 }
                    , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                ]]
            };
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //判断操作类型
            if (OperationType == 1) {//无源单
                //报工平台报检申请查看列表
                set_ClearBill();
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            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_MESStopWorkBillList.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                    case 'btn-Add': //set_AddNew();
                        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_MESStopWorkBillList.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                    case 'btn-Edit': set_ShowBill();
                        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_MESStopWorkBill/DeltetMESStopWorkBill", //方法所在页面和方法名
                                    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('请选择一行数据删除!');
                        }
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //刷新
                    case 'get_Refresh': set_Refresh();
                        break;
                    //审核按钮
                    case 'btn-Audit': set_CheckBill();
                        break;
                    //退出
                    case 'get_Exit': Pub_Close(2);
                        break;
                };
            });
            //进入页面显示的缓存列表
            var index0 = layer.load(0, { shade: false });
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Sc_MESStopWorkBill/list',
                type: "GET",
                data: { "sWhere": sWhere },
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index0);
                    } else {
                        layer.close(index0);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index0);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#WorkCenter").val("");//单据号
                $("#btnSearch").click();
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
                var ajaxLoad = layer.load();
                var HDate = $("#HDate").val();//开始日期
                var HDate1 = $("#HDate1").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HSource = $("#HSource").val();//生产资源
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
@@ -292,7 +169,9 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                var index = layer.load(0, { shade: false });
                if (HSource) {
                    sWhere += " and èµ„源代码 like '%" + HSource + "%' or èµ„源名称 like '%" + HSource + "%'";
                }
                $.ajax({
                    url: GetWEBURL() + '/Sc_MESStopWorkBill/list',
                    type: "GET",
@@ -301,33 +180,311 @@
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                sWhere = "";//调用接口后清空sWhere缓存
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");//单据号
                $("#HSource").val("");//生产资源
                $("#btnSearch").click();
            });
            //#endregion
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            // åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //初始化表格
            function set_InitGrid() {
                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));
                 option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号' }
                        , { field: '单据类型', title: '单据类型', hide: true }
                        , { field: 'HBillStatus', title: '单据状态', width: 160 }
                        , { field: '任务单号', title: '任务单号' }
                        , { field: '工序计划单号', title: '工序计划单号' }
                        , { field: '工序流转卡号', title: '工序流转卡号' }
                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
                        , { field: '物料代码', title: '物料代码' }
                        , { field: '物料名称', title: '物料名称' }
                        , { field: '规格型号', title: '规格型号' }
                        , { field: 'HProcID', title: 'HProcID', hide: true }
                        , { field: '工序代码', title: '工序代码' }
                        , { field: '工序名称', title: '工序名称' }
                        , { field: '任务单数量', title: '任务单数量' }
                        , { field: '计划数量', title: '计划数量' }
                        , { field: '开始停工时间', title: '开始停工时间', templet: "<div>{{d.开始停工时间 ==null ?'':layui.util.toDateString(d.开始停工时间, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '结束停工时间', title: '结束停工时间', templet: "<div>{{d.结束停工时间 ==null ?'':layui.util.toDateString(d.结束停工时间, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: 'HSourceID', title: 'HSourceID', hide: true }
                        , { field: '生产资源代码', title: '生产资源代码' }
                        , { field: '生产资源', title: '生产资源' }
                        , { field: 'HGroupID', title: 'HGroupID', hide: true }
                        , { field: '生产班组代码', title: '生产班组代码' }
                        , { field: '生产班组', title: '生产班组' }
                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
                        , { field: '生产车间代码', title: '生产车间代码' }
                        , { field: '生产车间', title: '生产车间' }
                        , { field: 'HEmpID', title: 'HEmpID', hide: true }
                        , { field: '申请停工人员代码', title: '申请停工人员代码' }
                        , { field: '申请停工人员', title: '申请停工人员' }
                        , { field: '停工原因', title: '停工原因' }
                        , { field: '停工汇报类型', title: '停工汇报类型' }
                        , { field: '条形码', title: '条形码' }
                        , { field: '机器地址', title: '机器地址' }
                        , { field: '扫描人', title: '扫描人' }
                        , { field: '扫描日期', title: '扫描日期', templet: "<div>{{d.扫描日期 ==null ?'':layui.util.toDateString(d.扫描日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '备注', title: '备注' }
                        , { field: '制单人', title: '制单人', width: 200 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 200 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 200 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 200 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                    ]]
                };
            }
            //查询
            function get_Display() {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_MESStopWorkBill/list',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //新增
            function set_AddNew() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '新增停工单',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    content: '../生产停工单/Sc_Add_MESStopWorkBillList.html?OperationType=1&linterid=&HSouceBillType=',
                    end: function () {
                        //刷新页面,
                        location.reload();
                    },
                    success: function (layero, index) {
                    }
                });
            }
            //编辑
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].hmainid.toString();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus != "1") {
                        layer.msg('单据状态不为未审核状态,不允许编辑!');
                        return false;
                    }
                    //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_MESStopWorkBillList.html?OperationType=3&linterid=' + linterid + '&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();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus != "1") {
                        layer.msg('单据状态不为未审核状态,不允许删除!');
                        return false;
                    }
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "Sc_MESStopWorkBill/DeltetMESStopWorkBill", //方法所在页面和方法名
                            data: { "HInterID": InterID, "UserName": sessionStorage["HUserName"]},
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        });
                    })
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //刷新
            function set_Refresh() {
                $("#btnSearch").click();
            }
            //审核
            function set_CheckBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESStopWorkBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //反审核
            function set_AbandonCheck() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESStopWorkBill/AuditProcessReportList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据反审核!');
                }
            }
            //#endregion
            //以上是layui模块
        });
    </script>