h-selfdelivery-admin-panel-p/src/app/pages/terminals/terminals.component.html

77 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div>
<h1>Терминалы</h1>
<h2 *ngIf="chooseName; else ClientNull">Выбран: {{chooseName}}</h2>
<ng-template #ClientNull>
<h2 style="color:red">Выберите клиента</h2>
</ng-template>
</div>
<div *ngIf="new_ter;else new_Terminal">
<button (click)="registerTerminal()">Добавить</button>
<p-table [value]="terminals">
<ng-template pTemplate="header">
<tr>
<th style="width: 16%">ID</th>
<th style="width: 16%">Наименование терминала</th>
<th style="width: 16%">Адрес точки заказа</th>
<th style="width: 16%">Список ID цехов готовки</th>
<th style="width: 16%">Статус подключения</th>
<th></th>
<th></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-terminals>
<tr>
<td style="width: 16%" class="customer-badge status-unqualified">{{terminals.id}}</td>
<td style="width: 16%">{{terminals.public_id}}</td>
<td style="width: 16%">{{terminals.division_id}}</td>
<td style="width: 16%">{{terminals.area_types}}</td>
<td style="width: 16%"></td>
<td><button (click)="updateTerminal1(terminals.id, terminals.public_id, terminals.division_id, terminals.area_types)">Изменить</button></td>
<td><button (click)="deleteTerminal(terminals.id)">Удалить</button></td>
</tr>
</ng-template>
</p-table>
</div>
<ng-template #new_Terminal>
<button (click)="getTerminals()">К списку</button>
<p-table>
<ng-template pTemplate="header">
<tr>
<th>Введите внешний ID терминала:</th>
<th><input type="text" style="width: 400px; height: 30px; font-size:20px"></th>
</tr>
<tr>
<th>Введите ID точки заказа:</th>
<th><input type="text" style="width: 400px; height: 30px; font-size:20px"></th>
</tr>
<tr>
<th>Введите ID цехов готовки:</th>
<th>
<tbody *ngFor="let area of areas">
<tr>
<input type="checkbox" value="{{area.selected}}" id="ar" [(ngModel)]="area.selected">
<span>Цех: {{area.name}}</span>
</tr>
</tbody>
</th>
</tr>
</ng-template>
</p-table>
<div *ngIf="create; else change">
<button (click)="registerTerminal2()">Создать</button>
<button (click)="updateTerminal()">Сохранить</button>
</div>
<ng-template #change>
<button (click)="updateTerminal()">Сохранить</button>
</ng-template>
</ng-template>