@aggdirect/coolmap 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +27 -0
- package/src/assets/mixin.scss +28 -0
- package/src/assets/palette.scss +24 -0
- package/src/assets/variable.scss +15 -0
- package/src/lib/component/add-route/add-route.component.html +140 -0
- package/src/lib/component/add-route/add-route.component.scss +235 -0
- package/src/lib/component/add-route/add-route.component.spec.ts +23 -0
- package/src/lib/component/add-route/add-route.component.ts +270 -0
- package/src/lib/component/job-code/job-code.component.html +93 -0
- package/src/lib/component/job-code/job-code.component.scss +427 -0
- package/src/lib/component/job-code/job-code.component.ts +94 -0
- package/src/lib/component/map/map.component.css +0 -0
- package/src/lib/component/map/map.component.html +5 -0
- package/src/lib/component/map/map.component.spec.ts +23 -0
- package/src/lib/component/map/map.component.ts +33 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +44 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +0 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +23 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +70 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +43 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +5 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +64 -0
- package/src/lib/component/nav/nav.component.html +19 -0
- package/src/lib/component/nav/nav.component.scss +65 -0
- package/src/lib/component/nav/nav.component.ts +38 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +56 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +167 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +42 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +66 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +226 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +234 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +7 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +10 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +15 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +30 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +172 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +19 -0
- package/src/lib/component/shared/dialog/dialog.component.html +7 -0
- package/src/lib/component/shared/dialog/dialog.component.scss +30 -0
- package/src/lib/component/shared/dialog/dialog.component.ts +18 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.html +27 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.scss +3 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +23 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.ts +54 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +8 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +12 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +23 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +15 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +5 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +32 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +23 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +12 -0
- package/src/lib/coolmap.component.ts +20 -0
- package/src/lib/coolmap.module.ts +92 -0
- package/src/public-api.ts +10 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { Component, ElementRef, OnInit, ViewChild, Output, EventEmitter, SimpleChanges, OnChanges, Input, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
import { debounceTime, distinctUntilChanged, fromEvent, map, Observable, startWith, Subject, takeUntil } from 'rxjs';
|
|
4
|
+
import {MatDialog} from '@angular/material/dialog';
|
|
5
|
+
import { CoolmapService, Route, UtilsService } from 'coolmap-services';
|
|
6
|
+
import { DialogComponent } from '../shared/dialog/dialog.component';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-add-route',
|
|
11
|
+
templateUrl: './add-route.component.html',
|
|
12
|
+
styleUrls: ['./add-route.component.scss']
|
|
13
|
+
})
|
|
14
|
+
export class AddRouteComponent implements OnInit, OnChanges, OnDestroy {
|
|
15
|
+
@ViewChild('filterPickup') filterPickup!: ElementRef;
|
|
16
|
+
@ViewChild('filterDelivery') filterDelivery!: ElementRef;
|
|
17
|
+
@Output() changeNav = new EventEmitter<string>();
|
|
18
|
+
@Output() updateRouteList = new EventEmitter<boolean>();
|
|
19
|
+
pickupOptions: any = [];
|
|
20
|
+
deliveryOptions: any = [];
|
|
21
|
+
requestParmsForRouteDetails = { pickup_lat_lng: '', delivery_lat_lng: '' }
|
|
22
|
+
customersList: any = [];
|
|
23
|
+
unitsList: any = [];
|
|
24
|
+
materialsList: any = [];
|
|
25
|
+
addRouteForm!: FormGroup;
|
|
26
|
+
@Input() routeData!: Route;
|
|
27
|
+
routeId: string | null | undefined;
|
|
28
|
+
preventSave: boolean = false;
|
|
29
|
+
preventInitialSave: boolean = false;
|
|
30
|
+
customersList$!: Observable<any>;
|
|
31
|
+
routeDetails!: { pickup_location: string | null | undefined; delivery_location: string | null | undefined; } | null;
|
|
32
|
+
private destroyer$ = new Subject<boolean>();
|
|
33
|
+
popupDetails: Route;
|
|
34
|
+
enablePopUp: boolean = false;
|
|
35
|
+
prevantPopupClose = false;
|
|
36
|
+
enableForm: boolean = false;
|
|
37
|
+
|
|
38
|
+
constructor(private coolMapService: CoolmapService, private utils: UtilsService, public dialog: MatDialog) {
|
|
39
|
+
this.fetchCustomersList();
|
|
40
|
+
this.fetchUnitsList();
|
|
41
|
+
this.fetchMaterialsList(); this.formInit();
|
|
42
|
+
this.utils.getrouteDetailsUtility.subscribe(res => {
|
|
43
|
+
if (res) {
|
|
44
|
+
if (res['event'] !== 'click' && !this.prevantPopupClose) { this.enablePopUp = res['event'] }
|
|
45
|
+
else if(this.enablePopUp && !this.prevantPopupClose) { this.prevantPopupClose = true; }
|
|
46
|
+
if (res['event'] !== 'click' && !res['event'] && this.prevantPopupClose) {
|
|
47
|
+
this.popupDetails = this.utils.getdictValue('route-detailsv2');
|
|
48
|
+
} else { this.popupDetails = res['route'] }
|
|
49
|
+
this.popupDetails['created_at'] = this.utils.getDateFormat(new Date(this.popupDetails['created_at']), '/');
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
filterCustomerList() {
|
|
54
|
+
this.customersList$ = this.addRouteForm.controls['customer_name'].valueChanges.pipe(
|
|
55
|
+
startWith(''),
|
|
56
|
+
map(value => this._filter(value || '')),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
private _filter(value: string): string[] {
|
|
60
|
+
const filterValue = value.toLowerCase();
|
|
61
|
+
return this.customersList.filter((option: any) => option['customer_name'].toLowerCase().includes(filterValue));
|
|
62
|
+
}
|
|
63
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
64
|
+
if (changes['routeData'] && !changes['routeData']['currentValue']) this.inIt(null);
|
|
65
|
+
}
|
|
66
|
+
openDialog(): void {
|
|
67
|
+
const dialogRef = this.dialog.open(DialogComponent, {
|
|
68
|
+
data: { body: 'Are you sure you want to delete this route?' },
|
|
69
|
+
});
|
|
70
|
+
dialogRef.afterClosed().subscribe(res => { if (res) { this.deleteRoute() } });
|
|
71
|
+
}
|
|
72
|
+
editEvent(){
|
|
73
|
+
this.prevantPopupClose = false;
|
|
74
|
+
this.enableForm = true; this.enablePopUp = false;
|
|
75
|
+
this.popupDetails['prevent'] = false;
|
|
76
|
+
this.utils.removeMapEntity.next(this.popupDetails);
|
|
77
|
+
this.inIt(this.popupDetails);
|
|
78
|
+
}
|
|
79
|
+
inIt(changes: Route) {
|
|
80
|
+
if (changes) {
|
|
81
|
+
if (!changes['prevent']) {
|
|
82
|
+
this.preventSave = false;
|
|
83
|
+
this.formControlValue();
|
|
84
|
+
this.patchFormValue(changes); this.checkAndFetchRouteInformation(true)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (!changes) { this.enableForm = true; this.preventSave = true; this.patchFormValue(); this.checkAndFetchRouteInformation() }
|
|
88
|
+
}
|
|
89
|
+
ngOnInit(): void {
|
|
90
|
+
this.formControlValue();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ngAfterViewInit() {
|
|
94
|
+
fromEvent(this.filterPickup.nativeElement, 'keyup').pipe(
|
|
95
|
+
distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
|
|
96
|
+
this.utils.fetchAutoCompleteLocations(this.filterPickup.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
97
|
+
this.pickupOptions = res.features;
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
fromEvent(this.filterDelivery.nativeElement, 'keyup').pipe(
|
|
102
|
+
distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
|
|
103
|
+
this.utils.fetchAutoCompleteLocations(this.filterDelivery.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
104
|
+
this.deliveryOptions = res.features;
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
formControlValue() {
|
|
110
|
+
this.addRouteForm.controls['pickup_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
111
|
+
if (this.addRouteForm.value.pickup_location && res !== this.addRouteForm.value.pickup_location) {
|
|
112
|
+
this.addRouteForm.patchValue({
|
|
113
|
+
pickup_lat_lng: '',
|
|
114
|
+
});
|
|
115
|
+
this.addRouteForm.controls['pickup_lat_lng'].markAsTouched();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
this.addRouteForm.controls['delivery_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
120
|
+
if (this.addRouteForm.value.delivery_location && res !== this.addRouteForm.value.delivery_location) {
|
|
121
|
+
this.addRouteForm.patchValue({
|
|
122
|
+
delivery_lat_lng: '',
|
|
123
|
+
});
|
|
124
|
+
this.addRouteForm.controls['delivery_lat_lng'].markAsTouched();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
formInit() {
|
|
130
|
+
this.addRouteForm = new FormGroup({
|
|
131
|
+
route_name: new FormControl('', [Validators.required]),
|
|
132
|
+
customer_name: new FormControl({value: '', disabled: true}, [Validators.required]),
|
|
133
|
+
materials_id: new FormControl('', [Validators.required]),
|
|
134
|
+
unit_id: new FormControl('', [Validators.required]),
|
|
135
|
+
path: new FormControl('', [Validators.required]),
|
|
136
|
+
pickup_location: new FormControl('', [Validators.required]),
|
|
137
|
+
pickup_lat_lng: new FormControl('', [Validators.required]),
|
|
138
|
+
delivery_location: new FormControl('', [Validators.required]),
|
|
139
|
+
delivery_lat_lng: new FormControl('', [Validators.required]),
|
|
140
|
+
estimated_distance: new FormControl('', [Validators.required]),
|
|
141
|
+
estimated_time: new FormControl('', [Validators.required]),
|
|
142
|
+
note: new FormControl('', [Validators.maxLength(2048)]),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
patchFormValue(data?: Route) {
|
|
147
|
+
this.addRouteForm.reset();
|
|
148
|
+
this.addRouteForm.patchValue(data!);
|
|
149
|
+
this.routeId = data?.route_id;
|
|
150
|
+
this.routeDetails = data ? { pickup_location: data.pickup_location, delivery_location: data.delivery_location } : null;
|
|
151
|
+
this.addRouteForm.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe(res => {
|
|
152
|
+
if (res) { if (this.preventInitialSave) this.preventInitialSave = false }
|
|
153
|
+
});
|
|
154
|
+
this.filterCustomerList();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
fetchCustomersList() {
|
|
158
|
+
this.utils.getData('coolmap/company/list/view').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
159
|
+
if (res) { this.customersList = res.data; this.filterCustomerList(); this.addRouteForm.controls['customer_name'].enable(); }
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async fetchUnitsList() {
|
|
164
|
+
await this.utils.getData('coolmap/unit/list/view').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
165
|
+
if (res) { this.unitsList = res.data }
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
fetchMaterialsList() {
|
|
170
|
+
this.utils.getData('coolmap/material/list/view').pipe(takeUntil(this.destroyer$)).subscribe(((res: any) => {
|
|
171
|
+
res.data.sort((a: any, b: any) => a.material.localeCompare(b.material))
|
|
172
|
+
this.materialsList = res.data
|
|
173
|
+
}))
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
selectedLongLat(type: string, event: any) {
|
|
177
|
+
if (type === 'pickup') {
|
|
178
|
+
this.addRouteForm.patchValue({
|
|
179
|
+
pickup_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
|
|
180
|
+
});
|
|
181
|
+
this.coolMapService.clearBoundWithCordinates();
|
|
182
|
+
} else if (type === 'delivery') {
|
|
183
|
+
this.addRouteForm.patchValue({
|
|
184
|
+
delivery_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
this.checkAndFetchRouteInformation();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
checkAndFetchRouteInformation(isinitial?: boolean) {
|
|
191
|
+
if (this.addRouteForm.value?.delivery_lat_lng?.length > 0 && this.addRouteForm.value?.pickup_lat_lng?.length > 0) {
|
|
192
|
+
const param = {
|
|
193
|
+
delivery_lat_lng: this.addRouteForm.value.delivery_lat_lng,
|
|
194
|
+
pickup_lat_lng: this.addRouteForm.value.pickup_lat_lng
|
|
195
|
+
};
|
|
196
|
+
this.utils.postdata('coolmap/calculate/routes/estimation', param).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
197
|
+
if (res && res['path']) {
|
|
198
|
+
this.addRouteForm.patchValue({
|
|
199
|
+
estimated_distance: res.dist, estimated_time: res.time, path: res.path
|
|
200
|
+
});
|
|
201
|
+
let path = res['path'].split(';');
|
|
202
|
+
path = path.map((ele: string | any) => { return ele = this.formateLatLong(ele) });
|
|
203
|
+
res['path'] = path;
|
|
204
|
+
const element: any = {
|
|
205
|
+
type: 'FeatureCollection',
|
|
206
|
+
features: [{ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: res['path'] } }]
|
|
207
|
+
}
|
|
208
|
+
this.coolMapService.removeRouteAndMarker(1).then(() => {
|
|
209
|
+
const unit = this.unitsList.find((x: any) => x.id === this.addRouteForm.value.unit_id);
|
|
210
|
+
const materialDetails = this.materialsList.find((x: any) => x.material_id === this.addRouteForm.value.materials_id);
|
|
211
|
+
this.coolMapService.loadMapProperty(element, 1, unit?.type,
|
|
212
|
+
{
|
|
213
|
+
pickup_location: this.addRouteForm.get('pickup_location')?.value,
|
|
214
|
+
delivery_location: this.addRouteForm.get('delivery_location')?.value,
|
|
215
|
+
route_name: this.addRouteForm.get('route_name')?.value,
|
|
216
|
+
material: materialDetails?.material, unit: unit?.type
|
|
217
|
+
}).then((res) =>{this.preventSave = true});
|
|
218
|
+
});
|
|
219
|
+
} else {
|
|
220
|
+
this.coolMapService.removeRouteAndMarker(1);
|
|
221
|
+
this.utils.openSnackBar(res['status'], 'error');
|
|
222
|
+
}
|
|
223
|
+
if (this.routeId && isinitial) this.preventInitialSave = true;
|
|
224
|
+
});
|
|
225
|
+
} else { this.coolMapService.removeRouteAndMarker(1) }
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
formateLatLong(latlong: string) { return latlong ? latlong.split(',').map(x => +x).reverse() : null }
|
|
229
|
+
saveRoute() {
|
|
230
|
+
if (this.addRouteForm.valid) {
|
|
231
|
+
this.preventSave = false;
|
|
232
|
+
const data = this.addRouteForm.value;
|
|
233
|
+
const url = this.routeId ? this.utils.postdata('coolmap/update/routes', data) : this.utils.postdata('coolmap/add/routes', data)
|
|
234
|
+
if (this.routeId) data['id'] = this.routeId;
|
|
235
|
+
url.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
236
|
+
if (res.success) {
|
|
237
|
+
this.updateRouteList.emit(true);
|
|
238
|
+
this.utils.openSnackBar(res.message, 'success');
|
|
239
|
+
this.preventInitialSave = true;
|
|
240
|
+
this.preventSave = true;
|
|
241
|
+
if(!this.routeId)this.changeNav.next('Addroute');
|
|
242
|
+
} else {
|
|
243
|
+
this.utils.openSnackBar(res.message, 'error');
|
|
244
|
+
this.preventSave = true;
|
|
245
|
+
}
|
|
246
|
+
}, (err) => { if (err) { this.preventSave = true; } });
|
|
247
|
+
} else {
|
|
248
|
+
this.addRouteForm.markAllAsTouched();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
deleteRoute() {
|
|
252
|
+
this.preventSave = false;
|
|
253
|
+
this.utils.postdata('coolmap/delete/routes', { uuid: this.routeId }).subscribe(res => {
|
|
254
|
+
if (res['data']['success']) {
|
|
255
|
+
this.utils.openSnackBar(res['data']['message'], 'success');
|
|
256
|
+
this.updateRouteList.emit(true);
|
|
257
|
+
this.changeNav.next('Addroute');
|
|
258
|
+
this.preventInitialSave = true;
|
|
259
|
+
this.preventSave = true;
|
|
260
|
+
} else {
|
|
261
|
+
this.utils.openSnackBar('Somthing went wrong', 'error');
|
|
262
|
+
this.preventSave = true;
|
|
263
|
+
}
|
|
264
|
+
}, (err) =>{this.preventSave = true})
|
|
265
|
+
}
|
|
266
|
+
ngOnDestroy(): void {
|
|
267
|
+
this.destroyer$.next(true);
|
|
268
|
+
this.destroyer$.unsubscribe();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<div class="jobcode_detailprt" (click)="isOverlapRouteSection = false" *ngIf="jobdetail" [ngClass]="{'overlap': !isOverlapRouteSection}" cdkDrag>
|
|
2
|
+
<div class="topheadingprt" *ngIf="jobdetail['order_number']">
|
|
3
|
+
<h2>{{jobdetail['order_number']}}</h2>
|
|
4
|
+
</div>
|
|
5
|
+
<span class="close"><mat-icon (click)="clearJob()">clear</mat-icon></span>
|
|
6
|
+
<div class="job_details_area">
|
|
7
|
+
<div class="detailnameprt">
|
|
8
|
+
<span> <b> {{jobdetail.customer_name}} </b> Customer </span>
|
|
9
|
+
<app-jobcode-status [jobValue]="jobdetail"></app-jobcode-status>
|
|
10
|
+
</div>
|
|
11
|
+
<app-jobcode-overview [jobValue]="jobdetail"></app-jobcode-overview>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="route_listprt" (click)="isOverlapRouteSection = true" [ngClass]="{ 'show': isVisible, 'overlap': isOverlapRouteSection}">
|
|
16
|
+
<div class="listing_toggle" (click)="toggleSidemenu()">
|
|
17
|
+
<img src="assets/images/route.svg" alt="" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="listing_box">
|
|
21
|
+
<div class="closebtn" (click)="toggleSidemenu()">
|
|
22
|
+
<mat-icon>clear</mat-icon>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="btnprt">
|
|
26
|
+
<h2> List of Routes </h2>
|
|
27
|
+
<button (click)="masterToggle()">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<app-job-route-list [routes]="routes" [masterRoutes]="masterRoutes" [selectedRoute]="selectedRoute" (changeRoutes)="routes = $event" (changeSelectedRoute)="selectedRoute = $event"></app-job-route-list>
|
|
31
|
+
|
|
32
|
+
<perfect-scrollbar>
|
|
33
|
+
<ul *ngIf="routes['length'] > 0">
|
|
34
|
+
<li *ngFor="let list of routes">
|
|
35
|
+
<div class="iconprt">
|
|
36
|
+
<span>
|
|
37
|
+
<input type="checkbox" [checked]="selectedRoute.isSelected(list)"
|
|
38
|
+
(change)="$event ? selectRoute(list) : null" /><label> </label>
|
|
39
|
+
<div class="border"></div>
|
|
40
|
+
</span>
|
|
41
|
+
<div class="statusunit" [ngClass]="list['unit']">{{list['unit']}}</div>
|
|
42
|
+
<div class="infoicon">
|
|
43
|
+
<img (mouseenter)="togglerouteDetails(true, list)" (mouseout)="togglerouteDetails(false, list, true)"
|
|
44
|
+
(click)="togglerouteDetails('click', list)" src="assets/images/info_icon.png" [alt]="" />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="pickprtbox">
|
|
48
|
+
<h2> {{list['route_name']}} </h2>
|
|
49
|
+
<h3>{{list['customer_name']}} | {{list['material']}}</h3>
|
|
50
|
+
<div class="pickdropprt">
|
|
51
|
+
<div class="pickprt">
|
|
52
|
+
<b>
|
|
53
|
+
<h4>{{list['pickup_location']}}</h4>
|
|
54
|
+
</b>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="dropprt">
|
|
57
|
+
<b>
|
|
58
|
+
<h4>{{list['delivery_location']}}</h4>
|
|
59
|
+
</b>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</li>
|
|
64
|
+
</ul>
|
|
65
|
+
<p style="color: #fff;" *ngIf="routes.length === 0">No Route found</p>
|
|
66
|
+
</perfect-scrollbar>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="route_detail" *ngIf="detailsCardEnable">
|
|
70
|
+
<div class="closebtnroutedetail" (click)="detailsCardEnable = false; preventMouseout = false">
|
|
71
|
+
<mat-icon>clear</mat-icon>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="destination">
|
|
74
|
+
<div class="duration">
|
|
75
|
+
<p class="pickprt"><b>Pickup:</b> {{routeCardDetail?.pickup_location}}</p>
|
|
76
|
+
<p class="dropprt"><b>Delivery:</b> {{routeCardDetail?.delivery_location}} </p>
|
|
77
|
+
</div>
|
|
78
|
+
<span><b>Name:</b> {{routeCardDetail?.route_name}}</span>
|
|
79
|
+
<span><b>Customer:</b> {{routeCardDetail?.customer_name}}</span>
|
|
80
|
+
<span><b>Material:</b> {{routeCardDetail?.material}}</span>
|
|
81
|
+
<span><b>Type:</b> {{routeCardDetail?.unit}}</span>
|
|
82
|
+
<span><b>Distance:</b> {{routeCardDetail?.estimated_distance}}</span>
|
|
83
|
+
<span><b>Travel Time:</b> {{routeCardDetail?.estimated_time}}</span>
|
|
84
|
+
<span class="notes"><b>Notes:</b> {{routeCardDetail?.note}}</span>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="createTxt">
|
|
88
|
+
<small>
|
|
89
|
+
Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}
|
|
90
|
+
</small>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|