diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html
index 14a088e..209e62b 100644
--- a/web/src/main/resources/static/index.html
+++ b/web/src/main/resources/static/index.html
@@ -700,6 +700,7 @@
var managersList = [];
var allPersonalData = [];
+ var allPublicData = [];
var isLoadingAllData = false;
var currentManagerFilter = null;
var currentFilterTable = 'personal';
@@ -976,7 +977,7 @@
'
' + (user.followup || '-') + ' | ' +
'' + responseTime + ' | ' +
managerCell +
- ' ' + jianDaoYunButton + ' | ' +
+ ' ' + jianDaoYunButton + ' | ' +
'';
personalBody.innerHTML += row;
@@ -1550,6 +1551,10 @@
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = JSON.parse(xhr.responseText);
+ // 保存公海池数据到全局变量
+ if (data.users) {
+ allPublicData = data.users;
+ }
displayPublicData(data);
renderPublicPagination(data.page, data.pages);
}
@@ -1947,6 +1952,104 @@
`;
+ // 详情弹窗HTML
+ var detailModalHTML = `
+
+
+
客户详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+
// 分配弹窗HTML
var assignModalHTML = `
@@ -2026,6 +2129,7 @@
document.body.insertAdjacentHTML('beforeend', followupModalHTML);
document.body.insertAdjacentHTML('beforeend', returnModalHTML);
document.body.insertAdjacentHTML('beforeend', jianDaoYunModalHTML);
+ document.body.insertAdjacentHTML('beforeend', detailModalHTML);
document.body.insertAdjacentHTML('beforeend', assignModalHTML);
document.body.insertAdjacentHTML('beforeend', alertModalHTML);
document.body.insertAdjacentHTML('beforeend', typeHelpModalHTML);
@@ -2050,6 +2154,8 @@
closeAssignModal();
} else if (modalId === 'typeHelpModal') {
closeTypeHelpModal();
+ } else if (modalId === 'detailModal') {
+ closeDetailModal();
}
}
});
@@ -2063,6 +2169,7 @@
addModalOutsideClose('alertModal');
addModalOutsideClose('assignModal');
addModalOutsideClose('typeHelpModal');
+ addModalOutsideClose('detailModal');
function showTypeHelp() {
document.getElementById('typeHelpModal').style.display = 'block';
@@ -2187,6 +2294,17 @@
return typeMap[type] || type;
}
+ function mapUserLevel(level) {
+ var levelMap = {
+ 'important': 'A-重要客户',
+ 'ordinary': 'B-普通客户',
+ 'low_value': 'C-低价值客户',
+ 'logistics': 'D-物流自提客户',
+ 'unclassified': '-'
+ };
+ return levelMap[level] || level;
+ }
+
function calculateResponseTime(createdAt, followupAt) {
if (!createdAt || !followupAt) return '-';
var createTime = new Date(createdAt);
@@ -2325,7 +2443,7 @@
'
' + (user.followup || '-') + ' | ' +
'' + responseTime + ' | ' +
managerCell +
- ' ' + jianDaoYunButton + ' | ' +
+ ' ' + jianDaoYunButton + ' | ' +
'';
personalBody.innerHTML += row;
@@ -2408,7 +2526,7 @@
'' + (user.followup || '-') + ' | ' +
'' + responseTime + ' | ' +
managerCell +
- ' | ' +
+ ' | ' +
'';
publicBody.innerHTML += row;
@@ -2605,6 +2723,77 @@
document.body.style.overflow = 'auto';
}
+ function openDetailModal(userId) {
+ // 根据userId查找用户数据
+ 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) {
+ // 如果在所有数据源中都找不到
+ showAlert('未找到该客户数据');
+ return;
+ }
+
+ // 填充客户详情数据
+ document.getElementById('detailUserId').textContent = user.userId || '-';
+ document.getElementById('detailUserName').textContent = user.nickName || '-';
+ document.getElementById('detailPhone').textContent = user.phoneNumber || '-';
+ document.getElementById('detailType').textContent = mapUserType(user.type) || '-';
+ document.getElementById('detailCreatedAt').textContent = formatDateTime(user.created_at) || '-';
+ document.getElementById('detailFollowup').textContent = user.followup || '-';
+
+ var responseTime = calculateResponseTime(user.created_at, user.followup_at);
+ document.getElementById('detailResponseTime').textContent = responseTime;
+
+ document.getElementById('detailManagerName').textContent = user.managerName || '-';
+
+ // 显示简道云状态
+ var syncStatus = '';
+ if (user.sync_statuss === 0 || user.sync_statuss === 1) {
+ syncStatus = '已写入简道云';
+ } else {
+ syncStatus = '未写入简道云';
+ }
+ document.getElementById('detailSyncStatus').textContent = syncStatus;
+
+ // 显示其他可能的字段
+ document.getElementById('detailLevel').textContent = mapUserLevel(user.level) || '-';
+ document.getElementById('detailRegion').textContent = user.region || '-';
+ document.getElementById('detailDetailedAddress').textContent = user.detailedaddress || '-';
+ document.getElementById('detailCompany').textContent = user.company || '-';
+ document.getElementById('detailDemand').textContent = user.demand || '-';
+
+ // 显示弹窗
+ document.getElementById('detailModal').style.display = 'block';
+ // 防止背景滚动
+ document.body.style.overflow = 'hidden';
+ }
+
+ function closeDetailModal() {
+ document.getElementById('detailModal').style.display = 'none';
+ // 恢复背景滚动
+ document.body.style.overflow = 'auto';
+ }
+
function saveJianDaoYun() {
var userId = document.getElementById('jianDaoYunUserId').value;
var usersManagements = userInfo.usersManagements;