diff --git a/src/app/pages/order/order-form/order-form.component.html b/src/app/pages/order/order-form/order-form.component.html index 886f593..4c09ecd 100644 --- a/src/app/pages/order/order-form/order-form.component.html +++ b/src/app/pages/order/order-form/order-form.component.html @@ -14,7 +14,7 @@ - @@ -164,7 +164,7 @@ - {{user.productName }}({{user.skuId }} ) diff --git a/src/app/pages/order/order-form/order-form.component.ts b/src/app/pages/order/order-form/order-form.component.ts index 8b6ba5b..d54e606 100644 --- a/src/app/pages/order/order-form/order-form.component.ts +++ b/src/app/pages/order/order-form/order-form.component.ts @@ -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"); diff --git a/src/app/pages/summary-list/summary-details/summary-details.component.ts b/src/app/pages/summary-list/summary-details/summary-details.component.ts index 73fc3bc..60d7d07 100644 --- a/src/app/pages/summary-list/summary-details/summary-details.component.ts +++ b/src/app/pages/summary-list/summary-details/summary-details.component.ts @@ -67,6 +67,7 @@ this.orderId = orderId back(){ + // let data = { 'date' : localStorage.getItem('dDate') , 'id' : localStorage.getItem('dId') } this.router.navigate(['/pages/summary']) } save(){ diff --git a/src/app/pages/summary-list/summary-list.component.html b/src/app/pages/summary-list/summary-list.component.html index 2823333..f1f7c6a 100644 --- a/src/app/pages/summary-list/summary-list.component.html +++ b/src/app/pages/summary-list/summary-list.component.html @@ -26,7 +26,8 @@
- + + - + Select Drivers - - + {{user.userName }} diff --git a/src/app/pages/summary-list/summary-list.component.ts b/src/app/pages/summary-list/summary-list.component.ts index bea421a..a20876e 100644 --- a/src/app/pages/summary-list/summary-list.component.ts +++ b/src/app/pages/summary-list/summary-list.component.ts @@ -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) diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index e5f5642..0c99d29 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,5 +5,6 @@ */ export const environment = { apiEndpoint:'https://dev.venbait.in/vnms/api/', + mailUrl:'', production: true, }; diff --git a/vnms_admin_de-05-09-2023.zip b/vnms_admin_de-05-09-2023.zip new file mode 100644 index 0000000..b40acbd Binary files /dev/null and b/vnms_admin_de-05-09-2023.zip differ diff --git a/vnms_admin_fe-04-09-23.zip b/vnms_admin_fe-04-09-23.zip new file mode 100644 index 0000000..0d39522 Binary files /dev/null and b/vnms_admin_fe-04-09-23.zip differ