entity branch edit , delete changes : kdk
This commit is contained in:
parent
c2eb97a5c9
commit
da69b69dd0
@ -5,13 +5,15 @@
|
||||
</form>
|
||||
<div *ngIf="listOfBranch.length > 0">
|
||||
<mat-list role="list" class="inlist">
|
||||
<mat-list-item role="listitem" *ngFor="let branch of listOfBranch; let i = index;" class="list-item" [ngStyle]="{ 'border-color': i === currentElement ? '#f44336' : 'gray'}">
|
||||
<label style="width: 80%" [hidden]="currentElement === i">{{branch.branch_name}}</label>
|
||||
<input *ngIf="currentElement === i" matInput placeholder="Add Branch" [(ngModel)]="branch.branch_name">
|
||||
<span (click)="editItem(i)" [hidden]="currentElement === i"><mat-icon>edit</mat-icon></span>
|
||||
<span (click)="editItem(-1)" *ngIf="currentElement === i"><mat-icon>check</mat-icon></span>
|
||||
<span (click)="deleteItem(i)"><mat-icon>delete</mat-icon></span>
|
||||
</mat-list-item>
|
||||
<ng-container *ngFor="let branch of listOfBranch; let i = index;">
|
||||
<mat-list-item role="listitem" *ngIf="branch.isactive == 1" class="list-item" [ngStyle]="{ 'border-color': i === currentElement ? '#f44336' : 'gray'}">
|
||||
<label style="width: 80%" [hidden]="currentElement === i">{{branch.branch_name}}</label>
|
||||
<input *ngIf="currentElement === i" matInput placeholder="Add Branch" [(ngModel)]="branch.branch_name">
|
||||
<span (click)="editItem(i)" [hidden]="currentElement === i"><mat-icon>edit</mat-icon></span>
|
||||
<span (click)="editItem(-1)" *ngIf="currentElement === i"><mat-icon>check</mat-icon></span>
|
||||
<span (click)="deleteItem(branch, i)"><mat-icon>delete</mat-icon></span>
|
||||
</mat-list-item>
|
||||
</ng-container>
|
||||
</mat-list>
|
||||
|
||||
<div class="row" style="text-align:right;">
|
||||
|
||||
@ -90,8 +90,12 @@ export class EntityBranchAddComponent implements OnInit {
|
||||
this.currentElement = i;
|
||||
}
|
||||
|
||||
deleteItem(i): void {
|
||||
this.listOfBranch.splice(i, 1);
|
||||
deleteItem(obj, i): void {
|
||||
if (obj.entity_lender_branch_id !== null) {
|
||||
obj.isactive = 0;
|
||||
} else {
|
||||
this.listOfBranch.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
saveBranch(): void {
|
||||
@ -112,7 +116,6 @@ export class EntityBranchAddComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// "records": [
|
||||
// {
|
||||
// "entity_lender_branch_id": null,
|
||||
|
||||
@ -240,7 +240,7 @@
|
||||
</app-entity-edit-tat>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab label="Branch">
|
||||
<mat-tab *ngIf="localEntityType == 2" label="Branch">
|
||||
<ng-template matTabContent>
|
||||
<app-entity-branch-add [entityId]="entity_id">
|
||||
</app-entity-branch-add>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user