ソースを参照

feat: 添加选择对话框关闭时清空选择功能

xieyong 2 日 前
親
コミット
bddc3dfd99

+ 11 - 1
src/views/bpm/handleTask/components/qualityReportApproval/unqualifiedProduct.vue

@@ -305,8 +305,10 @@
       width="60%"
       append-to-body
       title="选择"
+      @close="closeAdd"
     >
       <el-table
+        ref="addTable"
         :data="inventoryList"
         @selection-change="handleAddSelectionChange"
         row-key="id"
@@ -920,11 +922,19 @@
       },
       add() {
         this.addDialogVisible = true;
-        this.addSelection = [];
+        this.$nextTick(() => {
+          this.$refs.addTable?.clearSelection();
+        });
         if (this.inventoryList.length === 1) {
           this.singleQuantity = this.inventoryList[0].measureQuantity || 0;
         }
       },
+      closeAdd() {
+        this.addSelection = [];
+        this.$nextTick(() => {
+          this.$refs.addTable?.clearSelection();
+        });
+      },
 
       // /* 表格数据源 */
       async datasource() {