选择企业组件修改;选择联系人组件;工作组项目页面;进度条组件
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<!-- 在点击组件时获取联系人列表-->
|
||||
<div>
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-select :value="value" v-bind="$attrs" v-on="$listeners">
|
||||
<a-select-option v-for="item in contactsList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-col>
|
||||
<a-col :span="4" class="form-btn">
|
||||
<a-button icon="plus" @click="addContacts"></a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<contact-management-module ref="contactForm"
|
||||
is-company-disabled
|
||||
:selected-company="selectedCompany"
|
||||
v-on="$listeners">
|
||||
</contact-management-module>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ContactManagementModule from '@views/businessManagement/modules/ContactManagementModule'
|
||||
import { getContactsByCompany } from '@api/api'
|
||||
|
||||
export default {
|
||||
name: 'SelectContacts',
|
||||
components: { ContactManagementModule },
|
||||
props: {
|
||||
// 已选中的企业信息
|
||||
selectedCompany: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
contactsList: [], // 该企业下联系人列表
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
* 选中企业发生变化时重新获取数据
|
||||
*/
|
||||
selectedCompany: {
|
||||
handler() {
|
||||
this.getContactsList()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取联系人数据
|
||||
*/
|
||||
getContactsList() {
|
||||
if (this.selectedCompany) {
|
||||
const params = {
|
||||
companyName: this.selectedCompany.companyName
|
||||
}
|
||||
getContactsByCompany(params).then(res => {
|
||||
this.contactsList = res.result
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 新建联系人
|
||||
*/
|
||||
addContacts() {
|
||||
if (this.selectedCompany) {
|
||||
this.$refs.contactForm.add()
|
||||
this.$refs.contactForm.title = '新增'
|
||||
this.$refs.contactForm.disableSubmit = false
|
||||
return
|
||||
}
|
||||
this.$message.warn('请先选择来款企业再为该企业新建联系人')
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-btn {
|
||||
padding-top: 1px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user