Время последнего обновления: {{lastOrderUpdateTime | date:'dd.MM.yyyy HH:mm:ss'}}
-
+
| ID |
Статус |
@@ -57,22 +21,9 @@
Телефон клиента |
Тип оплаты |
-
+
|
|
-
-
|
|
|
@@ -154,21 +105,12 @@
-
| {{ord.title}} |
{{ord.requested_quantity}} |
- |
{{ord.stock_quantity}} |
- |
-
-
-
-
-
|
@@ -187,8 +129,8 @@
- | Сумма к оплате по безналу: |
- Тип оплаты: |
+ Сумма оплаты по безналу: |
+ Тип оплаты: |
@@ -198,6 +140,20 @@
+
+ Возвраты:
+
+
+
+ | Сумма по возвратам: |
+ |
+
+
+ | {{sumRef}} |
+ |
+
+
+
diff --git a/src/app/pages/orders/orders.component.scss b/src/app/pages/orders/orders.component.scss
index b9956f0..065b532 100644
--- a/src/app/pages/orders/orders.component.scss
+++ b/src/app/pages/orders/orders.component.scss
@@ -1,3 +1,50 @@
-.Red {
- color: red;
+button:disabled {
+ background-color: grey !important;
+ opacity: 50%;
+ cursor: default;
+}
+.red {
+ color: red !important;
+ background-color: pink;
+}
+
+.orange {
+ color: darkorange !important;
+ background-color: wheat;
+}
+
+.green {
+ color: green !important;
+ background-color: lightgreen;
+}
+
+.grey {
+ color: grey !important;
+ background-color: lightgray;
+}
+
+.yellow {
+ color: darkgoldenrod !important;
+ background-color: lightgoldenrodyellow;
+}
+
+.blue {
+ color: blue !important;
+ background-color: lightblue;
+}
+
+.lilac {
+ color: #8b00ff !important;
+ background-color: #ebc4eb;
+}
+
+p-table {
+ height: auto;
+ overflow: scroll
+}
+
+tr {
+ display: table;
+ width: calc(100% - 5px);
+ table-layout: fixed;
}
diff --git a/src/app/pages/orders/orders.component.ts b/src/app/pages/orders/orders.component.ts
index 5829bf9..5e8dbba 100644
--- a/src/app/pages/orders/orders.component.ts
+++ b/src/app/pages/orders/orders.component.ts
@@ -2,7 +2,7 @@ import { Component, OnInit, Renderer2, ElementRef, Input } from "@angular/core";
import { TableModule } from 'primeng/table';
import { JsonrpcService, RpcService } from "src/app/services/jsonrpc.service";
import { MessageService } from "primeng/api";
-import { Order, Products, Delivery_address, Notification } from "src/app/interface/data";
+import { Order, Products, Delivery_address, Notification, Refund } from "src/app/interface/data";
import { ClientsComponent } from "../clients/clients.component";
/*import { SwPush, NewsletterService } from '@angular/service-worker*/
@@ -26,6 +26,11 @@ export class OrdersComponent implements OnInit {
public map_due = new Map();
public myAudioP = new Audio();
public myAudioA = new Audio();
+ public refund!: Refund;
+ public sumRef: number = 0;
+ public sumRef0: any = 0;
+ public sumRef1: any = 0;
+ public sumRef2: any = 0;
public statuses = [
@@ -108,6 +113,13 @@ export class OrdersComponent implements OnInit {
this.lastOrderUpdateTime = Date().toString();
+
+ document.getElementsByTagName('thead')[0].style.display = 'table';
+ document.getElementsByTagName('thead')[0].style.width = '100%';
+ document.getElementsByTagName('thead')[0].style.tableLayout = 'fixed';
+ document.getElementsByTagName('tbody')[0].style.display = 'block';
+ document.getElementsByTagName('tbody')[0].style.maxHeight = 'calc(100vh - 290px)';
+ document.getElementsByTagName('tbody')[0].style.overflowY = 'scroll';
},
error: (err) => {
console.log('ERROR: ', err)
@@ -167,9 +179,75 @@ notif2() {
}
}
);
- this.view = false
+ this.view = false;
+ setTimeout(() => this.getOrderRefunds(this.order[0].external_id), 400);
}
+
+ async getOrderRefunds(id: any) {
+
+ await this.jsonRpcService.rpc2({
+ method: 'getOrderRefunds',
+ params: { "external_id": id }
+ }, RpcService.authService, false)
+ .subscribe({
+ next: (result) => {
+ let data = result.result
+ this.refund =data
+
+ if (this.refund.admin_return.status == 'COMPLETED') {
+ this.sumRef0 = this.refund.admin_return.amount
+
+ } else this.sumRef0 = 0;
+
+ if (this.refund.difference_return.status == 'COMPLETED') {
+ this.sumRef1 = this.refund.difference_return.amount
+
+ } else this.sumRef1 = 0;
+
+ if (this.refund.full_return.status == 'COMPLETED') {
+ this.sumRef2 = this.refund.full_return.amount
+
+ } else this.sumRef2 = 0
+ this.sumRef = this.sumRef0 + this.sumRef1 + this.sumRef2
+ },
+ error: (err) => {
+ console.log('ERROR: ', err)
+ this.messageService.add({
+ severity: 'error',
+ summary: 'Произошла ошибка!',
+ })
+ }
+ }
+ );
+
+
+ }
+
+ async doAdminRefund(id: any, qr_id: any) {
+
+ await this.jsonRpcService.rpc2({
+ method: 'doAdminRefund',
+ params: { "external_id": id, "qr_id": qr_id }
+ }, RpcService.authService, false)
+ .subscribe({
+ next: (result) => {
+ let data = result.result
+ console.log(data)
+ },
+ error: (err) => {
+ console.log('ERROR: ', err)
+ this.messageService.add({
+ severity: 'error',
+ summary: 'Произошла ошибка!',
+ })
+ }
+ }
+ );
+ console.log(id, qr_id)
+ }
+
+
listOrders() {
this.view = true;
this.getOrders();
diff --git a/src/app/pages/terminals/terminals.component.html b/src/app/pages/terminals/terminals.component.html
index 3edb554..f8536d8 100644
--- a/src/app/pages/terminals/terminals.component.html
+++ b/src/app/pages/terminals/terminals.component.html
@@ -1,42 +1,41 @@
-Терминалы
+
+
Терминалы
-
-
-Выбран: {{chooseName}}
-
- Выберите клиента
-
+ Выбран: {{chooseName}}
+
+ Выберите клиента
+
+
+
-
+
+
- | ID |
- Наименование терминала |
- ID точки заказа |
- Список ID цехов готовки |
- Статус подключения |
- |
- |
+ ID |
+ Наименование терминала |
+ Адрес точки заказа |
+ Список ID цехов готовки |
+ Статус подключения |
+ |
+ |
-
-
-
-
- | {{terminals.id}} |
- {{terminals.public_id}} |
- {{terminals.division_id}} |
- {{terminals.area_types}} |
- |
- |
- |
-
-
+
+
+
+
+ | {{terminals.id}} |
+ {{terminals.public_id}} |
+ {{terminals.division_id}} |
+ {{terminals.area_types}} |
+ |
+ |
+ |
+
+
+
diff --git a/src/app/pages/terminals/terminals.component.scss b/src/app/pages/terminals/terminals.component.scss
index e69de29..b7e51a8 100644
--- a/src/app/pages/terminals/terminals.component.scss
+++ b/src/app/pages/terminals/terminals.component.scss
@@ -0,0 +1,9 @@
+span {
+ padding: 0 5px !important;
+}
+
+tr {
+ display: table;
+ width: calc(100% - 5px);
+ table-layout: fixed;
+}
diff --git a/src/app/pages/terminals/terminals.component.ts b/src/app/pages/terminals/terminals.component.ts
index e1b5840..5b357eb 100644
--- a/src/app/pages/terminals/terminals.component.ts
+++ b/src/app/pages/terminals/terminals.component.ts
@@ -45,6 +45,12 @@ export class TerminalsComponent implements OnInit {
next: (result) => {
let data = result.result;
this.terminals = data;
+ document.getElementsByTagName('thead')[0].style.display = 'table';
+ document.getElementsByTagName('thead')[0].style.width = '100%';
+ document.getElementsByTagName('thead')[0].style.tableLayout = 'fixed';
+ document.getElementsByTagName('tbody')[0].style.display = 'block';
+ document.getElementsByTagName('tbody')[0].style.maxHeight = 'calc(100vh - 290px)';
+ document.getElementsByTagName('tbody')[0].style.overflowY = 'scroll';
},
error: (err) => {
console.log('ERROR: ', err)
@@ -55,6 +61,7 @@ export class TerminalsComponent implements OnInit {
}
});
this.chooseName = this.jsonRpcService.ClientChooseName;
+
}
async getAreas() {