|
|
|
@ -597,6 +597,10 @@ |
|
|
|
<input type="text" id="personalPhoneSearch" placeholder="搜索手机号" style="margin-left: 20px; padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<button onclick="searchPersonalByPhone()" style="margin-left: 8px; padding: 4px 12px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 14px;">搜索</button> |
|
|
|
<button onclick="resetPersonalPhoneSearch()" style="margin-left: 8px; padding: 4px 12px; background-color: #666; color: white; border: none; border-radius: 4px; font-size: 14px;">重置</button> |
|
|
|
<span style="margin-left: 20px; font-size: 14px;">负责人:</span> |
|
|
|
<select id="personalManagerFilter" onchange="filterPersonalByManager()" style="padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<option value="">全部</option> |
|
|
|
</select> |
|
|
|
<span style="margin-left: 20px; font-size: 14px;">创建时间:</span> |
|
|
|
<input type="date" id="personalStartDate" style="padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<span style="margin: 0 8px; font-size: 14px;">至</span> |
|
|
|
@ -625,7 +629,7 @@ |
|
|
|
<th>创建时间</th> |
|
|
|
<th>跟进内容</th> |
|
|
|
<th>响应时间</th> |
|
|
|
<th id="managerHeader" onclick="toggleManagerFilter()" style="cursor: pointer;">负责人</th> |
|
|
|
<th id="managerHeader">负责人</th> |
|
|
|
<th>操作</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
@ -647,6 +651,10 @@ |
|
|
|
<input type="text" id="publicPhoneSearch" placeholder="搜索手机号" style="margin-left: 20px; padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<button onclick="searchPublicByPhone()" style="margin-left: 8px; padding: 4px 12px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 14px;">搜索</button> |
|
|
|
<button onclick="resetPublicPhoneSearch()" style="margin-left: 8px; padding: 4px 12px; background-color: #666; color: white; border: none; border-radius: 4px; font-size: 14px;">重置</button> |
|
|
|
<span style="margin-left: 20px; font-size: 14px;">负责人:</span> |
|
|
|
<select id="publicManagerFilter" onchange="filterPublicByManager()" style="padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<option value="">全部</option> |
|
|
|
</select> |
|
|
|
<span style="margin-left: 20px; font-size: 14px;">创建时间:</span> |
|
|
|
<input type="date" id="publicStartDate" style="padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px;"> |
|
|
|
<span style="margin: 0 8px; font-size: 14px;">至</span> |
|
|
|
@ -674,7 +682,7 @@ |
|
|
|
<th>创建时间</th> |
|
|
|
<th>跟进内容</th> |
|
|
|
<th>响应时间</th> |
|
|
|
<th id="publicManagerHeader" onclick="toggleManagerFilter('public')" style="cursor: pointer;">负责人</th> |
|
|
|
<th id="publicManagerHeader">负责人</th> |
|
|
|
<th>操作</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
@ -700,6 +708,7 @@ |
|
|
|
|
|
|
|
var managersList = []; |
|
|
|
var allPersonalData = []; |
|
|
|
var allPublicData = []; |
|
|
|
var isLoadingAllData = false; |
|
|
|
var currentManagerFilter = null; |
|
|
|
var currentFilterTable = 'personal'; |
|
|
|
@ -949,7 +958,7 @@ |
|
|
|
|
|
|
|
// 只对管理员显示负责人信息 |
|
|
|
if (userRole === '管理员') { |
|
|
|
managerCell = '<td onclick="showManagerDropdown(event, this, \'' + (user.managerName || '-') + '\')" style="cursor: pointer; position: relative;">' + (user.managerName || '-') + '</td>'; |
|
|
|
managerCell = '<td>' + (user.managerName || '-') + '</td>'; |
|
|
|
} else { |
|
|
|
managerCell = '<td style="display: none;"></td>'; |
|
|
|
} |
|
|
|
@ -976,7 +985,7 @@ |
|
|
|
'<td>' + (user.followup || '-') + '</td>' + |
|
|
|
'<td>' + responseTime + '</td>' + |
|
|
|
managerCell + |
|
|
|
'<td><button onclick="openFollowupModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 12px;">跟进</button> <button onclick="openReturnModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\', \'' + (user.type || '') + '\')" style="padding: 4px 8px; background-color: #faad14; color: white; border: none; border-radius: 4px; font-size: 12px;">归还</button> ' + jianDaoYunButton + '</td>' + |
|
|
|
'<td><button onclick="openDetailModal(\'' + (user.userId || '') + '\')" style="padding: 4px 8px; background-color: #13c2c2; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">详情</button><button onclick="openFollowupModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">跟进</button> <button onclick="openReturnModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\', \'' + (user.type || '') + '\')" style="padding: 4px 8px; background-color: #faad14; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">归还</button> ' + jianDaoYunButton + '</td>' + |
|
|
|
'</tr>'; |
|
|
|
personalBody.innerHTML += row; |
|
|
|
|
|
|
|
@ -1520,6 +1529,30 @@ |
|
|
|
updateFilterTags('public'); |
|
|
|
} |
|
|
|
|
|
|
|
// 筛选个人数据负责人 |
|
|
|
function filterPersonalByManager() { |
|
|
|
var managerName = document.getElementById('personalManagerFilter').value; |
|
|
|
currentManagerFilter = managerName || null; |
|
|
|
personalPage = 1; // 重置为第一页 |
|
|
|
|
|
|
|
// 总是加载所有数据以便筛选 |
|
|
|
loadAllPersonalData(); |
|
|
|
|
|
|
|
// 更新筛选标签 |
|
|
|
updateFilterTags('personal'); |
|
|
|
} |
|
|
|
|
|
|
|
// 筛选公海池数据负责人 |
|
|
|
function filterPublicByManager() { |
|
|
|
var managerName = document.getElementById('publicManagerFilter').value; |
|
|
|
currentManagerFilter = managerName || null; |
|
|
|
publicPage = 1; // 重置为第一页 |
|
|
|
loadPublicData(); // 重新加载公海池数据 |
|
|
|
|
|
|
|
// 更新筛选标签 |
|
|
|
updateFilterTags('public'); |
|
|
|
} |
|
|
|
|
|
|
|
function loadPublicData() { |
|
|
|
var userRole = userInfo.loginInfo.projectName; |
|
|
|
var usersManagements = userInfo.usersManagements; |
|
|
|
@ -1561,6 +1594,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); |
|
|
|
} |
|
|
|
@ -1958,6 +1995,104 @@ |
|
|
|
</div> |
|
|
|
`; |
|
|
|
|
|
|
|
// 详情弹窗HTML |
|
|
|
var detailModalHTML = ` |
|
|
|
<div id="detailModal" 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: 600px; 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> |
|
|
|
<div style="margin-bottom: 24px;"> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户ID:</span> |
|
|
|
<span id="detailUserId" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户名称:</span> |
|
|
|
<span id="detailUserName" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">电话号码:</span> |
|
|
|
<span id="detailPhone" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户类型:</span> |
|
|
|
<span id="detailType" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">创建时间:</span> |
|
|
|
<span id="detailCreatedAt" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">跟进内容:</span> |
|
|
|
<span id="detailFollowup" style="font-size: 14px; color: #333; max-width: 400px; text-align: right;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">响应时间:</span> |
|
|
|
<span id="detailResponseTime" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">负责人:</span> |
|
|
|
<span id="detailManagerName" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">简道云状态:</span> |
|
|
|
<span id="detailSyncStatus" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户等级:</span> |
|
|
|
<span id="detailLevel" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户地区:</span> |
|
|
|
<span id="detailRegion" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">详细地址:</span> |
|
|
|
<span id="detailDetailedAddress" style="font-size: 14px; color: #333; max-width: 400px; text-align: right;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户公司:</span> |
|
|
|
<span id="detailCompany" style="font-size: 14px; color: #333; max-width: 400px; text-align: right;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-bottom: 16px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"> |
|
|
|
<span style="font-size: 14px; font-weight: 500; color: #666;">客户需求:</span> |
|
|
|
<span id="detailDemand" style="font-size: 14px; color: #333;"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="text-align: center; margin-top: 24px;"> |
|
|
|
<button onclick="closeDetailModal()" 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> |
|
|
|
`; |
|
|
|
|
|
|
|
// 分配弹窗HTML |
|
|
|
var assignModalHTML = ` |
|
|
|
<div id="assignModal" 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;"> |
|
|
|
@ -2037,6 +2172,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); |
|
|
|
@ -2061,6 +2197,8 @@ |
|
|
|
closeAssignModal(); |
|
|
|
} else if (modalId === 'typeHelpModal') { |
|
|
|
closeTypeHelpModal(); |
|
|
|
} else if (modalId === 'detailModal') { |
|
|
|
closeDetailModal(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -2074,6 +2212,7 @@ |
|
|
|
addModalOutsideClose('alertModal'); |
|
|
|
addModalOutsideClose('assignModal'); |
|
|
|
addModalOutsideClose('typeHelpModal'); |
|
|
|
addModalOutsideClose('detailModal'); |
|
|
|
|
|
|
|
function showTypeHelp() { |
|
|
|
document.getElementById('typeHelpModal').style.display = 'block'; |
|
|
|
@ -2198,6 +2337,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); |
|
|
|
@ -2309,7 +2459,7 @@ |
|
|
|
|
|
|
|
// 只对管理员显示负责人信息 |
|
|
|
if (userRole === '管理员') { |
|
|
|
managerCell = '<td onclick="showManagerDropdown(event, this, \'' + (user.managerName || '-') + '\')" style="cursor: pointer; position: relative;">' + (user.managerName || '-') + '</td>'; |
|
|
|
managerCell = '<td>' + (user.managerName || '-') + '</td>'; |
|
|
|
} else { |
|
|
|
managerCell = '<td style="display: none;"></td>'; |
|
|
|
} |
|
|
|
@ -2336,7 +2486,7 @@ |
|
|
|
'<td>' + (user.followup || '-') + '</td>' + |
|
|
|
'<td>' + responseTime + '</td>' + |
|
|
|
managerCell + |
|
|
|
'<td><button onclick="openFollowupModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 12px;">跟进</button> <button onclick="openReturnModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\', \'' + (user.type || '') + '\')" style="padding: 4px 8px; background-color: #faad14; color: white; border: none; border-radius: 4px; font-size: 12px;">归还</button> ' + jianDaoYunButton + '</td>' + |
|
|
|
'<td><button onclick="openDetailModal(\'' + (user.userId || '') + '\')" style="padding: 4px 8px; background-color: #13c2c2; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">详情</button><button onclick="openFollowupModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #1890ff; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">跟进</button> <button onclick="openReturnModal(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\', \'' + (user.type || '') + '\')" style="padding: 4px 8px; background-color: #faad14; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">归还</button> ' + jianDaoYunButton + '</td>' + |
|
|
|
'</tr>'; |
|
|
|
personalBody.innerHTML += row; |
|
|
|
|
|
|
|
@ -2405,7 +2555,7 @@ |
|
|
|
|
|
|
|
// 只对管理员显示负责人信息 |
|
|
|
if (userRole === '管理员') { |
|
|
|
managerCell = '<td onclick="showManagerDropdown(event, this, \'' + (user.managerName || '-') + '\')" style="cursor: pointer; position: relative;">' + (user.managerName || '-') + '</td>'; |
|
|
|
managerCell = '<td>' + (user.managerName || '-') + '</td>'; |
|
|
|
} else { |
|
|
|
managerCell = '<td style="display: none;"></td>'; |
|
|
|
} |
|
|
|
@ -2419,7 +2569,7 @@ |
|
|
|
'<td>' + (user.followup || '-') + '</td>' + |
|
|
|
'<td>' + responseTime + '</td>' + |
|
|
|
managerCell + |
|
|
|
'<td><button onclick="claimCustomer(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #52c41a; color: white; border: none; border-radius: 4px; font-size: 12px;">认领</button></td>' + |
|
|
|
'<td><button onclick="openDetailModal(\'' + (user.userId || '') + '\')" style="padding: 4px 8px; background-color: #13c2c2; color: white; border: none; border-radius: 4px; font-size: 12px; margin-right: 4px;">详情</button><button onclick="claimCustomer(\'' + (user.userId || '') + '\', \'' + (user.nickName || '') + '\', \'' + (user.phoneNumber || '') + '\')" style="padding: 4px 8px; background-color: #52c41a; color: white; border: none; border-radius: 4px; font-size: 12px;">认领</button></td>' + |
|
|
|
'</tr>'; |
|
|
|
publicBody.innerHTML += row; |
|
|
|
|
|
|
|
@ -2616,6 +2766,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; |
|
|
|
@ -2827,7 +3048,20 @@ |
|
|
|
var select = document.getElementById('managerSelect'); |
|
|
|
select.innerHTML = '<option value="">请选择负责人</option>'; |
|
|
|
|
|
|
|
// 清空并初始化负责人筛选下拉框 |
|
|
|
var personalManagerFilter = document.getElementById('personalManagerFilter'); |
|
|
|
var publicManagerFilter = document.getElementById('publicManagerFilter'); |
|
|
|
|
|
|
|
if (personalManagerFilter) { |
|
|
|
personalManagerFilter.innerHTML = '<option value="">全部</option>'; |
|
|
|
} |
|
|
|
|
|
|
|
if (publicManagerFilter) { |
|
|
|
publicManagerFilter.innerHTML = '<option value="">全部</option>'; |
|
|
|
} |
|
|
|
|
|
|
|
managersList.forEach(function(manager) { |
|
|
|
// 填充分配模态框的下拉框 |
|
|
|
var option = document.createElement('option'); |
|
|
|
option.value = manager.managerId; |
|
|
|
option.textContent = manager.userName; |
|
|
|
@ -2838,6 +3072,22 @@ |
|
|
|
option.setAttribute('data-root', manager.root); |
|
|
|
option.setAttribute('data-assistant', manager.assistant); |
|
|
|
select.appendChild(option); |
|
|
|
|
|
|
|
// 填充个人数据标签页的负责人筛选下拉框 |
|
|
|
if (personalManagerFilter) { |
|
|
|
var personalOption = document.createElement('option'); |
|
|
|
personalOption.value = manager.userName; |
|
|
|
personalOption.textContent = manager.userName; |
|
|
|
personalManagerFilter.appendChild(personalOption); |
|
|
|
} |
|
|
|
|
|
|
|
// 填充公海池数据标签页的负责人筛选下拉框 |
|
|
|
if (publicManagerFilter) { |
|
|
|
var publicOption = document.createElement('option'); |
|
|
|
publicOption.value = manager.userName; |
|
|
|
publicOption.textContent = manager.userName; |
|
|
|
publicManagerFilter.appendChild(publicOption); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|