add vendor field
This commit is contained in:
parent
58d8e0ee03
commit
ac4ffb1ef6
@ -175,6 +175,7 @@ export class UserService {
|
|||||||
"email": users.email,
|
"email": users.email,
|
||||||
"isactive":users.isactive,
|
"isactive":users.isactive,
|
||||||
"designation":users.designation,
|
"designation":users.designation,
|
||||||
|
"smc_agency_id":users.smc_agency_id,
|
||||||
"fk_entity_type_id":users.type.entity_type_id,
|
"fk_entity_type_id":users.type.entity_type_id,
|
||||||
"fk_entity_id":enities,
|
"fk_entity_id":enities,
|
||||||
"fk_city":users.city.city_id,
|
"fk_city":users.city.city_id,
|
||||||
@ -247,6 +248,9 @@ export class UserService {
|
|||||||
|
|
||||||
return this.http.post(apiurl + "saveOrUpdateUserConfig",configdata);
|
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>
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
<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>--</mat-option>
|
||||||
<mat-option *ngFor="let c of City" [value]="c">
|
<mat-option *ngFor="let c of City" [value]="c">
|
||||||
{{c.name}}
|
{{c.name}}
|
||||||
@ -174,6 +174,17 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</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>
|
</div>
|
||||||
<mat-card-actions style="text-align:right;">
|
<mat-card-actions style="text-align:right;">
|
||||||
|
|||||||
@ -73,6 +73,7 @@ export class RegisterComponent implements OnInit {
|
|||||||
visible: boolean=false;
|
visible: boolean=false;
|
||||||
configdata: any;
|
configdata: any;
|
||||||
shortname: any;
|
shortname: any;
|
||||||
|
vendorlist: any;
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router, public fb: FormBuilder,public cb: FormBuilder, public AWS: AwsService, private cd: ChangeDetectorRef
|
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) {
|
,private elementRef: ElementRef,public users:UserService,notifier:NotifierService,private dialog: MatDialog) {
|
||||||
@ -204,10 +205,9 @@ export class RegisterComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
register(userData) {
|
register(userData) {
|
||||||
console.log(userData)
|
|
||||||
if(this.regForm.invalid){
|
if(this.regForm.invalid){
|
||||||
//console.log(this.regForm.value);
|
|
||||||
//return;
|
|
||||||
// this.notifier.notify('success','Please Fill all the Fields')
|
// this.notifier.notify('success','Please Fill all the Fields')
|
||||||
Swal('Please Fill all the Fields');
|
Swal('Please Fill all the Fields');
|
||||||
const invalid = [];
|
const invalid = [];
|
||||||
@ -396,6 +396,8 @@ getBranch(flag?){
|
|||||||
if(this.types[0].entity_type_id == '2' && this.regForm.value.lenVenName.short_name == 'MWISE') {
|
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('user_config',this.addUserConfigControls())
|
||||||
this.regForm.addControl('designation',new FormControl('',Validators.required))
|
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=>{
|
this.users.getEntityPreferences(this.regForm.value.lenVenName.entity_id).subscribe(res=>{
|
||||||
if(res['dataStatus']) {
|
if(res['dataStatus']) {
|
||||||
this.productsList = res['records'].salespd_products
|
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('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('designation').setValue(this.users.localUserId.designation)
|
||||||
|
this.regForm.get('smc_agency_id').setValue(this.users.localUserId.designation)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -426,6 +430,7 @@ getBranch(flag?){
|
|||||||
else {
|
else {
|
||||||
this.regForm.removeControl('user_config')
|
this.regForm.removeControl('user_config')
|
||||||
this.regForm.removeControl('designation')
|
this.regForm.removeControl('designation')
|
||||||
|
this.regForm.removeControl('smc_agency_id')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userupdate() {
|
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);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ export class UserListComponent implements OnInit {
|
|||||||
let userGroup = session.idToken.payload["cognito:groups"].filter(
|
let userGroup = session.idToken.payload["cognito:groups"].filter(
|
||||||
usergroup => usergroup == "ADMIN"
|
usergroup => usergroup == "ADMIN"
|
||||||
)[0];
|
)[0];
|
||||||
|
// let userGroup="ADMIN";
|
||||||
if(userGroup == "ADMIN" ){
|
if(userGroup == "ADMIN" ){
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user