Procházet zdrojové kódy

refactor(dealer): 清理冗余代码并统一搜索逻辑

yz před 1 měsícem
rodič
revize
069507b081
1 změnil soubory, kde provedl 3 přidání a 24 odebrání
  1. 3 24
      src/mixins/dealer/dealerInventoryIndex.js

+ 3 - 24
src/mixins/dealer/dealerInventoryIndex.js

@@ -146,7 +146,7 @@ export default {
           ...this.searchForm
         }
 
-        const response= await getInventoryList(params)
+        const response = await getInventoryList(params)
 
         if (response.data && response.data.success) {
           const { records, total } = response.data.data
@@ -269,16 +269,8 @@ export default {
      * @returns {void}
      */
     searchChange(params) {
-    //   Object.assign(this.searchForm, params)
-    //   this.handleSearch()
       Object.assign(this.searchForm, params)
-      this.pagination.currentPage = 1
-      this.loadTableData().finally(() => {
-        // 调用done回调函数,通知avue-crud搜索完成
-        if (typeof done === 'function') {
-          done()
-        }
-      })
+      this.handleSearch()
     },
 
     /**
@@ -286,20 +278,7 @@ export default {
      * @returns {void}
      */
     searchReset() {
-    //   this.handleResetSearch()
-      this.searchForm = {
-        customerCode: '',
-        customerName: '',
-        itemCode: '',
-        itemName: ''
-      }
-      this.pagination.currentPage = 1
-      this.loadTableData().finally(() => {
-        // 调用done回调函数,通知avue-crud重置完成
-        if (typeof done === 'function') {
-          done()
-        }
-      })
+      this.handleResetSearch()
     },
 
     /**