From 727ee25aeb5fcaf84e2cf009b2eacd3a86bcb3ca Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 28 十一月 2024 12:55:23 +0800
Subject: [PATCH] 新增 环境检测方案,环境检测单

---
 WebTM/views/质量管理/工序检验单/QC_ProcessCheckBillList2.html |  112 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 107 insertions(+), 5 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
index 740754d..9658b2e 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
@@ -221,6 +221,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" style="display:none;" id="set_AddNew" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
@@ -265,6 +266,8 @@
 
             var option = [];
             var sWhere = "";
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
             var HModName = "QC_ProcessCheckBillList";
 
             //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
@@ -274,7 +277,7 @@
             //#endregion
 
             //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
-            var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"];
+            var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID", "sorderid"];
 
             var sql = " ";
             //#endregion
@@ -408,9 +411,17 @@
             //#region 鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
                 if ($("#HProject").val() == 0) {
-                    get_FastQuery();
+                    if (page != 1) {
+                        $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                    } else {
+                        get_FastQuery();
+                    }
                 } else {
-                    get_FastQuery(2);
+                    if (page != 1) {
+                        $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                    } else {
+                        get_FastQuery(2);
+                    }
                 }
             });
             //#endregion
@@ -475,7 +486,7 @@
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
                     , height: 'full-50'
-                    , page: true
+                    , page: false
                     , sort: true  //閲嶇偣1锛氳繖閲岀殑sort琛ㄧず table琛ㄥ湪鍙栧緱鎺ュ彛鏁版嵁鍚庯紝瀵归〉闈㈡覆鏌撳悗鐨則able鏁版嵁杩涜鎺掑簭銆傚悓鏃讹紝杩欓噷鐨則rue 浼氬奖鍝嶉〉闈ort 涓婁笅灏忕澶寸殑 鏄剧ず鏁堟灉
                     , totalRow: true
                     //, cellMinWidth: 90
@@ -485,6 +496,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
             //#endregion  鐩戝惉缃戞牸琛ㄤ綋浜嬩欢
@@ -600,6 +629,77 @@
             }
             //#endregion
 
+            //#region 鍒嗛〉鏌ヨ
+            function get_DisplayPage(sqlWhere) {
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/QC_ProcessCheckMainBill/QC_ProcessCheckMainBillListPage',
+                    type: "GET",
+                    data: { "sWhere": sqlWhere, "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
 
             //#region 蹇�熻繃婊�
             function get_FastQuery(number) {
@@ -719,7 +819,9 @@
                         sqlWhere += " and 椤圭洰鍙� like '%" + HProject + "%'";
                     }
                 }
-                get_Display(sqlWhere);
+                //get_Display(sqlWhere);
+                //鏁版嵁搴撳垎椤垫煡璇�
+                get_DisplayPage(sqlWhere);
             }
             //#endregion
 

--
Gitblit v1.9.1