Вывел тип заказа
This commit is contained in:
gofnnp 2023-02-05 19:13:56 +04:00
parent d7265def88
commit acc9175381
4 changed files with 18 additions and 0 deletions

7
src/app/data/data.ts Normal file
View File

@ -0,0 +1,7 @@
export const OrderTypes = {
"mobileApp": "Мобильное приложение",
"offlineReline": "Кассовое приложение",
"mobileAppOfflineOrder": "Диплинк",
"selfServiceTerminalOrder": "Терминал самообслуживания",
"notFound": "Тип не найден"
}

View File

@ -63,6 +63,7 @@ export interface Order {
status_h: string;
item_style: string;
isWarnLine: boolean;
type: string;
}
export interface Client {

View File

@ -20,6 +20,7 @@
<th>Внешний ID заказа</th>
<th>Телефон клиента</th>
<th>Тип оплаты</th>
<th>Тип заказа</th>
</tr>
<tr style="position:sticky !important; top: 55px">
<th><p-columnFilter type="text" field="id" [matchModeOptions]="matchModeOptions" [matchMode]="'custom-contains'"></p-columnFilter></th>
@ -43,6 +44,7 @@
<td>{{order.external_id}}</td>
<td>{{order.phone}}</td>
<td *ngIf="order.payment[0]; else nd">{{order.payment[0].type}}</td>
<td>{{orderTypes[leadToTypeOrderType(order.type)]}}</td>
</tr>
</ng-template>
<ng-template #nd>
@ -62,6 +64,7 @@
<th>Дата создания</th>
<th>ID точки заказа</th>
<th>Статус</th>
<th>Тип заказа</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-ord>
@ -89,6 +92,7 @@
<option>Напечатан</option>
</select>
</td>
<td>{{orderTypes[leadToTypeOrderType(ord.type)]}}</td>
</tr>
</ng-template>
</p-table>

View File

@ -6,6 +6,7 @@ import { Order, Products, Delivery_address, Notification, Refund } from "src/app
import { ClientsComponent } from "../clients/clients.component";
import { ToastModule } from 'primeng/toast';
import { ConfirmationService, FilterService, FilterMatchMode, SelectItem } from 'primeng/api';
import { OrderTypes } from "src/app/data/data";
/*import { SwPush, NewsletterService } from '@angular/service-worker*/
@ -36,6 +37,7 @@ export class OrdersComponent implements OnInit {
public sumRef3: any = 0;
public matchModeOptions!: SelectItem[];
public dis: boolean = false;
public readonly orderTypes = OrderTypes
public statuses = [
@ -398,4 +400,8 @@ notif2() {
}
}
leadToTypeOrderType(str: any) {
return str as keyof typeof this.orderTypes
}
}