From 11565ecddceaf3191cee0ceb3123ecbbfa6b95b0 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Fri, 14 Mar 2025 19:33:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E6=B7=BB=E5=8A=A0=E8=B7=9F?= =?UTF-8?q?=E8=BF=9B=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD-=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=B7=9F=E8=BF=9B=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8C=85=E5=90=AB=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E3=80=81=E7=AD=9B=E9=80=89=E3=80=81=E5=88=86=E9=A1=B5=E7=AD=89?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20-=20=E6=B7=BB=E5=8A=A0=E8=B7=9F=E8=BF=9B?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B7=BB=E5=8A=A0=E5=92=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95=20-=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95=E7=9A=84=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD-=20=E9=9B=86=E6=88=90=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E4=BD=8E=E4=B8=AD?= =?UTF-8?q?=E9=AB=98=E3=80=81=E6=98=AF=E5=90=A6=E3=80=81=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=AD=89=E9=80=89=E9=A1=B9=E7=9A=84=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=8A=A0=E8=BD=BD-=20=E6=B7=BB=E5=8A=A0=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=85=B3=E8=81=94=E3=80=81=E8=B7=9F=E8=BF=9B=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=AD=89=E4=B8=8B=E6=8B=89=E9=80=89=E9=A1=B9=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/components.d.ts | 2 +- admin/src/addon/zhjw/api/follow_up_logs.ts | 58 ++ .../zh-cn/follow_up_logs.follow_up_logs.json | 51 ++ .../follow_up_logs.follow_up_logs_edit.json | 55 ++ .../views/follow_up_logs/follow_up_logs.vue | 555 ++++++++++++++++ .../follow_up_logs/follow_up_logs_edit.vue | 604 ++++++++++++++++++ .../addon/zhjw/admin/api/follow_up_logs.ts | 58 ++ .../zh-cn/follow_up_logs.follow_up_logs.json | 51 ++ .../follow_up_logs.follow_up_logs_edit.json | 55 ++ .../views/follow_up_logs/follow_up_logs.vue | 517 +++++++++++++++ .../follow_up_logs/follow_up_logs_edit.vue | 563 ++++++++++++++++ .../follow_up_logs/FollowUpLogs.php | 157 +++++ .../addon/zhjw/app/adminapi/route/route.php | 27 + .../app/model/follow_up_logs/FollowUpLogs.php | 310 +++++++++ .../follow_up_logs/FollowUpLogsService.php | 115 ++++ .../validate/follow_up_logs/FollowUpLogs.php | 43 ++ 16 files changed, 3220 insertions(+), 1 deletion(-) create mode 100644 admin/src/addon/zhjw/api/follow_up_logs.ts create mode 100644 admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs.json create mode 100644 admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json create mode 100644 admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs.vue create mode 100644 admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs_edit.vue create mode 100644 niucloud/addon/zhjw/admin/api/follow_up_logs.ts create mode 100644 niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs.json create mode 100644 niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json create mode 100644 niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs.vue create mode 100644 niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs_edit.vue create mode 100644 niucloud/addon/zhjw/app/adminapi/controller/follow_up_logs/FollowUpLogs.php create mode 100644 niucloud/addon/zhjw/app/model/follow_up_logs/FollowUpLogs.php create mode 100644 niucloud/addon/zhjw/app/service/admin/follow_up_logs/FollowUpLogsService.php create mode 100644 niucloud/addon/zhjw/app/validate/follow_up_logs/FollowUpLogs.php diff --git a/admin/components.d.ts b/admin/components.d.ts index a659e019..8a96f9da 100644 --- a/admin/components.d.ts +++ b/admin/components.d.ts @@ -16,9 +16,9 @@ declare module '@vue/runtime-core' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] - ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCard: typeof import('element-plus/es')['ElCard'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] diff --git a/admin/src/addon/zhjw/api/follow_up_logs.ts b/admin/src/addon/zhjw/api/follow_up_logs.ts new file mode 100644 index 00000000..f9a09662 --- /dev/null +++ b/admin/src/addon/zhjw/api/follow_up_logs.ts @@ -0,0 +1,58 @@ +import request from '@/utils/request' + +// USER_CODE_BEGIN -- zhjw_follow_up_logs +/** + * 获取跟进管理列表 + * @param params + * @returns + */ +export function getFollowUpLogsList(params: Record) { + return request.get(`zhjw/follow_up_logs`, {params}) +} + +/** + * 获取跟进管理详情 + * @param id 跟进管理id + * @returns + */ +export function getFollowUpLogsInfo(id: number) { + return request.get(`zhjw/follow_up_logs/${id}`); +} + +/** + * 添加跟进管理 + * @param params + * @returns + */ +export function addFollowUpLogs(params: Record) { + return request.post('zhjw/follow_up_logs', params, {showErrorMessage: true, showSuccessMessage: true}) +} + +/** + * 编辑跟进管理 + * @param id + * @param params + * @returns + */ +export function editFollowUpLogs(params: Record) { + return request.put(`zhjw/follow_up_logs/${params.id}`, params, {showErrorMessage: true, showSuccessMessage: true}) +} + +/** + * 删除跟进管理 + * @param id + * @returns + */ +export function deleteFollowUpLogs(id: number) { + return request.delete(`zhjw/follow_up_logs/${id}`, {showErrorMessage: true, showSuccessMessage: true}) +} + +export function getWithSalesList(params: Record) { + return request.get('zhjw/sales_all', {params}) +} + +export function getWithStaffList(params: Record) { + return request.get('zhjw/staff_all', {params}) +} + +// USER_CODE_END -- zhjw_follow_up_logs diff --git a/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs.json b/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs.json new file mode 100644 index 00000000..8c76e4d3 --- /dev/null +++ b/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs.json @@ -0,0 +1,51 @@ +{ + "id":"序号", + "salesId":"销售关联", + "salesIdPlaceholder":"全部", + "staffId":"跟进人员", + "staffIdPlaceholder":"全部", + "roleId":"跟进人员角色", + "entryType":"填写人员类型", + "entryTypePlaceholder":"请输入填写人员类型", + "requirement":"需求", + "purchasingPower":"购买力", + "purchasingPowerPlaceholder":"请输入购买力", + "cognitiveConcept":"认知理念", + "cognitiveConceptPlaceholder":"请输入认知理念", + "schooltime":"时间", + "schooltimePlaceholder":"请输入时间", + "distance":"距离", + "communicationNotes":"沟通备注", + "decisionMaker":"决策人", + "emotionalIntensity":"情感粘度", + "emotionalIntensityPlaceholder":"请输入情感粘度", + "initialCustomerIntent":"客户初步意向度", + "initialCustomerIntentPlaceholder":"请输入客户初步意向度", + "initialRelationshipIntent":"客情初步意向度", + "initialRelationshipIntentPlaceholder":"请输入客情初步意向度", + "promisedVisitDate":"承诺到访时间", + "promisedVisitDatePlaceholder":"请输入承诺到访时间", + "actualVisitDate":"实际到访时间", + "actualVisitDatePlaceholder":"请输入实际到访时间", + "firstVisitFeedback":"当面资讯反馈-第1次访问情况", + "secondVisitFeedback":"当面资讯反馈-第2次访问情况", + "isClosedDeal":"是否关单", + "isClosedDealPlaceholder":"请输入是否关单", + "followUpType":"跟进类型", + "followUpTypePlaceholder":"请输入跟进类型", + "followUpTime":"跟进时间", + "followUpTimePlaceholder":"请输入跟进时间", + "audioUpload":"上传录音(单文件)", + "followUpContent":"跟进内容", + "customerStatus":"客户状态", + "customerStatusPlaceholder":"请输入客户状态", + "signUpContactId":"签单意向联系人(员工id)", + "signUpContactIdPlaceholder":"全部", + "createTime":"添加时间", + "createTimePlaceholder":"请输入添加时间", + "addFollowUpLogs":"添加跟进管理", + "updateFollowUpLogs":"编辑跟进管理", + "followUpLogsDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json b/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json new file mode 100644 index 00000000..394dd30e --- /dev/null +++ b/admin/src/addon/zhjw/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json @@ -0,0 +1,55 @@ +{ + "salesId":"销售关联", + "staffId":"跟进人员", + "roleId":"跟进人员角色", + "entryType":"填写人员类型", + "requirement":"需求", + "purchasingPower":"购买力", + "cognitiveConcept":"认知理念", + "schooltime":"时间", + "distance":"距离", + "communicationNotes":"沟通备注", + "decisionMaker":"决策人", + "emotionalIntensity":"情感粘度", + "initialCustomerIntent":"客户初步意向度", + "initialRelationshipIntent":"客情初步意向度", + "promisedVisitDate":"承诺到访时间", + "actualVisitDate":"实际到访时间", + "firstVisitFeedback":"当面资讯反馈-第1次访问情况", + "secondVisitFeedback":"当面资讯反馈-第2次访问情况", + "isClosedDeal":"是否关单", + "followUpType":"跟进类型", + "followUpTime":"跟进时间", + "audioUpload":"上传录音(单文件)", + "followUpContent":"跟进内容", + "customerStatus":"客户状态", + "signUpContactId":"签单意向联系人(员工id)", + "salesIdPlaceholder":"请选择销售关联", + "staffIdPlaceholder":"请选择跟进人员", + "roleIdPlaceholder":"请输入跟进人员角色", + "entryTypePlaceholder":"请选择填写人员类型", + "requirementPlaceholder":"请输入需求", + "purchasingPowerPlaceholder":"请选择购买力", + "cognitiveConceptPlaceholder":"请选择认知理念", + "schooltimePlaceholder":"请选择时间", + "distancePlaceholder":"请输入距离", + "communicationNotesPlaceholder":"请输入沟通备注", + "decisionMakerPlaceholder":"请输入决策人", + "emotionalIntensityPlaceholder":"请选择情感粘度", + "initialCustomerIntentPlaceholder":"请选择客户初步意向度", + "initialRelationshipIntentPlaceholder":"请选择客情初步意向度", + "promisedVisitDatePlaceholder":"请选择承诺到访时间", + "actualVisitDatePlaceholder":"请选择实际到访时间", + "firstVisitFeedbackPlaceholder":"请输入当面资讯反馈-第1次访问情况", + "secondVisitFeedbackPlaceholder":"请输入当面资讯反馈-第2次访问情况", + "isClosedDealPlaceholder":"请选择是否关单", + "followUpTypePlaceholder":"请选择跟进类型", + "followUpTimePlaceholder":"请选择跟进时间", + "audioUploadPlaceholder":"请输入上传录音(单文件)", + "followUpContentPlaceholder":"请输入跟进内容", + "customerStatusPlaceholder":"请选择客户状态", + "signUpContactIdPlaceholder":"请选择签单意向联系人(员工id)", + "addFollowUpLogs":"添加跟进管理", + "updateFollowUpLogs":"编辑跟进管理", + "followUpLogsDeleteTips":"确定要删除该跟进管理吗?" +} \ No newline at end of file diff --git a/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs.vue b/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs.vue new file mode 100644 index 00000000..9f5ef7e5 --- /dev/null +++ b/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs.vue @@ -0,0 +1,555 @@ + + + + + diff --git a/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs_edit.vue b/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs_edit.vue new file mode 100644 index 00000000..32c01e85 --- /dev/null +++ b/admin/src/addon/zhjw/views/follow_up_logs/follow_up_logs_edit.vue @@ -0,0 +1,604 @@ + + + + + diff --git a/niucloud/addon/zhjw/admin/api/follow_up_logs.ts b/niucloud/addon/zhjw/admin/api/follow_up_logs.ts new file mode 100644 index 00000000..3df9b208 --- /dev/null +++ b/niucloud/addon/zhjw/admin/api/follow_up_logs.ts @@ -0,0 +1,58 @@ +import request from '@/utils/request' + +// USER_CODE_BEGIN -- zhjw_follow_up_logs +/** + * 获取跟进管理列表 + * @param params + * @returns + */ +export function getFollowUpLogsList(params: Record) { + return request.get(`zhjw/follow_up_logs`, {params}) +} + +/** + * 获取跟进管理详情 + * @param id 跟进管理id + * @returns + */ +export function getFollowUpLogsInfo(id: number) { + return request.get(`zhjw/follow_up_logs/${id}`); +} + +/** + * 添加跟进管理 + * @param params + * @returns + */ +export function addFollowUpLogs(params: Record) { + return request.post('zhjw/follow_up_logs', params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 编辑跟进管理 + * @param id + * @param params + * @returns + */ +export function editFollowUpLogs(params: Record) { + return request.put(`zhjw/follow_up_logs/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) +} + +/** + * 删除跟进管理 + * @param id + * @returns + */ +export function deleteFollowUpLogs(id: number) { + return request.delete(`zhjw/follow_up_logs/${id}`, { showErrorMessage: true, showSuccessMessage: true }) +} + +export function getWithSalesList(params: Record){ + return request.get('zhjw/sales_all', {params}) +}export function getWithStaffList(params: Record){ + return request.get('zhjw/staff_all', {params}) +}export function getWithStaffList(params: Record){ + return request.get('zhjw/staff_all', {params}) +} + +// USER_CODE_END -- zhjw_follow_up_logs diff --git a/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs.json b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs.json new file mode 100644 index 00000000..8c76e4d3 --- /dev/null +++ b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs.json @@ -0,0 +1,51 @@ +{ + "id":"序号", + "salesId":"销售关联", + "salesIdPlaceholder":"全部", + "staffId":"跟进人员", + "staffIdPlaceholder":"全部", + "roleId":"跟进人员角色", + "entryType":"填写人员类型", + "entryTypePlaceholder":"请输入填写人员类型", + "requirement":"需求", + "purchasingPower":"购买力", + "purchasingPowerPlaceholder":"请输入购买力", + "cognitiveConcept":"认知理念", + "cognitiveConceptPlaceholder":"请输入认知理念", + "schooltime":"时间", + "schooltimePlaceholder":"请输入时间", + "distance":"距离", + "communicationNotes":"沟通备注", + "decisionMaker":"决策人", + "emotionalIntensity":"情感粘度", + "emotionalIntensityPlaceholder":"请输入情感粘度", + "initialCustomerIntent":"客户初步意向度", + "initialCustomerIntentPlaceholder":"请输入客户初步意向度", + "initialRelationshipIntent":"客情初步意向度", + "initialRelationshipIntentPlaceholder":"请输入客情初步意向度", + "promisedVisitDate":"承诺到访时间", + "promisedVisitDatePlaceholder":"请输入承诺到访时间", + "actualVisitDate":"实际到访时间", + "actualVisitDatePlaceholder":"请输入实际到访时间", + "firstVisitFeedback":"当面资讯反馈-第1次访问情况", + "secondVisitFeedback":"当面资讯反馈-第2次访问情况", + "isClosedDeal":"是否关单", + "isClosedDealPlaceholder":"请输入是否关单", + "followUpType":"跟进类型", + "followUpTypePlaceholder":"请输入跟进类型", + "followUpTime":"跟进时间", + "followUpTimePlaceholder":"请输入跟进时间", + "audioUpload":"上传录音(单文件)", + "followUpContent":"跟进内容", + "customerStatus":"客户状态", + "customerStatusPlaceholder":"请输入客户状态", + "signUpContactId":"签单意向联系人(员工id)", + "signUpContactIdPlaceholder":"全部", + "createTime":"添加时间", + "createTimePlaceholder":"请输入添加时间", + "addFollowUpLogs":"添加跟进管理", + "updateFollowUpLogs":"编辑跟进管理", + "followUpLogsDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json new file mode 100644 index 00000000..394dd30e --- /dev/null +++ b/niucloud/addon/zhjw/admin/lang/zh-cn/follow_up_logs.follow_up_logs_edit.json @@ -0,0 +1,55 @@ +{ + "salesId":"销售关联", + "staffId":"跟进人员", + "roleId":"跟进人员角色", + "entryType":"填写人员类型", + "requirement":"需求", + "purchasingPower":"购买力", + "cognitiveConcept":"认知理念", + "schooltime":"时间", + "distance":"距离", + "communicationNotes":"沟通备注", + "decisionMaker":"决策人", + "emotionalIntensity":"情感粘度", + "initialCustomerIntent":"客户初步意向度", + "initialRelationshipIntent":"客情初步意向度", + "promisedVisitDate":"承诺到访时间", + "actualVisitDate":"实际到访时间", + "firstVisitFeedback":"当面资讯反馈-第1次访问情况", + "secondVisitFeedback":"当面资讯反馈-第2次访问情况", + "isClosedDeal":"是否关单", + "followUpType":"跟进类型", + "followUpTime":"跟进时间", + "audioUpload":"上传录音(单文件)", + "followUpContent":"跟进内容", + "customerStatus":"客户状态", + "signUpContactId":"签单意向联系人(员工id)", + "salesIdPlaceholder":"请选择销售关联", + "staffIdPlaceholder":"请选择跟进人员", + "roleIdPlaceholder":"请输入跟进人员角色", + "entryTypePlaceholder":"请选择填写人员类型", + "requirementPlaceholder":"请输入需求", + "purchasingPowerPlaceholder":"请选择购买力", + "cognitiveConceptPlaceholder":"请选择认知理念", + "schooltimePlaceholder":"请选择时间", + "distancePlaceholder":"请输入距离", + "communicationNotesPlaceholder":"请输入沟通备注", + "decisionMakerPlaceholder":"请输入决策人", + "emotionalIntensityPlaceholder":"请选择情感粘度", + "initialCustomerIntentPlaceholder":"请选择客户初步意向度", + "initialRelationshipIntentPlaceholder":"请选择客情初步意向度", + "promisedVisitDatePlaceholder":"请选择承诺到访时间", + "actualVisitDatePlaceholder":"请选择实际到访时间", + "firstVisitFeedbackPlaceholder":"请输入当面资讯反馈-第1次访问情况", + "secondVisitFeedbackPlaceholder":"请输入当面资讯反馈-第2次访问情况", + "isClosedDealPlaceholder":"请选择是否关单", + "followUpTypePlaceholder":"请选择跟进类型", + "followUpTimePlaceholder":"请选择跟进时间", + "audioUploadPlaceholder":"请输入上传录音(单文件)", + "followUpContentPlaceholder":"请输入跟进内容", + "customerStatusPlaceholder":"请选择客户状态", + "signUpContactIdPlaceholder":"请选择签单意向联系人(员工id)", + "addFollowUpLogs":"添加跟进管理", + "updateFollowUpLogs":"编辑跟进管理", + "followUpLogsDeleteTips":"确定要删除该跟进管理吗?" +} \ No newline at end of file diff --git a/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs.vue b/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs.vue new file mode 100644 index 00000000..17bccbcd --- /dev/null +++ b/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs.vue @@ -0,0 +1,517 @@ + + + + + diff --git a/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs_edit.vue b/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs_edit.vue new file mode 100644 index 00000000..7972268c --- /dev/null +++ b/niucloud/addon/zhjw/admin/views/follow_up_logs/follow_up_logs_edit.vue @@ -0,0 +1,563 @@ + + + + + diff --git a/niucloud/addon/zhjw/app/adminapi/controller/follow_up_logs/FollowUpLogs.php b/niucloud/addon/zhjw/app/adminapi/controller/follow_up_logs/FollowUpLogs.php new file mode 100644 index 00000000..890457f2 --- /dev/null +++ b/niucloud/addon/zhjw/app/adminapi/controller/follow_up_logs/FollowUpLogs.php @@ -0,0 +1,157 @@ +request->params([ + ["sales_id",""], + ["staff_id",""], + ["entry_type",""], + ["purchasing_power",""], + ["cognitive_concept",""], + ["schooltime",["",""]], + ["emotional_intensity",""], + ["initial_customer_intent",""], + ["initial_relationship_intent",""], + ["promised_visit_date",["",""]], + ["actual_visit_date",["",""]], + ["is_closed_deal",""], + ["follow_up_type",""], + ["follow_up_time",["",""]], + ["customer_status",""], + ["sign_up_contact_id",""], + ["create_time",["",""]] + ]); + return success((new FollowUpLogsService())->getPage($data)); + } + + /** + * 跟进管理详情 + * @param int $id + * @return \think\Response + */ + public function info(int $id){ + return success((new FollowUpLogsService())->getInfo($id)); + } + + /** + * 添加跟进管理 + * @return \think\Response + */ + public function add(){ + $data = $this->request->params([ + ["sales_id",0], + ["staff_id",0], + ["role_id",0], + ["entry_type",""], + ["requirement",""], + ["purchasing_power",""], + ["cognitive_concept",""], + ["schooltime","2025-03-14 19:18:08"], + ["distance",""], + ["communication_notes",""], + ["decision_maker",""], + ["emotional_intensity",""], + ["initial_customer_intent",""], + ["initial_relationship_intent",""], + ["promised_visit_date","2025-03-14 19:18:08"], + ["actual_visit_date","2025-03-14 19:18:08"], + ["first_visit_feedback",""], + ["second_visit_feedback",""], + ["is_closed_deal",""], + ["follow_up_type",""], + ["follow_up_time","2025-03-14 19:18:08"], + ["audio_upload",""], + ["follow_up_content",""], + ["customer_status",""], + ["sign_up_contact_id",0], + + ]); + $this->validate($data, 'addon\zhjw\app\validate\follow_up_logs\FollowUpLogs.add'); + $id = (new FollowUpLogsService())->add($data); + return success('ADD_SUCCESS', ['id' => $id]); + } + + /** + * 跟进管理编辑 + * @param $id 跟进管理id + * @return \think\Response + */ + public function edit(int $id){ + $data = $this->request->params([ + ["sales_id",0], + ["staff_id",0], + ["role_id",0], + ["entry_type",""], + ["requirement",""], + ["purchasing_power",""], + ["cognitive_concept",""], + ["schooltime","2025-03-14 19:18:08"], + ["distance",""], + ["communication_notes",""], + ["decision_maker",""], + ["emotional_intensity",""], + ["initial_customer_intent",""], + ["initial_relationship_intent",""], + ["promised_visit_date","2025-03-14 19:18:08"], + ["actual_visit_date","2025-03-14 19:18:08"], + ["first_visit_feedback",""], + ["second_visit_feedback",""], + ["is_closed_deal",""], + ["follow_up_type",""], + ["follow_up_time","2025-03-14 19:18:08"], + ["audio_upload",""], + ["follow_up_content",""], + ["customer_status",""], + ["sign_up_contact_id",0], + + ]); + $this->validate($data, 'addon\zhjw\app\validate\follow_up_logs\FollowUpLogs.edit'); + (new FollowUpLogsService())->edit($id, $data); + return success('EDIT_SUCCESS'); + } + + /** + * 跟进管理删除 + * @param $id 跟进管理id + * @return \think\Response + */ + public function del(int $id){ + (new FollowUpLogsService())->del($id); + return success('DELETE_SUCCESS'); + } + + + public function getSalesAll(){ + return success(( new FollowUpLogsService())->getSalesAll()); + } + + public function getStaffAll(){ + return success(( new FollowUpLogsService())->getStaffAll()); + } + +} diff --git a/niucloud/addon/zhjw/app/adminapi/route/route.php b/niucloud/addon/zhjw/app/adminapi/route/route.php index 8ef9d911..9543fad7 100644 --- a/niucloud/addon/zhjw/app/adminapi/route/route.php +++ b/niucloud/addon/zhjw/app/adminapi/route/route.php @@ -381,3 +381,30 @@ Route::group('zhjw', function () { AdminLog::class ]); // USER_CODE_END -- zhjw_sales + +// USER_CODE_BEGIN -- zhjw_follow_up_logs + +Route::group('zhjw', function () { + + //跟进管理列表 + Route::get('follow_up_logs', 'addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@lists'); + //跟进管理详情 + Route::get('follow_up_logs/:id', 'addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@info'); + //添加跟进管理 + Route::post('follow_up_logs', 'addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@add'); + //编辑跟进管理 + Route::put('follow_up_logs/:id', 'addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@edit'); + //删除跟进管理 + Route::delete('follow_up_logs/:id', 'addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@del'); + + Route::get('sales_all','addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@getSalesAll'); + + Route::get('staff_all','addon\zhjw\app\adminapi\controller\follow_up_logs\FollowUpLogs@getStaffAll'); + + +})->middleware([ + AdminCheckToken::class, + AdminCheckRole::class, + AdminLog::class +]); +// USER_CODE_END -- zhjw_follow_up_logs diff --git a/niucloud/addon/zhjw/app/model/follow_up_logs/FollowUpLogs.php b/niucloud/addon/zhjw/app/model/follow_up_logs/FollowUpLogs.php new file mode 100644 index 00000000..babd1333 --- /dev/null +++ b/niucloud/addon/zhjw/app/model/follow_up_logs/FollowUpLogs.php @@ -0,0 +1,310 @@ +where("sales_id", $value); + } + } + + /** + * 搜索器:跟进管理跟进人员 + * @param $value + * @param $data + */ + public function searchStaffIdAttr($query, $value, $data) + { + if ($value) { + $query->where("staff_id", $value); + } + } + + /** + * 搜索器:跟进管理填写人员类型 + * @param $value + * @param $data + */ + public function searchEntryTypeAttr($query, $value, $data) + { + if ($value) { + $query->where("entry_type", $value); + } + } + + /** + * 搜索器:跟进管理购买力 + * @param $value + * @param $data + */ + public function searchPurchasingPowerAttr($query, $value, $data) + { + if ($value) { + $query->where("purchasing_power", $value); + } + } + + /** + * 搜索器:跟进管理认知理念 + * @param $value + * @param $data + */ + public function searchCognitiveConceptAttr($query, $value, $data) + { + if ($value) { + $query->where("cognitive_concept", $value); + } + } + + /** + * 搜索器:跟进管理时间 + * @param $value + * @param $data + */ + public function searchSchooltimeAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["schooltime", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["schooltime", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["schooltime", "<=", $end]]); + } + } + + /** + * 搜索器:跟进管理情感粘度 + * @param $value + * @param $data + */ + public function searchEmotionalIntensityAttr($query, $value, $data) + { + if ($value) { + $query->where("emotional_intensity", $value); + } + } + + /** + * 搜索器:跟进管理客户初步意向度 + * @param $value + * @param $data + */ + public function searchInitialCustomerIntentAttr($query, $value, $data) + { + if ($value) { + $query->where("initial_customer_intent", $value); + } + } + + /** + * 搜索器:跟进管理客情初步意向度 + * @param $value + * @param $data + */ + public function searchInitialRelationshipIntentAttr($query, $value, $data) + { + if ($value) { + $query->where("initial_relationship_intent", $value); + } + } + + /** + * 搜索器:跟进管理承诺到访时间 + * @param $value + * @param $data + */ + public function searchPromisedVisitDateAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["promised_visit_date", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["promised_visit_date", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["promised_visit_date", "<=", $end]]); + } + } + + /** + * 搜索器:跟进管理实际到访时间 + * @param $value + * @param $data + */ + public function searchActualVisitDateAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["actual_visit_date", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["actual_visit_date", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["actual_visit_date", "<=", $end]]); + } + } + + /** + * 搜索器:跟进管理是否关单 + * @param $value + * @param $data + */ + public function searchIsClosedDealAttr($query, $value, $data) + { + if ($value) { + $query->where("is_closed_deal", $value); + } + } + + /** + * 搜索器:跟进管理跟进类型 + * @param $value + * @param $data + */ + public function searchFollowUpTypeAttr($query, $value, $data) + { + if ($value) { + $query->where("follow_up_type", $value); + } + } + + /** + * 搜索器:跟进管理跟进时间 + * @param $value + * @param $data + */ + public function searchFollowUpTimeAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["follow_up_time", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["follow_up_time", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["follow_up_time", "<=", $end]]); + } + } + + /** + * 搜索器:跟进管理客户状态 + * @param $value + * @param $data + */ + public function searchCustomerStatusAttr($query, $value, $data) + { + if ($value) { + $query->where("customer_status", $value); + } + } + + /** + * 搜索器:跟进管理签单意向联系人(员工id) + * @param $value + * @param $data + */ + public function searchSignUpContactIdAttr($query, $value, $data) + { + if ($value) { + $query->where("sign_up_contact_id", $value); + } + } + + /** + * 搜索器:跟进管理添加时间 + * @param $value + * @param $data + */ + public function searchCreateTimeAttr($query, $value, $data) + { + $start = empty($value[0]) ? 0 : strtotime($value[0]); + $end = empty($value[1]) ? 0 : strtotime($value[1]); + if ($start > 0 && $end > 0) { + $query->where([["create_time", "between", [$start, $end]]]); + } else if ($start > 0 && $end == 0) { + $query->where([["create_time", ">=", $start]]); + } else if ($start == 0 && $end > 0) { + $query->where([["create_time", "<=", $end]]); + } + } + + + + + + + public function sales(){ + return $this->hasOne(Sales::class, 'id', 'sales_id')->joinType('left')->withField('student_name,id')->bind(['sales_id_name'=>'student_name']); + } + + public function staff(){ + return $this->hasOne(Staff::class, 'id', 'staff_id')->joinType('left')->withField('name,id')->bind(['staff_id_name'=>'name']); + } + + //签单意向联系人 + public function staffContact(){ + return $this->hasOne(Staff::class, 'id', 'sign_up_contact_id')->joinType('left')->withField('name,id')->bind(['sign_up_contact_id_name'=>'name']); + } + +} diff --git a/niucloud/addon/zhjw/app/service/admin/follow_up_logs/FollowUpLogsService.php b/niucloud/addon/zhjw/app/service/admin/follow_up_logs/FollowUpLogsService.php new file mode 100644 index 00000000..128b9aa3 --- /dev/null +++ b/niucloud/addon/zhjw/app/service/admin/follow_up_logs/FollowUpLogsService.php @@ -0,0 +1,115 @@ +model = new FollowUpLogs(); + } + + /** + * 获取跟进管理列表 + * @param array $where + * @return array + */ + public function getPage(array $where = []) + { + $field = 'id,sales_id,staff_id,role_id,entry_type,requirement,purchasing_power,cognitive_concept,schooltime,distance,communication_notes,decision_maker,emotional_intensity,initial_customer_intent,initial_relationship_intent,promised_visit_date,actual_visit_date,first_visit_feedback,second_visit_feedback,is_closed_deal,follow_up_type,follow_up_time,audio_upload,follow_up_content,customer_status,sign_up_contact_id,is_deleted,create_time,update_time,created_by,created_role,updated_by,updated_role'; + $order = 'id desc'; + + $search_model = $this->model->withSearch(["sales_id", "staff_id", "entry_type", "purchasing_power", "cognitive_concept", "schooltime", "emotional_intensity", "initial_customer_intent", "initial_relationship_intent", "promised_visit_date", "actual_visit_date", "is_closed_deal", "follow_up_type", "follow_up_time", "customer_status", "sign_up_contact_id", "create_time"], $where)->with(['sales', 'staff', 'staff'])->field($field)->order($order); + $list = $this->pageQuery($search_model); + return $list; + } + + /** + * 获取跟进管理信息 + * @param int $id + * @return array + */ + public function getInfo(int $id) + { + $field = 'id,sales_id,staff_id,role_id,entry_type,requirement,purchasing_power,cognitive_concept,schooltime,distance,communication_notes,decision_maker,emotional_intensity,initial_customer_intent,initial_relationship_intent,promised_visit_date,actual_visit_date,first_visit_feedback,second_visit_feedback,is_closed_deal,follow_up_type,follow_up_time,audio_upload,follow_up_content,customer_status,sign_up_contact_id,is_deleted,create_time,update_time,created_by,created_role,updated_by,updated_role'; + + $info = $this->model->field($field)->where([['id', "=", $id]])->with(['sales', 'staff', 'staffContact'])->findOrEmpty()->toArray(); + return $info; + } + + /** + * 添加跟进管理 + * @param array $data + * @return mixed + */ + public function add(array $data) + { + $res = $this->model->create($data); + return $res->id; + + } + + /** + * 跟进管理编辑 + * @param int $id + * @param array $data + * @return bool + */ + public function edit(int $id, array $data) + { + + $this->model->where([['id', '=', $id]])->update($data); + return true; + } + + /** + * 删除跟进管理 + * @param int $id + * @return bool + */ + public function del(int $id) + { + $model = $this->model->where([['id', '=', $id]])->find(); + $res = $model->delete(); + return $res; + } + + + public function getSalesAll() + { + $salesModel = new Sales(); + return $salesModel->select()->toArray(); + } + + public function getStaffAll() + { + $staffModel = new Staff(); + return $staffModel->select()->toArray(); + } + + + + +} diff --git a/niucloud/addon/zhjw/app/validate/follow_up_logs/FollowUpLogs.php b/niucloud/addon/zhjw/app/validate/follow_up_logs/FollowUpLogs.php new file mode 100644 index 00000000..53d29fe4 --- /dev/null +++ b/niucloud/addon/zhjw/app/validate/follow_up_logs/FollowUpLogs.php @@ -0,0 +1,43 @@ + 'require', + 'staff_id' => 'require', + 'role_id' => 'require', + 'entry_type' => 'require', + 'follow_up_time' => 'require', + ]; + + protected $message = [ + 'sales_id.require' => ['common_validate.require', ['sales_id']], + 'staff_id.require' => ['common_validate.require', ['staff_id']], + 'role_id.require' => ['common_validate.require', ['role_id']], + 'entry_type.require' => ['common_validate.require', ['entry_type']], + 'follow_up_time.require' => ['common_validate.require', ['follow_up_time']], + ]; + + protected $scene = [ + "add" => ['sales_id', 'staff_id', 'role_id', 'entry_type', 'requirement', 'purchasing_power', 'cognitive_concept', 'schooltime', 'distance', 'communication_notes', 'decision_maker', 'emotional_intensity', 'initial_customer_intent', 'initial_relationship_intent', 'promised_visit_date', 'actual_visit_date', 'first_visit_feedback', 'second_visit_feedback', 'is_closed_deal', 'follow_up_type', 'follow_up_time', 'audio_upload', 'follow_up_content', 'customer_status', 'sign_up_contact_id'], + "edit" => ['sales_id', 'staff_id', 'role_id', 'entry_type', 'requirement', 'purchasing_power', 'cognitive_concept', 'schooltime', 'distance', 'communication_notes', 'decision_maker', 'emotional_intensity', 'initial_customer_intent', 'initial_relationship_intent', 'promised_visit_date', 'actual_visit_date', 'first_visit_feedback', 'second_visit_feedback', 'is_closed_deal', 'follow_up_type', 'follow_up_time', 'audio_upload', 'follow_up_content', 'customer_status', 'sign_up_contact_id'] + ]; + +}