Browse Source

Merge branch 'develop_szhj' of jianguan-web/qpls-md-html into develop

陈瑞 3 years ago
parent
commit
21b0ec8719

+ 10 - 9
src/components/Table/index.js

@@ -253,6 +253,7 @@ export default {
         selectedRowKeys: this.selectedRowKeys,
         selectedRows: this.selectedRows
       }
+      console.log(obj)
       this.$emit('rowSelection', obj)
     },
     onSelectChange (record, selected, selectedRows, nativeEvent) {
@@ -275,17 +276,17 @@ export default {
       if (selected) { //  选择
         this.selectedRows = [...this.selectedRows, ...changeRows]
       } else { //  取消
-        const arrId = []
-        this.selectedRows.map((item, index) => {
-          this.selectedRows.map((subItem, ind) => {
-            if (item[this.rowKeyName] == subItem[this.rowKeyName]) {
-              arrId.push(index)
-            }
-          })
+        const arrIds = []
+        changeRows.map((item, index) => {
+          arrIds.push(item[this.rowKeyName])
         })
-        arrId.map((item, index) => {
-          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        const arrs = []
+        this.selectedRows.map((item, index) => {
+          if (arrIds.indexOf(item[this.rowKeyName]) == -1) {
+            arrs.push(item)
+          }
         })
+        this.selectedRows = arrs
       }
       this.updateSelect()
     },

+ 7 - 3
src/views/numsGoodsShelves/shelfSet/basicInfoModal.vue

@@ -114,9 +114,13 @@ export default {
         if (this.nowData.customerSn) {
           const _this = this
           this.$nextTick(() => {
-            _this.form.customerSn = _this.nowData.customerSn
-            _this.$refs.custList.fetchUser(_this.nowData.customerName)
-            _this.$refs.custList.dealerName = { key: _this.nowData.customerSn, label: _this.nowData.customerName, row: _this.nowData }
+            _this.form.customerSn = _this.nowData.customerEntity && _this.nowData.customerEntity.customerSn
+            _this.$refs.custList.fetchUser(_this.nowData.customerEntity && _this.nowData.customerEntity.customerName)
+            _this.$refs.custList.dealerName = {
+              key: _this.nowData.customerEntity && _this.nowData.customerEntity.customerSn,
+              label: _this.nowData.customerEntity && _this.nowData.customerEntity.customerName,
+              row: _this.nowData
+            }
           })
         }
       }