UX: Удалено поле "Примечание" из виджета оплаты в POS
Убрано лишнее поле "Примечание" из PaymentWidget: - Удалено HTML-поле для ввода примечания - Убраны все обращения к notesInput в коде - Примечания теперь передаются как пустая строка Для POS-терминала это поле избыточно и только замедляет процесс оплаты. Интерфейс стал проще и быстрее. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -71,15 +71,6 @@ export class PaymentWidget {
|
|||||||
<small class="text-muted" id="${this.containerId}-hint"></small>
|
<small class="text-muted" id="${this.containerId}-hint"></small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Примечание -->
|
|
||||||
<div class="mb-2">
|
|
||||||
<label class="form-label small mb-1">Примечание</label>
|
|
||||||
<input type="text"
|
|
||||||
class="form-control form-control-sm"
|
|
||||||
id="${this.containerId}-notes"
|
|
||||||
placeholder="Опционально">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Кнопка добавить (только для mixed mode) -->
|
<!-- Кнопка добавить (только для mixed mode) -->
|
||||||
${this.mode === 'mixed' ? `
|
${this.mode === 'mixed' ? `
|
||||||
<div class="d-flex gap-2">
|
<div class="d-flex gap-2">
|
||||||
@@ -186,7 +177,6 @@ export class PaymentWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const amountInput = document.getElementById(`${this.containerId}-amount`);
|
const amountInput = document.getElementById(`${this.containerId}-amount`);
|
||||||
const notesInput = document.getElementById(`${this.containerId}-notes`);
|
|
||||||
|
|
||||||
const amount = parseFloat(amountInput.value);
|
const amount = parseFloat(amountInput.value);
|
||||||
|
|
||||||
@@ -208,7 +198,7 @@ export class PaymentWidget {
|
|||||||
method_code: this.selectedMethod.code,
|
method_code: this.selectedMethod.code,
|
||||||
method_name: this.selectedMethod.name,
|
method_name: this.selectedMethod.name,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
notes: notesInput.value.trim()
|
notes: '' // Примечания не используются в POS
|
||||||
});
|
});
|
||||||
|
|
||||||
// Обновляем UI
|
// Обновляем UI
|
||||||
@@ -217,7 +207,6 @@ export class PaymentWidget {
|
|||||||
// Сбрасываем форму
|
// Сбрасываем форму
|
||||||
const remaining = this.order.amount_due - this.getTotalPayments();
|
const remaining = this.order.amount_due - this.getTotalPayments();
|
||||||
amountInput.value = remaining > 0 ? remaining.toFixed(2) : '0.00';
|
amountInput.value = remaining > 0 ? remaining.toFixed(2) : '0.00';
|
||||||
notesInput.value = '';
|
|
||||||
|
|
||||||
// Снимаем выделение способа
|
// Снимаем выделение способа
|
||||||
document.querySelectorAll(`#${this.containerId}-methods .payment-method-btn`).forEach(b => {
|
document.querySelectorAll(`#${this.containerId}-methods .payment-method-btn`).forEach(b => {
|
||||||
@@ -256,7 +245,6 @@ export class PaymentWidget {
|
|||||||
<div style="font-size: 0.9rem;">
|
<div style="font-size: 0.9rem;">
|
||||||
<strong>${p.method_name}</strong>
|
<strong>${p.method_name}</strong>
|
||||||
<span class="text-success ms-2">${p.amount.toFixed(2)} руб.</span>
|
<span class="text-success ms-2">${p.amount.toFixed(2)} руб.</span>
|
||||||
${p.notes ? `<br><small class="text-muted">${p.notes}</small>` : ''}
|
|
||||||
</div>
|
</div>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-sm btn-outline-danger remove-payment-btn"
|
class="btn btn-sm btn-outline-danger remove-payment-btn"
|
||||||
@@ -340,19 +328,18 @@ export class PaymentWidget {
|
|||||||
if (this.mode === 'single') {
|
if (this.mode === 'single') {
|
||||||
// Одиночная оплата
|
// Одиночная оплата
|
||||||
const amountInput = document.getElementById(`${this.containerId}-amount`);
|
const amountInput = document.getElementById(`${this.containerId}-amount`);
|
||||||
const notesInput = document.getElementById(`${this.containerId}-notes`);
|
|
||||||
|
|
||||||
paymentsData = [{
|
paymentsData = [{
|
||||||
payment_method: this.selectedMethod.code,
|
payment_method: this.selectedMethod.code,
|
||||||
amount: parseFloat(amountInput.value),
|
amount: parseFloat(amountInput.value),
|
||||||
notes: notesInput.value.trim()
|
notes: ''
|
||||||
}];
|
}];
|
||||||
} else {
|
} else {
|
||||||
// Смешанная оплата
|
// Смешанная оплата
|
||||||
paymentsData = this.payments.map(p => ({
|
paymentsData = this.payments.map(p => ({
|
||||||
payment_method: p.method_code,
|
payment_method: p.method_code,
|
||||||
amount: p.amount,
|
amount: p.amount,
|
||||||
notes: p.notes
|
notes: p.notes || ''
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user