whj %!s(int64=2) %!d(string=hai) anos
pai
achega
373fc6d41d

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

@@ -181,6 +181,8 @@ export default {
       ipqcMap: [],
       model: {},
       sbIds: [],
+      rows: [],
+      sortNums: [],
       directorMap: [],
       infoNum: 0,
       confirmLoading: false
@@ -219,13 +221,17 @@ export default {
       })
     },
     handleSbSelect () {
-      this.$refs.sbInfoSelectModal.base({}, this.sbIds)
+      this.$refs.sbInfoSelectModal.base({}, this.sbIds, this.rows)
     },
     handleInfoSelect () {
       this.$refs.infoSelectModal.base(this.model)
     },
     handleSbSelectd (keys, rows) {
+      console.log(keys, rows)
       this.sbIds = keys
+      this.rows = rows
+      this.sortNums = rows.map(item => item.sortNum)
+      console.log(this.sortNums)
     },
     save () {
       const { form: { validateFieldsAndScroll } } = this
@@ -242,6 +248,8 @@ export default {
           return
         }
         values.sbIds = this.sbIds
+        values.sortNums = this.sortNums
+
         console.log(values)
         addFillTasks(values).then(res => {
           // this.$message.success('创建成功!')

+ 4 - 2
src/views/fill/gather/modules/SbInfoSelectModal.vue

@@ -275,7 +275,7 @@ export default {
     },
     onSelectChange (selectedRowKeys, selectedRows) {
       this.selectedRowKeys = Array.from(new Set([...selectedRowKeys]))
-      this.selectedRows = Array.from(new Set([...selectedRows]))
+      this.selectedRows = Array.from(new Set([...this.selectedRows, ...selectedRows]))
     },
     resetSearchForm () {
       this.queryParam = {
@@ -293,7 +293,8 @@ export default {
         this.treeData = res.data
       })
     },
-    base (record, keys) {
+    base (record, keys, rows) {
+      console.log(keys, rows)
       this.visible = true
       this.modalTitle = '选择设备'
       if (keys.length === 0) this.$refs.table.clearSelected()
@@ -310,6 +311,7 @@ export default {
         this.$message.warn('请至少选择一项信息')
       } else {
         this.confirmLoading = true
+        this.selectedRows = this.selectedRows.filter(item => this.selectedRowKeys.includes(item.id))
         this.$emit('selected', this.selectedRowKeys, this.selectedRows)
         this.confirmLoading = false
         this.queryParam = {

+ 1 - 0
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -532,6 +532,7 @@ export default {
       this.$refs.spareStoreSelectModal.base()
     },
     handleSpareStoreSelected (record, keys, rows) {
+      console.log(rows)
       const { data } = this
       for (let i = 0; i < rows.length; i++) {
         let find = false

+ 23 - 20
src/views/store/sparestore/modules/SpareStoreSelectModalYY.vue

@@ -197,7 +197,6 @@ export default {
       },
       selectedRowKeys: [],
       selectedRows: [],
-
       options: {
         alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
         rowSelection: {
@@ -235,21 +234,21 @@ export default {
                 name: record.id
               }
             })
-          },
-          customRow: (record) => {
-            return {
-              on: { // 事件
-                click: (event) => { // 点击行
-                  // 选择对象
-                  this.mySelect([record.id], [record])
-                },
-                dblclick: (event) => {
-                  this.mySelect([record.id], [record])
-                  this.handleSelect()
-                }
-              }
-            }
           }
+          // customRow: (record) => {
+          //   return {
+          //     on: { // 事件
+          //       click: (event) => { // 点击行
+          //         // 选择对象
+          //         this.mySelect([record.id], [record])
+          //       },
+          //       dblclick: (event) => {
+          //         this.mySelect([record.id], [record])
+          //         this.handleSelect()
+          //       }
+          //     }
+          //   }
+          // }
         }
         this.optionAlertShow = true
       } else {
@@ -264,8 +263,8 @@ export default {
       this.$refs.table.refresh()
     },
     onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRows = [...new Set([...this.selectedRows, ...selectedRows])]
       this.selectedRowKeys = selectedRowKeys
-      this.selectedRows = selectedRows
     },
     resetSearchForm () {
       this.queryParam = {
@@ -307,15 +306,19 @@ export default {
         if (this.record !== null) {
           this.record.isSpecial = this.isSpecial
         }
+        this.selectedRows = this.selectedRows.filter(item => this.selectedRowKeys.includes(+item.id))
         this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
         this.confirmLoading = false
         this.visible = false
       }
     },
-    mySelect (selectedRowKeys, selectedRows) {
-      this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
-      this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
-    },
+    // mySelect (selectedRowKeys, selectedRows) {
+    //   this.selectedRowKeys = selectedRowKeys
+    //   this.selectedRows = selectedRows
+    //   console.log(this.selectedRowKeys, this.selectedRows)
+    //   this.$refs.table.updateSelect(this.selectedRowKeys, this.selectedRows)
+    //   this.$refs.table.rowSelection.onChange(this.selectedRowKeys, this.selectedRows)
+    // },
     onSelect: function (selectedKeys, info) {
       this.selectedKeys = selectedKeys
       this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''