diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html
index 6d26db1..584738d 100644
--- a/web/src/main/resources/static/index.html
+++ b/web/src/main/resources/static/index.html
@@ -1755,21 +1755,21 @@
@@ -2446,6 +2446,12 @@
}
function mapUserType(type) {
+ // 如果已经是中文,则直接返回
+ var chineseTypes = ['大贸易客户', '供应商', '两者都是', '小品种客户', '批发贸易类', '电商平台类', '配送零售类', '次品蛋专项类', '其他类型'];
+ if (chineseTypes.includes(type)) {
+ return type;
+ }
+
var typeMap = {
'buyer': '大贸易客户',
'seller': '供应商',
@@ -2461,6 +2467,12 @@
}
function mapUserLevel(level) {
+ // 如果已经是中文,则直接返回
+ var chineseLevels = ['A-重要客户', 'B-普通客户', 'C-低价值客户', 'D-物流自提客户', '-'];
+ if (chineseLevels.includes(level)) {
+ return level;
+ }
+
var levelMap = {
'important': 'A-重要客户',
'ordinary': 'B-普通客户',
@@ -2748,7 +2760,113 @@
document.getElementById('followupUserId').value = userId;
document.getElementById('followupUserName').value = userName;
document.getElementById('followupPhone').value = phone;
- document.getElementById('followupContent').value = '';
+
+ // 查找用户数据
+ var user = null;
+
+ // 首先在个人数据中查找
+ if (allPersonalData.length > 0) {
+ for (var i = 0; i < allPersonalData.length; i++) {
+ if (allPersonalData[i].userId === userId) {
+ user = allPersonalData[i];
+ break;
+ }
+ }
+ }
+
+ // 如果在个人数据中找不到,尝试在公海池数据中查找
+ if (!user && allPublicData.length > 0) {
+ for (var i = 0; i < allPublicData.length; i++) {
+ if (allPublicData[i].userId === userId) {
+ user = allPublicData[i];
+ break;
+ }
+ }
+ }
+
+ // 填充表单数据
+ if (user) {
+ // 客户类型 - 处理中英文映射
+ var typeValue = user.type || '';
+ // 检查是否为英文值,如果是则转换为中文
+ var typeMap = {
+ 'buyer': '大贸易客户',
+ 'seller': '供应商',
+ 'both': '两者都是',
+ 'smalls': '小品种客户',
+ 'wholesale': '批发贸易类',
+ 'e-commerce': '电商平台类',
+ 'delivery_retail': '配送零售类',
+ 'defective_egg': '次品蛋专项类',
+ 'other': '其他类型'
+ };
+ typeValue = typeMap[typeValue] || typeValue;
+ // 检查是否在下拉选项中存在,如果不存在则设为空
+ var typeOptions = ['批发贸易类', '电商平台类', '配送零售类', '次品蛋专项类', '其他类型'];
+ if (!typeOptions.includes(typeValue)) {
+ typeValue = '';
+ }
+ document.getElementById('followupType').value = typeValue;
+
+ // 客户等级 - 处理中英文映射
+ var levelValue = user.level || '';
+ // 检查是否为英文值,如果是则转换为中文
+ var levelMap = {
+ 'important': 'A-重要客户',
+ 'ordinary': 'B-普通客户',
+ 'low_value': 'C-低价值客户',
+ 'logistics': 'D-物流自提客户',
+ 'unclassified': ''
+ };
+ levelValue = levelMap[levelValue] || levelValue;
+ // 检查是否在下拉选项中存在,如果不存在则设为空
+ var levelOptions = ['A-重要客户', 'B-普通客户', 'C-低价值客户', 'D-物流自提客户'];
+ if (!levelOptions.includes(levelValue)) {
+ levelValue = '';
+ }
+ document.getElementById('followupLevel').value = levelValue;
+
+ // 客户需求
+ var demandValue = user.demand || '';
+ // 检查是否在下拉选项中存在,如果不存在则设为空
+ var demandOptions = ['粉蛋', '粉三', '红蛋', '绿壳', '土鸡蛋', '次品', '白壳'];
+ if (!demandOptions.includes(demandValue)) {
+ demandValue = '';
+ }
+ document.getElementById('followupDemand').value = demandValue;
+
+ // 客户地区(特殊处理)
+ if (user.region) {
+ document.getElementById('followupRegion').value = user.region;
+ document.getElementById('followupRegionDisplay').textContent = user.region;
+ document.getElementById('followupRegionDisplay').style.color = '#333';
+ } else {
+ document.getElementById('followupRegion').value = '';
+ document.getElementById('followupRegionDisplay').textContent = '请选择客户地区';
+ document.getElementById('followupRegionDisplay').style.color = '#999';
+ }
+
+ // 详细地址
+ document.getElementById('followupDetailedAddress').value = user.detailedaddress || '';
+
+ // 客户公司
+ document.getElementById('followupCompany').value = user.company || '';
+
+ // 跟进内容
+ document.getElementById('followupContent').value = user.followup || '';
+ } else {
+ // 如果没有找到用户数据,清空表单
+ document.getElementById('followupType').value = '';
+ document.getElementById('followupLevel').value = '';
+ document.getElementById('followupDemand').value = '';
+ document.getElementById('followupRegion').value = '';
+ document.getElementById('followupRegionDisplay').textContent = '请选择客户地区';
+ document.getElementById('followupRegionDisplay').style.color = '#999';
+ document.getElementById('followupDetailedAddress').value = '';
+ document.getElementById('followupCompany').value = '';
+ document.getElementById('followupContent').value = '';
+ }
+
document.getElementById('followupModal').style.display = 'block';
// 防止背景滚动
document.body.style.overflow = 'hidden';
diff --git a/web/src/main/resources/static/login.html b/web/src/main/resources/static/login.html
index e107cf4..b5e44f9 100644
--- a/web/src/main/resources/static/login.html
+++ b/web/src/main/resources/static/login.html
@@ -89,15 +89,15 @@