From d85d1e2cc42e45ffb99f48a438c8cf9acb49bab1 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 九月 2024 11:24:21 +0800
Subject: [PATCH] 工序进站接收单维护:分页

---
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user  |    4 
 WebTM/views/车间管理/工序进站接收单/Cj_StationInBillList.html |  150 +++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 145 insertions(+), 9 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index 7ee84d1..6e08eea 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -6321,13 +6321,13 @@
       <publishTime>06/13/2024 14:47:29</publishTime>
     </File>
     <File Include="views/杞﹂棿绠$悊/宸ュ簭杩涚珯鎺ユ敹鍗�/Cj_StationInBillList.html">
-      <publishTime>07/15/2024 09:58:59</publishTime>
+      <publishTime>09/26/2024 11:19:07</publishTime>
     </File>
     <File Include="views/杞﹂棿绠$悊/宸ュ簭杩涚珯鎺ユ敹鍗�/Cj_StationInBill.html">
       <publishTime>06/13/2024 14:47:29</publishTime>
     </File>
     <File Include="views/杞﹂棿绠$悊/宸ュ簭杩涚珯鎺ユ敹鍗�/Cj_StationInBillList.html">
-      <publishTime>07/15/2024 09:58:59</publishTime>
+      <publishTime>09/26/2024 11:19:07</publishTime>
     </File>
     <File Include="views/杞﹂棿绠$悊/宸ュ簭杩涚珯鎺ユ敹鍗�/Cj_StationInBillList_QiaoYi.html">
       <publishTime>01/08/2024 14:40:30</publishTime>
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\350\277\233\347\253\231\346\216\245\346\224\266\345\215\225/Cj_StationInBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\350\277\233\347\253\231\346\216\245\346\224\266\345\215\225/Cj_StationInBillList.html"
index b84a6ef..356716c 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\350\277\233\347\253\231\346\216\245\346\224\266\345\215\225/Cj_StationInBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\350\277\233\347\253\231\346\216\245\346\224\266\345\215\225/Cj_StationInBillList.html"
@@ -55,10 +55,10 @@
                                         <input type="date" class="layui-input ForFilteringSchemes" id="HEndDate" style="width:190px;">
                                     </div>
                                 </div>
-                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" style="display:none;" 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" style="margin-left:5px;">
                                     <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393" id="HFilterScheme_Now"></div>
@@ -166,6 +166,7 @@
                             </div>
                         </div>
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
+                        <div id="page"></div>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
@@ -212,9 +213,14 @@
                 , laydate = layui.laydate
                 , util = layui.util
                 , soulTable = layui.soulTable
+
+            var Organization = sessionStorage["Organization"];
             //鍏敤鍙橀噺
             var sWhere = "";
             var option = [];
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
+
             var ins;                        //鐢ㄤ簬瀵煎嚭excel
             var HModName = "Cj_StationInBillList";
             var titleData = ["hmainid", "HProcID", "HMaterID", "HEmpID", "HSourceID", "HGroupID", "HInterID", "HProcExchInterID", "HProcExchEntryID", "HICMOInterID", "HICMOEntryID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
@@ -252,11 +258,21 @@
             //閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
                 set_ClearQuery();
+
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery();
+                }
             });
 
             //鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
-                get_FastQuery();
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery();
+                }
             });
 
             //#region 閫夋嫨鐢熶骇杞﹂棿鎸夐挳
@@ -448,12 +464,12 @@
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
                     , defaultToolbar: ['filter', 'exports', 'print']
-                    , height: 'full-50'
-                    , page: true
+                    , height: 'full-80'
+                    //, page: true
                     , totalRow: true
                     , cellMinWidth: 90
                     , limit: 50
-                    , limits: [50, 500, 5000, 20000]
+                    //, limits: [50, 500, 5000, 20000]
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
                         , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
@@ -493,6 +509,32 @@
                         none: '鏃犳暟鎹紒'
                     }
                 };
+
+                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);
+
+
                 set_ClearQuery();
                 get_FastQuery();
             }
@@ -608,6 +650,96 @@
                 layer.close(wait);
             }
 
+            //#region 鏌ヨ-鍒嗛〉
+            function get_DisplayPage(sWhere) {
+                var wait = layer.load();//閬僵
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/Cj_StationInBill/get_Display_byPage',
+                    type: "GET",
+                    async:false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization, "page": page, "size": size, "HBillSubType": "3790" },
+                    success: function (data1) {
+                        option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+                        if (data1.count != 0) {
+                            optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+                            var totalArray = ["LOT鏁伴噺", "鎺ユ敹鏁伴噺", "娴佽浆鍗℃暟閲�"];
+                            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 });
+                            }
+                            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+                            col.push({ type: 'checkbox', fixed: 'left' });
+                            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 if ($.inArray(data[i].name, totalArray) > -1) {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
+                                } else if (data[i].name == '鍗曟嵁鍙�') {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '鍗曟嵁鍙�' });
+                                }
+                                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;
+                                        default:
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                    }
+                                }
+                            }
+
+                            //鍔ㄦ�佹樉绀哄垪鍚�
+                            option = {
+                                elem: '#mainTable'
+                                , toolbar: '#toolbarDemo'
+                                , cols: [col]
+                                , data: data1.data
+                                , height: 'full-80'
+                                //, page: true
+                                , totalRow: true
+                                , cellMinWidth: 90
+                                , limit: 50
+                                //, limits: [50, 500, 5000, 20000]
+                                , done: function (res, curr, count) {
+                                    soulTable.render(this);
+                                }
+                            }
+                            ins = table.render(option);
+
+                            laypage.render(optionPage);
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn();
+
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            Display_HideButton(btns, "3790", HModName, sessionStorage["HUserName"]);
+
+                            layer.close(ajaxLoad);
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+                        } 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
+
+
             //蹇�熻繃婊�
             function get_FastQuery() {
                 //鍒ゆ柇鏄惁涓轰笅鏌ユ搷浣滐紝鑻ユ槸鍒欏彉鏇存煡璇㈠崟鍙峰拰鏃堕棿杩囨护鏉′欢
@@ -709,7 +841,10 @@
                     }
                 }
                 sWhere += "  and HBillSubType<>'SUB'";
-                get_Display(sWhere);
+                //get_Display(sWhere);
+
+                get_DisplayPage(sWhere);
+
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
             }
 
@@ -895,6 +1030,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