add vendor field
This commit is contained in:
parent
58d8e0ee03
commit
ac4ffb1ef6
@ -175,6 +175,7 @@ export class UserService {
|
||||
"email": users.email,
|
||||
"isactive":users.isactive,
|
||||
"designation":users.designation,
|
||||
"smc_agency_id":users.smc_agency_id,
|
||||
"fk_entity_type_id":users.type.entity_type_id,
|
||||
"fk_entity_id":enities,
|
||||
"fk_city":users.city.city_id,
|
||||
@ -247,6 +248,9 @@ export class UserService {
|
||||
|
||||
return this.http.post(apiurl + "saveOrUpdateUserConfig",configdata);
|
||||
}
|
||||
getvendorlist(){
|
||||
return this.http.get<any[]>(apiurl+'getSMCVendorList')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="City" [formControl]="regForm.controls['city']" required>
|
||||
<mat-select matInput placeholder="City" [formControl]="regForm.controls['city']" required >
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let c of City" [value]="c">
|
||||
{{c.name}}
|
||||
@ -174,6 +174,17 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="ml-xs mr-xs" *ngIf="regForm.controls['smc_agency_id']">
|
||||
<mat-select placeholder="Vendor" formControlName="smc_agency_id">
|
||||
<mat-option>
|
||||
Select
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let v_list of vendorlist" [value]="v_list.entity_id" >
|
||||
{{v_list.short_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<mat-card-actions style="text-align:right;">
|
||||
@ -192,7 +203,7 @@
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form [formGroup]="configForm" (ngSubmit)="configuration(configForm.value)">
|
||||
<div *ngIf="usersData && usersData.userid">
|
||||
|
||||
@ -73,6 +73,7 @@ export class RegisterComponent implements OnInit {
|
||||
visible: boolean=false;
|
||||
configdata: any;
|
||||
shortname: any;
|
||||
vendorlist: any;
|
||||
constructor(
|
||||
private router: Router, public fb: FormBuilder,public cb: FormBuilder, public AWS: AwsService, private cd: ChangeDetectorRef
|
||||
,private elementRef: ElementRef,public users:UserService,notifier:NotifierService,private dialog: MatDialog) {
|
||||
@ -204,10 +205,9 @@ export class RegisterComponent implements OnInit {
|
||||
|
||||
|
||||
register(userData) {
|
||||
console.log(userData)
|
||||
|
||||
if(this.regForm.invalid){
|
||||
//console.log(this.regForm.value);
|
||||
//return;
|
||||
|
||||
// this.notifier.notify('success','Please Fill all the Fields')
|
||||
Swal('Please Fill all the Fields');
|
||||
const invalid = [];
|
||||
@ -396,6 +396,8 @@ getBranch(flag?){
|
||||
if(this.types[0].entity_type_id == '2' && this.regForm.value.lenVenName.short_name == 'MWISE') {
|
||||
//this.regForm.addControl('user_config',this.addUserConfigControls())
|
||||
this.regForm.addControl('designation',new FormControl('',Validators.required))
|
||||
this.regForm.addControl('smc_agency_id',new FormControl('',Validators.required))
|
||||
this.getvendor()
|
||||
this.users.getEntityPreferences(this.regForm.value.lenVenName.entity_id).subscribe(res=>{
|
||||
if(res['dataStatus']) {
|
||||
this.productsList = res['records'].salespd_products
|
||||
@ -418,6 +420,8 @@ getBranch(flag?){
|
||||
// this.regForm.get('user_config')['controls']['salespd_products'].setValue(this.users.localUserId.user_config.salespd_products)
|
||||
|
||||
this.regForm.get('designation').setValue(this.users.localUserId.designation)
|
||||
this.regForm.get('smc_agency_id').setValue(this.users.localUserId.designation)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -426,6 +430,7 @@ getBranch(flag?){
|
||||
else {
|
||||
this.regForm.removeControl('user_config')
|
||||
this.regForm.removeControl('designation')
|
||||
this.regForm.removeControl('smc_agency_id')
|
||||
}
|
||||
}
|
||||
userupdate() {
|
||||
@ -651,5 +656,16 @@ callrole(flag,type,usersData){
|
||||
|
||||
})
|
||||
}
|
||||
getvendor()
|
||||
{
|
||||
|
||||
this.users.getvendorlist().subscribe(Response=>{
|
||||
if(Response['dataStatus']){
|
||||
this.vendorlist=Response['records'];
|
||||
console.log('list');
|
||||
console.log(this.vendorlist);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<mat-card-title><span style="font-size:24px;"> Users</span></mat-card-title>
|
||||
</div>
|
||||
</div>
|
||||
<mat-card-content>
|
||||
<mat-card-content>
|
||||
<div class="example-container mat-elevation-z8" style="margin-top:26px;">
|
||||
<div class="example-header">
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2" >
|
||||
|
||||
@ -11,7 +11,7 @@ import Swal from 'sweetalert2'
|
||||
@Component({
|
||||
selector: 'app-user-list',
|
||||
templateUrl: './user-list.component.html',
|
||||
styleUrls: ['./user-list.component.scss']
|
||||
styleUrls: ['./user-list.component.scss']
|
||||
})
|
||||
export class UserListComponent implements OnInit {
|
||||
public dataLength: number;
|
||||
@ -34,7 +34,7 @@ export class UserListComponent implements OnInit {
|
||||
let userGroup = session.idToken.payload["cognito:groups"].filter(
|
||||
usergroup => usergroup == "ADMIN"
|
||||
)[0];
|
||||
|
||||
// let userGroup="ADMIN";
|
||||
if(userGroup == "ADMIN" ){
|
||||
|
||||
}else{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user