From 26daa3a1ff1e270666a964ea04430c443c53bfb4 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 27 Jan 2024 15:02:25 +0800 Subject: [PATCH 1/9] =?UTF-8?q?CRM-=E5=AE=A2=E6=88=B7=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=AE=A2=E6=88=B7=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customer/index.ts | 5 + src/views/crm/customer/CustomerImportForm.vue | 134 ++++++++++++++++++ src/views/crm/customer/index.vue | 11 +- src/views/system/user/UserImportForm.vue | 1 + 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/views/crm/customer/CustomerImportForm.vue diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 4542c86a..004f642d 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -63,6 +63,11 @@ 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 getSimpleCustomerList = async () => { return await request.get({ url: `/crm/customer/list-all-simple` }) diff --git a/src/views/crm/customer/CustomerImportForm.vue b/src/views/crm/customer/CustomerImportForm.vue new file mode 100644 index 00000000..7a74acf9 --- /dev/null +++ b/src/views/crm/customer/CustomerImportForm.vue @@ -0,0 +1,134 @@ + + diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue index b2cee2f7..2c441d99 100644 --- a/src/views/crm/customer/index.vue +++ b/src/views/crm/customer/index.vue @@ -84,6 +84,10 @@ 新增 + + + 导入 + + diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue index 4932292c..7d287381 100644 --- a/src/views/crm/contact/detail/index.vue +++ b/src/views/crm/contact/detail/index.vue @@ -1,5 +1,12 @@ diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index 5d5578f9..a9271ce5 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -1,54 +1,108 @@ - diff --git a/src/views/crm/contract/components/ProductList.vue b/src/views/crm/contract/components/ProductList.vue new file mode 100644 index 00000000..6c4ca350 --- /dev/null +++ b/src/views/crm/contract/components/ProductList.vue @@ -0,0 +1,112 @@ + + + From 331b6c5611001f622c70646883bd4fc8b62ff091 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 27 Jan 2024 23:18:52 +0800 Subject: [PATCH 5/9] =?UTF-8?q?CRM-=E5=90=88=E5=90=8C=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=90=88=E5=90=8C=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contract/index.ts | 3 +-- src/views/crm/contract/ContractForm.vue | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 527eb5c7..1d944498 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -15,11 +15,10 @@ export interface ContractVO { price: number discountPercent: number productPrice: number - roUserIds: string - rwUserIds: string contactId: number signUserId: number contactLastTime: Date + status: number remark: string productItems: ProductExpandVO[] } diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index a9271ce5..28e49301 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -5,7 +5,7 @@ v-loading="formLoading" :model="formData" :rules="formRules" - label-width="100px" + label-width="110px" > @@ -152,7 +152,8 @@ @@ -164,6 +165,7 @@ import * as UserApi from '@/api/system/user' import * as ContactApi from '@/api/crm/contact' import * as BusinessApi from '@/api/crm/business' import ProductList from './components/ProductList.vue' +import { cloneDeep } from 'lodash-es' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -217,7 +219,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 -const submitForm = async () => { +const submitForm = async (status: number) => { // 校验表单 if (!formRef) return const valid = await formRef.value.validate() @@ -225,7 +227,8 @@ const submitForm = async () => { // 提交请求 formLoading.value = true try { - const data = formData.value as unknown as ContractApi.ContractVO + const data = cloneDeep(unref(formData.value)) as unknown as ContractApi.ContractVO + data.status = status if (formType.value === 'create') { await ContractApi.createContract(data) message.success(t('common.createSuccess')) From 90e0baf5bc7787232c9cdbc9fc4b6e8f04f779cb Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 27 Jan 2024 23:43:30 +0800 Subject: [PATCH 6/9] =?UTF-8?q?CRM-=E5=90=88=E5=90=8C=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=90=88=E5=90=8C=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contract/index.ts | 5 + src/views/crm/contract/ContractForm.vue | 19 ++-- src/views/crm/contract/index.vue | 116 ++++++++++++++---------- 3 files changed, 83 insertions(+), 57 deletions(-) diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 1d944498..ffe4b578 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -57,3 +57,8 @@ export const deleteContract = async (id: number) => { export const exportContract = async (params) => { return await request.download({ url: `/crm/contract/export-excel`, params }) } + +// 提交审核 +export const handleApprove = async (id: number) => { + return await request.put({ url: `/crm/contract/approve?id=${id}` }) +} diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index 28e49301..7a272c1c 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -145,15 +145,12 @@ - - - + 查看工作流 @@ -165,7 +162,6 @@ import * as UserApi from '@/api/system/user' import * as ContactApi from '@/api/crm/contact' import * as BusinessApi from '@/api/crm/business' import ProductList from './components/ProductList.vue' -import { cloneDeep } from 'lodash-es' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -176,7 +172,11 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formData = ref({} as ContractApi.ContractVO) const formRules = reactive({ - name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }] + name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }], + customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }], + orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }], + ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], + no: [{ required: true, message: '合同编号不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref watch( @@ -219,7 +219,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 -const submitForm = async (status: number) => { +const submitForm = async () => { // 校验表单 if (!formRef) return const valid = await formRef.value.validate() @@ -227,8 +227,7 @@ const submitForm = async (status: number) => { // 提交请求 formLoading.value = true try { - const data = cloneDeep(unref(formData.value)) as unknown as ContractApi.ContractVO - data.status = status + const data = unref(formData.value) as unknown as ContractApi.ContractVO if (formType.value === 'create') { await ContractApi.createContract(data) message.success(t('common.createSuccess')) diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue index 26ff403a..49ea53a9 100644 --- a/src/views/crm/contract/index.vue +++ b/src/views/crm/contract/index.vue @@ -2,44 +2,52 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 - 导出 + + 导出 @@ -48,70 +56,78 @@ - - - - - - + + + + + + - - + + - - - - - + + + + + - + - diff --git a/src/views/crm/contract/detail/ContractDetailsInfo.vue b/src/views/crm/contract/detail/ContractDetailsInfo.vue new file mode 100644 index 00000000..f18f7c08 --- /dev/null +++ b/src/views/crm/contract/detail/ContractDetailsInfo.vue @@ -0,0 +1,51 @@ + + diff --git a/src/views/crm/contract/detail/index.vue b/src/views/crm/contract/detail/index.vue new file mode 100644 index 00000000..5ba1e997 --- /dev/null +++ b/src/views/crm/contract/detail/index.vue @@ -0,0 +1,111 @@ + + diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue index 49ea53a9..da3aeaad 100644 --- a/src/views/crm/contract/index.vue +++ b/src/views/crm/contract/index.vue @@ -105,7 +105,7 @@ width="180px" /> - + + diff --git a/src/views/crm/contract/detail/index.vue b/src/views/crm/contract/detail/index.vue index 5ba1e997..fde35ba2 100644 --- a/src/views/crm/contract/detail/index.vue +++ b/src/views/crm/contract/detail/index.vue @@ -105,7 +105,7 @@ onMounted(async () => { close() return } - contractId.value = id + contractId.value = id as unknown as number await getContractData() }) diff --git a/src/views/crm/contract/oa/ContractDetail/index.vue b/src/views/crm/contract/oa/ContractDetail/index.vue new file mode 100644 index 00000000..ac8a4f63 --- /dev/null +++ b/src/views/crm/contract/oa/ContractDetail/index.vue @@ -0,0 +1,220 @@ + + From 770e551900cebf69deb5c34a08b85521861090ca Mon Sep 17 00:00:00 2001 From: anhaohao <1036606149@qq.com> Date: Sun, 28 Jan 2024 20:04:42 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=95=86?= =?UTF-8?q?=E4=B8=9A=E6=99=BA=E8=83=BD-=E6=8E=92=E8=A1=8C=E6=A6=9C?= =?UTF-8?q?=EF=BC=8C=E5=90=88=E5=90=8C=E9=87=91=E9=A2=9D=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E5=92=8C=E5=9B=9E=E6=AC=BE=E9=87=91=E9=A2=9D=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/bi/ranking.ts | 34 +++++ src/utils/dict.ts | 5 +- .../components/RankingContractStatistics.vue | 133 ++++++++++++++++++ .../RankingReceivablesStatistics.vue | 133 ++++++++++++++++++ src/views/crm/bi/ranking/index.vue | 91 ++++++++++++ 5 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 src/api/crm/bi/ranking.ts create mode 100644 src/views/crm/bi/ranking/components/RankingContractStatistics.vue create mode 100644 src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue create mode 100644 src/views/crm/bi/ranking/index.vue diff --git a/src/api/crm/bi/ranking.ts b/src/api/crm/bi/ranking.ts new file mode 100644 index 00000000..53c09e63 --- /dev/null +++ b/src/api/crm/bi/ranking.ts @@ -0,0 +1,34 @@ +import request from '@/config/axios' + +export interface BiContractRanKingRespVO { + price: number + nickname: string + deptName: string +} +export interface BiReceivablesRanKingRespVO { + price: number + nickname: string + deptName: string +} +export interface BiRankReqVO { + deptId: number + type: string +} + +// 排行 API +export const RankingStatisticsApi = { + // 获得合同排行榜 + contractAmountRanking: (params: any) => { + return request.get({ + url: '/bi/ranking/contract-ranking', + params + }) + }, + // 获得回款排行榜 + receivablesAmountRanking: (params: any) => { + return request.get({ + url: '/bi/ranking/receivables-ranking', + params + }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 2c8e47ff..4c490f59 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -203,5 +203,8 @@ export enum DICT_TYPE { CRM_PRODUCT_STATUS = 'crm_product_status', CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别 CRM_PRODUCT_UNIT = 'crm_product_unit', // 产品单位 - CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type' // 跟进方式 + CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // 跟进方式 + + // ========== BI - 商业智能模块 ========== + BI_ANALYZE_TYPE = 'bi_analyze_type' // 分析类型 } diff --git a/src/views/crm/bi/ranking/components/RankingContractStatistics.vue b/src/views/crm/bi/ranking/components/RankingContractStatistics.vue new file mode 100644 index 00000000..b560131c --- /dev/null +++ b/src/views/crm/bi/ranking/components/RankingContractStatistics.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue b/src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue new file mode 100644 index 00000000..80186535 --- /dev/null +++ b/src/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/views/crm/bi/ranking/index.vue b/src/views/crm/bi/ranking/index.vue new file mode 100644 index 00000000..fac2b8ba --- /dev/null +++ b/src/views/crm/bi/ranking/index.vue @@ -0,0 +1,91 @@ + + +