From 92b75271be9decbafcd988c6125f16821cd5e111 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 九月 2024 14:49:01 +0800
Subject: [PATCH] 生产订单:分页

---
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user |    2 
 WebTM/views/生产管理/生产任务单/Sc_ICMOBillList.html       |  173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 164 insertions(+), 11 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index f3702f7..3b585ad 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -4731,7 +4731,7 @@
       <publishTime>04/11/2023 16:34:43</publishTime>
     </File>
     <File Include="views/鐢熶骇绠$悊/鐢熶骇浠诲姟鍗�/Sc_ICMOBillList.html">
-      <publishTime>09/19/2024 10:08:59</publishTime>
+      <publishTime>09/26/2024 14:47:33</publishTime>
     </File>
     <File Include="views/鐢熶骇绠$悊/鐢熶骇浠诲姟鍗�/Sc_ICMOBillList_LookDown.html">
       <publishTime>03/07/2024 10:26:24</publishTime>
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
index 1262bed..297f90c 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
@@ -96,10 +96,10 @@
                                             <input type="text" class="layui-input ForFilteringSchemes" name="WorkCenter" id="WorkCenter">
                                         </div>
                                     </div>
-                                    <button class="layui-btn layuiadmin-btn-order" style="display:none;" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                                    <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>
                                     </button>
-                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px;display:none;">閲嶇疆</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-inline">
@@ -255,6 +255,7 @@
                             </div>
                         </div>
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
+                        <div id="page" style="margin-top:70px;"></div>
                         <script type="text/html" id="toolbarDemo">
                             <!--<div class="layui-btn-container">
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>涓嬫帹</button>
@@ -342,6 +343,11 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , soulTable = layui.soulTable
+
+
+            var Organization = sessionStorage["Organization"];
+
+
             var sWhere = "";
             var sWhere = "";
             var HModName = "Sc_ICMOBillList";
@@ -350,6 +356,10 @@
             var params = getUrlVars();
             var HDeptID = params[params[0]];
             var option = [];
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
+
+
             var ins;                        //鐢ㄤ簬瀵煎嚭excel
             var titleData = ["hmainid", "HEntryID", "浣滃簾浜�", "浣滃簾鏃ユ湡", "閿�鍞鍗曟棩鏈�", "璁㈠崟璺熻釜鍙�", "HDeptID", "HMaterID", "hunitid", "hempid", "涓氬姟鍛樹唬鐮�", "涓氬姟鍛�", "hcusid", "瀹㈡埛浠g爜", "瀹㈡埛", "HCenterID", "宸ヤ綔涓績浠g爜", "宸ヤ綔涓績", "hbomid", "BOM鍗曠紪鐮�", "HRoutingInterID", "宸ヨ壓璺嚎浠g爜", "璁㈠崟鍖呰澶囨敞", "hsubid", "婧愬崟鍗曞彿", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "琛屽叧闂汉", "鍏抽棴绫诲瀷", "鍗曟嵁绫诲瀷", "璁″垝璺熻釜鍙�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
             //var titleData = ["hmainid", "HEntryID", "浣滃簾浜�", "浣滃簾鏃ユ湡", "閿�鍞鍗曟棩鏈�", "璁㈠崟璺熻釜鍙�", "HDeptID", "HMaterID", "hunitid", "hempid", "涓氬姟鍛樹唬鐮�", "涓氬姟鍛�", "hcusid", "瀹㈡埛浠g爜", "瀹㈡埛", "HCenterID", "宸ヤ綔涓績浠g爜", "宸ヤ綔涓績", "hbomid", "BOM鍗曠紪鐮�", "HRoutingInterID", "宸ヨ壓璺嚎浠g爜", "宸ヨ壓璺嚎", "璁㈠崟鍖呰澶囨敞", "hsubid", "婧愬崟鍗曞彿", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "琛屽叧闂汉", "鍏抽棴绫诲瀷", "鍗曟嵁绫诲瀷", "璁″垝璺熻釜鍙�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
@@ -558,16 +568,29 @@
             form.on('submit(btnReSearch)', function (data) {
                 set_ClearQuery();
 
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    if ($("#HProject").val() == 0) {
+                        get_FastQuery(2);
+                    } else {
+                        get_FastQuery(3);
+                    }
+                }
+
             });
 
             //鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅
