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) {