Compare commits

..

No commits in common. "dc9919bf26e03e5b97a5c401dfcaee2284e68fce" and "25f812d60a81e526e413cf28dab55eea7815dc4b" have entirely different histories.

21 changed files with 271 additions and 729 deletions

Binary file not shown.

View File

@ -24,12 +24,12 @@
pack="eva" pack="eva"
[attr.aria-label]="showPassword ? 'hide password' : 'show password'"> [attr.aria-label]="showPassword ? 'hide password' : 'show password'">
</nb-icon> </nb-icon>
<!-- <ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div style="color:red" *ngIf="loginForm.get('password').hasError('required') && loginForm.get('password').touched">Password is required.</div> <div style="color:red" *ngIf="loginForm.get('password').hasError('required') && loginForm.get('password').touched">Password is required.</div>
<div style="color:#7c0e0e" *ngIf="!loginForm.get('password')?.errors?.required && (loginForm.get('password')?.errors?.pattern)"> <div style="color:#7c0e0e" *ngIf="!loginForm.get('password')?.errors?.required && (loginForm.get('password')?.errors?.pattern)">
Password length must be greater than or equal to 8, and the password must contain one or more uppercase, lowercase, numeric, and special characters. Password length must be greater than or equal to 8, and the password must contain one or more uppercase, lowercase, numeric, and special characters.
</div> </div>
</ng-container> --> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -37,7 +37,7 @@
<a class="forgot-password caption-2" routerLink="../request-password" (click)="openForgot()">Forgot Password?</a> <a class="forgot-password caption-2" routerLink="../request-password" (click)="openForgot()">Forgot Password?</a>
</span> </span>
</div> </div>
<button type="submit" style=" width: 95%;" nbButton fullWidth status="success" size="large">Sign in</button> <button type="submit" style=" width: 95%;" [disabled]="!loginForm.valid" nbButton fullWidth status="success" size="large">Sign in</button>
</form> </form>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card>

View File

@ -3,101 +3,104 @@
<nb-card-body> <nb-card-body>
<form [formGroup]="userForm" (ngSubmit)="onSubmit()"> <form [formGroup]="userForm" (ngSubmit)="onSubmit()">
<div class="row show-grid"> <div class="row show-grid">
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">Name:</label> <label for="subject">Name:</label>
<input formControlName="userName" nbInput id="userName" [status]="userForm.get('userName').invalid && userForm.get('userName').touched? 'danger' : 'basic'" type="text"> <input formControlName="userName" nbInput id="userName" [status]="userForm.get('userName').invalid && userForm.get('userName').touched? 'danger' : 'basic'" type="text">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('userName').hasError('required') && userForm.get('userName').touched">Name is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('userName').hasError('required') && userForm.get('userName').touched">Name is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<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'" >
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *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 class="error-message" *ngIf="!userForm.get('email')?.errors?.required && userForm.get('email')?.errors?.pattern">Please enter a valid email address</div> <div style="color:#7c0e0e" *ngIf="!userForm.get('email')?.errors?.required && (userForm.get('email')?.errors?.pattern)">
Please enter a valid email address
</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field > <nb-form-field >
<label for="subject">Password:</label> <label for="subject">Password:</label>
<div *ngIf="action == 'Edit'"> <input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
<div *ngIf="!showPasswordField">
<a href="javascript:void(0)" (click)="togglePasswordField()">Change Password</a>
</div>
</div>
<div *ngIf="showPasswordField">
<input formControlName="password" nbInput id="password" autocomplete="off" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched ? 'danger' : 'basic'">
<nb-icon *ngIf="action == 'Edit'" (click)="togglePasswordField()" icon="close-outline" style="position: absolute; top: 8px; right: 10px;color: red;"></nb-icon>
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">Password is required</div>
<div class="error-message" *ngIf="!userForm.get('password')?.errors?.required && userForm.get('password')?.errors?.pattern">Invalid password format <nb-icon <div style="color:#7c0e0e;font-size:small" *ngIf="!userForm.get('password')?.errors?.required && (userForm.get('password')?.errors?.pattern)">
nbTooltip="Password length must be greater than or equal to 8 and password must contain one or more uppercase, lowercase, numeric, and special characters" Password length must be greater than or equal to 8
nbTooltipStatus="info"
icon="info-outline"
class="icon-error"
style="margin-left: 5px;margin-top: 10px;">
</nb-icon></div>
</ng-container>
</div> </div>
<!-- <div style="color:#7c0e0e" *ngIf="!userForm.get('password')?.errors?.required">
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
</div> -->
<div style="color:#7c0e0e" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">
Password is required
</div>
</ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
</div> </div>
<div class="row show-grid"> <div class="row show-grid">
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">Mobile No:</label> <label for="subject">Mobile No:</label>
<input formControlName="mobileNo" nbInput id="mobileNo" type="text" [status]="userForm.get('mobileNo').invalid && userForm.get('mobileNo').touched? 'danger' : 'basic'"> <input formControlName="mobileNo" nbInput id="mobileNo" type="text" [status]="userForm.get('mobileNo').invalid && userForm.get('mobileNo').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('mobileNo').hasError('required') && userForm.get('mobileNo').touched">Mobile No is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('mobileNo').hasError('required') && userForm.get('mobileNo').touched">Mobile No is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">Address</label> <label for="subject">Address</label>
<input formControlName="address_1" nbInput id="address_1" type="text" [status]="userForm.get('address_1').invalid && userForm.get('address_1').touched? 'danger' : 'basic'"> <input formControlName="address_1" nbInput id="address_1" type="text" [status]="userForm.get('address_1').invalid && userForm.get('address_1').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('address_1').hasError('required') && userForm.get('address_1').touched">Address is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('address_1').hasError('required') && userForm.get('address_1').touched">Address is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-4 col-lg-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">State:</label> <label for="subject">State:</label>
<input formControlName="state" nbInput id="state" type="text" [status]="userForm.get('state').invalid && userForm.get('state').touched? 'danger' : 'basic'"> <input formControlName="state" nbInput id="state" type="text" [status]="userForm.get('state').invalid && userForm.get('state').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('state').hasError('required') && userForm.get('state').touched">State is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('state').hasError('required') && userForm.get('state').touched">State is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
</div> </div>
<div class="row show-grid" > <div class="row show-grid" >
<div class="col-md-3 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">City:</label> <label for="subject">City:</label>
<input formControlName="city" nbInput id="city" type="text" [status]="userForm.get('city').invalid && userForm.get('city').touched? 'danger' : 'basic'"> <input formControlName="city" nbInput id="city" type="text" [status]="userForm.get('city').invalid && userForm.get('city').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('city').hasError('required') && userForm.get('city').touched">City is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('city').hasError('required') && userForm.get('city').touched">City is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-3 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">Pincode:</label> <label for="subject">Pincode:</label>
<input formControlName="pincode" nbInput id="pincode" type="text" [status]="userForm.get('pincode').invalid && userForm.get('pincode').touched? 'danger' : 'basic'"> <input formControlName="pincode" nbInput id="pincode" type="text" [status]="userForm.get('pincode').invalid && userForm.get('pincode').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('pincode').hasError('required') && userForm.get('pincode').touched">Pincode is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('pincode').hasError('required') && userForm.get('pincode').touched">Pincode is required.</div>
<div class="error-message" *ngIf="userForm.get('pincode').hasError('pattern') && userForm.get('pincode').touched">Pincode must be a 6-digit number.</div> <div style="color: #7c0e0e" *ngIf="userForm.get('pincode').hasError('pattern') && userForm.get('pincode').touched">Pincode must be a 6-digit number.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> </div>
<div class="col-md-3 col-sm-12"> <div class="col-md-4 col-sm-12">
<nb-form-field> <nb-form-field>
<label for="subject">Customer Type:</label> <br /> <label for="subject">Customer Type:</label> <br />
<nb-select selected="Medical" formControlName="cusType" style="width: 100% !important;" [status]="userForm.get('cusType').invalid && userForm.get('cusType').touched? 'danger' : 'basic'"> <nb-select selected="Medical" formControlName="cusType" style="width: 100% !important;" [status]="userForm.get('cusType').invalid && userForm.get('cusType').touched? 'danger' : 'basic'">
@ -105,25 +108,21 @@
<nb-option value="Industrial">Industrial</nb-option> <nb-option value="Industrial">Industrial</nb-option>
</nb-select> </nb-select>
<ng-container nbInputErrorMessage> <ng-container nbInputErrorMessage>
<div class="error-message" *ngIf="userForm.get('cusType').hasError('required') && userForm.get('cusType').touched">Customer Type is required.</div> <div style="color:#7c0e0e" *ngIf="userForm.get('cusType').hasError('required') && userForm.get('cusType').touched">Customer Type is required.</div>
</ng-container> </ng-container>
</nb-form-field> </nb-form-field>
</div> <!-- <nb-form-field>
<div class="col-md-3 col-sm-12">
<nb-form-field> </nb-form-field> -->
<label for="subject">GST No:</label>
<input formControlName="gst" nbInput id="gst" type="text">
</nb-form-field>
</div> </div>
</div> </div>
<nb-card-footer> <nb-card-footer>
<div class="row">
<div class="col-md-12" style="text-align: end;">
<button class="cancel" nbButton status="danger" type="button" (click)="cancel()">Cancel</button> <button class="cancel" nbButton status="danger" type="button" (click)="cancel()">Cancel</button>
<button nbButton status="success" [disabled]="!userForm.valid" type="submit">Submit</button> <button nbButton status="success" [disabled]="!userForm.valid" type="submit">Submit</button>
</div>
</div>
</nb-card-footer> </nb-card-footer>
</form> </form>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card>

