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