This commit is contained in:
bitbucket 2023-11-21 17:34:15 +05:30
parent 1c307c6f60
commit c8f9d33dc5
6 changed files with 620 additions and 587 deletions

1148
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,13 +8,17 @@
</ng-container> </ng-container>
<label for="subject">E-mail:</label> <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> <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').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)"> <div style="color:#7c0e0e" *ngIf="!userForm.get('email')?.errors?.required && (userForm.get('email')?.errors?.pattern)">
Please enter a valid email address Please enter a valid email address
</div> </div>
<div style="color:#7c0e0e" *ngIf="mail_exist == true">
Email already exist
</div>
</ng-container> </ng-container>
<label for="subject">Password:</label> <label for="subject">Password:</label>
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'"> <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-select> -->
<nb-card-footer> <nb-card-footer>
<button type="button" class="cancel" nbButton status="danger" (click)="cancel()">Cancel</button> <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> </nb-card-footer>
</form> </form>

View File

@ -8,10 +8,11 @@ import { NbWindowService ,NbWindowRef, NB_WINDOW_CONTEXT } from '@nebular/theme'
styleUrls: ['./driver-form.component.scss'] styleUrls: ['./driver-form.component.scss']
}) })
export class DriverFormComponent implements OnInit { export class DriverFormComponent implements OnInit {
driver :any;
mail_exist :any;
userForm: FormGroup | any; formData:any =[] userForm: FormGroup | any; formData:any =[]
constructor(@Inject(NB_WINDOW_CONTEXT) public data: any,public _api:PageapiService,private windowService: NbWindowService, private windowRef: NbWindowRef) { constructor(@Inject(NB_WINDOW_CONTEXT) public data: any,public _api:PageapiService,private windowService: NbWindowService, private windowRef: NbWindowRef) {
this.getuserlistApi()
console.log(this.data) 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);
}
})
}
} }

View File

@ -140,9 +140,10 @@
<label for="subject" style=" font-weight: 600;width: 30%;">Qty:</label> <label for="subject" style=" font-weight: 600;width: 30%;">Qty:</label>
</div> </div>
</div> </div>
<div class="col-6 col-md-3"></div>
<div class="col-6 col-md-4"> <div class="col-6 col-md-4">
<div> <div *ngIf="( fieldTitle == 'Edit Order' && setData.status == 'ordered') || dropdown_data == 'ordered'">
<label for="subject" style=" font-weight: 600;"> </label> <label for="subject" style="font-weight: 600; text-align: center; display: block;">Add or Remove Products </label>
</div> </div>
</div> </div>
<nb-action icon="plus-circle-outline" class="custom-action-icon" [nbTooltip]="'Add'" (click)="addInputFieldGroup()" *ngIf="inputFieldGroups.length == 0"></nb-action> <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="row show-grid" *ngIf="product.length>0" >
<div class="col-6 col-md-3"> <div class="col-6 col-md-3">
<div > <div >
<nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false"> <nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false">
@ -187,10 +189,10 @@
<input nbInput *ngIf="fieldTitle != 'View Order' && fieldGroup.id == 6" style=" width: 100%;" [(ngModel)]="fieldGroup.productSpec" placeholder="eg:- N2:CO2:O2 - 50:30:20" type="text"> <input nbInput *ngIf="fieldTitle != 'View Order' && fieldGroup.id == 6" style=" width: 100%;" [(ngModel)]="fieldGroup.productSpec" placeholder="eg:- N2:CO2:O2 - 50:30:20" type="text">
</div> </div>
</div> </div>
<div class="col-6 col-md-3"> <div class="col-6 col-md-3">
<div > <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="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> <nb-action icon="minus-circle-outline" [nbTooltip]="'Remove'" (click)="removeInputFieldGroup(i)"></nb-action>

View File

@ -57,6 +57,7 @@ fieldTitle:any ='New Order'
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[]; selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
invoice = new Invoice(); invoice = new Invoice();
hiddenBtn= false; hiddenBtn= false;
dropdown_data: any;
delArr:any=[] delArr:any=[]
selectedProductId: number | undefined = null; selectedProductId: number | undefined = null;
addFormBtn: any; addFormBtn: any;
@ -821,6 +822,7 @@ onSelectChange(newValue: string) {
// Handle the selected value change here // Handle the selected value change here
this.selectDriver = [] this.selectDriver = []
console.log(newValue); console.log(newValue);
this.dropdown_data = newValue;
if(newValue == 'Out For Delivery'){ if(newValue == 'Out For Delivery'){
this.hiddenBtn = true; this.hiddenBtn = true;
} }

View File

@ -9,8 +9,8 @@
// The list of which env maps to which file can be found in `.angular-cli.json`. // The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = { export const environment = {
apiEndpoint:'https://dev.venbait.in/vnms/api/', // apiEndpoint:'https://dev.venbait.in/vnms/api/',
// apiEndpoint:'http://localhost:8081/api/', apiEndpoint:'http://localhost:8081/api/',
mailUrl:'', mailUrl:'',
production: false, production: false,
}; };