wtt
2024-11-22 4f90256a50a31f587853ce3ce51a89732764c924
WebTM/views/É豸¹ÜÀí/É豸¿ª»úµ¥/Sb_EquipBeginBillList.html
@@ -149,10 +149,11 @@
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <div id="page" style="position: relative; bottom: 0;"></div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <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>
@@ -198,6 +199,8 @@
            var option = [];
            var sWhere = "";
            var page = 1;//分页数据
            var size = 50;
            var HModName = "Sb_EquipBeginBillList";
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
@@ -207,7 +210,7 @@
        //#endregion
            //不需要显示的字段 å¯æ‰©å±•
            var titleData = ["HInterID", "HEquipID", "HEquipRelationID", "HBeginEmpID"];
            var titleData = ["HInterID", "HEquipID", "HEquipRelationID", "HBeginEmpID","sorderid"];
            //#endregion
            //#region ã€è¿‡æ»¤æ–¹æ¡ˆã€‘
@@ -333,7 +336,11 @@
            //#region æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
                if (page != 1) {
                    $("#page a:eq(1)").get(0).click();//点击分页栏第一页
                } else {
                    get_FastQuery();
                }
            });
            //#endregion
@@ -347,7 +354,7 @@
                set_InitGrid();
               
                //查询
                get_FastQuery();
                //get_FastQuery();
                //查询当前登录用户有没有在当前模块设置默认过滤方案
                get_DefaultModule();
                $("#BenginHCreateDate").val(Format(new Date(new Date()-(1000 * 60 * 60 * 24 * 7)), "yyyy-MM-dd"));
@@ -361,7 +368,7 @@
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , page: false
                    , sort: true  //重点1:这里的sort表示 table表在取得接口数据后,对页面渲染后的table数据进行排序。同时,这里的true ä¼šå½±å“é¡µé¢sort ä¸Šä¸‹å°ç®­å¤´çš„ æ˜¾ç¤ºæ•ˆæžœ
                    , totalRow: true
                    , limit: 50
@@ -370,6 +377,24 @@
                        soulTable.render(this);
                    }
                };
                optionPage = {
                    elem: 'page', //注意,这里的 page æ˜¯ ID,不用加 # å·
                    count: 10000, //数据总数,从服务端得到
                    limit: 50,
                    limits: [50, 500, 5000, 50000],
                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                    jump: function (obj, first) {
                        //首次不执行
                        if (!first) {
                            //do something
                            page = obj.curr;
                            size = obj.limit;
                            get_FastQuery();
                        }
                    }
                }
                laypage.render(optionPage);
            }
            //#endregion
@@ -431,6 +456,78 @@
                    }
                });
            }
            //#endregion
            //#region åˆ†é¡µæŸ¥è¯¢
            function get_DisplayPage(sWhere) {
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sb_EquipBeginBill/getSb_EquipBeginBillListPage',
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
                    success: function (data1) {
                        option.limit = size;//改变表格页大小
                        if (data1.code == 1) {
                            optionPage.count = data1.count;//改变列表数据总数
                            var data = [];
                            var col = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                //动态获取列表所有列名
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                                //获取不需要显示的列(H开头的列不显示)
                                var patrn = new RegExp(/^h/i);
                                if (patrn.test(data1.list[key].ColmCols)) {
                                    titleData[key] = data1.list[key].ColmCols;
                                }
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 160 });
                                            break;
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
                                            break;
                                        case 'Int32':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 140 });
                                    }
                                }
                            }
                            columns = col;
                            option.cols = [col];
                            option.data = data1.data;
                            option.totalRow = true;
                            laypage.render(optionPage);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            layer.close(ajaxLoad);
                            if ($("#ColName option").length < 1) {
                                ColFilter();
                            }
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
@@ -530,7 +627,9 @@
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + EndHCreateDate + "'";
                }
                get_Display(sWhere);
                //get_Display(sWhere);
                //数据库分页查询
                get_DisplayPage(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //#endregion
@@ -946,6 +1045,8 @@
                            //当前用户没有设置默认的过滤方案
                            //隐藏显示过滤方案的标签信息
                            document.getElementById("HFilterScheme_Now").style.display = "none";
                            //查询
                            get_FastQuery()
                           
                        }
                    }, error: function () {