提示
@@ -984,12 +1307,180 @@
`;
+ // 客户类型说明弹窗HTML
+ var typeHelpModalHTML = `
+
+
+
客户类型说明
+
+
批发贸易类
+
核心判断标准:1.单次采购为整车量级;2.车型规格涵盖 4.2 米、6.8 米、9.6米;3.采购量达对应车型满载/准满载标准
+
需求特点:1.采购量大,合作频次稳定;2.对供货时效、产品一致性要求高;3.重视批量采购价格优势与长期供货稳定
+
+
+
电商平台类
+
核心判断标准:1.单次采购为整车小码规格货品;2.货品需符合电商分装、物流、销售标准;3.订单具备持续性与稳定性
+
需求特点:1.对包装标准化、溯源信息完整性要求高;2.需匹配电商仓储入库、分拣发货流程;3.关注库存周转率与供货节奏同步
+
+
+
配送零售类
+
核心判断标准:1.采购辐射范围为周边鸡场;2.单次采购量 10-200 件;3.采购模式为小批量、多频次补货
+
需求特点:1.采购半径小,对配送时效要求极高;2.极度关注货品新鲜度与品质稳定性;3.需求存在应急补货场景
+
+
+
次品蛋专项类
+
核心判断标准:1.采购品类仅限次品蛋(下架蛋、裂纹蛋);2.不涉及任何合格商品蛋;3.采购用途为食品深加工/饲料原料等
+
需求特点:1.对价格敏感度极高;2.不关注货品外观品相;3.要求货源稳定、批次可控
+
+
+
其他类型
+
核心判断标准:其他核心判断标准
+
需求特点:其他需求特点
+
+
+
+
+
+
+ `;
+
// 添加弹窗到页面
document.body.insertAdjacentHTML('beforeend', followupModalHTML);
document.body.insertAdjacentHTML('beforeend', returnModalHTML);
document.body.insertAdjacentHTML('beforeend', jianDaoYunModalHTML);
document.body.insertAdjacentHTML('beforeend', assignModalHTML);
document.body.insertAdjacentHTML('beforeend', alertModalHTML);
+ document.body.insertAdjacentHTML('beforeend', typeHelpModalHTML);
+
+ // 为模态框添加点击外部关闭功能
+ function addModalOutsideClose(modalId) {
+ const modal = document.getElementById(modalId);
+ if (modal) {
+ modal.addEventListener('click', function(e) {
+ // 点击的是模态框背景本身而不是内容
+ if (e.target === modal) {
+ // 根据不同模态框调用对应的关闭函数
+ if (modalId === 'followupModal') {
+ closeFollowupModal();
+ } else if (modalId === 'returnModal') {
+ closeReturnModal();
+ } else if (modalId === 'jianDaoYunModal') {
+ closeJianDaoYunModal();
+ } else if (modalId === 'alertModal') {
+ closeAlertModal();
+ } else if (modalId === 'assignModal') {
+ closeAssignModal();
+ } else if (modalId === 'typeHelpModal') {
+ closeTypeHelpModal();
+ }
+ }
+ });
+ }
+ }
+
+ // 为所有模态框添加点击外部关闭功能
+ addModalOutsideClose('followupModal');
+ addModalOutsideClose('returnModal');
+ addModalOutsideClose('jianDaoYunModal');
+ addModalOutsideClose('alertModal');
+ addModalOutsideClose('assignModal');
+ addModalOutsideClose('typeHelpModal');
+
+ function showTypeHelp() {
+ document.getElementById('typeHelpModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
+ }
+
+ function closeTypeHelpModal() {
+ document.getElementById('typeHelpModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
+ }
+
+ // 搜索选择组件相关函数
+ let currentOpenSelect = null;
+
+ // 切换搜索选择下拉框
+ function toggleSearchSelect(selectId) {
+ const dropdown = document.getElementById(selectId + 'Dropdown');
+ const searchInput = document.getElementById(selectId + 'Search');
+
+ // 关闭其他已打开的选择框
+ if (currentOpenSelect && currentOpenSelect !== selectId) {
+ closeSearchSelect(currentOpenSelect);
+ }
+
+ // 切换当前选择框
+ if (dropdown.style.display === 'block') {
+ closeSearchSelect(selectId);
+ currentOpenSelect = null;
+ } else {
+ dropdown.style.display = 'block';
+ searchInput.style.display = 'block';
+ searchInput.focus();
+ currentOpenSelect = selectId;
+ }
+ }
+
+ // 关闭搜索选择下拉框
+ function closeSearchSelect(selectId) {
+ const dropdown = document.getElementById(selectId + 'Dropdown');
+ const searchInput = document.getElementById(selectId + 'Search');
+ dropdown.style.display = 'none';
+ searchInput.style.display = 'none';
+ searchInput.value = '';
+ // 显示所有选项
+ const options = dropdown.querySelectorAll('.search-select-option');
+ options.forEach(option => {
+ option.style.display = 'block';
+ });
+ }
+
+ // 过滤地区选项
+ function filterRegions() {
+ const searchInput = document.getElementById('followupRegionSearch');
+ const filter = searchInput.value.toLowerCase();
+ const dropdown = document.getElementById('followupRegionDropdown');
+ const options = dropdown.querySelectorAll('.search-select-option');
+
+ options.forEach(option => {
+ const text = option.textContent.toLowerCase();
+ if (text.includes(filter)) {
+ option.style.display = 'block';
+ } else {
+ option.style.display = 'none';
+ }
+ });
+ }
+
+ // 选择地区
+ function selectRegion(region) {
+ const display = document.getElementById('followupRegionDisplay');
+ const hiddenInput = document.getElementById('followupRegion');
+
+ if (region) {
+ display.textContent = region;
+ display.style.color = '#333';
+ } else {
+ display.textContent = '请选择客户地区';
+ display.style.color = '#999';
+ }
+
+ hiddenInput.value = region;
+ closeSearchSelect('followupRegion');
+ currentOpenSelect = null;
+ }
+
+ // 点击外部关闭下拉框
+ document.addEventListener('click', function(event) {
+ if (!event.target.closest('.search-select')) {
+ if (currentOpenSelect) {
+ closeSearchSelect(currentOpenSelect);
+ currentOpenSelect = null;
+ }
+ }
+ });
function formatDateTime(dateTimeString) {
if (!dateTimeString) return '-';
@@ -1008,7 +1499,12 @@
'buyer': '大贸易客户',
'seller': '供应商',
'both': '两者都是',
- 'smalls': '小品种客户'
+ 'smalls': '小品种客户',
+ 'wholesale': '批发贸易类',
+ 'e-commerce': '电商平台类',
+ 'delivery_retail': '配送零售类',
+ 'defective_egg': '次品蛋专项类',
+ 'other': '其他类型'
};
return typeMap[type] || type;
}
@@ -1246,7 +1742,7 @@
role: usersManagements.role || ''
};
- var url = 'http://8.137.125.67:8083/KH/api/users/claim';
+ var url = '/KH/api/users/claim';
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
@@ -1273,17 +1769,48 @@
document.getElementById('followupPhone').value = phone;
document.getElementById('followupContent').value = '';
document.getElementById('followupModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
}
function closeFollowupModal() {
document.getElementById('followupModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
}
function saveFollowup() {
var userId = document.getElementById('followupUserId').value;
var content = document.getElementById('followupContent').value;
+ var type = document.getElementById('followupType').value;
+ var level = document.getElementById('followupLevel').value;
+ var detailedAddress = document.getElementById('followupDetailedAddress').value;
+ var company = document.getElementById('followupCompany').value;
+ var demand = document.getElementById('followupDemand').value;
+ var region = document.getElementById('followupRegion').value;
var usersManagements = userInfo.usersManagements;
+ // 验证必填字段
+ if (!type) {
+ showAlert('请选择客户类型');
+ return;
+ }
+ if (!level) {
+ showAlert('请选择客户等级');
+ return;
+ }
+ if (!demand) {
+ showAlert('请选择客户需求');
+ return;
+ }
+ if (!region) {
+ showAlert('请选择客户地区');
+ return;
+ }
+ if (!company) {
+ showAlert('请填写客户公司');
+ return;
+ }
if (!content) {
showAlert('请填写跟进内容');
return;
@@ -1292,6 +1819,12 @@
var params = {
userId: userId,
followup: content,
+ type: type,
+ level: level,
+ detailedaddress: detailedAddress,
+ company: company,
+ demand: demand,
+ region: region,
userName: usersManagements.userName || '',
managercompany: usersManagements.managercompany || '',
managerdepartment: usersManagements.managerdepartment || '',
@@ -1299,7 +1832,7 @@
role: usersManagements.role || ''
};
- var url = 'http://8.137.125.67:8083/KH/api/users/followup';
+ var url = '/KH/api/users/followup';
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
@@ -1330,10 +1863,14 @@
document.getElementById('returnPhone').value = phone;
document.getElementById('returnType').value = type || '采购员';
document.getElementById('returnModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
}
function closeReturnModal() {
document.getElementById('returnModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
}
function openJianDaoYunModal(userId, userName, followup) {
@@ -1344,19 +1881,27 @@
}
document.getElementById('jianDaoYunUserId').value = userId;
document.getElementById('jianDaoYunModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
}
function closeJianDaoYunModal() {
document.getElementById('jianDaoYunModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
}
function showAlert(message) {
document.getElementById('alertMessage').textContent = message;
document.getElementById('alertModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
}
function closeAlertModal() {
document.getElementById('alertModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
}
function saveJianDaoYun() {
@@ -1372,7 +1917,7 @@
role: usersManagements.role || ''
};
- var url = 'http://8.137.125.67:8083/KH/api/users/jianDaoYun';
+ var url = '/KH/api/users/jianDaoYun';
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
@@ -1408,7 +1953,7 @@
role: usersManagements.role || ''
};
- var url = 'http://8.137.125.67:8083/KH/api/users/return';
+ var url = '/KH/api/users/return';
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
From 65c5695900ade05c7d9692d09fd5f704dfdfbb60 Mon Sep 17 00:00:00 2001
From: Default User
Date: Tue, 20 Jan 2026 16:43:39 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?=
=?UTF-8?q?=E7=B1=BB=E9=85=8D=E7=BD=AE=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/test/java/com/example/WebApplicationTests.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/src/test/java/com/example/WebApplicationTests.java b/web/src/test/java/com/example/WebApplicationTests.java
index 6a70368..fec2b0b 100644
--- a/web/src/test/java/com/example/WebApplicationTests.java
+++ b/web/src/test/java/com/example/WebApplicationTests.java
@@ -3,7 +3,7 @@ package com.example;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
-@SpringBootTest
+@SpringBootTest(classes = com.example.web.WebApplication.class)
class WebApplicationTests {
@Test
From c5850a36b271b4bd082bd8c1cc32e0dd85a2eb57 Mon Sep 17 00:00:00 2001
From: Default User
Date: Tue, 20 Jan 2026 17:19:06 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=9F=E8=B4=A3?=
=?UTF-8?q?=E4=BA=BA=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD=EF=BC=9A=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E7=BC=BA=E5=A4=B1=E7=9A=84managerName=E6=9D=A1?=
=?UTF-8?q?=E4=BB=B6=E5=88=B0=E6=89=80=E6=9C=89=E7=9B=B8=E5=85=B3=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/main/resources/mapper/UsersMapper.xml | 46 +++++++++++++++----
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/web/src/main/resources/mapper/UsersMapper.xml b/web/src/main/resources/mapper/UsersMapper.xml
index 9e237e6..e28706e 100644
--- a/web/src/main/resources/mapper/UsersMapper.xml
+++ b/web/src/main/resources/mapper/UsersMapper.xml
@@ -14,6 +14,9 @@
AND um.userName = #{userName}
+
+ AND um.userName = #{managerName}
+
AND um.managercompany = #{managercompany}
@@ -45,6 +48,9 @@
AND um.userName = #{userName}
+
+ AND um.userName = #{managerName}
+
AND um.managercompany = #{managercompany}
@@ -74,12 +80,15 @@
AND role = #{role}
)
AND u.type != 'Colleague'
+
+ AND EXISTS (SELECT 1 FROM usermanagements um WHERE um.userId = u.userId AND um.userName = #{managerName})
+
ORDER BY u.created_at DESC
LIMIT #{offset}, #{limit}
@@ -136,21 +151,32 @@
OR (um.organization IS NOT NULL AND um.organization != '')
OR (um.role IS NOT NULL AND um.role != '')
OR (um.userName IS NOT NULL AND um.userName != ''))
+
+ AND um.userName = #{managerName}
+