|
|
@ -1038,6 +1038,23 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 跟进信息弹窗 --> |
|
|
|
|
|
<div id="followupModal" class="modal"> |
|
|
|
|
|
<div class="modal-content"> |
|
|
|
|
|
<div class="modal-header">供应商跟进</div> |
|
|
|
|
|
<div class="modal-body"> |
|
|
|
|
|
<textarea id="followupContent" placeholder="请输入跟进信息..." maxlength="1000" style="height: 150px;"></textarea> |
|
|
|
|
|
<div style="text-align: right; margin-top: 5px; font-size: 12px; color: #999;"> |
|
|
|
|
|
<span id="followupCharCount">0</span>/1000 |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="modal-footer"> |
|
|
|
|
|
<button id="cancelFollowupBtn" class="btn btn-default">取消</button> |
|
|
|
|
|
<button id="confirmFollowupBtn" class="btn btn-primary">确认保存</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
// 登录检查 |
|
|
// 登录检查 |
|
|
@ -1670,9 +1687,20 @@ |
|
|
</div> |
|
|
</div> |
|
|
` : ''} |
|
|
` : ''} |
|
|
|
|
|
|
|
|
|
|
|
<!-- 跟进信息 --> |
|
|
|
|
|
${supplier.seller_followup ? ` |
|
|
|
|
|
<div class="supply-followup" style="margin-top: 15px; padding: 10px; background-color: #f0f9ff; border: 1px solid #bae7ff; border-radius: 4px;"> |
|
|
|
|
|
<div class="label" style="font-size: 12px; color: #1890ff; margin-bottom: 5px;">跟进信息:</div> |
|
|
|
|
|
<div class="followup-content" style="font-size: 14px; color: #333;">${supplier.seller_followup}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
` : ''} |
|
|
|
|
|
|
|
|
<!-- 操作按钮 --> |
|
|
<!-- 操作按钮 --> |
|
|
<div class="action-buttons"> |
|
|
<div class="action-buttons"> |
|
|
${canReview ? ` |
|
|
${canReview ? ` |
|
|
|
|
|
<button class="btn btn-default" data-id="${id}" onclick="showFollowupModal('${id}')"> |
|
|
|
|
|
跟进 |
|
|
|
|
|
</button> |
|
|
<button class="btn btn-primary" data-id="${id}" onclick="showSupplierApproveModal('${id}')"> |
|
|
<button class="btn btn-primary" data-id="${id}" onclick="showSupplierApproveModal('${id}')"> |
|
|
通过 |
|
|
通过 |
|
|
</button> |
|
|
</button> |
|
|
@ -1680,6 +1708,9 @@ |
|
|
拒绝 |
|
|
拒绝 |
|
|
</button> |
|
|
</button> |
|
|
` : canTerminate ? ` |
|
|
` : canTerminate ? ` |
|
|
|
|
|
<button class="btn btn-default" data-id="${id}" onclick="showFollowupModal('${id}')"> |
|
|
|
|
|
跟进 |
|
|
|
|
|
</button> |
|
|
<button class="btn btn-danger" data-id="${id}" onclick="showTerminateModal('${id}')"> |
|
|
<button class="btn btn-danger" data-id="${id}" onclick="showTerminateModal('${id}')"> |
|
|
终止合作 |
|
|
终止合作 |
|
|
</button> |
|
|
</button> |
|
|
@ -1687,6 +1718,9 @@ |
|
|
审核时间:${formatTime(auditTime)} |
|
|
审核时间:${formatTime(auditTime)} |
|
|
</div> |
|
|
</div> |
|
|
` : canCooperate ? ` |
|
|
` : canCooperate ? ` |
|
|
|
|
|
<button class="btn btn-default" data-id="${id}" onclick="showFollowupModal('${id}')"> |
|
|
|
|
|
跟进 |
|
|
|
|
|
</button> |
|
|
<button class="btn btn-primary" data-id="${id}" onclick="confirmSupplierToCooperation('${id}')"> |
|
|
<button class="btn btn-primary" data-id="${id}" onclick="confirmSupplierToCooperation('${id}')"> |
|
|
开始合作 |
|
|
开始合作 |
|
|
</button> |
|
|
</button> |
|
|
@ -1694,6 +1728,9 @@ |
|
|
审核时间:${formatTime(auditTime)} |
|
|
审核时间:${formatTime(auditTime)} |
|
|
</div> |
|
|
</div> |
|
|
` : ` |
|
|
` : ` |
|
|
|
|
|
<button class="btn btn-default" data-id="${id}" onclick="showFollowupModal('${id}')"> |
|
|
|
|
|
跟进 |
|
|
|
|
|
</button> |
|
|
<div class="audit-time"> |
|
|
<div class="audit-time"> |
|
|
审核时间:${formatTime(auditTime)} |
|
|
审核时间:${formatTime(auditTime)} |
|
|
</div> |
|
|
</div> |
|
|
@ -1891,6 +1928,66 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 显示跟进信息弹窗 |
|
|
|
|
|
function showFollowupModal(supplierId) { |
|
|
|
|
|
currentSupplierId = supplierId; |
|
|
|
|
|
const followupModalEl = document.getElementById('followupModal'); |
|
|
|
|
|
const followupContentEl = document.getElementById('followupContent'); |
|
|
|
|
|
const followupCharCountEl = document.getElementById('followupCharCount'); |
|
|
|
|
|
|
|
|
|
|
|
if (followupContentEl) { |
|
|
|
|
|
followupContentEl.value = ''; |
|
|
|
|
|
followupContentEl.focus(); |
|
|
|
|
|
} |
|
|
|
|
|
if (followupCharCountEl) { |
|
|
|
|
|
followupCharCountEl.textContent = '0'; |
|
|
|
|
|
} |
|
|
|
|
|
if (followupModalEl) { |
|
|
|
|
|
followupModalEl.style.display = 'flex'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 确认保存跟进信息 |
|
|
|
|
|
async function confirmFollowup() { |
|
|
|
|
|
const followupContentEl = document.getElementById('followupContent'); |
|
|
|
|
|
const followupModalEl = document.getElementById('followupModal'); |
|
|
|
|
|
const content = followupContentEl ? followupContentEl.value.trim() : ''; |
|
|
|
|
|
|
|
|
|
|
|
if (!content) { |
|
|
|
|
|
alert('请输入跟进信息'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const response = await fetch(`/api/suppliers/${currentSupplierId}/followup?_t=${Date.now()}`, { |
|
|
|
|
|
method: 'POST', |
|
|
|
|
|
headers: { |
|
|
|
|
|
'Content-Type': 'application/json', |
|
|
|
|
|
}, |
|
|
|
|
|
body: JSON.stringify({ content }) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (!response.ok) { |
|
|
|
|
|
throw new Error('服务器响应异常'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const data = await response.json(); |
|
|
|
|
|
|
|
|
|
|
|
if (data.success) { |
|
|
|
|
|
if (followupModalEl) { |
|
|
|
|
|
followupModalEl.style.display = 'none'; |
|
|
|
|
|
} |
|
|
|
|
|
loadSuppliers(); |
|
|
|
|
|
showSuccessModal('跟进信息保存成功'); |
|
|
|
|
|
} else { |
|
|
|
|
|
alert(data.message || '保存跟进信息失败'); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('保存跟进信息失败:', error); |
|
|
|
|
|
alert('网络错误,请稍后重试'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 为终止合作模态框添加事件监听 |
|
|
// 为终止合作模态框添加事件监听 |
|
|
const terminateModalEl = document.getElementById('terminateModal'); |
|
|
const terminateModalEl = document.getElementById('terminateModal'); |
|
|
if (terminateModalEl) { |
|
|
if (terminateModalEl) { |
|
|
@ -1932,6 +2029,47 @@ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 为跟进信息模态框添加事件监听 |
|
|
|
|
|
const followupModalEl = document.getElementById('followupModal'); |
|
|
|
|
|
if (followupModalEl) { |
|
|
|
|
|
const followupContentEl = document.getElementById('followupContent'); |
|
|
|
|
|
const followupCharCountEl = document.getElementById('followupCharCount'); |
|
|
|
|
|
const cancelFollowupBtnEl = document.getElementById('cancelFollowupBtn'); |
|
|
|
|
|
const confirmFollowupBtnEl = document.getElementById('confirmFollowupBtn'); |
|
|
|
|
|
|
|
|
|
|
|
// 字符计数 |
|
|
|
|
|
if (followupContentEl && followupCharCountEl) { |
|
|
|
|
|
followupContentEl.addEventListener('input', () => { |
|
|
|
|
|
const length = followupContentEl.value.length; |
|
|
|
|
|
followupCharCountEl.textContent = length; |
|
|
|
|
|
followupCharCountEl.style.color = length > 800 ? '#ff4d4f' : '#999'; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 取消按钮 |
|
|
|
|
|
if (cancelFollowupBtnEl) { |
|
|
|
|
|
cancelFollowupBtnEl.addEventListener('click', function(e) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
followupModalEl.style.display = 'none'; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 确认保存按钮 |
|
|
|
|
|
if (confirmFollowupBtnEl) { |
|
|
|
|
|
confirmFollowupBtnEl.addEventListener('click', function(e) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
confirmFollowup(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 点击模态框外部关闭 |
|
|
|
|
|
followupModalEl.addEventListener('click', (e) => { |
|
|
|
|
|
if (e.target === followupModalEl) { |
|
|
|
|
|
followupModalEl.style.display = 'none'; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 绑定成功弹窗的确认按钮 |
|
|
// 绑定成功弹窗的确认按钮 |
|
|
document.getElementById('successConfirmBtn').addEventListener('click', closeSuccessModal); |
|
|
document.getElementById('successConfirmBtn').addEventListener('click', closeSuccessModal); |
|
|
|
|
|
|
|
|
@ -1982,6 +2120,8 @@ |
|
|
window.showTerminateModal = showTerminateModal; |
|
|
window.showTerminateModal = showTerminateModal; |
|
|
window.confirmTerminate = confirmTerminate; |
|
|
window.confirmTerminate = confirmTerminate; |
|
|
window.confirmSupplierToCooperation = confirmSupplierToCooperation; |
|
|
window.confirmSupplierToCooperation = confirmSupplierToCooperation; |
|
|
|
|
|
window.showFollowupModal = showFollowupModal; |
|
|
|
|
|
window.confirmFollowup = confirmFollowup; |
|
|
window.loadSuppliers = loadSuppliers; |
|
|
window.loadSuppliers = loadSuppliers; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|