|
|
|
|
@ -5,7 +5,9 @@
|
|
|
|
|
<el-tab-pane label="详细资料">
|
|
|
|
|
<ContactDetailsInfo :contact="contact" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="操作日志" lazy>TODO 待开发</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="操作日志">
|
|
|
|
|
<OperateLogV2 :log-list="logList" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="团队成员" lazy>
|
|
|
|
|
<PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
@ -20,7 +22,6 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ElMessage } from 'element-plus' // TODO @zyna:使用 hook 引入 message
|
|
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
|
import * as ContactApi from '@/api/crm/contact'
|
|
|
|
|
import ContactDetailsHeader from '@/views/crm/contact/detail/ContactDetailsHeader.vue'
|
|
|
|
|
@ -28,6 +29,7 @@ import ContactDetailsInfo from '@/views/crm/contact/detail/ContactDetailsInfo.vu
|
|
|
|
|
import BusinessList from '@/views/crm/business/components/BusinessList.vue' // 商机列表
|
|
|
|
|
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
|
|
|
|
|
import { BizTypeEnum } from '@/api/crm/permission'
|
|
|
|
|
import { OperateLogV2VO } from '@/api/system/operatelog'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'CrmContactDetail' })
|
|
|
|
|
|
|
|
|
|
@ -41,11 +43,24 @@ const getContactData = async (id: number) => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
contact.value = await ContactApi.getContact(id)
|
|
|
|
|
await getOperateLog(id)
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const logList = ref<OperateLogV2VO[]>([]) // 操作日志列表
|
|
|
|
|
/**
|
|
|
|
|
* 获取操作日志
|
|
|
|
|
*/
|
|
|
|
|
const getOperateLog = async (contactId: number) => {
|
|
|
|
|
if (!contactId) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const data = await ContactApi.getOperateLogPage({
|
|
|
|
|
bizId: contactId
|
|
|
|
|
})
|
|
|
|
|
logList.value = data.list
|
|
|
|
|
}
|
|
|
|
|
/** 初始化 */
|
|
|
|
|
const { delView } = useTagsViewStore() // 视图操作
|
|
|
|
|
const { currentRoute } = useRouter() // 路由
|
|
|
|
|
|