@djb25/digit-ui-module-wt 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +534 -328
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer,
|
|
1
|
+
import { TickMark, ArrowDown, MobileNumber, CardLabelError, TextInput, Dropdown, DatePicker, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, KeyNote, Modal, CardHeader, CardText, FormStep, CardLabel, RadioButtons, UploadFile, TextArea, CheckBox, CardSubHeader, StatusTable, Row, GenericFileIcon, LinkButton, EditIcon, Banner, CHBIcon, EmployeeModuleCard, CloseSvg, Label, LinkLabel, ActionBar, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, CustomNameDropdown, MultiSelectDropdown, LabelFieldPair, AddIcon, Menu, Header, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, MultiLink, Localities, RemoveableTag, FormComposer, PDFSvg, MultiUploadWrapper, Close as Close$g, BreakLine, InfoBannerIcon, ViewsIcon, ButtonSelector, LocationIcon, CitizenHomeCard, PTIcon, ApplicantDetails, AddressDetails } from '@djb25/digit-ui-react-components';
|
|
2
2
|
import React, { useState, useMemo, useCallback, useEffect, Fragment, useRef } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useLocation, useHistory, useRouteMatch, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
|
|
@@ -795,25 +795,25 @@ const WTSearchApplication = ({
|
|
|
795
795
|
code: "TREE_PRUNING_SERVICE_COMPLETED",
|
|
796
796
|
value: t("TP_TREE_PRUNING_SERVICE_COMPLETED")
|
|
797
797
|
}] : [{
|
|
798
|
-
i18nKey: "
|
|
798
|
+
i18nKey: "WT_BOOKING_CREATED",
|
|
799
799
|
code: "BOOKING_CREATED",
|
|
800
800
|
value: t("WT_BOOKING_CREATED")
|
|
801
801
|
}, {
|
|
802
|
-
i18nKey: "
|
|
803
|
-
code: "
|
|
804
|
-
value: t("
|
|
802
|
+
i18nKey: "WT_VENDOR_ASSIGNED",
|
|
803
|
+
code: "VENDOR_ASSIGNED",
|
|
804
|
+
value: t("WT_VENDOR_ASSIGNED")
|
|
805
805
|
}, {
|
|
806
|
-
i18nKey: "
|
|
807
|
-
code: "
|
|
808
|
-
value: t("
|
|
806
|
+
i18nKey: "WT_DELIVERY_PENDING",
|
|
807
|
+
code: "DELIVERY_PENDING",
|
|
808
|
+
value: t("WT_DELIVERY_PENDING")
|
|
809
809
|
}, {
|
|
810
|
-
i18nKey: "
|
|
811
|
-
code: "
|
|
812
|
-
value: t("
|
|
810
|
+
i18nKey: "WT_DELIVERED",
|
|
811
|
+
code: "DELIVERED",
|
|
812
|
+
value: t("WT_DELIVERED")
|
|
813
813
|
}, {
|
|
814
|
-
i18nKey: "
|
|
815
|
-
code: "
|
|
816
|
-
value: t("
|
|
814
|
+
i18nKey: "WT_REQUEST_REJECTED",
|
|
815
|
+
code: "REQUEST_REJECTED",
|
|
816
|
+
value: t("WT_REQUEST_REJECTED")
|
|
817
817
|
}];
|
|
818
818
|
const onSort = useCallback(args => {
|
|
819
819
|
if (args.length === 0) return;
|
|
@@ -1128,6 +1128,10 @@ const SearchApp = ({
|
|
|
1128
1128
|
|
|
1129
1129
|
const App = () => {
|
|
1130
1130
|
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi;
|
|
1131
|
+
const {
|
|
1132
|
+
t
|
|
1133
|
+
} = useTranslation();
|
|
1134
|
+
const location = useLocation();
|
|
1131
1135
|
const {
|
|
1132
1136
|
path,
|
|
1133
1137
|
url,
|
|
@@ -1142,6 +1146,52 @@ const App = () => {
|
|
|
1142
1146
|
const WTCard = Digit.ComponentRegistryService.getComponent("WTCitizenCard");
|
|
1143
1147
|
const MTCard = Digit.ComponentRegistryService.getComponent("MTCitizenCard");
|
|
1144
1148
|
const ApplicationDetails = (_Digit6 = Digit) === null || _Digit6 === void 0 ? void 0 : (_Digit6$ComponentRegi = _Digit6.ComponentRegistryService) === null || _Digit6$ComponentRegi === void 0 ? void 0 : _Digit6$ComponentRegi.getComponent("ApplicationDetails");
|
|
1149
|
+
const getDynamicBreadcrumbs = () => {
|
|
1150
|
+
const pathname = location.pathname;
|
|
1151
|
+
if (pathname.includes("/mt/")) ;
|
|
1152
|
+
if (pathname.includes("/tp/")) ;
|
|
1153
|
+
let crumbs = [{
|
|
1154
|
+
icon: HomeIcon,
|
|
1155
|
+
path: "/digit-ui/citizen"
|
|
1156
|
+
}, {
|
|
1157
|
+
label: t("WT_MODULE_NAME"),
|
|
1158
|
+
path: `${path}/wt-Vendor`
|
|
1159
|
+
}];
|
|
1160
|
+
if (pathname.includes("/inbox")) {
|
|
1161
|
+
let label = "ES_COMMON_INBOX";
|
|
1162
|
+
if (pathname.includes("/mt/inbox")) {
|
|
1163
|
+
crumbs = [{
|
|
1164
|
+
icon: HomeIcon,
|
|
1165
|
+
path: "/digit-ui/citizen"
|
|
1166
|
+
}, {
|
|
1167
|
+
label: t("ACTION_TEST_MT"),
|
|
1168
|
+
path: `${path}/mt-Vendor`
|
|
1169
|
+
}];
|
|
1170
|
+
}
|
|
1171
|
+
crumbs.push({
|
|
1172
|
+
label: t(label)
|
|
1173
|
+
});
|
|
1174
|
+
} else if (pathname.includes("/my-bookings")) {
|
|
1175
|
+
let label = "WT_SEARCH_BOOKINGS";
|
|
1176
|
+
if (pathname.includes("/mt/my-bookings")) label = "MT_SEARCH_BOOKINGS";
|
|
1177
|
+
crumbs.push({
|
|
1178
|
+
label: t(label)
|
|
1179
|
+
});
|
|
1180
|
+
} else if (pathname.includes("/status")) {
|
|
1181
|
+
crumbs.push({
|
|
1182
|
+
label: t("WT_MY_APPLICATIONS")
|
|
1183
|
+
});
|
|
1184
|
+
} else if (pathname.includes("/booking/") || pathname.includes("/booking-details") || pathname.includes("/bookingsearch/booking-details")) {
|
|
1185
|
+
crumbs.push({
|
|
1186
|
+
label: t("ES_COMMON_INBOX"),
|
|
1187
|
+
path: pathname.includes("/mt/") ? `${path}/mt/inbox` : `${path}/inbox`
|
|
1188
|
+
});
|
|
1189
|
+
crumbs.push({
|
|
1190
|
+
label: t("WT_BOOKING_DETAILS")
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
return crumbs;
|
|
1194
|
+
};
|
|
1145
1195
|
const getInboxInitialState = service => ({
|
|
1146
1196
|
searchParams: {
|
|
1147
1197
|
uuid: {
|
|
@@ -1159,7 +1209,17 @@ const App = () => {
|
|
|
1159
1209
|
style: {
|
|
1160
1210
|
width: "100%"
|
|
1161
1211
|
}
|
|
1162
|
-
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(
|
|
1212
|
+
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
|
|
1213
|
+
className: "ground-container employee-app-container form-container"
|
|
1214
|
+
}, /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
1215
|
+
leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
|
|
1216
|
+
className: "icon"
|
|
1217
|
+
}), t("CS_COMMON_BACK")),
|
|
1218
|
+
onLeftClick: () => window.history.back(),
|
|
1219
|
+
breadcrumbs: getDynamicBreadcrumbs()
|
|
1220
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1221
|
+
className: "employee-form-content"
|
|
1222
|
+
}, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
1163
1223
|
path: `${path}/inbox`,
|
|
1164
1224
|
component: () => /*#__PURE__*/React.createElement(Inbox, {
|
|
1165
1225
|
useNewInboxAPI: true,
|
|
@@ -1244,7 +1304,7 @@ const App = () => {
|
|
|
1244
1304
|
parentRoute: path,
|
|
1245
1305
|
moduleCode: "MT"
|
|
1246
1306
|
}))
|
|
1247
|
-
}))));
|
|
1307
|
+
}))))));
|
|
1248
1308
|
};
|
|
1249
1309
|
|
|
1250
1310
|
const ExistingBookingDetails = ({
|
|
@@ -2291,6 +2351,9 @@ const WTCard = () => {
|
|
|
2291
2351
|
}, {
|
|
2292
2352
|
label: t("WT_SEARCH_FIX_POINT"),
|
|
2293
2353
|
link: `${APPLICATION_PATH}/employee/wt/search-filling-fix-point`
|
|
2354
|
+
}, {
|
|
2355
|
+
label: t("Vendor_Assign"),
|
|
2356
|
+
link: `${APPLICATION_PATH}/employee/wt/vendor-assignment`
|
|
2294
2357
|
}];
|
|
2295
2358
|
const WT_CEMP = Digit.UserService.hasAccess(["WT_CEMP"]) || false;
|
|
2296
2359
|
const propsForModuleCard = {
|
|
@@ -2373,7 +2436,7 @@ const InboxLinks = ({
|
|
|
2373
2436
|
className: "filter inboxLinks"
|
|
2374
2437
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2375
2438
|
className: "complaint-links-container"
|
|
2376
|
-
}, GetLogo(), /*#__PURE__*/React.createElement("div", {
|
|
2439
|
+
}, Digit.UserService.getUser().info.type !== "CITIZEN" && GetLogo(), /*#__PURE__*/React.createElement("div", {
|
|
2377
2440
|
className: "body"
|
|
2378
2441
|
}, links.map(({
|
|
2379
2442
|
link,
|
|
@@ -3137,10 +3200,36 @@ const AddTripModal = ({
|
|
|
3137
3200
|
control,
|
|
3138
3201
|
formState: {
|
|
3139
3202
|
errors
|
|
3140
|
-
}
|
|
3203
|
+
},
|
|
3204
|
+
watch,
|
|
3205
|
+
setValue
|
|
3141
3206
|
} = useForm({
|
|
3142
3207
|
defaultValues: initialValues || {}
|
|
3143
3208
|
});
|
|
3209
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3210
|
+
const {
|
|
3211
|
+
isLoading: isFixedPointLoading,
|
|
3212
|
+
data: fixedPointsData
|
|
3213
|
+
} = Digit.Hooks.wt.useFixedPointSearchAPI({
|
|
3214
|
+
tenantId,
|
|
3215
|
+
filters: {
|
|
3216
|
+
limit: 1000
|
|
3217
|
+
}
|
|
3218
|
+
});
|
|
3219
|
+
const fixedPoints = (fixedPointsData === null || fixedPointsData === void 0 ? void 0 : fixedPointsData.waterTankerBookingDetail) || [];
|
|
3220
|
+
const fixedPointOptions = fixedPoints.map(fp => {
|
|
3221
|
+
var _fp$applicantDetail, _fp$applicantDetail2, _fp$address, _fp$applicantDetail3, _fp$applicantDetail4, _fp$address2, _fp$address3, _fp$address4, _fp$address5, _fp$address6;
|
|
3222
|
+
return {
|
|
3223
|
+
name: (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail = fp.applicantDetail) === null || _fp$applicantDetail === void 0 ? void 0 : _fp$applicantDetail.name) || "NA",
|
|
3224
|
+
mobileNumber: (fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail2 = fp.applicantDetail) === null || _fp$applicantDetail2 === void 0 ? void 0 : _fp$applicantDetail2.mobileNumber) || "NA",
|
|
3225
|
+
locality: (fp === null || fp === void 0 ? void 0 : (_fp$address = fp.address) === null || _fp$address === void 0 ? void 0 : _fp$address.locality) || "NA",
|
|
3226
|
+
displayLabel: `${(fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail3 = fp.applicantDetail) === null || _fp$applicantDetail3 === void 0 ? void 0 : _fp$applicantDetail3.name) || "NA"} | ${(fp === null || fp === void 0 ? void 0 : (_fp$applicantDetail4 = fp.applicantDetail) === null || _fp$applicantDetail4 === void 0 ? void 0 : _fp$applicantDetail4.mobileNumber) || "NA"} | ${(fp === null || fp === void 0 ? void 0 : (_fp$address2 = fp.address) === null || _fp$address2 === void 0 ? void 0 : _fp$address2.locality) || "NA"}`,
|
|
3227
|
+
value: fp.bookingId,
|
|
3228
|
+
fullAddress: [(fp === null || fp === void 0 ? void 0 : (_fp$address3 = fp.address) === null || _fp$address3 === void 0 ? void 0 : _fp$address3.houseNo) && `${t("WT_HOUSE_NO")} = ${fp.address.houseNo}`, (fp === null || fp === void 0 ? void 0 : (_fp$address4 = fp.address) === null || _fp$address4 === void 0 ? void 0 : _fp$address4.streetName) && `${t("WT_STREET_NAME")} = ${fp.address.streetName}`, (fp === null || fp === void 0 ? void 0 : (_fp$address5 = fp.address) === null || _fp$address5 === void 0 ? void 0 : _fp$address5.landmark) && `${t("WT_LANDMARK")} = ${fp.address.landmark}`, (fp === null || fp === void 0 ? void 0 : (_fp$address6 = fp.address) === null || _fp$address6 === void 0 ? void 0 : _fp$address6.locality) && `${t("WT_LOCALITY")} = ${fp.address.locality}`].filter(Boolean).join(", ")
|
|
3229
|
+
};
|
|
3230
|
+
});
|
|
3231
|
+
const selectedFixedPointCode = watch("fixedPointCode");
|
|
3232
|
+
const selectedFixedPoint = fixedPointOptions.find(opt => opt.value === selectedFixedPointCode);
|
|
3144
3233
|
const dayOptions = [{
|
|
3145
3234
|
label: t("MONDAY"),
|
|
3146
3235
|
value: "MONDAY"
|
|
@@ -3185,21 +3274,66 @@ const AddTripModal = ({
|
|
|
3185
3274
|
display: "flex",
|
|
3186
3275
|
justifyContent: "center",
|
|
3187
3276
|
alignItems: "center",
|
|
3188
|
-
zIndex:
|
|
3189
|
-
}
|
|
3190
|
-
}, /*#__PURE__*/React.createElement("
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3277
|
+
zIndex: 200000
|
|
3278
|
+
}
|
|
3279
|
+
}, /*#__PURE__*/React.createElement("style", null, `
|
|
3280
|
+
.custom-modal-content {
|
|
3281
|
+
background-color: #fff;
|
|
3282
|
+
border-radius: 8px;
|
|
3283
|
+
width: 70%;
|
|
3284
|
+
max-width: 800px;
|
|
3285
|
+
max-height: 90vh;
|
|
3286
|
+
display: flex;
|
|
3287
|
+
flex-direction: column;
|
|
3288
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
3289
|
+
position: relative;
|
|
3290
|
+
}
|
|
3291
|
+
.add-trip-form {
|
|
3292
|
+
display: grid;
|
|
3293
|
+
grid-template-columns: repeat(2, 1fr);
|
|
3294
|
+
gap: 20px;
|
|
3295
|
+
}
|
|
3296
|
+
@media (max-width: 768px) {
|
|
3297
|
+
.custom-modal-content {
|
|
3298
|
+
width: 90%;
|
|
3299
|
+
max-height: 85vh;
|
|
3300
|
+
}
|
|
3301
|
+
.add-trip-form {
|
|
3302
|
+
grid-template-columns: 1fr;
|
|
3303
|
+
gap: 15px;
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
@media (max-width: 480px) {
|
|
3307
|
+
.custom-modal-content {
|
|
3308
|
+
width: 95%;
|
|
3309
|
+
max-height: 95vh;
|
|
3310
|
+
}
|
|
3311
|
+
.custom-modal-body {
|
|
3312
|
+
padding: 15px !important;
|
|
3313
|
+
}
|
|
3314
|
+
.custom-modal-footer {
|
|
3315
|
+
padding: 12px 15px !important;
|
|
3316
|
+
flex-direction: row;
|
|
3317
|
+
justify-content: flex-end;
|
|
3318
|
+
}
|
|
3319
|
+
.custom-modal-header {
|
|
3320
|
+
padding: 12px 15px !important;
|
|
3321
|
+
}
|
|
3322
|
+
.custom-modal-header h1 {
|
|
3323
|
+
font-size: 18px !important;
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
@media (max-width: 320px) {
|
|
3327
|
+
.custom-modal-footer {
|
|
3328
|
+
flex-direction: column-reverse;
|
|
3329
|
+
align-items: stretch;
|
|
3330
|
+
}
|
|
3331
|
+
.custom-modal-footer button {
|
|
3332
|
+
width: 100%;
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
`), /*#__PURE__*/React.createElement("div", {
|
|
3336
|
+
className: "custom-modal-content"
|
|
3203
3337
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3204
3338
|
className: "custom-modal-header",
|
|
3205
3339
|
style: {
|
|
@@ -3232,12 +3366,7 @@ const AddTripModal = ({
|
|
|
3232
3366
|
overflowY: "auto"
|
|
3233
3367
|
}
|
|
3234
3368
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3235
|
-
className: "add-trip-form"
|
|
3236
|
-
style: {
|
|
3237
|
-
display: "grid",
|
|
3238
|
-
gridTemplateColumns: "repeat(3, 1fr)",
|
|
3239
|
-
gap: "20px"
|
|
3240
|
-
}
|
|
3369
|
+
className: "add-trip-form"
|
|
3241
3370
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3242
3371
|
className: "field-group"
|
|
3243
3372
|
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
@@ -3245,10 +3374,32 @@ const AddTripModal = ({
|
|
|
3245
3374
|
marginBottom: "8px",
|
|
3246
3375
|
fontWeight: "500"
|
|
3247
3376
|
}
|
|
3248
|
-
}, t("WT_FIXED_POINT_CODE")), /*#__PURE__*/React.createElement(
|
|
3377
|
+
}, t("WT_FIXED_POINT_CODE")), isFixedPointLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Controller, {
|
|
3378
|
+
control: control,
|
|
3249
3379
|
name: "fixedPointCode",
|
|
3250
|
-
|
|
3251
|
-
|
|
3380
|
+
render: props => /*#__PURE__*/React.createElement(CustomNameDropdown, {
|
|
3381
|
+
option: fixedPointOptions,
|
|
3382
|
+
optionKey: "displayLabel",
|
|
3383
|
+
selected: fixedPointOptions.find(opt => opt.value === props.value),
|
|
3384
|
+
select: val => props.onChange(val.value),
|
|
3385
|
+
t: t,
|
|
3386
|
+
optionsHeader: {
|
|
3387
|
+
name: "WT_NAME",
|
|
3388
|
+
mobileNumber: "WT_MOBILE_NUMBER",
|
|
3389
|
+
locality: "WT_LOCALITY"
|
|
3390
|
+
}
|
|
3391
|
+
})
|
|
3392
|
+
}), selectedFixedPoint && /*#__PURE__*/React.createElement("div", {
|
|
3393
|
+
style: {
|
|
3394
|
+
marginTop: "8px",
|
|
3395
|
+
padding: "10px",
|
|
3396
|
+
backgroundColor: "#f9f9f9",
|
|
3397
|
+
border: "1px solid #ddd",
|
|
3398
|
+
borderRadius: "4px",
|
|
3399
|
+
fontSize: "14px",
|
|
3400
|
+
color: "#555"
|
|
3401
|
+
}
|
|
3402
|
+
}, /*#__PURE__*/React.createElement("strong", null, t("WT_ADDRESS"), ":"), " ", selectedFixedPoint.fullAddress)), /*#__PURE__*/React.createElement("div", {
|
|
3252
3403
|
className: "field-group"
|
|
3253
3404
|
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3254
3405
|
style: {
|
|
@@ -3258,12 +3409,14 @@ const AddTripModal = ({
|
|
|
3258
3409
|
}, t("WT_DAY")), /*#__PURE__*/React.createElement(Controller, {
|
|
3259
3410
|
control: control,
|
|
3260
3411
|
name: "day",
|
|
3261
|
-
render: props => /*#__PURE__*/React.createElement(
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
selected: props.value,
|
|
3265
|
-
|
|
3266
|
-
t: t
|
|
3412
|
+
render: props => /*#__PURE__*/React.createElement(MultiSelectDropdown, {
|
|
3413
|
+
options: dayOptions,
|
|
3414
|
+
optionsKey: "label",
|
|
3415
|
+
selected: dayOptions.filter(opt => (props.value || []).some(v => v === opt.value || (v === null || v === void 0 ? void 0 : v.value) === opt.value)),
|
|
3416
|
+
onSelect: val => props.onChange(val.map(v => Array.isArray(v) ? v[1] : (v === null || v === void 0 ? void 0 : v.value) || v)),
|
|
3417
|
+
t: t,
|
|
3418
|
+
defaultLabel: t("WT_SELECT_DAYS"),
|
|
3419
|
+
defaultUnit: t("WT_DAYS")
|
|
3267
3420
|
})
|
|
3268
3421
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3269
3422
|
className: "field-group"
|
|
@@ -3282,16 +3435,6 @@ const AddTripModal = ({
|
|
|
3282
3435
|
marginBottom: "8px",
|
|
3283
3436
|
fontWeight: "500"
|
|
3284
3437
|
}
|
|
3285
|
-
}, t("WT_VEHICLE_ID")), /*#__PURE__*/React.createElement(TextInput, {
|
|
3286
|
-
name: "vehicleId",
|
|
3287
|
-
inputRef: register()
|
|
3288
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
3289
|
-
className: "field-group"
|
|
3290
|
-
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3291
|
-
style: {
|
|
3292
|
-
marginBottom: "8px",
|
|
3293
|
-
fontWeight: "500"
|
|
3294
|
-
}
|
|
3295
3438
|
}, t("WT_ARRIVAL_TIME_TO_FPL")), /*#__PURE__*/React.createElement(TextInput, {
|
|
3296
3439
|
name: "arrivalTimeFpl",
|
|
3297
3440
|
inputRef: register(),
|
|
@@ -3368,7 +3511,7 @@ const AddTripModal = ({
|
|
|
3368
3511
|
t: t
|
|
3369
3512
|
})
|
|
3370
3513
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3371
|
-
className: "field-group",
|
|
3514
|
+
className: "field-group remarks-field-group",
|
|
3372
3515
|
style: {
|
|
3373
3516
|
gridColumn: "span 2"
|
|
3374
3517
|
}
|
|
@@ -3413,33 +3556,35 @@ const AddTripModal = ({
|
|
|
3413
3556
|
}, initialValues ? t("WT_UPDATE") : t("CS_COMMON_SAVE")))));
|
|
3414
3557
|
};
|
|
3415
3558
|
|
|
3416
|
-
const FixedPointScheduleManagement = (
|
|
3559
|
+
const FixedPointScheduleManagement = ({
|
|
3560
|
+
...props
|
|
3561
|
+
}) => {
|
|
3417
3562
|
const {
|
|
3418
3563
|
t
|
|
3419
3564
|
} = useTranslation();
|
|
3420
3565
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3421
3566
|
const [showModal, setShowModal] = useState(false);
|
|
3422
3567
|
const [toast, setToast] = useState(null);
|
|
3423
|
-
const [selectedDay, setSelectedDay] = useState("
|
|
3568
|
+
const [selectedDay, setSelectedDay] = useState("all");
|
|
3424
3569
|
const [year, setYear] = useState({
|
|
3425
3570
|
label: "Year 2026",
|
|
3426
3571
|
value: "2026"
|
|
3427
3572
|
});
|
|
3428
3573
|
const [fixedPoint, setFixedPoint] = useState({
|
|
3429
|
-
label: "
|
|
3430
|
-
value: "
|
|
3574
|
+
label: "All Fixed Points",
|
|
3575
|
+
value: "all"
|
|
3431
3576
|
});
|
|
3432
3577
|
const [day, setDay] = useState({
|
|
3433
|
-
label: "
|
|
3434
|
-
value: "
|
|
3578
|
+
label: "All Days",
|
|
3579
|
+
value: "all"
|
|
3435
3580
|
});
|
|
3436
3581
|
const [status, setStatus] = useState({
|
|
3437
3582
|
label: "All Status",
|
|
3438
3583
|
value: "all"
|
|
3439
3584
|
});
|
|
3440
3585
|
const [vehicle, setVehicle] = useState({
|
|
3441
|
-
label: "
|
|
3442
|
-
value: "
|
|
3586
|
+
label: "All Vehicles",
|
|
3587
|
+
value: "all"
|
|
3443
3588
|
});
|
|
3444
3589
|
const [editingRowIndex, setEditingRowIndex] = useState(null);
|
|
3445
3590
|
const [filters, setFilters] = useState({});
|
|
@@ -3508,9 +3653,9 @@ const FixedPointScheduleManagement = () => {
|
|
|
3508
3653
|
setData(mappedData);
|
|
3509
3654
|
}
|
|
3510
3655
|
}, [scheduleData]);
|
|
3511
|
-
const handleSearch = () => {
|
|
3656
|
+
const handleSearch = (customFilters = null) => {
|
|
3512
3657
|
var _day$value;
|
|
3513
|
-
setFilters({
|
|
3658
|
+
setFilters(customFilters || {
|
|
3514
3659
|
fixedPointCode: (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value) === "all" ? "" : fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value,
|
|
3515
3660
|
day: (day === null || day === void 0 ? void 0 : day.value) === "all" ? "" : day === null || day === void 0 ? void 0 : (_day$value = day.value) === null || _day$value === void 0 ? void 0 : _day$value.toUpperCase(),
|
|
3516
3661
|
status: (status === null || status === void 0 ? void 0 : status.value) === "all" ? "" : status === null || status === void 0 ? void 0 : status.value,
|
|
@@ -3595,7 +3740,7 @@ const FixedPointScheduleManagement = () => {
|
|
|
3595
3740
|
}
|
|
3596
3741
|
}, t("WT_DELETE")))
|
|
3597
3742
|
}], [t]);
|
|
3598
|
-
const days = ["
|
|
3743
|
+
const days = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"];
|
|
3599
3744
|
return /*#__PURE__*/React.createElement("div", {
|
|
3600
3745
|
className: "fixed-point-schedule-management"
|
|
3601
3746
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
@@ -3609,24 +3754,24 @@ const FixedPointScheduleManagement = () => {
|
|
|
3609
3754
|
}
|
|
3610
3755
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3611
3756
|
className: "finance-mainlayout-col1"
|
|
3612
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
3757
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("WT_FIXED_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3613
3758
|
option: [{
|
|
3614
|
-
label: "
|
|
3615
|
-
value: "
|
|
3759
|
+
label: t("WT_EXCEL_WEEKWISE"),
|
|
3760
|
+
value: "Weekwise"
|
|
3616
3761
|
}, {
|
|
3617
|
-
label: "
|
|
3618
|
-
value: "
|
|
3762
|
+
label: t("WT_EXCEL_MONTHWISE"),
|
|
3763
|
+
value: "Monthwise"
|
|
3619
3764
|
}, {
|
|
3620
|
-
label: "
|
|
3621
|
-
value: "
|
|
3765
|
+
label: t("WT_EXCEL_YEARWISE"),
|
|
3766
|
+
value: "Yearwise"
|
|
3622
3767
|
}],
|
|
3623
3768
|
optionKey: "label",
|
|
3624
|
-
|
|
3769
|
+
placeholder: t("WT_EXPORT"),
|
|
3625
3770
|
t: t,
|
|
3626
|
-
select:
|
|
3771
|
+
select: handleDownload
|
|
3627
3772
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3628
3773
|
className: "finance-mainlayout-col1"
|
|
3629
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
3774
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("WT_FIXED_POINT")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3630
3775
|
option: [{
|
|
3631
3776
|
label: "All Fixed Points",
|
|
3632
3777
|
value: "all"
|
|
@@ -3643,44 +3788,63 @@ const FixedPointScheduleManagement = () => {
|
|
|
3643
3788
|
optionKey: "label",
|
|
3644
3789
|
selected: fixedPoint,
|
|
3645
3790
|
t: t,
|
|
3646
|
-
select:
|
|
3791
|
+
select: val => {
|
|
3792
|
+
var _day$value2;
|
|
3793
|
+
setFixedPoint(val);
|
|
3794
|
+
handleSearch({
|
|
3795
|
+
fixedPointCode: (val === null || val === void 0 ? void 0 : val.value) === "all" ? "" : val === null || val === void 0 ? void 0 : val.value,
|
|
3796
|
+
day: (day === null || day === void 0 ? void 0 : day.value) === "all" ? "" : day === null || day === void 0 ? void 0 : (_day$value2 = day.value) === null || _day$value2 === void 0 ? void 0 : _day$value2.toUpperCase(),
|
|
3797
|
+
status: (status === null || status === void 0 ? void 0 : status.value) === "all" ? "" : status === null || status === void 0 ? void 0 : status.value,
|
|
3798
|
+
vehicleId: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.value) === "all" ? "" : vehicle === null || vehicle === void 0 ? void 0 : vehicle.value
|
|
3799
|
+
});
|
|
3800
|
+
},
|
|
3647
3801
|
placeholder: "All Fixed Points"
|
|
3648
3802
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3649
3803
|
className: "finance-mainlayout-col1"
|
|
3650
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
3804
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("WT_DAY")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3651
3805
|
option: [{
|
|
3652
3806
|
label: "All Days",
|
|
3653
3807
|
value: "all"
|
|
3654
3808
|
}, {
|
|
3655
|
-
label: "
|
|
3656
|
-
value: "
|
|
3809
|
+
label: t("MONDAY"),
|
|
3810
|
+
value: "MONDAY"
|
|
3657
3811
|
}, {
|
|
3658
|
-
label: "
|
|
3659
|
-
value: "
|
|
3812
|
+
label: t("TUESDAY"),
|
|
3813
|
+
value: "TUESDAY"
|
|
3660
3814
|
}, {
|
|
3661
|
-
label: "
|
|
3662
|
-
value: "
|
|
3815
|
+
label: t("WEDNESDAY"),
|
|
3816
|
+
value: "WEDNESDAY"
|
|
3663
3817
|
}, {
|
|
3664
|
-
label: "
|
|
3665
|
-
value: "
|
|
3818
|
+
label: t("THURSDAY"),
|
|
3819
|
+
value: "THURSDAY"
|
|
3666
3820
|
}, {
|
|
3667
|
-
label: "
|
|
3668
|
-
value: "
|
|
3821
|
+
label: t("FRIDAY"),
|
|
3822
|
+
value: "FRIDAY"
|
|
3669
3823
|
}, {
|
|
3670
|
-
label: "
|
|
3671
|
-
value: "
|
|
3824
|
+
label: t("SATURDAY"),
|
|
3825
|
+
value: "SATURDAY"
|
|
3672
3826
|
}, {
|
|
3673
|
-
label: "
|
|
3674
|
-
value: "
|
|
3827
|
+
label: t("SUNDAY"),
|
|
3828
|
+
value: "SUNDAY"
|
|
3675
3829
|
}],
|
|
3676
3830
|
optionKey: "label",
|
|
3677
3831
|
selected: day,
|
|
3678
3832
|
t: t,
|
|
3679
|
-
select:
|
|
3833
|
+
select: val => {
|
|
3834
|
+
var _val$value;
|
|
3835
|
+
setDay(val);
|
|
3836
|
+
setSelectedDay(val.value);
|
|
3837
|
+
handleSearch({
|
|
3838
|
+
fixedPointCode: (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value) === "all" ? "" : fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value,
|
|
3839
|
+
day: (val === null || val === void 0 ? void 0 : val.value) === "all" ? "" : val === null || val === void 0 ? void 0 : (_val$value = val.value) === null || _val$value === void 0 ? void 0 : _val$value.toUpperCase(),
|
|
3840
|
+
status: (status === null || status === void 0 ? void 0 : status.value) === "all" ? "" : status === null || status === void 0 ? void 0 : status.value,
|
|
3841
|
+
vehicleId: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.value) === "all" ? "" : vehicle === null || vehicle === void 0 ? void 0 : vehicle.value
|
|
3842
|
+
});
|
|
3843
|
+
},
|
|
3680
3844
|
placeholder: "All Days"
|
|
3681
3845
|
})), /*#__PURE__*/React.createElement("div", {
|
|
3682
3846
|
className: "finance-mainlayout-col1"
|
|
3683
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
3847
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, t("WT_STATUS")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
3684
3848
|
option: [{
|
|
3685
3849
|
label: "All Status",
|
|
3686
3850
|
value: "all"
|
|
@@ -3694,7 +3858,16 @@ const FixedPointScheduleManagement = () => {
|
|
|
3694
3858
|
optionKey: "label",
|
|
3695
3859
|
selected: status,
|
|
3696
3860
|
t: t,
|
|
3697
|
-
select:
|
|
3861
|
+
select: val => {
|
|
3862
|
+
var _day$value3;
|
|
3863
|
+
setStatus(val);
|
|
3864
|
+
handleSearch({
|
|
3865
|
+
fixedPointCode: (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value) === "all" ? "" : fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value,
|
|
3866
|
+
day: (day === null || day === void 0 ? void 0 : day.value) === "all" ? "" : day === null || day === void 0 ? void 0 : (_day$value3 = day.value) === null || _day$value3 === void 0 ? void 0 : _day$value3.toUpperCase(),
|
|
3867
|
+
status: (val === null || val === void 0 ? void 0 : val.value) === "all" ? "" : val === null || val === void 0 ? void 0 : val.value,
|
|
3868
|
+
vehicleId: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.value) === "all" ? "" : vehicle === null || vehicle === void 0 ? void 0 : vehicle.value
|
|
3869
|
+
});
|
|
3870
|
+
},
|
|
3698
3871
|
placeholder: "All Status"
|
|
3699
3872
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
3700
3873
|
className: "finance-mainlayout",
|
|
@@ -3703,26 +3876,7 @@ const FixedPointScheduleManagement = () => {
|
|
|
3703
3876
|
}
|
|
3704
3877
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3705
3878
|
className: "finance-mainlayout-col1"
|
|
3706
|
-
}, /*#__PURE__*/React.createElement(
|
|
3707
|
-
option: [{
|
|
3708
|
-
label: "All Vehicles",
|
|
3709
|
-
value: "all"
|
|
3710
|
-
}, {
|
|
3711
|
-
label: "DL1LAG7729",
|
|
3712
|
-
value: "DL1LAG7729"
|
|
3713
|
-
}, {
|
|
3714
|
-
label: "DL1LAG7730",
|
|
3715
|
-
value: "DL1LAG7730"
|
|
3716
|
-
}, {
|
|
3717
|
-
label: "DL1LAG7731",
|
|
3718
|
-
value: "DL1LAG7731"
|
|
3719
|
-
}],
|
|
3720
|
-
optionKey: "label",
|
|
3721
|
-
selected: vehicle,
|
|
3722
|
-
t: t,
|
|
3723
|
-
select: setVehicle,
|
|
3724
|
-
placeholder: "All Vehicles"
|
|
3725
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
3879
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3726
3880
|
className: "finance-mainlayout-col1"
|
|
3727
3881
|
}), /*#__PURE__*/React.createElement("div", {
|
|
3728
3882
|
className: "finance-mainlayout-col1"
|
|
@@ -3745,25 +3899,43 @@ const FixedPointScheduleManagement = () => {
|
|
|
3745
3899
|
className: "finance-mainlayout-col1"
|
|
3746
3900
|
}, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3747
3901
|
label: t("ES_COMMON_SEARCH"),
|
|
3748
|
-
onSubmit: handleSearch
|
|
3902
|
+
onSubmit: () => handleSearch()
|
|
3749
3903
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
3750
3904
|
style: {
|
|
3751
3905
|
display: "flex",
|
|
3752
3906
|
gap: "5px",
|
|
3753
3907
|
marginBottom: "20px"
|
|
3754
3908
|
}
|
|
3755
|
-
}, days.map(
|
|
3756
|
-
key:
|
|
3757
|
-
onClick: () =>
|
|
3909
|
+
}, days.map(dayItem => /*#__PURE__*/React.createElement("button", {
|
|
3910
|
+
key: dayItem,
|
|
3911
|
+
onClick: () => {
|
|
3912
|
+
setSelectedDay(dayItem);
|
|
3913
|
+
const dayOption = {
|
|
3914
|
+
label: dayItem,
|
|
3915
|
+
value: dayItem
|
|
3916
|
+
};
|
|
3917
|
+
setDay(dayOption);
|
|
3918
|
+
handleSearch({
|
|
3919
|
+
fixedPointCode: (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value) === "all" ? "" : fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.value,
|
|
3920
|
+
day: dayItem.toUpperCase(),
|
|
3921
|
+
status: (status === null || status === void 0 ? void 0 : status.value) === "all" ? "" : status === null || status === void 0 ? void 0 : status.value,
|
|
3922
|
+
vehicleId: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.value) === "all" ? "" : vehicle === null || vehicle === void 0 ? void 0 : vehicle.value
|
|
3923
|
+
});
|
|
3924
|
+
},
|
|
3758
3925
|
style: {
|
|
3759
3926
|
padding: "8px 16px",
|
|
3760
3927
|
border: "1px solid #ccc",
|
|
3761
3928
|
borderRadius: "4px",
|
|
3762
|
-
background: selectedDay ===
|
|
3763
|
-
color: selectedDay ===
|
|
3929
|
+
background: selectedDay === dayItem ? "#1D4E7F" : "#fff",
|
|
3930
|
+
color: selectedDay === dayItem ? "#fff" : "#333",
|
|
3764
3931
|
cursor: "pointer"
|
|
3765
3932
|
}
|
|
3766
|
-
}, t(
|
|
3933
|
+
}, t(dayItem.toUpperCase())))), /*#__PURE__*/React.createElement("div", {
|
|
3934
|
+
style: {
|
|
3935
|
+
width: "100%",
|
|
3936
|
+
overflowX: "auto"
|
|
3937
|
+
}
|
|
3938
|
+
}, /*#__PURE__*/React.createElement(ApplicationTable, {
|
|
3767
3939
|
t: t,
|
|
3768
3940
|
data: data,
|
|
3769
3941
|
columns: columns,
|
|
@@ -3774,8 +3946,17 @@ const FixedPointScheduleManagement = () => {
|
|
|
3774
3946
|
inboxStyles: {
|
|
3775
3947
|
overflowX: "auto"
|
|
3776
3948
|
},
|
|
3777
|
-
isLoading: isLoading
|
|
3778
|
-
|
|
3949
|
+
isLoading: isLoading,
|
|
3950
|
+
onPageSizeChange: props.onPageSizeChange,
|
|
3951
|
+
currentPage: props.currentPage,
|
|
3952
|
+
onNextPage: props.onNextPage,
|
|
3953
|
+
onPrevPage: props.onPrevPage,
|
|
3954
|
+
pageSizeLimit: props.pageSizeLimit,
|
|
3955
|
+
onSort: props.onSort,
|
|
3956
|
+
disableSort: props.disableSort,
|
|
3957
|
+
sortParams: props.sortParams,
|
|
3958
|
+
totalRecords: props.totalRecords
|
|
3959
|
+
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("button", {
|
|
3779
3960
|
onClick: () => {
|
|
3780
3961
|
setEditingRowIndex(null);
|
|
3781
3962
|
setShowModal(true);
|
|
@@ -3801,10 +3982,10 @@ const FixedPointScheduleManagement = () => {
|
|
|
3801
3982
|
initialValues: editingRowIndex !== null ? {
|
|
3802
3983
|
scheduleId: data[editingRowIndex].scheduleId,
|
|
3803
3984
|
fixedPointCode: data[editingRowIndex].fixedPoint,
|
|
3804
|
-
day: {
|
|
3985
|
+
day: [{
|
|
3805
3986
|
label: t(data[editingRowIndex].day),
|
|
3806
3987
|
value: data[editingRowIndex].day
|
|
3807
|
-
},
|
|
3988
|
+
}],
|
|
3808
3989
|
frequencyNo: data[editingRowIndex].freq,
|
|
3809
3990
|
arrivalTimeFpl: data[editingRowIndex].arrToFpl,
|
|
3810
3991
|
departureTimeFpl: data[editingRowIndex].depFromFpl,
|
|
@@ -3819,24 +4000,37 @@ const FixedPointScheduleManagement = () => {
|
|
|
3819
4000
|
}
|
|
3820
4001
|
} : null,
|
|
3821
4002
|
onSubmit: formData => {
|
|
3822
|
-
var _formData$
|
|
4003
|
+
var _formData$active, _formData$active2;
|
|
4004
|
+
const formDataDay = formData === null || formData === void 0 ? void 0 : formData.day;
|
|
4005
|
+
let daysArr = [];
|
|
4006
|
+
if (Array.isArray(formDataDay)) {
|
|
4007
|
+
daysArr = formDataDay.map(d => typeof d === "string" ? d : (d === null || d === void 0 ? void 0 : d.value) || (Array.isArray(d) ? d[1] : d)).filter(d => typeof d === "string" && d !== "WT_SELECT_ALL");
|
|
4008
|
+
if (daysArr.length === 0 && formDataDay.some(d => (typeof d === "string" ? d : (d === null || d === void 0 ? void 0 : d.value) || (Array.isArray(d) ? d[1] : d)) === "WT_SELECT_ALL")) {
|
|
4009
|
+
daysArr = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"];
|
|
4010
|
+
}
|
|
4011
|
+
} else if (formDataDay) {
|
|
4012
|
+
const dayVal = typeof formDataDay === "string" ? formDataDay : formDataDay === null || formDataDay === void 0 ? void 0 : formDataDay.value;
|
|
4013
|
+
if (dayVal && dayVal !== "WT_SELECT_ALL") daysArr = [dayVal];
|
|
4014
|
+
}
|
|
4015
|
+
const fixedPointTimeTableDetails = {
|
|
4016
|
+
tenantId,
|
|
4017
|
+
system_assigned_schedule_id: formData.scheduleId,
|
|
4018
|
+
fixed_point_code: formData.fixedPointCode,
|
|
4019
|
+
days: daysArr.map(d => d.toUpperCase()),
|
|
4020
|
+
trip_no: formData.frequencyNo,
|
|
4021
|
+
arrival_time_to_fpl: formData.arrivalTimeFpl,
|
|
4022
|
+
departure_time_from_fpl: formData.departureTimeFpl,
|
|
4023
|
+
arrival_time_delivery_point: formData.arrivalFixedPoint,
|
|
4024
|
+
departure_time_delivery_point: formData.departureFixedPoint,
|
|
4025
|
+
time_of_arriving_back_fpl_after_delivery: formData.returnFpl,
|
|
4026
|
+
volume_water_tobe_delivery: formData.volume,
|
|
4027
|
+
active: ((_formData$active = formData.active) === null || _formData$active === void 0 ? void 0 : _formData$active.value) === "Yes" || formData.active === "Yes",
|
|
4028
|
+
is_enable: ((_formData$active2 = formData.active) === null || _formData$active2 === void 0 ? void 0 : _formData$active2.value) === "Yes" || formData.active === "Yes",
|
|
4029
|
+
remarks: formData.remarks,
|
|
4030
|
+
vehicle_id: formData.vehicleId
|
|
4031
|
+
};
|
|
3823
4032
|
const payload = {
|
|
3824
|
-
|
|
3825
|
-
system_assigned_schedule_id: formData.scheduleId,
|
|
3826
|
-
fixed_point_code: formData.fixedPointCode,
|
|
3827
|
-
day: (_formData$day = formData.day) === null || _formData$day === void 0 ? void 0 : (_formData$day$value = _formData$day.value) === null || _formData$day$value === void 0 ? void 0 : _formData$day$value.toUpperCase(),
|
|
3828
|
-
trip_no: formData.frequencyNo,
|
|
3829
|
-
arrival_time_to_fpl: formData.arrivalTimeFpl,
|
|
3830
|
-
departure_time_from_fpl: formData.departureTimeFpl,
|
|
3831
|
-
arrival_time_delivery_point: formData.arrivalFixedPoint,
|
|
3832
|
-
departure_time_delivery_point: formData.departureFixedPoint,
|
|
3833
|
-
time_of_arriving_back_fpl_after_delivery: formData.returnFpl,
|
|
3834
|
-
volume_water_tobe_delivery: formData.volume,
|
|
3835
|
-
active: ((_formData$active = formData.active) === null || _formData$active === void 0 ? void 0 : _formData$active.value) === "Yes",
|
|
3836
|
-
is_enable: ((_formData$active2 = formData.active) === null || _formData$active2 === void 0 ? void 0 : _formData$active2.value) === "Yes",
|
|
3837
|
-
remarks: formData.remarks,
|
|
3838
|
-
vehicle_id: formData.vehicleId
|
|
3839
|
-
}
|
|
4033
|
+
fixedPointTimeTableDetails
|
|
3840
4034
|
};
|
|
3841
4035
|
createSchedule(payload, {
|
|
3842
4036
|
onError: (error, variables) => {
|
|
@@ -4077,7 +4271,7 @@ const RouteLayer = ({
|
|
|
4077
4271
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
4078
4272
|
style: {
|
|
4079
4273
|
margin: 0,
|
|
4080
|
-
color: "#
|
|
4274
|
+
color: "#667eea"
|
|
4081
4275
|
}
|
|
4082
4276
|
}, "Route Information"), /*#__PURE__*/React.createElement("button", {
|
|
4083
4277
|
onClick: () => setShowSteps(false),
|
|
@@ -4132,7 +4326,7 @@ const RouteLayer = ({
|
|
|
4132
4326
|
width: "20px",
|
|
4133
4327
|
height: "20px",
|
|
4134
4328
|
borderRadius: "50%",
|
|
4135
|
-
background: "#
|
|
4329
|
+
background: "#667eea",
|
|
4136
4330
|
color: "white",
|
|
4137
4331
|
display: "flex",
|
|
4138
4332
|
alignItems: "center",
|
|
@@ -4170,12 +4364,12 @@ const RouteMarkers = ({
|
|
|
4170
4364
|
className: "distance-marker",
|
|
4171
4365
|
html: `<div style="
|
|
4172
4366
|
background: white;
|
|
4173
|
-
border: 2px solid #
|
|
4367
|
+
border: 2px solid #667eea;
|
|
4174
4368
|
border-radius: 12px;
|
|
4175
4369
|
padding: 2px 6px;
|
|
4176
4370
|
font-size: 10px;
|
|
4177
4371
|
font-weight: bold;
|
|
4178
|
-
color: #
|
|
4372
|
+
color: #667eea;
|
|
4179
4373
|
white-space: nowrap;
|
|
4180
4374
|
">${(i / 1000).toFixed(0)} km</div>`,
|
|
4181
4375
|
iconSize: [40, 20],
|
|
@@ -4274,7 +4468,7 @@ const DriverCard = ({
|
|
|
4274
4468
|
style: {
|
|
4275
4469
|
fontWeight: "600",
|
|
4276
4470
|
fontSize: "16px",
|
|
4277
|
-
color: "#
|
|
4471
|
+
color: "#667eea",
|
|
4278
4472
|
marginBottom: "4px",
|
|
4279
4473
|
overflow: "hidden",
|
|
4280
4474
|
textOverflow: "ellipsis",
|
|
@@ -4377,7 +4571,7 @@ const DriverCard = ({
|
|
|
4377
4571
|
style: {
|
|
4378
4572
|
fontSize: "14px",
|
|
4379
4573
|
fontWeight: "600",
|
|
4380
|
-
color: "#
|
|
4574
|
+
color: "#667eea"
|
|
4381
4575
|
}
|
|
4382
4576
|
}, eta, " min")), driver.speed && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
4383
4577
|
style: {
|
|
@@ -4531,7 +4725,7 @@ function LiveTrackingSystem() {
|
|
|
4531
4725
|
top: "10px",
|
|
4532
4726
|
left: "10px",
|
|
4533
4727
|
zIndex: 2000,
|
|
4534
|
-
background: "#
|
|
4728
|
+
background: "#667eea",
|
|
4535
4729
|
color: "white",
|
|
4536
4730
|
border: "none",
|
|
4537
4731
|
borderRadius: "8px",
|
|
@@ -4572,7 +4766,7 @@ function LiveTrackingSystem() {
|
|
|
4572
4766
|
}, showSidebar && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
4573
4767
|
style: {
|
|
4574
4768
|
padding: isMobile ? "16px" : "24px",
|
|
4575
|
-
background: "linear-gradient(135deg, #
|
|
4769
|
+
background: "linear-gradient(135deg, #667eea, #0d47a1)",
|
|
4576
4770
|
color: "white"
|
|
4577
4771
|
}
|
|
4578
4772
|
}, isMobile && /*#__PURE__*/React.createElement("button", {
|
|
@@ -4639,7 +4833,7 @@ function LiveTrackingSystem() {
|
|
|
4639
4833
|
style: {
|
|
4640
4834
|
fontSize: isMobile ? "16px" : "20px",
|
|
4641
4835
|
fontWeight: "bold",
|
|
4642
|
-
color: "#
|
|
4836
|
+
color: "#667eea"
|
|
4643
4837
|
}
|
|
4644
4838
|
}, Object.keys(drivers).length)), /*#__PURE__*/React.createElement("div", {
|
|
4645
4839
|
style: {
|
|
@@ -4708,7 +4902,7 @@ function LiveTrackingSystem() {
|
|
|
4708
4902
|
transition: "border-color 0.2s",
|
|
4709
4903
|
boxSizing: "border-box"
|
|
4710
4904
|
},
|
|
4711
|
-
onFocus: e => e.target.style.borderColor = "#
|
|
4905
|
+
onFocus: e => e.target.style.borderColor = "#667eea",
|
|
4712
4906
|
onBlur: e => e.target.style.borderColor = "#e0e0e0"
|
|
4713
4907
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4714
4908
|
style: {
|
|
@@ -4724,7 +4918,7 @@ function LiveTrackingSystem() {
|
|
|
4724
4918
|
padding: isMobile ? "6px" : "8px",
|
|
4725
4919
|
border: "1px solid #e0e0e0",
|
|
4726
4920
|
borderRadius: "6px",
|
|
4727
|
-
background: filterOnline === filter ? "#
|
|
4921
|
+
background: filterOnline === filter ? "#667eea" : "white",
|
|
4728
4922
|
color: filterOnline === filter ? "white" : "#333",
|
|
4729
4923
|
cursor: "pointer",
|
|
4730
4924
|
fontSize: isMobile ? "11px" : "12px",
|
|
@@ -4824,7 +5018,7 @@ function LiveTrackingSystem() {
|
|
|
4824
5018
|
style: {
|
|
4825
5019
|
fontWeight: "bold",
|
|
4826
5020
|
fontSize: isMobile ? "14px" : "16px",
|
|
4827
|
-
color: "#
|
|
5021
|
+
color: "#667eea",
|
|
4828
5022
|
marginBottom: "8px",
|
|
4829
5023
|
borderBottom: "1px solid #eee",
|
|
4830
5024
|
paddingBottom: "4px"
|
|
@@ -4901,7 +5095,7 @@ function LiveTrackingSystem() {
|
|
|
4901
5095
|
},
|
|
4902
5096
|
style: {
|
|
4903
5097
|
padding: isMobile ? "10px 12px" : "8px 16px",
|
|
4904
|
-
background: "#
|
|
5098
|
+
background: "#667eea",
|
|
4905
5099
|
color: "white",
|
|
4906
5100
|
border: "none",
|
|
4907
5101
|
borderRadius: "4px",
|
|
@@ -4955,7 +5149,7 @@ function LiveTrackingSystem() {
|
|
|
4955
5149
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
4956
5150
|
style: {
|
|
4957
5151
|
margin: 0,
|
|
4958
|
-
color: "#
|
|
5152
|
+
color: "#667eea",
|
|
4959
5153
|
fontSize: isMobile ? "14px" : "16px"
|
|
4960
5154
|
}
|
|
4961
5155
|
}, "Selected Driver"), /*#__PURE__*/React.createElement("span", {
|
|
@@ -5186,9 +5380,11 @@ const AddFixFillAddress = ({
|
|
|
5186
5380
|
label: local.label
|
|
5187
5381
|
}))) || [];
|
|
5188
5382
|
useEffect(() => {
|
|
5189
|
-
|
|
5383
|
+
var _formData$address10;
|
|
5384
|
+
const currentId = (formData === null || formData === void 0 ? void 0 : formData.id) || (formData === null || formData === void 0 ? void 0 : formData.bookingId) || (formData === null || formData === void 0 ? void 0 : (_formData$address10 = formData.address) === null || _formData$address10 === void 0 ? void 0 : _formData$address10.id);
|
|
5385
|
+
if (currentId && lastBookingId.current !== currentId) {
|
|
5190
5386
|
isInitialized.current = false;
|
|
5191
|
-
lastBookingId.current =
|
|
5387
|
+
lastBookingId.current = currentId;
|
|
5192
5388
|
}
|
|
5193
5389
|
if (formData !== null && formData !== void 0 && formData.address && !isInitialized.current && allCities) {
|
|
5194
5390
|
const addressData = formData.address;
|
|
@@ -5349,6 +5545,7 @@ const AddFillingPointAddress = () => {
|
|
|
5349
5545
|
t
|
|
5350
5546
|
} = useTranslation();
|
|
5351
5547
|
const location = useLocation();
|
|
5548
|
+
const history = useHistory();
|
|
5352
5549
|
const queryParams = new URLSearchParams(location.search);
|
|
5353
5550
|
const editId = queryParams.get("id");
|
|
5354
5551
|
const [formData, setFormData] = useState({});
|
|
@@ -5360,10 +5557,10 @@ const AddFillingPointAddress = () => {
|
|
|
5360
5557
|
const {
|
|
5361
5558
|
isLoading: isEditLoading,
|
|
5362
5559
|
data: editData
|
|
5363
|
-
} = Digit.Hooks.wt.
|
|
5560
|
+
} = Digit.Hooks.wt.useFillPointSearch({
|
|
5364
5561
|
tenantId,
|
|
5365
5562
|
filters: {
|
|
5366
|
-
|
|
5563
|
+
id: editId
|
|
5367
5564
|
}
|
|
5368
5565
|
}, {
|
|
5369
5566
|
enabled: !!editId
|
|
@@ -5378,29 +5575,28 @@ const AddFillingPointAddress = () => {
|
|
|
5378
5575
|
}));
|
|
5379
5576
|
};
|
|
5380
5577
|
useEffect(() => {
|
|
5381
|
-
if (editId && editData !== null && editData !== void 0 && editData.
|
|
5382
|
-
const data = editData.
|
|
5578
|
+
if (editId && editData !== null && editData !== void 0 && editData.fillingPoints) {
|
|
5579
|
+
const data = editData.fillingPoints.find(item => item.id === editId);
|
|
5383
5580
|
if (data) {
|
|
5384
|
-
var _data$fillingpointmet, _data$fillingpointmet2, _data$fillingpointmet3, _data$fillingpointmet4, _data$fillingpointmet5, _data$fillingpointmet6, _data$fillingpointmet7, _data$fillingpointmet8, _data$fillingpointmet9, _data$fillingpointmet0, _data$fillingpointmet1, _data$fillingpointmet10, _data$fillingpointmet11, _data$fillingpointmet12, _data$fillingpointmet13, _data$fillingpointmet14, _data$fillingpointmet15, _data$fillingpointmet16;
|
|
5385
5581
|
setFormData({
|
|
5582
|
+
id: data.id,
|
|
5583
|
+
tenantId: data.tenantId,
|
|
5386
5584
|
owner: {
|
|
5387
|
-
fillingPointName:
|
|
5388
|
-
emergencyName:
|
|
5389
|
-
aeName:
|
|
5390
|
-
aeMobile:
|
|
5391
|
-
aeEmail:
|
|
5392
|
-
jeName:
|
|
5393
|
-
jeMobile:
|
|
5394
|
-
jeEmail:
|
|
5395
|
-
eeName:
|
|
5396
|
-
eeMobile:
|
|
5397
|
-
eeEmail:
|
|
5585
|
+
fillingPointName: data.fillingPointName,
|
|
5586
|
+
emergencyName: data.emergencyName,
|
|
5587
|
+
aeName: data.aeName,
|
|
5588
|
+
aeMobile: data.aeMobile,
|
|
5589
|
+
aeEmail: data.aeEmail,
|
|
5590
|
+
jeName: data.jeName,
|
|
5591
|
+
jeMobile: data.jeMobile,
|
|
5592
|
+
jeEmail: data.jeEmail,
|
|
5593
|
+
eeName: data.eeName,
|
|
5594
|
+
eeMobile: data.eeMobile,
|
|
5595
|
+
eeEmail: data.eeEmail
|
|
5398
5596
|
},
|
|
5399
5597
|
address: {
|
|
5400
5598
|
...data.address
|
|
5401
|
-
}
|
|
5402
|
-
bookingId: data.bookingId,
|
|
5403
|
-
auditDetails: data.auditDetails
|
|
5599
|
+
}
|
|
5404
5600
|
});
|
|
5405
5601
|
}
|
|
5406
5602
|
}
|
|
@@ -5415,19 +5611,25 @@ const AddFillingPointAddress = () => {
|
|
|
5415
5611
|
const {
|
|
5416
5612
|
mutate: createFillingPoint
|
|
5417
5613
|
} = Digit.Hooks.wt.useCreateFillPoint(tenantId);
|
|
5614
|
+
const {
|
|
5615
|
+
mutate: updateFillingPoint
|
|
5616
|
+
} = Digit.Hooks.wt.useUpdateFillPoint(tenantId);
|
|
5418
5617
|
const handleSubmit = e => {
|
|
5419
5618
|
if (e && e.preventDefault) e.preventDefault();
|
|
5420
5619
|
const payload = fillingPointPayload({
|
|
5421
5620
|
...formData,
|
|
5422
5621
|
tenantId
|
|
5423
5622
|
});
|
|
5424
|
-
const mutation = createFillingPoint;
|
|
5623
|
+
const mutation = editId ? updateFillingPoint : createFillingPoint;
|
|
5425
5624
|
mutation(payload, {
|
|
5426
5625
|
onSuccess: () => {
|
|
5427
5626
|
setShowToast({
|
|
5428
5627
|
label: editId ? t("WT_FILLING_POINT_UPDATED_SUCCESS") : t("WT_FILLING_POINT_CREATED_SUCCESS")
|
|
5429
5628
|
});
|
|
5430
|
-
setTimeout(() =>
|
|
5629
|
+
setTimeout(() => {
|
|
5630
|
+
setShowToast(null);
|
|
5631
|
+
history.push(`/digit-ui/employee/wt/search-filling-fix-point`);
|
|
5632
|
+
}, 3000);
|
|
5431
5633
|
},
|
|
5432
5634
|
onError: error => {
|
|
5433
5635
|
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
@@ -5466,7 +5668,8 @@ const AddFillingPointAddress = () => {
|
|
|
5466
5668
|
t: t,
|
|
5467
5669
|
config: addressConfig,
|
|
5468
5670
|
onSelect: handleSelect,
|
|
5469
|
-
formData: formData
|
|
5671
|
+
formData: formData,
|
|
5672
|
+
isEdit: !!editId
|
|
5470
5673
|
}), /*#__PURE__*/React.createElement("div", {
|
|
5471
5674
|
style: {
|
|
5472
5675
|
display: "flex",
|
|
@@ -5707,7 +5910,11 @@ const SearchFillingPointAddress = () => {
|
|
|
5707
5910
|
const [mobileNumber, setMobileNumber] = useState("");
|
|
5708
5911
|
const [status, setStatus] = useState(null);
|
|
5709
5912
|
const [searchParams, setSearchParams] = useState({});
|
|
5913
|
+
const [toast, setToast] = useState(null);
|
|
5710
5914
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
5915
|
+
const closeToast = () => {
|
|
5916
|
+
setToast(null);
|
|
5917
|
+
};
|
|
5711
5918
|
const {
|
|
5712
5919
|
isLoading: isFixedLoading,
|
|
5713
5920
|
data: fixedPointData,
|
|
@@ -5728,6 +5935,21 @@ const SearchFillingPointAddress = () => {
|
|
|
5728
5935
|
}, {
|
|
5729
5936
|
enabled: selectedTab === "FILLING_POINT"
|
|
5730
5937
|
});
|
|
5938
|
+
const {
|
|
5939
|
+
isLoading: isAllFillingPointsLoading,
|
|
5940
|
+
data: allFillingPointsData
|
|
5941
|
+
} = Digit.Hooks.wt.useFillPointSearch({
|
|
5942
|
+
tenantId,
|
|
5943
|
+
filters: {
|
|
5944
|
+
limit: 1000
|
|
5945
|
+
}
|
|
5946
|
+
}, {
|
|
5947
|
+
enabled: true
|
|
5948
|
+
});
|
|
5949
|
+
const allFillingPoints = (allFillingPointsData === null || allFillingPointsData === void 0 ? void 0 : allFillingPointsData.fillingPoints) || [];
|
|
5950
|
+
const {
|
|
5951
|
+
mutate: mapFixedFilling
|
|
5952
|
+
} = Digit.Hooks.wt.useFixedFillingMapping(tenantId);
|
|
5731
5953
|
const isLoading = selectedTab === "FIXED_POINT" ? isFixedLoading : isFillingLoading;
|
|
5732
5954
|
const tableData = (selectedTab === "FIXED_POINT" ? fixedPointData === null || fixedPointData === void 0 ? void 0 : fixedPointData.waterTankerBookingDetail : fillingPointData === null || fillingPointData === void 0 ? void 0 : fillingPointData.fillingPoints) || [];
|
|
5733
5955
|
const searchConfig = {
|
|
@@ -5794,6 +6016,32 @@ const SearchFillingPointAddress = () => {
|
|
|
5794
6016
|
};
|
|
5795
6017
|
setSearchParams(filters);
|
|
5796
6018
|
};
|
|
6019
|
+
const onFillingPointSelect = (row, value) => {
|
|
6020
|
+
var _row$original$applica, _value$fillingpointme;
|
|
6021
|
+
const payload = {
|
|
6022
|
+
fixedFillingPointMapping: {
|
|
6023
|
+
fixed_pt_name: (_row$original$applica = row.original.applicantDetail) === null || _row$original$applica === void 0 ? void 0 : _row$original$applica.applicantId,
|
|
6024
|
+
filling_pt_name: value.id || value.bookingId || value.fillingPointId || value.uuid || ((_value$fillingpointme = value.fillingpointmetadata) === null || _value$fillingpointme === void 0 ? void 0 : _value$fillingpointme.fillingPointId)
|
|
6025
|
+
}
|
|
6026
|
+
};
|
|
6027
|
+
mapFixedFilling(payload, {
|
|
6028
|
+
onSuccess: () => {
|
|
6029
|
+
setToast({
|
|
6030
|
+
label: t("WT_FIXED_FILLING_MAPPING_SUCCESS")
|
|
6031
|
+
});
|
|
6032
|
+
setTimeout(closeToast, 5000);
|
|
6033
|
+
refetchFixed();
|
|
6034
|
+
},
|
|
6035
|
+
onError: err => {
|
|
6036
|
+
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
6037
|
+
setToast({
|
|
6038
|
+
label: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || t("WT_FIXED_FILLING_MAPPING_FAIL"),
|
|
6039
|
+
error: true
|
|
6040
|
+
});
|
|
6041
|
+
setTimeout(closeToast, 5000);
|
|
6042
|
+
}
|
|
6043
|
+
});
|
|
6044
|
+
};
|
|
5797
6045
|
const columns = React.useMemo(() => {
|
|
5798
6046
|
if (selectedTab === "FIXED_POINT") {
|
|
5799
6047
|
return [{
|
|
@@ -5806,12 +6054,12 @@ const SearchFillingPointAddress = () => {
|
|
|
5806
6054
|
Cell: ({
|
|
5807
6055
|
row
|
|
5808
6056
|
}) => {
|
|
5809
|
-
var _row$original$
|
|
6057
|
+
var _row$original$applica2;
|
|
5810
6058
|
return /*#__PURE__*/React.createElement("span", {
|
|
5811
6059
|
className: "link"
|
|
5812
6060
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
5813
6061
|
to: `/digit-ui/employee/wt/add-fix-point-address?id=${row.original.bookingId}`
|
|
5814
|
-
}, ((_row$original$
|
|
6062
|
+
}, ((_row$original$applica2 = row.original.applicantDetail) === null || _row$original$applica2 === void 0 ? void 0 : _row$original$applica2.name) || "NA"));
|
|
5815
6063
|
}
|
|
5816
6064
|
}, {
|
|
5817
6065
|
Header: t("WT_MOBILE_NUMBER"),
|
|
@@ -5827,6 +6075,35 @@ const SearchFillingPointAddress = () => {
|
|
|
5827
6075
|
return (row === null || row === void 0 ? void 0 : (_row$address = row.address) === null || _row$address === void 0 ? void 0 : _row$address.locality) || "NA";
|
|
5828
6076
|
},
|
|
5829
6077
|
id: "locality"
|
|
6078
|
+
}, {
|
|
6079
|
+
Header: t("WT_FILLING_POINT"),
|
|
6080
|
+
accessor: row => {
|
|
6081
|
+
var _row$fillingpointmeta;
|
|
6082
|
+
return (row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta = row.fillingpointmetadata) === null || _row$fillingpointmeta === void 0 ? void 0 : _row$fillingpointmeta.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || "NA";
|
|
6083
|
+
},
|
|
6084
|
+
id: "fillingPoint",
|
|
6085
|
+
Cell: ({
|
|
6086
|
+
row
|
|
6087
|
+
}) => {
|
|
6088
|
+
var _row$original$filling, _row$original$filling2, _row$original$filling3, _row$original$filling4;
|
|
6089
|
+
const rowFpId = String(row.original.fillingPointId || ((_row$original$filling = row.original.fillingpointmetadata) === null || _row$original$filling === void 0 ? void 0 : _row$original$filling.fillingPointId) || row.original.fillingPtName || row.original.filling_pt_name || (typeof row.original.fillingPoint === "object" ? (_row$original$filling2 = row.original.fillingPoint) === null || _row$original$filling2 === void 0 ? void 0 : _row$original$filling2.id : row.original.fillingPoint) || ((_row$original$filling3 = row.original.fillingPointDetail) === null || _row$original$filling3 === void 0 ? void 0 : _row$original$filling3.id) || ((_row$original$filling4 = row.original.fillingPointDetail) === null || _row$original$filling4 === void 0 ? void 0 : _row$original$filling4.bookingId) || "");
|
|
6090
|
+
const selectedOption = allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.find(fp => {
|
|
6091
|
+
var _fp$fillingpointmetad;
|
|
6092
|
+
const fpId = String(fp.id || fp.bookingId || fp.fillingPointId || fp.uuid || ((_fp$fillingpointmetad = fp.fillingpointmetadata) === null || _fp$fillingpointmetad === void 0 ? void 0 : _fp$fillingpointmetad.fillingPointId));
|
|
6093
|
+
return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null" && rowFpId !== "";
|
|
6094
|
+
});
|
|
6095
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
6096
|
+
className: "fsm-registry-dropdown",
|
|
6097
|
+
selected: selectedOption,
|
|
6098
|
+
option: allFillingPoints,
|
|
6099
|
+
select: value => onFillingPointSelect(row, value),
|
|
6100
|
+
style: {
|
|
6101
|
+
textAlign: "left"
|
|
6102
|
+
},
|
|
6103
|
+
optionKey: "fillingPointName",
|
|
6104
|
+
t: t
|
|
6105
|
+
});
|
|
6106
|
+
}
|
|
5830
6107
|
}];
|
|
5831
6108
|
} else {
|
|
5832
6109
|
return [{
|
|
@@ -5840,10 +6117,18 @@ const SearchFillingPointAddress = () => {
|
|
|
5840
6117
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
5841
6118
|
to: `/digit-ui/employee/wt/add-filling-point-address?id=${row.original.id}`
|
|
5842
6119
|
}, row.original.fillingPointName || "NA"))
|
|
6120
|
+
}, {
|
|
6121
|
+
Header: t("WT_AE_NAME"),
|
|
6122
|
+
accessor: row => (row === null || row === void 0 ? void 0 : row.aeName) || "NA",
|
|
6123
|
+
id: "aeName"
|
|
5843
6124
|
}, {
|
|
5844
6125
|
Header: t("WT_JE_NAME"),
|
|
5845
6126
|
accessor: row => (row === null || row === void 0 ? void 0 : row.jeName) || "NA",
|
|
5846
6127
|
id: "jeName"
|
|
6128
|
+
}, {
|
|
6129
|
+
Header: t("WT_EE_NAME"),
|
|
6130
|
+
accessor: row => (row === null || row === void 0 ? void 0 : row.eeName) || "NA",
|
|
6131
|
+
id: "eeName"
|
|
5847
6132
|
}, {
|
|
5848
6133
|
Header: t("WT_LOCALITY"),
|
|
5849
6134
|
accessor: row => {
|
|
@@ -5853,7 +6138,7 @@ const SearchFillingPointAddress = () => {
|
|
|
5853
6138
|
id: "locality"
|
|
5854
6139
|
}];
|
|
5855
6140
|
}
|
|
5856
|
-
}, [selectedTab, t]);
|
|
6141
|
+
}, [allFillingPoints, selectedTab, t]);
|
|
5857
6142
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
5858
6143
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
|
|
5859
6144
|
className: "search-tabs-container",
|
|
@@ -5928,6 +6213,7 @@ const SearchFillingPointAddress = () => {
|
|
|
5928
6213
|
label: t("ES_COMMON_SEARCH"),
|
|
5929
6214
|
onSubmit: onSearch
|
|
5930
6215
|
})))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Table, {
|
|
6216
|
+
key: (allFillingPoints === null || allFillingPoints === void 0 ? void 0 : allFillingPoints.length) > 0 ? "loaded" : "loading",
|
|
5931
6217
|
data: tableData,
|
|
5932
6218
|
columns: columns,
|
|
5933
6219
|
pageSize: 10,
|
|
@@ -5941,12 +6227,16 @@ const SearchFillingPointAddress = () => {
|
|
|
5941
6227
|
}
|
|
5942
6228
|
}),
|
|
5943
6229
|
t: t,
|
|
5944
|
-
isLoading: isLoading,
|
|
6230
|
+
isLoading: isLoading || isAllFillingPointsLoading,
|
|
5945
6231
|
isSearchRequired: false,
|
|
5946
6232
|
isDownloadRequired: true,
|
|
5947
6233
|
isFilterRequired: true,
|
|
5948
6234
|
isSortRequired: true
|
|
5949
|
-
}))
|
|
6235
|
+
})), toast && /*#__PURE__*/React.createElement(Toast, {
|
|
6236
|
+
error: toast.error,
|
|
6237
|
+
label: toast.label,
|
|
6238
|
+
onClose: closeToast
|
|
6239
|
+
}));
|
|
5950
6240
|
};
|
|
5951
6241
|
|
|
5952
6242
|
const VendorAssign = ({
|
|
@@ -5958,83 +6248,60 @@ const VendorAssign = ({
|
|
|
5958
6248
|
t
|
|
5959
6249
|
} = useTranslation();
|
|
5960
6250
|
const [showToast, setShowToast] = useState(null);
|
|
5961
|
-
const [
|
|
6251
|
+
const [workOrderId, setWorkOrderId] = useState("");
|
|
6252
|
+
const [vendor, setVendor] = useState(null);
|
|
5962
6253
|
const [applicantName, setApplicantName] = useState("");
|
|
5963
6254
|
const [mobileNumber, setMobileNumber] = useState("");
|
|
5964
6255
|
const [alternateNumber, setAlternateNumber] = useState("");
|
|
5965
6256
|
const [emailId, setEmailId] = useState("");
|
|
5966
6257
|
const [validFrom, setValidFrom] = useState("");
|
|
5967
6258
|
const [validTo, setValidTo] = useState("");
|
|
5968
|
-
const [fillingPoint, setFillingPoint] = useState(null);
|
|
5969
6259
|
const {
|
|
5970
|
-
data:
|
|
5971
|
-
isLoading:
|
|
5972
|
-
} = Digit.Hooks.
|
|
6260
|
+
data: vendorOptions,
|
|
6261
|
+
isLoading: isVendorLoading
|
|
6262
|
+
} = Digit.Hooks.fsm.useVendorSearch({
|
|
5973
6263
|
tenantId,
|
|
5974
|
-
filters: {
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
var _fp$fillingpointmetad, _fp$fillingpointmetad2, _fp$fillingpointmetad3, _fp$fillingpointmetad4, _fp$fillingpointmetad5;
|
|
5980
|
-
return {
|
|
5981
|
-
name: ((_fp$fillingpointmetad = fp.fillingpointmetadata) === null || _fp$fillingpointmetad === void 0 ? void 0 : _fp$fillingpointmetad.fillingPointName) || ((_fp$fillingpointmetad2 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad2 === void 0 ? void 0 : _fp$fillingpointmetad2.name),
|
|
5982
|
-
code: ((_fp$fillingpointmetad3 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad3 === void 0 ? void 0 : _fp$fillingpointmetad3.fillingPointId) || fp.bookingId,
|
|
5983
|
-
i18nKey: ((_fp$fillingpointmetad4 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad4 === void 0 ? void 0 : _fp$fillingpointmetad4.fillingPointName) || ((_fp$fillingpointmetad5 = fp.fillingpointmetadata) === null || _fp$fillingpointmetad5 === void 0 ? void 0 : _fp$fillingpointmetad5.name)
|
|
5984
|
-
};
|
|
5985
|
-
});
|
|
6264
|
+
filters: {
|
|
6265
|
+
status: "ACTIVE"
|
|
6266
|
+
},
|
|
6267
|
+
config: {
|
|
6268
|
+
select: data => (data === null || data === void 0 ? void 0 : data.vendor) || []
|
|
5986
6269
|
}
|
|
5987
6270
|
});
|
|
5988
|
-
const
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
i18nKey: "WT_FILLING_POINT_1"
|
|
5992
|
-
}, {
|
|
5993
|
-
name: "Filling Point 2",
|
|
5994
|
-
code: "FILLING_POINT_2",
|
|
5995
|
-
i18nKey: "WT_FILLING_POINT_2"
|
|
5996
|
-
}, {
|
|
5997
|
-
name: "Filling Point 3",
|
|
5998
|
-
code: "FILLING_POINT_3",
|
|
5999
|
-
i18nKey: "WT_FILLING_POINT_3"
|
|
6000
|
-
}, {
|
|
6001
|
-
name: "Filling Point 4",
|
|
6002
|
-
code: "FILLING_POINT_4",
|
|
6003
|
-
i18nKey: "WT_FILLING_POINT_4"
|
|
6004
|
-
}];
|
|
6271
|
+
const {
|
|
6272
|
+
mutate: createWorkOrder
|
|
6273
|
+
} = Digit.Hooks.wt.useVendorWorkOrderCreate(tenantId);
|
|
6005
6274
|
const handleSubmit = () => {
|
|
6006
|
-
if (!applicantName || !mobileNumber || !emailId || !validFrom || !validTo || !formData.address) {
|
|
6007
|
-
setShowToast({
|
|
6008
|
-
isError: true,
|
|
6009
|
-
label: t("ES_COMMON_FILL_ALL_MANDATORY_FIELDS")
|
|
6010
|
-
});
|
|
6011
|
-
return;
|
|
6012
|
-
}
|
|
6013
6275
|
const payload = {
|
|
6014
|
-
|
|
6276
|
+
vendorWorkOrder: {
|
|
6277
|
+
id: workOrderId,
|
|
6015
6278
|
tenantId,
|
|
6016
6279
|
name: applicantName,
|
|
6280
|
+
vendorId: (vendor === null || vendor === void 0 ? void 0 : vendor.code) || (vendor === null || vendor === void 0 ? void 0 : vendor.id),
|
|
6281
|
+
validFrom: new Date(validFrom).getTime(),
|
|
6282
|
+
validTo: new Date(validTo).getTime(),
|
|
6017
6283
|
mobileNumber,
|
|
6018
6284
|
alternateNumber,
|
|
6019
6285
|
emailId,
|
|
6020
|
-
|
|
6021
|
-
validTo,
|
|
6022
|
-
fillingPoint: fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.code,
|
|
6023
|
-
address: formData.address
|
|
6286
|
+
serviceType: "WT"
|
|
6024
6287
|
}
|
|
6025
6288
|
};
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6289
|
+
createWorkOrder(payload, {
|
|
6290
|
+
onSuccess: result => {
|
|
6291
|
+
setShowToast({
|
|
6292
|
+
isError: false,
|
|
6293
|
+
label: t("ES_COMMON_SAVE_SUCCESS")
|
|
6294
|
+
});
|
|
6295
|
+
},
|
|
6296
|
+
onError: err => {
|
|
6297
|
+
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
6298
|
+
setShowToast({
|
|
6299
|
+
isError: true,
|
|
6300
|
+
label: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || t("ES_COMMON_ERROR_SAVING")
|
|
6301
|
+
});
|
|
6302
|
+
}
|
|
6037
6303
|
});
|
|
6304
|
+
console.log(payload, "iuyui");
|
|
6038
6305
|
};
|
|
6039
6306
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
6040
6307
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -6062,61 +6329,15 @@ const VendorAssign = ({
|
|
|
6062
6329
|
display: "flex",
|
|
6063
6330
|
flexDirection: "column"
|
|
6064
6331
|
}
|
|
6065
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("
|
|
6066
|
-
className: "astericColor"
|
|
6067
|
-
}, "*")), /*#__PURE__*/React.createElement(TextInput, {
|
|
6068
|
-
t: t,
|
|
6069
|
-
type: "text",
|
|
6070
|
-
isMandatory: true,
|
|
6071
|
-
name: "applicantName",
|
|
6072
|
-
value: applicantName,
|
|
6073
|
-
style: {
|
|
6074
|
-
width: "100%"
|
|
6075
|
-
},
|
|
6076
|
-
onChange: e => setApplicantName(e.target.value)
|
|
6077
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6078
|
-
style: {
|
|
6079
|
-
display: "flex",
|
|
6080
|
-
flexDirection: "column"
|
|
6081
|
-
}
|
|
6082
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_APPLICANT_MOBILE_NUMBER")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
6083
|
-
className: "astericColor"
|
|
6084
|
-
}, "*")), /*#__PURE__*/React.createElement(MobileNumber, {
|
|
6085
|
-
value: mobileNumber,
|
|
6086
|
-
name: "mobileNumber",
|
|
6087
|
-
onChange: value => setMobileNumber(value),
|
|
6088
|
-
style: {
|
|
6089
|
-
width: "100%"
|
|
6090
|
-
}
|
|
6091
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6092
|
-
style: {
|
|
6093
|
-
display: "flex",
|
|
6094
|
-
flexDirection: "column"
|
|
6095
|
-
}
|
|
6096
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VENDOR_ALT_MOBILE_NUMBER")}`), /*#__PURE__*/React.createElement(MobileNumber, {
|
|
6097
|
-
value: alternateNumber,
|
|
6098
|
-
name: "alternateNumber",
|
|
6099
|
-
onChange: value => setAlternateNumber(value),
|
|
6100
|
-
style: {
|
|
6101
|
-
width: "100%"
|
|
6102
|
-
}
|
|
6103
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6104
|
-
style: {
|
|
6105
|
-
display: "flex",
|
|
6106
|
-
flexDirection: "column"
|
|
6107
|
-
}
|
|
6108
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_APPLICANT_EMAIL_ID")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
6332
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WT_VENDOR_NAME")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
6109
6333
|
className: "astericColor"
|
|
6110
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
6334
|
+
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6111
6335
|
t: t,
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
width: "100%"
|
|
6118
|
-
},
|
|
6119
|
-
onChange: e => setEmailId(e.target.value)
|
|
6336
|
+
option: vendorOptions,
|
|
6337
|
+
optionKey: "name",
|
|
6338
|
+
select: setVendor,
|
|
6339
|
+
selected: vendor,
|
|
6340
|
+
placeholder: t("WT_SELECT_VENDOR")
|
|
6120
6341
|
})), /*#__PURE__*/React.createElement("div", {
|
|
6121
6342
|
style: {
|
|
6122
6343
|
display: "flex",
|
|
@@ -6143,30 +6364,6 @@ const VendorAssign = ({
|
|
|
6143
6364
|
style: {
|
|
6144
6365
|
width: "100%"
|
|
6145
6366
|
}
|
|
6146
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6147
|
-
style: {
|
|
6148
|
-
display: "flex",
|
|
6149
|
-
flexDirection: "column"
|
|
6150
|
-
}
|
|
6151
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("COMMON_FILLING_POINT")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
6152
|
-
className: "astericColor"
|
|
6153
|
-
}, "*")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
6154
|
-
className: "form-field",
|
|
6155
|
-
selected: fillingPoint,
|
|
6156
|
-
disable: isFillingLoading,
|
|
6157
|
-
select: setFillingPoint,
|
|
6158
|
-
option: fillingPointOptions,
|
|
6159
|
-
optionKey: "i18nKey",
|
|
6160
|
-
optionCardStyles: {
|
|
6161
|
-
overflowY: "auto",
|
|
6162
|
-
maxHeight: "300px"
|
|
6163
|
-
},
|
|
6164
|
-
t: t,
|
|
6165
|
-
name: "fillingPoint",
|
|
6166
|
-
placeholder: t("WT_SELECT_FILLING_POINT") || "Select Filling Point",
|
|
6167
|
-
style: {
|
|
6168
|
-
width: "100%"
|
|
6169
|
-
}
|
|
6170
6367
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
6171
6368
|
style: {
|
|
6172
6369
|
display: "flex",
|
|
@@ -21581,8 +21778,9 @@ const WTCitizenCard = () => {
|
|
|
21581
21778
|
const {
|
|
21582
21779
|
t
|
|
21583
21780
|
} = useTranslation();
|
|
21781
|
+
const history = useHistory();
|
|
21584
21782
|
const [total, setTotal] = useState("-");
|
|
21585
|
-
const tenantId = Digit.ULBService.
|
|
21783
|
+
const tenantId = Digit.ULBService.getCurrentTenantId() || Digit.ULBService.getCitizenCurrentTenant(true);
|
|
21586
21784
|
const {
|
|
21587
21785
|
data,
|
|
21588
21786
|
isLoading,
|
|
@@ -21609,6 +21807,9 @@ const WTCitizenCard = () => {
|
|
|
21609
21807
|
useEffect(() => {
|
|
21610
21808
|
if (!isFetching && isSuccess) setTotal(data);
|
|
21611
21809
|
}, [isFetching]);
|
|
21810
|
+
const handleDetailsClick = () => {
|
|
21811
|
+
history.push(`${APPLICATION_PATH}/citizen/wt/inbox`);
|
|
21812
|
+
};
|
|
21612
21813
|
const links = [{
|
|
21613
21814
|
label: t("ES_COMMON_INBOX"),
|
|
21614
21815
|
link: `${APPLICATION_PATH}/citizen/wt/inbox`
|
|
@@ -21622,9 +21823,10 @@ const WTCitizenCard = () => {
|
|
|
21622
21823
|
kpis: [{
|
|
21623
21824
|
count: total === null || total === void 0 ? void 0 : total.totalCount,
|
|
21624
21825
|
label: t("ES_TITLE_INBOX"),
|
|
21625
|
-
link: `${APPLICATION_PATH}/
|
|
21826
|
+
link: `${APPLICATION_PATH}/citizen/wt/inbox`
|
|
21626
21827
|
}],
|
|
21627
|
-
links
|
|
21828
|
+
links,
|
|
21829
|
+
onDetailsClick: handleDetailsClick
|
|
21628
21830
|
};
|
|
21629
21831
|
return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
|
|
21630
21832
|
};
|
|
@@ -23062,10 +23264,13 @@ const WTLinks = ({
|
|
|
23062
23264
|
}, []);
|
|
23063
23265
|
const links = [{
|
|
23064
23266
|
link: `${matchPath}/wt`,
|
|
23065
|
-
i18nKey: t("
|
|
23267
|
+
i18nKey: t("WT_REQUEST_TANKER")
|
|
23066
23268
|
}, {
|
|
23067
23269
|
link: `${matchPath}/wt/status`,
|
|
23068
23270
|
i18nKey: t("WT_VIEW_APPLICATIONS")
|
|
23271
|
+
}, {
|
|
23272
|
+
link: `${matchPath}/wt/wt-Vendor`,
|
|
23273
|
+
i18nKey: t("WT_VENDOR_LOGIN")
|
|
23069
23274
|
}];
|
|
23070
23275
|
return /*#__PURE__*/React.createElement(CitizenHomeCard, {
|
|
23071
23276
|
header: t("WATER_TANKER_SERVICE"),
|
|
@@ -23101,6 +23306,7 @@ const componentsToRegister = {
|
|
|
23101
23306
|
WFCaption,
|
|
23102
23307
|
WTEmpInbox: Inbox,
|
|
23103
23308
|
WTCitizenCard: WTCitizenCard,
|
|
23309
|
+
WTCard: WTCard,
|
|
23104
23310
|
ServiceTypes,
|
|
23105
23311
|
ToiletRequestDetails,
|
|
23106
23312
|
TreePruningRequestDetails,
|