From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/api/crm/customer/index.ts | 132 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 132 insertions(+), 0 deletions(-)
diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts
new file mode 100644
index 0000000..d149d4e
--- /dev/null
+++ b/src/api/crm/customer/index.ts
@@ -0,0 +1,132 @@
+import request from '@/config/axios'
+import { TransferReqVO } from '@/api/crm/permission'
+
+export interface CustomerVO {
+ id: number // 缂栧彿
+ name: string // 瀹㈡埛鍚嶇О
+ followUpStatus: boolean // 璺熻繘鐘舵��
+ contactLastTime: Date // 鏈�鍚庤窡杩涙椂闂�
+ contactLastContent: string // 鏈�鍚庤窡杩涘唴瀹�
+ contactNextTime: Date // 涓嬫鑱旂郴鏃堕棿
+ ownerUserId: number // 璐熻矗浜虹殑鐢ㄦ埛缂栧彿
+ ownerUserName?: string // 璐熻矗浜虹殑鐢ㄦ埛鍚嶇О
+ ownerUserDept?: string // 璐熻矗浜虹殑閮ㄩ棬鍚嶇О
+ lockStatus?: boolean
+ dealStatus?: boolean
+ mobile: string // 鎵嬫満鍙�
+ telephone: string // 鐢佃瘽
+ qq: string // QQ
+ wechat: string // wechat
+ email: string // email
+ areaId: number // 鎵�鍦ㄥ湴
+ areaName?: string // 鎵�鍦ㄥ湴鍚嶇О
+ detailAddress: string // 璇︾粏鍦板潃
+ industryId: number // 鎵�灞炶涓�
+ level: number // 瀹㈡埛绛夌骇
+ source: number // 瀹㈡埛鏉ユ簮
+ remark: string // 澶囨敞
+ creator: string // 鍒涘缓浜�
+ creatorName?: string // 鍒涘缓浜哄悕绉�
+ createTime: Date // 鍒涘缓鏃堕棿
+ updateTime: Date // 鏇存柊鏃堕棿
+}
+
+// 鏌ヨ瀹㈡埛鍒楄〃
+export const getCustomerPage = async (params) => {
+ return await request.get({ url: `/crm/customer/page`, params })
+}
+
+// 杩涘叆鍏捣瀹㈡埛鎻愰啋鐨勫鎴峰垪琛�
+export const getPutPoolRemindCustomerPage = async (params) => {
+ return await request.get({ url: `/crm/customer/put-pool-remind-page`, params })
+}
+
+// 鑾峰緱寰呰繘鍏ュ叕娴峰鎴锋暟閲�
+export const getPutPoolRemindCustomerCount = async () => {
+ return await request.get({ url: `/crm/customer/put-pool-remind-count` })
+}
+
+// 鑾峰緱浠婃棩闇�鑱旂郴瀹㈡埛鏁伴噺
+export const getTodayContactCustomerCount = async () => {
+ return await request.get({ url: `/crm/customer/today-contact-count` })
+}
+
+// 鑾峰緱鍒嗛厤缁欐垜銆佸緟璺熻繘鐨勭嚎绱㈡暟閲忕殑瀹㈡埛鏁伴噺
+export const getFollowCustomerCount = async () => {
+ return await request.get({ url: `/crm/customer/follow-count` })
+}
+
+// 鏌ヨ瀹㈡埛璇︽儏
+export const getCustomer = async (id: number) => {
+ return await request.get({ url: `/crm/customer/get?id=` + id })
+}
+
+// 鏂板瀹㈡埛
+export const createCustomer = async (data: CustomerVO) => {
+ return await request.post({ url: `/crm/customer/create`, data })
+}
+
+// 淇敼瀹㈡埛
+export const updateCustomer = async (data: CustomerVO) => {
+ return await request.put({ url: `/crm/customer/update`, data })
+}
+
+// 鏇存柊瀹㈡埛鐨勬垚浜ょ姸鎬�
+export const updateCustomerDealStatus = async (id: number, dealStatus: boolean) => {
+ return await request.put({ url: `/crm/customer/update-deal-status`, params: { id, dealStatus } })
+}
+
+// 鍒犻櫎瀹㈡埛
+export const deleteCustomer = async (id: number) => {
+ return await request.delete({ url: `/crm/customer/delete?id=` + id })
+}
+
+// 瀵煎嚭瀹㈡埛 Excel
+export const exportCustomer = async (params: any) => {
+ return await request.download({ url: `/crm/customer/export-excel`, params })
+}
+
+// 涓嬭浇瀹㈡埛瀵煎叆妯℃澘
+export const importCustomerTemplate = () => {
+ return request.download({ url: '/crm/customer/get-import-template' })
+}
+
+// 瀵煎叆瀹㈡埛
+export const handleImport = async (formData) => {
+ return await request.upload({ url: `/crm/customer/import`, data: formData })
+}
+
+// 瀹㈡埛鍒楄〃
+export const getCustomerSimpleList = async () => {
+ return await request.get({ url: `/crm/customer/simple-list` })
+}
+
+// ======================= 涓氬姟鎿嶄綔 =======================
+
+// 瀹㈡埛杞Щ
+export const transferCustomer = async (data: TransferReqVO) => {
+ return await request.put({ url: '/crm/customer/transfer', data })
+}
+
+// 閿佸畾/瑙i攣瀹㈡埛
+export const lockCustomer = async (id: number, lockStatus: boolean) => {
+ return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
+}
+
+// 棰嗗彇鍏捣瀹㈡埛
+export const receiveCustomer = async (ids: any[]) => {
+ return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
+}
+
+// 鍒嗛厤鍏捣缁欏搴旇礋璐d汉
+export const distributeCustomer = async (ids: any[], ownerUserId: number) => {
+ return await request.put({
+ url: '/crm/customer/distribute',
+ data: { ids: ids, ownerUserId }
+ })
+}
+
+// 瀹㈡埛鏀惧叆鍏捣
+export const putCustomerPool = async (id: number) => {
+ return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
+}
--
Gitblit v1.8.0