lvhao 8 小時之前
父節點
當前提交
be8ad380fd
共有 2 個文件被更改,包括 35 次插入4 次删除
  1. 1 0
      core/CoreApp/controllers/Workshopshow.php
  2. 34 4
      template/erp/workshopshow_xdshow.html

+ 1 - 0
core/CoreApp/controllers/Workshopshow.php

@@ -249,6 +249,7 @@ class Workshopshow extends Start_Controller
             echo json_encode([
                 'code'=>-1,
                 'msg'=>"没有更多数据",
+                'page_able'=>0,
                 'data'=>[],
             ],JSON_UNESCAPED_UNICODE);
             die;

+ 34 - 4
template/erp/workshopshow_xdshow.html

@@ -580,8 +580,8 @@ h2 {
 
         <!-- 3. 分页组件 (独立一行) -->
         <div class="pagination-section">
-            <a href="#" class="page-btn">上一页</a>
-            <a href="#" class="page-btn">下一页</a>
+            <a href="#" id="syy" class="page-btn disabled" data-type="1" onclick="getOrderList(this)">上一页</a>
+            <a href="#" id="xyy" class="page-btn" data-type="2"  onclick="getOrderList(this)">下一页</a>
         </div>
     </div>
 
@@ -730,10 +730,15 @@ h2 {
     }
 
     //美国备货订单列表
-    function mgbhorders(){
+    function mgbhorders(type = 0){
         $.post("/workshopshow/mgbhorders",{page:page},function(res){
             if(res.code == 1){
-                page = page + 1;
+                if(type == 1){
+                    page = page -1;
+                }
+                if(type == 2){
+                    page = page + 1;
+                }
                 let tplStr = document.getElementById('edit_content').innerHTML;
                 //let outputHtml = compiledTemplate.fetch({ data: data });
                 let outputHtml =  ejs.render(tplStr, {data: res.data});
@@ -743,6 +748,31 @@ h2 {
             }
         },'json')
     }
+    function getOrderList(that){
+        let type = $(that).data("type");
+        if($(that).hasClass("disabled")){
+            if(type == 1){
+                layx.msg('已经是第一页了',{dialogIcon:'warn', position:'cc'});
+            }else{
+                layx.msg('已经是最后一页了',{dialogIcon:'warn', position:'cc'});
+            }
+            return ;
+        }
+
+        
+        if(type == 1){
+            let tmp_page = page - 1;
+            if(tmp_page <= 0){
+                layx.msg('已经是第一页了');
+                return;
+            }
+            page = tmp_page;
+
+        }else{
+            
+        }
+        mgbhorders(type);
+    }