14087 - Питьсбург. Правки в админке
This commit is contained in:
parent
1de86131c6
commit
08c4bdb12d
@ -5,7 +5,7 @@
|
||||
"ng": "ng",
|
||||
"start": "ng serve --proxy-config proxy.confi.json",
|
||||
"build": "ng build",
|
||||
"build-test:lithium": "ng build --output-path=/var/www/html/selfdelivery-pitsburg-test.mydatahosting.ru --configuration=test",
|
||||
"build-test:lithium": "ng build --configuration=test",
|
||||
"build-prod:lithium": "ng build --output-path=/var/www/html/selfdelivery-pitsburg.mydatahosting.ru",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test"
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
<ng-template #order_v>
|
||||
<div>
|
||||
<button (click)="listOrders()">К списку</button>
|
||||
<h1>Заказ: {{order[0].id}}</h1>
|
||||
<h1>Заказ: {{order[0]?.id}}</h1>
|
||||
<p-table [value]="order">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
@ -150,7 +150,7 @@
|
||||
<tr>
|
||||
<th>Сумма оплаты</th>
|
||||
<th>Тип оплаты</th>
|
||||
<th *ngIf="order[0].payment[0]?.type !== 'CASH'">Статус оплаты</th>
|
||||
<th *ngIf="order[0].payment[0]?.type?.toUpperCase() !== 'CASH'">Статус оплаты</th>
|
||||
<!-- <th *ngIf="['PAID', 'NOTIFIED', 'INTERNAL_ERROR', 'PROCESSING'].includes(order[0].payment[0]?.payload?.status || '') && order[0].payment[0]?.type !== 'CASH'">Отмена заказа</th> -->
|
||||
<th>Отмена заказа</th>
|
||||
</tr>
|
||||
@ -159,7 +159,7 @@
|
||||
<tr>
|
||||
<td>{{pay.summ}}</td>
|
||||
<td>{{pay.type | paymentType}}</td>
|
||||
<td *ngIf="pay.type !== 'CASH'">{{pay?.payload?.status | paymentStatus}}</td>
|
||||
<td *ngIf="pay?.type?.toUpperCase() !== 'CASH'">{{pay?.payload?.status | paymentStatus}}</td>
|
||||
<!-- <td *ngIf="['PAID', 'NOTIFIED', 'INTERNAL_ERROR', 'PROCESSING'].includes(order[0].payment[0]?.payload?.status || '') && order[0].payment[0]?.type !== 'CASH'"> -->
|
||||
<td>
|
||||
<button (click)="cancelOrder(pay.payload?.id)">Отменить</button>
|
||||
|
||||
@ -332,6 +332,9 @@ export class OrdersComponent implements OnInit {
|
||||
},
|
||||
error: (error) => {
|
||||
console.log('ERROR: ', error);
|
||||
if(error?.error?.error?.code === 3){
|
||||
return;
|
||||
}
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Произошла ошибка!',
|
||||
@ -341,7 +344,7 @@ export class OrdersComponent implements OnInit {
|
||||
}
|
||||
|
||||
cancelOrder(payment_request_id: string) {
|
||||
if (this.order[0].payment[0]?.type === 'CASH') {
|
||||
if (this.order[0].payment[0]?.type?.toUpperCase() === 'CASH' && !this.order[0].payment[0]?.payload?.id) {
|
||||
this.changeOrderStatus(this.order[0].id, 'cancel');
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user