📖 CRM:跟进记录的 code review

This commit is contained in:
YunaiV 2024-01-15 21:30:25 +08:00
parent 163613e90c
commit 9fa769b16a
15 changed files with 40 additions and 44 deletions

View File

@ -61,7 +61,7 @@ export const exportBusiness = async (params) => {
return await request.download({ url: `/crm/business/export-excel`, params }) return await request.download({ url: `/crm/business/export-excel`, params })
} }
//联系人关联商机列表 // 联系人关联商机列表
export const getBusinessPageByContact = async (params) => { export const getBusinessPageByContact = async (params) => {
return await request.get({ url: `/crm/business/page-by-contact`, params }) return await request.get({ url: `/crm/business/page-by-contact`, params })
} }

View File

@ -2,22 +2,14 @@ import request from '@/config/axios'
// 跟进记录 VO // 跟进记录 VO
export interface FollowUpRecordVO { export interface FollowUpRecordVO {
// 编号 id: number // 编号
id: number bizType: number // 数据类型
// 数据类型 bizId: number // 数据编号
bizType: number type: number // 跟进类型
// 数据编号 content: string // 跟进内容
bizId: number nextTime: Date // 下次联系时间
// 跟进类型 businessIds: number[] // 关联的商机编号数组
type: number contactIds: number[] // 关联的联系人编号数组
// 跟进内容
content: string
// 下次联系时间
nextTime: Date
// 关联的商机编号数组
businessIds: number[]
// 关联的联系人编号数组
contactIds: number[]
} }
// 跟进记录 API // 跟进记录 API

View File

@ -1,5 +1,5 @@
<!-- 某个记录的操作日志列表目前主要用于 CRM 客户商机等详情界面 -->
<template> <template>
<!-- TODO @puhui999左边不用有空隙哈 -->
<div class="pt-20px"> <div class="pt-20px">
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item

View File

@ -503,7 +503,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
title: '客户详情', title: '客户详情',
noCache: true, noCache: true,
hidden: true, hidden: true,
activeMenu: '/crm/customer/index' activeMenu: '/crm/customer'
}, },
component: () => import('@/views/crm/customer/detail/index.vue') component: () => import('@/views/crm/customer/detail/index.vue')
}, },

View File