-                if ($("#HProject").val() == 0) {
-                    get_FastQuery(2);
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
                 } else {
-                    get_FastQuery(3);
+                    if ($("#HProject").val() == 0) {
+                        get_FastQuery(2);
+                    } else {
+                        get_FastQuery(3);
+                    }
                 }
-              
             });
 
             //#region 鏃ユ湡闂撮殧涓嬫媺鍒楄〃鐩戝惉
@@ -758,12 +781,12 @@
                 option = {
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
-                    , height: 'full-50'
-                    , page: true
+                    , height: 'full-80'
+                    //, page: true
                     , cellMinWidth: 'auto'
                     , totalRow: true
                     , limit: 50
-                    , limits: [50, 500, 5000, 20000]
+                    //, limits: [50, 500, 5000, 20000]
                     , done: function (res, curr, count) {
                         soulTable.render(this);
                     }
@@ -855,6 +878,33 @@
                         , { field: '鐗╂枡鍒嗙被', title: '鐗╂枡鍒嗙被', sort: 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) {
+                        //console.log(obj)
+                        //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛�
+                        //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆�
+                        //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁�
+
+                        //棣栨涓嶆墽琛�
+                        if (!first) {
+                            //do something
+                            console.log(obj)
+                            page = obj.curr;
+                            size = obj.limit;
+                            get_FastQuery();
+                        }
+                    }
+                }
+                laypage.render(optionPage);
+
+
             }
             //#endregion  鐩戝惉缃戞牸琛ㄤ綋浜嬩欢
             table.on('tool(mainTable)', function (obj) {
@@ -1028,6 +1078,105 @@
             }
             //#endregion
 
+            //#region 鏌ヨ-鍒嗛〉
+            function get_DisplayPage(sWhere) {
+                var wait = layer.load();//閬僵
+                var ajaxLoad = layer.load();
+                sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " ";
+                $.ajax({
+                    url: GetWEBURL() + '/LEMS/MES_IF_ICMOBillList_Json_byPage',
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization, "page": page, "size": size },
+                    success: function (data1) {
+                        option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+                        if (data1.count != 0) {
+                            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 (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
+                                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: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
+                                            break;
+                                        case 'long':
+                                        case 'Int32':
+                                        case 'Int64':
+                                        case 'double':
+                                        case 'Decimal':
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
+                                            break;
+                                        default:
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                    }
+                                }
+                            }
+
+                            //鍔ㄦ�佹樉绀哄垪鍚�
+                            option = {
+                                elem: '#mainTable'
+                                , toolbar: '#toolbarDemo'
+                                , totalRow: true
+                                , cols: [col]
+                                , data: data1.data
+                                , height: 'full-120'
+                                //, page: true
+                                //, limits: [50, 500, 5000, 50000]
+                                , limit: 500
+                                , cellMinWidth: 90
+                                , done: function (res, curr, count) {
+                                    soulTable.render(this);
+                                }
+                            }
+                            ins = table.render(option);
+
+                            laypage.render(optionPage);
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn();
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            var HBillType = "3710";
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "" && $("#Comparator1").val() == 0 && $("#ColContent1").val() == "" && $("#Comparator2").val() == 0 && $("#ColContent2").val() == "") {
+                                ColFilter();
+                            }
+
+                            layer.close(ajaxLoad);
+                        } else {
+                            option.data = [];
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                            /*layer.alert(data1.code + data1.Message, { icon: 5 });*/
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                layer.close(wait);
+            }
+            //#endregion
+
             //#region 蹇�熻繃婊�
             function get_FastQuery(number) {
                 var HDate = $("#HDate").val();;//寮�濮嬫棩鏈�
@@ -1188,7 +1337,10 @@
                 //鏍规嵁鐢ㄦ埛杩囨护鐢ㄦ埛鍏宠仈瀹㈡埛鐨勮褰�
                 sWhere += getSWhereByHUser();
 
-                get_Display(sWhere);
+                //get_Display(sWhere);
+
+                get_DisplayPage(sWhere);
+
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
                 GetDataCols = "";
             }
@@ -2464,6 +2616,7 @@
                 $.ajax({
                     url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                     type: "GET",
+                    async: false,
                     data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
                     success: function (data1) {
                         if (data1.count == 1) {

--
Gitblit v1.9.1