Ver Fonte

改为查询页面之后多选清空

002390 há 2 anos atrás
pai
commit
af5f25f08e
1 ficheiros alterados com 19 adições e 41 exclusões
  1. 19 41
      src/views/purchase/purchase-order/index.vue

+ 19 - 41
src/views/purchase/purchase-order/index.vue

@@ -52,18 +52,23 @@ export default {
     },
   },
   created() {
-    this.fetchList(this.params, this.page);
+    // this.fetchList(this.params, this.page);
+    this.handleRefreshList();
   },
   methods: {
     async fetchList(data, params) {
+
       try {
         this.loading = true;
         params['isAsc'] = 'desc';
         params['orderByColumn'] = 'updateTime';
         
         const { code, msg, rows, total } = await orderApi.list(data, params);
+
         if (code === 200) {
+
           this.page.total = total;
+
           this.tableData = rows;
         }
       } catch (err) {
@@ -86,13 +91,18 @@ export default {
     // 刷新操作
     handleRefreshList() {
       this.page = initPage();
+      this.checkedList = [];
+              
+      this.checkedTabList = [];
+
+      this.primaryResource = {};
       this.fetchList(this.params, this.page);
     },
     // 查询操作
     handleQueryList() {
       let {date} = this.params;
-        this.params.startDate = date ? date[0] :'';
-        this.params.endDate = date ? date[1] : '';
+      this.params.startDate = date ? date[0] :'';
+      this.params.endDate = date ? date[1] : '';
       this.fetchList(this.params, this.page);
     },
     // 重置操作
@@ -187,7 +197,8 @@ export default {
 
           if (code === 200) {
 
-            this.fetchList(this.params, this.page);
+            // this.fetchList(this.params, this.page);
+            this.handleRefreshList();
 
           }
         })
@@ -209,7 +220,8 @@ export default {
  
          if (code == 200) {
  
-           this.fetchList(this.params, this.page);
+          //  this.fetchList(this.params, this.page);
+          this.handleRefreshList();
  
          }
 
@@ -234,34 +246,6 @@ export default {
     handleAllReturn() {
 
       this.handleReturn(this.checkedList[0].id,[]);
-      // this.$prompt('请输入退回原因', '提示', {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     inputPattern: /\s*\S+?/,
-      //     inputErrorMessage: '退回原因不能为空'
-      //   }).then(async ({ value }) => {
-
-      //     let data = {
-      //       id: this.checkedList[0].id,
-      //       documentIds: [],
-      //       baskCause: value,
-      //     };
-
-      //     console.log(data);
-
-      //     try {
-
-      //       let { code, msg } = await orderApi.documentsReturn(data);
-
-      //       if (code === 200) {
-
-      //         this.fetchList(this.params, this.page);
-
-      //       }
-      //     } catch (error) {
-      //       console.log(error,'error------------');
-      //     }
-      //   }).catch(() => {   });
       
     },
      // 判断“行退回”按钮
@@ -308,13 +292,7 @@ export default {
 
             if (code === 200) {
 
-              this.fetchList(this.params, this.page);
-
-              this.checkedList = [];
-              
-              this.checkedTabList = [];
-
-              this.primaryResource = {};
+              this.handleRefreshList();
 
             }
           } catch (error) {
@@ -353,7 +331,7 @@ export default {
 
           if (code === 200) {
 
-            this.fetchList(this.params, this.page);
+            this.handleRefreshList();
 
           }
         })