ss
This commit is contained in:
parent
1c307c6f60
commit
c8f9d33dc5
1146
package-lock.json
generated
1146
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,13 +8,17 @@
|
||||
|
||||
</ng-container>
|
||||
<label for="subject">E-mail:</label>
|
||||
<input formControlName="email" nbInput id="email" type="text" [status]="userForm.get('email').invalid && userForm.get('email').touched? 'danger' : 'basic'">
|
||||
<input formControlName="email" nbInput id="email" type="text" [status]="userForm.get('email').invalid && userForm.get('email').touched? 'danger' : 'basic'" (input)="onInputChange($event)">
|
||||
<ng-container nbInputErrorMessage>
|
||||
<div style="color:#7c0e0e" *ngIf="userForm.get('email').hasError('required') && userForm.get('email').touched">Email is required.</div>
|
||||
|
||||
<div style="color:#7c0e0e" *ngIf="!userForm.get('email')?.errors?.required && (userForm.get('email')?.errors?.pattern)">
|
||||
Please enter a valid email address
|
||||
</div>
|
||||
|
||||
<div style="color:#7c0e0e" *ngIf="mail_exist == true">
|
||||
Email already exist
|
||||
</div>
|
||||
</ng-container>
|
||||
<label for="subject">Password:</label>
|
||||
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
|
||||
@ -43,6 +47,6 @@
|
||||
</nb-select> -->
|
||||
<nb-card-footer>
|
||||
<button type="button" class="cancel" nbButton status="danger" (click)="cancel()">Cancel</button>
|
||||
<button nbButton status="success" type="submit" [disabled]="!userForm.valid">Submit</button>
|
||||
<button nbButton status="success" type="submit" [disabled]="!userForm.valid || mail_exist">Submit</button>
|
||||
</nb-card-footer>
|
||||
</form>
|
||||
@ -8,10 +8,11 @@ import { NbWindowService ,NbWindowRef, NB_WINDOW_CONTEXT } from '@nebular/theme'
|
||||
styleUrls: ['./driver-form.component.scss']
|
||||
})
|
||||
export class DriverFormComponent implements OnInit {
|
||||
|
||||
driver :any;
|
||||
mail_exist :any;
|
||||
userForm: FormGroup | any; formData:any =[]
|
||||
constructor(@Inject(NB_WINDOW_CONTEXT) public data: any,public _api:PageapiService,private windowService: NbWindowService, private windowRef: NbWindowRef) {
|
||||
|
||||
this.getuserlistApi()
|
||||
console.log(this.data)
|
||||
}
|
||||
|
||||
@ -86,4 +87,32 @@ this.windowRef.close(1);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onInputChange(event: any) {
|
||||
const enteredText = event.target.value;
|
||||
const userWithEmail = this.driver.some(user => user.email === enteredText);
|
||||
this.mail_exist = userWithEmail;
|
||||
|
||||
// You can perform additional actions with the entered text here
|
||||
}
|
||||
|
||||
getuserlistApi(){
|
||||
let param ={}
|
||||
this._api.getusers(param).subscribe(res => {
|
||||
console.log(res)
|
||||
if(res.status == 200){
|
||||
|
||||
let passData = res.data
|
||||
let driver = passData.filter(arr=>{return arr.role == 'DRIVER'})
|
||||
driver.forEach((element:any, index) => {
|
||||
element.index = index +1
|
||||
|
||||
});
|
||||
this.driver = driver
|
||||
console.log(driver)
|
||||
//this.source.load(driver);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -140,9 +140,10 @@
|
||||
<label for="subject" style=" font-weight: 600;width: 30%;">Qty:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-md-3"></div>
|
||||
<div class="col-6 col-md-4">
|
||||
<div>
|
||||
<label for="subject" style=" font-weight: 600;"> </label>
|
||||
<div *ngIf="( fieldTitle == 'Edit Order' && setData.status == 'ordered') || dropdown_data == 'ordered'">
|
||||
<label for="subject" style="font-weight: 600; text-align: center; display: block;">Add or Remove Products </label>
|
||||
</div>
|
||||
</div>
|
||||
<nb-action icon="plus-circle-outline" class="custom-action-icon" [nbTooltip]="'Add'" (click)="addInputFieldGroup()" *ngIf="inputFieldGroups.length == 0"></nb-action>
|
||||
@ -158,6 +159,7 @@
|
||||
|
||||
|
||||
<div class="row show-grid" *ngIf="product.length>0" >
|
||||
|
||||
<div class="col-6 col-md-3">
|
||||
<div >
|
||||
<nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false">
|
||||
@ -190,7 +192,7 @@
|
||||
|
||||
<div class="col-6 col-md-3">
|
||||
<div >
|
||||
<nb-actions size="medium" *ngIf="fieldTitle != 'View Order'">
|
||||
<nb-actions size="medium" *ngIf="(fieldTitle != 'View Order') && ( fieldTitle == 'Edit Order' && setData.status == 'ordered') || dropdown_data == 'ordered'">
|
||||
<nb-action icon="plus-circle-outline" class="custom-action-icon" [nbTooltip]="'Add'" (click)="addInputFieldGroup()"></nb-action>
|
||||
|
||||
<nb-action icon="minus-circle-outline" [nbTooltip]="'Remove'" (click)="removeInputFieldGroup(i)"></nb-action>
|
||||
|
||||
@ -57,6 +57,7 @@ fieldTitle:any ='New Order'
|
||||
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
|
||||
invoice = new Invoice();
|
||||
hiddenBtn= false;
|
||||
dropdown_data: any;
|
||||
delArr:any=[]
|
||||
selectedProductId: number | undefined = null;
|
||||
addFormBtn: any;
|
||||
@ -821,6 +822,7 @@ onSelectChange(newValue: string) {
|
||||
// Handle the selected value change here
|
||||
this.selectDriver = []
|
||||
console.log(newValue);
|
||||
this.dropdown_data = newValue;
|
||||
if(newValue == 'Out For Delivery'){
|
||||
this.hiddenBtn = true;
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
||||
|
||||
export const environment = {
|
||||
apiEndpoint:'https://dev.venbait.in/vnms/api/',
|
||||
// apiEndpoint:'http://localhost:8081/api/',
|
||||
// apiEndpoint:'https://dev.venbait.in/vnms/api/',
|
||||
apiEndpoint:'http://localhost:8081/api/',
|
||||
mailUrl:'',
|
||||
production: false,
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user