提示
@@ -984,12 +1307,180 @@
`;
+ // 客户类型说明弹窗HTML
+ var typeHelpModalHTML = `
+
+
+
客户类型说明
+
+
批发贸易类
+
核心判断标准:1.单次采购为整车量级;2.车型规格涵盖 4.2 米、6.8 米、9.6米;3.采购量达对应车型满载/准满载标准
+
需求特点:1.采购量大,合作频次稳定;2.对供货时效、产品一致性要求高;3.重视批量采购价格优势与长期供货稳定
+
+
+
电商平台类
+
核心判断标准:1.单次采购为整车小码规格货品;2.货品需符合电商分装、物流、销售标准;3.订单具备持续性与稳定性
+
需求特点:1.对包装标准化、溯源信息完整性要求高;2.需匹配电商仓储入库、分拣发货流程;3.关注库存周转率与供货节奏同步
+
+
+
配送零售类
+
核心判断标准:1.采购辐射范围为周边鸡场;2.单次采购量 10-200 件;3.采购模式为小批量、多频次补货
+
需求特点:1.采购半径小,对配送时效要求极高;2.极度关注货品新鲜度与品质稳定性;3.需求存在应急补货场景
+
+
+
次品蛋专项类
+
核心判断标准:1.采购品类仅限次品蛋(下架蛋、裂纹蛋);2.不涉及任何合格商品蛋;3.采购用途为食品深加工/饲料原料等
+
需求特点:1.对价格敏感度极高;2.不关注货品外观品相;3.要求货源稳定、批次可控
+
+
+
其他类型
+
核心判断标准:其他核心判断标准
+
需求特点:其他需求特点
+
+
+
+
+
+
+ `;
+
// 添加弹窗到页面
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);