Browse Source

修改跟进功能:直接写入中文客户类型和等级,优化占位符文本

pull/10/head
Default User 1 month ago
parent
commit
bbea58cb0f
  1. 102
      web/src/main/resources/static/index.html
  2. 6
      web/src/main/resources/static/login.html

102
web/src/main/resources/static/index.html

@ -1755,21 +1755,21 @@
</div>
<select id="followupType" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; cursor: pointer; transition: all 0.3s ease;">
<option value="">请选择客户类型</option>
<option value="wholesale">批发贸易类</option>
<option value="e-commerce">电商平台类</option>
<option value="delivery_retail">配送零售类</option>
<option value="defective_egg">次品蛋专项类</option>
<option value="other">其他类型</option>
<option value="批发贸易类">批发贸易类</option>
<option value="电商平台类">电商平台类</option>
<option value="配送零售类">配送零售类</option>
<option value="次品蛋专项类">次品蛋专项类</option>
<option value="其他类型">其他类型</option>
</select>
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;"><span style="color: #ff4d4f;">*</span> 客户等级</label>
<select id="followupLevel" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; cursor: pointer; transition: all 0.3s ease;">
<option value="">请选择客户等级</option>
<option value="important">A-重要客户</option>
<option value="ordinary">B-普通客户</option>
<option value="low_value">C-低价值客户</option>
<option value="logistics">D-物流自提客户</option>
<option value="A-重要客户">A-重要客户</option>
<option value="B-普通客户">B-普通客户</option>
<option value="C-低价值客户">C-低价值客户</option>
<option value="D-物流自提客户">D-物流自提客户</option>
</select>
</div>
<div style="margin-bottom: 20px;">
@ -2052,15 +2052,15 @@
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;">详细地址</label>
<input type="text" id="followupDetailedAddress" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: all 0.3s ease;">
<input type="text" id="followupDetailedAddress" placeholder="请输入详细地址" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: all 0.3s ease;">
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;"><span style="color: #ff4d4f;">*</span> 客户公司</label>
<input type="text" id="followupCompany" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: all 0.3s ease;">
<input type="text" id="followupCompany" placeholder="请输入客户公司" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: all 0.3s ease;">
</div>
<div style="margin-bottom: 24px;">
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;"><span style="color: #ff4d4f;">*</span> 跟进内容</label>
<textarea id="followupContent" rows="3" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; resize: vertical; transition: all 0.3s ease;"></textarea>
<textarea id="followupContent" placeholder="请输入跟进内容" rows="3" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; resize: vertical; transition: all 0.3s ease;"></textarea>
</div>
<div style="text-align: right; margin-top: 24px;">
<button onclick="closeFollowupModal()" style="padding: 10px 16px; margin-right: 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; color: #666; background-color: white; cursor: pointer; transition: all 0.3s ease;">取消</button>
@ -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;
// 查找用户数据
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';

6
web/src/main/resources/static/login.html

@ -89,15 +89,15 @@
<form id="loginForm">
<div class="form-group">
<label for="projectName">职位名称</label>
<input type="text" id="projectName" name="projectName" required>
<input type="text" id="projectName" name="projectName" placeholder="请输入职位名称" required>
</div>
<div class="form-group">
<label for="userName">用户名</label>
<input type="text" id="userName" name="userName" required>
<input type="text" id="userName" name="userName" placeholder="请输入用户名" required>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<input type="password" id="password" name="password" placeholder="请输入密码" required>
</div>
<button type="submit">登录</button>
<div id="errorMessage" class="error-message"></div>

Loading…
Cancel
Save