diff --git a/backend/src/main/java/com/bycrm/dto/ReportDTO.java b/backend/src/main/java/com/bycrm/dto/ReportDTO.java
index 135468a..d69a40c 100644
--- a/backend/src/main/java/com/bycrm/dto/ReportDTO.java
+++ b/backend/src/main/java/com/bycrm/dto/ReportDTO.java
@@ -40,4 +40,14 @@ public class ReportDTO implements Serializable {
* 报备说明
*/
private String description;
+
+ /**
+ * 项目负责人姓名
+ */
+ private String contactPerson;
+
+ /**
+ * 项目负责人电话
+ */
+ private String contactPhone;
}
diff --git a/backend/src/main/java/com/bycrm/dto/ReportUpdateDTO.java b/backend/src/main/java/com/bycrm/dto/ReportUpdateDTO.java
index 4e09a99..fbda956 100644
--- a/backend/src/main/java/com/bycrm/dto/ReportUpdateDTO.java
+++ b/backend/src/main/java/com/bycrm/dto/ReportUpdateDTO.java
@@ -31,6 +31,16 @@ public class ReportUpdateDTO implements Serializable {
*/
private String description;
+ /**
+ * 项目负责人姓名
+ */
+ private String contactPerson;
+
+ /**
+ * 项目负责人电话
+ */
+ private String contactPhone;
+
/**
* 状态
*/
diff --git a/backend/src/main/java/com/bycrm/entity/Report.java b/backend/src/main/java/com/bycrm/entity/Report.java
index 89a1c28..0101568 100644
--- a/backend/src/main/java/com/bycrm/entity/Report.java
+++ b/backend/src/main/java/com/bycrm/entity/Report.java
@@ -50,6 +50,16 @@ public class Report implements Serializable {
*/
private String description;
+ /**
+ * 项目负责人姓名
+ */
+ private String contactPerson;
+
+ /**
+ * 项目负责人电话
+ */
+ private String contactPhone;
+
/**
* 状态:0-待审核 1-已通过 2-已驳回 3-已失效 4-已作废
*/
diff --git a/backend/src/main/java/com/bycrm/service/impl/ReportServiceImpl.java b/backend/src/main/java/com/bycrm/service/impl/ReportServiceImpl.java
index 5e070b3..36dd425 100644
--- a/backend/src/main/java/com/bycrm/service/impl/ReportServiceImpl.java
+++ b/backend/src/main/java/com/bycrm/service/impl/ReportServiceImpl.java
@@ -6,10 +6,12 @@ import com.bycrm.dto.PageQuery;
import com.bycrm.dto.ReportAuditDTO;
import com.bycrm.dto.ReportDTO;
import com.bycrm.dto.ReportUpdateDTO;
+import com.bycrm.entity.Dealer;
import com.bycrm.entity.Report;
import com.bycrm.entity.School;
import com.bycrm.entity.User;
import com.bycrm.exception.BusinessException;
+import com.bycrm.mapper.DealerMapper;
import com.bycrm.mapper.ReportMapper;
import com.bycrm.mapper.SchoolMapper;
import com.bycrm.mapper.UserMapper;
@@ -35,15 +37,18 @@ public class ReportServiceImpl implements ReportService {
private final ReportMapper reportMapper;
private final SchoolMapper schoolMapper;
private final UserMapper userMapper;
+ private final DealerMapper dealerMapper;
private final SystemConfigService systemConfigService;
public ReportServiceImpl(ReportMapper reportMapper,
SchoolMapper schoolMapper,
UserMapper userMapper,
+ DealerMapper dealerMapper,
SystemConfigService systemConfigService) {
this.reportMapper = reportMapper;
this.schoolMapper = schoolMapper;
this.userMapper = userMapper;
+ this.dealerMapper = dealerMapper;
this.systemConfigService = systemConfigService;
}
@@ -121,6 +126,27 @@ public class ReportServiceImpl implements ReportService {
}
}
+ // 查询经销商信息,获取默认的联系人信息
+ String defaultContactPerson = null;
+ String defaultContactPhone = null;
+ if (currentUser.getDealerId() != null) {
+ Dealer dealer = dealerMapper.selectById(currentUser.getDealerId());
+ if (dealer != null) {
+ defaultContactPerson = dealer.getContactPerson();
+ defaultContactPhone = dealer.getContactPhone();
+ }
+ }
+
+ // 如果用户没有填写联系人信息,使用经销商信息作为默认值
+ String contactPerson = reportDTO.getContactPerson();
+ if (contactPerson == null || contactPerson.trim().isEmpty()) {
+ contactPerson = defaultContactPerson;
+ }
+ String contactPhone = reportDTO.getContactPhone();
+ if (contactPhone == null || contactPhone.trim().isEmpty()) {
+ contactPhone = defaultContactPhone;
+ }
+
// 创建报备
Report report = new Report();
report.setDealerId(currentUser.getDealerId());
@@ -129,6 +155,8 @@ public class ReportServiceImpl implements ReportService {
report.setProduct(reportDTO.getProduct());
report.setProjectType(reportDTO.getProjectType());
report.setDescription(reportDTO.getDescription());
+ report.setContactPerson(contactPerson);
+ report.setContactPhone(contactPhone);
report.setStatus(Constants.REPORT_STATUS_PENDING);
report.setCreatedAt(LocalDateTime.now());
report.setUpdatedAt(LocalDateTime.now());
@@ -203,6 +231,8 @@ public class ReportServiceImpl implements ReportService {
report.setProduct(updateDTO.getProduct());
report.setProjectType(updateDTO.getProjectType());
report.setDescription(updateDTO.getDescription());
+ report.setContactPerson(updateDTO.getContactPerson());
+ report.setContactPhone(updateDTO.getContactPhone());
report.setStatus(updateDTO.getStatus());
report.setCancelReason(updateDTO.getCancelReason());
report.setUpdatedAt(LocalDateTime.now());
diff --git a/backend/src/main/java/com/bycrm/service/impl/UserServiceImpl.java b/backend/src/main/java/com/bycrm/service/impl/UserServiceImpl.java
index b327062..aa4144a 100644
--- a/backend/src/main/java/com/bycrm/service/impl/UserServiceImpl.java
+++ b/backend/src/main/java/com/bycrm/service/impl/UserServiceImpl.java
@@ -3,8 +3,10 @@ package com.bycrm.service.impl;
import com.bycrm.common.Constants;
import com.bycrm.dto.ChangePasswordDTO;
import com.bycrm.dto.ResetPasswordDTO;
+import com.bycrm.entity.Dealer;
import com.bycrm.entity.User;
import com.bycrm.exception.BusinessException;
+import com.bycrm.mapper.DealerMapper;
import com.bycrm.mapper.UserMapper;
import com.bycrm.service.UserService;
import com.bycrm.util.JwtUtil;
@@ -20,11 +22,13 @@ public class UserServiceImpl implements UserService {
private final UserMapper userMapper;
private final JwtUtil jwtUtil;
+ private final DealerMapper dealerMapper;
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
- public UserServiceImpl(UserMapper userMapper, JwtUtil jwtUtil) {
+ public UserServiceImpl(UserMapper userMapper, JwtUtil jwtUtil, DealerMapper dealerMapper) {
this.userMapper = userMapper;
this.jwtUtil = jwtUtil;
+ this.dealerMapper = dealerMapper;
}
@Override
@@ -71,6 +75,16 @@ public class UserServiceImpl implements UserService {
vo.setDealerName(user.getDealerName());
vo.setRole(user.getRole());
vo.setRoleDesc(user.getRole() == Constants.USER_ROLE_ADMIN ? "管理员" : "经销商用户");
+
+ // 如果是经销商用户,查询经销商的联系人信息
+ if (user.getDealerId() != null) {
+ Dealer dealer = dealerMapper.selectById(user.getDealerId());
+ if (dealer != null) {
+ vo.setDealerContactPerson(dealer.getContactPerson());
+ vo.setDealerContactPhone(dealer.getContactPhone());
+ }
+ }
+
return vo;
}
diff --git a/backend/src/main/java/com/bycrm/vo/ReportVO.java b/backend/src/main/java/com/bycrm/vo/ReportVO.java
index 245bf9e..ffc1787 100644
--- a/backend/src/main/java/com/bycrm/vo/ReportVO.java
+++ b/backend/src/main/java/com/bycrm/vo/ReportVO.java
@@ -55,6 +55,16 @@ public class ReportVO implements Serializable {
*/
private String description;
+ /**
+ * 项目负责人姓名
+ */
+ private String contactPerson;
+
+ /**
+ * 项目负责人电话
+ */
+ private String contactPhone;
+
/**
* 状态:0-待审核 1-已通过 2-已驳回 3-已失效 4-已作废
*/
diff --git a/backend/src/main/java/com/bycrm/vo/UserInfoVO.java b/backend/src/main/java/com/bycrm/vo/UserInfoVO.java
index e3b91ab..9b9904d 100644
--- a/backend/src/main/java/com/bycrm/vo/UserInfoVO.java
+++ b/backend/src/main/java/com/bycrm/vo/UserInfoVO.java
@@ -37,6 +37,16 @@ public class UserInfoVO implements Serializable {
*/
private String dealerName;
+ /**
+ * 经销商联系人
+ */
+ private String dealerContactPerson;
+
+ /**
+ * 经销商联系电话
+ */
+ private String dealerContactPhone;
+
/**
* 角色:0-管理员 1-经销商用户
*/
diff --git a/backend/src/main/resources/mapper/ReportMapper.xml b/backend/src/main/resources/mapper/ReportMapper.xml
index bf79882..68f622b 100644
--- a/backend/src/main/resources/mapper/ReportMapper.xml
+++ b/backend/src/main/resources/mapper/ReportMapper.xml
@@ -11,6 +11,8 @@
+
+
@@ -91,8 +93,8 @@
- INSERT INTO crm_report (dealer_id, school_id, school_name, product, project_type, description, status, protect_start_date, protect_end_date)
- VALUES (#{dealerId}, #{schoolId}, #{schoolName}, #{product}, #{projectType}, #{description}, #{status}, #{protectStartDate}, #{protectEndDate})
+ INSERT INTO crm_report (dealer_id, school_id, school_name, product, project_type, description, contact_person, contact_phone, status, protect_start_date, protect_end_date)
+ VALUES (#{dealerId}, #{schoolId}, #{schoolName}, #{product}, #{projectType}, #{description}, #{contactPerson}, #{contactPhone}, #{status}, #{protectStartDate}, #{protectEndDate})
@@ -101,6 +103,8 @@
product = #{product},
project_type = #{projectType},
description = #{description},
+ contact_person = #{contactPerson},
+ contact_phone = #{contactPhone},
status = #{status},
reject_reason = #{rejectReason},
cancel_reason = #{cancelReason},
diff --git a/by-crm-crm-backend-2026.01.27.tar b/by-crm-crm-backend-2026.01.27.tar
new file mode 100644
index 0000000..cf779bd
Binary files /dev/null and b/by-crm-crm-backend-2026.01.27.tar differ
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index d083809..221dafb 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -5,6 +5,8 @@ export interface User {
realName: string
dealerId?: number
dealerName?: string
+ dealerContactPerson?: string
+ dealerContactPhone?: string
role: number
roleDesc: string
}
@@ -65,6 +67,8 @@ export interface Report {
product?: string
projectType?: string
description?: string
+ contactPerson?: string
+ contactPhone?: string
status: number
statusDesc: string
rejectReason?: string
@@ -82,6 +86,8 @@ export interface ReportForm {
product: string
projectType: string
description?: string
+ contactPerson?: string
+ contactPhone?: string
}
export interface ReportAuditForm {
@@ -93,6 +99,8 @@ export interface ReportUpdateForm {
product: string
projectType: string
description?: string
+ contactPerson?: string
+ contactPhone?: string
status: number
cancelReason?: string
}
diff --git a/frontend/src/views/Report.vue b/frontend/src/views/Report.vue
index bcfa3a7..f3e3982 100644
--- a/frontend/src/views/Report.vue
+++ b/frontend/src/views/Report.vue
@@ -45,6 +45,8 @@
+
+
@@ -118,7 +120,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ currentReport?.projectType || '-' }}
+
+ {{ currentReport?.contactPerson || '-' }}
+
+
+ {{ currentReport?.contactPhone || '-' }}
+
待审核
已通过
@@ -398,7 +434,9 @@ const formData = reactive({
schoolName: '',
product: '',
projectType: '',
- description: ''
+ description: '',
+ contactPerson: '',
+ contactPhone: ''
})
const auditForm = reactive({
@@ -410,6 +448,8 @@ const editFormData = reactive({
product: '',
projectType: '',
description: '',
+ contactPerson: '',
+ contactPhone: '',
status: 1,
cancelReason: ''
})
@@ -559,6 +599,13 @@ const handleReset = () => {
// 新增按钮
const handleAdd = () => {
+ // 自动填充经销商的联系人和电话
+ if (userStore.userInfo?.dealerContactPerson) {
+ formData.contactPerson = userStore.userInfo.dealerContactPerson
+ }
+ if (userStore.userInfo?.dealerContactPhone) {
+ formData.contactPhone = userStore.userInfo.dealerContactPhone
+ }
dialogVisible.value = true
}
@@ -583,6 +630,8 @@ const handleEdit = (row: Report) => {
editFormData.product = row.product || ''
editFormData.projectType = row.projectType || ''
editFormData.description = row.description || ''
+ editFormData.contactPerson = row.contactPerson || ''
+ editFormData.contactPhone = row.contactPhone || ''
editFormData.status = row.status
editFormData.cancelReason = row.cancelReason || ''
editDialogVisible.value = true
@@ -595,6 +644,8 @@ const handleEditDialogClose = () => {
product: '',
projectType: '',
description: '',
+ contactPerson: '',
+ contactPhone: '',
status: 1,
cancelReason: ''
})
@@ -683,7 +734,9 @@ const handleDialogClose = () => {
schoolName: '',
product: '',
projectType: '',
- description: ''
+ description: '',
+ contactPerson: '',
+ contactPhone: ''
})
selectedSchool.value = null
}