【修改】下拉框两个人的bug

This commit is contained in:
fengachen
2022-11-01 16:44:22 +08:00
parent 549b9ccd06
commit 2ec6fa0716
+6 -7
View File
@@ -119,6 +119,7 @@ export default {
* 获取联系人数据 * 获取联系人数据
*/ */
getContactsList() { getContactsList() {
this.contactsList = []
let params = {} let params = {}
if (this.selectedCompany && this.selectedCompany.id) { if (this.selectedCompany && this.selectedCompany.id) {
params.companyId = this.selectedCompany.id params.companyId = this.selectedCompany.id
@@ -188,17 +189,15 @@ export default {
* 第一次展开下拉,去掉和初始联系人一样的联系人 * 第一次展开下拉,去掉和初始联系人一样的联系人
*/ */
handleDropdownOpen() { handleDropdownOpen() {
this.getContactsList() // this.getContactsList()
if (this.isFirstOpen && this.initContacts && this.initContacts.id) { if (this.isFirstOpen && this.initContacts && this.initContacts.id) {
this.contactsList.forEach((item, index) => { let delIndex = this.contactsList.findIndex(e => {
if (item.id === this.initContacts.id) { e.id === this.initContacts.id
this.$emit('change', undefined)
this.contactsList.splice(index, 1)
}
}) })
this.contactsList.splice(delIndex,1)
this.isFirstOpen = false this.isFirstOpen = false
} }
} },
}, },
model: { model: {
prop: 'value', prop: 'value',