From 0f8844dcb400fcdee4ea7831336a6aff382a8cc2 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期六, 23 九月 2023 14:59:16 +0800
Subject: [PATCH] fix: 修复搜索供应商列表结果为空时产品列表不为空的bug, 修复产品列表翻页后搜索供应商时产品列表页码未重置的bug, 修复供应商列表/产品列表/采购订单/质检单/退货单翻页后再搜索页码未重置的bug

---
 src/views/supplierManage/supplier/index.vue |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/views/supplierManage/supplier/index.vue b/src/views/supplierManage/supplier/index.vue
index 985fb9a..0755ae7 100644
--- a/src/views/supplierManage/supplier/index.vue
+++ b/src/views/supplierManage/supplier/index.vue
@@ -280,7 +280,17 @@
           this.$nextTick(() => {
             this.$refs.tableSupplier.$refs.table.setCurrentRow(this.tableList.tableInfomation[0])
           })
-          this.getProductList()
+
+          // 閲嶆柊鑾峰彇渚涘簲鍟嗗垪琛ㄥ悗搴旇閲嶇疆浜у搧鍒楄〃椤电爜
+          this.productPagerOptions.currPage = 1;
+          // 濡傛灉渚涘簲鍟嗗垪琛ㄤ负绌�,鍒欏彲鎻愪緵浜у搧鍒楄〃涔熷簲涓虹┖
+          if (list.length){
+            this.getProductList()
+          }else {
+            this.productTableList.tableInfomation=[]
+            this.productPagerOptions.currPage = 1;
+            this.productPagerOptions.totalCount = 0
+          }
         }
       })
     },
@@ -306,10 +316,12 @@
     // 鎼滅储渚涘簲鍟�
     onFilterSearch(searchText){
       this.searchSupplierName = searchText ??''
+      this.pagerOptions.currPage = 1
       this.getSupplierList()
     },
     // 鎼滅储浜у搧
     onProductFilterSearch(searchText){
+      this.productPagerOptions.currPage = 1
       this.getProductList('name', searchText)
     },
     // 鏂板缓渚涘簲鍟�

--
Gitblit v1.8.0