@aggdirect/coolmap 2.0.8 → 2.1.0

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.
Files changed (123) hide show
  1. package/README.md +34 -1
  2. package/esm2020/aggdirect-coolmap.mjs +5 -0
  3. package/esm2020/lib/component/add-route/add-route.component.mjs +317 -0
  4. package/esm2020/lib/component/job-code/job-code.component.mjs +174 -0
  5. package/esm2020/lib/component/map/map.component.mjs +37 -0
  6. package/esm2020/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +145 -0
  7. package/esm2020/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +114 -0
  8. package/esm2020/lib/component/nav/nav.component.mjs +52 -0
  9. package/esm2020/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +72 -0
  10. package/esm2020/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +314 -0
  11. package/esm2020/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +19 -0
  12. package/esm2020/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +29 -0
  13. package/esm2020/lib/component/shared/dialog/dialog.component.mjs +29 -0
  14. package/esm2020/lib/component/shared/estimation-display/estimation-display.component.mjs +19 -0
  15. package/esm2020/lib/component/shared/job-route-list/job-route-list.component.mjs +71 -0
  16. package/esm2020/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +19 -0
  17. package/esm2020/lib/component/shared/jobcode-status/jobcode-status.component.mjs +14 -0
  18. package/esm2020/lib/coolmap.module.mjs +182 -0
  19. package/esm2020/public-api.mjs +19 -0
  20. package/fesm2015/aggdirect-coolmap.mjs +1524 -0
  21. package/fesm2015/aggdirect-coolmap.mjs.map +1 -0
  22. package/fesm2020/aggdirect-coolmap.mjs +1490 -0
  23. package/fesm2020/aggdirect-coolmap.mjs.map +1 -0
  24. package/index.d.ts +5 -0
  25. package/lib/component/add-route/add-route.component.d.ts +61 -60
  26. package/lib/component/job-code/job-code.component.d.ts +40 -29
  27. package/lib/component/map/map.component.d.ts +15 -12
  28. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +49 -36
  29. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +42 -34
  30. package/lib/component/nav/nav.component.d.ts +31 -28
  31. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +20 -16
  32. package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +42 -39
  33. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +9 -6
  34. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +11 -8
  35. package/lib/component/shared/dialog/dialog.component.d.ts +13 -10
  36. package/lib/component/shared/estimation-display/estimation-display.component.d.ts +9 -6
  37. package/lib/component/shared/job-route-list/job-route-list.component.d.ts +26 -21
  38. package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +9 -6
  39. package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +8 -5
  40. package/lib/coolmap.module.d.ts +43 -2
  41. package/package.json +40 -15
  42. package/public-api.d.ts +15 -16
  43. package/bundles/coolmap.umd.js +0 -1383
  44. package/bundles/coolmap.umd.js.map +0 -1
  45. package/bundles/coolmap.umd.min.js +0 -2
  46. package/bundles/coolmap.umd.min.js.map +0 -1
  47. package/coolmap.d.ts +0 -5
  48. package/coolmap.metadata.json +0 -1
  49. package/esm2015/coolmap.js +0 -6
  50. package/esm2015/coolmap.ngsummary.json +0 -1
  51. package/esm2015/lib/component/add-route/add-route.component.js +0 -309
  52. package/esm2015/lib/component/add-route/add-route.component.ngfactory.js +0 -304
  53. package/esm2015/lib/component/add-route/add-route.component.ngsummary.json +0 -1
  54. package/esm2015/lib/component/job-code/job-code.component.js +0 -116
  55. package/esm2015/lib/component/job-code/job-code.component.ngfactory.js +0 -77
  56. package/esm2015/lib/component/job-code/job-code.component.ngsummary.json +0 -1
  57. package/esm2015/lib/component/map/map.component.js +0 -39
  58. package/esm2015/lib/component/map/map.component.ngfactory.js +0 -23
  59. package/esm2015/lib/component/map/map.component.ngsummary.json +0 -1
  60. package/esm2015/lib/component/nav/layout/add-route-nav/add-route-nav.component.js +0 -79
  61. package/esm2015/lib/component/nav/layout/add-route-nav/add-route-nav.component.ngfactory.js +0 -142
  62. package/esm2015/lib/component/nav/layout/add-route-nav/add-route-nav.component.ngsummary.json +0 -1
  63. package/esm2015/lib/component/nav/layout/job-code-nav/job-code-nav.component.js +0 -82
  64. package/esm2015/lib/component/nav/layout/job-code-nav/job-code-nav.component.ngfactory.js +0 -194
  65. package/esm2015/lib/component/nav/layout/job-code-nav/job-code-nav.component.ngsummary.json +0 -1
  66. package/esm2015/lib/component/nav/nav.component.js +0 -54
  67. package/esm2015/lib/component/nav/nav.component.ngfactory.js +0 -43
  68. package/esm2015/lib/component/nav/nav.component.ngsummary.json +0 -1
  69. package/esm2015/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.js +0 -66
  70. package/esm2015/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ngfactory.js +0 -46
  71. package/esm2015/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ngsummary.json +0 -1
  72. package/esm2015/lib/component/route-jobcode-list/route-jobcode-list.component.js +0 -301
  73. package/esm2015/lib/component/route-jobcode-list/route-jobcode-list.component.ngfactory.js +0 -99
  74. package/esm2015/lib/component/route-jobcode-list/route-jobcode-list.component.ngsummary.json +0 -1
  75. package/esm2015/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.js +0 -20
  76. package/esm2015/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ngfactory.js +0 -21
  77. package/esm2015/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ngsummary.json +0 -1
  78. package/esm2015/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.js +0 -30
  79. package/esm2015/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ngfactory.js +0 -30
  80. package/esm2015/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ngsummary.json +0 -1
  81. package/esm2015/lib/component/shared/dialog/dialog.component.js +0 -29
  82. package/esm2015/lib/component/shared/dialog/dialog.component.ngfactory.js +0 -24
  83. package/esm2015/lib/component/shared/dialog/dialog.component.ngsummary.json +0 -1
  84. package/esm2015/lib/component/shared/estimation-display/estimation-display.component.js +0 -20
  85. package/esm2015/lib/component/shared/estimation-display/estimation-display.component.ngfactory.js +0 -23
  86. package/esm2015/lib/component/shared/estimation-display/estimation-display.component.ngsummary.json +0 -1
  87. package/esm2015/lib/component/shared/job-route-list/job-route-list.component.js +0 -63
  88. package/esm2015/lib/component/shared/job-route-list/job-route-list.component.ngfactory.js +0 -134
  89. package/esm2015/lib/component/shared/job-route-list/job-route-list.component.ngsummary.json +0 -1
  90. package/esm2015/lib/component/shared/jobcode-overview/jobcode-overview.component.js +0 -20
  91. package/esm2015/lib/component/shared/jobcode-overview/jobcode-overview.component.ngfactory.js +0 -19
  92. package/esm2015/lib/component/shared/jobcode-overview/jobcode-overview.component.ngsummary.json +0 -1
  93. package/esm2015/lib/component/shared/jobcode-status/jobcode-status.component.js +0 -16
  94. package/esm2015/lib/component/shared/jobcode-status/jobcode-status.component.ngfactory.js +0 -17
  95. package/esm2015/lib/component/shared/jobcode-status/jobcode-status.component.ngsummary.json +0 -1
  96. package/esm2015/lib/coolmap.component.js +0 -18
  97. package/esm2015/lib/coolmap.component.ngfactory.js +0 -16
  98. package/esm2015/lib/coolmap.component.ngsummary.json +0 -1
  99. package/esm2015/lib/coolmap.module.js +0 -108
  100. package/esm2015/lib/coolmap.module.ngfactory.js +0 -46
  101. package/esm2015/lib/coolmap.module.ngsummary.json +0 -1
  102. package/esm2015/public-api.js +0 -20
  103. package/esm2015/public-api.ngsummary.json +0 -1
  104. package/fesm2015/coolmap.js +0 -1317
  105. package/fesm2015/coolmap.js.map +0 -1
  106. package/lib/component/add-route/add-route.component.ngfactory.d.ts +0 -1
  107. package/lib/component/job-code/job-code.component.ngfactory.d.ts +0 -1
  108. package/lib/component/map/map.component.ngfactory.d.ts +0 -1
  109. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.ngfactory.d.ts +0 -1
  110. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.ngfactory.d.ts +0 -1
  111. package/lib/component/nav/nav.component.ngfactory.d.ts +0 -1
  112. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ngfactory.d.ts +0 -1
  113. package/lib/component/route-jobcode-list/route-jobcode-list.component.ngfactory.d.ts +0 -1
  114. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ngfactory.d.ts +0 -1
  115. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ngfactory.d.ts +0 -1
  116. package/lib/component/shared/dialog/dialog.component.ngfactory.d.ts +0 -1
  117. package/lib/component/shared/estimation-display/estimation-display.component.ngfactory.d.ts +0 -1
  118. package/lib/component/shared/job-route-list/job-route-list.component.ngfactory.d.ts +0 -1
  119. package/lib/component/shared/jobcode-overview/jobcode-overview.component.ngfactory.d.ts +0 -1
  120. package/lib/component/shared/jobcode-status/jobcode-status.component.ngfactory.d.ts +0 -1
  121. package/lib/coolmap.component.d.ts +0 -5
  122. package/lib/coolmap.component.ngfactory.d.ts +0 -1
  123. package/lib/coolmap.module.ngfactory.d.ts +0 -3
