52 lines
1.8 KiB
HTML
52 lines
1.8 KiB
HTML
<h1>Подразделения</h1>
|
||
|
||
<h2 *ngIf="chooseName; else ClientNull">Выбран: {{chooseName}}</h2>
|
||
<ng-template #ClientNull>
|
||
<h2 style="color:red">Выберите клиента</h2>
|
||
</ng-template>
|
||
|
||
<div *ngIf="new_div;else new_Division">
|
||
<button (click)="createDivision()">Добавить</button>
|
||
<p-table [value]="divisions">
|
||
<ng-template pTemplate="header">
|
||
<tr style="position:sticky !important; top: 0">
|
||
<th style="width:35%">ID</th>
|
||
<th style="width:35%">Наименование подразделения</th>
|
||
<th></th>
|
||
<th></th>
|
||
</tr>
|
||
</ng-template>
|
||
<ng-template pTemplate="body" let-Division>
|
||
<!--*ngIf="color()" style="color: red" [ngClass]="{ui-button-danger: true}"-->
|
||
<tr>
|
||
<td style="width:35%">{{Division.id}}</td>
|
||
<td style="width:35%">{{Division.name}}</td>
|
||
<td><button (click)="changeDivision1(Division.id, Division.name)">Изменить</button></td>
|
||
<td><button (click)="confirm(Division.id)">Удалить</button></td>
|
||
</tr>
|
||
</ng-template>
|
||
</p-table>
|
||
</div>
|
||
|
||
<ng-template #new_Division>
|
||
<button (click)="getDivisions()">К списку</button>
|
||
<p-table>
|
||
<ng-template pTemplate="header">
|
||
<tr>
|
||
<th>Введите наименование подразделения:</th>
|
||
<th><input type="text" style="width: 400px; height: 30px; font-size:20px"></th>
|
||
</tr>
|
||
</ng-template>
|
||
</p-table>
|
||
<div *ngIf="create; else change">
|
||
<button (click)="createDivision2()">Создать</button>
|
||
</div>
|
||
<ng-template #change>
|
||
<button (click)="changeDivision()">Сохранить</button>
|
||
</ng-template>
|
||
</ng-template>
|
||
|
||
<p-confirmDialog header="Предупреждение" icon="pi pi-exclamation-triangle" defaultFocus="reject" rejectButtonStyleClass="p-button-outlined"></p-confirmDialog>
|
||
|
||
|