Merge branch 'master' of bitbucket.org:venbainformationtechnology/vnms_admin_fe

This commit is contained in:
Surendiran 2023-09-05 18:21:18 +05:30
commit 60d5e319f6
8 changed files with 51 additions and 16 deletions

View File

@ -14,7 +14,7 @@
</button>
<button nbTooltip="Edit" nbTooltipPlacement="top" *ngIf=" fieldTitle != 'Edit Order'" style=" margin-left: 2rem;" (click)="edit()" nbButton status="primary" hero>
<button nbTooltip="Edit" nbTooltipPlacement="top" *ngIf=" fieldTitle != 'Edit Order' && this.selectStatus != 'Delivered'" style=" margin-left: 2rem;" (click)="edit()" nbButton status="primary" hero>
<nb-icon icon="edit-outline"></nb-icon>
</button>
@ -164,7 +164,7 @@
<nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" >
<!-- <nb-option value="">Select Drivers</nb-option> -->
<!-- (click)="onProductSelect(user.id,user.productName)" -->
<nb-option *ngFor="let user of product; index as i; first as isFirst " [value]="user.id
<nb-option *ngFor="let user of product; index as i; first as isFirst" [value]="user.id
">{{user.productName }}({{user.skuId }} )</nb-option>

View File

@ -58,7 +58,7 @@ fieldTitle:any =' New Order'
invoice = new Invoice();
hiddenBtn= false;
delArr:any=[]
selectedProductId: number | null = null;
selectedProductId: number | undefined = null;
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) => {
@ -148,7 +148,7 @@ fieldTitle:any =' New Order'
localStorage.setItem('driverId',this.setData.driverId)
this.selectCustomer = this.setData['OrderDetails.CusDetails.cusName']
this.invoice.customerName = this.selectCustomer
this.invoice.address = this.setData['OrderDetails.CusDetails.address_1']
this.invoice.address = ""+this.setData['OrderDetails.CusDetails.address_1']+","+this.setData['OrderDetails.CusDetails.city']+"-"+this.setData['OrderDetails.CusDetails.pincode']+""
this.invoice.email = this.setData['OrderDetails.CusDetails.email']
this.invoice.contactNo = this.setData['OrderDetails.CusDetails.phoneNo']
@ -315,15 +315,25 @@ console.log(product)
}
}
onProductSelect(event: any,prod:any) {
if(prod != 'Mixed Gas')
{
this.selectedProductId = event;
this.product = this.product.filter((item) => item.id !== event);
// onProductSelect(event: any,prod:any) {
// if(prod != 'Mixed Gas')
// {
// // this.selectedProductId = event;
// this.product = this.product.filter((item) => item.id !== event);
// }
// }
onProductSelect(selectedProductId: number) {
// Find the selected product index
const selectedIndex = this.product.findIndex(product => product.id === selectedProductId);
if (selectedIndex !== -1) {
// Remove the selected product from the array
this.product.splice(selectedIndex, 1);
}
}
saveNew(){
let data = { 'id' : this.delArr}
this._api.delOrder(data).subscribe(res => { console.log( "success");

View File

@ -67,6 +67,7 @@ this.orderId = orderId
back(){
// let data = { 'date' : localStorage.getItem('dDate') , 'id' : localStorage.getItem('dId') }
this.router.navigate(['/pages/summary'])
}
save(){

View File

@ -26,7 +26,8 @@
<div class="row show-grid">
<div class="col-md-12">
<div>
<input nbInput placeholder="Pick Date" [nbDatepicker]="dateTimePicker">
<!-- [(ngModel)]="dDate" -->
<input nbInput placeholder="Pick Date" [nbDatepicker]="dateTimePicker" >
<nb-datepicker #dateTimePicker (dateChange)="onStartDateChanged($event)" ></nb-datepicker>
<!-- <input nbInput class="fx-date-range" type="text"
ngxDaterangepickerMd
@ -43,10 +44,10 @@
autocomplete="off"
[(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
<nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<nb-select selected="" style="width: 100% !important;margin-left: 2rem;" >
<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
<!-- [(ngModel)]="dId" -->
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " (click)="val(user)" [value]="user.id
">{{user.userName }}</nb-option>

View File

@ -9,6 +9,8 @@ import * as html2pdf from 'html2pdf.js'
styleUrls: ['./summary-list.component.scss']
})
export class SummaryListComponent implements OnInit {
dDate: string | null = this.reduceDate(localStorage.getItem('dDate'));
dId: string | null = localStorage.getItem('dId');
ranges: any = {
'Today': [moment(), moment()],
// 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
@ -21,7 +23,13 @@ export class SummaryListComponent implements OnInit {
// ]
};selectDate:any =[];driverId:any =[];DateDisplay:any =[];driverName:any =[];
selectedDateRange:any =[];drivers:any =[];summaryaData:any=[];driverval:any=[];returnSummary:any =[];
constructor(public _api:PageapiService, private router:Router) { }
constructor(public _api:PageapiService, private router:Router) {
if(localStorage.getItem('dDate'))
{
this.dDate = this.reduceDate(localStorage.getItem('dDate'));
this.dId = localStorage.getItem('dId');
}
}
ngOnInit(): void {
this.selectedDateRange =[];
@ -30,6 +38,19 @@ export class SummaryListComponent implements OnInit {
this.getDriverlistApi()
}
reduceDate(date){
// Create a Date object from the input date string
const inputDate = new Date(date);
// Subtract one day (24 hours) from the input date
const newDate = new Date(inputDate.getTime() - 24 * 60 * 60 * 1000);
// Format the new date as a string
const formattedDate = newDate.toString();
return formattedDate;
}
back(){
@ -156,7 +177,8 @@ console.log(result)
// Convert the updated date to a UTC string
const updatedUtcDate = utcDate.toISOString();
console.log(updatedUtcDate)
localStorage.setItem('dDate' , updatedUtcDate);
localStorage.setItem('dId' , this.driverId);
let param ={date:new Date( updatedUtcDate),id:this.driverId}
this._api.getDriverSummaryAdminList(param).subscribe(res => {
console.log(res)

View File

@ -5,5 +5,6 @@
*/
export const environment = {
apiEndpoint:'https://dev.venbait.in/vnms/api/',
mailUrl:'',
production: true,
};

Binary file not shown.

BIN
vnms_admin_fe-04-09-23.zip Normal file

Binary file not shown.