@@ -1,1317 +0,0 @@
1
- import { Component, ViewChild, EventEmitter, Output, Input, Inject, NgModule } from '@angular/core';
2
- import { CoolmapService, UtilsService, DriversmsCardKey, DriverSmsCardEnum, JobCodeOverviewData, JobCodeOverviewEnum, EstinationData, EstinationEnum } from '@aggdirect/coolmap-services';
3
- import { Subject, fromEvent } from 'rxjs';
4
- import { takeUntil, startWith, map, distinctUntilChanged, debounceTime } from 'rxjs/operators';
5
- import { MatSidenavModule } from '@angular/material/sidenav';
6
- import { MatSnackBarModule } from '@angular/material/snack-bar';
7
- import { DragDropModule } from '@angular/cdk/drag-drop';
8
- import { FormControl, Validators, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import { MatInputModule } from '@angular/material/input';
10
- import { MatSelectModule } from '@angular/material/select';
11
- import { MatIconModule } from '@angular/material/icon';
12
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
13
- import { MatFormFieldModule } from '@angular/material/form-field';
14
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
15
- import { MatChipsModule } from '@angular/material/chips';
16
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
17
- import { CommonModule } from '@angular/common';
18
- import { MatTooltipModule } from '@angular/material/tooltip';
19
- import { MatDatepickerModule } from '@angular/material/datepicker';
20
- import { MatNativeDateModule, MatPseudoCheckboxModule } from '@angular/material/core';
21
- import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
22
- import { MatButtonModule } from '@angular/material/button';
23
- import { MatProgressBarModule } from '@angular/material/progress-bar';
24
- import { SelectionModel } from '@angular/cdk/collections';
25
-
26
- class CoolmapComponent {
27
- constructor() { }
28
- ngOnInit() {
29
- }
30
- }
31
- CoolmapComponent.decorators = [
32
- { type: Component, args: [{
33
- selector: 'lib-coolmap',
34
- template: `
35
- <p>
36
- coolmap works!
37
- </p>
38
- `
39
- },] }
40
- ];
41
- CoolmapComponent.ctorParameters = () => [];
42
-
43
- class MapComponent {
44
- constructor(coolmapService) {
45
- this.coolmapService = coolmapService;
46
- this.enableProgress = true;
47
- this.destroyer$ = new Subject();
48
- }
49
- ngAfterViewInit() {
50
- this.coolmapService.reintiatecoolmap.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
51
- this.enableProgress = true;
52
- if (res) {
53
- this.coolmapService.initiateMapForAddRoute(this.mapDiv.nativeElement).then((res) => {
54
- this.enableProgress = false;
55
- });
56
- }
57
- });
58
- }
59
- ngOnDestroy() {
60
- this.destroyer$.next(true);
61
- this.destroyer$.unsubscribe();
62
- }
63
- }
64
- MapComponent.decorators = [
65
- { type: Component, args: [{
66
- selector: 'app-map',
67
- template: "<div>\r\n <mat-progress-bar *ngIf=\"enableProgress\" mode=\"indeterminate\"></mat-progress-bar>\r\n <div #map class=\"coolmap\" style=\"height: 100vh;\"></div>\r\n</div>\r\n",
68
- styles: [""]
69
- },] }
70
- ];
71
- MapComponent.ctorParameters = () => [
72
- { type: CoolmapService }
73
- ];
74
- MapComponent.propDecorators = {
75
- mapDiv: [{ type: ViewChild, args: ['map', { static: true },] }]
76
- };
77
-
78
- class NavComponent {
79
- constructor(utils, coolMap) {
80
- this.utils = utils;
81
- this.coolMap = coolMap;
82
- this.drawer = new EventEmitter();
83
- this.changeNav = new EventEmitter();
84
- this.navValue = 'Jobcode';
85
- this.isnavChange = true;
86
- this.paddinForJobCode = { top: 0, bottom: 250, left: 500, right: 400 };
87
- this.paddinForViewRoute = { top: 0, bottom: 400, left: 400, right: 0 };
88
- this.destroyer$ = new Subject();
89
- this.utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => { this.isnavChange = res; });
90
- this.coolMap.setPadding(this.paddinForJobCode);
91
- }
92
- openDrawer() { this.drawer.emit(true); }
93
- chnageNav(name) {
94
- if (this.isnavChange) {
95
- this.changeNav.emit(name);
96
- this.navValue = name;
97
- this.coolMap.clearBound();
98
- if (name === 'Addroute') {
99
- this.coolMap.setPadding(this.paddinForViewRoute);
100
- }
101
- else {
102
- this.coolMap.setPadding(this.paddinForJobCode);
103
- }
104
- this.utils.clearOptions();
105
- }
106
- }
107
- ngOnDestroy() {
108
- this.destroyer$.next(true);
109
- this.destroyer$.unsubscribe();
110
- }
111
- }
112
- NavComponent.decorators = [
113
- { type: Component, args: [{
114
- selector: 'app-nav',
115
- template: "<div class=\"nav\">\r\n <button (click)=\"openDrawer()\" class=\"toggle\">\r\n <img src=\"assets/images/toggle.svg\" alt=\"\" />\r\n </button>\r\n\r\n <ul class=\"m-100\">\r\n <li [ngClass]=\"{'active': navValue === 'Jobcode'}\">\r\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Job Code\" aria-label=\"Job-code\" (click)=\"chnageNav('Jobcode')\">\r\n <img src=\"assets/images/job-code.svg\" alt=\"\" />\r\n </a>\r\n </li>\r\n\r\n <li [ngClass]=\"{'active': navValue === 'Addroute', 'disabled': !isnavChange }\">\r\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"View Route\" aria-label=\"View-route\" (click)=\"chnageNav('Addroute')\">\r\n <img src=\"assets/images/route.svg\" alt=\"\" />\r\n </a>\r\n </li>\r\n </ul>\r\n</div>\r\n",
116
- styles: [".nav{background:#e8e8e8;height:100vh;padding:15px 0;display:flex;align-items:center;flex-direction:column}.nav button{background:#fff;border-radius:15px;padding:5px 6px}.nav button img{width:28px}.nav ul{display:flex;flex-direction:column;align-items:center}.nav ul li{margin:10px 0;padding:0 5px;border-right:2px solid #e8e8e8}.nav ul li:hover{border-right:2px solid #326ad3;padding:0 5px}.nav ul li.disabled a{pointer-events:none;opacity:.5}.nav ul li.disabled:hover{border-right:2px solid #e8e8e8}.nav ul li a{padding:6px 0;display:block;border-radius:15px;min-width:42px;box-shadow:none;line-height:30px}.nav ul li a img{width:27px}.nav ul li a:hover{background:#fff}.nav ul li a:hover img{filter:invert(.2) sepia(1) saturate(8) hue-rotate(180deg)}.nav ul li.active{border-right:2px solid #326ad3}.nav ul li.active a{background:#fff}"]
117
- },] }
118
- ];
119
- NavComponent.ctorParameters = () => [
120
- { type: UtilsService },
121
- { type: CoolmapService }
122
- ];
123
- NavComponent.propDecorators = {
124
- drawer: [{ type: Output }],
125
- changeNav: [{ type: Output }]
126
- };
127
-
128
- class RouteJobCodeListComponent {
129
- constructor(coolMap, utils) {
130
- this.coolMap = coolMap;
131
- this.utils = utils;
132
- this.loader = true;
133
- this.type = '';
134
- this.data = [];
135
- this.currentNav = '';
136
- this.emitroute = new EventEmitter();
137
- this.showAllRoute = new EventEmitter();
138
- this.preventMouseout = false;
139
- this.filterList = this.data;
140
- this.isDriverList = false;
141
- this.selectedRoute = new SelectionModel(true, []);
142
- this.preventListSelect = false;
143
- this.clearJobDetailsFromList = new EventEmitter();
144
- this.preventDetailsClose = false;
145
- this.messageLoader = false;
146
- this.driverMessage = new FormControl('', [Validators.maxLength(256)]);
147
- this.isSmsList = false;
148
- this.driverList = [];
149
- }
150
- ngOnInit() {
151
- this.utils.getpreVentJobdetailclose.subscribe(res => { this.preventDetailsClose = res; });
152
- this.utils.removeMapEntityUtility.subscribe((res) => { this.passRoute(res); });
153
- }
154
- passRoute(job) {
155
- this.data.forEach((each) => { if (each['route_id'] !== job['route_id']) {
156
- each['isActive'] = false;
157
- }
158
- else {
159
- each['isActive'] = true;
160
- } });
161
- if (this.type == 'addroute')
162
- this.filterList.forEach(ele => this.coolMap.filterRoute(ele['route_id'], 'none'));
163
- }
164
- selectRoute(route) {
165
- if (!this.preventListSelect) {
166
- this.preventListSelect = true;
167
- this.selectedRoute.toggle(route);
168
- this.clearJobDetailsFromList.emit(true);
169
- this.utils.preVentJobdetailclose.next(false);
170
- this.filterList.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'none'));
171
- this.clearList();
172
- this.selectedRoute.selected.forEach((ele, index) => {
173
- this.coolMap.filterRoute(ele['job_id'], 'visible', ((this.selectedRoute.selected.length - 1) === index)).then(() => {
174
- this.preventListSelect = false;
175
- });
176
- });
177
- if (!this.selectedRoute.selected.length) {
178
- this.preventListSelect = false;
179
- this.data.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'visible'));
180
- }
181
- ;
182
- }
183
- }
184
- checkroutes(route) {
185
- const selectedRoute = this.selectedRoute.selected;
186
- this.filterList = this.filterList.map(ele => { ele['isSelected'] = false; return ele; });
187
- if (selectedRoute.length > 0) {
188
- selectedRoute.forEach(ele => {
189
- if (route['order_number'] === ele['order_number']) {
190
- ele['isSelected'] = true;
191
- }
192
- });
193
- }
194
- return route;
195
- }
196
- ngOnChanges(changes) {
197
- setTimeout(() => {
198
- if (this.currentNav === 'Addroute' && (this.data.length < this.filterList.length)) {
199
- const index = this.filterList.findIndex(ele => ele.isActive);
200
- if (index > 0)
201
- this.filterList[index].isActive = false;
202
- this.data.forEach((ele, indexForData) => {
203
- const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
204
- this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
205
- });
206
- });
207
- }
208
- }, 500);
209
- if (changes['data'] && changes['data']['currentValue']) {
210
- this.filterList = changes['data']['currentValue'];
211
- if (this.searchTerm) {
212
- if (this.searchTerm.length > 0) {
213
- this.data = this.utils.getSearchResults(changes['data']['currentValue'], this.searchTerm);
214
- this.filterList = this.data;
215
- }
216
- else {
217
- this.filterList = changes['data']['currentValue'];
218
- }
219
- }
220
- if (this.type === 'jobcode') {
221
- this.loader = true;
222
- this.clearList();
223
- if (this.filterList.length === 0)
224
- this.loader = false;
225
- }
226
- if (this.type !== 'jobcode') {
227
- if (changes['data']['previousValue'] && this.currentNav === 'addForm') {
228
- const activeRoute = changes['data']['previousValue'].find((ele) => ele.isActive);
229
- if (activeRoute) {
230
- this.filterList.map((item) => {
231
- if (item.route_id === activeRoute.route_id) {
232
- item.isActive = true;
233
- }
234
- });
235
- }
236
- }
237
- }
238
- if (changes['data']['previousValue'] && this.currentNav !== 'addForm') {
239
- this.coolMap.removeJobFromMap(changes['data']['previousValue']);
240
- this.selectedRoute.clear();
241
- }
242
- ;
243
- if (this.currentNav !== 'addForm') {
244
- changes['data']['currentValue'].forEach((ele, indexForData) => {
245
- const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
246
- this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
247
- if (indexForData === (this.data.length - 1)) {
248
- this.loader = false;
249
- this.utils.preventnavChange.next(true);
250
- }
251
- });
252
- });
253
- }
254
- }
255
- if (changes['searchTerm']) {
256
- if (this.filterList) {
257
- this.data = this.filterList;
258
- this.clearList();
259
- if (changes['searchTerm']['currentValue'].length > 0) {
260
- this.coolMap.removeRouteAndMarker(1);
261
- this.data = this.utils.getSearchResults(this.data, changes['searchTerm']['currentValue']);
262
- }
263
- else {
264
- this.data = this.filterList;
265
- }
266
- setTimeout(() => {
267
- this.coolMap.clearBoundWithCordinates();
268
- if (this.currentNav !== 'addForm' && !this.selectedRoute['selected'].length) {
269
- this.coolMap.removeRouteAndMarker(1);
270
- this.toggleFilterRoute(this.filterList);
271
- }
272
- }, 500);
273
- if (this.currentNav !== 'addForm' && this.selectedRoute['selected'].length) {
274
- if (this.data && this.data.length > 0) {
275
- this.clearList();
276
- this.clearJobDetailsFromList.emit(true);
277
- this.coolMap.removeJobFromMap(this.selectedRoute.selected);
278
- setTimeout(() => {
279
- this.data.forEach((ele, indexForData) => {
280
- this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === (this.data.length - 1))).then(() => {
281
- if (indexForData === (this.data.length - 1)) {
282
- this.loader = false;
283
- this.utils.preventnavChange.next(true);
284
- }
285
- if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
286
- this.selectedRoute.clear();
287
- }
288
- });
289
- });
290
- }, 500);
291
- }
292
- }
293
- }
294
- }
295
- }
296
- showRoute() {
297
- this.utils.preventnavChange.next(false);
298
- this.loader = true;
299
- this.clearList();
300
- this.showAllRoute.emit(true);
301
- if (this.filterList && this.filterList.length > 0) {
302
- this.coolMap.removeJobFromMap(this.selectedRoute.selected);
303
- setTimeout(() => {
304
- this.filterList.forEach((ele, indexForData) => {
305
- this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === this.filterList.length - 1)).then(() => {
306
- if (indexForData === this.filterList.length - 1) {
307
- this.loader = false;
308
- this.utils.preventnavChange.next(true);
309
- }
310
- if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
311
- this.selectedRoute.clear();
312
- }
313
- });
314
- });
315
- }, 500);
316
- }
317
- }
318
- toggleDrivermenu(event) {
319
- const mouseevntType = event.mouseevntType;
320
- let route = event.route;
321
- const isHoverOut = event.isHoverOut;
322
- if (typeof (mouseevntType) === 'string') {
323
- if (this.preventMouseout) {
324
- this.isDriverList = !this.isDriverList;
325
- }
326
- ;
327
- this.preventMouseout = true;
328
- }
329
- if (typeof (mouseevntType) === 'boolean' && !mouseevntType && !this.preventMouseout) {
330
- this.isDriverList = mouseevntType;
331
- }
332
- ;
333
- if (typeof (mouseevntType) === 'boolean' && mouseevntType && !this.preventMouseout) {
334
- this.isDriverList = mouseevntType;
335
- }
336
- ;
337
- if (this.preventMouseout && !this.isDriverList)
338
- this.preventMouseout = false;
339
- if (isHoverOut) {
340
- if (this.preventMouseout) {
341
- route = this.utils.getdictValue('driver-details');
342
- this.driverList = route;
343
- }
344
- if (!this.preventMouseout) {
345
- this.driverList = route;
346
- }
347
- }
348
- else {
349
- this.driverList = route;
350
- }
351
- }
352
- visiblesection(value) { if (this.type === value) {
353
- return true;
354
- }
355
- else
356
- return false; }
357
- toggleFilterRoute(filterList) {
358
- filterList.forEach((ele) => {
359
- const filterItem = (this.type === 'jobcode') ? 'job_id' : 'route_id';
360
- const index = this.data.findIndex((ele1) => { return (ele1[`${filterItem}`] === ele[`${filterItem}`]); });
361
- const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
362
- if (id && index < 0)
363
- this.coolMap.filterRoute(id, 'none');
364
- if (id && index >= 0) {
365
- this.data[index].isActive = false;
366
- this.coolMap.filterRoute(id, 'visible');
367
- this.coolMap.extendBound(ele['path'], (index === (this.data.length - 1)));
368
- }
369
- ;
370
- });
371
- }
372
- clearList() {
373
- this.isDriverList = false;
374
- this.driverList = null;
375
- this.preventMouseout = false;
376
- this.isSmsList = false;
377
- }
378
- sendMessage() {
379
- this.messageLoader = true;
380
- if (this.driverMessage.valid) {
381
- const data = {
382
- order_number: this.driverList['order_number'],
383
- date: this.driverList['date'],
384
- message: this.driverMessage.value,
385
- };
386
- this.utils.postdata('coolmap/jobs_report_chat', data).subscribe((res) => {
387
- if (res['data']['status'] === 'Success.') {
388
- this.messageLoader = false;
389
- this.driverMessage.reset();
390
- this.utils.openSnackBar('Message Sent', 'success');
391
- }
392
- else {
393
- this.messageLoader = false;
394
- this.utils.openSnackBar('Message not sent', 'error');
395
- }
396
- }, err => { if (err) {
397
- this.messageLoader = false;
398
- } });
399
- }
400
- }
401
- }
402
- RouteJobCodeListComponent.decorators = [
403
- { type: Component, args: [{
404
- selector: 'app-route-jobcode-list',
405
- template: "<div class=\"scrollprt addroutelist\" [class.viewroute]=\"visiblesection('addroute')\"\r\n [class.jobList]=\"visiblesection('jobcode')\">\r\n <button (click)=\"showRoute()\" [disabled]=\"loader\" *ngIf=\"selectedRoute.selected.length\" class=\"show_routebtn\">Show all\r\n route</button>\r\n <perfect-scrollbar [class.jobscroll]=\"visiblesection('jobcode')\">\r\n <mat-spinner *ngIf=\"loader\"></mat-spinner>\r\n <ul *ngIf=\"!loader && data.length > 0\">\r\n <li [class.active]=\"route['isActive'] && visiblesection('addroute')\" *ngFor=\"let route of data\">\r\n <app-job-code-list-card *ngIf=\"visiblesection('jobcode')\" (toggleDrivermenu)=\"toggleDrivermenu($event)\"\r\n (routeSeletion)=\"selectRoute($event)\" [preventCloseDetails]=\"preventDetailsClose\"\r\n [emitJobdetails]=\"{'emitroute': emitroute, 'clearJobDetailsFromList':clearJobDetailsFromList}\" [route]=\"checkroutes(route)\"></app-job-code-list-card>\r\n <app-view-route-list-card [emitrouteevent]=\"emitroute\" *ngIf=\"visiblesection('addroute')\"\r\n [route]=\"route\"></app-view-route-list-card>\r\n </li>\r\n </ul>\r\n <p *ngIf=\"!loader && data.length === 0\">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>\r\n </perfect-scrollbar>\r\n</div>\r\n<div class=\"driver_list\" *ngIf=\"isDriverList\">\r\n <div class=\"driver_headingprt\">\r\n <h2>Driver List</h2>\r\n <button *ngIf=\"driverList.driver_list?.length > 0\" (click)=\"isSmsList = true\">SMS</button>\r\n <div class=\"closebtn\" (click)=\"isDriverList = false; preventMouseout = false; isSmsList = false\">\r\n <mat-icon>clear</mat-icon>\r\n </div>\r\n </div>\r\n <ul class=\"driverList\" *ngIf=\"driverList && driverList.driver_list\">\r\n <li *ngFor=\"let driver of driverList?.driver_list\">\r\n <img src=\"assets/images/driver_icon.png\" [alt]=\"driver['driver_name']\" />\r\n <div class=\"driver_detail\">\r\n <b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>\r\n <div class=\"cont_del\">\r\n <small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>\r\n <small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] :\r\n 'N/A'}}</b></small>\r\n </div>\r\n </div>\r\n </li>\r\n <p *ngIf=\"driverList.driver_list?.length === 0\" style=\"font-weight:700; text-align:center;\">\r\n No Driver found\r\n </p>\r\n </ul>\r\n <div class=\"smslist\" *ngIf=\"isSmsList\">\r\n <div class=\"heading\">\r\n <h2>SMS All Drivers</h2>\r\n <div class=\"closebtn\" (click)=\"isSmsList = false\">\r\n <mat-icon>clear</mat-icon>\r\n </div>\r\n </div>\r\n <div class=\"detailprt\">\r\n <app-sms-card-details-overview [jobValue]=\"driverList\"></app-sms-card-details-overview>\r\n <div class=\"form_input\">\r\n <mat-form-field class=\"example-full-width\">\r\n <textarea matInput placeholder=\"Text here...\" autocomplete=\"nope\" column=\"10\"\r\n [formControl]=\"driverMessage\"></textarea>\r\n <mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>\r\n </mat-form-field>\r\n <button *ngIf=\"!messageLoader\" [disabled]=\"!driverMessage.value || driverMessage.invalid\"\r\n (click)=\"sendMessage()\">\r\n Send SMS\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"loader\">\r\n <mat-spinner *ngIf=\"messageLoader\"></mat-spinner>\r\n </div>\r\n </div>\r\n</div>",
406
- styles: [".driver_iconprt{position:absolute;right:10px;top:12px;z-index:9999}.driver_iconprt img{width:25px;height:25px}.driver_list{background:#fff;position:fixed;width:300px;top:10px;left:360px;border-top-left-radius:20px;border-top-right-radius:20px}.driver_list .driver_headingprt{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.driver_list .driver_headingprt button{background:none;border:1px solid #ccc;border-radius:10px;padding:5px 20px}.driver_list .driver_headingprt button:hover{background:#326ad3;color:#fff}.driver_list h2{font-size:20px}.driver_list .driverList{height:300px;overflow:auto}.driver_list .driverList li{display:flex;padding:10px;align-items:flex-start;cursor:pointer;border-bottom:1px solid #fff;background:#eee}.driver_list .driverList li img{width:35px;height:35px;border-radius:100%;margin-right:10px}.driver_list .driverList li .driver_detail{width:calc(100% - 45px);display:flex;flex-direction:column;justify-content:flex-start}.driver_list .driverList li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px;font-size:.9rem}.driver_list .driverList li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;font-size:.8rem}.driver_list:after{height:10px;border-bottom-right-radius:20px;border-bottom-left-radius:20px;content:\"\";bottom:-9px;width:100%}.driver_list:after,.smslist{background:#fff;position:absolute}.smslist{width:480px;top:0;left:105%;border-radius:20px;padding-bottom:20px}.smslist .heading{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.smslist .detailprt{padding:0 15px}.smslist .detailprt span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}.smslist .detailprt span label{font-weight:600;width:37%}.smslist .detailprt .form_input{display:flex;flex-direction:column;font-size:.8rem}.smslist .detailprt .form_input button{background:#326ad3;padding:10px 18px;color:#fff;font-size:.8125rem;border-radius:30px;display:flex;align-self:flex-end}.closebtn{box-shadow:0 0 5px 0 rgba(0,0,0,.11);border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5}.show_routebtn{font-size:.9rem;margin-bottom:20px;padding:6px 11px;border-radius:5%;position:absolute;top:8px;right:10px;background-color:initial;color:#3f51b5;border:1px solid #3f51b5;border-radius:10px;box-shadow:none}.show_routebtn:hover{background-color:#3f51b5;color:#fff}.cont_del{margin-top:10px}.cont_del small{display:block}.jobList ul{margin:0 15px 0 10px;width:100%}.jobList ul li{position:relative;background:#fbfbfb;padding:10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left-width:3px;cursor:pointer;height:inherit}@media (min-width:2500px){.jobList ul li{height:7.65vh}}@media (min-width:3300px){.jobList ul li{height:5.61vh}}.viewroute ul{margin:0 15px;width:100%}.viewroute ul li{position:relative;background:#fbfbfb;padding:7px 10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left-width:3px;cursor:pointer;height:16.4vh}@media (min-width:1600px){.viewroute ul li{height:12.4vh}}.viewroute ul li.active{border:1px solid #39c471;border-left-width:3px}.loader{position:absolute;height:100%;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}"]
407
- },] }
408
- ];
409
- RouteJobCodeListComponent.ctorParameters = () => [
410
- { type: CoolmapService },
411
- { type: UtilsService }
412
- ];
413
- RouteJobCodeListComponent.propDecorators = {
414
- loader: [{ type: Input }],
415
- type: [{ type: Input }],
416
- data: [{ type: Input }],
417
- currentNav: [{ type: Input }],
418
- emitroute: [{ type: Output }],
419
- showAllRoute: [{ type: Output }],
420
- searchTerm: [{ type: Input }],
421
- clearJobDetailsFromList: [{ type: Output }],
422
- clearListSeletion: [{ type: Input }]
423
- };
424
-
425
- class ViewRouteListCardComponent {
426
- constructor(utils) {
427
- this.utils = utils;
428
- }
429
- detailsDict(event, route) {
430
- if (event === 'click')
431
- this.utils.setdictValue('route-detailsv2', JSON.stringify(route));
432
- route['type'] = 'editroute';
433
- route['prevent'] = true;
434
- this.emitrouteevent.emit(route);
435
- this.utils.routeDetailsUtility.next({ event, route });
436
- }
437
- }
438
- ViewRouteListCardComponent.decorators = [
439
- { type: Component, args: [{
440
- selector: 'app-view-route-list-card',
441
- template: "<div class=\"routebox\">\r\n <span>\r\n <mat-icon>directions</mat-icon>\r\n <h2 [ngClass]=\"{'routeheading': route['route_name']}\">\r\n {{route['route_name']}}\r\n </h2>\r\n </span>\r\n <h3>{{route['customer_name']}} | {{route['material']}}</h3>\r\n\r\n <div class=\"pickdropprt\">\r\n <div class=\"pickprt\">\r\n <b>\r\n <h4>{{route['pickup_location']}}</h4>\r\n </b>\r\n </div>\r\n <div class=\"dropprt\">\r\n <b>\r\n <h4>{{route['delivery_location']}}</h4>\r\n </b>\r\n </div>\r\n </div>\r\n <div class=\"infoicon\" (click)=\"detailsDict('click', route)\" (mouseover)=\"detailsDict(true, route)\"\r\n (mouseleave)=\"detailsDict(false, route)\">\r\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\r\n </div>\r\n <div class=\"status routestatus\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\r\n</div>\r\n\r\n\r\n\r\n",
442
- styles: [".routebox span{display:flex;align-items:center}.routebox span h2{margin-left:5px;max-width:180px;margin-bottom:5px;margin-top:5px;font-size:.95rem}.routebox h3,.routebox span h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.routebox h3{font-size:.85rem;color:#767676;font-weight:400;margin-top:0;max-width:325px;margin-bottom:10px}.routebox .pickdropprt{font-size:.8125rem}.routebox .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:6px}.routebox .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .pickprt b{position:relative;font-weight:400}.routebox .pickdropprt .pickprt b:after{background:#000;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.routebox .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}@media (min-width:1600px){.routebox .pickdropprt .pickprt h4{max-width:265px}}.routebox .pickdropprt .pickprt h4:before{background:#000;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.routebox .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .dropprt b{position:relative;font-weight:400}.routebox .pickdropprt .dropprt b:after{background:#000;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.routebox .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;max-width:215px}.routebox .pickdropprt .dropprt h4:before{background:#000;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .infoicon{position:absolute;right:10px;bottom:10px}.routebox .infoicon img{width:20px;height:20px}.routebox .status{position:absolute;border-radius:30px;top:12px;right:40px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;padding:3px 10px}.routebox .status.routestatus{right:10px;width:20px;height:20px;text-align:center;line-height:20px;padding:0 0 0 1px}.routebox .status.routestatus:first-letter{font-size:.8rem}@media (min-width:1600px){.routebox .status.routestatus{padding:0;line-height:22px}}.routebox .status.Ton{background:#ff7272}.routebox .status.Load{background:#a3c52e}.routebox .status.Hourly{background:#ae23d1}"]
443
- },] }
444
- ];
445
- ViewRouteListCardComponent.ctorParameters = () => [
446
- { type: UtilsService }
447
- ];
448
- ViewRouteListCardComponent.propDecorators = {
449
- route: [{ type: Input }],
450
- emitrouteevent: [{ type: Input }]
451
- };
452
-
453
- class SmsCardDetailsOverviewComponent {
454
- constructor() {
455
- this.label = DriversmsCardKey;
456
- this.overViewEnum = DriverSmsCardEnum;
457
- }
458
- }
459
- SmsCardDetailsOverviewComponent.decorators = [
460
- { type: Component, args: [{
461
- selector: 'app-sms-card-details-overview',
462
- template: "<ng-container *ngFor=\"let item of label\">\r\n <span>\r\n <label>{{overViewEnum[item]}}</label>\r\n <ng-container *ngIf=\"item !== 'values'\">{{jobValue[item] ? jobValue[item] : 'N/A'}}</ng-container>\r\n <ng-container *ngIf=\"item === 'values'\">{{jobValue[item]['Done'] + jobValue[item]['Ongoing'] + jobValue[item]['Open']}}</ng-container>\r\n </span>\r\n</ng-container>\r\n",
463
- styles: ["span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}span label{font-weight:600;width:37%}"]
464
- },] }
465
- ];
466
- SmsCardDetailsOverviewComponent.ctorParameters = () => [];
467
- SmsCardDetailsOverviewComponent.propDecorators = {
468
- jobValue: [{ type: Input }]
469
- };
470
-
471
- class JobCodeListCardComponent {
472
- constructor(utils) {
473
- this.utils = utils;
474
- this.routeSeletion = new EventEmitter();
475
- this.toggleDrivermenu = new EventEmitter();
476
- }
477
- selectRoute(route) { this.routeSeletion.emit(route); }
478
- toggleDriverlist(mouseevntType, route, isHoverOut) {
479
- const data = { mouseevntType, route, isHoverOut };
480
- this.toggleDrivermenu.emit(data);
481
- if (mouseevntType === 'click')
482
- this.utils.setdictValue('driver-details', JSON.stringify(this.route));
483
- }
484
- toggleJobCodeDetails(mouseEventType, route) {
485
- if (mouseEventType) {
486
- route['type'] = 'jobcode';
487
- this.emitJobdetails.emitroute.emit(route);
488
- }
489
- else if (!mouseEventType && this.preventCloseDetails) {
490
- route = this.utils.getdictValue('route-details');
491
- route['type'] = 'jobcode';
492
- this.emitJobdetails.emitroute.emit(route);
493
- }
494
- else if (!mouseEventType && !this.preventCloseDetails)
495
- this.emitJobdetails.clearJobDetailsFromList.emit(true);
496
- }
497
- calculateStatusPercentage(type, route) {
498
- const total = route['Done'] + route['Ongoing'] + route['Open'];
499
- if (type === 'done') {
500
- return Math.round((100 * route['Done']) / total);
501
- }
502
- else if (type === 'ongoing') {
503
- return Math.round((100 * route['Ongoing']) / total);
504
- }
505
- else if (type === 'open') {
506
- return Math.round((100 * route['Open']) / total);
507
- }
508
- else {
509
- return null;
510
- }
511
- }
512
- setRouteItem() {
513
- this.utils.preVentJobdetailclose.next(true);
514
- this.utils.setdictValue('route-details', JSON.stringify(this.route));
515
- }
516
- }
517
- JobCodeListCardComponent.decorators = [
518
- { type: Component, args: [{
519
- selector: 'app-job-code-list-card',
520
- template: "<div class=\"innerbox\">\r\n <div class=\"inputarea\">\r\n <input type=\"checkbox\" name=\"selectroute\" [checked]=\"route['isSelected']\" (change)=\"$event ? selectRoute(route) : null\" />\r\n <label>&nbsp;</label>\r\n <div class=\"border\"></div>\r\n </div>\r\n <div class=\"job_intro\">\r\n <div class=\"heading\">\r\n <h2>\r\n {{route['order_number'] ? route['order_number'] : ''}}\r\n </h2>\r\n |\r\n <span>\r\n {{route['customer_name']}}\r\n </span>\r\n |\r\n <span>\r\n {{route['project']}}\r\n </span>\r\n </div>\r\n <div class=\"destinationprt\">\r\n <span style=\"padding-left: 0;\">\r\n {{route['pickup_location']}}\r\n </span>\r\n <b>></b>\r\n <span>\r\n {{route['delivery_location']}}\r\n </span>\r\n </div>\r\n <div class=\"mat_cat\">\r\n <span>\r\n {{route['material']}}\r\n </span>\r\n </div>\r\n\r\n <div class=\"statusbar\">\r\n <div class=\"status_percent\">\r\n <span class=\"done\" [style]=\"'width:'+calculateStatusPercentage('done',route['values'])+'%'\"></span>\r\n <span class=\"ongoing\" [style]=\"'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'\"> </span>\r\n <span class=\"open\" [style]=\"'width:'+calculateStatusPercentage('open', route['values'])+'%'\"> </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"statusarea\">\r\n <div class=\"statusunit\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\r\n <div class=\"driver_icon\" (mouseover)=\"toggleDriverlist(true, route)\" (mouseout)=\"toggleDriverlist(false, route, true)\"\r\n mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Click on icon to show the driver list\" matTooltipPosition=\"above\"\r\n (click)=\"toggleDriverlist('click', route)\">\r\n <img src=\"assets/images/driver_icon.png\" [alt]=\"\" />\r\n </div>\r\n <div class=\"infoicon\" (click)=\"setRouteItem()\" (mouseover)=\"toggleJobCodeDetails(true, route)\"\r\n (mouseout)=\"toggleJobCodeDetails(false, route)\">\r\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\r\n </div>\r\n </div>\r\n</div>\r\n",
521
- styles: [".innerbox{display:flex;justify-content:space-between}.innerbox .inputarea{display:flex;align-items:center;width:6%}.innerbox .inputarea input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.innerbox .inputarea input[type=checkbox]:checked+label{background:url(../../../../../assets/images/fill-radio.png) 10px 11px no-repeat}.innerbox .inputarea label{background:url(../../../../../assets/images/blank-radio.png) 10px 11px no-repeat;width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.innerbox .inputarea .border{position:absolute;width:100%;height:100%;left:0;right:0;top:-1px;border-radius:15px}.innerbox .inputarea input:checked~.border{border:1px solid #39c471;border-left-width:3px}.innerbox .inputarea h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:214px;padding-left:16px;margin-bottom:5px;margin-top:0}.innerbox .job_intro{width:80%}.innerbox .job_intro .heading{display:flex;font-size:.8rem}.innerbox .job_intro .heading h2{margin:0 4px 0 0;font-size:.8rem}.innerbox .job_intro .heading span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100px;padding:0 3px;display:block}.innerbox .job_intro .destinationprt{display:flex;margin-top:10px;font-size:.8rem}.innerbox .job_intro .destinationprt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:132px;padding:0 5px;display:block}.innerbox .job_intro .mat_cat{margin-top:10px;font-size:.8rem}.innerbox .job_intro .statusbar{width:100%;position:relative;height:5px;margin-top:10px}.innerbox .job_intro .statusbar .status_percent{position:absolute;left:0;display:flex;width:100%;height:100%}.innerbox .job_intro .statusbar .status_percent span{display:block}.innerbox .job_intro .statusbar .status_percent .done{background:green}.innerbox .job_intro .statusbar .status_percent .ongoing{background:#fc0}.innerbox .job_intro .statusbar .status_percent .open{background:#bfbfbf}.innerbox .statusarea{display:flex;flex-direction:column;align-items:center;width:10%}.innerbox .statusarea .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px}.innerbox .statusarea .statusunit:first-letter{font-size:.8rem}.innerbox .statusarea .statusunit.routestatus{right:10px}.innerbox .statusarea .statusunit.Ton{background:#39c471}.innerbox .statusarea .statusunit.Load{background:#326ad3}.innerbox .statusarea .statusunit.Hourly{background:#ffad56}.innerbox .statusarea .driver_icon,.innerbox .statusarea .infoicon{z-index:9999}.innerbox .statusarea .driver_icon img,.innerbox .statusarea .infoicon img{width:20px;height:20px}.innerbox .statusarea .driver_icon{margin:5px 0}"]
522
- },] }
523
- ];
524
- JobCodeListCardComponent.ctorParameters = () => [
525
- { type: UtilsService }
526
- ];
527
- JobCodeListCardComponent.propDecorators = {
528
- route: [{ type: Input }],
529
- routeSeletion: [{ type: Output }],
530
- toggleDrivermenu: [{ type: Output }],
531
- emitJobdetails: [{ type: Input }],
532
- preventCloseDetails: [{ type: Input }]
533
- };
534
-
535
- class JobCodeComponent {
536
- constructor(utils, coolMap) {
537
- this.utils = utils;
538
- this.coolMap = coolMap;
539
- this.isVisible = false;
540
- this.routes = [];
541
- this.selectedRoute = new SelectionModel(true, []);
542
- this.clearJobDetails = new EventEmitter();
543
- this.isOverlapRouteSection = false;
544
- this.destroyer$ = new Subject();
545
- this.preventMouseout = false;
546
- this.utils.clearViewRouteforJobCodeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
547
- if (res)
548
- this.coolMap.removeJobFromMap(this.selectedRoute.selected);
549
- this.selectedRoute.clear();
550
- });
551
- }
552
- ngOnInit() { this.getRouteList(); }
553
- getRouteList() {
554
- this.utils.getData('coolmap/routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
555
- if (res) {
556
- this.routes = res.data;
557
- this.masterRoutes = res.data;
558
- this.preventListUpdate = false;
559
- this.utils.clearOptions();
560
- this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
561
- }
562
- });
563
- }
564
- toggleSidemenu() {
565
- this.isVisible = !this.isVisible;
566
- this.detailsCardEnable = false;
567
- this.preventMouseout = false;
568
- }
569
- clearJob() { this.clearJobDetails.emit(true); this.utils.preVentJobdetailclose.next(false); }
570
- selectRoute(event) {
571
- const i = this.selectedRoute.selected.findIndex(ele => ele['order_number'] === event['order_number']);
572
- this.selectedRoute.toggle(event);
573
- if (!this.selectedRoute.isSelected(event) && event['route_id']) {
574
- this.coolMap.removeRouteAndMarker(event['route_id']).then((res) => {
575
- this.coolMap.extendReBound();
576
- });
577
- }
578
- else {
579
- this.coolMap.plotRoute(event, event['route_id'], 'jobrouteList', false, true);
580
- }
581
- }
582
- masterToggle() {
583
- if (this.routes.length === this.selectedRoute.selected.length) {
584
- this.selectedRoute.clear();
585
- this.routes.forEach(row => {
586
- this.coolMap.removeRouteAndMarker(row['route_id']).then((res) => { this.coolMap.extendReBound(); });
587
- });
588
- }
589
- else {
590
- this.routes.forEach(row => {
591
- this.selectedRoute.select(row);
592
- this.coolMap.plotRoute(row, row['route_id'], 'jobrouteList', false, true);
593
- });
594
- }
595
- }
596
- togglerouteDetails(eventType, route, mouseOut) {
597
- if (typeof (eventType) === 'string') {
598
- this.preventMouseout = true;
599
- this.utils.setdictValue('route-details', JSON.stringify(route));
600
- }
601
- if (typeof (eventType) === 'boolean' && eventType && !this.preventMouseout) {
602
- this.detailsCardEnable = eventType;
603
- }
604
- ;
605
- if (typeof (eventType) === 'boolean' && !eventType && !this.preventMouseout) {
606
- this.detailsCardEnable = eventType;
607
- }
608
- ;
609
- if (this.preventMouseout && !this.detailsCardEnable)
610
- this.preventMouseout = false;
611
- if (mouseOut) {
612
- if (this.preventMouseout) {
613
- route = this.utils.getdictValue('route-details');
614
- this.routeCardDetail = route;
615
- }
616
- if (!this.preventMouseout) {
617
- this.routeCardDetail = route;
618
- }
619
- }
620
- else {
621
- this.routeCardDetail = route;
622
- }
623
- this.routeCardDetail['created_at'] = this.utils.getDateFormat(new Date(this.routeCardDetail['created_at']), '/');
624
- }
625
- ngOnDestroy() {
626
- this.destroyer$.next(true);
627
- this.destroyer$.unsubscribe();
628
- }
629
- }
630
- JobCodeComponent.decorators = [
631
- { type: Component, args: [{
632
- selector: 'app-job-code',
633
- template: "<div class=\"jobcode_detailprt\" (click)=\"isOverlapRouteSection = false\" *ngIf=\"jobdetail\" [ngClass]=\"{'overlap': !isOverlapRouteSection}\" cdkDrag>\r\n <div class=\"topheadingprt\" *ngIf=\"jobdetail['order_number']\">\r\n <h2>{{jobdetail['order_number']}}</h2>\r\n </div>\r\n <span class=\"close\"><mat-icon (click)=\"clearJob()\">clear</mat-icon></span>\r\n <div class=\"job_details_area\">\r\n <div class=\"detailnameprt\">\r\n <span> <b> {{jobdetail.customer_name}} </b> Customer </span>\r\n <app-jobcode-status [jobValue]=\"jobdetail\"></app-jobcode-status>\r\n </div>\r\n <app-jobcode-overview [jobValue]=\"jobdetail\"></app-jobcode-overview>\r\n </div>\r\n</div>\r\n\r\n<div class=\"route_listprt\" (click)=\"isOverlapRouteSection = true\" [ngClass]=\"{ 'show': isVisible, 'overlap': isOverlapRouteSection}\">\r\n <div class=\"listing_toggle\" (click)=\"toggleSidemenu()\">\r\n <img src=\"assets/images/route.svg\" alt=\"\" />\r\n </div>\r\n\r\n <div class=\"listing_box\">\r\n <div class=\"closebtn\" (click)=\"toggleSidemenu()\">\r\n <mat-icon>clear</mat-icon>\r\n </div>\r\n\r\n <div class=\"btnprt\">\r\n <h2> List of Routes </h2>\r\n <button (click)=\"masterToggle()\">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>\r\n </div>\r\n\r\n <app-job-route-list [routes]=\"routes\" [masterRoutes]=\"masterRoutes\" [selectedRoute]=\"selectedRoute\" (changeRoutes)=\"routes = $event\" (changeSelectedRoute)=\"selectedRoute = $event\"></app-job-route-list>\r\n\r\n <perfect-scrollbar>\r\n <ul *ngIf=\"routes['length'] > 0\">\r\n <li *ngFor=\"let list of routes\">\r\n <div class=\"iconprt\">\r\n <span>\r\n <input type=\"checkbox\" [checked]=\"selectedRoute.isSelected(list)\"\r\n (change)=\"$event ? selectRoute(list) : null\" /><label>&nbsp;</label>\r\n <div class=\"border\"></div>\r\n </span>\r\n <div class=\"statusunit\" [ngClass]=\"list['unit']\">{{list['unit']}}</div>\r\n <div class=\"infoicon\">\r\n <img (mouseenter)=\"togglerouteDetails(true, list)\" (mouseout)=\"togglerouteDetails(false, list, true)\"\r\n (click)=\"togglerouteDetails('click', list)\" src=\"assets/images/info_icon.png\" [alt]=\"\" />\r\n </div>\r\n </div>\r\n <div class=\"pickprtbox\">\r\n <h2> {{list['route_name']}} </h2>\r\n <h3>{{list['customer_name']}} | {{list['material']}}</h3>\r\n <div class=\"pickdropprt\">\r\n <div class=\"pickprt\">\r\n <b>\r\n <h4>{{list['pickup_location']}}</h4>\r\n </b>\r\n </div>\r\n <div class=\"dropprt\">\r\n <b>\r\n <h4>{{list['delivery_location']}}</h4>\r\n </b>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n <p style=\"color: #fff;\" *ngIf=\"routes.length === 0\">No Route found</p>\r\n </perfect-scrollbar>\r\n </div>\r\n\r\n <div class=\"route_detail\" *ngIf=\"detailsCardEnable\">\r\n <div class=\"closebtnroutedetail\" (click)=\"detailsCardEnable = false; preventMouseout = false\">\r\n <mat-icon>clear</mat-icon>\r\n </div>\r\n <div class=\"destination\">\r\n <div class=\"duration\">\r\n <p class=\"pickprt\"><b>Pickup:</b> {{routeCardDetail?.pickup_location}}</p>\r\n <p class=\"dropprt\"><b>Delivery:</b> {{routeCardDetail?.delivery_location}} </p>\r\n </div>\r\n <span><b>Name:</b> {{routeCardDetail?.route_name}}</span>\r\n <span><b>Customer:</b> {{routeCardDetail?.customer_name}}</span>\r\n <span><b>Material:</b> {{routeCardDetail?.material}}</span>\r\n <span><b>Type:</b> {{routeCardDetail?.unit}}</span>\r\n <span><b>Distance:</b> {{routeCardDetail?.estimated_distance}}</span>\r\n <span><b>Travel Time:</b> {{routeCardDetail?.estimated_time}}</span>\r\n <span class=\"notes\"><b>Notes:</b> {{routeCardDetail?.note}}</span>\r\n </div>\r\n\r\n <div class=\"createTxt\">\r\n <small>\r\n Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}\r\n </small>\r\n </div>\r\n </div>\r\n</div>\r\n",
634
- styles: [".jobcode_detailprt{position:absolute;left:300px;bottom:10px;background:#fff;padding:10px 20px;border-radius:20px;width:calc(100% - 315px);z-index:999;box-shadow:0 0 5px 0 rgba(0,0,0,.1);height:250px;cursor:move}@media (min-width:1600px){.jobcode_detailprt{left:307px;width:calc(100% - 325px)}}.jobcode_detailprt .topheadingprt .driver_list ul{display:flex;width:450px;justify-content:flex-end}.jobcode_detailprt .topheadingprt .driver_list ul li{position:relative;margin:0 -6px 2px 0;cursor:pointer}.jobcode_detailprt .topheadingprt .driver_list ul li img{width:30px;height:30px;border-radius:100%;border:1px solid #fff}.jobcode_detailprt .topheadingprt .driver_list ul li:hover .driver_detail{display:flex}.jobcode_detailprt .topheadingprt .driver_list ul li .driver_detail{position:absolute;top:-70px;left:-50px;display:none;will-change:transform;pointer-events:none;border-radius:10px;box-shadow:0 4px 4px 0 rgba(0,0,0,.14);width:133px;background:#fff;text-align:center;padding:10px;flex-direction:column;font-size:.8125rem}.jobcode_detailprt .topheadingprt .driver_list ul li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px}.jobcode_detailprt .topheadingprt .driver_list ul li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:117px;display:block}.jobcode_detailprt .topheadingprt .driver_list ul li .driver_detail:after{width:0;height:0;border-top:15px solid #fff;border-left:10px solid transparent;border-right:10px solid transparent;z-index:1;content:\"\";position:absolute;filter:drop-shadow(0 3px 1px rgba(0,0,0,.2));bottom:-14px;left:50%;transform:translateX(-50%)}.jobcode_detailprt .topheadingprt .driver_list ul li.extraicon{background:#fff;width:30px;height:30px;border-radius:100%;display:flex;justify-content:center;align-items:center;margin:0 0 0 10px;border:1px solid #eee}.jobcode_detailprt .close{position:absolute;top:10px;right:20px;background:#e8e8e8;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer}@keyframes autoslide{to{transform:translateX(calc(90vw - 100%))}0%{transform:translateX(0)}}.jobcode_detailprt .job_details_area{padding:15px 0}.jobcode_detailprt .job_details_area .detailnameprt{display:flex;justify-content:space-between}.jobcode_detailprt .job_details_area .detailnameprt span{display:flex;flex-direction:column;font-size:.875rem;color:#767676}.jobcode_detailprt .job_details_area .detailnameprt span b{font-size:.9375rem;font-weight:500;color:#000}.route_listprt .listing_toggle{background:#fff;border-radius:15px;padding:5px;position:absolute;right:10px;top:20px;cursor:pointer}.route_listprt .listing_toggle img{width:28px}.route_listprt .listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px 0 hsla(0,0%,100%,.08);transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 0;opacity:0}.route_listprt .listing_box .closebtn{display:none}.route_listprt .listing_box ul{padding:0 20px 0 0}.route_listprt .listing_box ul li{background:#4a4a4a;padding:10px 15px;border-radius:15px;display:flex;margin-bottom:10px;position:relative;height:inherit}@media (min-width:1600px){.route_listprt .listing_box ul li{padding:6px 15px;margin-bottom:5px}}.route_listprt .listing_box ul li .iconprt{display:flex;flex-direction:column}.route_listprt .listing_box ul li .iconprt span{display:flex;align-items:center;margin-bottom:32px}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]:checked+label{background:url(../../../assets/images/fill-check.png) 16px 15px no-repeat}.route_listprt .listing_box ul li .iconprt span label{background:url(../../../assets/images/blank-check.png) 16px 15px no-repeat;width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.route_listprt .listing_box ul li .iconprt span .border{position:absolute;width:100%;height:100%;left:0;right:0;top:0;border-radius:15px}.route_listprt .listing_box ul li .iconprt span input:checked~.border{border:1px solid #fff}.route_listprt .listing_box ul li .iconprt span h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;padding-left:16px;font-size:.9rem;margin-bottom:0;font-weight:400;margin-top:0}.route_listprt .listing_box ul li .iconprt .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px;margin-bottom:7px}.route_listprt .listing_box ul li .iconprt .statusunit:first-letter{font-size:.8rem}.route_listprt .listing_box ul li .iconprt .statusunit.Ton{background:#ff7272}.route_listprt .listing_box ul li .iconprt .statusunit.Load{background:#a3c52e}.route_listprt .listing_box ul li .iconprt .statusunit.Hourly{background:#ae23d1}@media (min-width:1600px){.route_listprt .listing_box ul li .iconprt .statusunit{line-height:21px}}.route_listprt .listing_box ul li .iconprt .infoicon{z-index:5;cursor:pointer}.route_listprt .listing_box ul li .iconprt .infoicon img{width:20px;height:20px}.route_listprt .listing_box ul li .pickprtbox{margin-left:10px}.route_listprt .listing_box ul li .pickprtbox h2{font-size:.9rem;margin:3px 0 5px;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden}.route_listprt .listing_box ul li h3{font-size:.8rem;color:#979797;font-weight:600;margin-top:0;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden;margin-bottom:5px}.route_listprt .listing_box ul li .pickdropprt{font-size:.75rem}.route_listprt .listing_box ul li .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .pickprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .pickprt b:after{background:#bcbcbc;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .pickprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt .listing_box ul li .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.route_listprt .listing_box ul li .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .dropprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .dropprt b:after{background:#bcbcbc;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.route_listprt .listing_box ul li .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .dropprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt.show .listing_box{width:300px;max-width:300px;flex:0 0 350px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}.route_listprt.show .listing_box h2{color:#fff;white-space:nowrap}.route_listprt.show .listing_box .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px 0 hsla(0,0%,100%,.08);display:block}.overlap{z-index:9999}.btnprt{display:flex;justify-content:space-between;align-items:center;padding-right:20px}.btnprt h2{margin:0}.btnprt button{font-size:15px;padding:8px 20px;border-radius:5%;background-color:#326ad3;color:#fff;border:none;border-radius:10px;box-shadow:none;outline:none}.hidden{display:none}.route_detail{background:#282828;position:absolute;width:260px;top:50%;transform:translateY(-50%);right:310px;border-radius:20px;padding:10px;box-shadow:0 0 5px 0 hsla(0,0%,100%,.21)}.route_detail .destination .duration{background:#444343;border:1px solid #918e8e;padding:10px;color:#fff}.route_detail .destination .duration b{color:#fff}.route_detail .destination .dropprt:before,.route_detail .destination .dropprt b:before,.route_detail .destination .pickprt:before,.route_detail .destination .pickprt b:before{background:#fff}.route_detail .destination span{line-height:20px;color:#fff;padding:3px 0}.route_detail .destination span b{color:#fff}.route_detail .destination span.notes{max-height:200px;overflow:auto}.createTxt small{color:#fff;font-size:.7rem}.closebtnroutedetail{box-shadow:0 0 5px 0 rgba(0,0,0,.11);border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5;position:absolute;top:-7px;left:-11px}"]
635
- },] }
636
- ];
637
- JobCodeComponent.ctorParameters = () => [
638
- { type: UtilsService },
639
- { type: CoolmapService }
640
- ];
641
- JobCodeComponent.propDecorators = {
642
- jobdetail: [{ type: Input }],
643
- clearJobDetails: [{ type: Output }]
644
- };
645
-
646
- class JobcodeStatusComponent {
647
- constructor() { }
648
- }
649
- JobcodeStatusComponent.decorators = [
650
- { type: Component, args: [{
651
- selector: 'app-jobcode-status',
652
- template: "<div class=\"statusprt\">\r\n <span class=\"done\"> Done - {{jobValue['values']['Done']}} </span>\r\n <span class=\"ongoing\"> Ongoing - {{jobValue['values']['Ongoing']}} </span>\r\n <span class=\"open\"> Open - {{jobValue['values']['Open']}} </span>\r\n</div>\r\n",
653
- styles: [".statusprt span{padding:10px;font-size:.9rem}.statusprt span.done{border:2px solid #0b843c;color:#0b843c}.statusprt span.done:hover{background:#0b843c;color:#fff}.statusprt span.ongoing{border:2px solid #eecb27;color:#eecb27}.statusprt span.ongoing:hover{background:#eecb27;color:#fff}.statusprt span.open{border:2px solid #12afcb;color:#12afcb}.statusprt span.open:hover{background:#12afcb;color:#fff}"]
654
- },] }
655
- ];
656
- JobcodeStatusComponent.ctorParameters = () => [];
657
- JobcodeStatusComponent.propDecorators = {
658
- jobValue: [{ type: Input }]
659
- };
660
-
661
- class JobRouteListComponent {
662
- constructor(utils, coolMap) {
663
- var _a;
664
- this.utils = utils;
665
- this.coolMap = coolMap;
666
- this.changeNav = new EventEmitter();
667
- this.filterForm = new FormGroup({ search: new FormControl() });
668
- this.changeRoutes = new EventEmitter();
669
- this.changeSelectedRoute = new EventEmitter();
670
- this.filters = [];
671
- this.filteredOptions = (_a = this.filterForm.get('search')) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
672
- }
673
- filterSearch(e) {
674
- this.changeNav.emit({ type: 'Addroute' });
675
- this.preventListUpdate = true;
676
- this.filterForm.controls.search.setValue(null);
677
- this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
678
- const filteredRoutes = this.utils.getSearchResults(this.masterRoutes, [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]);
679
- this.changeRoutes.emit(filteredRoutes);
680
- this.selectedRoute.selected.forEach((item) => {
681
- const routeData = filteredRoutes.find(x => x.route_id === item.route_id);
682
- if (!routeData) {
683
- this.selectedRoute.toggle(item);
684
- this.changeSelectedRoute.emit(this.selectedRoute);
685
- this.coolMap.removeRouteAndMarker(item['route_id']).then((res) => {
686
- this.coolMap.extendReBound();
687
- });
688
- }
689
- });
690
- }
691
- removeFromFilter(filter) {
692
- this.changeNav.emit({ type: 'Addroute' });
693
- const index = this.filters.indexOf(filter);
694
- if (index >= 0) {
695
- this.filters = [];
696
- this.changeRoutes.emit(this.masterRoutes);
697
- }
698
- }
699
- }
700
- JobRouteListComponent.decorators = [
701
- { type: Component, args: [{
702
- selector: 'app-job-route-list',
703
- template: "<div class=\"searchprt\">\r\n <form [formGroup]=\"filterForm\">\r\n <mat-form-field class=\"full-width\">\r\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\" placeholder=\"Search\">\r\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"filterForm.reset()\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\r\n [value]=\"option\">\r\n {{option.type | titlecase }}: {{option['label']}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n</form>\r\n</div>\r\n<div class=\"chip-list\">\r\n <mat-chip-list #chipList aria-label=\"Filter selection\">\r\n <mat-chip *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\r\n {{filter.type | titlecase }}: {{filter.name}}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n",
704
- styles: [".searchprt{padding-right:20px}"]
705
- },] }
706
- ];
707
- JobRouteListComponent.ctorParameters = () => [
708
- { type: UtilsService },
709
- { type: CoolmapService }
710
- ];
711
- JobRouteListComponent.propDecorators = {
712
- changeNav: [{ type: Output }],
713
- routes: [{ type: Input }],
714
- selectedRoute: [{ type: Input }],
715
- changeRoutes: [{ type: Output }],
716
- changeSelectedRoute: [{ type: Output }],
717
- masterRoutes: [{ type: Input }]
718
- };
719
-
720
- class JobcodeOverviewComponent {
721
- constructor() {
722
- this.label = JobCodeOverviewData;
723
- this.overViewEnum = JobCodeOverviewEnum;
724
- }
725
- }
726
- JobcodeOverviewComponent.decorators = [
727
- { type: Component, args: [{
728
- selector: 'app-jobcode-overview',
729
- template: "<div class=\"detail_view m-40\">\r\n <ng-container *ngFor=\"let item of label\">\r\n <span [class.pickprt]=\"item === 'pickup_location'\" [class.dropprt]=\"item === 'delivery_location'\">\r\n <label>{{overViewEnum[item]}}</label>\r\n <b> {{jobValue[item] ? jobValue[item] : 'N/A'}} </b>\r\n </span>\r\n </ng-container>\r\n</div>\r\n",
730
- styles: [".detail_view{display:flex;flex-direction:row;justify-content:space-between}.detail_view span{display:flex;flex-direction:column;font-size:.8125rem;width:15%;margin:0 7px 0 0}.detail_view span.dropprt,.detail_view span.pickprt{width:20%}.detail_view span label{font-size:.8125rem;font-weight:400;color:#767676;padding-bottom:8px}.detail_view span b{font-weight:500}"]
731
- },] }
732
- ];
733
- JobcodeOverviewComponent.ctorParameters = () => [];
734
- JobcodeOverviewComponent.propDecorators = {
735
- jobValue: [{ type: Input }]
736
- };
737
-
738
- class DialogComponent {
739
- constructor(dialogRef, data) {
740
- this.dialogRef = dialogRef;
741
- this.data = data;
742
- this.body = 'Are you sure you want to delete?';
743
- this.positive = 'Delete';
744
- this.negative = 'Cancel';
745
- ['body', 'positive', 'negative'].map(elem => {
746
- if (this.data[elem] !== undefined) {
747
- this[elem] = this.data[elem];
748
- }
749
- });
750
- }
751
- onClose(result) { this.dialogRef.close(result); }
752
- }
753
- DialogComponent.decorators = [
754
- { type: Component, args: [{
755
- selector: 'app-dialog',
756
- template: "<div class=\"dialogbox\">\r\n <h2>{{body}}</h2>\r\n <div class=\"twobtnprt\">\r\n <button class=\"delbtn\" (click)=\"onClose(true)\">{{positive}}</button>\r\n <button class=\"closebtn\" (click)=\"onClose(false)\">{{negative}}</button>\r\n </div>\r\n</div>\r\n",
757
- styles: [".dialogbox{display:flex;flex-direction:column}.dialogbox h2{font-size:1.5rem}.dialogbox .twobtnprt{display:flex;justify-content:center;margin-top:10px}.closebtn{background:#000}.closebtn,.delbtn{color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}.delbtn{background:red}"]
758
- },] }
759
- ];
760
- DialogComponent.ctorParameters = () => [
761
- { type: MatDialogRef },
762
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
763
- ];
764
-
765
- class AddRouteComponent {
766
- constructor(coolMapService, utils, dialog) {
767
- this.coolMapService = coolMapService;
768
- this.utils = utils;
769
- this.dialog = dialog;
770
- this.changeNav = new EventEmitter();
771
- this.updateRouteList = new EventEmitter();
772
- this.pickupOptions = [];
773
- this.deliveryOptions = [];
774
- this.requestParmsForRouteDetails = { pickup_lat_lng: '', delivery_lat_lng: '' };
775
- this.customersList = [];
776
- this.unitsList = [];
777
- this.materialsList = [];
778
- this.preventSave = false;
779
- this.preventInitialSave = false;
780
- this.destroyer$ = new Subject();
781
- this.enablePopUp = false;
782
- this.prevantPopupClose = false;
783
- this.enableForm = false;
784
- this.formInit();
785
- this.utils.getrouteDetailsUtility.subscribe(res => {
786
- if (res) {
787
- if (res['event'] !== 'click' && !this.prevantPopupClose) {
788
- this.enablePopUp = res['event'];
789
- }
790
- else if (this.enablePopUp && !this.prevantPopupClose) {
791
- this.prevantPopupClose = true;
792
- }
793
- if (res['event'] !== 'click' && !res['event'] && this.prevantPopupClose) {
794
- this.popupDetails = this.utils.getdictValue('route-detailsv2');
795
- }
796
- else {
797
- this.popupDetails = res['route'];
798
- }
799
- if (this.enablePopUp)
800
- this.popupDetails['created_at'] = this.utils.getDateFormat(new Date(this.popupDetails['created_at']), '/');
801
- }
802
- });
803
- }
804
- filterCustomerList() {
805
- this.customersList$ = this.addRouteForm.controls['customer_name'].valueChanges.pipe(startWith(''), map(value => this._filter(value || '')));
806
- }
807
- _filter(value) {
808
- const filterValue = value.toLowerCase();
809
- return this.customersList.filter((option) => option['customer_name'].toLowerCase().includes(filterValue));
810
- }
811
- ngOnChanges(changes) {
812
- if (changes['routeData'] && !changes['routeData']['currentValue'])
813
- this.inIt(null);
814
- }
815
- openDialog() {
816
- const dialogRef = this.dialog.open(DialogComponent, {
817
- data: { body: 'Are you sure you want to delete this route?' },
818
- });
819
- dialogRef.afterClosed().subscribe(res => { if (res) {
820
- this.deleteRoute();
821
- } });
822
- }
823
- editEvent() {
824
- this.prevantPopupClose = false;
825
- this.enableForm = true;
826
- this.enablePopUp = false;
827
- this.popupDetails['prevent'] = false;
828
- this.utils.removeMapEntity.next(this.popupDetails);
829
- this.inIt(this.popupDetails);
830
- }
831
- inIt(changes) {
832
- if (changes) {
833
- if (!changes['prevent']) {
834
- this.preventSave = false;
835
- this.formControlValue();
836
- this.patchFormValue(changes);
837
- this.checkAndFetchRouteInformation(true);
838
- }
839
- }
840
- if (!changes) {
841
- this.enableForm = true;
842
- this.preventSave = true;
843
- this.patchFormValue();
844
- this.checkAndFetchRouteInformation();
845
- }
846
- }
847
- ngOnInit() {
848
- this.fetchCustomersList();
849
- this.fetchUnitsList();
850
- this.fetchMaterialsList();
851
- this.formControlValue();
852
- }
853
- ngAfterViewInit() {
854
- fromEvent(this.filterPickup.nativeElement, 'keyup').pipe(distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
855
- this.utils.fetchAutoCompleteLocations(this.filterPickup.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
856
- this.pickupOptions = res.features;
857
- });
858
- });
859
- fromEvent(this.filterDelivery.nativeElement, 'keyup').pipe(distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
860
- this.utils.fetchAutoCompleteLocations(this.filterDelivery.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
861
- this.deliveryOptions = res.features;
862
- });
863
- });
864
- }
865
- formControlValue() {
866
- var _a, _b;
867
- (_a = this.addRouteForm.controls['pickup_location']) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
868
- if (this.addRouteForm.value.pickup_location && res !== this.addRouteForm.value.pickup_location) {
869
- this.addRouteForm.patchValue({
870
- pickup_lat_lng: '',
871
- });
872
- this.addRouteForm.controls['pickup_lat_lng'].markAsTouched();
873
- }
874
- });
875
- (_b = this.addRouteForm.controls['delivery_location']) === null || _b === void 0 ? void 0 : _b.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
876
- if (this.addRouteForm.value.delivery_location && res !== this.addRouteForm.value.delivery_location) {
877
- this.addRouteForm.patchValue({
878
- delivery_lat_lng: '',
879
- });
880
- this.addRouteForm.controls['delivery_lat_lng'].markAsTouched();
881
- }
882
- });
883
- }
884
- formInit() {
885
- this.addRouteForm = new FormGroup({
886
- route_name: new FormControl('', [Validators.required]),
887
- customer_name: new FormControl({ value: '', disabled: true }, [Validators.required]),
888
- materials_id: new FormControl('', [Validators.required]),
889
- unit_id: new FormControl('', [Validators.required]),
890
- path: new FormControl('', [Validators.required]),
891
- pickup_location: new FormControl('', [Validators.required]),
892
- pickup_lat_lng: new FormControl('', [Validators.required]),
893
- delivery_location: new FormControl('', [Validators.required]),
894
- delivery_lat_lng: new FormControl('', [Validators.required]),
895
- estimated_distance: new FormControl('', [Validators.required]),
896
- estimated_time: new FormControl('', [Validators.required]),
897
- note: new FormControl('', [Validators.maxLength(2048)]),
898
- });
899
- }
900
- patchFormValue(data) {
901
- this.addRouteForm.reset();
902
- this.addRouteForm.patchValue(data);
903
- this.routeId = data === null || data === void 0 ? void 0 : data.route_id;
904
- this.routeDetails = data ? { pickup_location: data.pickup_location, delivery_location: data.delivery_location } : null;
905
- this.addRouteForm.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe(res => {
906
- if (res) {
907
- if (this.preventInitialSave)
908
- this.preventInitialSave = false;
909
- }
910
- });
911
- this.filterCustomerList();
912
- }
913
- fetchCustomersList() {
914
- this.utils.getData(`${this.portalName}/company/list/view`).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
915
- if (res) {
916
- this.customersList = res.data;
917
- this.filterCustomerList();
918
- this.addRouteForm.controls['customer_name'].enable();
919
- }
920
- });
921
- }
922
- fetchUnitsList() {
923
- this.utils.getData(`${this.portalName}/unit/list/view`).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
924
- if (res) {
925
- this.unitsList = res.data;
926
- }
927
- });
928
- }
929
- fetchMaterialsList() {
930
- this.utils.getData(`${this.portalName}/material/list/view`).pipe(takeUntil(this.destroyer$)).subscribe(((res) => {
931
- res.data.sort((a, b) => a.material.localeCompare(b.material));
932
- this.materialsList = res.data;
933
- }));
934
- }
935
- selectedLongLat(type, event) {
936
- if (type === 'pickup') {
937
- this.addRouteForm.patchValue({
938
- pickup_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
939
- });
940
- this.coolMapService.clearBoundWithCordinates();
941
- }
942
- else if (type === 'delivery') {
943
- this.addRouteForm.patchValue({
944
- delivery_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
945
- });
946
- }
947
- this.checkAndFetchRouteInformation();
948
- }
949
- checkAndFetchRouteInformation(isinitial) {
950
- var _a, _b, _c, _d;
951
- if (((_b = (_a = this.addRouteForm.value) === null || _a === void 0 ? void 0 : _a.delivery_lat_lng) === null || _b === void 0 ? void 0 : _b.length) > 0 && ((_d = (_c = this.addRouteForm.value) === null || _c === void 0 ? void 0 : _c.pickup_lat_lng) === null || _d === void 0 ? void 0 : _d.length) > 0 && this.addRouteForm.value.unit_id) {
952
- let unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
953
- const param = {
954
- delivery_lat_lng: this.addRouteForm.value.delivery_lat_lng,
955
- pickup_lat_lng: this.addRouteForm.value.pickup_lat_lng,
956
- unit: unit === null || unit === void 0 ? void 0 : unit.type
957
- };
958
- this.utils.postdata('coolmap/calculate/routes/estimation', param).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
959
- if (res && res['path']) {
960
- this.addRouteForm.patchValue({
961
- estimated_distance: res.dist, estimated_time: res.time, path: res.path
962
- });
963
- let path = res['path'].split(';');
964
- path = path.map((ele) => { return ele = this.formateLatLong(ele); });
965
- res['path'] = path;
966
- const element = {
967
- type: 'FeatureCollection',
968
- features: [{ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: res['path'] } }]
969
- };
970
- this.coolMapService.removeRouteAndMarker(1).then(() => {
971
- var _a, _b, _c;
972
- const unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
973
- const materialDetails = this.materialsList.find((x) => x.material_id === this.addRouteForm.value.materials_id);
974
- this.coolMapService.loadMapProperty(element, 1, unit === null || unit === void 0 ? void 0 : unit.type, {
975
- pickup_location: (_a = this.addRouteForm.get('pickup_location')) === null || _a === void 0 ? void 0 : _a.value,
976
- delivery_location: (_b = this.addRouteForm.get('delivery_location')) === null || _b === void 0 ? void 0 : _b.value,
977
- route_name: (_c = this.addRouteForm.get('route_name')) === null || _c === void 0 ? void 0 : _c.value,
978
- material: materialDetails === null || materialDetails === void 0 ? void 0 : materialDetails.material, unit: unit === null || unit === void 0 ? void 0 : unit.type
979
- }).then((res) => { this.preventSave = true; });
980
- });
981
- }
982
- else {
983
- this.coolMapService.removeRouteAndMarker(1);
984
- this.utils.openSnackBar(res['status'], 'error');
985
- }
986
- if (this.routeId && isinitial)
987
- this.preventInitialSave = true;
988
- });
989
- }
990
- else {
991
- this.coolMapService.removeRouteAndMarker(1);
992
- }
993
- }
994
- formateLatLong(latlong) { return latlong ? latlong.split(',').map(x => +x).reverse() : null; }
995
- saveRoute() {
996
- if (this.addRouteForm.valid) {
997
- this.preventSave = false;
998
- const data = this.addRouteForm.value;
999
- data['trucker_pay_estimate'] = null;
1000
- data['customer_price_estimate'] = null;
1001
- const url = this.routeId ? this.utils.postdata('coolmap/update/routes', data) : this.utils.postdata('coolmap/add/routes', data);
1002
- if (this.routeId)
1003
- data['id'] = this.routeId;
1004
- url.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1005
- if (res.success) {
1006
- this.updateRouteList.emit(true);
1007
- this.utils.openSnackBar(res.message, 'success');
1008
- this.preventInitialSave = true;
1009
- this.preventSave = true;
1010
- if (!this.routeId)
1011
- this.changeNav.next('Addroute');
1012
- }
1013
- else {
1014
- this.utils.openSnackBar(res.message, 'error');
1015
- this.preventSave = true;
1016
- }
1017
- }, (err) => { if (err) {
1018
- this.preventSave = true;
1019
- } });
1020
- }
1021
- else {
1022
- this.addRouteForm.markAllAsTouched();
1023
- }
1024
- }
1025
- deleteRoute() {
1026
- this.preventSave = false;
1027
- this.utils.postdata('coolmap/delete/routes', { uuid: this.routeId }).subscribe(res => {
1028
- if (res['data']['success']) {
1029
- this.utils.openSnackBar(res['data']['message'], 'success');
1030
- this.updateRouteList.emit(true);
1031
- this.changeNav.next('Addroute');
1032
- this.preventInitialSave = true;
1033
- this.preventSave = true;
1034
- }
1035
- else {
1036
- this.utils.openSnackBar('Somthing went wrong', 'error');
1037
- this.preventSave = true;
1038
- }
1039
- }, (err) => { this.preventSave = true; });
1040
- }
1041
- ngOnDestroy() {
1042
- this.destroyer$.next(true);
1043
- this.destroyer$.unsubscribe();
1044
- }
1045
- }
1046
- AddRouteComponent.decorators = [
1047
- { type: Component, args: [{
1048
- selector: 'app-add-route',
1049
- template: "<div class=\"addroutebox\">\r\n <div class=\"routedetailbox\" *ngIf=\"enablePopUp\">\r\n <div class=\"closebtnroutedetail\">\r\n <mat-icon (click)=\"prevantPopupClose = false; enablePopUp = false;\">clear</mat-icon>\r\n </div>\r\n <div class=\"destination\">\r\n <div class=\"duration\">\r\n <p class=\"pickprt\"><b>Pickup:</b>{{popupDetails['pickup_location']}}</p>\r\n <p class=\"dropprt\"><b>Delivery:</b>{{popupDetails['delivery_location']}}</p>\r\n </div>\r\n <span><b>Name:</b> {{popupDetails['route_name']}}</span>\r\n <span><b>Customer:</b> {{popupDetails['customer_name']}}</span>\r\n <span><b>Material:</b> {{popupDetails['material']}}</span>\r\n <span><b>Type:</b> {{popupDetails['unit']}}</span>\r\n <span><b>Distance:</b> {{popupDetails['estimated_distance']}}</span>\r\n <span><b>Travel Time:</b> {{popupDetails['estimated_time']}}</span>\r\n\r\n <span class=\"routenotes\"><b>Notes:</b> {{popupDetails['note']}}</span>\r\n </div>\r\n <div class=\"createTxt\">\r\n <small>\r\n Created by {{popupDetails['created_by_name']}} on {{popupDetails['created_at']}}\r\n </small>\r\n <button class=\"editbtn\" (click)=\"editEvent()\">Edit</button>\r\n </div>\r\n </div>\r\n <div class=\"add_add_route_box\" cdkDrag [style.visibility]=\"!enableForm ? 'hidden' : 'visible'\">\r\n <div class=\"topheadingprt\">\r\n <h2> {{routeId? 'EDIT' : 'ADD'}} ROUTE </h2>\r\n <div class=\"buttonprt\">\r\n <button *ngIf=\"routeId\" class=\"delbtn\" (click)=\"openDialog()\">Delete</button>\r\n <button mat-raised-button type=\"submit\" class=\"closebtn\" (click)=\"changeNav.next('Addroute')\">Close</button>\r\n </div>\r\n </div>\r\n <form [formGroup]=\"addRouteForm\">\r\n <div class=\"route_form_area\">\r\n <div class=\"col-6\">\r\n <mat-form-field>\r\n <mat-label>Route Name</mat-label>\r\n <input matInput formControlName=\"route_name\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\">\r\n <mat-error *ngIf=\"addRouteForm.controls['route_name'].hasError('required')\">\r\n Route Name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-6\">\r\n <mat-form-field>\r\n <input type=\"text\" placeholder=\"Customer Name\" matInput formControlName=\"customer_name\" [matAutocomplete]=\"auto\" (mousedown)=\"$event.stopPropagation()\">\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let customer of customersList$ | async\" [value]=\"customer['customer_name']\">\r\n {{customer['customer_name']}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"addRouteForm.controls['customer_name'].hasError('required')\">\r\n Customer name is required.\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-6\">\r\n <mat-form-field>\r\n <mat-label>Pickup</mat-label>\r\n <input type=\"text\" placeholder=\"Search...\" matInput #filterPickup [matAutocomplete]=\"pickupAutocomplete\"\r\n formControlName=\"pickup_location\" (mousedown)=\"$event.stopPropagation()\">\r\n\r\n <mat-autocomplete #pickupAutocomplete=\"matAutocomplete\">\r\n <mat-option (click)=\"selectedLongLat('pickup', option)\" *ngFor=\"let option of pickupOptions\"\r\n [value]=\"option?.place_name\">\r\n {{option?.place_name}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n <mat-error *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\r\n Please select pickup location from the list.\r\n </mat-error>\r\n </div>\r\n <div class=\"col-6\">\r\n <mat-form-field>\r\n <mat-label>Delivery</mat-label>\r\n <input type=\"text\" placeholder=\"Search...\" matInput #filterDelivery [matAutocomplete]=\"deliveryAutocomplete\"\r\n formControlName=\"delivery_location\" (mousedown)=\"$event.stopPropagation()\">\r\n <mat-autocomplete #deliveryAutocomplete=\"matAutocomplete\">\r\n <mat-option (click)=\"selectedLongLat('delivery', option)\" *ngFor=\"let option of deliveryOptions\"\r\n [value]=\"option?.place_name\">\r\n {{option?.place_name}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\r\n Please select delivery location from the list.\r\n </mat-error>\r\n </div>\r\n <div class=\"col-6\">\r\n <mat-form-field>\r\n <mat-label>Notes</mat-label>\r\n <textarea style=\"height: 18px; resize: none;\" matInput name=\"\" id=\"\" cols=\"30\" rows=\"10\" formControlName=\"note\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\"></textarea>\r\n <mat-error *ngIf=\"addRouteForm.controls['note'].hasError('maxlength')\">\r\n Notes should be within 2048 characters.\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"col-6 d-flex\">\r\n <div class=\"inputbox m-0\">\r\n <mat-form-field>\r\n <mat-label>Unit type</mat-label>\r\n <mat-select formControlName=\"unit_id\" (selectionChange)=\"checkAndFetchRouteInformation()\" (mousedown)=\"$event.stopPropagation()\">\r\n <mat-option *ngFor=\"let unit of unitsList\" [value]=\"unit?.id\"> {{unit?.type}} </mat-option>\r\n </mat-select>\r\n <mat-error *ngIf=\"addRouteForm.controls['unit_id'].hasError('required')\">\r\n Unit is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"inputbox m-0\">\r\n <mat-form-field>\r\n <mat-label>Material</mat-label>\r\n <mat-select formControlName=\"materials_id\" (mousedown)=\"$event.stopPropagation()\">\r\n <mat-option *ngFor=\"let material of materialsList\" [value]=\"material?.material_id\"> {{material?.material}}\r\n </mat-option>\r\n </mat-select>\r\n <mat-error *ngIf=\"addRouteForm.controls['materials_id'].hasError('required')\">\r\n Meterial is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <app-estimation-display *ngIf=\"addRouteForm?.value?.pickup_lat_lng && addRouteForm?.value?.delivery_lat_lng\" [value]=\"addRouteForm['value']\"></app-estimation-display>\r\n </div>\r\n <button mat-raised-button type=\"submit\" (click)=\"saveRoute()\" *ngIf=\"preventSave\"\r\n [disabled]=\"addRouteForm.invalid && preventSave || preventInitialSave\">{{routeId? 'Update' : 'Save'}}\r\n </button>\r\n <div class=\"loader\">\r\n <mat-spinner *ngIf=\"!preventSave\"></mat-spinner>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</div>\r\n",
1050
- styles: [".addroutebox{width:calc(100% - 315px);position:absolute;left:300px;bottom:10px;z-index:999;display:flex;justify-content:space-between;align-items:flex-start}.addroutebox .routedetailbox{max-width:300px;padding:10px;background-color:#fff;border-radius:20px;margin-right:20px}@media (min-width:1600px){.addroutebox .routedetailbox{max-width:280px}}.addroutebox .editbtn{background:#326ad3;padding:10px 25px;color:#fff;font-size:.8125rem;border-radius:30px;float:right}.add_add_route_box{background:#fff;padding:10px 20px;border-radius:20px;box-shadow:2px 4px 4px 2px rgba(0,0,0,.14);height:370px;width:100%;position:relative;cursor:move}.add_add_route_box .route_form_area{display:flex;flex-wrap:wrap;justify-content:space-between}.add_add_route_box .route_form_area .col-6{width:48%;margin-top:15px;justify-content:space-between}.add_add_route_box .route_form_area .col-6 .inputbox{width:47%}.add_add_route_box .route_form_area .col-6 span{font-size:.875rem}.add_add_route_box .route_form_area button{background:#326ad3;padding:0 18px;color:#fff;font-size:.8125rem;border-radius:30px;position:absolute;right:18px;top:20px}.closebtn{background:#000;padding:0 18px;margin-left:10px}.closebtn,.delbtn{color:#fff;border-radius:30px}.delbtn{background:red;padding:10px 18px}.add_route_listingpart .listing_toggle{background:#fff;border-radius:15px;padding:8px 10px;position:absolute;right:10px;top:30px;cursor:pointer}.listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px 0 hsla(0,0%,100%,.08);transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 40px;opacity:0}.listing_box .closebtn{display:none}.show .listing_box{width:250px;max-width:250px;flex:0 0 250px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}@media (min-width:1600px){.show .listing_box{width:320px;max-width:320px;flex:0 0 320px}}.show .listing_box h2{color:#fff;white-space:nowrap}.show .listing_box ul{padding:0 20px 0 0}.show .listing_box ul li{background:#4a4a4a;padding:15px;border-radius:15px;display:flex;margin-bottom:15px}.show .listing_box ul li .companayIcon{width:40px;height:40px;border-radius:10px;background:#fff;margin-right:10px;display:flex;justify-content:center;align-items:center}.show .listing_box ul li .company_cont{width:calc(100% - 50px)}.show .listing_box ul li .company_cont h3{color:#fff;font-size:15px;font-weight:400;margin:0;text-overflow:ellipsis;max-width:129px;-webkit-box-orient:vertical;white-space:nowrap;overflow:hidden}@media (min-width:1600px){.show .listing_box ul li .company_cont h3{max-width:170px}}.show .listing_box ul li .company_cont p{color:#bcbcbc;font-size:12px;margin:5px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:16px}.show .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px 0 hsla(0,0%,100%,.08);display:block}.loader{position:absolute;width:95%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.buttonprt{margin-right:83px}.destination .duration{padding:10px}.destination span{padding:5px 0}.closebtnroutedetail{box-shadow:0 0 5px 0 rgba(0,0,0,.11);border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}.routenotes{max-height:170px;overflow:auto}"]
1051
- },] }
1052
- ];
1053
- AddRouteComponent.ctorParameters = () => [
1054
- { type: CoolmapService },
1055
- { type: UtilsService },
1056
- { type: MatDialog }
1057
- ];
1058
- AddRouteComponent.propDecorators = {
1059
- filterPickup: [{ type: ViewChild, args: ['filterPickup',] }],
1060
- filterDelivery: [{ type: ViewChild, args: ['filterDelivery',] }],
1061
- changeNav: [{ type: Output }],
1062
- updateRouteList: [{ type: Output }],
1063
- routeData: [{ type: Input }],
1064
- portalName: [{ type: Input }]
1065
- };
1066
-
1067
- class AddRouteNavComponent {
1068
- constructor(utils) {
1069
- var _a;
1070
- this.utils = utils;
1071
- this.filterForm = new FormGroup({ search: new FormControl() });
1072
- this.filters = [];
1073
- this.loaderVal = false;
1074
- this.routes = [];
1075
- this.changeNav = new EventEmitter();
1076
- this.navValue = '';
1077
- this.addemit = new EventEmitter();
1078
- this.updateRouteList = false;
1079
- this.destroyer$ = new Subject();
1080
- this.preventListUpdate = false;
1081
- this.filteredOptions = (_a = this.filterForm.get('search')) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
1082
- }
1083
- showAddForm() { this.changeNav.emit('addForm'); this.addemit.emit(''); }
1084
- filterSearch(e) {
1085
- this.changeNav.emit({ type: 'Addroute' });
1086
- this.preventListUpdate = true;
1087
- this.filterForm.controls.search.setValue(null);
1088
- this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
1089
- }
1090
- removeFromFilter(filter) {
1091
- this.changeNav.emit({ type: 'Addroute' });
1092
- const index = this.filters.indexOf(filter);
1093
- if (index >= 0) {
1094
- this.filters = [];
1095
- }
1096
- }
1097
- ngAfterViewInit() { this.getRouteList(); }
1098
- ngOnChanges(changes) {
1099
- if (changes['updateRouteList'] && changes['updateRouteList']['currentValue'])
1100
- this.getRouteList();
1101
- if (changes['navValue'] && (changes['navValue']['previousValue'] === 'addForm') && !this.preventListUpdate)
1102
- this.getRouteList();
1103
- }
1104
- getRoute(event) { if (event['type'] === 'editroute') {
1105
- this.addemit.emit(event);
1106
- } }
1107
- getRouteList() {
1108
- this.utils.getData('coolmap/routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1109
- if (res) {
1110
- this.filters = [];
1111
- this.routes = res['data'];
1112
- this.preventListUpdate = false;
1113
- this.utils.clearOptions();
1114
- this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
1115
- }
1116
- });
1117
- }
1118
- resetSearch() { this.changeNav.emit('Addroute'); }
1119
- ngOnDestroy() {
1120
- this.destroyer$.next(true);
1121
- this.destroyer$.unsubscribe();
1122
- }
1123
- }
1124
- AddRouteNavComponent.decorators = [
1125
- { type: Component, args: [{
1126
- selector: 'app-add-route-nav',
1127
- template: "<div class=\"nav_body\">\r\n <div class=\"logo\">\r\n <img src=\"assets/images/logo.png\" alt=\"logo\" />\r\n </div>\r\n <div class=\"heading m-20\">\r\n <h1>View Route</h1>\r\n <button mat-raised-button color=\"primary\" (click)=\"showAddForm()\">\r\n <mat-icon>add_circle_outline</mat-icon> Add route\r\n </button>\r\n </div>\r\n\r\n <div class=\"search-panel\">\r\n <div class=\"w-100\">\r\n <form [formGroup]=\"filterForm\">\r\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\r\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\r\n [disabled]=\"loaderVal\" placeholder=\"Search\">\r\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\r\n (click)=\"filterForm.reset()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\r\n [value]=\"option\">\r\n {{option.type | titlecase }}: {{option['label']}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n <div class=\"chip-list\">\r\n <mat-chip-list #chipList aria-label=\"Filter selection\">\r\n <mat-chip *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\r\n {{filter.type | titlecase }}: {{filter.name}}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n </div>\r\n </div>\r\n <app-route-jobcode-list [type]=\"'addroute'\" [currentNav]=\"navValue\" [searchTerm]=\"filters\" [data]=\"routes\" [loader]=\"loaderVal\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\r\n</div>\r\n",
1128
- styles: [""]
1129
- },] }
1130
- ];
1131
- AddRouteNavComponent.ctorParameters = () => [
1132
- { type: UtilsService }
1133
- ];
1134
- AddRouteNavComponent.propDecorators = {
1135
- changeNav: [{ type: Output }],
1136
- navValue: [{ type: Input }],
1137
- addemit: [{ type: Output }],
1138
- updateRouteList: [{ type: Input }]
1139
- };
1140
-
1141
- class JobCodeNavComponent {
1142
- constructor(utils) {
1143
- this.utils = utils;
1144
- this.filterForm = new FormGroup({ search: new FormControl() });
1145
- this.listData = [];
1146
- this.loaderVal = false;
1147
- this.dateValue = new Date();
1148
- this.jobemit = new EventEmitter();
1149
- this.value = '';
1150
- this.filters = [];
1151
- this.clearJobDetails = new EventEmitter();
1152
- this.destroyer$ = new Subject();
1153
- utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
1154
- if (res) {
1155
- this.loaderVal = false;
1156
- }
1157
- else
1158
- this.loaderVal = true;
1159
- });
1160
- }
1161
- ngOnInit() { this.loadData(this.utils.getDateFormat(new Date())); }
1162
- loadData(value) {
1163
- var _a;
1164
- this.filteredOptions = (_a = this.filterForm.get('search')) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
1165
- this.utils.preventnavChange.next(false);
1166
- this.loaderVal = true;
1167
- this.utils.postdata('coolmap/jobs_report_v2', { date: value }).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1168
- if (typeof res['data'] !== 'string') {
1169
- if (res['data'].length > 0)
1170
- this.listData = res['data'].map((ele) => { ele['date'] = value; return ele; });
1171
- this.listData.forEach((ele) => { this.utils.makeOptions(ele); });
1172
- }
1173
- else
1174
- this.listData = [];
1175
- this.clearJobDetails.emit(true);
1176
- this.utils.clearViewRouteforJobCode.next(true);
1177
- this.filters = [];
1178
- if (typeof res['data'] === 'string')
1179
- this.utils.preventnavChange.next(true);
1180
- }, (err) => { if (err)
1181
- this.utils.preventnavChange.next(true); });
1182
- }
1183
- getRoute(job) { if (job['type'] === 'jobcode') {
1184
- this.jobemit.emit(job);
1185
- } }
1186
- getDate(ev) { this.loadData(this.utils.getDateFormat(ev.value)); }
1187
- filterSearch(e) {
1188
- this.filterForm.controls.search.setValue(null);
1189
- this.filterForm.controls.search.updateValueAndValidity();
1190
- this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
1191
- }
1192
- removeFromFilter(filter) {
1193
- const index = this.filters.indexOf(filter);
1194
- if (index >= 0) {
1195
- this.filters = [];
1196
- }
1197
- }
1198
- ngOnDestroy() {
1199
- this.destroyer$.next(true);
1200
- this.destroyer$.unsubscribe();
1201
- }
1202
- }
1203
- JobCodeNavComponent.decorators = [
1204
- { type: Component, args: [{
1205
- selector: 'app-job-code-nav',
1206
- template: "<div class=\"nav_body\">\r\n <div class=\"search-panel\">\r\n <div class=\"datepicker\">\r\n <mat-form-field>\r\n <mat-label>Choose a date</mat-label>\r\n <input readonly matInput (click)=\"picker.open()\" [disabled]=\"loaderVal\" [(ngModel)]=\"dateValue\" [matDatepicker]=\"picker\" (dateChange)=\"getDate($event)\">\r\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-datepicker #picker></mat-datepicker>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"search\">\r\n <form [formGroup]=\"filterForm\">\r\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\r\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\r\n [disabled]=\"loaderVal\" placeholder=\"Search\">\r\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\r\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\" (click)=\"filterForm.reset()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\r\n [value]=\"option\">\r\n {{option.type | titlecase }}: {{option['label']}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </form>\r\n\r\n </div>\r\n\r\n <div class=\"chip-list\">\r\n <mat-chip-list #chipList aria-label=\"Filter selection\">\r\n <mat-chip *ngFor=\"let filter of filters\" (removed)=\"removeFromFilter(filter)\">\r\n {{filter.type | titlecase }}: {{filter.name}}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n </div>\r\n <app-route-jobcode-list [type]=\"'jobcode'\" [searchTerm]=\"filters\" [data]=\"listData\" [loader]=\"loaderVal\" (clearJobDetailsFromList)=\"clearJobDetails.emit(true)\" (showAllRoute)=\"filters = []; clearJobDetails.emit(true)\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\r\n</div>\r\n",
1207
- styles: [".search-panel .datepicker,.search-panel .search{width:47%}"]
1208
- },] }
1209
- ];
1210
- JobCodeNavComponent.ctorParameters = () => [
1211
- { type: UtilsService }
1212
- ];
1213
- JobCodeNavComponent.propDecorators = {
1214
- jobemit: [{ type: Output }],
1215
- clearJobDetails: [{ type: Output }]
1216
- };
1217
-
1218
- class EstimationDisplayComponent {
1219
- constructor() {
1220
- this.label = EstinationData;
1221
- this.Estinationlabel = EstinationEnum;
1222
- }
1223
- }
1224
- EstimationDisplayComponent.decorators = [
1225
- { type: Component, args: [{
1226
- selector: 'app-estimation-display',
1227
- template: "<div class=\"d-flex\">\r\n <ng-container *ngFor=\"let item of label\">\r\n <span *ngIf=\"value[item]\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\r\n Estimation of {{Estinationlabel[item]}} - <b>{{value[item]}}</b>\r\n </span>\r\n </ng-container>\r\n</div>\r\n",
1228
- styles: [".estimate{margin-right:20px;font-size:.7rem}@media (min-width:1600px){.estimate{font-size:.95rem}}"]
1229
- },] }
1230
- ];
1231
- EstimationDisplayComponent.ctorParameters = () => [];
1232
- EstimationDisplayComponent.propDecorators = {
1233
- value: [{ type: Input }]
1234
- };
1235
-
1236
- class CoolmapModule {
1237
- }
1238
- CoolmapModule.decorators = [
1239
- { type: NgModule, args: [{
1240
- declarations: [
1241
- CoolmapComponent,
1242
- MapComponent,
1243
- NavComponent,
1244
- AddRouteNavComponent,
1245
- JobCodeNavComponent,
1246
- RouteJobCodeListComponent,
1247
- ViewRouteListCardComponent,
1248
- SmsCardDetailsOverviewComponent,
1249
- JobCodeListCardComponent,
1250
- JobCodeComponent,
1251
- JobRouteListComponent,
1252
- JobcodeStatusComponent,
1253
- JobcodeOverviewComponent,
1254
- DialogComponent,
1255
- AddRouteComponent,
1256
- EstimationDisplayComponent
1257
- ],
1258
- imports: [
1259
- CommonModule,
1260
- MatSnackBarModule,
1261
- MatSidenavModule,
1262
- DragDropModule,
1263
- FormsModule,
1264
- MatInputModule,
1265
- MatSelectModule,
1266
- MatIconModule,
1267
- ReactiveFormsModule,
1268
- MatAutocompleteModule,
1269
- MatFormFieldModule,
1270
- MatProgressSpinnerModule,
1271
- MatChipsModule,
1272
- MatDialogModule,
1273
- MatTooltipModule,
1274
- MatDatepickerModule,
1275
- MatNativeDateModule,
1276
- PerfectScrollbarModule,
1277
- MatPseudoCheckboxModule,
1278
- MatButtonModule,
1279
- MatProgressBarModule,
1280
- ],
1281
- exports: [
1282
- CoolmapComponent,
1283
- MapComponent,
1284
- NavComponent,
1285
- AddRouteNavComponent,
1286
- JobCodeNavComponent,
1287
- RouteJobCodeListComponent,
1288
- ViewRouteListCardComponent,
1289
- SmsCardDetailsOverviewComponent,
1290
- JobCodeListCardComponent,
1291
- JobCodeComponent,
1292
- JobRouteListComponent,
1293
- JobcodeStatusComponent,
1294
- JobcodeOverviewComponent,
1295
- DialogComponent,
1296
- AddRouteComponent,
1297
- EstimationDisplayComponent
1298
- ],
1299
- entryComponents: [
1300
- DialogComponent,
1301
- JobCodeComponent,
1302
- AddRouteComponent
1303
- ],
1304
- providers: []
1305
- },] }
1306
- ];
1307
-
1308
- /*
1309
- * Public API Surface of coolmap
1310
- */
1311
-
1312
- /**
1313
- * Generated bundle index. Do not edit.
1314
- */
1315
-
1316
- export { AddRouteComponent, AddRouteNavComponent, CoolmapComponent, CoolmapModule, DialogComponent, JobCodeComponent, JobCodeListCardComponent, JobCodeNavComponent, JobRouteListComponent, JobcodeOverviewComponent, JobcodeStatusComponent, MapComponent, NavComponent, RouteJobCodeListComponent, SmsCardDetailsOverviewComponent, ViewRouteListCardComponent, EstimationDisplayComponent as ɵa };
1317
- //# sourceMappingURL=coolmap.js.map