Browse Source

添加地区搜索功能、优化必填字段提示、添加其他客户类型

pull/2/head
Default User 2 months ago
parent
commit
5b76302843
  1. 9
      web/src/main/java/com/example/web/entity/Users.java
  2. 8
      web/src/main/resources/mapper/UsersMapper.xml
  3. 571
      web/src/main/resources/static/index.html

9
web/src/main/java/com/example/web/entity/Users.java

@ -29,6 +29,7 @@ public class Users {
private LocalDateTime updated_at;//更新时间
private String company;//客户公司
private String region;//客户地区
private String detailedaddress;//详细地址
private String level;//客户等级
private String demand;//客户需求
private String spec;//规格
@ -176,6 +177,14 @@ public class Users {
this.region = region;
}
public String getDetailedaddress() {
return detailedaddress;
}
public void setDetailedaddress(String detailedaddress) {
this.detailedaddress = detailedaddress;
}
public String getLevel() {
return level;
}

8
web/src/main/resources/mapper/UsersMapper.xml

@ -180,7 +180,13 @@
<update id="updateFollowup" parameterType="java.util.Map">
UPDATE users
SET followup = #{followup},
followup_at = NOW()
followup_at = NOW(),
type = #{type},
level = #{level},
detailedaddress = #{detailedaddress},
company = #{company},
demand = #{demand},
region = #{region}
WHERE userId = #{userId}
</update>

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

@ -409,6 +409,19 @@
#returnModal button:active {
transform: translateY(0);
}
/* 搜索选择组件样式 */
.search-select-option:hover {
background-color: #f0f7ff;
color: #1890ff;
}
/* 搜索输入框焦点样式 */
#followupRegionSearch:focus {
outline: none;
border-color: #1890ff;
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}
</style>
</head>
<body>
@ -657,7 +670,7 @@
role: usersManagements.role || ''
};
var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params);
var url = '/KH/api/users?' + objectToQueryString(params);
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
@ -695,7 +708,7 @@
role: usersManagements.role || ''
};
var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params);
var url = '/KH/api/users?' + objectToQueryString(params);
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
@ -852,7 +865,7 @@
role: usersManagements.role || ''
};
var url = 'http://8.137.125.67:8083/KH/api/users/public?' + objectToQueryString(params);
var url = '/KH/api/users/public?' + objectToQueryString(params);
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
@ -874,8 +887,8 @@
// 跟进弹窗HTML
var followupModalHTML = `
<div id="followupModal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; z-index: 1000; animation: fadeIn 0.3s ease;">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 24px; border-radius: 8px; width: 450px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease;">
<div id="followupModal" style="position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0,0,0,0.5); display: none; z-index: 9999; animation: fadeIn 0.3s ease; overflow: hidden; pointer-events: auto;">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 24px; border-radius: 8px; width: 450px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-height: 90vh; overflow-y: auto;">
<h3 style="margin: 0 0 20px 0; font-size: 18px; font-weight: 600; color: #333; text-align: center;">跟进客户</h3>
<input type="hidden" id="followupUserId">
<div style="margin-bottom: 20px;">
@ -886,9 +899,319 @@
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;">电话号码</label>
<input type="text" id="followupPhone" disabled style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; background-color: #f5f5f5;">
</div>
<div style="margin-bottom: 20px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
<label style="font-size: 14px; font-weight: 500; color: #666;"><span style="color: #ff4d4f;">*</span> 客户类型</label>
<button onclick="showTypeHelp()" style="width: 20px; height: 20px; border-radius: 50%; border: 1px solid #1890ff; background-color: white; color: #1890ff; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0; transition: all 0.3s ease;">?</button>
</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>
</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>
</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="followupDemand" 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="粉蛋">粉蛋</option>
<option value="粉三">粉三</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>
<!-- 带搜索功能的地区选择组件 -->
<div class="search-select" style="position: relative; width: 100%;">
<div class="search-select-input" onclick="toggleSearchSelect('followupRegion')" style="
width: 100%;
padding: 10px;
border: 1px solid #d9d9d9;
border-radius: 4px;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
">
<span id="followupRegionDisplay">请选择客户地区</span>
<span style="color: #999;"></span>
</div>
<input
type="text"
id="followupRegionSearch"
oninput="filterRegions()"
placeholder="搜索地区..."
style="
width: 100%;
padding: 10px;
border: 1px solid #d9d9d9;
border-top: none;
border-radius: 0 0 4px 4px;
font-size: 14px;
display: none;
box-sizing: border-box;
"
/>
<div class="search-select-dropdown" id="followupRegionDropdown" style="
position: absolute;
top: 100%;
left: 0;
right: 0;
max-height: 200px;
overflow-y: auto;
border: 1px solid #d9d9d9;
border-top: none;
border-radius: 0 0 4px 4px;
background-color: white;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
z-index: 1000;
display: none;
">
<div class="search-select-option" onclick="selectRegion('')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">请选择客户地区</div>
<div class="search-select-option" onclick="selectRegion('四川地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">四川地区</div>
<div class="search-select-option" onclick="selectRegion('成都地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">成都地区</div>
<div class="search-select-option" onclick="selectRegion('乐山地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">乐山地区</div>
<div class="search-select-option" onclick="selectRegion('贵州地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">贵州地区</div>
<div class="search-select-option" onclick="selectRegion('重庆地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">重庆地区</div>
<div class="search-select-option" onclick="selectRegion('云南地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">云南地区</div>
<div class="search-select-option" onclick="selectRegion('河南地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">河南地区</div>
<div class="search-select-option" onclick="selectRegion('河北地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">河北地区</div>
<div class="search-select-option" onclick="selectRegion('广西地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">广西地区</div>
<div class="search-select-option" onclick="selectRegion('广东地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">广东地区</div>
<div class="search-select-option" onclick="selectRegion('湖南地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">湖南地区</div>
<div class="search-select-option" onclick="selectRegion('湖北地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">湖北地区</div>
<div class="search-select-option" onclick="selectRegion('上海地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">上海地区</div>
<div class="search-select-option" onclick="selectRegion('山西地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">山西地区</div>
<div class="search-select-option" onclick="selectRegion('山东地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">山东地区</div>
<div class="search-select-option" onclick="selectRegion('陕西地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">陕西地区</div>
<div class="search-select-option" onclick="selectRegion('甘肃地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">甘肃地区</div>
<div class="search-select-option" onclick="selectRegion('黑龙江地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">黑龙江地区</div>
<div class="search-select-option" onclick="selectRegion('吉林地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">吉林地区</div>
<div class="search-select-option" onclick="selectRegion('辽宁地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">辽宁地区</div>
<div class="search-select-option" onclick="selectRegion('江苏地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">江苏地区</div>
<div class="search-select-option" onclick="selectRegion('浙江地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">浙江地区</div>
<div class="search-select-option" onclick="selectRegion('安徽地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">安徽地区</div>
<div class="search-select-option" onclick="selectRegion('福建地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">福建地区</div>
<div class="search-select-option" onclick="selectRegion('江西地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">江西地区</div>
<div class="search-select-option" onclick="selectRegion('北京地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">北京地区</div>
<div class="search-select-option" onclick="selectRegion('天津地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">天津地区</div>
<div class="search-select-option" onclick="selectRegion('内蒙古地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">内蒙古地区</div>
<div class="search-select-option" onclick="selectRegion('宁夏地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">宁夏地区</div>
<div class="search-select-option" onclick="selectRegion('青海地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">青海地区</div>
<div class="search-select-option" onclick="selectRegion('新疆地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">新疆地区</div>
<div class="search-select-option" onclick="selectRegion('西藏地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">西藏地区</div>
<div class="search-select-option" onclick="selectRegion('香港地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">香港地区</div>
<div class="search-select-option" onclick="selectRegion('澳门地区')" style="
padding: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
">澳门地区</div>
</div>
<input type="hidden" id="followupRegion" name="followupRegion" />
</div>
</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;">
</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;">
</div>
<div style="margin-bottom: 24px;">
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #666;">跟进内容</label>
<textarea id="followupContent" rows="4" style="width: 100%; padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; resize: vertical; transition: all 0.3s ease;"></textarea>
<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>
</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>
@ -971,7 +1294,7 @@
// 提示弹窗HTML
var alertModalHTML = `
<div id="alertModal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; z-index: 1000; animation: fadeIn 0.3s ease;">
<div id="alertModal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; z-index: 10000; animation: fadeIn 0.3s ease;">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 24px; border-radius: 8px; width: 350px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease;">
<h3 style="margin: 0 0 20px 0; font-size: 16px; font-weight: 600; color: #333; text-align: center;">提示</h3>
<div style="margin-bottom: 24px; text-align: center;">
@ -984,12 +1307,180 @@
</div>
`;
// 客户类型说明弹窗HTML
var typeHelpModalHTML = `
<div id="typeHelpModal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; z-index: 10000; animation: fadeIn 0.3s ease;">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 24px; border-radius: 8px; width: 500px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-height: 80vh; overflow-y: auto;">
<h3 style="margin: 0 0 20px 0; font-size: 18px; font-weight: 600; color: #333; text-align: center;">客户类型说明</h3>
<div style="margin-bottom: 20px;">
<h4 style="font-size: 16px; font-weight: 600; color: #1890ff; margin-bottom: 10px;">批发贸易类</h4>
<p style="font-size: 14px; color: #666; margin-bottom: 8px;"><strong style="color: #333;">核心判断标准:</strong>1.单次采购为整车量级;2.车型规格涵盖 4.2 米、6.8 米、9.6米;3.采购量达对应车型满载/准满载标准</p>
<p style="font-size: 14px; color: #666;"><strong style="color: #333;">需求特点:</strong>1.采购量大,合作频次稳定;2.对供货时效、产品一致性要求高;3.重视批量采购价格优势与长期供货稳定</p>
</div>
<div style="margin-bottom: 20px;">
<h4 style="font-size: 16px; font-weight: 600; color: #1890ff; margin-bottom: 10px;">电商平台类</h4>
<p style="font-size: 14px; color: #666; margin-bottom: 8px;"><strong style="color: #333;">核心判断标准:</strong>1.单次采购为整车小码规格货品;2.货品需符合电商分装、物流、销售标准;3.订单具备持续性与稳定性</p>
<p style="font-size: 14px; color: #666;"><strong style="color: #333;">需求特点:</strong>1.对包装标准化、溯源信息完整性要求高;2.需匹配电商仓储入库、分拣发货流程;3.关注库存周转率与供货节奏同步</p>
</div>
<div style="margin-bottom: 20px;">
<h4 style="font-size: 16px; font-weight: 600; color: #1890ff; margin-bottom: 10px;">配送零售类</h4>
<p style="font-size: 14px; color: #666; margin-bottom: 8px;"><strong style="color: #333;">核心判断标准:</strong>1.采购辐射范围为周边鸡场;2.单次采购量 10-200 件;3.采购模式为小批量、多频次补货</p>
<p style="font-size: 14px; color: #666;"><strong style="color: #333;">需求特点:</strong>1.采购半径小,对配送时效要求极高;2.极度关注货品新鲜度与品质稳定性;3.需求存在应急补货场景</p>
</div>
<div style="margin-bottom: 20px;">
<h4 style="font-size: 16px; font-weight: 600; color: #1890ff; margin-bottom: 10px;">次品蛋专项类</h4>
<p style="font-size: 14px; color: #666; margin-bottom: 8px;"><strong style="color: #333;">核心判断标准:</strong>1.采购品类仅限次品蛋(下架蛋、裂纹蛋);2.不涉及任何合格商品蛋;3.采购用途为食品深加工/饲料原料等</p>
<p style="font-size: 14px; color: #666;"><strong style="color: #333;">需求特点:</strong>1.对价格敏感度极高;2.不关注货品外观品相;3.要求货源稳定、批次可控</p>
</div>
<div style="margin-bottom: 20px;">
<h4 style="font-size: 16px; font-weight: 600; color: #1890ff; margin-bottom: 10px;">其他类型</h4>
<p style="font-size: 14px; color: #666; margin-bottom: 8px;"><strong style="color: #333;">核心判断标准:</strong>其他核心判断标准</p>
<p style="font-size: 14px; color: #666;"><strong style="color: #333;">需求特点:</strong>其他需求特点</p>
</div>
<div style="text-align: center; margin-top: 24px;">
<button onclick="closeTypeHelpModal()" style="padding: 10px 24px; border: none; border-radius: 4px; font-size: 14px; color: white; background-color: #1890ff; cursor: pointer; transition: all 0.3s ease;">知道了</button>
</div>
</div>
</div>
`;
// 添加弹窗到页面
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);

Loading…
Cancel
Save