From c6b89c7f12f9e79bf4291e68cf15be8402a19d60 Mon Sep 17 00:00:00 2001 From: Well Date: Mon, 26 Aug 2024 15:46:23 +0800 Subject: [PATCH 01/88] pay button --- .../ui-cards/CashRegisters/ChequeModal.vue | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue index a1d67c82a4..e25d556b20 100644 --- a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue +++ b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue @@ -108,8 +108,20 @@ > -
+
К оплате {{ summForPay.toFixed(2) }}
+ +
+ Не все услуги имеют цену +
{ } return 0.00; }); +watch([summForPay], () => { + paymentCard.value = Number(summForPay.value.toFixed(2)); +}); const receivedCash = ref(0); const cashChange = computed(() => { @@ -275,4 +290,7 @@ const maxPay = computed(() => { .discount-width { width: 90px; } +.text-red { + color: red; +} From 67e5ea315f10938de5efeadb06cc3ffc0ee730a7 Mon Sep 17 00:00:00 2001 From: Well Date: Tue, 27 Aug 2024 09:01:28 +0800 Subject: [PATCH 02/88] payment v0.1 --- .../ui-cards/CashRegisters/ChequeModal.vue | 33 +++++++++++++++++-- .../src/ui-cards/CashRegisters/ShiftModal.vue | 2 +- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue index e25d556b20..85249d1810 100644 --- a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue +++ b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue @@ -112,7 +112,8 @@
К оплате {{ summForPay.toFixed(2) }}
@@ -160,7 +161,7 @@ diff --git a/l2-frontend/src/ui-cards/CashRegisters/ShiftModal.vue b/l2-frontend/src/ui-cards/CashRegisters/ShiftModal.vue index b4163ec1bb..7d2d660988 100644 --- a/l2-frontend/src/ui-cards/CashRegisters/ShiftModal.vue +++ b/l2-frontend/src/ui-cards/CashRegisters/ShiftModal.vue @@ -249,8 +249,8 @@ const openShift = async () => { const { ok, message } = await api('cash-register/open-shift', { cashRegisterId: selectedCashRegister.value }); loading.value = false; if (ok) { - await getShiftData(); root.$emit('msg', 'ok', 'Заявка отправлена'); + await getShiftData(); } else { root.$emit('msg', 'error', message); } From 7ba146cb097066290d521a18b0ffb7a69e58fa97 Mon Sep 17 00:00:00 2001 From: Well Date: Tue, 27 Aug 2024 09:11:52 +0800 Subject: [PATCH 03/88] . --- api/cash_registers/urls.py | 1 + api/cash_registers/views.py | 7 +++++++ l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api/cash_registers/urls.py b/api/cash_registers/urls.py index 74767cfba6..6843365bdf 100644 --- a/api/cash_registers/urls.py +++ b/api/cash_registers/urls.py @@ -7,4 +7,5 @@ path('close-shift', views.close_shift), path('get-shift-data', views.get_shift_data), path('get-services-coasts', views.get_services_coasts), + path('payment', views.payment), ] diff --git a/api/cash_registers/views.py b/api/cash_registers/views.py index 0da5fb7f68..c8c107de78 100644 --- a/api/cash_registers/views.py +++ b/api/cash_registers/views.py @@ -40,3 +40,10 @@ def get_services_coasts(request): request_data = json.loads(request.body) result = cash_register_views.get_service_coasts(request_data["serviceIds"]) return JsonResponse(result) + + +@login_required +def payment(request): + request_data = json.loads(request.body) + result = {"ok": True, "message": ""} + return JsonResponse(result) diff --git a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue index 85249d1810..c91d7de97d 100644 --- a/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue +++ b/l2-frontend/src/ui-cards/CashRegisters/ChequeModal.vue @@ -254,11 +254,12 @@ const payment = async () => { serviceIds: props.serviceIds, }); await store.dispatch(actions.DEC_LOADING); + console.log(ok); if (ok) { root.$emit('msg', 'ok', 'Заявка отправлена'); await getChequeData(); } else { - root.$emit('msg', 'error', message); + root.$emit('msg', 'error', 'Ошибка'); } }; From 8d69b4dd3a6c0267c07d8a140448396b593ff3d3 Mon Sep 17 00:00:00 2001 From: Well Date: Tue, 27 Aug 2024 10:16:13 +0800 Subject: [PATCH 04/88] shift component fixs --- l2-frontend/src/components/Navbar.vue | 11 +- .../ui-cards/CashRegisters/ShiftButton.vue | 52 ++++ .../src/ui-cards/CashRegisters/ShiftModal.vue | 273 ++++++++---------- 3 files changed, 179 insertions(+), 157 deletions(-) create mode 100644 l2-frontend/src/ui-cards/CashRegisters/ShiftButton.vue diff --git a/l2-frontend/src/components/Navbar.vue b/l2-frontend/src/components/Navbar.vue index 890ea7f7ba..759f3c073e 100644 --- a/l2-frontend/src/components/Navbar.vue +++ b/l2-frontend/src/components/Navbar.vue @@ -63,8 +63,11 @@ -