This commit is contained in:
@@ -623,12 +623,12 @@ let priceChartInstance = null;
|
||||
const sku = button.dataset.reviewSku || '';
|
||||
const action = button.dataset.reviewAction || '';
|
||||
if (!sku || !action) return;
|
||||
const confirmText = button.dataset.reviewConfirm || '確認寫入這筆覆核決策?';
|
||||
const confirmText = button.dataset.reviewConfirm || '執行這筆 AI 例外決策?';
|
||||
if (!confirm(confirmText)) return;
|
||||
const reason = prompt('補充覆核原因(可留空)', '') || '';
|
||||
const reason = prompt('補充 AI 決策依據(可留空)', '') || '';
|
||||
const originalText = button.textContent;
|
||||
button.disabled = true;
|
||||
button.textContent = '寫入中';
|
||||
button.textContent = '執行中';
|
||||
fetch(`/api/pchome-review/${encodeURIComponent(sku)}/decision`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -640,9 +640,9 @@ let priceChartInstance = null;
|
||||
.then(response => response.json().then(data => ({ ok: response.ok, data })))
|
||||
.then(({ ok, data }) => {
|
||||
if (!ok || !data.success) {
|
||||
throw new Error(data.message || '覆核寫入失敗');
|
||||
throw new Error(data.message || 'AI 決策寫入失敗');
|
||||
}
|
||||
alert(data.message || '覆核已寫入');
|
||||
alert(data.message || 'AI 決策已寫入');
|
||||
window.location.reload();
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user