From 6725318f27af0738ef3e44d5a6568baaf4e99899 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 24 Feb 2024 23:01:29 +0800 Subject: [PATCH] =?UTF-8?q?CRM=EF=BC=9A=E5=AE=8C=E5=96=84=E5=9B=9E?= =?UTF-8?q?=E6=AC=BE=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contract/index.ts | 7 + src/api/crm/customer/index.ts | 5 + src/api/crm/receivable/plan/index.ts | 4 +- src/views/crm/customer/CustomerImportForm.vue | 14 +- .../receivable/plan/ReceivablePlanForm.vue | 248 ++++++++++-------- src/views/crm/receivable/plan/index.vue | 147 ++++++----- 6 files changed, 232 insertions(+), 193 deletions(-) diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 1115e950..494c60c7 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -65,6 +65,13 @@ export const getContract = async (id: number) => { return await request.get({ url: `/crm/contract/get?id=` + id }) } +// 查询 CRM 合同下拉列表 +export const getCrmContractSimpleListByCustomerId = async (customerId: number) => { + return await request.get({ + url: `/crm/contract/list-all-simple-by-customer?customerId=${customerId}` + }) +} + // 新增 CRM 合同 export const createContract = async (data: ContractVO) => { return await request.post({ url: `/crm/contract/create`, data }) diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index cc15eb5e..c684e98d 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -90,6 +90,11 @@ 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` }) diff --git a/src/api/crm/receivable/plan/index.ts b/src/api/crm/receivable/plan/index.ts index 3ddbd7db..98fadb0d 100644 --- a/src/api/crm/receivable/plan/index.ts +++ b/src/api/crm/receivable/plan/index.ts @@ -4,8 +4,7 @@ export interface ReceivablePlanVO { id: number period: number receivableId: number - status: number - checkStatus: string + finishStatus: number processInstanceId: number price: number returnTime: Date @@ -14,7 +13,6 @@ export interface ReceivablePlanVO { customerId: number contractId: number ownerUserId: number - sort: number remark: string } diff --git a/src/views/crm/customer/CustomerImportForm.vue b/src/views/crm/customer/CustomerImportForm.vue index 4290b361..af802ab2 100644 --- a/src/views/crm/customer/CustomerImportForm.vue +++ b/src/views/crm/customer/CustomerImportForm.vue @@ -4,7 +4,6 @@ @@ -45,6 +45,7 @@ import * as CustomerApi from '@/api/crm/customer' import { getAccessToken, getTenantId } from '@/utils/auth' import download from '@/utils/download' +import type { UploadUserFile } from 'element-plus' defineOptions({ name: 'SystemUserImportForm' }) @@ -53,11 +54,9 @@ const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 const formLoading = ref(false) // 表单的加载中 const uploadRef = ref() -const importUrl = - import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/crm/customer/import' const uploadHeaders = ref() // 上传 Header 头 -const fileList = ref([]) // 文件列表 -const updateSupport = ref(0) // 是否更新已经存在的客户数据 +const fileList = ref([]) // 文件列表 +const updateSupport = ref(false) // 是否更新已经存在的客户数据 /** 打开弹窗 */ const open = () => { @@ -79,7 +78,10 @@ const submitForm = async () => { 'tenant-id': getTenantId() } formLoading.value = true - uploadRef.value!.submit() + const formData = new FormData() + formData.append('updateSupport', updateSupport.value) + formData.append('file', fileList.value[0].raw) + await CustomerApi.handleImport(formData) } /** 文件上传成功 */ diff --git a/src/views/crm/receivable/plan/ReceivablePlanForm.vue b/src/views/crm/receivable/plan/ReceivablePlanForm.vue index 29897b15..b6fa9799 100644 --- a/src/views/crm/receivable/plan/ReceivablePlanForm.vue +++ b/src/views/crm/receivable/plan/ReceivablePlanForm.vue @@ -1,95 +1,119 @@ - diff --git a/src/views/crm/receivable/plan/index.vue b/src/views/crm/receivable/plan/index.vue index decd79bc..16b54aee 100644 --- a/src/views/crm/receivable/plan/index.vue +++ b/src/views/crm/receivable/plan/index.vue @@ -2,49 +2,63 @@ - + placeholder="请选择客户" + @keyup.enter="handleQuery" + > + + - + - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 - 导出 + + 新增 + + + + 导出 @@ -52,68 +66,58 @@ - - - - - - + + + + + - - - - - - - - - - - + /> + - - + - + fixed="right" + label="完成状态" + prop="finishStatus" + width="130px" + > + + + -