From bbea58cb0f4ed7132f46d916f31f4cb135919d3b Mon Sep 17 00:00:00 2001 From: Default User Date: Wed, 21 Jan 2026 13:46:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=9F=E8=BF=9B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E7=9B=B4=E6=8E=A5=E5=86=99=E5=85=A5?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=AE=A2=E6=88=B7=E7=B1=BB=E5=9E=8B=E5=92=8C?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=EF=BC=8C=E4=BC=98=E5=8C=96=E5=8D=A0=E4=BD=8D?= =?UTF-8?q?=E7=AC=A6=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/resources/static/index.html | 104 ++++++++++++++++++++--- web/src/main/resources/static/login.html | 6 +- 2 files changed, 94 insertions(+), 16 deletions(-) diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html index 6d26db1..a7a23b5 100644 --- a/web/src/main/resources/static/index.html +++ b/web/src/main/resources/static/index.html @@ -1755,21 +1755,21 @@
@@ -2052,15 +2052,15 @@
- +
- +
- +
@@ -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,73 @@ 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) { + // 客户类型 + document.getElementById('followupType').value = user.type || ''; + + // 客户等级 + document.getElementById('followupLevel').value = user.level || ''; + + // 客户需求 + document.getElementById('followupDemand').value = user.demand || ''; + + // 客户地区(特殊处理) + 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 @@
- +
- +
- +
From 9da2e6dedd0e311aa55e527430ab567b24a1724a Mon Sep 17 00:00:00 2001 From: Default User Date: Wed, 21 Jan 2026 14:04:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=92=8C=E5=AE=A2=E6=88=B7=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E5=A7=8B=E7=BB=88=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A4=BC=E8=B2=8C=E7=94=A8=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/resources/static/index.html | 50 +++++++++++++++++++++--- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html index a7a23b5..584738d 100644 --- a/web/src/main/resources/static/index.html +++ b/web/src/main/resources/static/index.html @@ -2786,14 +2786,54 @@ // 填充表单数据 if (user) { - // 客户类型 - document.getElementById('followupType').value = user.type || ''; + // 客户类型 - 处理中英文映射 + 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; - // 客户等级 - document.getElementById('followupLevel').value = user.level || ''; + // 客户等级 - 处理中英文映射 + 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; // 客户需求 - document.getElementById('followupDemand').value = user.demand || ''; + var demandValue = user.demand || ''; + // 检查是否在下拉选项中存在,如果不存在则设为空 + var demandOptions = ['粉蛋', '粉三', '红蛋', '绿壳', '土鸡蛋', '次品', '白壳']; + if (!demandOptions.includes(demandValue)) { + demandValue = ''; + } + document.getElementById('followupDemand').value = demandValue; // 客户地区(特殊处理) if (user.region) {