408249787 преди 2 години
родител
ревизия
0d9c6a1ba5
променени са 2 файла, в които са добавени 11 реда и са изтрити 10 реда
  1. 2 1
      src/views/fill/gather/modules/CreateTaskForm.vue
  2. 9 9
      src/views/fill/gather/modules/SbInfoSelectModal.vue

+ 2 - 1
src/views/fill/gather/modules/CreateTaskForm.vue

@@ -219,7 +219,7 @@ export default {
       })
     },
     handleSbSelect () {
-      this.$refs.sbInfoSelectModal.base({}, {})
+      this.$refs.sbInfoSelectModal.base({}, this.sbIds)
     },
     handleInfoSelect () {
       this.$refs.infoSelectModal.base(this.model)
@@ -263,6 +263,7 @@ export default {
     handleCancel (values) {
       this.visible = false
       this.form.resetFields()
+      this.sbIds = []
       this.$emit('ok', values)
     }
 

+ 9 - 9
src/views/fill/gather/modules/SbInfoSelectModal.vue

@@ -217,7 +217,7 @@ export default {
     }
   },
   created () {
-    this.tableOption()
+    // this.tableOption()
     this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
@@ -274,8 +274,8 @@ export default {
       this.$refs.table.refresh()
     },
     onSelectChange (selectedRowKeys, selectedRows) {
-      this.selectedRowKeys = Array.from(new Set([...selectedRowKeys, ...this.selectedRowKeys]))
-      this.selectedRows = Array.from(new Set([...selectedRows, ...this.selectedRows]))
+      this.selectedRowKeys = Array.from(new Set([...selectedRowKeys]))
+      this.selectedRows = Array.from(new Set([...selectedRows]))
     },
     resetSearchForm () {
       this.queryParam = {
@@ -293,17 +293,15 @@ export default {
         this.treeData = res.data
       })
     },
-    base (record, queryParam = {}) {
+    base (record, keys) {
       this.visible = true
       this.modalTitle = '选择设备'
-      this.extraQueryParam = queryParam
       if (this.isCreated) {
-        console.log(this.$refs.table)
-        this.$refs.table.clearSelected()
+        if (keys.length === 0) this.$refs.table.clearSelected()
         this.options.rowSelection.type = this.type
         this.handleOk()
       } else {
-        this.tableOption()
+        // this.tableOption()
         this.isCreated = true
       }
       // this.mySelect(this.selectedRowKeys, this.selectedRows)
@@ -319,13 +317,15 @@ export default {
         this.confirmLoading = true
         this.$emit('selected', this.selectedRowKeys, this.selectedRows)
         this.confirmLoading = false
+        this.queryParam = {
+        }
         this.visible = false
         this.selectedRowKeys = []
         this.selectedRows = []
       }
     },
     mySelect (selectedRowKeys, selectedRows) {
-      this.$refs.table.updateSelect([...selectedRowKeys, ...this.selectedRowKeys], [...selectedRows, ...this.selectedRows])
+      this.$refs.table.updateSelect([...selectedRowKeys], [...selectedRows])
       this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
     }
   }