From d8990b6ab903f9e9ee6a8634e5b0f42e534445d5 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 九月 2024 20:57:25 +0800
Subject: [PATCH] 发货通知单:分页

---
 WebTM/views/销售管理/发货通知单/Xs_SeOutStockBillList.html |  163 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user |    4 
 2 files changed, 158 insertions(+), 9 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index a5ff2c2..8b87660 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -6699,7 +6699,7 @@
       <publishTime>09/19/2024 10:08:59</publishTime>
     </File>
     <File Include="views/閿�鍞鐞�/鍙戣揣閫氱煡鍗�/Xs_SeOutStockBillList.html">
-      <publishTime>09/11/2024 21:05:00</publishTime>
+      <publishTime>09/26/2024 20:56:41</publishTime>
     </File>
     <File Include="views/閿�鍞鐞�/鍙戣揣閫氱煡鍗�/Xs_SeOutStockBillQuery.html">
       <publishTime>09/19/2024 10:08:59</publishTime>
@@ -6807,7 +6807,7 @@
       <publishTime>09/23/2024 10:51:16</publishTime>
     </File>
     <File Include="views/閿�鍞鐞�/鍙戣揣閫氱煡鍗�/Xs_SeOutStockBillList.html">
-      <publishTime>09/11/2024 21:05:00</publishTime>
+      <publishTime>09/26/2024 20:56:41</publishTime>
     </File>
     <File Include="views/閿�鍞鐞�/閫�璐ч�氱煡鍗�/Xs_SeOutStockBackBillList.html">
       <publishTime>08/23/2024 15:38:54</publishTime>
diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\217\221\350\264\247\351\200\232\347\237\245\345\215\225/Xs_SeOutStockBillList.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\217\221\350\264\247\351\200\232\347\237\245\345\215\225/Xs_SeOutStockBillList.html"
index 74083ab..f9321f3 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\217\221\350\264\247\351\200\232\347\237\245\345\215\225/Xs_SeOutStockBillList.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\217\221\350\264\247\351\200\232\347\237\245\345\215\225/Xs_SeOutStockBillList.html"
@@ -195,10 +195,11 @@
                                         </div>
                                     </div>
                                 </div>
-                                    </div>
-                                </div>
-                         
+                            </div>
+                        </div>
+
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
+                        <div id="page" style="margin-top:30px;"></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-file-b"></i>鏂板</button>
@@ -246,9 +247,17 @@
                 , laydate = layui.laydate
                 , util = layui.util
                 , soulTable = layui.soulTable
+
+
+
+            var Organization = sessionStorage["Organization"];
+
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
+
             var HModName = "Xs_SeOutStockBill";
             var HBillType = "1402";
 
@@ -286,12 +295,22 @@
             form.on('submit(btnReSearch)', function (data) {
                 //娓呯┖杩囨护鏉′欢
                 set_ClearQuery();
+
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery(table, option);
+                }
             });
             //#endregion
 
             //#region 鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
-                get_FastQuery(table, option);
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery(table, option);
+                }
             });
             //#endregion
 
@@ -352,10 +371,10 @@
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
                     , height: 'full-50'
-                    , page: true
+                    //, page: true
                     , cellMinWidth: 90
                     , limit: 50
-                    , limits: [50, 500, 5000, 20000]
+                    //, limits: [50, 500, 5000, 20000]
                     , done: function (res, curr, count) {
                         soulTable.render(this);
                     }
@@ -427,6 +446,32 @@
 
                     ]]
                 };
+
+
+
+                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(table, option);
+                        }
+                    }
+                }
+                laypage.render(optionPage);
             }
 
             //#endregion  鐩戝惉缃戞牸琛ㄤ綋浜嬩欢
@@ -540,6 +585,104 @@
                     }
                 });
             }
+
+            //#region 鏌ヨ(涓昏〃)-鍒嗛〉
+            function get_DisplayPage(sWhere) {
+                var wait = layer.load();//閬僵
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/Xs_SeOutStockBill/list_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 = [];
+                            var totalArray = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            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', totalRowText: '鍚堣' });
+                            for (var i = 0; i < data.length; i++) {//閬嶅巻data鏁扮粍閲嶇殑鏁版嵁
+                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
+                                if ($.inArray(data[i].name, titleData) > -1) {//妫�鏌ata銆恑銆�.name鏄惁鍦ㄦ暟缁勪腑  //璁$畻鍒�
+                                    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: '鍗曟嵁鍙�', event: '鍗曟嵁鍙�', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.鍗曟嵁鍙� + '</span>'
+                                        }, style: 'cursor: pointer;'
+                                    });
+                                } 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 == "琛屽叧闂棩鏈�" ? "琛屽叧闂汉" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</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: 800
+                                //, page: true
+                                , totalRow: true
+                                , cellMinWidth: 90
+                                , limit: 50
+                                //, limits: [50, 500, 5000, 20000]
+                                , done: function (res, curr, count) {
+                                    soulTable.render(this);
+                                }
+                            }
+
+                            option.data = data1.data;
+                            table.render(option);
+
+                            laypage.render(optionPage);
+                            layer.close(ajaxLoad);
+
+                            DisPlay_HideColumn();
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            var btns = document.getElementsByTagName("button");     //鑾峰彇鏈〉鎵�鏈夋寜閽璞�
+                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
+
+
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
+
+                        } else {
+                            optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+                            laypage.render(optionPage);
+
+                            option.data = [];
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                            /*layer.alert(data1.code + data1.Message, { icon: 5 });*/
+                        }
+                    }, error: function (e) {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                layer.close(wait);
+            }
+            //#endregion
+
             //澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus(obj.config.id);
@@ -824,7 +967,8 @@
                     sWhere += " and 涓荤 like '%" + HMangerID + "%'";
                 }
                 sWhere += addSWhereByOpenType();
-                get_Display(sWhere);
+                //get_Display(sWhere);
+                get_DisplayPage(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
             }
             //#endregion
@@ -1314,6 +1458,10 @@
                             dataCol = data1.data[0].HGridString.split(',');
 
                             for (var i = 0; i < option.cols[0].length - 2; i++) {
+                                if (dataCol.length <= i) {
+                                    break;
+                                }
+
                                 var dataCols = dataCol[i].split('|');
                                 //闅愯棌鍒�
                                 if (dataCols[1] == 1) {
@@ -1410,6 +1558,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