@ -1,8 +1,8 @@
/** /**
* *
*/ */
import {useDictStoreWithOut} from '@/store/modules/dict' import { useDictStoreWithOut } from '@/store/modules/dict'
import {ElementPlusInfoType} from '@/types/elementPlus' import { ElementPlusInfoType } from '@/types/elementPlus'
const dictStore = useDictStoreWithOut() const dictStore = useDictStoreWithOut()
@ -162,9 +162,7 @@ export enum DICT_TYPE {
MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型 MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型
// ========== MALL - 商品模块 ========== // ========== MALL - 商品模块 ==========
PRODUCT_UNIT = 'product_unit', // 商品单位
PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态 PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
PROMOTION_TYPE_ENUM = 'promotion_type_enum', // 营销类型枚举
// ========== MALL - 交易模块 ========== // ========== MALL - 交易模块 ==========
EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', //快递的计费方式 EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', //快递的计费方式

View File

@ -36,15 +36,12 @@
</CustomerDetailsHeader> </CustomerDetailsHeader>
<el-col> <el-col>
<el-tabs> <el-tabs>
<el-tab-pane label="详细资料"> <el-tab-pane label="跟进记录">
<CustomerDetailsInfo :customer="customer" />
</el-tab-pane>
<el-tab-pane label="操作日志">
<OperateLogV2 :log-list="logList" />
</el-tab-pane>
<el-tab-pane label="跟进">
<FollowUpList :biz-id="customerId" :biz-type="BizTypeEnum.CRM_CUSTOMER" /> <FollowUpList :biz-id="customerId" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="基本信息">
<CustomerDetailsInfo :customer="customer" />
</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>
@ -66,6 +63,9 @@
<ReceivablePlanList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" /> <ReceivablePlanList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
<ReceivableList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" /> <ReceivableList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="操作日志">
<OperateLogV2 :log-list="logList" />
</el-tab-pane>
<el-tab-pane label="回访" lazy>TODO 待开发</el-tab-pane> <el-tab-pane label="回访" lazy>TODO 待开发</el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>

View File

@ -146,7 +146,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="距离进入公海" prop="poolDay"> <el-table-column align="center" label="距离进入公海" prop="poolDay">
<template #default="scope"> {{ scope.row.poolDay }}</template> <template #default="scope"> {{ scope.row.poolDay }} </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:formatter="dateFormatter" :formatter="dateFormatter"

View File

@ -187,7 +187,7 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as CustomerApi from '@/api/crm/customer' import * as CustomerApi from '@/api/crm/customer'
defineOptions({ name: 'CrmCustomer' }) defineOptions({ name: 'CrmCustomerPool' })
const message = useMessage() // const message = useMessage() //

View File

@ -1,3 +1,4 @@
<!-- 跟进记录的添加表单弹窗 -->
<template> <template>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="50%"> <Dialog v-model="dialogVisible" :title="dialogTitle" width="50%">
<el-form <el-form
@ -30,11 +31,13 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO @puhui999不搞富文本哈然后加个附件图片两个 form-item -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="跟进内容" prop="content"> <el-form-item label="跟进内容" prop="content">
<Editor v-model="formData.content" height="300px" /> <Editor v-model="formData.content" height="300px" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO @puhui999因为不考虑编辑的情况是不是关联要是个弹窗选择哈 -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="关联联系人" prop="contactIds"> <el-form-item label="关联联系人" prop="contactIds">
<el-select v-model="formData.contactIds" multiple placeholder="请选择"> <el-select v-model="formData.contactIds" multiple placeholder="请选择">
@ -90,7 +93,6 @@ import { BusinessList, ContactList } from './components'
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'
import * as BusinessApi from '@/api/crm/business' import * as BusinessApi from '@/api/crm/business'
/** 跟进记录 表单 */
defineOptions({ name: 'FollowUpRecordForm' }) defineOptions({ name: 'FollowUpRecordForm' })
const { t } = useI18n() // const { t } = useI18n() //

View File

@ -1,3 +1,4 @@
<!-- 某个记录的跟进记录列表目前主要用于 CRM 客户商机等详情界面 -->
<template> <template>
<!-- 操作栏 --> <!-- 操作栏 -->
<el-row class="mb-10px" justify="end"> <el-row class="mb-10px" justify="end">
@ -24,7 +25,9 @@
prop="nextTime" prop="nextTime"
width="180px" width="180px"
/> />
<!-- TODO @puhui999点击后查看关联联系人 -->
<el-table-column align="center" label="关联联系人" prop="contactIds" /> <el-table-column align="center" label="关联联系人" prop="contactIds" />
<!-- TODO @puhui999点击后查看关联商机 -->
<el-table-column align="center" label="关联商机" prop="businessIds" /> <el-table-column align="center" label="关联商机" prop="businessIds" />
<el-table-column <el-table-column
:formatter="dateFormatter" :formatter="dateFormatter"
@ -73,7 +76,7 @@ import { DICT_TYPE } from '@/utils/dict'
import { FollowUpRecordApi, FollowUpRecordVO } from '@/api/crm/followup' import { FollowUpRecordApi, FollowUpRecordVO } from '@/api/crm/followup'
import FollowUpRecordForm from './FollowUpRecordForm.vue' import FollowUpRecordForm from './FollowUpRecordForm.vue'
/** 跟进记录 列表 */ /** 跟进记录列表 */
defineOptions({ name: 'FollowUpRecord' }) defineOptions({ name: 'FollowUpRecord' })
const props = defineProps<{ const props = defineProps<{
bizType: number bizType: number
@ -84,8 +87,7 @@ const { t } = useI18n() // 国际化
const loading = ref(true) // const loading = ref(true) //
const list = ref<FollowUpRecordVO[]>([]) // const list = ref<FollowUpRecordVO[]>([]) //
// const total = ref(0) //
const total = ref(0)
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,

View File

@ -1,3 +1,4 @@
<!-- 转移数据的表单弹窗目前主要用于 CRM 客户商机等详情界面 -->
<template> <template>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="30%"> <Dialog v-model="dialogVisible" :title="dialogTitle" width="30%">
<el-form <el-form
@ -39,6 +40,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- TODO 转移客户时需要额外有联系人商机合同 checkbox 选择 -->
<template #footer> <template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </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>

View File

@ -47,7 +47,7 @@
<el-form-item label="产品单位" prop="unit"> <el-form-item label="产品单位" prop="unit">
<el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位"> <el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_UNIT)" v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"

View File

@ -22,7 +22,7 @@
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }} {{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="产品单位"> <el-descriptions-item label="产品单位">
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="product.unit" /> <dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="产品价格">{{ fenToYuan(product.price) }}</el-descriptions-item> <el-descriptions-item label="产品价格">{{ fenToYuan(product.price) }}</el-descriptions-item>
<el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item> <el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>

View File

@ -14,10 +14,10 @@
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }} {{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="是否上下架"> <el-descriptions-item label="是否上下架">
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status"/> <dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="单位"> <el-descriptions-item label="单位">
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="product.unit"/> <dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-collapse-item> </el-collapse-item>
@ -25,12 +25,12 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {DICT_TYPE} from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import * as ProductApi from '@/api/crm/product' import * as ProductApi from '@/api/crm/product'
import {fenToYuan} from '@/utils' import { fenToYuan } from '@/utils'
import * as ProductCategoryApi from '@/api/crm/product/productCategory' import * as ProductCategoryApi from '@/api/crm/product/productCategory'
const {product} = defineProps<{ const { product } = defineProps<{
product: ProductApi.ProductVO product: ProductApi.ProductVO
}>() }>()

View File

@ -60,7 +60,7 @@
<el-table-column label="产品类型" align="center" prop="categoryName" width="160" /> <el-table-column label="产品类型" align="center" prop="categoryName" width="160" />
<el-table-column label="产品单位" align="center" prop="unit"> <el-table-column label="产品单位" align="center" prop="unit">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="scope.row.unit" /> <dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="scope.row.unit" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产品编码" align="center" prop="no" /> <el-table-column label="产品编码" align="center" prop="no" />