@djb25/digit-ui-module-vendor 1.0.1 → 1.0.2
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 +208 -23
- 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 { Header, SearchForm, SearchField, Dropdown as Dropdown$2, MobileNumber, CardLabelError, DatePicker as DatePicker$3, SubmitBar, Card, Table, Loader, Toast, AppContainer, PrivateRoute, EmployeeModuleCard, FormComposer, TickMark, FormStep, CardLabel, TextInput, LabelFieldPair, UploadFile, CardSubHeader, CardText, RadioOrSelect, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, AddIcon, Menu, Label, LinkLabel, ToggleSwitch, CardSectionHeader, StatusTable, Row, EditIcon, DeleteIcon, Modal, InfoIcon, CardHeader, LinkButton, Banner } from '@djb25/digit-ui-react-components';
|
|
1
|
+
import { Header, SearchForm, SearchField, Dropdown as Dropdown$2, MobileNumber, CardLabelError, DatePicker as DatePicker$3, SubmitBar, Card, Table, Loader, Toast, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, HomeIcon, PropertyHouse, EmployeeModuleCard, FormComposer, TickMark, FormStep, CardLabel, TextInput, LabelFieldPair, UploadFile, CardSubHeader, CardText, RadioOrSelect, ShippingTruck, CheckBox, RadioButtons, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, AddIcon, Menu, Label, LinkLabel, ToggleSwitch, CardSectionHeader, StatusTable, Row, EditIcon, DeleteIcon, Modal, InfoIcon, CardHeader, LinkButton, Banner } from '@djb25/digit-ui-react-components';
|
|
2
2
|
import React, { useEffect, useMemo, useCallback, useState, Fragment } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useParams, useLocation, Switch, useHistory, Link, useRouteMatch, Route, Redirect } from 'react-router-dom';
|
|
@@ -323,7 +323,6 @@ const EmployeeApp = ({
|
|
|
323
323
|
const location = useLocation();
|
|
324
324
|
sessionStorage.removeItem("revalidateddone");
|
|
325
325
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
326
|
-
console.log("index page in employee");
|
|
327
326
|
const AddVendor = Digit.ComponentRegistryService.getComponent("AddVendor");
|
|
328
327
|
const SearchVendor = Digit.ComponentRegistryService.getComponent("SearchVendor");
|
|
329
328
|
const AddDriver = Digit.ComponentRegistryService.getComponent("AddDriver");
|
|
@@ -332,9 +331,59 @@ const EmployeeApp = ({
|
|
|
332
331
|
const VendorCreate = Digit.ComponentRegistryService.getComponent("VENDORCreate");
|
|
333
332
|
const DriverDetails = Digit.ComponentRegistryService.getComponent("DriverDetails");
|
|
334
333
|
const VehicleDetails = Digit.ComponentRegistryService.getComponent("VehicleDetails");
|
|
334
|
+
const getDynamicBreadcrumbs = () => {
|
|
335
|
+
const pathname = location.pathname;
|
|
336
|
+
let crumbs = [{
|
|
337
|
+
icon: HomeIcon,
|
|
338
|
+
path: "/digit-ui/employee"
|
|
339
|
+
}, {
|
|
340
|
+
label: t("ES_COMMON_VENDOR"),
|
|
341
|
+
path: `/digit-ui/employee/vendor/search-vendor`
|
|
342
|
+
}];
|
|
343
|
+
if (pathname.includes("/registry/new-vendor")) {
|
|
344
|
+
crumbs.push({
|
|
345
|
+
label: t("VENDOR_CREATE_NEW_VENDOR")
|
|
346
|
+
});
|
|
347
|
+
} else if (pathname.includes("/search-vendor")) {
|
|
348
|
+
crumbs.push({
|
|
349
|
+
label: t("VENDOR_SEARCH_VENDORS")
|
|
350
|
+
});
|
|
351
|
+
} else if (pathname.includes("/registry/new-driver")) {
|
|
352
|
+
crumbs.push({
|
|
353
|
+
label: t("VENDOR_CREATE_NEW_DRIVER")
|
|
354
|
+
});
|
|
355
|
+
} else if (pathname.includes("/registry/vendor-details") || pathname.includes("/registry/modify-vendor/")) {
|
|
356
|
+
crumbs.push({
|
|
357
|
+
label: t("VENDOR_VENDOR_DETAILS")
|
|
358
|
+
});
|
|
359
|
+
} else if (pathname.includes("/registry/vehicle-details") || pathname.includes("/registry/modify-vehicle/")) {
|
|
360
|
+
crumbs.push({
|
|
361
|
+
label: t("VENDOR_VEHICLE_DETAILS")
|
|
362
|
+
});
|
|
363
|
+
} else if (pathname.includes("/registry/new-vehicle")) {
|
|
364
|
+
crumbs.push({
|
|
365
|
+
label: t("VENDOR_CREATE_NEW_VEHICLE")
|
|
366
|
+
});
|
|
367
|
+
} else if (pathname.includes("/registry/driver-details") || pathname.includes("/registry/modify-driver/")) {
|
|
368
|
+
crumbs.push({
|
|
369
|
+
label: t("VENDOR_DRIVER_DETAILS")
|
|
370
|
+
});
|
|
371
|
+
} else if (pathname.includes("/registry/additionaldetails")) {
|
|
372
|
+
crumbs.push({
|
|
373
|
+
label: t("VENDOR_ADDITIONAL_DETAILS")
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return crumbs;
|
|
377
|
+
};
|
|
335
378
|
return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
336
379
|
className: "ground-container"
|
|
337
|
-
}, /*#__PURE__*/React.createElement(
|
|
380
|
+
}, /*#__PURE__*/React.createElement(ModuleHeader, {
|
|
381
|
+
leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
|
|
382
|
+
className: "icon"
|
|
383
|
+
}), "Back"),
|
|
384
|
+
onLeftClick: () => window.history.back(),
|
|
385
|
+
breadcrumbs: getDynamicBreadcrumbs()
|
|
386
|
+
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
338
387
|
path: `${path}/registry/new-vendor`,
|
|
339
388
|
component: () => /*#__PURE__*/React.createElement(AddVendor, {
|
|
340
389
|
parentRoute: path
|
|
@@ -402,6 +451,7 @@ const VENDORCard = () => {
|
|
|
402
451
|
}];
|
|
403
452
|
const VENDORRole = Digit.UserService.hasAccess(["VENDOR"]) || false;
|
|
404
453
|
const propsForModuleCard = {
|
|
454
|
+
Icon: /*#__PURE__*/React.createElement(PropertyHouse, null),
|
|
405
455
|
moduleName: t("TITLE_VENDOR_MANAGEMENT"),
|
|
406
456
|
kpis: [{
|
|
407
457
|
count: total === null || total === void 0 ? void 0 : total.totalCount,
|
|
@@ -649,6 +699,16 @@ const VendorConfig = (t, disabled = false) => {
|
|
|
649
699
|
className: "payment-form-text-input-correction"
|
|
650
700
|
}
|
|
651
701
|
}]
|
|
702
|
+
}, {
|
|
703
|
+
head: "ES_FSM_REGISTRY_BANK_DETAILS",
|
|
704
|
+
body: [{
|
|
705
|
+
route: "bank-details",
|
|
706
|
+
component: "BankDetailsComponent",
|
|
707
|
+
withoutLabel: true,
|
|
708
|
+
key: "bankDetails",
|
|
709
|
+
isMandatory: false,
|
|
710
|
+
type: "component"
|
|
711
|
+
}]
|
|
652
712
|
}, {
|
|
653
713
|
head: "",
|
|
654
714
|
body: [{
|
|
@@ -719,7 +779,7 @@ const AddVendor = ({
|
|
|
719
779
|
setShowToast(null);
|
|
720
780
|
};
|
|
721
781
|
const onSubmit = data => {
|
|
722
|
-
var _data$street, _data$doorNo, _data$plotNo, _data$landmark, _data$address, _data$address$city, _data$address2, _data$address2$city, _data$address3, _data$address3$city, _data$address4, _data$address4$city, _data$buildingName, _data$address5, _data$address5$locali, _data$address6, _data$address6$locali, _data$address7, _data$address7$locali, _data$selectGender, _data$serviceType, _data$address8, _data$address9;
|
|
782
|
+
var _data$street, _data$doorNo, _data$plotNo, _data$landmark, _data$address, _data$address$city, _data$address2, _data$address2$city, _data$address3, _data$address3$city, _data$address4, _data$address4$city, _data$buildingName, _data$address5, _data$address5$locali, _data$address6, _data$address6$locali, _data$address7, _data$address7$locali, _data$selectGender, _data$serviceType, _data$bankDetails, _data$bankDetails2, _data$bankDetails3, _data$bankDetails4, _data$address8, _data$address9;
|
|
723
783
|
console.log("dataaaaaaaa", data);
|
|
724
784
|
const name = data === null || data === void 0 ? void 0 : data.vendorName;
|
|
725
785
|
const pincode = data === null || data === void 0 ? void 0 : data.pincode;
|
|
@@ -740,6 +800,10 @@ const AddVendor = ({
|
|
|
740
800
|
const phone = data === null || data === void 0 ? void 0 : data.phone;
|
|
741
801
|
const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
|
|
742
802
|
const additionalDetails = data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code;
|
|
803
|
+
const accountNo = data === null || data === void 0 ? void 0 : (_data$bankDetails = data.bankDetails) === null || _data$bankDetails === void 0 ? void 0 : _data$bankDetails.accountNumber;
|
|
804
|
+
const ifscCode = data === null || data === void 0 ? void 0 : (_data$bankDetails2 = data.bankDetails) === null || _data$bankDetails2 === void 0 ? void 0 : _data$bankDetails2.ifscCode;
|
|
805
|
+
const bankName = data === null || data === void 0 ? void 0 : (_data$bankDetails3 = data.bankDetails) === null || _data$bankDetails3 === void 0 ? void 0 : _data$bankDetails3.bankName;
|
|
806
|
+
const bankBranchName = data === null || data === void 0 ? void 0 : (_data$bankDetails4 = data.bankDetails) === null || _data$bankDetails4 === void 0 ? void 0 : _data$bankDetails4.branchName;
|
|
743
807
|
const formData = {
|
|
744
808
|
vendor: {
|
|
745
809
|
tenantId: tenantId,
|
|
@@ -783,6 +847,12 @@ const AddVendor = ({
|
|
|
783
847
|
additionalDetails: {
|
|
784
848
|
serviceType: additionalDetails
|
|
785
849
|
},
|
|
850
|
+
bankDetails: [{
|
|
851
|
+
bankName: bankName,
|
|
852
|
+
bankBranchName: bankBranchName,
|
|
853
|
+
ifscCode: ifscCode,
|
|
854
|
+
accountNumber: accountNo
|
|
855
|
+
}],
|
|
786
856
|
vehicle: [],
|
|
787
857
|
drivers: [],
|
|
788
858
|
source: "WhatsApp"
|
|
@@ -808,6 +878,7 @@ const AddVendor = ({
|
|
|
808
878
|
};
|
|
809
879
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
810
880
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ES_FSM_REGISTRY_TITLE_NEW_VENDOR"))), /*#__PURE__*/React.createElement("div", {
|
|
881
|
+
className: "vendor-two-column-form",
|
|
811
882
|
style: !isMobile ? {
|
|
812
883
|
marginLeft: "-15px"
|
|
813
884
|
} : {}
|
|
@@ -1050,6 +1121,8 @@ const VendorDetails = ({
|
|
|
1050
1121
|
config: config,
|
|
1051
1122
|
onSelect: goNext,
|
|
1052
1123
|
t: t
|
|
1124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1125
|
+
className: "vendor-details-two-column"
|
|
1053
1126
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("VENDOR_ID")}`), /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
1054
1127
|
t: t,
|
|
1055
1128
|
type: "text",
|
|
@@ -1059,7 +1132,7 @@ const VendorDetails = ({
|
|
|
1059
1132
|
value: VendorId,
|
|
1060
1133
|
onChange: setvendorid,
|
|
1061
1134
|
style: {
|
|
1062
|
-
width: "
|
|
1135
|
+
width: "100%"
|
|
1063
1136
|
},
|
|
1064
1137
|
maxLength: 11,
|
|
1065
1138
|
ValidationRequired: false
|
|
@@ -1078,7 +1151,7 @@ const VendorDetails = ({
|
|
|
1078
1151
|
placeholder: "Enter IFSC Code",
|
|
1079
1152
|
onChange: setvendorifsc,
|
|
1080
1153
|
style: {
|
|
1081
|
-
width: "
|
|
1154
|
+
width: "100%"
|
|
1082
1155
|
},
|
|
1083
1156
|
maxLength: 11,
|
|
1084
1157
|
ValidationRequired: true
|
|
@@ -1097,7 +1170,7 @@ const VendorDetails = ({
|
|
|
1097
1170
|
name: "bankName",
|
|
1098
1171
|
placeholder: "Bank Name Auto Select",
|
|
1099
1172
|
style: {
|
|
1100
|
-
width: "
|
|
1173
|
+
width: "100%"
|
|
1101
1174
|
},
|
|
1102
1175
|
value: Bank,
|
|
1103
1176
|
onChange: setvendorbank,
|
|
@@ -1112,7 +1185,7 @@ const VendorDetails = ({
|
|
|
1112
1185
|
name: "BankbranchName",
|
|
1113
1186
|
value: BankbranchName,
|
|
1114
1187
|
style: {
|
|
1115
|
-
width: "
|
|
1188
|
+
width: "100%"
|
|
1116
1189
|
},
|
|
1117
1190
|
placeholder: "Bank Branch Name Auto Select",
|
|
1118
1191
|
onChange: setBankbranch,
|
|
@@ -1127,7 +1200,7 @@ const VendorDetails = ({
|
|
|
1127
1200
|
name: "MicrNo",
|
|
1128
1201
|
value: micrNo,
|
|
1129
1202
|
style: {
|
|
1130
|
-
width: "
|
|
1203
|
+
width: "100%"
|
|
1131
1204
|
},
|
|
1132
1205
|
placeholder: "MICR No",
|
|
1133
1206
|
onChange: setmicrNo,
|
|
@@ -1141,7 +1214,7 @@ const VendorDetails = ({
|
|
|
1141
1214
|
value: AccountNo,
|
|
1142
1215
|
onChange: setvendoraccountno,
|
|
1143
1216
|
style: {
|
|
1144
|
-
width: "
|
|
1217
|
+
width: "100%"
|
|
1145
1218
|
},
|
|
1146
1219
|
ValidationRequired: true
|
|
1147
1220
|
}, validation = {
|
|
@@ -1158,7 +1231,7 @@ const VendorDetails = ({
|
|
|
1158
1231
|
value: PhoneNo,
|
|
1159
1232
|
onChange: setphoneno,
|
|
1160
1233
|
style: {
|
|
1161
|
-
width: "
|
|
1234
|
+
width: "100%"
|
|
1162
1235
|
},
|
|
1163
1236
|
ValidationRequired: true
|
|
1164
1237
|
}, validation = {
|
|
@@ -1175,7 +1248,7 @@ const VendorDetails = ({
|
|
|
1175
1248
|
value: ContactPerson,
|
|
1176
1249
|
onChange: setcontactperson,
|
|
1177
1250
|
style: {
|
|
1178
|
-
width: "
|
|
1251
|
+
width: "100%"
|
|
1179
1252
|
},
|
|
1180
1253
|
ValidationRequired: true
|
|
1181
1254
|
}, validation = {
|
|
@@ -1192,7 +1265,7 @@ const VendorDetails = ({
|
|
|
1192
1265
|
value: Company,
|
|
1193
1266
|
onChange: setcompanyname,
|
|
1194
1267
|
style: {
|
|
1195
|
-
width: "
|
|
1268
|
+
width: "100%"
|
|
1196
1269
|
},
|
|
1197
1270
|
ValidationRequired: true
|
|
1198
1271
|
}, validation = {
|
|
@@ -1209,7 +1282,7 @@ const VendorDetails = ({
|
|
|
1209
1282
|
value: PanNo,
|
|
1210
1283
|
onChange: setpanno,
|
|
1211
1284
|
style: {
|
|
1212
|
-
width: "
|
|
1285
|
+
width: "100%"
|
|
1213
1286
|
},
|
|
1214
1287
|
ValidationRequired: true
|
|
1215
1288
|
}, validation = {
|
|
@@ -1226,7 +1299,7 @@ const VendorDetails = ({
|
|
|
1226
1299
|
value: GstNo,
|
|
1227
1300
|
onChange: setgstno,
|
|
1228
1301
|
style: {
|
|
1229
|
-
width: "
|
|
1302
|
+
width: "100%"
|
|
1230
1303
|
},
|
|
1231
1304
|
ValidationRequired: true
|
|
1232
1305
|
}, validation = {
|
|
@@ -1243,7 +1316,7 @@ const VendorDetails = ({
|
|
|
1243
1316
|
value: GstState,
|
|
1244
1317
|
onChange: setgststate,
|
|
1245
1318
|
style: {
|
|
1246
|
-
width: "
|
|
1319
|
+
width: "100%"
|
|
1247
1320
|
},
|
|
1248
1321
|
ValidationRequired: true
|
|
1249
1322
|
}, validation = {
|
|
@@ -1260,7 +1333,7 @@ const VendorDetails = ({
|
|
|
1260
1333
|
value: RegistrationNo,
|
|
1261
1334
|
onChange: setregistrationno,
|
|
1262
1335
|
style: {
|
|
1263
|
-
width: "
|
|
1336
|
+
width: "100%"
|
|
1264
1337
|
},
|
|
1265
1338
|
ValidationRequired: true
|
|
1266
1339
|
}, validation = {
|
|
@@ -1277,7 +1350,7 @@ const VendorDetails = ({
|
|
|
1277
1350
|
value: EpfNo,
|
|
1278
1351
|
onChange: setepfno,
|
|
1279
1352
|
style: {
|
|
1280
|
-
width: "
|
|
1353
|
+
width: "100%"
|
|
1281
1354
|
},
|
|
1282
1355
|
ValidationRequired: true
|
|
1283
1356
|
}, validation = {
|
|
@@ -1294,7 +1367,7 @@ const VendorDetails = ({
|
|
|
1294
1367
|
value: EsiNo,
|
|
1295
1368
|
onChange: setesino,
|
|
1296
1369
|
style: {
|
|
1297
|
-
width: "
|
|
1370
|
+
width: "100%"
|
|
1298
1371
|
},
|
|
1299
1372
|
ValidationRequired: true
|
|
1300
1373
|
}, validation = {
|
|
@@ -1425,7 +1498,7 @@ const VendorDetails = ({
|
|
|
1425
1498
|
placeholder: "Select",
|
|
1426
1499
|
t: t
|
|
1427
1500
|
})
|
|
1428
|
-
}))));
|
|
1501
|
+
})))));
|
|
1429
1502
|
};
|
|
1430
1503
|
|
|
1431
1504
|
const VendorDocuments = ({
|
|
@@ -1696,10 +1769,12 @@ const VendorSelectAddress = ({
|
|
|
1696
1769
|
});
|
|
1697
1770
|
}
|
|
1698
1771
|
if (userType === "employee") {
|
|
1699
|
-
return /*#__PURE__*/React.createElement("div",
|
|
1772
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1773
|
+
className: ""
|
|
1774
|
+
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
1700
1775
|
className: "card-label-smaller"
|
|
1701
1776
|
}, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
|
|
1702
|
-
className: "
|
|
1777
|
+
className: "",
|
|
1703
1778
|
isMandatory: true,
|
|
1704
1779
|
selected: (cities === null || cities === void 0 ? void 0 : cities.length) === 1 ? cities[0] : selectedCity,
|
|
1705
1780
|
disable: (cities === null || cities === void 0 ? void 0 : cities.length) === 1,
|
|
@@ -1710,7 +1785,7 @@ const VendorSelectAddress = ({
|
|
|
1710
1785
|
})), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
1711
1786
|
className: "card-label-smaller"
|
|
1712
1787
|
}, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
|
|
1713
|
-
className: "
|
|
1788
|
+
className: "",
|
|
1714
1789
|
isMandatory: true,
|
|
1715
1790
|
selected: selectedLocality,
|
|
1716
1791
|
option: localities,
|
|
@@ -9133,6 +9208,7 @@ const AddDriver = ({
|
|
|
9133
9208
|
};
|
|
9134
9209
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
9135
9210
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER"))), /*#__PURE__*/React.createElement("div", {
|
|
9211
|
+
className: "vendor-two-column-form",
|
|
9136
9212
|
style: !isMobile ? {
|
|
9137
9213
|
marginLeft: "-15px"
|
|
9138
9214
|
} : {}
|
|
@@ -9884,6 +9960,7 @@ const AddVehicle = ({
|
|
|
9884
9960
|
};
|
|
9885
9961
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
9886
9962
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE"))), /*#__PURE__*/React.createElement("div", {
|
|
9963
|
+
className: "vendor-two-column-form",
|
|
9887
9964
|
style: !isMobile ? {
|
|
9888
9965
|
marginLeft: "-15px"
|
|
9889
9966
|
} : {}
|
|
@@ -11240,6 +11317,113 @@ const SelectVehicleType = ({
|
|
|
11240
11317
|
})));
|
|
11241
11318
|
};
|
|
11242
11319
|
|
|
11320
|
+
const BankDetailsComponent = ({
|
|
11321
|
+
t,
|
|
11322
|
+
config,
|
|
11323
|
+
onSelect,
|
|
11324
|
+
userType,
|
|
11325
|
+
formData,
|
|
11326
|
+
...props
|
|
11327
|
+
}) => {
|
|
11328
|
+
const [ifsc, setIfsc] = useState((formData === null || formData === void 0 ? void 0 : formData.ifscCode) || "");
|
|
11329
|
+
const [bankName, setBankName] = useState((formData === null || formData === void 0 ? void 0 : formData.bankName) || "");
|
|
11330
|
+
const [branchName, setBranchName] = useState((formData === null || formData === void 0 ? void 0 : formData.branchName) || "");
|
|
11331
|
+
const [accountNumber, setAccountNumber] = useState((formData === null || formData === void 0 ? void 0 : formData.accountNumber) || "");
|
|
11332
|
+
const [showToast, setShowToast] = useState(null);
|
|
11333
|
+
useEffect(() => {
|
|
11334
|
+
if (ifsc.length === 11) {
|
|
11335
|
+
fetch(`https://ifsc.razorpay.com/${ifsc}`).then(response => response.json()).then(data => {
|
|
11336
|
+
if (data && data.BANK && data.BRANCH) {
|
|
11337
|
+
setBankName(data.BANK);
|
|
11338
|
+
setBranchName(data.BRANCH);
|
|
11339
|
+
if (typeof onSelect === 'function') {
|
|
11340
|
+
onSelect(config.key, {
|
|
11341
|
+
bankName: data.BANK,
|
|
11342
|
+
branchName: data.BRANCH,
|
|
11343
|
+
ifscCode: ifsc,
|
|
11344
|
+
accountNumber: accountNumber
|
|
11345
|
+
});
|
|
11346
|
+
}
|
|
11347
|
+
setShowToast({
|
|
11348
|
+
error: false,
|
|
11349
|
+
label: t("VALID_IFSC_CODE")
|
|
11350
|
+
});
|
|
11351
|
+
} else {
|
|
11352
|
+
setShowToast({
|
|
11353
|
+
error: true,
|
|
11354
|
+
label: t("INVALID_IFSC_CODE")
|
|
11355
|
+
});
|
|
11356
|
+
}
|
|
11357
|
+
}).catch(() => {
|
|
11358
|
+
setShowToast({
|
|
11359
|
+
error: true,
|
|
11360
|
+
label: t("INVALID_IFSC_CODE")
|
|
11361
|
+
});
|
|
11362
|
+
});
|
|
11363
|
+
}
|
|
11364
|
+
}, [ifsc]);
|
|
11365
|
+
useEffect(() => {
|
|
11366
|
+
if (typeof onSelect === 'function') {
|
|
11367
|
+
onSelect(config.key, {
|
|
11368
|
+
bankName,
|
|
11369
|
+
branchName,
|
|
11370
|
+
ifscCode: ifsc,
|
|
11371
|
+
accountNumber
|
|
11372
|
+
});
|
|
11373
|
+
}
|
|
11374
|
+
}, [accountNumber, bankName, branchName, ifsc]);
|
|
11375
|
+
const handleIfscChange = e => {
|
|
11376
|
+
const input = e.target.value.replace(/[^a-zA-Z0-9]/g, "");
|
|
11377
|
+
if (input.length <= 11) {
|
|
11378
|
+
setIfsc(input);
|
|
11379
|
+
}
|
|
11380
|
+
};
|
|
11381
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_IFSC_CODE")), /*#__PURE__*/React.createElement(TextInput, {
|
|
11382
|
+
t: t,
|
|
11383
|
+
type: "text",
|
|
11384
|
+
isMandatory: false,
|
|
11385
|
+
name: "ifscCode",
|
|
11386
|
+
value: ifsc,
|
|
11387
|
+
onChange: handleIfscChange,
|
|
11388
|
+
style: {
|
|
11389
|
+
width: "100%"
|
|
11390
|
+
},
|
|
11391
|
+
maxLength: 11
|
|
11392
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_ACCOUNT_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
|
|
11393
|
+
t: t,
|
|
11394
|
+
type: "text",
|
|
11395
|
+
isMandatory: false,
|
|
11396
|
+
name: "accountNumber",
|
|
11397
|
+
value: accountNumber,
|
|
11398
|
+
onChange: e => setAccountNumber(e.target.value),
|
|
11399
|
+
style: {
|
|
11400
|
+
width: "100%"
|
|
11401
|
+
}
|
|
11402
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_BANK_NAME")), /*#__PURE__*/React.createElement(TextInput, {
|
|
11403
|
+
t: t,
|
|
11404
|
+
type: "text",
|
|
11405
|
+
isMandatory: false,
|
|
11406
|
+
name: "bankName",
|
|
11407
|
+
value: bankName,
|
|
11408
|
+
onChange: e => setBankName(e.target.value),
|
|
11409
|
+
disabled: ifsc.length === 11 && bankName,
|
|
11410
|
+
style: {
|
|
11411
|
+
width: "100%"
|
|
11412
|
+
}
|
|
11413
|
+
}), /*#__PURE__*/React.createElement(CardLabel, null, t("ES_FSM_REGISTRY_BRANCH_NAME")), /*#__PURE__*/React.createElement(TextInput, {
|
|
11414
|
+
t: t,
|
|
11415
|
+
type: "text",
|
|
11416
|
+
isMandatory: false,
|
|
11417
|
+
name: "branchName",
|
|
11418
|
+
value: branchName,
|
|
11419
|
+
onChange: e => setBranchName(e.target.value),
|
|
11420
|
+
disabled: ifsc.length === 11 && branchName,
|
|
11421
|
+
style: {
|
|
11422
|
+
width: "100%"
|
|
11423
|
+
}
|
|
11424
|
+
}));
|
|
11425
|
+
};
|
|
11426
|
+
|
|
11243
11427
|
const componentsToRegister = {
|
|
11244
11428
|
VendorDetails,
|
|
11245
11429
|
VendorDocuments,
|
|
@@ -11250,6 +11434,7 @@ const componentsToRegister = {
|
|
|
11250
11434
|
SearchVendor,
|
|
11251
11435
|
SelectServiceType,
|
|
11252
11436
|
SelectVehicleType,
|
|
11437
|
+
BankDetailsComponent,
|
|
11253
11438
|
AddDriver,
|
|
11254
11439
|
EditVendorDetails,
|
|
11255
11440
|
AddVehicle,
|