CRM-联系人:完善联系人转移、数据权限
This commit is contained in:
parent
5adf75d15b
commit
a64d4240a3
@ -1,4 +1,5 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
import { TransferReqVO } from '@/api/crm/customer'
|
||||||
|
|
||||||
export interface ContactVO {
|
export interface ContactVO {
|
||||||
name: string
|
name: string
|
||||||
@ -85,3 +86,8 @@ export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
|
|||||||
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
|
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
|
||||||
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
|
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 联系人转移
|
||||||
|
export const transfer = async (data: TransferReqVO) => {
|
||||||
|
return await request.put({ url: '/crm/contact/transfer', data })
|
||||||
|
}
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<!-- 右上:按钮 -->
|
<!-- 右上:按钮 -->
|
||||||
<el-button @click="openForm('update', contact.id)" v-hasPermi="['crm:contact:update']">
|
<slot></slot>
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -32,18 +30,10 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
|
||||||
<ContactForm ref="formRef" @success="emit('refresh')" />
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
import ContactForm from '@/views/crm/contact/ContactForm.vue'
|
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
//操作修改
|
|
||||||
const formRef = ref()
|
|
||||||
const openForm = (type: string, id?: number) => {
|
|
||||||
formRef.value.open(type, id)
|
|
||||||
}
|
|
||||||
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
|
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
|
||||||
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<ContactDetailsHeader :contact="contact" :loading="loading" @refresh="getContactData(id)" />
|
<ContactDetailsHeader v-loading="loading" :contact="contact">
|
||||||
|
<el-button v-if="permissionListRef?.validateWrite" @click="openForm('update', contact.id)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="permissionListRef?.validateOwnerUser" type="primary" @click="transfer">
|
||||||
|
转移
|
||||||
|
</el-button>
|
||||||
|
</ContactDetailsHeader>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-tabs>
|
<el-tabs>
|
||||||
<el-tab-pane label="详细资料">
|
<el-tab-pane label="详细资料">
|
||||||
@ -8,8 +15,14 @@
|
|||||||
<el-tab-pane label="操作日志">
|
<el-tab-pane label="操作日志">
|
||||||
<OperateLogV2 :log-list="logList" />
|
<OperateLogV2 :log-list="logList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="团队成员" lazy>
|
<el-tab-pane label="团队成员">
|
||||||
<PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" />
|
<PermissionList
|
||||||
|
ref="permissionListRef"
|
||||||
|
:biz-id="contact.id!"
|
||||||
|
:biz-type="BizTypeEnum.CRM_CONTACT"
|
||||||
|
:show-action="!permissionListRef?.isPool || false"
|
||||||
|
@quit-team="close"
|
||||||
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="商机" lazy>
|
<el-tab-pane label="商机" lazy>
|
||||||
<BusinessList
|
<BusinessList
|
||||||
@ -20,6 +33,9 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ContactForm ref="formRef" @success="getContactData" />
|
||||||
|
<CrmTransferForm ref="crmTransferFormRef" @success="close" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
@ -31,6 +47,8 @@ import PermissionList from '@/views/crm/permission/components/PermissionList.vue
|
|||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
import { OperateLogV2VO } from '@/api/system/operatelog'
|
import { OperateLogV2VO } from '@/api/system/operatelog'
|
||||||
import { getOperateLogPage } from '@/api/crm/operateLog'
|
import { getOperateLogPage } from '@/api/crm/operateLog'
|
||||||
|
import ContactForm from '@/views/crm/contact/ContactForm.vue'
|
||||||
|
import CrmTransferForm from '@/views/crm/permission/components/TransferForm.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmContactDetail' })
|
defineOptions({ name: 'CrmContactDetail' })
|
||||||
|
|
||||||
@ -49,6 +67,18 @@ const getContactData = async (id: number) => {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** 编辑 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
/** 联系人转移 */
|
||||||
|
const crmTransferFormRef = ref<InstanceType<typeof CrmTransferForm>>() // 联系人转移表单 ref
|
||||||
|
const transfer = () => {
|
||||||
|
crmTransferFormRef.value?.open('联系人转移', contact.value.id, ContactApi.transfer)
|
||||||
|
}
|
||||||
|
|
||||||
|
const permissionListRef = ref<InstanceType<typeof PermissionList>>() // 团队成员列表 Ref
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取操作日志
|
* 获取操作日志
|
||||||
@ -64,14 +94,16 @@ const getOperateLog = async (contactId: number) => {
|
|||||||
})
|
})
|
||||||
logList.value = data.list
|
logList.value = data.list
|
||||||
}
|
}
|
||||||
|
const close = () => {
|
||||||
|
delView(unref(currentRoute))
|
||||||
|
}
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
const { delView } = useTagsViewStore() // 视图操作
|
const { delView } = useTagsViewStore() // 视图操作
|
||||||
const { currentRoute } = useRouter() // 路由
|
const { currentRoute } = useRouter() // 路由
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
ElMessage.warning('参数错误,联系人不能为空!')
|
ElMessage.warning('参数错误,联系人不能为空!')
|
||||||
delView(unref(currentRoute))
|
close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await getContactData(id)
|
await getContactData(id)
|
||||||
|
Loading…
Reference in New Issue
Block a user