From 4f90256a50a31f587853ce3ce51a89732764c924 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 22 十一月 2024 15:21:15 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/设备管理/Sb_EqpMaintenanceBillList.html |  149 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 124 insertions(+), 25 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EqpMaintenanceBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EqpMaintenanceBillList.html"
index 5f008f3..6111253 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EqpMaintenanceBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EqpMaintenanceBillList.html"
@@ -174,6 +174,7 @@
                             </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="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
@@ -223,6 +224,8 @@
 
             //鏌ヨ鏉′欢
             var sWhere = "";
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
             var option = [];
             var HModName = "Sb_EqpMaintenanceBillList";
 
@@ -232,11 +235,11 @@
             var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
         //#endregion
 
-            var titleData = ["hmainid", "鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HEquipID", "HRepairID", "HEmpID", "HDeptID", "HManagerID", "hsubid", "HRepairID1", "HManagerID1", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType", "HMainSourceBillType", "HMainSourceInterID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+            var titleData = ["sorderid","hmainid", "鍗曟嵁ID", "鍗曟嵁绫诲瀷", "HEquipID", "HRepairID", "HEmpID", "HDeptID", "HManagerID", "hsubid", "HRepairID1", "HManagerID1", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "HBillType", "HMainSourceBillType", "HMainSourceInterID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
             //#region 銆愯繃婊ゆ柟妗堛��
 
-            //杩囨护鏉′欢鐨刢lass绫� 
+            //杩囨护鏉′欢鐨刢lass绫�
             var HClassTag = "ForFilteringSchemes";
             //妯″潡鍚嶇О锛堜腑鏂囩増锛� 姣忎釜妯″潡椤甸潰閮介渶瑕佷慨鏀�
             window.HModuleName = "璁惧缁翠慨璁板綍鍗曞垪琛�";
@@ -253,7 +256,7 @@
             //鍒濆鍖栫晫闈�
             set_ClearBill();
             //鍒濆鍖栬〃鏍�
-            DisPlay_HideColumn();
+            //DisPlay_HideColumn();
             //#endregion
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
@@ -325,7 +328,11 @@
 
             // 鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
-                get_FastQuery();
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery();
+                }
             });
 
             // 閲嶇疆鎸夐挳
@@ -351,7 +358,7 @@
                     get_DefaultModule();
                 }
 
-              
+
             }
 
             //鍒濆鍖栬〃鏍�
@@ -362,7 +369,7 @@
                     , height: 'full-50'
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
-                    , page: true
+                    , page: false
                     , cellMinWidth: 90
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
@@ -426,6 +433,24 @@
                         , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                     ]]
                 };
+                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);
             }
 
             //鏌ヨ
@@ -463,7 +488,7 @@
                                         case 'double':
                                         case 'Decimal':
                                             col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
-                                            break;  
+                                            break;
                                         default:
                                             col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                     }
@@ -511,6 +536,78 @@
                     }
                 });
             }
+
+            //#region 鍒嗛〉鏌ヨ
+            function get_DisplayPage(sWhere) {
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage',
+                    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
 
             //鏂板
             function set_AddNew()
@@ -605,8 +702,8 @@
 
            //蹇�熻繃婊�
             function get_FastQuery() {
-            var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
-            var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
+                var HDate = $("#HDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HDate1").val();//缁撴潫鏃ユ湡
                 var HBillNo = $("#HBillNo").val();//鍗曟嵁鍙�
                 var ColName = $("#ColName").val();//澶嶉�夋
                 var Comparator = $("#Comparator").val()
@@ -682,18 +779,20 @@
                     }
                     sWhere += " and " + ColName2 + " " + com2;
                 }
-            if (HDate) {
-                sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
-            }
-            if (HDate1) {
-                sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
-            }
-            if (HBillNo) {
-                sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
-            }
-            get_Display(sWhere);
-            //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
-            sWhere = "";
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                //get_Display(sWhere);
+                //鏁版嵁搴撳垎椤�
+                get_DisplayPage(sWhere);
+                //璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
+                sWhere = "";
 
         }
 
@@ -781,7 +880,7 @@
                 else {
                     layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
                 }
-            } 
+            }
 
             //闅愯棌鍒楄缃�
             function get_HideColumn() {
@@ -919,12 +1018,12 @@
             function addSWhereByOpenType() {
                 //鑾峰彇鍙傛暟
                 var params = getUrlVars();
-                var openType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鎵撳紑鏂瑰紡  1鐩存帴鎵撳紑 2鍏跺畠椤甸潰閫氳繃閫夋嫨鎸夐挳鎵撳紑  
+                var openType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鎵撳紑鏂瑰紡  1鐩存帴鎵撳紑 2鍏跺畠椤甸潰閫氳繃閫夋嫨鎸夐挳鎵撳紑
                 if (openType == 2) {
                     sWhere += " and  瀹℃牳浜� IS NOT NULL and 瀹℃牳浜� <> '' and (鍏抽棴浜� IS NULL OR 鍏抽棴浜� = '')  ";
                     form.render("select");
                     return true;
-                } 
+                }
             }
             //#endregion
 
@@ -1010,7 +1109,7 @@
                 for (var i = 0; i < Filter.length; i++) {
                     HFilterIdList = Filter[i].id; //杩囨护鏉′欢ID
                     HFilterIdLists += Filter[i].id + ","; //杩囨护鏉′欢ID(鎷兼帴)
-                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�                    
+                    HValue += $("#" + HFilterIdList).val() + ","; //杩囨护鏉′欢涓緭鍏ョ殑鍊�
                     HElement_type += document.getElementById(HFilterIdList).tagName + ",";//閫氳繃鏍囩id鑾峰彇鏍囩绫诲瀷
                 }
 

--
Gitblit v1.9.1