crm-客户:集成操作日志详情组件
This commit is contained in:
parent
59c6670775
commit
455688eaa8
@ -67,3 +67,8 @@ export const exportCustomer = async (params) => {
|
|||||||
export const queryAllList = async () => {
|
export const queryAllList = async () => {
|
||||||
return await request.get({ url: `/crm/customer/query-all-list` })
|
return await request.get({ url: `/crm/customer/query-all-list` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询客户操作日志
|
||||||
|
export const getOperateLog = async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/customer/operate-log?id=` + id })
|
||||||
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
v-loading="formLoading"
|
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<el-form-item label="所属行业" prop="industryId">
|
<el-form-item label="所属行业" prop="industryId">
|
||||||
<el-select v-model="formData.industryId" placeholder="请选择所属行业">
|
<el-select v-model="formData.industryId" placeholder="请选择所属行业">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<el-form-item label="客户来源" prop="source">
|
<el-form-item label="客户来源" prop="source">
|
||||||
<el-select v-model="formData.source" placeholder="请选择客户来源">
|
<el-select v-model="formData.source" placeholder="请选择客户来源">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_CUSTOMER_SOURCE)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_SOURCE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<el-form-item label="客户等级" prop="level">
|
<el-form-item label="客户等级" prop="level">
|
||||||
<el-select v-model="formData.level" placeholder="请选择客户等级">
|
<el-select v-model="formData.level" placeholder="请选择客户等级">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
@ -120,9 +120,9 @@
|
|||||||
<el-form-item label="下次联系时间" prop="contactNextTime">
|
<el-form-item label="下次联系时间" prop="contactNextTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.contactNextTime"
|
v-model="formData.contactNextTime"
|
||||||
|
placeholder="选择下次联系时间"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
placeholder="选择下次联系时间"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -139,13 +139,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as AreaApi from '@/api/system/area'
|
import * as AreaApi from '@/api/system/area'
|
||||||
import { defaultProps } from '@/utils/tree'
|
import { defaultProps } from '@/utils/tree'
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<el-button v-hasPermi="['crm:customer:update']" @click="openForm(customer.id)">
|
<el-button v-hasPermi="['crm:customer:update']" @click="openForm(customer.id)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button @click="transfer">转移</el-button>
|
||||||
<el-button>更改成交状态</el-button>
|
<el-button>更改成交状态</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -37,11 +38,13 @@
|
|||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<CustomerForm ref="formRef" @success="emit('refresh')" />
|
<CustomerForm ref="formRef" @success="emit('refresh')" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import CustomerForm from '../CustomerForm.vue'
|
import CustomerForm from '../CustomerForm.vue'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CustomerDetailsHeader' })
|
||||||
|
|
||||||
const { customer, loading } = defineProps<{
|
const { customer, loading } = defineProps<{
|
||||||
customer: CustomerApi.CustomerVO // 客户信息
|
customer: CustomerApi.CustomerVO // 客户信息
|
||||||
loading: boolean // 加载中
|
loading: boolean // 加载中
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-collapse class="" v-model="activeNames">
|
<el-collapse v-model="activeNames" class="">
|
||||||
<el-collapse-item name="basicInfo">
|
<el-collapse-item name="basicInfo">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span class="text-base font-bold">基本信息</span>
|
<span class="text-base font-bold">基本信息</span>
|
||||||
@ -60,15 +60,16 @@
|
|||||||
</el-collapse>
|
</el-collapse>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script lang="ts" setup>
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CustomerDetailsInfo' })
|
||||||
const { customer } = defineProps<{
|
const { customer } = defineProps<{
|
||||||
customer: CustomerApi.CustomerVO // 客户明细
|
customer: CustomerApi.CustomerVO // 客户明细
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const activeNames = ref(['basicInfo', 'systemInfo']) // 展示的折叠面板
|
const activeNames = ref(['basicInfo', 'systemInfo']) // 展示的折叠面板
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss"></style>
|
<style lang="scss" scoped></style>
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
<el-tab-pane label="详细资料">
|
<el-tab-pane label="详细资料">
|
||||||
<CustomerDetailsInfo :customer="customer" />
|
<CustomerDetailsInfo :customer="customer" />
|
||||||
</el-tab-pane>
|
</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>
|
<el-tab-pane label="联系人" lazy>
|
||||||
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -38,24 +40,34 @@ import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue
|
|||||||
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
|
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
|
||||||
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
|
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'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmCustomerDetail' })
|
defineOptions({ name: 'CrmCustomerDetail' })
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const id = Number(route.params.id) // 客户编号
|
const id = Number(route.params.id) // 客户编号
|
||||||
const loading = ref(true) // 加载中
|
const loading = ref(true) // 加载中
|
||||||
|
|
||||||
/** 获取详情 */
|
/** 获取详情 */
|
||||||
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) // 客户详情
|
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) // 客户详情
|
||||||
const getCustomer = async (id: number) => {
|
const getCustomer = async (id: number) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
customer.value = await CustomerApi.getCustomer(id)
|
customer.value = await CustomerApi.getCustomer(id)
|
||||||
|
await getOperateLog(id)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const logList = ref<OperateLogV2VO[]>([]) // 操作日志列表
|
||||||
|
/**
|
||||||
|
* 获取操作日志
|
||||||
|
*/
|
||||||
|
const getOperateLog = async (customerId: number) => {
|
||||||
|
if (!customerId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logList.value = await CustomerApi.getOperateLog(customerId)
|
||||||
|
}
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
const { delView } = useTagsViewStore() // 视图操作
|
const { delView } = useTagsViewStore() // 视图操作
|
||||||
const { currentRoute } = useRouter() // 路由
|
const { currentRoute } = useRouter() // 路由
|
||||||
|
Loading…
Reference in New Issue
Block a user