View File

@ -9,33 +9,6 @@
margin-right: 1rem; margin-right: 1rem;
} }
} }
.error-message {
color: #7c0e0e;
font-size: 10px;
word-wrap: break-word;
max-width: 250px; /* Adjust this value as needed */
}
nb-icon {
cursor: pointer;
}
.icon-error {
color: red !important;
}
@media (max-width: 767px) {
.show-grid .col-sm-12 {
padding: 0 15px;
}
}
@media (min-width: 768px) {
.show-grid .col-md-4, .show-grid .col-md-3 {
padding: 0 15px;
}
}
.custom-dialog-class { .custom-dialog-class {
width: 50%; /* Set the desired width here */ width: 50%; /* Set the desired width here */
height: 300px; /* Set the desired height here */ height: 300px; /* Set the desired height here */
@ -43,17 +16,4 @@ nb-icon {
.show-grid{ .show-grid{
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.error-message-container {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.error-message {
color: #7c0e0e;
}
.error-message.small {
font-size: 12px;
}

View File

@ -12,8 +12,6 @@ export class CustomerFormComponent implements OnInit {
data:any =[]; data:any =[];
userForm: FormGroup | any; formData:any =[] userForm: FormGroup | any; formData:any =[]
heading:any =[]; heading:any =[];
action: any;
showPasswordField: boolean = false;
constructor(private dialogRef: NbDialogRef<CustomerFormComponent> ,public _api:PageapiService,private dialogService: NbDialogService) { constructor(private dialogRef: NbDialogRef<CustomerFormComponent> ,public _api:PageapiService,private dialogService: NbDialogService) {
@ -22,12 +20,6 @@ export class CustomerFormComponent implements OnInit {
ngOnInit() { ngOnInit() {
console.log('dialogRef', this.dialogRef.componentRef.instance); console.log('dialogRef', this.dialogRef.componentRef.instance);
let details:any = this.dialogRef.componentRef.instance let details:any = this.dialogRef.componentRef.instance
console.log('details',details)
this.action = details.action
if(this.action == 'Add'){
this.showPasswordField = !this.showPasswordField;
}
this.heading = details.title this.heading = details.title
@ -50,7 +42,6 @@ export class CustomerFormComponent implements OnInit {
password: new FormControl('', [Validators.required,Validators.pattern( password: new FormControl('', [Validators.required,Validators.pattern(
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$' '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$'
)]), )]),
gst: new FormControl(''),
address_1: new FormControl('', [Validators.required]), address_1: new FormControl('', [Validators.required]),
state: new FormControl('', [Validators.required]), state: new FormControl('', [Validators.required]),
city: new FormControl('', [Validators.required]), city: new FormControl('', [Validators.required]),
@ -72,36 +63,6 @@ export class CustomerFormComponent implements OnInit {
this.userForm.controls['password'].updateValueAndValidity(); this.userForm.controls['password'].updateValueAndValidity();
} }
this.userForm.patchValue(this.data) this.userForm.patchValue(this.data)
// Add value change listener for password field
this.userForm.get('password').valueChanges.subscribe(value => {
const passwordControl = this.userForm.get('password');
if (value) {
passwordControl.setValidators([
Validators.required,
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$')
]);
} else {
passwordControl.clearValidators();
}
passwordControl.updateValueAndValidity({ onlySelf: true, emitEvent: false });
});
}
togglePasswordField() {
this.showPasswordField = !this.showPasswordField;
if (this.showPasswordField) {
this.userForm.get('password').setValidators([
Validators.required,
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$')
]);
} else {
this.userForm.get('password').clearValidators();
this.userForm.get('password').reset();
}
this.userForm.get('password').updateValueAndValidity();
} }
cancel(){ cancel(){
@ -128,7 +89,6 @@ export class CustomerFormComponent implements OnInit {
city : tmp.city, city : tmp.city,
pincode:tmp.pincode, pincode:tmp.pincode,
cusType:tmp.cusType, cusType:tmp.cusType,
gst:tmp.gst,
} }
@ -146,10 +106,7 @@ export class CustomerFormComponent implements OnInit {
this.formData.append('userName',tmp.userName) this.formData.append('userName',tmp.userName)
this.formData.append('email', tmp.email); this.formData.append('email', tmp.email);
// if((tmp.password != "")){ if((tmp.password != "")){
// this.formData.append('password', tmp.password);
// }
if (tmp.password) {
this.formData.append('password', tmp.password); this.formData.append('password', tmp.password);
} }

View File

@ -86,23 +86,12 @@
[width]="4"> [width]="4">
</ng-data-table-column> </ng-data-table-column>
<ng-data-table-column
[field]="'gst'"
[sortable]="false"
[title]="'GST No'"
[filterable]="false"
[width]="5">
</ng-data-table-column>
<ng-data-table-column <ng-data-table-column
[field]="'isActive'" [field]="'isActive'"
[sortable]="false" [sortable]="false"
[title]="'Status'" [title]="'Status'"
[filterable]="false" [filterable]="false"
[width]="5"> [width]="4">
<ng-template #ngDataTableCell let-row="row"> <ng-template #ngDataTableCell let-row="row">
<td > <td >
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
@ -125,10 +114,6 @@
</td> </td>
</ng-template> </ng-template>
</ng-data-table-column> </ng-data-table-column>
<ng-data-table-column <ng-data-table-column
[field]="'role'" [field]="'role'"
[sortable]="false" [sortable]="false"
@ -137,6 +122,13 @@
[width]="3"> [width]="3">
<ng-template #ngDataTableCell let-row="row"> <ng-template #ngDataTableCell let-row="row">
<td > <td >
<div class="align-center" style="display: flex; align-items: center;"> <div class="align-center" style="display: flex; align-items: center;">

View File

@ -81,7 +81,6 @@ export class CustomerComponent {
}, },
}; };
searchTerm:any=[];filteredItems:any=[]; searchTerm:any=[];filteredItems:any=[];
@ -276,7 +275,6 @@ export class CustomerComponent {
customer.forEach((element:any, index) => { customer.forEach((element:any, index) => {
element.index = index +1 element.index = index +1
element.type =element['CusDetails.cusType'] element.type =element['CusDetails.cusType']
element.gst =element['CusDetails.gst']
}); });
this.customer = customer this.customer = customer

View File

@ -43,45 +43,14 @@
autocomplete="off" autocomplete="off"
[(ngModel)]="selectedDateRange" [(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> --> name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
<nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<nb-select [custom]="true" placeholder="Select Drivers" [autoClose]="false" style="width: 100% !important;margin-left: 2rem;">
<!-- Search Input -->
<nb-option>
<input
nbInput
placeholder="Search Driver..."
[(ngModel)]="searchQuery"
(ngModelChange)="filterDrivers()"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredDrivers; index as i"
[value]="user.id"
(click)="val(user)"
>
{{ user.userName }}
</nb-option>
</nb-select>
<!-- <nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<nb-option value="">Select Drivers</nb-option> <nb-option value="">Select Drivers</nb-option>
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id <nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id
">{{user.userName }}</nb-option> ">{{user.userName }}</nb-option>
</nb-select> --> </nb-select>
<button (click)="generate()" nbButton status="primary" style="margin-left: 2rem;" hero> <button (click)="generate()" nbButton status="primary" style="margin-left: 2rem;" hero>
generate generate
</button> </button>

View File

@ -20,21 +20,8 @@ export class DriverySheetComponent implements OnInit {
// moment().subtract(1, 'month').endOf('month') // moment().subtract(1, 'month').endOf('month')
// ] // ]
}; };productDeatils:any =[]; DateDisplay:any =[];driverName:any =[]; selectDate:any =[]; driverId:any =[];
productDeatils:any =[]; selectedDateRange:any =[];drivers:any =[];summaryaData:any=[];driverval:any=[];returnSummary:any =[];
DateDisplay:any =[];
driverName:any =[];
selectDate:any =[];
driverId:any =[];
selectedDateRange:any =[];
drivers:any =[];
filteredDrivers: any[] = []; // Search query
searchQuery: string = '';
summaryaData:any=[];
driverval:any=[];
returnSummary:any =[];
constructor(public _api:PageapiService, private router:Router) { } constructor(public _api:PageapiService, private router:Router) { }
ngOnInit(): void { ngOnInit(): void {
@ -80,18 +67,6 @@ export class DriverySheetComponent implements OnInit {
return acc; return acc;
}, []); }, []);
} }
// Filter customers based on search input
filterDrivers() {
if (this.searchQuery.trim() === '') {
this.filteredDrivers = [...this.drivers];
} else {
this.filteredDrivers = this.drivers.filter(user =>
user.userName?.toLowerCase().includes(this.searchQuery.toLowerCase())
);
}
}
getDriverlistApi(){ getDriverlistApi(){
// console.log(this.selectedDateRange) // console.log(this.selectedDateRange)
let param ={} let param ={}
@ -112,7 +87,6 @@ export class DriverySheetComponent implements OnInit {
this.drivers = driver this.drivers = driver
this.filteredDrivers = [...this.drivers];
// console.log(data) // console.log(data)
} }

View File

@ -31,41 +31,15 @@
<div> <div>
<label for="exampleInputEmail1" class="label">Customer</label> <br /> <label for="exampleInputEmail1" class="label">Customer</label> <br />
<span *ngIf="fieldTitle == 'View Order'">{{selectCustomer}}</span> <span *ngIf="fieldTitle == 'View Order'">{{selectCustomer}}</span>
<!-- {{filteredCustomers | json}} --> <nb-select selected="" [(ngModel)]="selectCustomer" *ngIf="fieldTitle != 'View Order'" [disabled]="fieldTitle =='Edit Order' ">
<nb-select
[(selected)]="selectCustomer"
[(ngModel)]="selectCustomer"
*ngIf="fieldTitle != 'View Order'"
[disabled]="fieldTitle == 'Edit Order'"
[custom]="true" placeholder="Select Customer" [autoClose]="false">
<!-- Search Input --> <nb-option value="" hidden>Select Customer</nb-option>
<nb-option>
<input <nb-option *ngFor="let user of customer; index as i; first as isFirst " (click)="checkType(user)" [value]="user['CusDetails.cusName']
nbInput ">{{user['CusDetails.cusName']
placeholder="Search Customer..." }}</nb-option>
[(ngModel)]="searchQuery"
(ngModelChange)="filterCustomers()"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredCustomers; index as i"
[value]="user['CusDetails.cusName']"
(click)="checkType(user)"
>
{{ user['CusDetails.cusName'] }}
</nb-option>
</nb-select> </nb-select>
<hr> <hr>
<div style="font-size: larger;margin-top: 1rem;margin-bottom: 1rem;"> Shipping Information</div> <div style="font-size: larger;margin-top: 1rem;margin-bottom: 1rem;"> Shipping Information</div>
<div class="row show-grid" *ngIf="product.length>0"> <div class="row show-grid" *ngIf="product.length>0">
@ -113,42 +87,14 @@
</nb-select> </nb-select>
<nb-select [custom]="true" [autoClose]="false" placeholder="Select Drivers" *ngIf="fieldTitle != 'View Order' && selectStatus == 'Out For Delivery'" [(ngModel)]="selectDriver" style="width: 57% !important;margin-right: 1rem;margin-top: 1rem;"> <nb-select (ngModelChange)="onSelectChange1($event)" selected="" placeholder="Select Drivers" *ngIf="fieldTitle != 'View Order' && selectStatus == 'Out For Delivery'" [(ngModel)]="selectDriver" style="width: 57% !important;margin-right: 1rem;margin-top: 1rem;" >
<!-- <nb-option value="">Select Drivers</nb-option> -->
<!-- Search Input -->
<nb-option>
<input
nbInput
placeholder="Search Driver..."
[(ngModel)]="searchDriverQuery"
(ngModelChange)="filterDrivers();onSelectChange1($event)"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredDrivers; index as i"
[value]="user.id"
(click)="val(user)"
>
{{ user.userName }}
</nb-option>
</nb-select>
<!-- <nb-select (ngModelChange)="onSelectChange1($event)" selected="" placeholder="Select Drivers" *ngIf="fieldTitle != 'View Order' && selectStatus == 'Out For Delivery'" [(ngModel)]="selectDriver" style="width: 57% !important;margin-right: 1rem;margin-top: 1rem;" >
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " [value]="user.id <nb-option *ngFor="let user of drivers; index as i; first as isFirst " [value]="user.id
">{{user.userName }}</nb-option> ">{{user.userName }}</nb-option>
</nb-select> --> </nb-select>
<input nbInput *ngIf="fieldTitle != 'View Order' && selectStatus == 'Cancelled'" [(ngModel)]="CancelReason" placeholder="Reason" style=" margin-right: 2%;margin-top: 1rem;" id="text"> <br /> <input nbInput *ngIf="fieldTitle != 'View Order' && selectStatus == 'Cancelled'" [(ngModel)]="CancelReason" placeholder="Reason" style=" margin-right: 2%;margin-top: 1rem;" id="text"> <br />
<button *ngIf="fieldTitle != 'View Order'" [disabled]="hiddenBtn" (click)="onSubmit2()" style="margin-top: 1rem;" type="submit" nbButton status="success" hero> <button *ngIf="fieldTitle != 'View Order'" [disabled]="hiddenBtn" (click)="onSubmit2()" style="margin-top: 1rem;" type="submit" nbButton status="success" hero>
Save Save
@ -215,46 +161,14 @@
<div class="col-6 col-md-3"> <div class="col-6 col-md-3">
<div > <div >
<nb-select [custom]="true" [autoClose]="false" placeholder="Select Product" <nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false">
[(ngModel)]="fieldGroup.id" <!-- <nb-option value="">Select Drivers</nb-option> -->
style="width: 100% !important; margin-right: 1rem;" <!-- (click)="onProductSelect(user.id,user.productName)" -->
[disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false" <nb-option *ngFor="let user of checkProductArray(); index as i; first as isFirst" [value]="user.id"
(ngModelChange)="onDropdownChange($event)"> >{{user.productName }}({{user.skuId }} )</nb-option>
<!-- Search Input -->
<nb-option>
<input
nbInput
placeholder="Search Product..."
[(ngModel)]="searchProductQuery"
(ngModelChange)="filterProduct()"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredProducts; index as i"
[value]="user.id"
(click)="val(user)">
{{user.productName}} ({{user.skuId}})
</nb-option>
</nb-select> </nb-select>
<!-- <nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false" (ngModelChange)="onDropdownChange($event)" >
<nb-option *ngFor="let user of checkProductArray(); index as i; first as isFirst" [value]="user.id">
{{user.productName}}({{user.skuId }} )
</nb-option>
</nb-select> -->
<!-- <label for="subject" style=" font-weight: 600;">Mixed Gas {{i+1}}:</label> --> <!-- <label for="subject" style=" font-weight: 600;">Mixed Gas {{i+1}}:</label> -->
</div> </div>
@ -265,20 +179,13 @@
<label for="subject" *ngIf="fieldTitle == 'View Order'" style=" font-weight: 600;">{{ fieldGroup.qty }}</label> <label for="subject" *ngIf="fieldTitle == 'View Order'" style=" font-weight: 600;">{{ fieldGroup.qty }}</label>
<input nbInput style="width: 50%;" *ngIf="fieldTitle != 'View Order'" [(ngModel)]="fieldGroup.qty" type="number"> <input nbInput style="width: 50%;" *ngIf="fieldTitle != 'View Order'" [(ngModel)]="fieldGroup.qty" type="number">
<!-- <input nbInput type="number" min="0" [(ngModel)]="item.qty"> --> <!-- <input nbInput type="number" min="0" [(ngModel)]="item.qty"> -->
</div>
<div>
<input nbInput style="width: 50%;" *ngIf="fieldTitle != 'View Order'" [(ngModel)]="fieldGroup.productName" type="string" hidden>
<!-- <input nbInput type="number" min="0" [(ngModel)]="item.qty"> -->
</div> </div>
</div> </div>
<div class="col-6 col-md-4"> <div class="col-6 col-md-4">
<div > <div >
<!-- <input nbInput type="text" [(ngModel)]="item.productSpec"> --> <!-- <input nbInput type="text" [(ngModel)]="item.productSpec"> -->
<label for="subject" *ngIf="fieldTitle == 'View Order'" style=" font-weight: 600;">({{ fieldGroup.productSpec }})</label> <label for="subject" *ngIf="fieldTitle == 'View Order'" style=" font-weight: 600;">({{ fieldGroup.productSpec }})</label>
<input nbInput *ngIf="fieldTitle != 'View Order' && fieldGroup.productName == 'Mixed Gas'" 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">
<!-- fieldGroup.productName == 'Mixed Gas' -->
</div> </div>
</div> </div>

View File

@ -31,15 +31,9 @@ class Invoice{
}) })
export class OrderFormComponent implements OnInit { export class OrderFormComponent implements OnInit {
customer:any =[]; customer:any =[];
// Filtered customer list for display product:any =[];ResultDisplay:any =[];
filteredCustomers: any[] = []; // Search query
searchQuery: string = '';
product:any =[];
ResultDisplay:any =[];
// Selected customer
selectCustomer: string | null = null;
mixedGas:any =[];productfull:any=[]; mixedGas:any =[];productfull:any=[];
// selectCustomer:any =""; selectCustomer:any ="";
items = [ items = [
{ label: 'Item 1', quantity: 0 }, { label: 'Item 1', quantity: 0 },
{ label: 'Item 2', quantity: 0 }, { label: 'Item 2', quantity: 0 },
@ -59,20 +53,14 @@ fieldTitle:any ='New Order'
position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT; position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT;
preventDuplicates = false; preventDuplicates = false;
status: NbComponentStatus = 'primary'; status: NbComponentStatus = 'primary';
inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' , productName : '' }]; inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' }];
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[]; selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
drivers:any =[];
filteredDrivers: any[] = []; // Search query
searchDriverQuery: string = '';
invoice = new Invoice(); invoice = new Invoice();
hiddenBtn= false; hiddenBtn= false;
dropdown_data: any = null; dropdown_data: any = null;
delArr:any=[] delArr:any=[]
selectedProductId: number | undefined = null; selectedProductId: number | undefined = null;
addFormBtn: any; addFormBtn: any;
selectedProductName: any;
filteredProducts: any[] = [];
searchProductQuery: string = '';
constructor(private dialogService: NbDialogService,private route :ActivatedRoute,private router: Router,public _api:PageapiService,private toastrService: NbToastrService,private service: SmartTableData ,private windowService: NbWindowService) { constructor(private dialogService: NbDialogService,private route :ActivatedRoute,private router: Router,public _api:PageapiService,private toastrService: NbToastrService,private service: SmartTableData ,private windowService: NbWindowService) {
this._api.orderDetails_observable$.subscribe((res) => { this._api.orderDetails_observable$.subscribe((res) => {
@ -155,19 +143,6 @@ fieldTitle:any ='New Order'
}
// Filter customers based on search input
filterCustomers() {
if (this.searchQuery.trim() === '') {
this.filteredCustomers = [...this.customer];
} else {
this.filteredCustomers = this.customer.filter(user =>
user['CusDetails.cusName']
?.toLowerCase()
.includes(this.searchQuery.toLowerCase())
);
}
} }
@ -186,7 +161,6 @@ fieldTitle:any ='New Order'
}); });
console.log(customer) console.log(customer)
this.customer = customer this.customer = customer
this.filteredCustomers = [...this.customer];
if( Object.keys(this.setData).length != 0){ if( Object.keys(this.setData).length != 0){
localStorage.setItem('cusId', this.setData['OrderDetails.CusDetails.id']) localStorage.setItem('cusId', this.setData['OrderDetails.CusDetails.id'])
localStorage.setItem('driverId',this.setData.driverId) localStorage.setItem('driverId',this.setData.driverId)
@ -259,8 +233,6 @@ fieldTitle:any ='New Order'
this.product = product this.product = product
this.filteredProducts = [...this.product];
console.log(this.product) console.log(this.product)
// this.productfull = product // this.productfull = product
if(this.setData != undefined){ if(this.setData != undefined){
@ -718,13 +690,11 @@ console.log(filteredItems)
this.inputFieldGroups =[]; this.inputFieldGroups =[];
// setTimeout(() => { // setTimeout(() => {
console.log('gwm');
console.log(result);
result.forEach(element => { result.forEach(element => {
this.inputFieldGroups.push({id:parseInt(element.productId ) , qty: element.qty, productSpec: element.productSpec , primaryId:element.id , this.inputFieldGroups.push({id:parseInt(element.productId ) , qty: element.qty, productSpec: element.productSpec , primaryId:element.id})
productName :element.productName });
}) })
@ -841,7 +811,6 @@ getDriverlistApi(){
this.drivers = driver this.drivers = driver
this.filteredDrivers = [...this.drivers];
if(this.setData != undefined){ if(this.setData != undefined){
if( Object.keys(this.setData).length != 0){ if( Object.keys(this.setData).length != 0){
this.selectDriver = parseInt(this.setData.driverId) this.selectDriver = parseInt(this.setData.driverId)
@ -851,17 +820,6 @@ getDriverlistApi(){
}) })
} }
// Filter customers based on search input
filterDrivers() {
if (this.searchDriverQuery.trim() === '') {
this.filteredDrivers = [...this.drivers];
} else {
this.filteredDrivers = this.drivers.filter(user =>
user.userName?.toLowerCase().includes(this.searchDriverQuery.toLowerCase())
);
}
}
onSelectChange(newValue: string) { onSelectChange(newValue: string) {
// Handle the selected value change here // Handle the selected value change here
@ -886,15 +844,6 @@ onSelectChange1(newValue: string) {
this.hiddenBtn = false; this.hiddenBtn = false;
} }
} }
notify(id,ordId,cusName){
let obj = { "id" : id , "ordId" : ordId , 'cusName' : cusName }
this._api.Notification(obj).subscribe(res => { console.log( "success");
})
}
onSubmit2(){ onSubmit2(){
@ -927,15 +876,10 @@ onSubmit2(){
this._api.CreateOrder (param).subscribe(res => { this._api.CreateOrder (param).subscribe(res => {
if (res.status == 200) { if (res.status == 200) {
console.log(res) console.log(res)
this.showToast('success', 'Updated Successfully', ''); this.showToast('success', 'Updated Successfully', '');
if(this.selectStatus == "Out For Delivery"){
this.notify(this.selectDriver , this.setData.orderId , this.selectCustomer );
}
this.selectStatus =[]; this.selectStatus =[];
}else{ }else{
this.showToast('warning', 'Somthing is Wrong...!', ''); this.showToast('warning', 'Somthing is Wrong...!', '');
@ -968,81 +912,27 @@ onSubmit2(){
} }
onDropdownChange(event: any) {
// Find the selected product in the array and get its name
const selectedProduct = this.checkProductArray().find(product => product.id === event);
if (selectedProduct) {
this.selectedProductName = selectedProduct.productName;
} else {
this.selectedProductName = ''; // If no product found, clear the selected product name
}
console.log(this.selectedProductName);
this.inputFieldGroups.forEach(element => {
if(element.id == event){
element.productName = this.selectedProductName;
}
});
}
// checkProductArray() {
// // console.log(this.inputFieldGroups)
// const hasNullId = this.inputFieldGroups.some((group) => group.id === null);
// // console.log(hasNullId)
// if (!hasNullId) {
// // There's an object with id = null in the inputFieldGroups array
// // console.log('There is an object with id = null');
// return this.product;
// } else {
// // There is no object with id = null in the inputFieldGroups array
// // Filter products based on the condition (productName !== 'Mixed Gas' in inputFieldGroups)
// const filteredProducts = this.product.filter((product) => {
// const isSelected = this.inputFieldGroups.some((group) => group.id === product.id );
// return product.productName === 'Mixed Gas' || !isSelected;
// });
// return filteredProducts;
// }
// }
checkProductArray() { checkProductArray() {
// console.log(this.inputFieldGroups)
const hasNullId = this.inputFieldGroups.some((group) => group.id === null); const hasNullId = this.inputFieldGroups.some((group) => group.id === null);
// console.log(hasNullId)
let filteredProducts;
if (!hasNullId) { if (!hasNullId) {
filteredProducts = [...this.product]; // There's an object with id = null in the inputFieldGroups array
// console.log('There is an object with id = null');
return this.product;
} else { } else {
filteredProducts = this.product.filter((product) => { // There is no object with id = null in the inputFieldGroups array
// Filter products based on the condition (productName !== 'Mixed Gas' in inputFieldGroups)
const filteredProducts = this.product.filter((product) => {
const isSelected = this.inputFieldGroups.some((group) => group.id === product.id); const isSelected = this.inputFieldGroups.some((group) => group.id === product.id);
return product.productName === 'Mixed Gas' || !isSelected; return product.productName === 'Mixed Gas' || !isSelected;
}); });
}
// Apply search filtering
if (this.searchProductQuery.trim() !== '') {
return filteredProducts.filter(product =>
product.productName?.toLowerCase().includes(this.searchProductQuery.toLowerCase()) ||
product.skuId?.toString().toLowerCase().includes(this.searchProductQuery.toLowerCase())
);
}
return filteredProducts; return filteredProducts;
} }
filterProduct() {
if (this.searchProductQuery.trim() === '') {
this.filteredProducts = this.checkProductArray();
} else {
this.filteredProducts = this.checkProductArray().filter(product =>
product.productName?.toLowerCase().includes(this.searchProductQuery.toLowerCase()) ||
product.skuId?.toString().toLowerCase().includes(this.searchProductQuery.toLowerCase())
);
}
}
}
addInputFieldGroup() { addInputFieldGroup() {
if(this.fieldTitle != 'New Order'){ if(this.fieldTitle != 'New Order'){
@ -1051,11 +941,9 @@ addInputFieldGroup() {
console.log(activeProductList) console.log(activeProductList)
this.product = activeProductList this.product = activeProductList
} }
this.searchProductQuery = ''
this.filteredProducts = this.product
// this.inputFieldGroups.push({id:null, qty: '1', productSpec: '' }); // this.inputFieldGroups.push({id:null, qty: '1', productSpec: '' });
// Add a new input field group to the array // Add a new input field group to the array
const newGroup = { id: null, qty: 1, productSpec: '', isNew: true , productName : '' }; const newGroup = { id: null, qty: 1, productSpec: '', isNew: true };
this.inputFieldGroups.push(newGroup); this.inputFieldGroups.push(newGroup);
console.log(this.inputFieldGroups) console.log(this.inputFieldGroups)
//this.childButtonEvent.emit( this.inputFieldGroups); //this.childButtonEvent.emit( this.inputFieldGroups);

View File

@ -2,14 +2,46 @@
<nb-card-header> <nb-card-header>
<div class="row show-grid"> <div class="row show-grid">
<div class="col-md-5"> <div class="col-md-2">
<div style="font-size: 20px;"> <nb-icon icon="shopping-bag-outline"></nb-icon> Order Management</div> <div> <nb-icon icon="shopping-bag-outline"></nb-icon> Order Management</div>
</div> </div>
<div class="col-md-3">
<div style=" text-align: end;">
<!-- <button (click)="Assign()" nbButton status="primary" hero>
Assign Driver
</button> -->
<input nbInput placeholder="Pick Date Range" [nbDatepicker]="formpicker" [(ngModel)]="dateRangeValue" #dateRangeInput>
<nb-rangepicker #formpicker (rangeChange)="manipulateDate($event)"[startDate]="defaultStartDate" [endDate]="defaultEndDate" ></nb-rangepicker>
<!-- <input nbInput class="fx-date-range" type="text"
ngxDaterangepickerMd
[locale]="{applyLabel: 'okay', format: 'MM/DD/YY'}"
[drops]="'down'"
[opens]="'right'"
[ranges]="ranges"
[showCustomRangeLabel]="true"
[alwaysShowCalendars]="true"
[keepCalendarOpeningWithRange]="true"
[showCancel]="true"
autocomplete="off"
[(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
<div class="col-md-7"> </div>
</div>
<div class="col-md-3">
<div style=" text-align: end;">
<!-- <button (click)="Assign()" nbButton status="primary" hero>
Assign Driver
</button> -->
<input [(ngModel)]="searchTerm" (keyup)="filterItems()" style="width: 100%;" nbInput id="mobileNo" type="text" placeholder="Search" >
</div>
</div>
<div class="col-md-4">
<div style=" text-align: end;"> <div style=" text-align: end;">
<button (click)="refresh()" nbTooltip="Refresh" nbTooltipPlacement="top" nbButton status="warning" hero> <button (click)="refresh()" nbTooltip="Refresh" nbTooltipPlacement="top" nbButton status="warning" hero>
<nb-icon icon="flip-outline"></nb-icon> <nb-icon icon="flip-outline"></nb-icon>
@ -24,17 +56,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row show-grid" style="margin-top: 1rem;">
<div class="col-md-6" style="text-align: start;">
<label style="margin-right: 10px;">Select Start & End Date </label>
<input nbInput placeholder="Pick Date Range" [nbDatepicker]="formpicker" [(ngModel)]="dateRangeValue" #dateRangeInput>
<nb-rangepicker #formpicker (rangeChange)="manipulateDate($event)"[startDate]="defaultStartDate" [endDate]="defaultEndDate" ></nb-rangepicker>
</div>
<div class="col-md-6" style="text-align: end;">
<input [(ngModel)]="searchTerm" (keyup)="filterItems()" style="width: 100%;" nbInput id="mobileNo" type="text" placeholder="Search" >
</div>
</div>
</nb-card-header> </nb-card-header>
<nb-card-body style="padding-top: 0px;"> <nb-card-body style="padding-top: 0px;">
@ -172,7 +193,7 @@
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span class="checkTxt" > <span class="checkTxt" >
{{row.item.createdAt | date :'dd/MM/yy hh:mm:ss'}} {{row.item.updatedAt | date :'dd/MM/yy hh:mm:ss'}}
</span> </span>
</div> </div>
@ -180,20 +201,24 @@
</ng-template> </ng-template>
</ng-data-table-column> </ng-data-table-column>
<ng-data-table-column <ng-data-table-column
[field]="'status'" [field]="'status'"
[title]="'Status'" [title]="'Status'"
[sortable]="false" [sortable]="false"
[width]="5"> [width]="5">
<ng-template #ngDataTableCell let-row="row"> <ng-template #ngDataTableCell let-row="row">
<td (click)="onViewConfirm(row.item)"> <td (click)="onViewConfirm(row.item)">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
@ -406,35 +431,6 @@
</ng-template> </ng-template>
</ng-data-table-column> </ng-data-table-column>
<ng-data-table-column
[field]="'productDetails'"
[sortable]="false"
[title]="'Products'"
[filterable]="false"
[width]="4">
<ng-template #ngDataTableCell let-row="row">
<td (click)="onViewConfirm(row.item)">
<div>
<ol>
<li *ngFor="let product of row.item.productDetails; let i = index">
<div *ngIf="i+1 != 1"> | </div>
<span> {{ i+1}}. Product Name: {{ product.productName }} - {{ product.qty }} </span>
<span *ngIf="product.qty > 1"> Nos </span><span *ngIf="product.qty == 1"> No </span>
<div *ngIf="product.productSpec !== null"> , Mixed Gas: {{ product.productSpec }}</div>
</li>
</ol>
</div>
</td>
</ng-template>
</ng-data-table-column>
<ng-data-table-column <ng-data-table-column
[field]="'status'" [field]="'status'"
[title]="'Status'" [title]="'Status'"

View File

@ -16,12 +16,12 @@ export const MENU_ITEMS: NbMenuItem[] = [
link: '/pages/order', link: '/pages/order',
}, },
{ {
title: 'Out For Delivery Sheet', title: 'Delivery Summary',
link: '/pages/delivery-sheet', link: '/pages/summary',
}, },
{ {
title: 'Delivered Summary', title: 'Delivery Sheet',
link: '/pages/summary', link: '/pages/delivery-sheet',
}, },
{ {
title: 'Return Sheet', title: 'Return Sheet',

View File

@ -44,43 +44,14 @@
[(ngModel)]="selectedDateRange" [(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> --> name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
<nb-select [custom]="true" placeholder="Select Drivers" [autoClose]="false" style="width: 100% !important;margin-left: 2rem;"> <nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<!-- Search Input -->
<nb-option>
<input
nbInput
placeholder="Search Driver..."
[(ngModel)]="searchQuery"
(ngModelChange)="filterDrivers()"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredDrivers; index as i"
[value]="user.id"
(click)="val(user)"
>
{{ user.userName }}
</nb-option>
</nb-select>
<!-- <nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<nb-option value="">Select Drivers</nb-option> <nb-option value="">Select Drivers</nb-option>
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id <nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id
">{{user.userName }}</nb-option> ">{{user.userName }}</nb-option>
</nb-select> --> </nb-select>
<button (click)="generate()" style="margin-left: 2rem;" nbButton status="primary" hero> <button (click)="generate()" style="margin-left: 2rem;" nbButton status="primary" hero>
generate generate
</button> </button>

View File

@ -23,11 +23,7 @@ export class ReturnSheetComponent implements OnInit {
// ] // ]
};productDeatils:any =[]; DateDisplay:any =[];driverName:any =[]; selectDate:any =[]; driverId:any =[]; };productDeatils:any =[]; DateDisplay:any =[];driverName:any =[]; selectDate:any =[]; driverId:any =[];
selectedDateRange:any =[]; selectedDateRange:any =[];drivers:any =[];summaryaData:any=[];driverval:any=[];returnSummary:any =[];
drivers:any =[];
filteredDrivers: any[] = []; // Search query
searchQuery: string = '';
summaryaData:any=[];driverval:any=[];returnSummary:any =[];
constructor(public _api:PageapiService, private router:Router) { } constructor(public _api:PageapiService, private router:Router) { }
ngOnInit(): void { ngOnInit(): void {
@ -73,19 +69,6 @@ export class ReturnSheetComponent implements OnInit {
return acc; return acc;
}, []); }, []);
} }
// Filter customers based on search input
filterDrivers() {
if (this.searchQuery.trim() === '') {
this.filteredDrivers = [...this.drivers];
} else {
this.filteredDrivers = this.drivers.filter(user =>
user.userName?.toLowerCase().includes(this.searchQuery.toLowerCase())
);
}
}
getDriverlistApi(){ getDriverlistApi(){
// console.log(this.selectedDateRange) // console.log(this.selectedDateRange)
let param ={} let param ={}
@ -106,7 +89,6 @@ export class ReturnSheetComponent implements OnInit {
this.drivers = driver this.drivers = driver
this.filteredDrivers = [...this.drivers];
// console.log(data) // console.log(data)
} }

View File

@ -44,42 +44,14 @@
autocomplete="off" autocomplete="off"
[(ngModel)]="selectedDateRange" [(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> --> name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
<nb-select [custom]="true" placeholder="Select Drivers" [autoClose]="false" style="width: 100% !important;margin-left: 2rem;"> <nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<!-- Search Input -->
<nb-option>
<input
nbInput
placeholder="Search Driver..."
[(ngModel)]="searchQuery"
(ngModelChange)="filterDrivers()"
(click)="$event.stopPropagation()"
(keydown)="$event.stopPropagation()"
(keydown.arrowdown)="$event.preventDefault()"
(keydown.arrowup)="$event.preventDefault()"
(keydown.enter)="$event.preventDefault()"
autocomplete="off"
style="width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px;"
/>
</nb-option>
<!-- Display Filtered Options -->
<nb-option
*ngFor="let user of filteredDrivers; index as i"
[value]="user.id"
(click)="val(user)"
>
{{ user.userName }}
</nb-option>
</nb-select>
<!-- <nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<nb-option value="">Select Drivers</nb-option> <nb-option value="">Select Drivers</nb-option>
<!-- [(ngModel)]="dId" -->
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id <nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id
">{{user.userName }}</nb-option> ">{{user.userName }}</nb-option>
</nb-select> --> </nb-select>
<button style=" margin-left: 2rem;" (click)="generate()" nbButton status="primary" hero> <button style=" margin-left: 2rem;" (click)="generate()" nbButton status="primary" hero>
generate generate

View File

@ -23,17 +23,8 @@ export class SummaryListComponent implements OnInit {
// moment().subtract(1, 'month').startOf('month'), // moment().subtract(1, 'month').startOf('month'),
// moment().subtract(1, 'month').endOf('month') // moment().subtract(1, 'month').endOf('month')
// ] // ]
};selectDate:any =[]; };selectDate:any =[];driverId:any =[];DateDisplay:any =[];driverName:any =[];
driverId:any =[]; selectedDateRange:any =[];drivers:any =[];summaryaData:any=[];driverval:any=[];returnSummary:any =[];
DateDisplay:any =[];
driverName:any =[];
selectedDateRange:any =[];
drivers:any =[];
filteredDrivers: any[] = []; // Search query
searchQuery: string = '';
summaryaData:any=[];
driverval:any=[];
returnSummary:any =[];
minimize = false; minimize = false;
maximize = false; maximize = false;
@ -101,18 +92,6 @@ const formattedDate = newDate.toString();
return acc; return acc;
}, []); }, []);
} }
// Filter customers based on search input
filterDrivers() {
if (this.searchQuery.trim() === '') {
this.filteredDrivers = [...this.drivers];
} else {
this.filteredDrivers = this.drivers.filter(user =>
user.userName?.toLowerCase().includes(this.searchQuery.toLowerCase())
);
}
}
getDriverlistApi(){ getDriverlistApi(){
// console.log(this.selectedDateRange) // console.log(this.selectedDateRange)
let param ={} let param ={}
@ -133,7 +112,6 @@ const formattedDate = newDate.toString();
this.drivers = driver this.drivers = driver
this.filteredDrivers = [...this.drivers];
// console.log(data) // console.log(data)
} }

View File

@ -9,8 +9,7 @@
// 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://api.vnms.in/api/', 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,

BIN
src/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 17 KiB