修改新增企业 新增联系人组件 是否调用无权限接口
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
<script>
|
||||
import ContactManagementModule from '@views/businessManagement/modules/ContactManagementModule'
|
||||
import { getContactsByCompany } from '@api/api'
|
||||
import { getContactsByCompany,getContactsByCompanyNoLimit } from '@api/api'
|
||||
|
||||
export default {
|
||||
name: 'SelectContacts',
|
||||
@@ -66,6 +66,12 @@ export default {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'string'
|
||||
},
|
||||
// 是否调用无权限接口
|
||||
isLimit:{
|
||||
type:Boolean,
|
||||
required:false,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -115,15 +121,29 @@ export default {
|
||||
const params = {
|
||||
companyId: this.selectedCompany.id
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
getContactsByCompany(params).then(res => {
|
||||
this.contactsList = res.result
|
||||
if (this.initContacts && this.initContacts.hasOwnProperty.call(this.initContacts, 'id')) {
|
||||
this.contactsList.push(this.initContacts)
|
||||
}
|
||||
resolve()
|
||||
// 是否调用无权限接口
|
||||
if(this.isLimit){
|
||||
// 调用无权限接口
|
||||
return new Promise(resolve => {
|
||||
getContactsByCompanyNoLimit(params).then(res => {
|
||||
this.contactsList = res.result
|
||||
if (this.initContacts && this.initContacts.hasOwnProperty.call(this.initContacts, 'id')) {
|
||||
this.contactsList.push(this.initContacts)
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
})
|
||||
}else{
|
||||
return new Promise(resolve => {
|
||||
getContactsByCompany(params).then(res => {
|
||||
this.contactsList = res.result
|
||||
if (this.initContacts && this.initContacts.hasOwnProperty.call(this.initContacts, 'id')) {
|
||||
this.contactsList.push(this.initContacts)
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -131,7 +151,8 @@ export default {
|
||||
*/
|
||||
addContacts() {
|
||||
if (this.selectedCompany && Object.keys(this.selectedCompany).length > 0) {
|
||||
this.$refs.contactForm.add()
|
||||
// 传入是否调用无权限接口的参数 去判断
|
||||
this.$refs.contactForm.add(this.isLimit)
|
||||
this.$refs.contactForm.title = '新增'
|
||||
this.$refs.contactForm.disableSubmit = false
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user