Browse Source

物料档案列表启用停用成功之后取消勾选状态

002390 2 năm trước cách đây
mục cha
commit
d167be8938
1 tập tin đã thay đổi với 13 bổ sung3 xóa
  1. 13 3
      src/views/material/basicFile/index.vue

+ 13 - 3
src/views/material/basicFile/index.vue

@@ -27,7 +27,7 @@
               <el-dropdown-item :command="filterCondition('stop')">显示停用</el-dropdown-item>
               <el-dropdown-item :command="filterCondition('allot')">显示已分配</el-dropdown-item>
             </el-dropdown-menu>
-                                                                                                                                                                                            </el-dropdown> -->
+                                                                                                                                                                                                        </el-dropdown> -->
 
             <!-- <el-button size="small" @click="handleQuery">查询</el-button> -->
             <el-button size="small" @click="handleRefresh">刷新</el-button>
@@ -239,7 +239,12 @@ export default {
       if (this.checkedList.length) {
         let ids = this.checkedList.map(i => i.id);
         materialApi.delMaterial(ids).then(res => {
-          if (res.code == 200) this.handleRefresh();
+          if (res.code == 200) {
+            this.handleRefresh();
+            // 清空选中数据
+            this.checkedList = [];
+            this.$refs.materialTable.clearSelection();
+          }
         })
       } else {
         this.$message({
@@ -294,7 +299,12 @@ export default {
       console.log(param, '启用/停用param');
       materialApi.updateEnableMaterial(param).then(res => {
         console.log(res, '启用/停用');
-        if (res.code == 200) this.handleRefresh();
+        if (res.code == 200) {
+          this.handleRefresh();
+          // 清空选中数据
+          this.checkedList = [];
+          this.$refs.materialTable.clearSelection();
+        }
       })
 
     },