Browse Source

📖 CRM:跟进记录的 code review

YunaiV 1 năm trước cách đây
mục cha
commit
9fa769b16a

+ 1 - 1
src/api/crm/business/index.ts

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

+ 8 - 16
src/api/crm/followup/index.ts

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

+ 1 - 1
src/components/OperateLogV2/src/OperateLogV2.vue

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

+ 1 - 1
src/router/modules/remaining.ts

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

+ 2 - 4
src/utils/dict.ts

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

+ 7 - 7
src/views/crm/customer/detail/index.vue

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

+ 1 - 1
src/views/crm/customer/index.vue

@@ -146,7 +146,7 @@
         </template>
       </el-table-column>
       <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
         :formatter="dateFormatter"

+ 1 - 1
src/views/crm/customer/pool/index.vue

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

+ 3 - 1
src/views/crm/followup/FollowUpRecordForm.vue

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

+ 5 - 3
src/views/crm/followup/index.vue

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

+ 2 - 0
src/views/crm/permission/components/TransferForm.vue

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

+ 1 - 1
src/views/crm/product/ProductForm.vue

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

+ 1 - 1
src/views/crm/product/detail/ProductDetailsHeader.vue

@@ -22,7 +22,7 @@
         {{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
       </el-descriptions-item>
       <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 label="产品价格">{{ fenToYuan(product.price) }}元</el-descriptions-item>
       <el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>

+ 5 - 5
src/views/crm/product/detail/ProductDetailsInfo.vue

@@ -14,10 +14,10 @@
             {{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
           </el-descriptions-item>
           <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 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>
       </el-collapse-item>
@@ -25,12 +25,12 @@
   </ContentWrap>
 </template>
 <script setup lang="ts">
-import {DICT_TYPE} from '@/utils/dict'
+import { DICT_TYPE } from '@/utils/dict'
 import * as ProductApi from '@/api/crm/product'
-import {fenToYuan} from '@/utils'
+import { fenToYuan } from '@/utils'
 import * as ProductCategoryApi from '@/api/crm/product/productCategory'
 
-const {product} = defineProps<{
+const { product } = defineProps<{
   product: ProductApi.ProductVO
 }>()
 

+ 1 - 1
src/views/crm/product/index.vue

@@ -60,7 +60,7 @@
       <el-table-column label="产品类型" align="center" prop="categoryName" width="160" />
       <el-table-column label="产品单位" align="center" prop="unit">
         <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>
       </el-table-column>
       <el-table-column label="产品编码" align="center" prop="no" />