feat: 优化客户编辑弹窗,根据意向产品动态显示试用时间字段并调整列表展示。
This commit is contained in:
parent
9250803979
commit
ecaf0aa786
@ -1082,7 +1082,7 @@
|
|||||||
<div id="editTrialPeriodModal" class="modal">
|
<div id="editTrialPeriodModal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h3><i class="fas fa-clock"></i> 编辑试用时间</h3>
|
<h3><i class="fas fa-user-edit"></i> 编辑客户信息</h3>
|
||||||
<span class="close">×</span>
|
<span class="close">×</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -1113,13 +1113,13 @@
|
|||||||
<input type="text" id="editTrialIntendedProductOther" name="editIntendedProductOther"
|
<input type="text" id="editTrialIntendedProductOther" name="editIntendedProductOther"
|
||||||
placeholder="请输入其他意向产品" style="display: none; margin-top: 8px" />
|
placeholder="请输入其他意向产品" style="display: none; margin-top: 8px" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" id="editTrialStartTimeGroup">
|
||||||
<label for="editTrialStartTime">开始时间</label>
|
<label for="editTrialStartTime">开始时间</label>
|
||||||
<input type="datetime-local" id="editTrialStartTime" name="startTime" required />
|
<input type="datetime-local" id="editTrialStartTime" name="startTime" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" id="editTrialEndTimeGroup">
|
||||||
<label for="editTrialEndTime">结束时间</label>
|
<label for="editTrialEndTime">结束时间</label>
|
||||||
<input type="datetime-local" id="editTrialEndTime" name="endTime" required />
|
<input type="datetime-local" id="editTrialEndTime" name="endTime" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>是否试用</label>
|
<label>是否试用</label>
|
||||||
|
|||||||
@ -80,6 +80,14 @@ function initTrialPeriodsPage() {
|
|||||||
setupIntendedProductCheckboxes('trialIntendedProductOtherCheckbox', 'trialIntendedProductOther');
|
setupIntendedProductCheckboxes('trialIntendedProductOtherCheckbox', 'trialIntendedProductOther');
|
||||||
setupIntendedProductCheckboxes('editTrialIntendedProductOtherCheckbox', 'editTrialIntendedProductOther');
|
setupIntendedProductCheckboxes('editTrialIntendedProductOtherCheckbox', 'editTrialIntendedProductOther');
|
||||||
|
|
||||||
|
// 为编辑弹窗的意向产品复选框添加监听器,控制时间字段显示
|
||||||
|
const editIntendedProductCheckboxes = document.querySelectorAll('input[name="editIntendedProduct"]');
|
||||||
|
editIntendedProductCheckboxes.forEach(checkbox => {
|
||||||
|
checkbox.addEventListener('change', function() {
|
||||||
|
updateEditTrialTimeFieldsVisibility();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// 刷新按钮事件
|
// 刷新按钮事件
|
||||||
const refreshTrialPeriodsBtn = document.getElementById('refreshTrialPeriodsBtn');
|
const refreshTrialPeriodsBtn = document.getElementById('refreshTrialPeriodsBtn');
|
||||||
if (refreshTrialPeriodsBtn) {
|
if (refreshTrialPeriodsBtn) {
|
||||||
@ -509,13 +517,22 @@ function renderTrialPeriodsTable() {
|
|||||||
const source = period.source || '';
|
const source = period.source || '';
|
||||||
const intendedProduct = period.intendedProduct || '';
|
const intendedProduct = period.intendedProduct || '';
|
||||||
|
|
||||||
|
// 检查意向产品是否包含"数据闭环"
|
||||||
|
// 如果只包含 robogo 或其他,则不显示试用相关信息
|
||||||
|
const hasDataLoop = intendedProduct.includes('数据闭环');
|
||||||
|
|
||||||
|
// 根据是否有数据闭环来决定显示内容
|
||||||
|
const statusCell = hasDataLoop ? statusBadge : '<span style="color: #999;">-</span>';
|
||||||
|
const startTimeCell = hasDataLoop ? startTime : '<span style="color: #999;">-</span>';
|
||||||
|
const endTimeCell = hasDataLoop ? endTime : '<span style="color: #999;">-</span>';
|
||||||
|
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td><strong>${customerName}</strong></td>
|
<td><strong>${customerName}</strong></td>
|
||||||
<td>${source}</td>
|
<td>${source}</td>
|
||||||
<td>${intendedProduct}</td>
|
<td>${intendedProduct}</td>
|
||||||
<td>${statusBadge}</td>
|
<td>${statusCell}</td>
|
||||||
<td>${startTime}</td>
|
<td>${startTimeCell}</td>
|
||||||
<td>${endTime}</td>
|
<td>${endTimeCell}</td>
|
||||||
<td>${createdAt}</td>
|
<td>${createdAt}</td>
|
||||||
<td class="action-cell">
|
<td class="action-cell">
|
||||||
<button class="action-btn edit-btn" data-id="${period.id}" title="编辑">
|
<button class="action-btn edit-btn" data-id="${period.id}" title="编辑">
|
||||||
@ -630,9 +647,31 @@ function openEditTrialModal(periodId) {
|
|||||||
isTrialRadio.checked = true;
|
isTrialRadio.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 控制时间字段的显示/隐藏
|
||||||
|
updateEditTrialTimeFieldsVisibility();
|
||||||
|
|
||||||
document.getElementById('editTrialPeriodModal').style.display = 'block';
|
document.getElementById('editTrialPeriodModal').style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新编辑弹窗中时间字段的显示状态
|
||||||
|
function updateEditTrialTimeFieldsVisibility() {
|
||||||
|
const intendedProduct = getIntendedProductValue('editTrialIntendedProduct', 'editTrialIntendedProductOther');
|
||||||
|
const hasDataLoop = intendedProduct.includes('数据闭环');
|
||||||
|
|
||||||
|
const startTimeGroup = document.getElementById('editTrialStartTimeGroup');
|
||||||
|
const endTimeGroup = document.getElementById('editTrialEndTimeGroup');
|
||||||
|
|
||||||
|
if (startTimeGroup && endTimeGroup) {
|
||||||
|
if (hasDataLoop) {
|
||||||
|
startTimeGroup.style.display = 'block';
|
||||||
|
endTimeGroup.style.display = 'block';
|
||||||
|
} else {
|
||||||
|
startTimeGroup.style.display = 'none';
|
||||||
|
endTimeGroup.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Delete trial period from page
|
// Delete trial period from page
|
||||||
async function deleteTrialPeriodFromPage(periodId) {
|
async function deleteTrialPeriodFromPage(periodId) {
|
||||||
if (!confirm('确定要删除这个试用时间记录吗?')) {
|
if (!confirm('确定要删除这个试用时间记录吗?')) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user