@djb25/digit-ui-module-vendor 1.0.57 → 1.0.59
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 +2172 -1738
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2174 -1740
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -907,6 +907,21 @@ const getSelectedVendorOption = function (row, vendors) {
|
|
|
907
907
|
if (!selectedVendorId) return null;
|
|
908
908
|
return vendors.find(vendor => (vendor === null || vendor === void 0 ? void 0 : vendor.id) === selectedVendorId) || ((_row25 = row) === null || _row25 === void 0 ? void 0 : _row25.vendor) || ((_row26 = row) === null || _row26 === void 0 ? void 0 : _row26.vendorData) || null;
|
|
909
909
|
};
|
|
910
|
+
const getSelectedSupervisorOption = function (row, supervisorsList) {
|
|
911
|
+
var _row27;
|
|
912
|
+
if (row === void 0) {
|
|
913
|
+
row = {};
|
|
914
|
+
}
|
|
915
|
+
if (supervisorsList === void 0) {
|
|
916
|
+
supervisorsList = [];
|
|
917
|
+
}
|
|
918
|
+
const supervisorId = (_row27 = row) === null || _row27 === void 0 ? void 0 : _row27.supervisorId;
|
|
919
|
+
if (!supervisorId) return null;
|
|
920
|
+
return supervisorsList.find(s => {
|
|
921
|
+
var _s$owner;
|
|
922
|
+
return s.id === supervisorId || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid) === supervisorId;
|
|
923
|
+
}) || null;
|
|
924
|
+
};
|
|
910
925
|
const getVendorFillingPoints = function (vendor) {
|
|
911
926
|
var _vendor, _vendor2, _vendor3, _vendor4;
|
|
912
927
|
if (vendor === void 0) {
|
|
@@ -945,14 +960,14 @@ const getVendorDriversForFillingPoint = (vendor, fillingPoint) => {
|
|
|
945
960
|
});
|
|
946
961
|
};
|
|
947
962
|
const getSelectedDriverOption = function (row, drivers) {
|
|
948
|
-
var
|
|
963
|
+
var _row28, _row28$driverData, _row29, _row29$driver;
|
|
949
964
|
if (row === void 0) {
|
|
950
965
|
row = {};
|
|
951
966
|
}
|
|
952
967
|
if (drivers === void 0) {
|
|
953
968
|
drivers = [];
|
|
954
969
|
}
|
|
955
|
-
const selectedDriverId = ((
|
|
970
|
+
const selectedDriverId = ((_row28 = row) === null || _row28 === void 0 ? void 0 : (_row28$driverData = _row28.driverData) === null || _row28$driverData === void 0 ? void 0 : _row28$driverData.id) || ((_row29 = row) === null || _row29 === void 0 ? void 0 : (_row29$driver = _row29.driver) === null || _row29$driver === void 0 ? void 0 : _row29$driver.id);
|
|
956
971
|
if (!selectedDriverId) return null;
|
|
957
972
|
return drivers.find(driver => (driver === null || driver === void 0 ? void 0 : driver.id) === selectedDriverId) || null;
|
|
958
973
|
};
|
|
@@ -1022,7 +1037,6 @@ const VendorInbox = props => {
|
|
|
1022
1037
|
key: "error",
|
|
1023
1038
|
action: "Failed to fetch document."
|
|
1024
1039
|
});
|
|
1025
|
-
setTimeout(closeToast, 5000);
|
|
1026
1040
|
});
|
|
1027
1041
|
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
1028
1042
|
} catch (e) {
|
|
@@ -1105,6 +1119,8 @@ const VendorInbox = props => {
|
|
|
1105
1119
|
mutateVehicle = _Digit$Hooks$fsm$useU.mutate;
|
|
1106
1120
|
const _Digit$Hooks$fsm$useD3 = Digit.Hooks.fsm.useDriverUpdate(tenantId),
|
|
1107
1121
|
mutateDriver = _Digit$Hooks$fsm$useD3.mutate;
|
|
1122
|
+
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSurveyorUpdate(tenantId),
|
|
1123
|
+
mutateSurveyor = _Digit$Hooks$fsm$useS.mutate;
|
|
1108
1124
|
React.useEffect(() => {
|
|
1109
1125
|
var _props$data;
|
|
1110
1126
|
setTableData((props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.table) || []);
|
|
@@ -1421,6 +1437,37 @@ const VendorInbox = props => {
|
|
|
1421
1437
|
}
|
|
1422
1438
|
});
|
|
1423
1439
|
};
|
|
1440
|
+
const onSurveyorSupervisorSelect = (row, selectedSupervisor) => {
|
|
1441
|
+
var _selectedSupervisor$o, _formDetails$owner9, _formDetails$owner0, _formDetails$owner1, _formDetails$owner10;
|
|
1442
|
+
let formDetails = row.original;
|
|
1443
|
+
const formData = {
|
|
1444
|
+
surveyor: _extends({}, formDetails, {
|
|
1445
|
+
supervisorId: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.id) || (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : (_selectedSupervisor$o = selectedSupervisor.owner) === null || _selectedSupervisor$o === void 0 ? void 0 : _selectedSupervisor$o.uuid) || null,
|
|
1446
|
+
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1447
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner9 = formDetails.owner) === null || _formDetails$owner9 === void 0 ? void 0 : _formDetails$owner9.gender) || "OTHERS",
|
|
1448
|
+
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner0 = formDetails.owner) === null || _formDetails$owner0 === void 0 ? void 0 : _formDetails$owner0.dob) || new Date("1/1/1970").getTime(),
|
|
1449
|
+
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner1 = formDetails.owner) === null || _formDetails$owner1 === void 0 ? void 0 : _formDetails$owner1.emailId) || "abc@egov.com",
|
|
1450
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner10 = formDetails.owner) === null || _formDetails$owner10 === void 0 ? void 0 : _formDetails$owner10.relationship) || "OTHER"
|
|
1451
|
+
})
|
|
1452
|
+
})
|
|
1453
|
+
};
|
|
1454
|
+
mutateSurveyor(formData, {
|
|
1455
|
+
onError: error => {
|
|
1456
|
+
setShowToast({
|
|
1457
|
+
key: "error",
|
|
1458
|
+
label: (error === null || error === void 0 ? void 0 : error.message) || error || t("ES_FSM_REGISTRY_INBOX_FAILED_TO_UPDATE_SUPERVISOR")
|
|
1459
|
+
});
|
|
1460
|
+
},
|
|
1461
|
+
onSuccess: () => {
|
|
1462
|
+
setShowToast({
|
|
1463
|
+
key: "success",
|
|
1464
|
+
label: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_MAPPED_SUCCESSFULLY")
|
|
1465
|
+
});
|
|
1466
|
+
queryClient.invalidateQueries(t("SURVEYOR_SEARCH"));
|
|
1467
|
+
props.refetchData();
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1424
1471
|
const onSelectAdd = () => {
|
|
1425
1472
|
switch (props.selectedTab) {
|
|
1426
1473
|
case "VENDOR":
|
|
@@ -1465,6 +1512,21 @@ const VendorInbox = props => {
|
|
|
1465
1512
|
allFillingPointsData = _Digit$Hooks$wt$useFi.data,
|
|
1466
1513
|
isAllFillingPointsLoading = _Digit$Hooks$wt$useFi.isLoading;
|
|
1467
1514
|
const allFillingPoints = (allFillingPointsData === null || allFillingPointsData === void 0 ? void 0 : allFillingPointsData.fillingPoints) || [];
|
|
1515
|
+
const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
|
|
1516
|
+
status: "ACTIVE"
|
|
1517
|
+
}, {
|
|
1518
|
+
enabled: props.selectedTab === "SURVEYOR"
|
|
1519
|
+
}),
|
|
1520
|
+
supervisorSearchResponse = _Digit$Hooks$fsm$useS2.data;
|
|
1521
|
+
const supervisors = React__default.useMemo(() => {
|
|
1522
|
+
const list = (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisors) || (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisor) || [];
|
|
1523
|
+
return list.map(s => {
|
|
1524
|
+
var _s$owner2, _s$owner3;
|
|
1525
|
+
return _extends({}, s, {
|
|
1526
|
+
displayName: (s.name || ((_s$owner2 = s.owner) === null || _s$owner2 === void 0 ? void 0 : _s$owner2.name) || "N/A") + " (" + (((_s$owner3 = s.owner) === null || _s$owner3 === void 0 ? void 0 : _s$owner3.mobileNumber) || s.mobileNo || "N/A") + ")"
|
|
1527
|
+
});
|
|
1528
|
+
});
|
|
1529
|
+
}, [supervisorSearchResponse]);
|
|
1468
1530
|
const columns = React__default.useMemo(() => {
|
|
1469
1531
|
switch (props.selectedTab) {
|
|
1470
1532
|
case "VENDOR":
|
|
@@ -1856,28 +1918,41 @@ const VendorInbox = props => {
|
|
|
1856
1918
|
}
|
|
1857
1919
|
}] : []), ...(props.selectedTab === "SURVEYOR" ? [{
|
|
1858
1920
|
Header: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_NAME"),
|
|
1921
|
+
id: "supervisor",
|
|
1859
1922
|
accessor: row => {
|
|
1860
1923
|
var _row$reportingManager;
|
|
1861
1924
|
return row.supervisorName || ((_row$reportingManager = row.reportingManager) === null || _row$reportingManager === void 0 ? void 0 : _row$reportingManager.name) || "NA";
|
|
1862
1925
|
},
|
|
1863
1926
|
Cell: _ref29 => {
|
|
1864
|
-
var _row$original19, _row$original20, _row$original20$repor;
|
|
1865
1927
|
let row = _ref29.row;
|
|
1866
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1928
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
1929
|
+
className: "fsm-registry-dropdown",
|
|
1930
|
+
selected: getSelectedSupervisorOption(row.original, supervisors),
|
|
1931
|
+
option: supervisors,
|
|
1932
|
+
select: value => onSurveyorSupervisorSelect(row, value),
|
|
1933
|
+
optionKey: "displayName",
|
|
1934
|
+
t: t,
|
|
1935
|
+
style: {
|
|
1936
|
+
textAlign: "left",
|
|
1937
|
+
width: "100%",
|
|
1938
|
+
minWidth: "250px"
|
|
1939
|
+
},
|
|
1940
|
+
disable: !supervisors.length
|
|
1941
|
+
});
|
|
1867
1942
|
}
|
|
1868
1943
|
}] : []), {
|
|
1869
1944
|
Header: t("ES_FSM_REGISTRY_INBOX_DATE_CREATION"),
|
|
1870
1945
|
accessor: "createdTime",
|
|
1871
1946
|
Cell: _ref30 => {
|
|
1872
|
-
var _row$
|
|
1947
|
+
var _row$original19, _row$original19$audit, _row$original20, _row$original20$audit;
|
|
1873
1948
|
let row = _ref30.row;
|
|
1874
|
-
return GetCell((_row$
|
|
1949
|
+
return GetCell((_row$original19 = row.original) !== null && _row$original19 !== void 0 && (_row$original19$audit = _row$original19.auditDetails) !== null && _row$original19$audit !== void 0 && _row$original19$audit.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original20 = row.original) === null || _row$original20 === void 0 ? void 0 : (_row$original20$audit = _row$original20.auditDetails) === null || _row$original20$audit === void 0 ? void 0 : _row$original20$audit.createdTime) : "");
|
|
1875
1950
|
}
|
|
1876
1951
|
}];
|
|
1877
1952
|
default:
|
|
1878
1953
|
return [];
|
|
1879
1954
|
}
|
|
1880
|
-
}, [props.selectedTab, vendors, drivers, tableData, additionalVendorData, allFillingPoints, t]);
|
|
1955
|
+
}, [props.selectedTab, vendors, drivers, tableData, additionalVendorData, allFillingPoints, supervisors, t]);
|
|
1881
1956
|
const csvExportColumns = React__default.useMemo(() => {
|
|
1882
1957
|
switch (props.selectedTab) {
|
|
1883
1958
|
case "VENDOR":
|
|
@@ -1989,8 +2064,9 @@ const VendorInbox = props => {
|
|
|
1989
2064
|
}, {
|
|
1990
2065
|
Header: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_NAME"),
|
|
1991
2066
|
exportAccessor: row => {
|
|
1992
|
-
var _row$reportingManager2;
|
|
1993
|
-
|
|
2067
|
+
var _selectedSupervisor$o2, _row$reportingManager2;
|
|
2068
|
+
const selectedSupervisor = getSelectedSupervisorOption(row, supervisors);
|
|
2069
|
+
return selectedSupervisor ? selectedSupervisor.name || ((_selectedSupervisor$o2 = selectedSupervisor.owner) === null || _selectedSupervisor$o2 === void 0 ? void 0 : _selectedSupervisor$o2.name) : (row === null || row === void 0 ? void 0 : row.supervisorName) || (row === null || row === void 0 ? void 0 : (_row$reportingManager2 = row.reportingManager) === null || _row$reportingManager2 === void 0 ? void 0 : _row$reportingManager2.name) || "NA";
|
|
1994
2070
|
}
|
|
1995
2071
|
}, {
|
|
1996
2072
|
Header: t("ES_FSM_REGISTRY_INBOX_DATE_DRIVER_CREATION"),
|
|
@@ -2046,7 +2122,7 @@ const VendorInbox = props => {
|
|
|
2046
2122
|
default:
|
|
2047
2123
|
return [];
|
|
2048
2124
|
}
|
|
2049
|
-
}, [props.selectedTab, t]);
|
|
2125
|
+
}, [props.selectedTab, supervisors, t]);
|
|
2050
2126
|
const getCSVExportData = React__default.useCallback(function () {
|
|
2051
2127
|
return Promise.resolve(tableData);
|
|
2052
2128
|
}, [tableData]);
|
|
@@ -2250,6 +2326,14 @@ const SearchVendor = () => {
|
|
|
2250
2326
|
const _useState9 = React.useState(null),
|
|
2251
2327
|
showToast = _useState9[0],
|
|
2252
2328
|
setShowToast = _useState9[1];
|
|
2329
|
+
const _Digit$Hooks$useToast = Digit.Hooks.useToast(),
|
|
2330
|
+
consumeToast = _Digit$Hooks$useToast.consumeToast;
|
|
2331
|
+
React.useEffect(() => {
|
|
2332
|
+
const message = consumeToast();
|
|
2333
|
+
if (message) {
|
|
2334
|
+
setShowToast(message);
|
|
2335
|
+
}
|
|
2336
|
+
}, []);
|
|
2253
2337
|
const isCitizen = (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info = userInfo.info) === null || _userInfo$info === void 0 ? void 0 : _userInfo$info.type) === "CITIZEN";
|
|
2254
2338
|
const loggedInVendorId = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info2 = userInfo.info) === null || _userInfo$info2 === void 0 ? void 0 : _userInfo$info2.uuid;
|
|
2255
2339
|
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
@@ -2705,7 +2789,7 @@ const SupervisorDetails = props => {
|
|
|
2705
2789
|
var _v$dsoDetails, _v$dsoDetails2;
|
|
2706
2790
|
return ((_v$dsoDetails = v.dsoDetails) === null || _v$dsoDetails === void 0 ? void 0 : _v$dsoDetails.id) === data.vendorId || ((_v$dsoDetails2 = v.dsoDetails) === null || _v$dsoDetails2 === void 0 ? void 0 : _v$dsoDetails2.vendorId) === data.vendorId;
|
|
2707
2791
|
});
|
|
2708
|
-
const vendorName = (mappedVendor === null || mappedVendor === void 0 ? void 0 : (_mappedVendor$dsoDeta = mappedVendor.dsoDetails) === null || _mappedVendor$dsoDeta === void 0 ? void 0 : _mappedVendor$dsoDeta.name) || data.vendorId || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR";
|
|
2792
|
+
const vendorName = data.vendorName || (mappedVendor === null || mappedVendor === void 0 ? void 0 : (_mappedVendor$dsoDeta = mappedVendor.dsoDetails) === null || _mappedVendor$dsoDeta === void 0 ? void 0 : _mappedVendor$dsoDeta.name) || data.vendorId || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR";
|
|
2709
2793
|
return {
|
|
2710
2794
|
supervisorData: data,
|
|
2711
2795
|
vendorDetails: {
|
|
@@ -3563,28 +3647,19 @@ const SurveyorDetails = props => {
|
|
|
3563
3647
|
})));
|
|
3564
3648
|
};
|
|
3565
3649
|
|
|
3566
|
-
const Heading$2 = props => {
|
|
3567
|
-
return /*#__PURE__*/React__default.createElement("h1", {
|
|
3568
|
-
className: "heading-m"
|
|
3569
|
-
}, props.label);
|
|
3570
|
-
};
|
|
3571
|
-
const CloseBtn$1 = props => {
|
|
3572
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3573
|
-
conClick: props.onClick
|
|
3574
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
3575
|
-
};
|
|
3576
3650
|
const formatLabel = key => {
|
|
3577
3651
|
const result = key.replace(/([A-Z])/g, " $1");
|
|
3578
3652
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3579
3653
|
};
|
|
3580
|
-
const
|
|
3654
|
+
const VendorDetails = () => {
|
|
3581
3655
|
var _dsoData$, _dsoData$$dsoDetails, _vendorAdditionalData, _vendorAdditionalData2, _vendorAdditionalData3, _parsedAdditionalDeta, _userInfo$info$type, _dsoData$5, _dsoData$5$employeeRe, _supervisorData$super, _surveyorData$surveyo;
|
|
3582
3656
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3583
3657
|
const _useTranslation = reactI18next.useTranslation(),
|
|
3584
3658
|
t = _useTranslation.t;
|
|
3585
3659
|
const history = reactRouterDom.useHistory();
|
|
3586
3660
|
const queryClient = reactQuery.useQueryClient();
|
|
3587
|
-
|
|
3661
|
+
const vendorId = new URLSearchParams(location.search).get("vendorId");
|
|
3662
|
+
const _useParams = reactRouterDom.useParams(),
|
|
3588
3663
|
dsoId = _useParams.id;
|
|
3589
3664
|
const _useState = React.useState(false),
|
|
3590
3665
|
displayMenu = _useState[0],
|
|
@@ -3690,9 +3765,9 @@ const EditVendorDetails = props => {
|
|
|
3690
3765
|
case "ADD_DRIVER":
|
|
3691
3766
|
return setShowModal(true);
|
|
3692
3767
|
case "EDIT":
|
|
3693
|
-
return history.push("/digit-ui/" + userType + "/
|
|
3768
|
+
return history.push("/digit-ui/" + userType + "/vendor/registry/modify-vendor/" + (dsoId || vendorId));
|
|
3694
3769
|
case "HOME":
|
|
3695
|
-
return history.push("/digit-ui/" + userType + "/
|
|
3770
|
+
return history.push("/digit-ui/" + userType + "/vendor/registry?selectedTabs=VENDOR");
|
|
3696
3771
|
}
|
|
3697
3772
|
}, [selectedAction]);
|
|
3698
3773
|
React.useEffect(() => {
|
|
@@ -3782,11 +3857,11 @@ const EditVendorDetails = props => {
|
|
|
3782
3857
|
};
|
|
3783
3858
|
const onEdit = (details, type, id) => {
|
|
3784
3859
|
if (type === "ES_FSM_REGISTRY_DETAILS_TYPE_DRIVER") {
|
|
3785
|
-
history.push("/digit-ui/" + userType + "/
|
|
3860
|
+
history.push("/digit-ui/" + userType + "/vendor/registry/modify-driver/" + id);
|
|
3786
3861
|
} else {
|
|
3787
3862
|
var _details$values, _details$values$find;
|
|
3788
3863
|
let registrationNumber = details === null || details === void 0 ? void 0 : (_details$values = details.values) === null || _details$values === void 0 ? void 0 : (_details$values$find = _details$values.find(ele => ele.title === "ES_FSM_REGISTRY_VEHICLE_NUMBER")) === null || _details$values$find === void 0 ? void 0 : _details$values$find.value;
|
|
3789
|
-
history.push("/digit-ui/" + userType + "/
|
|
3864
|
+
history.push("/digit-ui/" + userType + "/vendor/registry/modify-vehicle/" + registrationNumber);
|
|
3790
3865
|
}
|
|
3791
3866
|
};
|
|
3792
3867
|
const onDelete = (details, type, id) => {
|
|
@@ -3835,7 +3910,6 @@ const EditVendorDetails = props => {
|
|
|
3835
3910
|
key: "error",
|
|
3836
3911
|
action: error
|
|
3837
3912
|
});
|
|
3838
|
-
setTimeout(closeToast, 5000);
|
|
3839
3913
|
},
|
|
3840
3914
|
onSuccess: (data, variables) => {
|
|
3841
3915
|
setShowToast({
|
|
@@ -3846,9 +3920,6 @@ const EditVendorDetails = props => {
|
|
|
3846
3920
|
refetchDso();
|
|
3847
3921
|
refetchVehicle();
|
|
3848
3922
|
refetchDriver();
|
|
3849
|
-
setTimeout(() => {
|
|
3850
|
-
closeToast();
|
|
3851
|
-
}, 5000);
|
|
3852
3923
|
}
|
|
3853
3924
|
});
|
|
3854
3925
|
};
|
|
@@ -3983,9 +4054,9 @@ const EditVendorDetails = props => {
|
|
|
3983
4054
|
}, safeVal));
|
|
3984
4055
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
3985
4056
|
className: "add-details-link hover-button",
|
|
3986
|
-
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/info?vendorId=" + dsoId)
|
|
4057
|
+
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/info?vendorId=" + (dsoId || vendorId))
|
|
3987
4058
|
}, t("Edit Details"))) : userType !== "CITIZEN" && !isEkyc && /*#__PURE__*/React__default.createElement("div", {
|
|
3988
|
-
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/
|
|
4059
|
+
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + (dsoId || vendorId)),
|
|
3989
4060
|
className: "add-details-link hover-button"
|
|
3990
4061
|
}, t("Add Additional Details")));
|
|
3991
4062
|
}
|
|
@@ -3997,7 +4068,9 @@ const EditVendorDetails = props => {
|
|
|
3997
4068
|
caption: value.caption,
|
|
3998
4069
|
className: "border-none flex-box " + (!isMobile ? "vendor-details-row" : "")
|
|
3999
4070
|
});
|
|
4000
|
-
}),
|
|
4071
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
4072
|
+
className: "flex-box flex-box-col flex-gap-2"
|
|
4073
|
+
}, detail === null || detail === void 0 ? void 0 : (_detail$child = detail.child) === null || _detail$child === void 0 ? void 0 : _detail$child.map((data, index) => {
|
|
4001
4074
|
var _data$values;
|
|
4002
4075
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
4003
4076
|
className: "card-with-background",
|
|
@@ -4040,7 +4113,7 @@ const EditVendorDetails = props => {
|
|
|
4040
4113
|
color: "green"
|
|
4041
4114
|
} : {}
|
|
4042
4115
|
}, value.value ? t(String(value.value)) : "N/A")))));
|
|
4043
|
-
}), detail.type && /*#__PURE__*/React__default.createElement("div", {
|
|
4116
|
+
})), detail.type && /*#__PURE__*/React__default.createElement("div", {
|
|
4044
4117
|
className: "add-details-link hover-button",
|
|
4045
4118
|
onClick: () => onActionSelect(detail.type === "ES_FSM_REGISTRY_DETAILS_TYPE_DRIVER" ? "ADD_DRIVER" : "ADD_VEHICLE")
|
|
4046
4119
|
}, t(detail.type + "_ADD"))));
|
|
@@ -4059,7 +4132,7 @@ const EditVendorDetails = props => {
|
|
|
4059
4132
|
t: t
|
|
4060
4133
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
4061
4134
|
className: "add-details-link hover-button",
|
|
4062
|
-
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-supervisor?vendorId=" + dsoId)
|
|
4135
|
+
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-supervisor?vendorId=" + (dsoId || vendorId))
|
|
4063
4136
|
}, t("ES_VENDOR_ADD_SUPERVISOR"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
4064
4137
|
style: {
|
|
4065
4138
|
marginBottom: "16px",
|
|
@@ -4074,10 +4147,10 @@ const EditVendorDetails = props => {
|
|
|
4074
4147
|
pageSizeLimit: 10,
|
|
4075
4148
|
t: t
|
|
4076
4149
|
})))), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
4077
|
-
headerBarMain: /*#__PURE__*/React__default.createElement(
|
|
4078
|
-
|
|
4079
|
-
}),
|
|
4080
|
-
headerBarEnd: /*#__PURE__*/React__default.createElement(
|
|
4150
|
+
headerBarMain: /*#__PURE__*/React__default.createElement("h1", {
|
|
4151
|
+
className: "heading-m"
|
|
4152
|
+
}, t(selectedAction === "DELETE" ? "ES_FSM_REGISTRY_DELETE_POPUP_HEADER" : selectedAction === "ADD_VEHICLE" ? "ES_FSM_REGISTRY_ADD_VEHICLE_POPUP_HEADER" : "ES_FSM_REGISTRY_ADD_DRIVER_POPUP_HEADER")),
|
|
4153
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, {
|
|
4081
4154
|
onClick: closeModal
|
|
4082
4155
|
}),
|
|
4083
4156
|
actionCancelLabel: t("CS_COMMON_CANCEL"),
|
|
@@ -4185,15 +4258,12 @@ const stringReplaceAll = function (str, searcher, replaceWith) {
|
|
|
4185
4258
|
return str;
|
|
4186
4259
|
};
|
|
4187
4260
|
|
|
4188
|
-
const VendorConfig = function (t,
|
|
4189
|
-
var
|
|
4190
|
-
if (
|
|
4191
|
-
|
|
4192
|
-
}
|
|
4193
|
-
if (formData === void 0) {
|
|
4194
|
-
formData = {};
|
|
4261
|
+
const VendorConfig = function (t, module, genderMenu, update) {
|
|
4262
|
+
var _module;
|
|
4263
|
+
if (module === void 0) {
|
|
4264
|
+
module = "";
|
|
4195
4265
|
}
|
|
4196
|
-
const isEkyc = ((
|
|
4266
|
+
const isEkyc = ((_module = module) === null || _module === void 0 ? void 0 : _module.toLocaleUpperCase()) === "EKYC";
|
|
4197
4267
|
return [{
|
|
4198
4268
|
head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
|
|
4199
4269
|
isCollapsible: true,
|
|
@@ -4202,7 +4272,7 @@ const VendorConfig = function (t, disabled, formData) {
|
|
|
4202
4272
|
label: "ES_FSM_REGISTRY_NEW_VENDOR_NAME",
|
|
4203
4273
|
isMandatory: true,
|
|
4204
4274
|
type: "text",
|
|
4205
|
-
disable:
|
|
4275
|
+
disable: false,
|
|
4206
4276
|
populators: {
|
|
4207
4277
|
name: "vendorName",
|
|
4208
4278
|
validation: {
|
|
@@ -4213,27 +4283,12 @@ const VendorConfig = function (t, disabled, formData) {
|
|
|
4213
4283
|
defaultValue: "",
|
|
4214
4284
|
className: "payment-form-text-input-correction"
|
|
4215
4285
|
}
|
|
4216
|
-
}, {
|
|
4217
|
-
label: "ES_FSM_REGISTRY_NEW_EMAIL",
|
|
4218
|
-
isMandatory: false,
|
|
4219
|
-
type: "text",
|
|
4220
|
-
key: "emailId",
|
|
4221
|
-
populators: {
|
|
4222
|
-
name: "emailId",
|
|
4223
|
-
validation: {
|
|
4224
|
-
required: false,
|
|
4225
|
-
pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
|
|
4226
|
-
},
|
|
4227
|
-
error: t("FSM_REGISTRY_INVALID_EMAIL"),
|
|
4228
|
-
defaultValue: "",
|
|
4229
|
-
className: "payment-form-text-input-correction"
|
|
4230
|
-
}
|
|
4231
4286
|
}, {
|
|
4232
4287
|
label: "ES_FSM_REGISTRY_NEW_VENDOR_PHONE",
|
|
4233
4288
|
isMandatory: true,
|
|
4234
4289
|
type: "mobileNumber",
|
|
4235
4290
|
key: "phone",
|
|
4236
|
-
disable:
|
|
4291
|
+
disable: false,
|
|
4237
4292
|
populators: {
|
|
4238
4293
|
name: "phone",
|
|
4239
4294
|
validation: {
|
|
@@ -4248,13 +4303,28 @@ const VendorConfig = function (t, disabled, formData) {
|
|
|
4248
4303
|
defaultValue: "",
|
|
4249
4304
|
className: "payment-form-text-input-correction"
|
|
4250
4305
|
}
|
|
4306
|
+
}, {
|
|
4307
|
+
label: "ES_FSM_REGISTRY_NEW_EMAIL",
|
|
4308
|
+
isMandatory: false,
|
|
4309
|
+
type: "text",
|
|
4310
|
+
key: "emailId",
|
|
4311
|
+
populators: {
|
|
4312
|
+
name: "emailId",
|
|
4313
|
+
validation: {
|
|
4314
|
+
required: false,
|
|
4315
|
+
pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
|
|
4316
|
+
},
|
|
4317
|
+
error: t("FSM_REGISTRY_INVALID_EMAIL"),
|
|
4318
|
+
defaultValue: "",
|
|
4319
|
+
className: "payment-form-text-input-correction"
|
|
4320
|
+
}
|
|
4251
4321
|
}, {
|
|
4252
4322
|
label: "ES_VENDOR_REGISTRY_SERVICE_TYPE",
|
|
4253
4323
|
isMandatory: true,
|
|
4254
4324
|
type: "component",
|
|
4255
4325
|
key: "serviceType",
|
|
4256
4326
|
component: "SelectServiceType",
|
|
4257
|
-
disable:
|
|
4327
|
+
disable: update,
|
|
4258
4328
|
populators: {
|
|
4259
4329
|
name: "serviceType",
|
|
4260
4330
|
defaultValue: {
|
|
@@ -4324,17 +4394,8 @@ const VendorConfig = function (t, disabled, formData) {
|
|
|
4324
4394
|
component: "SelectEkycDropdown",
|
|
4325
4395
|
populators: {
|
|
4326
4396
|
name: "gender",
|
|
4327
|
-
options:
|
|
4328
|
-
|
|
4329
|
-
name: "ES_COMMON_GENDER_MALE"
|
|
4330
|
-
}, {
|
|
4331
|
-
code: "FEMALE",
|
|
4332
|
-
name: "ES_COMMON_GENDER_FEMALE"
|
|
4333
|
-
}, {
|
|
4334
|
-
code: "OTHER",
|
|
4335
|
-
name: "ES_COMMON_GENDER_OTHER"
|
|
4336
|
-
}],
|
|
4337
|
-
optionsKey: "name"
|
|
4397
|
+
options: genderMenu,
|
|
4398
|
+
optionsKey: "i18nKey"
|
|
4338
4399
|
}
|
|
4339
4400
|
}, {
|
|
4340
4401
|
label: "ES_FSM_REGISTRY_NEW_DOB",
|
|
@@ -4374,7 +4435,7 @@ const VendorConfig = function (t, disabled, formData) {
|
|
|
4374
4435
|
};
|
|
4375
4436
|
|
|
4376
4437
|
const AddVendor = () => {
|
|
4377
|
-
var _Digit$UserService$ge, _formData$
|
|
4438
|
+
var _Digit$UserService$ge, _formData$serviceType2;
|
|
4378
4439
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
4379
4440
|
const _useTranslation = reactI18next.useTranslation(),
|
|
4380
4441
|
t = _useTranslation.t;
|
|
@@ -4387,12 +4448,30 @@ const AddVendor = () => {
|
|
|
4387
4448
|
const _useState2 = React.useState(null),
|
|
4388
4449
|
showToast = _useState2[0],
|
|
4389
4450
|
setShowToast = _useState2[1];
|
|
4451
|
+
const _useState3 = React.useState([]),
|
|
4452
|
+
genderMenu = _useState3[0],
|
|
4453
|
+
setGenderMenu = _useState3[1];
|
|
4390
4454
|
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
|
|
4391
4455
|
setMutationHappened = _Digit$Hooks$useSessi[1];
|
|
4392
4456
|
const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
|
|
4393
4457
|
clearError = _Digit$Hooks$useSessi2[2];
|
|
4394
4458
|
const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
|
|
4395
4459
|
clearSuccessData = _Digit$Hooks$useSessi3[2];
|
|
4460
|
+
const stateId = Digit.ULBService.getStateId();
|
|
4461
|
+
const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
|
|
4462
|
+
genderTypeData = _Digit$Hooks$obps$use.data;
|
|
4463
|
+
React.useEffect(() => {
|
|
4464
|
+
var _genderTypeData$commo, _genderTypeData$commo2;
|
|
4465
|
+
if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
|
|
4466
|
+
var _genderTypeData$commo3, _genderTypeData$commo4;
|
|
4467
|
+
const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
|
|
4468
|
+
i18nKey: "COMMON_GENDER_" + genderDetails.code,
|
|
4469
|
+
code: "" + genderDetails.code,
|
|
4470
|
+
value: "" + genderDetails.code
|
|
4471
|
+
}));
|
|
4472
|
+
setGenderMenu(menuItems);
|
|
4473
|
+
}
|
|
4474
|
+
}, [genderTypeData]);
|
|
4396
4475
|
const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorCreate(tenantId),
|
|
4397
4476
|
mutate = _Digit$Hooks$fsm$useV.mutate;
|
|
4398
4477
|
React.useEffect(() => {
|
|
@@ -4412,16 +4491,19 @@ const AddVendor = () => {
|
|
|
4412
4491
|
amount: null
|
|
4413
4492
|
}
|
|
4414
4493
|
};
|
|
4415
|
-
const
|
|
4416
|
-
formData =
|
|
4417
|
-
setFormData =
|
|
4418
|
-
const Config = React__default.useMemo(() =>
|
|
4494
|
+
const _useState4 = React.useState(defaultValues),
|
|
4495
|
+
formData = _useState4[0],
|
|
4496
|
+
setFormData = _useState4[1];
|
|
4497
|
+
const Config = React__default.useMemo(() => {
|
|
4498
|
+
var _formData$serviceType;
|
|
4499
|
+
return VendorConfig(t, (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code, genderMenu);
|
|
4500
|
+
}, [t, formData === null || formData === void 0 ? void 0 : (_formData$serviceType2 = formData.serviceType) === null || _formData$serviceType2 === void 0 ? void 0 : _formData$serviceType2.i18nKey, genderMenu]);
|
|
4419
4501
|
const onFormValueChange = (setValue, data) => {
|
|
4420
|
-
var _data$zoneIds, _data$serviceType, _formData$
|
|
4502
|
+
var _data$zoneIds, _data$serviceType, _formData$serviceType3, _data$serviceType2;
|
|
4421
4503
|
const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => item === null || item === void 0 ? void 0 : item.code)) || [];
|
|
4422
4504
|
const previousZoneCodes = (formData === null || formData === void 0 ? void 0 : formData.zoneIds) || [];
|
|
4423
4505
|
const zoneChanged = currentZoneCodes.join(",") !== previousZoneCodes.join(",");
|
|
4424
|
-
if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
4506
|
+
if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType3 = formData.serviceType) === null || _formData$serviceType3 === void 0 ? void 0 : _formData$serviceType3.code) || zoneChanged) {
|
|
4425
4507
|
setFormData(prev => _extends({}, prev, {
|
|
4426
4508
|
serviceType: data === null || data === void 0 ? void 0 : data.serviceType
|
|
4427
4509
|
}));
|
|
@@ -4554,10 +4636,7 @@ const AddVendor = () => {
|
|
|
4554
4636
|
if (isEkyc) {
|
|
4555
4637
|
var _mergedData$zoneIds, _mergedData$clusterId;
|
|
4556
4638
|
vendorData = _extends({}, vendorData, {
|
|
4557
|
-
zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z =>
|
|
4558
|
-
var _z$;
|
|
4559
|
-
return z === null || z === void 0 ? void 0 : (_z$ = z[1]) === null || _z$ === void 0 ? void 0 : _z$.code;
|
|
4560
|
-
})) || [],
|
|
4639
|
+
zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z === null || z === void 0 ? void 0 : z.name)) || [],
|
|
4561
4640
|
clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
|
|
4562
4641
|
var _c$;
|
|
4563
4642
|
return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
|
|
@@ -5292,8 +5371,8 @@ const createConfig = [{
|
|
|
5292
5371
|
nextStep: "vendor-details",
|
|
5293
5372
|
key: "Documents"
|
|
5294
5373
|
}, {
|
|
5295
|
-
route: "
|
|
5296
|
-
component: "
|
|
5374
|
+
route: "modify-details",
|
|
5375
|
+
component: "AdditionalDetails",
|
|
5297
5376
|
withoutLabel: true,
|
|
5298
5377
|
key: "vendordet",
|
|
5299
5378
|
type: "component",
|
|
@@ -5377,7 +5456,6 @@ const VENDORCreate = _ref => {
|
|
|
5377
5456
|
nextStep = key;
|
|
5378
5457
|
}
|
|
5379
5458
|
if (nextStep === null) {
|
|
5380
|
-
console.log("matchhhhh pathhhh", match.path);
|
|
5381
5459
|
return redirectWithHistory(match.path + "/check");
|
|
5382
5460
|
}
|
|
5383
5461
|
if (!isNaN(nextStep.split("/").pop())) {
|
|
@@ -5428,8 +5506,7 @@ const VENDORCreate = _ref => {
|
|
|
5428
5506
|
clearParams();
|
|
5429
5507
|
queryClient.invalidateQueries("VENDOR_CREATE");
|
|
5430
5508
|
};
|
|
5431
|
-
|
|
5432
|
-
commonFields.forEach(obj => {
|
|
5509
|
+
createConfig.forEach(obj => {
|
|
5433
5510
|
config = config.concat(obj.body.filter(a => !a.hideInCitizen));
|
|
5434
5511
|
});
|
|
5435
5512
|
config.indexRoute = "info";
|
|
@@ -5471,447 +5548,314 @@ const VENDORCreate = _ref => {
|
|
|
5471
5548
|
}))));
|
|
5472
5549
|
};
|
|
5473
5550
|
|
|
5474
|
-
const
|
|
5475
|
-
|
|
5551
|
+
const EditVendor = () => {
|
|
5552
|
+
var _Digit$UserService$ge, _defaultValues$servic2;
|
|
5553
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
5476
5554
|
const _useTranslation = reactI18next.useTranslation(),
|
|
5477
5555
|
t = _useTranslation.t;
|
|
5478
|
-
const
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
const
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
const
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5556
|
+
const history = reactRouterDom.useHistory();
|
|
5557
|
+
let _useParams = reactRouterDom.useParams(),
|
|
5558
|
+
dsoId = _useParams.id;
|
|
5559
|
+
const _useState = React.useState(null),
|
|
5560
|
+
showToast = _useState[0],
|
|
5561
|
+
setShowToast = _useState[1];
|
|
5562
|
+
const _useState2 = React.useState(false),
|
|
5563
|
+
canSubmit = _useState2[0],
|
|
5564
|
+
setCanSubmit = _useState2[1];
|
|
5565
|
+
const _useState3 = React.useState({}),
|
|
5566
|
+
defaultValues = _useState3[0],
|
|
5567
|
+
setDefaultValues = _useState3[1];
|
|
5568
|
+
const _useState4 = React.useState({}),
|
|
5569
|
+
dsoDetails = _useState4[0],
|
|
5570
|
+
setDsoDetails = _useState4[1];
|
|
5571
|
+
const queryClient = reactQuery.useQueryClient();
|
|
5572
|
+
const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
5573
|
+
const userType = userInfo === null || userInfo === void 0 ? void 0 : userInfo.type;
|
|
5574
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
|
|
5575
|
+
setMutationHappened = _Digit$Hooks$useSessi[1];
|
|
5576
|
+
const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
|
|
5577
|
+
clearError = _Digit$Hooks$useSessi2[2];
|
|
5578
|
+
const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
|
|
5579
|
+
clearSuccessData = _Digit$Hooks$useSessi3[2];
|
|
5580
|
+
const _useState5 = React.useState([]),
|
|
5581
|
+
genderMenu = _useState5[0],
|
|
5582
|
+
setGenderMenu = _useState5[1];
|
|
5583
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
5584
|
+
ids: dsoId
|
|
5491
5585
|
}, {
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
crumbs.push({
|
|
5517
|
-
label: t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE")
|
|
5518
|
-
});
|
|
5519
|
-
} else if (pathname.includes("/registry/driver-details") || pathname.includes("/registry/modify-driver/")) {
|
|
5520
|
-
crumbs.push({
|
|
5521
|
-
label: t("VENDOR_DRIVER_DETAILS")
|
|
5522
|
-
});
|
|
5523
|
-
} else if (pathname.includes("/registry/additionaldetails")) {
|
|
5524
|
-
crumbs.push({
|
|
5525
|
-
label: t("VENDOR_ADDITIONAL_DETAILS")
|
|
5526
|
-
});
|
|
5527
|
-
} else if (pathname.includes("/registry/new-supervisor")) {
|
|
5528
|
-
crumbs.push({
|
|
5529
|
-
label: t("ES_FSM_REGISTRY_TITLE_NEW_SUPERVISOR")
|
|
5530
|
-
});
|
|
5531
|
-
} else if (pathname.includes("/registry/supervisor-details") || pathname.includes("/registry/modify-supervisor/")) {
|
|
5532
|
-
crumbs.push({
|
|
5533
|
-
label: t("VENDOR_SUPERVISOR_DETAILS")
|
|
5534
|
-
});
|
|
5535
|
-
} else if (pathname.includes("/registry/new-surveyor")) {
|
|
5536
|
-
crumbs.push({
|
|
5537
|
-
label: t("ES_FSM_REGISTRY_TITLE_NEW_SURVEYOR")
|
|
5538
|
-
});
|
|
5539
|
-
} else if (pathname.includes("/registry/surveyor-details") || pathname.includes("/registry/modify-surveyor/")) {
|
|
5540
|
-
crumbs.push({
|
|
5541
|
-
label: t("VENDOR_SURVEYOR_DETAILS")
|
|
5542
|
-
});
|
|
5586
|
+
staleTime: Infinity
|
|
5587
|
+
}),
|
|
5588
|
+
dsoData = _Digit$Hooks$fsm$useD.data,
|
|
5589
|
+
daoDataLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
5590
|
+
const stateId = Digit.ULBService.getStateId();
|
|
5591
|
+
const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
|
|
5592
|
+
genderTypeData = _Digit$Hooks$obps$use.data;
|
|
5593
|
+
const _useState6 = React.useState([]),
|
|
5594
|
+
zones = _useState6[0],
|
|
5595
|
+
setZones = _useState6[1];
|
|
5596
|
+
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
5597
|
+
boundaryData = _Digit$Hooks$useCommo.data,
|
|
5598
|
+
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
5599
|
+
React.useEffect(() => {
|
|
5600
|
+
var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
|
|
5601
|
+
const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
|
|
5602
|
+
const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
|
|
5603
|
+
if (Array.isArray(boundaries === null || boundaries === void 0 ? void 0 : boundaries.children) && (boundaries === null || boundaries === void 0 ? void 0 : boundaries.children.length) > 0) {
|
|
5604
|
+
const allZones = boundaries.children.flatMap(assembly => ((assembly === null || assembly === void 0 ? void 0 : assembly.children) || []).map(zone => ({
|
|
5605
|
+
code: zone.code,
|
|
5606
|
+
name: zone.name
|
|
5607
|
+
})));
|
|
5608
|
+
const zonesList = [...new Map(allZones.map(zone => [zone.code, zone])).values()];
|
|
5609
|
+
setZones(zonesList);
|
|
5543
5610
|
}
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
path: path + "/search-vendor",
|
|
5556
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5557
|
-
layoutClass: "normal"
|
|
5558
|
-
}, /*#__PURE__*/React__default.createElement(SearchVendor, _extends({}, props, {
|
|
5559
|
-
parentRoute: path
|
|
5560
|
-
})))
|
|
5561
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5562
|
-
path: path + "/registry/new-driver",
|
|
5563
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5564
|
-
layoutClass: "action"
|
|
5565
|
-
}, /*#__PURE__*/React__default.createElement(AddDriver, _extends({}, props, {
|
|
5566
|
-
parentRoute: path
|
|
5567
|
-
})))
|
|
5568
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5569
|
-
path: path + "/registry/new-vehicle",
|
|
5570
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5571
|
-
layoutClass: "action"
|
|
5572
|
-
}, /*#__PURE__*/React__default.createElement(AddVehicle, _extends({}, props, {
|
|
5573
|
-
parentRoute: path
|
|
5574
|
-
})))
|
|
5575
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5576
|
-
path: path + "/registry/additionaldetails",
|
|
5577
|
-
component: props => {
|
|
5578
|
-
const isInfoPage = props.location.pathname.includes("/info");
|
|
5579
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5580
|
-
layoutClass: isInfoPage ? "action" : "normal"
|
|
5581
|
-
}, /*#__PURE__*/React__default.createElement(VENDORCreate, _extends({}, props, {
|
|
5582
|
-
parentRoute: path
|
|
5583
|
-
})));
|
|
5611
|
+
}, [boundaryData]);
|
|
5612
|
+
React.useEffect(() => {
|
|
5613
|
+
var _genderTypeData$commo, _genderTypeData$commo2;
|
|
5614
|
+
if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
|
|
5615
|
+
var _genderTypeData$commo3, _genderTypeData$commo4;
|
|
5616
|
+
const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
|
|
5617
|
+
i18nKey: "COMMON_GENDER_" + genderDetails.code,
|
|
5618
|
+
code: "" + genderDetails.code,
|
|
5619
|
+
value: "" + genderDetails.code
|
|
5620
|
+
}));
|
|
5621
|
+
setGenderMenu(menuItems);
|
|
5584
5622
|
}
|
|
5585
|
-
}
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
parentRoute: path
|
|
5591
|
-
})))
|
|
5592
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5593
|
-
path: path + "/registry/modify-driver/:id",
|
|
5594
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5595
|
-
layoutClass: "action"
|
|
5596
|
-
}, /*#__PURE__*/React__default.createElement(EditDriver, _extends({}, props, {
|
|
5597
|
-
parentRoute: path
|
|
5598
|
-
})))
|
|
5599
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5600
|
-
path: path + "/common-search/:id",
|
|
5601
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5602
|
-
layoutClass: "normal"
|
|
5603
|
-
}, /*#__PURE__*/React__default.createElement(SearchApp, _extends({}, props, {
|
|
5604
|
-
parentRoute: path
|
|
5605
|
-
})))
|
|
5606
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5607
|
-
path: path + "/registry/new-vendor",
|
|
5608
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5609
|
-
layoutClass: "action"
|
|
5610
|
-
}, /*#__PURE__*/React__default.createElement(AddVendor, _extends({}, props, {
|
|
5611
|
-
parentRoute: path
|
|
5612
|
-
})))
|
|
5613
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5614
|
-
path: path + "/registry/vendor-details/:id",
|
|
5615
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5616
|
-
layoutClass: "action"
|
|
5617
|
-
}, /*#__PURE__*/React__default.createElement(EditVendorDetails, _extends({}, props, {
|
|
5618
|
-
parentRoute: path
|
|
5619
|
-
})))
|
|
5620
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5621
|
-
path: path + "/registry/vehicle-details/:id",
|
|
5622
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5623
|
-
layoutClass: "action"
|
|
5624
|
-
}, /*#__PURE__*/React__default.createElement(VehicleDetails, _extends({}, props, {
|
|
5625
|
-
parentRoute: path
|
|
5626
|
-
})))
|
|
5627
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5628
|
-
path: path + "/registry/modify-vehicle/:id",
|
|
5629
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5630
|
-
layoutClass: "action"
|
|
5631
|
-
}, /*#__PURE__*/React__default.createElement(EditVehicle, _extends({}, props, {
|
|
5632
|
-
parentRoute: path
|
|
5633
|
-
})))
|
|
5634
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5635
|
-
path: path + "/registry/new-supervisor",
|
|
5636
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5637
|
-
layoutClass: "action"
|
|
5638
|
-
}, /*#__PURE__*/React__default.createElement(AddSupervisor, _extends({}, props, {
|
|
5639
|
-
parentRoute: path
|
|
5640
|
-
})))
|
|
5641
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5642
|
-
path: path + "/registry/supervisor-details/:id",
|
|
5643
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5644
|
-
layoutClass: "action"
|
|
5645
|
-
}, /*#__PURE__*/React__default.createElement(SupervisorDetails, _extends({}, props, {
|
|
5646
|
-
parentRoute: path
|
|
5647
|
-
})))
|
|
5648
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5649
|
-
path: path + "/registry/modify-supervisor/:id",
|
|
5650
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5651
|
-
layoutClass: "action"
|
|
5652
|
-
}, /*#__PURE__*/React__default.createElement(EditSupervisor, _extends({}, props, {
|
|
5653
|
-
parentRoute: path
|
|
5654
|
-
})))
|
|
5655
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5656
|
-
path: path + "/registry/new-surveyor",
|
|
5657
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5658
|
-
layoutClass: "action"
|
|
5659
|
-
}, /*#__PURE__*/React__default.createElement(AddSurveyor, _extends({}, props, {
|
|
5660
|
-
parentRoute: path
|
|
5661
|
-
})))
|
|
5662
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5663
|
-
path: path + "/registry/surveyor-details/:id",
|
|
5664
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5665
|
-
layoutClass: "action"
|
|
5666
|
-
}, /*#__PURE__*/React__default.createElement(SurveyorDetails, _extends({}, props, {
|
|
5667
|
-
parentRoute: path
|
|
5668
|
-
})))
|
|
5669
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5670
|
-
path: path + "/registry/modify-surveyor/:id",
|
|
5671
|
-
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5672
|
-
layoutClass: "action"
|
|
5673
|
-
}, /*#__PURE__*/React__default.createElement(EditSurveyor, _extends({}, props, {
|
|
5674
|
-
parentRoute: path
|
|
5675
|
-
})))
|
|
5676
|
-
})))));
|
|
5677
|
-
};
|
|
5678
|
-
|
|
5679
|
-
const VENDORCard = () => {
|
|
5680
|
-
const _useTranslation = reactI18next.useTranslation(),
|
|
5681
|
-
t = _useTranslation.t;
|
|
5682
|
-
const history = reactRouterDom.useHistory();
|
|
5683
|
-
const isCitizen = window.location.pathname.toLowerCase().includes("citizen");
|
|
5684
|
-
let hasAccess = Digit.Utils.vendorAccess() || Digit.UserService.hasAccess(["WT_VENDOR", "MT_VENDOR"]);
|
|
5685
|
-
if (isCitizen) {
|
|
5686
|
-
hasAccess = Digit.UserService.hasAccess(["WT_VENDOR", "EKYC_VENDOR", "EKYC_SUPERVISOR"]);
|
|
5687
|
-
}
|
|
5688
|
-
if (!hasAccess) {
|
|
5689
|
-
return null;
|
|
5690
|
-
}
|
|
5691
|
-
const links = [{
|
|
5692
|
-
label: t("VENDOR_NEW_REGISTERATION"),
|
|
5693
|
-
link: isCitizen ? "/digit-ui/citizen/vendor/registry/new-vendor" : "/digit-ui/employee/vendor/registry/new-vendor"
|
|
5694
|
-
}, {
|
|
5695
|
-
label: t("SEARCH_VENDOR"),
|
|
5696
|
-
link: isCitizen ? "/digit-ui/citizen/vendor/search-vendor" : "/digit-ui/employee/vendor/search-vendor"
|
|
5697
|
-
}];
|
|
5698
|
-
const VENDORRole = Digit.UserService.hasAccess(["WT_VENDOR"]);
|
|
5699
|
-
const propsForModuleCard = _extends({
|
|
5700
|
-
Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PropertyHouse, null),
|
|
5701
|
-
moduleName: t("TITLE_VENDOR_MANAGEMENT"),
|
|
5702
|
-
kpis: [{
|
|
5703
|
-
count: 0,
|
|
5704
|
-
label: t("Inbox"),
|
|
5705
|
-
link: isCitizen ? "/digit-ui/citizen/vendor/search-vendor" : "/digit-ui/employee/vendor/search-vendor"
|
|
5706
|
-
}],
|
|
5707
|
-
links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole)
|
|
5708
|
-
}, isCitizen ? {
|
|
5709
|
-
onDetailsClick: () => history.push("/digit-ui/citizen/vendor/search-vendor")
|
|
5710
|
-
} : {});
|
|
5711
|
-
if (isCitizen) {
|
|
5712
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
5713
|
-
className: "wt-citizen-card-premium"
|
|
5714
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard));
|
|
5715
|
-
}
|
|
5716
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
5717
|
-
};
|
|
5718
|
-
|
|
5719
|
-
const VendorDetails = _ref => {
|
|
5720
|
-
var _formData$ownerKey, _formData$ownerKey2, _formData$ownerKey3, _formData$ownerKey4;
|
|
5721
|
-
let t = _ref.t,
|
|
5722
|
-
config = _ref.config,
|
|
5723
|
-
onSelect = _ref.onSelect,
|
|
5724
|
-
userType = _ref.userType,
|
|
5725
|
-
formData = _ref.formData;
|
|
5726
|
-
let index = 0;
|
|
5727
|
-
const user = Digit.UserService.getUser().info;
|
|
5728
|
-
const applicantName = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].applicantName || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey = formData.ownerKey) === null || _formData$ownerKey === void 0 ? void 0 : _formData$ownerKey.applicantName) || "";
|
|
5729
|
-
const emailId = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].emailId || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey2 = formData.ownerKey) === null || _formData$ownerKey2 === void 0 ? void 0 : _formData$ownerKey2.emailId) || "";
|
|
5730
|
-
const mobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].mobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey3 = formData.ownerKey) === null || _formData$ownerKey3 === void 0 ? void 0 : _formData$ownerKey3.mobileNumber) || (user === null || user === void 0 ? void 0 : user.mobileNumber);
|
|
5731
|
-
const altMobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].altMobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey4 = formData.ownerKey) === null || _formData$ownerKey4 === void 0 ? void 0 : _formData$ownerKey4.altmobileNumber) || "";
|
|
5732
|
-
const _useState = React.useState(""),
|
|
5733
|
-
VendorCategory = _useState[0],
|
|
5734
|
-
setVendorCategory = _useState[1];
|
|
5735
|
-
const _useState2 = React.useState(""),
|
|
5736
|
-
VendorId = _useState2[0],
|
|
5737
|
-
setVendorId = _useState2[1];
|
|
5738
|
-
const _useState3 = React.useState(""),
|
|
5739
|
-
userName = _useState3[0],
|
|
5740
|
-
setUserName = _useState3[1];
|
|
5741
|
-
const _useState4 = React.useState(""),
|
|
5742
|
-
Bank = _useState4[0],
|
|
5743
|
-
setBank = _useState4[1];
|
|
5744
|
-
const _useState5 = React.useState(),
|
|
5745
|
-
BankbranchName = _useState5[0],
|
|
5746
|
-
setBankbranchName = _useState5[1];
|
|
5747
|
-
const _useState6 = React.useState(""),
|
|
5748
|
-
IFSC = _useState6[0],
|
|
5749
|
-
setIFSC = _useState6[1];
|
|
5750
|
-
const _useState7 = React.useState(""),
|
|
5751
|
-
AccountNo = _useState7[0],
|
|
5752
|
-
setAccountNo = _useState7[1];
|
|
5753
|
-
const _useState8 = React.useState(""),
|
|
5754
|
-
PanNo = _useState8[0],
|
|
5755
|
-
setPanNo = _useState8[1];
|
|
5756
|
-
const _useState9 = React.useState(""),
|
|
5757
|
-
GstNo = _useState9[0],
|
|
5758
|
-
setGstNo = _useState9[1];
|
|
5759
|
-
const _useState0 = React.useState(""),
|
|
5760
|
-
GstState = _useState0[0],
|
|
5761
|
-
setGstState = _useState0[1];
|
|
5762
|
-
const _useState1 = React.useState(""),
|
|
5763
|
-
RegistrationNo = _useState1[0],
|
|
5764
|
-
setRegistrationNo = _useState1[1];
|
|
5765
|
-
const _useState10 = React.useState(""),
|
|
5766
|
-
EpfNo = _useState10[0],
|
|
5767
|
-
setEpfNo = _useState10[1];
|
|
5768
|
-
const _useState11 = React.useState(""),
|
|
5769
|
-
EsiNo = _useState11[0],
|
|
5770
|
-
setEsiNo = _useState11[1];
|
|
5771
|
-
const _useState12 = React.useState(""),
|
|
5772
|
-
VendorType = _useState12[0],
|
|
5773
|
-
setVendorType = _useState12[1];
|
|
5774
|
-
const _useState13 = React.useState(""),
|
|
5775
|
-
Status = _useState13[0],
|
|
5776
|
-
setStatus = _useState13[1];
|
|
5777
|
-
const _useState14 = React.useState(""),
|
|
5778
|
-
micrNo = _useState14[0],
|
|
5779
|
-
setmicrNo = _useState14[1];
|
|
5780
|
-
const _useState15 = React.useState(""),
|
|
5781
|
-
PhoneNo = _useState15[0],
|
|
5782
|
-
setPhoneNo = _useState15[1];
|
|
5783
|
-
const _useState16 = React.useState(""),
|
|
5784
|
-
ContactPerson = _useState16[0],
|
|
5785
|
-
setContactPerson = _useState16[1];
|
|
5623
|
+
}, [genderTypeData]);
|
|
5624
|
+
const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorUpdate(tenantId),
|
|
5625
|
+
mutate = _Digit$Hooks$fsm$useV.mutate;
|
|
5626
|
+
const _Digit$Hooks$useToast = Digit.Hooks.useToast(),
|
|
5627
|
+
setToast = _Digit$Hooks$useToast.setToast;
|
|
5786
5628
|
React.useEffect(() => {
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5629
|
+
setMutationHappened(false);
|
|
5630
|
+
clearSuccessData();
|
|
5631
|
+
clearError();
|
|
5632
|
+
}, []);
|
|
5633
|
+
React.useEffect(() => {
|
|
5634
|
+
if (dsoData && dsoData[0]) {
|
|
5635
|
+
var _dsoData$, _dsoDetails$additiona, _dsoDetails$additiona2, _dsoDetails$address, _dsoDetails$address2, _dsoDetails$address3, _dsoDetails$address4, _dsoDetails$address4$, _dsoDetails$address5, _dsoDetails$address6, _dsoDetails$address7, _dsoDetails$address8, _dsoDetails$address8$, _dsoDetails$address9, _dsoDetails$address9$, _dsoDetails$address$g, _dsoDetails$address$g2, _dsoDetails$owner, _dsoDetails$owner2, _dsoDetails$owner3, _dsoDetails$owner4, _dsoDetails$owner5, _dsoDetails$owner6, _dsoDetails$owner7, _dsoDetails$owner8, _dsoDetails$owner9, _dsoDetails$additiona3;
|
|
5636
|
+
const dsoDetails = (_dsoData$ = dsoData[0]) === null || _dsoData$ === void 0 ? void 0 : _dsoData$.dsoDetails;
|
|
5637
|
+
setDsoDetails(dsoDetails);
|
|
5638
|
+
const serviceType = {
|
|
5639
|
+
i18nKey: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$additiona = dsoDetails.additionalDetails) === null || _dsoDetails$additiona === void 0 ? void 0 : _dsoDetails$additiona.serviceType.toUpperCase(),
|
|
5640
|
+
code: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$additiona2 = dsoDetails.additionalDetails) === null || _dsoDetails$additiona2 === void 0 ? void 0 : _dsoDetails$additiona2.serviceType
|
|
5641
|
+
};
|
|
5642
|
+
const values = {
|
|
5643
|
+
vendorName: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.name,
|
|
5644
|
+
propertyAddress: {
|
|
5645
|
+
pincode: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address = dsoDetails.address) === null || _dsoDetails$address === void 0 ? void 0 : _dsoDetails$address.pincode) || "",
|
|
5646
|
+
city: {
|
|
5647
|
+
code: tenantId,
|
|
5648
|
+
name: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address2 = dsoDetails.address) === null || _dsoDetails$address2 === void 0 ? void 0 : _dsoDetails$address2.city,
|
|
5649
|
+
i18nKey: "TENANT_TENANTS_" + tenantId.toUpperCase().replace(".", "_")
|
|
5650
|
+
},
|
|
5651
|
+
locality: _extends({}, dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address3 = dsoDetails.address) === null || _dsoDetails$address3 === void 0 ? void 0 : _dsoDetails$address3.locality, {
|
|
5652
|
+
i18nkey: (dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.tenantId.toUpperCase().split(".").join("_")) + "_REVENUE_" + (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address4 = dsoDetails.address) === null || _dsoDetails$address4 === void 0 ? void 0 : (_dsoDetails$address4$ = _dsoDetails$address4.locality) === null || _dsoDetails$address4$ === void 0 ? void 0 : _dsoDetails$address4$.code)
|
|
5653
|
+
}),
|
|
5654
|
+
houseNo: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address5 = dsoDetails.address) === null || _dsoDetails$address5 === void 0 ? void 0 : _dsoDetails$address5.doorNo) || "",
|
|
5655
|
+
streetName: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address6 = dsoDetails.address) === null || _dsoDetails$address6 === void 0 ? void 0 : _dsoDetails$address6.street) || "",
|
|
5656
|
+
landmark: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address7 = dsoDetails.address) === null || _dsoDetails$address7 === void 0 ? void 0 : _dsoDetails$address7.landmark) || "",
|
|
5657
|
+
latitude: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address8 = dsoDetails.address) === null || _dsoDetails$address8 === void 0 ? void 0 : (_dsoDetails$address8$ = _dsoDetails$address8.geoLocation) === null || _dsoDetails$address8$ === void 0 ? void 0 : _dsoDetails$address8$.latitude) || "",
|
|
5658
|
+
longitude: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$address9 = dsoDetails.address) === null || _dsoDetails$address9 === void 0 ? void 0 : (_dsoDetails$address9$ = _dsoDetails$address9.geoLocation) === null || _dsoDetails$address9$ === void 0 ? void 0 : _dsoDetails$address9$.longitude) || ""
|
|
5659
|
+
},
|
|
5660
|
+
cpt: {
|
|
5661
|
+
details: {
|
|
5662
|
+
address: {
|
|
5663
|
+
pincode: dsoDetails.address.pincode,
|
|
5664
|
+
city: {
|
|
5665
|
+
code: tenantId,
|
|
5666
|
+
name: dsoDetails.address.city,
|
|
5667
|
+
i18nKey: "TENANT_TENANTS_" + tenantId.toUpperCase().replace(".", "_")
|
|
5668
|
+
},
|
|
5669
|
+
locality: _extends({}, dsoDetails.address.locality, {
|
|
5670
|
+
i18nKey: dsoDetails.tenantId.toUpperCase().replace(".", "_") + "_REVENUE_" + dsoDetails.address.locality.code
|
|
5671
|
+
}),
|
|
5672
|
+
houseNo: dsoDetails.address.doorNo,
|
|
5673
|
+
street: dsoDetails.address.street,
|
|
5674
|
+
landmark: dsoDetails.address.landmark,
|
|
5675
|
+
geoLocation: {
|
|
5676
|
+
latitude: (_dsoDetails$address$g = dsoDetails.address.geoLocation) === null || _dsoDetails$address$g === void 0 ? void 0 : _dsoDetails$address$g.latitude,
|
|
5677
|
+
longitude: (_dsoDetails$address$g2 = dsoDetails.address.geoLocation) === null || _dsoDetails$address$g2 === void 0 ? void 0 : _dsoDetails$address$g2.longitude
|
|
5678
|
+
}
|
|
5679
|
+
},
|
|
5680
|
+
additionalDetails: {
|
|
5681
|
+
assembly: "",
|
|
5682
|
+
block: "",
|
|
5683
|
+
zone: ""
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
},
|
|
5687
|
+
phone: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner = dsoDetails.owner) === null || _dsoDetails$owner === void 0 ? void 0 : _dsoDetails$owner.mobileNumber,
|
|
5688
|
+
ownerName: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner2 = dsoDetails.owner) === null || _dsoDetails$owner2 === void 0 ? void 0 : _dsoDetails$owner2.name,
|
|
5689
|
+
contractEndDate: Digit.DateUtils.ConvertTimestampToDate(dsoDetails.contractEndDate, "yyyy-MM-dd"),
|
|
5690
|
+
contractStartDate: Digit.DateUtils.ConvertTimestampToDate(dsoDetails.contractStartDate, "yyyy-MM-dd"),
|
|
5691
|
+
fatherOrHusbandName: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner3 = dsoDetails.owner) === null || _dsoDetails$owner3 === void 0 ? void 0 : _dsoDetails$owner3.fatherOrHusbandName,
|
|
5692
|
+
relationship: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner4 = dsoDetails.owner) === null || _dsoDetails$owner4 === void 0 ? void 0 : _dsoDetails$owner4.relationship,
|
|
5693
|
+
gender: genderMenu.find(ele => ele.code === dsoDetails.owner.gender),
|
|
5694
|
+
dob: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner5 = dsoDetails.owner) === null || _dsoDetails$owner5 === void 0 ? void 0 : _dsoDetails$owner5.dob) && Digit.DateUtils.ConvertTimestampToDate(dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner6 = dsoDetails.owner) === null || _dsoDetails$owner6 === void 0 ? void 0 : _dsoDetails$owner6.dob, "yyyy-MM-dd"),
|
|
5695
|
+
emailId: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner7 = dsoDetails.owner) === null || _dsoDetails$owner7 === void 0 ? void 0 : _dsoDetails$owner7.emailId) === "abc@egov.com" ? "" : dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner8 = dsoDetails.owner) === null || _dsoDetails$owner8 === void 0 ? void 0 : _dsoDetails$owner8.emailId,
|
|
5696
|
+
correspondenceAddress: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$owner9 = dsoDetails.owner) === null || _dsoDetails$owner9 === void 0 ? void 0 : _dsoDetails$owner9.correspondenceAddress,
|
|
5697
|
+
additionalDetails: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$additiona3 = dsoDetails.additionalDetails) === null || _dsoDetails$additiona3 === void 0 ? void 0 : _dsoDetails$additiona3.description,
|
|
5698
|
+
vendorId: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.vendor_id,
|
|
5699
|
+
serviceType: serviceType,
|
|
5700
|
+
zoneIds: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.zoneIds
|
|
5701
|
+
};
|
|
5702
|
+
setDefaultValues(values);
|
|
5703
|
+
}
|
|
5704
|
+
}, [dsoData]);
|
|
5705
|
+
React.useEffect(() => {
|
|
5706
|
+
var _dsoDetails$zoneIds;
|
|
5707
|
+
if (!zones.length || !((_dsoDetails$zoneIds = dsoDetails.zoneIds) !== null && _dsoDetails$zoneIds !== void 0 && _dsoDetails$zoneIds.length)) return;
|
|
5708
|
+
if (typeof dsoDetails.zoneIds[0] === "object") return;
|
|
5709
|
+
setDefaultValues(prev => _extends({}, prev, {
|
|
5710
|
+
zoneIds: zones.filter(z => {
|
|
5711
|
+
var _prev$zoneIds;
|
|
5712
|
+
return prev === null || prev === void 0 ? void 0 : (_prev$zoneIds = prev.zoneIds) === null || _prev$zoneIds === void 0 ? void 0 : _prev$zoneIds.includes(z.name);
|
|
5713
|
+
})
|
|
5714
|
+
}));
|
|
5715
|
+
}, [dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.zoneIds, zones]);
|
|
5716
|
+
const onFormValueChange = (setValue, data) => {
|
|
5717
|
+
var _data$propertyAddress, _data$propertyAddress2, _data$serviceType, _data$serviceType2;
|
|
5718
|
+
const isAddressFilled = (data === null || data === void 0 ? void 0 : (_data$propertyAddress = data.propertyAddress) === null || _data$propertyAddress === void 0 ? void 0 : _data$propertyAddress.city) && (data === null || data === void 0 ? void 0 : (_data$propertyAddress2 = data.propertyAddress) === null || _data$propertyAddress2 === void 0 ? void 0 : _data$propertyAddress2.locality);
|
|
5719
|
+
const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code);
|
|
5720
|
+
const isEkyc = (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code) === "EKYC";
|
|
5721
|
+
let isEkycFieldsFilled = true;
|
|
5722
|
+
if (isEkyc) {
|
|
5723
|
+
var _data$zoneIds, _data$clusterIds;
|
|
5724
|
+
isEkycFieldsFilled = (data === null || data === void 0 ? void 0 : data.ownerName) && (data === null || data === void 0 ? void 0 : data.contractStartDate) && (data === null || data === void 0 ? void 0 : data.contractEndDate) && (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.length) > 0 && (data === null || data === void 0 ? void 0 : (_data$clusterIds = data.clusterIds) === null || _data$clusterIds === void 0 ? void 0 : _data$clusterIds.length) > 0 && (data === null || data === void 0 ? void 0 : data.gender) && (data === null || data === void 0 ? void 0 : data.dob);
|
|
5725
|
+
}
|
|
5726
|
+
if (isVendorDetailsFilled && isAddressFilled && isEkycFieldsFilled) {
|
|
5727
|
+
setCanSubmit(true);
|
|
5795
5728
|
} else {
|
|
5796
|
-
|
|
5797
|
-
setBank(Bank);
|
|
5798
|
-
setBankbranchName(BankbranchName);
|
|
5799
|
-
setmicrNo(micrNo);
|
|
5800
|
-
} else {
|
|
5801
|
-
setBank("");
|
|
5802
|
-
setBankbranchName("");
|
|
5803
|
-
setmicrNo("");
|
|
5804
|
-
}
|
|
5729
|
+
setCanSubmit(false);
|
|
5805
5730
|
}
|
|
5806
|
-
}
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
}
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
const
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5731
|
+
};
|
|
5732
|
+
const closeToast = () => {
|
|
5733
|
+
setShowToast(null);
|
|
5734
|
+
};
|
|
5735
|
+
const onSubmit = data => {
|
|
5736
|
+
var _address$city, _address$city2, _address$city3, _address$city4, _address$locality, _address$locality2, _address$ward, _address$ward2, _mergedData$plotNo, _mergedData$buildingN, _mergedData$serviceTy, _mergedData$address, _mergedData$address2, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
|
|
5737
|
+
const mergedData = data;
|
|
5738
|
+
const address = mergedData === null || mergedData === void 0 ? void 0 : mergedData.propertyAddress;
|
|
5739
|
+
const pincode = address === null || address === void 0 ? void 0 : address.pincode;
|
|
5740
|
+
const street = address === null || address === void 0 ? void 0 : address.streetName;
|
|
5741
|
+
const doorNo = address === null || address === void 0 ? void 0 : address.houseNo;
|
|
5742
|
+
const landmark = address === null || address === void 0 ? void 0 : address.landmark;
|
|
5743
|
+
const city = address === null || address === void 0 ? void 0 : (_address$city = address.city) === null || _address$city === void 0 ? void 0 : _address$city.name;
|
|
5744
|
+
const state = address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.name;
|
|
5745
|
+
const district = address === null || address === void 0 ? void 0 : (_address$city3 = address.city) === null || _address$city3 === void 0 ? void 0 : _address$city3.name;
|
|
5746
|
+
const region = address === null || address === void 0 ? void 0 : (_address$city4 = address.city) === null || _address$city4 === void 0 ? void 0 : _address$city4.name;
|
|
5747
|
+
const localityCode = address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.code;
|
|
5748
|
+
const localityName = address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.name;
|
|
5749
|
+
const localityArea = address === null || address === void 0 ? void 0 : address.subLocality;
|
|
5750
|
+
const wardCode = address === null || address === void 0 ? void 0 : (_address$ward = address.ward) === null || _address$ward === void 0 ? void 0 : _address$ward.code;
|
|
5751
|
+
const wardName = address === null || address === void 0 ? void 0 : (_address$ward2 = address.ward) === null || _address$ward2 === void 0 ? void 0 : _address$ward2.name;
|
|
5752
|
+
const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
|
|
5753
|
+
const plotNo = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$plotNo = mergedData.plotNo) === null || _mergedData$plotNo === void 0 ? void 0 : _mergedData$plotNo.trim();
|
|
5754
|
+
const buildingName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$buildingN = mergedData.buildingName) === null || _mergedData$buildingN === void 0 ? void 0 : _mergedData$buildingN.trim();
|
|
5755
|
+
const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
|
|
5756
|
+
const phone = mergedData === null || mergedData === void 0 ? void 0 : mergedData.phone;
|
|
5757
|
+
const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.i18nKey) === "EKYC";
|
|
5758
|
+
let vendorData = _extends({}, dsoDetails, {
|
|
5759
|
+
tenantId: tenantId,
|
|
5760
|
+
name,
|
|
5761
|
+
agencyType: "ULB",
|
|
5762
|
+
paymentPreference: "post-service",
|
|
5763
|
+
address: _extends({}, dsoDetails.address, {
|
|
5764
|
+
tenantId: tenantId,
|
|
5765
|
+
landmark,
|
|
5766
|
+
doorNo,
|
|
5767
|
+
plotNo,
|
|
5768
|
+
street,
|
|
5769
|
+
city,
|
|
5770
|
+
district,
|
|
5771
|
+
region,
|
|
5772
|
+
state,
|
|
5773
|
+
country: "india",
|
|
5774
|
+
pincode,
|
|
5775
|
+
buildingName,
|
|
5776
|
+
locality: _extends({}, dsoDetails.address.locality, {
|
|
5777
|
+
code: localityCode || "",
|
|
5778
|
+
name: localityName || "",
|
|
5779
|
+
label: "Locality",
|
|
5780
|
+
area: localityArea || ""
|
|
5781
|
+
}),
|
|
5782
|
+
ward: wardCode ? {
|
|
5783
|
+
code: wardCode,
|
|
5784
|
+
name: wardName
|
|
5785
|
+
} : undefined,
|
|
5786
|
+
geoLocation: _extends({}, dsoDetails.address.geoLocation, {
|
|
5787
|
+
latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address = mergedData.address) === null || _mergedData$address === void 0 ? void 0 : _mergedData$address.latitude) || 28.6139,
|
|
5788
|
+
longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address2 = mergedData.address) === null || _mergedData$address2 === void 0 ? void 0 : _mergedData$address2.longitude) || 77.209
|
|
5789
|
+
})
|
|
5790
|
+
}),
|
|
5791
|
+
owner: _extends({}, dsoDetails.owner, {
|
|
5792
|
+
tenantId: "dl",
|
|
5793
|
+
name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
|
|
5794
|
+
fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
|
|
5795
|
+
relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
|
|
5796
|
+
gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
|
|
5797
|
+
dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? new Date(mergedData.dob).getTime() : new Date("1/1/1970").getTime(),
|
|
5798
|
+
emailId: emailId || "",
|
|
5799
|
+
mobileNumber: phone
|
|
5800
|
+
}),
|
|
5801
|
+
additionalDetails: {
|
|
5802
|
+
serviceType: isEkyc ? "ekyc" : mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy2 = mergedData.serviceType) === null || _mergedData$serviceTy2 === void 0 ? void 0 : _mergedData$serviceTy2.code
|
|
5803
|
+
},
|
|
5804
|
+
vehicles: [],
|
|
5805
|
+
drivers: [],
|
|
5806
|
+
source: isEkyc ? "eKYC Portal" : "WhatsApp"
|
|
5807
|
+
});
|
|
5808
|
+
if (isEkyc) {
|
|
5809
|
+
var _mergedData$zoneIds, _mergedData$clusterId;
|
|
5810
|
+
vendorData = _extends({}, vendorData, {
|
|
5811
|
+
zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z === null || z === void 0 ? void 0 : z.name)) || [],
|
|
5812
|
+
clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
|
|
5813
|
+
var _c$;
|
|
5814
|
+
return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
|
|
5815
|
+
})) || [],
|
|
5816
|
+
contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
|
|
5817
|
+
contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
|
|
5890
5818
|
});
|
|
5891
|
-
onSelect(config.key, ownerStep, false, index);
|
|
5892
5819
|
}
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5820
|
+
const payload = {
|
|
5821
|
+
vendor: vendorData
|
|
5822
|
+
};
|
|
5823
|
+
if (isEkyc) {
|
|
5824
|
+
payload.RequestInfo = {
|
|
5825
|
+
apiId: "Rainmaker",
|
|
5826
|
+
msgId: "ekyc-vendor-create"
|
|
5827
|
+
};
|
|
5897
5828
|
}
|
|
5898
|
-
|
|
5829
|
+
mutate(payload, {
|
|
5830
|
+
onError: error => {
|
|
5831
|
+
setShowToast({
|
|
5832
|
+
key: "error",
|
|
5833
|
+
action: error
|
|
5834
|
+
});
|
|
5835
|
+
},
|
|
5836
|
+
onSuccess: () => {
|
|
5837
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
5838
|
+
setToast({
|
|
5839
|
+
key: "success",
|
|
5840
|
+
action: "ES_VENDOR_UPDATE_VENDOR"
|
|
5841
|
+
});
|
|
5842
|
+
history.push("/digit-ui/" + userType + "/vendor/search-vendor");
|
|
5843
|
+
}
|
|
5844
|
+
});
|
|
5845
|
+
};
|
|
5846
|
+
const config = React__default.useMemo(() => {
|
|
5847
|
+
var _defaultValues$servic;
|
|
5848
|
+
return VendorConfig(t, (defaultValues === null || defaultValues === void 0 ? void 0 : (_defaultValues$servic = defaultValues.serviceType) === null || _defaultValues$servic === void 0 ? void 0 : _defaultValues$servic.i18nKey) || "", genderMenu, true);
|
|
5849
|
+
}, [t, defaultValues === null || defaultValues === void 0 ? void 0 : (_defaultValues$servic2 = defaultValues.serviceType) === null || _defaultValues$servic2 === void 0 ? void 0 : _defaultValues$servic2.i18nKey, genderMenu]);
|
|
5850
|
+
if (daoDataLoading || isLoading || Object.keys(defaultValues).length === 0) {
|
|
5851
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
5852
|
+
}
|
|
5899
5853
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
|
|
5900
5854
|
config: [{
|
|
5901
5855
|
timeLine: [{
|
|
5902
|
-
actions: t("
|
|
5856
|
+
actions: t("ES_FSM_REGISTRY_TITLE_EDIT_VENDOR"),
|
|
5903
5857
|
currentStep: 1
|
|
5904
5858
|
}]
|
|
5905
|
-
}, {
|
|
5906
|
-
timeLine: [{
|
|
5907
|
-
actions: t("VENDOR_DOCUMENT_DETAILS"),
|
|
5908
|
-
currentStep: 2
|
|
5909
|
-
}]
|
|
5910
|
-
}, {
|
|
5911
|
-
timeLine: [{
|
|
5912
|
-
actions: t("VENDOR_SUMMARY"),
|
|
5913
|
-
currentStep: 3
|
|
5914
|
-
}]
|
|
5915
5859
|
}],
|
|
5916
5860
|
currentActiveIndex: 0,
|
|
5917
5861
|
showFinalStep: false
|
|
@@ -5920,356 +5864,280 @@ const VendorDetails = _ref => {
|
|
|
5920
5864
|
flex: "1",
|
|
5921
5865
|
overflowY: "auto"
|
|
5922
5866
|
}
|
|
5923
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
message: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
|
|
5934
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
5935
|
-
t: t,
|
|
5936
|
-
type: "text",
|
|
5937
|
-
isMandatory: false,
|
|
5938
|
-
optionKey: "i18nKey",
|
|
5939
|
-
name: "IFSC",
|
|
5940
|
-
value: IFSC,
|
|
5941
|
-
placeholder: "Enter IFSC Code",
|
|
5942
|
-
onChange: setvendorifsc,
|
|
5943
|
-
style: {
|
|
5944
|
-
width: "100%"
|
|
5945
|
-
},
|
|
5946
|
-
maxLength: 11,
|
|
5947
|
-
ValidationRequired: true,
|
|
5948
|
-
validation: {
|
|
5949
|
-
isRequired: true,
|
|
5950
|
-
pattern: "^[A-Z]{4}0[A-Z0-9]{6}$",
|
|
5951
|
-
type: "text",
|
|
5952
|
-
title: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
|
|
5953
|
-
}
|
|
5954
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_BANK_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
5955
|
-
className: "check-page-link-button"
|
|
5956
|
-
}, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
5957
|
-
t: t,
|
|
5958
|
-
type: "text",
|
|
5959
|
-
isMandatory: false,
|
|
5960
|
-
optionKey: "i18nKey",
|
|
5961
|
-
name: "bankName",
|
|
5962
|
-
placeholder: "Bank Name Auto Select",
|
|
5963
|
-
style: {
|
|
5964
|
-
width: "100%"
|
|
5867
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
5868
|
+
isDisabled: !canSubmit,
|
|
5869
|
+
label: t("ES_COMMON_APPLICATION_SUBMIT"),
|
|
5870
|
+
config: config.filter(i => !i.hideInEmployee).map(config => {
|
|
5871
|
+
return _extends({}, config, {
|
|
5872
|
+
body: config.body.filter(a => !a.hideInEmployee)
|
|
5873
|
+
});
|
|
5874
|
+
}),
|
|
5875
|
+
fieldStyle: {
|
|
5876
|
+
marginRight: 0
|
|
5965
5877
|
},
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
t:
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
}
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
optionKey: "i18nKey",
|
|
6047
|
-
name: "PanNo",
|
|
6048
|
-
value: PanNo,
|
|
6049
|
-
onChange: setpanno,
|
|
6050
|
-
style: {
|
|
6051
|
-
width: "100%"
|
|
6052
|
-
},
|
|
6053
|
-
ValidationRequired: true,
|
|
6054
|
-
validation: {
|
|
6055
|
-
isRequired: true,
|
|
6056
|
-
pattern: "[A-Z]{5}[0-9]{4}[A-Z]{1}",
|
|
6057
|
-
type: "text",
|
|
6058
|
-
title: t("INVALID_PAN_NO_ERROR_MESSAGE")
|
|
6059
|
-
}
|
|
6060
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
6061
|
-
t: t,
|
|
6062
|
-
type: "text",
|
|
6063
|
-
isMandatory: false,
|
|
6064
|
-
optionKey: "i18nKey",
|
|
6065
|
-
name: "GstNo",
|
|
6066
|
-
value: GstNo,
|
|
6067
|
-
onChange: setgstno,
|
|
6068
|
-
style: {
|
|
6069
|
-
width: "100%"
|
|
6070
|
-
},
|
|
6071
|
-
ValidationRequired: true,
|
|
6072
|
-
validation: {
|
|
6073
|
-
isRequired: true,
|
|
6074
|
-
pattern: "^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$",
|
|
6075
|
-
type: "text",
|
|
6076
|
-
title: t("INVALID_GST_NO_ERROR_MESSAGE")
|
|
6077
|
-
}
|
|
6078
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_REGISTERED_STATE/UT")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
6079
|
-
t: t,
|
|
6080
|
-
type: "text",
|
|
6081
|
-
isMandatory: false,
|
|
6082
|
-
optionKey: "i18nKey",
|
|
6083
|
-
name: "GstState",
|
|
6084
|
-
value: GstState,
|
|
6085
|
-
onChange: setgststate,
|
|
6086
|
-
style: {
|
|
6087
|
-
width: "100%"
|
|
6088
|
-
},
|
|
6089
|
-
ValidationRequired: true,
|
|
6090
|
-
validation: {
|
|
6091
|
-
isRequired: true,
|
|
6092
|
-
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
6093
|
-
type: "text",
|
|
6094
|
-
title: t("PT_NAME_ERROR_MESSAGE")
|
|
6095
|
-
}
|
|
6096
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("REGISTRATION_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
6097
|
-
t: t,
|
|
6098
|
-
type: "text",
|
|
6099
|
-
isMandatory: false,
|
|
6100
|
-
optionKey: "i18nKey",
|
|
6101
|
-
name: "RegistrationNo",
|
|
6102
|
-
value: RegistrationNo,
|
|
6103
|
-
onChange: setregistrationno,
|
|
6104
|
-
style: {
|
|
6105
|
-
width: "100%"
|
|
6106
|
-
},
|
|
6107
|
-
ValidationRequired: true,
|
|
6108
|
-
validation: {
|
|
6109
|
-
isRequired: true,
|
|
6110
|
-
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
6111
|
-
type: "text",
|
|
6112
|
-
title: t("INVALID_REGISTRATION_NO_ERROR_MESSAGE")
|
|
6113
|
-
}
|
|
6114
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("EPF_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
6115
|
-
t: t,
|
|
6116
|
-
type: "text",
|
|
6117
|
-
isMandatory: false,
|
|
6118
|
-
optionKey: "i18nKey",
|
|
6119
|
-
name: "EpfNo",
|
|
6120
|
-
value: EpfNo,
|
|
6121
|
-
onChange: setepfno,
|
|
6122
|
-
style: {
|
|
6123
|
-
width: "100%"
|
|
6124
|
-
},
|
|
6125
|
-
ValidationRequired: true,
|
|
6126
|
-
validation: {
|
|
6127
|
-
isRequired: true,
|
|
6128
|
-
pattern: "^[a-zA-Z0-9/-]{1,15}$",
|
|
6129
|
-
type: "text",
|
|
6130
|
-
title: t("INVALID_EPF_NO_ERROR_MESSAGE")
|
|
6131
|
-
}
|
|
6132
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("ESI_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
6133
|
-
t: t,
|
|
6134
|
-
type: "text",
|
|
6135
|
-
isMandatory: false,
|
|
6136
|
-
optionKey: "i18nKey",
|
|
6137
|
-
name: "EsiNo",
|
|
6138
|
-
value: EsiNo,
|
|
6139
|
-
onChange: setesino,
|
|
6140
|
-
style: {
|
|
6141
|
-
width: "100%"
|
|
6142
|
-
},
|
|
6143
|
-
ValidationRequired: true,
|
|
6144
|
-
validation: {
|
|
6145
|
-
isRequired: true,
|
|
6146
|
-
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
6147
|
-
type: "text",
|
|
6148
|
-
title: t("INVALID_ESI_NO_ERROR_MESSAGE")
|
|
6149
|
-
}
|
|
6150
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENDOR_TYPE"), /*#__PURE__*/React__default.createElement("div", {
|
|
6151
|
-
className: "tooltip",
|
|
6152
|
-
style: {
|
|
6153
|
-
width: "12px",
|
|
6154
|
-
height: "5px",
|
|
6155
|
-
marginLeft: "10px",
|
|
6156
|
-
display: "inline-flex",
|
|
6157
|
-
alignItems: "center"
|
|
6158
|
-
}
|
|
6159
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6160
|
-
className: "tooltiptext",
|
|
6161
|
-
style: {
|
|
6162
|
-
whiteSpace: "pre-wrap",
|
|
6163
|
-
fontSize: "small",
|
|
6164
|
-
wordWrap: "break-word",
|
|
6165
|
-
width: "300px",
|
|
6166
|
-
marginLeft: "15px",
|
|
6167
|
-
marginBottom: "-10px"
|
|
6168
|
-
}
|
|
6169
|
-
}, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
6170
|
-
control: control,
|
|
6171
|
-
name: "VendorType",
|
|
6172
|
-
defaultValue: VendorType,
|
|
6173
|
-
rules: {
|
|
6174
|
-
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
6175
|
-
},
|
|
6176
|
-
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
6177
|
-
selected: VendorType,
|
|
6178
|
-
select: setVendorType,
|
|
6179
|
-
option: [{
|
|
6180
|
-
i18nKey: "Supplier",
|
|
6181
|
-
code: "SUPPLIER"
|
|
6182
|
-
}, {
|
|
6183
|
-
i18nKey: "Contractor",
|
|
6184
|
-
code: "CONTRACTOR"
|
|
6185
|
-
}],
|
|
6186
|
-
optionKey: "i18nKey",
|
|
6187
|
-
placeholder: "Select",
|
|
6188
|
-
t: t
|
|
6189
|
-
})
|
|
6190
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENOR_CATEGORY"), /*#__PURE__*/React__default.createElement("div", {
|
|
6191
|
-
className: "tooltip",
|
|
6192
|
-
style: {
|
|
6193
|
-
width: "12px",
|
|
6194
|
-
height: "5px",
|
|
6195
|
-
marginLeft: "10px",
|
|
6196
|
-
display: "inline-flex",
|
|
6197
|
-
alignItems: "center"
|
|
6198
|
-
}
|
|
6199
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6200
|
-
className: "tooltiptext",
|
|
6201
|
-
style: {
|
|
6202
|
-
whiteSpace: "pre-wrap",
|
|
6203
|
-
fontSize: "small",
|
|
6204
|
-
wordWrap: "break-word",
|
|
6205
|
-
width: "300px",
|
|
6206
|
-
marginLeft: "15px",
|
|
6207
|
-
marginBottom: "-10px"
|
|
6208
|
-
}
|
|
6209
|
-
}))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
6210
|
-
control: control,
|
|
6211
|
-
name: "VendorCategory",
|
|
6212
|
-
defaultValue: VendorCategory,
|
|
6213
|
-
rules: {
|
|
6214
|
-
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
6215
|
-
},
|
|
6216
|
-
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
6217
|
-
selected: VendorCategory,
|
|
6218
|
-
select: setVendorCategory,
|
|
6219
|
-
option: [{
|
|
6220
|
-
i18nKey: "Firm",
|
|
6221
|
-
code: "FIRM"
|
|
6222
|
-
}, {
|
|
6223
|
-
i18nKey: "Individual",
|
|
6224
|
-
code: "Individual"
|
|
6225
|
-
}],
|
|
6226
|
-
optionKey: "i18nKey",
|
|
6227
|
-
placeholder: "Select",
|
|
6228
|
-
t: t
|
|
6229
|
-
})
|
|
6230
|
-
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("STATUS"), /*#__PURE__*/React__default.createElement("div", {
|
|
6231
|
-
className: "tooltip",
|
|
6232
|
-
style: {
|
|
6233
|
-
width: "12px",
|
|
6234
|
-
height: "5px",
|
|
6235
|
-
marginLeft: "10px",
|
|
6236
|
-
display: "inline-flex",
|
|
6237
|
-
alignItems: "center"
|
|
5878
|
+
onSubmit: onSubmit,
|
|
5879
|
+
defaultValues: defaultValues,
|
|
5880
|
+
onFormValueChange: onFormValueChange,
|
|
5881
|
+
noBreakLine: true
|
|
5882
|
+
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
5883
|
+
error: showToast.key === "error" ? true : false,
|
|
5884
|
+
label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
|
|
5885
|
+
onClose: closeToast
|
|
5886
|
+
})));
|
|
5887
|
+
};
|
|
5888
|
+
|
|
5889
|
+
const EmployeeApp = _ref => {
|
|
5890
|
+
let path = _ref.path;
|
|
5891
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
5892
|
+
t = _useTranslation.t;
|
|
5893
|
+
const location = reactRouterDom.useLocation();
|
|
5894
|
+
sessionStorage.removeItem("revalidateddone");
|
|
5895
|
+
const AddDriver = Digit.ComponentRegistryService.getComponent("AddDriver");
|
|
5896
|
+
const AddVehicle = Digit.ComponentRegistryService.getComponent("AddVehicle");
|
|
5897
|
+
const DriverDetails = Digit.ComponentRegistryService.getComponent("DriverDetails");
|
|
5898
|
+
const VehicleDetails = Digit.ComponentRegistryService.getComponent("VehicleDetails");
|
|
5899
|
+
const EditDriver = Digit.ComponentRegistryService.getComponent("EditDriver");
|
|
5900
|
+
const EditVehicle = Digit.ComponentRegistryService.getComponent("EditVehicle");
|
|
5901
|
+
const getDynamicBreadcrumbs = () => {
|
|
5902
|
+
const pathname = location.pathname;
|
|
5903
|
+
let crumbs = [{
|
|
5904
|
+
icon: digitUiReactComponents.HomeIcon,
|
|
5905
|
+
path: "/digit-ui/employee"
|
|
5906
|
+
}, {
|
|
5907
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
5908
|
+
path: "/digit-ui/employee/vendor/search-vendor"
|
|
5909
|
+
}];
|
|
5910
|
+
if (pathname.includes("/registry/new-vendor")) {
|
|
5911
|
+
crumbs.push({
|
|
5912
|
+
label: t("ES_FSM_REGISTRY_TITLE_NEW_VENDOR")
|
|
5913
|
+
});
|
|
5914
|
+
} else if (pathname.includes("/search-vendor")) {
|
|
5915
|
+
crumbs.push({
|
|
5916
|
+
label: t("SEARCH_VENDOR")
|
|
5917
|
+
});
|
|
5918
|
+
} else if (pathname.includes("/registry/new-driver")) {
|
|
5919
|
+
crumbs.push({
|
|
5920
|
+
label: t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER")
|
|
5921
|
+
});
|
|
5922
|
+
} else if (pathname.includes("/registry/vendor-details") || pathname.includes("/registry/modify-vendor/")) {
|
|
5923
|
+
crumbs.push({
|
|
5924
|
+
label: t("VENDOR_VENDOR_DETAILS")
|
|
5925
|
+
});
|
|
5926
|
+
} else if (pathname.includes("/registry/vehicle-details") || pathname.includes("/registry/modify-vehicle/")) {
|
|
5927
|
+
crumbs.push({
|
|
5928
|
+
label: t("VENDOR_VEHICLE_DETAILS")
|
|
5929
|
+
});
|
|
5930
|
+
} else if (pathname.includes("/registry/new-vehicle")) {
|
|
5931
|
+
crumbs.push({
|
|
5932
|
+
label: t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE")
|
|
5933
|
+
});
|
|
5934
|
+
} else if (pathname.includes("/registry/driver-details") || pathname.includes("/registry/modify-driver/")) {
|
|
5935
|
+
crumbs.push({
|
|
5936
|
+
label: t("VENDOR_DRIVER_DETAILS")
|
|
5937
|
+
});
|
|
5938
|
+
} else if (pathname.includes("/registry/additionaldetails")) {
|
|
5939
|
+
crumbs.push({
|
|
5940
|
+
label: t("VENDOR_ADDITIONAL_DETAILS")
|
|
5941
|
+
});
|
|
5942
|
+
} else if (pathname.includes("/registry/new-supervisor")) {
|
|
5943
|
+
crumbs.push({
|
|
5944
|
+
label: t("ES_FSM_REGISTRY_TITLE_NEW_SUPERVISOR")
|
|
5945
|
+
});
|
|
5946
|
+
} else if (pathname.includes("/registry/supervisor-details") || pathname.includes("/registry/modify-supervisor/")) {
|
|
5947
|
+
crumbs.push({
|
|
5948
|
+
label: t("VENDOR_SUPERVISOR_DETAILS")
|
|
5949
|
+
});
|
|
5950
|
+
} else if (pathname.includes("/registry/new-surveyor")) {
|
|
5951
|
+
crumbs.push({
|
|
5952
|
+
label: t("ES_FSM_REGISTRY_TITLE_NEW_SURVEYOR")
|
|
5953
|
+
});
|
|
5954
|
+
} else if (pathname.includes("/registry/surveyor-details") || pathname.includes("/registry/modify-surveyor/")) {
|
|
5955
|
+
crumbs.push({
|
|
5956
|
+
label: t("VENDOR_SURVEYOR_DETAILS")
|
|
5957
|
+
});
|
|
6238
5958
|
}
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
5959
|
+
return crumbs;
|
|
5960
|
+
};
|
|
5961
|
+
return /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.AppContainer, null, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
5962
|
+
className: "ground-container employee-app-container form-container"
|
|
5963
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {
|
|
5964
|
+
leftContent: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ArrowLeft, {
|
|
5965
|
+
className: "icon"
|
|
5966
|
+
}), "Back"),
|
|
5967
|
+
onLeftClick: () => window.history.back(),
|
|
5968
|
+
breadcrumbs: getDynamicBreadcrumbs()
|
|
5969
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5970
|
+
path: path + "/search-vendor",
|
|
5971
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5972
|
+
layoutClass: "normal"
|
|
5973
|
+
}, /*#__PURE__*/React__default.createElement(SearchVendor, _extends({}, props, {
|
|
5974
|
+
parentRoute: path
|
|
5975
|
+
})))
|
|
5976
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5977
|
+
path: path + "/registry/new-driver",
|
|
5978
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5979
|
+
layoutClass: "action"
|
|
5980
|
+
}, /*#__PURE__*/React__default.createElement(AddDriver, _extends({}, props, {
|
|
5981
|
+
parentRoute: path
|
|
5982
|
+
})))
|
|
5983
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5984
|
+
path: path + "/registry/new-vehicle",
|
|
5985
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5986
|
+
layoutClass: "action"
|
|
5987
|
+
}, /*#__PURE__*/React__default.createElement(AddVehicle, _extends({}, props, {
|
|
5988
|
+
parentRoute: path
|
|
5989
|
+
})))
|
|
5990
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
5991
|
+
path: path + "/registry/additionaldetails",
|
|
5992
|
+
component: props => {
|
|
5993
|
+
const isInfoPage = props.location.pathname.includes("/info");
|
|
5994
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
5995
|
+
layoutClass: isInfoPage ? "action" : "normal"
|
|
5996
|
+
}, /*#__PURE__*/React__default.createElement(VENDORCreate, _extends({}, props, {
|
|
5997
|
+
parentRoute: path
|
|
5998
|
+
})));
|
|
6248
5999
|
}
|
|
6249
|
-
}
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
}
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
})
|
|
6000
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6001
|
+
path: path + "/registry/driver-details/:id",
|
|
6002
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6003
|
+
layoutClass: "action"
|
|
6004
|
+
}, /*#__PURE__*/React__default.createElement(DriverDetails, _extends({}, props, {
|
|
6005
|
+
parentRoute: path
|
|
6006
|
+
})))
|
|
6007
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6008
|
+
path: path + "/registry/modify-driver/:id",
|
|
6009
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6010
|
+
layoutClass: "action"
|
|
6011
|
+
}, /*#__PURE__*/React__default.createElement(EditDriver, _extends({}, props, {
|
|
6012
|
+
parentRoute: path
|
|
6013
|
+
})))
|
|
6014
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6015
|
+
path: path + "/common-search/:id",
|
|
6016
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6017
|
+
layoutClass: "normal"
|
|
6018
|
+
}, /*#__PURE__*/React__default.createElement(SearchApp, _extends({}, props, {
|
|
6019
|
+
parentRoute: path
|
|
6020
|
+
})))
|
|
6021
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6022
|
+
path: path + "/registry/new-vendor",
|
|
6023
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6024
|
+
layoutClass: "action"
|
|
6025
|
+
}, /*#__PURE__*/React__default.createElement(AddVendor, _extends({}, props, {
|
|
6026
|
+
parentRoute: path
|
|
6027
|
+
})))
|
|
6028
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6029
|
+
path: path + "/registry/vendor-details/:id",
|
|
6030
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6031
|
+
layoutClass: "action"
|
|
6032
|
+
}, /*#__PURE__*/React__default.createElement(VendorDetails, _extends({}, props, {
|
|
6033
|
+
parentRoute: path
|
|
6034
|
+
})))
|
|
6035
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6036
|
+
path: path + "/registry/modify-vendor/:id",
|
|
6037
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6038
|
+
layoutClass: "action"
|
|
6039
|
+
}, /*#__PURE__*/React__default.createElement(EditVendor, _extends({}, props, {
|
|
6040
|
+
parentRoute: path
|
|
6041
|
+
})))
|
|
6042
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6043
|
+
path: path + "/registry/vehicle-details/:id",
|
|
6044
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6045
|
+
layoutClass: "action"
|
|
6046
|
+
}, /*#__PURE__*/React__default.createElement(VehicleDetails, _extends({}, props, {
|
|
6047
|
+
parentRoute: path
|
|
6048
|
+
})))
|
|
6049
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6050
|
+
path: path + "/registry/modify-vehicle/:id",
|
|
6051
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6052
|
+
layoutClass: "action"
|
|
6053
|
+
}, /*#__PURE__*/React__default.createElement(EditVehicle, _extends({}, props, {
|
|
6054
|
+
parentRoute: path
|
|
6055
|
+
})))
|
|
6056
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6057
|
+
path: path + "/registry/new-supervisor",
|
|
6058
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6059
|
+
layoutClass: "action"
|
|
6060
|
+
}, /*#__PURE__*/React__default.createElement(AddSupervisor, _extends({}, props, {
|
|
6061
|
+
parentRoute: path
|
|
6062
|
+
})))
|
|
6063
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6064
|
+
path: path + "/registry/supervisor-details/:id",
|
|
6065
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6066
|
+
layoutClass: "action"
|
|
6067
|
+
}, /*#__PURE__*/React__default.createElement(SupervisorDetails, _extends({}, props, {
|
|
6068
|
+
parentRoute: path
|
|
6069
|
+
})))
|
|
6070
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6071
|
+
path: path + "/registry/modify-supervisor/:id",
|
|
6072
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6073
|
+
layoutClass: "action"
|
|
6074
|
+
}, /*#__PURE__*/React__default.createElement(EditSupervisor, _extends({}, props, {
|
|
6075
|
+
parentRoute: path
|
|
6076
|
+
})))
|
|
6077
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6078
|
+
path: path + "/registry/new-surveyor",
|
|
6079
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6080
|
+
layoutClass: "action"
|
|
6081
|
+
}, /*#__PURE__*/React__default.createElement(AddSurveyor, _extends({}, props, {
|
|
6082
|
+
parentRoute: path
|
|
6083
|
+
})))
|
|
6084
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6085
|
+
path: path + "/registry/surveyor-details/:id",
|
|
6086
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6087
|
+
layoutClass: "action"
|
|
6088
|
+
}, /*#__PURE__*/React__default.createElement(SurveyorDetails, _extends({}, props, {
|
|
6089
|
+
parentRoute: path
|
|
6090
|
+
})))
|
|
6091
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
6092
|
+
path: path + "/registry/modify-surveyor/:id",
|
|
6093
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
6094
|
+
layoutClass: "action"
|
|
6095
|
+
}, /*#__PURE__*/React__default.createElement(EditSurveyor, _extends({}, props, {
|
|
6096
|
+
parentRoute: path
|
|
6097
|
+
})))
|
|
6270
6098
|
})))));
|
|
6271
6099
|
};
|
|
6272
6100
|
|
|
6101
|
+
const VENDORCard = () => {
|
|
6102
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
6103
|
+
t = _useTranslation.t;
|
|
6104
|
+
const history = reactRouterDom.useHistory();
|
|
6105
|
+
const isCitizen = window.location.pathname.toLowerCase().includes("citizen");
|
|
6106
|
+
let hasAccess = Digit.Utils.vendorAccess() || Digit.UserService.hasAccess(["WT_VENDOR", "MT_VENDOR"]);
|
|
6107
|
+
if (isCitizen) {
|
|
6108
|
+
hasAccess = Digit.UserService.hasAccess(["WT_VENDOR", "EKYC_VENDOR", "EKYC_SUPERVISOR"]);
|
|
6109
|
+
}
|
|
6110
|
+
if (!hasAccess) {
|
|
6111
|
+
return null;
|
|
6112
|
+
}
|
|
6113
|
+
const links = [{
|
|
6114
|
+
label: t("VENDOR_NEW_REGISTERATION"),
|
|
6115
|
+
link: isCitizen ? "/digit-ui/citizen/vendor/registry/new-vendor" : "/digit-ui/employee/vendor/registry/new-vendor"
|
|
6116
|
+
}, {
|
|
6117
|
+
label: t("SEARCH_VENDOR"),
|
|
6118
|
+
link: isCitizen ? "/digit-ui/citizen/vendor/search-vendor" : "/digit-ui/employee/vendor/search-vendor"
|
|
6119
|
+
}];
|
|
6120
|
+
const VENDORRole = Digit.UserService.hasAccess(["WT_VENDOR"]);
|
|
6121
|
+
const propsForModuleCard = _extends({
|
|
6122
|
+
Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PropertyHouse, null),
|
|
6123
|
+
moduleName: t("TITLE_VENDOR_MANAGEMENT"),
|
|
6124
|
+
kpis: [{
|
|
6125
|
+
count: 0,
|
|
6126
|
+
label: t("Inbox"),
|
|
6127
|
+
link: isCitizen ? "/digit-ui/citizen/vendor/search-vendor" : "/digit-ui/employee/vendor/search-vendor"
|
|
6128
|
+
}],
|
|
6129
|
+
links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole)
|
|
6130
|
+
}, isCitizen ? {
|
|
6131
|
+
onDetailsClick: () => history.push("/digit-ui/citizen/vendor/search-vendor")
|
|
6132
|
+
} : {});
|
|
6133
|
+
if (isCitizen) {
|
|
6134
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
6135
|
+
className: "wt-citizen-card-premium"
|
|
6136
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard));
|
|
6137
|
+
}
|
|
6138
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
6139
|
+
};
|
|
6140
|
+
|
|
6273
6141
|
const VendorDocuments = _ref => {
|
|
6274
6142
|
var _formData$documents;
|
|
6275
6143
|
let t = _ref.t,
|
|
@@ -7303,7 +7171,14 @@ const CitizenVendorApp = () => {
|
|
|
7303
7171
|
path: path + "/registry/vendor-details/:id",
|
|
7304
7172
|
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
7305
7173
|
layoutClass: "action"
|
|
7306
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
7174
|
+
}, /*#__PURE__*/React__default.createElement(VendorDetails, _extends({}, props, {
|
|
7175
|
+
parentRoute: path
|
|
7176
|
+
})))
|
|
7177
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
7178
|
+
path: path + "/registry/modify-vendor/:id",
|
|
7179
|
+
component: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
7180
|
+
layoutClass: "action"
|
|
7181
|
+
}, /*#__PURE__*/React__default.createElement(EditVendor, _extends({}, props, {
|
|
7307
7182
|
parentRoute: path
|
|
7308
7183
|
})))
|
|
7309
7184
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
@@ -7455,8 +7330,6 @@ const CheckPage = _ref2 => {
|
|
|
7455
7330
|
t = _useTranslation2.t;
|
|
7456
7331
|
const vendordet = value.vendordet,
|
|
7457
7332
|
documents = value.documents;
|
|
7458
|
-
console.log("vendordetailssppsss", vendordet);
|
|
7459
|
-
console.log("documents", documents);
|
|
7460
7333
|
const _useState = React.useState(false),
|
|
7461
7334
|
agree = _useState[0],
|
|
7462
7335
|
setAgree = _useState[1];
|
|
@@ -8048,12 +7921,12 @@ const AddDriver = () => {
|
|
|
8048
7921
|
})));
|
|
8049
7922
|
};
|
|
8050
7923
|
|
|
8051
|
-
const Heading$
|
|
7924
|
+
const Heading$2 = props => {
|
|
8052
7925
|
return /*#__PURE__*/React__default.createElement("h1", {
|
|
8053
7926
|
className: "heading-m"
|
|
8054
7927
|
}, props.label);
|
|
8055
7928
|
};
|
|
8056
|
-
const CloseBtn$
|
|
7929
|
+
const CloseBtn$1 = props => {
|
|
8057
7930
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8058
7931
|
onClick: props.onClick
|
|
8059
7932
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
@@ -8395,10 +8268,10 @@ const DriverDetails = () => {
|
|
|
8395
8268
|
}, t(value.value) || "N/A"));
|
|
8396
8269
|
}))));
|
|
8397
8270
|
}))), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
8398
|
-
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$
|
|
8271
|
+
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$2, {
|
|
8399
8272
|
label: t(modalHeading())
|
|
8400
8273
|
}),
|
|
8401
|
-
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$
|
|
8274
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$1, {
|
|
8402
8275
|
onClick: closeModal
|
|
8403
8276
|
}),
|
|
8404
8277
|
actionCancelLabel: t("CS_COMMON_CANCEL"),
|
|
@@ -8567,958 +8440,1516 @@ const VehicleConfig = function (t, disabled) {
|
|
|
8567
8440
|
required: true,
|
|
8568
8441
|
pattern: /^[6-9]\d{9}$/
|
|
8569
8442
|
},
|
|
8570
|
-
error: t("FSM_REGISTRY_INVALID_PHONE"),
|
|
8571
|
-
defaultValue: ""
|
|
8572
|
-
}
|
|
8573
|
-
}, {
|
|
8574
|
-
label: "ES_FSM_REGISTRY_NEW_GENDER",
|
|
8575
|
-
isMandatory: true,
|
|
8576
|
-
type: "component",
|
|
8577
|
-
route: "select-gender",
|
|
8578
|
-
hideInEmployee: false,
|
|
8579
|
-
key: "selectGender",
|
|
8580
|
-
component: "SelectGender"
|
|
8581
|
-
}, {
|
|
8582
|
-
label: t("ES_FSM_REGISTRY_NEW_DOB"),
|
|
8583
|
-
isMandatory: true,
|
|
8584
|
-
type: "custom",
|
|
8585
|
-
key: "dob",
|
|
8586
|
-
populators: {
|
|
8587
|
-
name: "dob",
|
|
8588
|
-
validation: {
|
|
8589
|
-
required: true
|
|
8443
|
+
error: t("FSM_REGISTRY_INVALID_PHONE"),
|
|
8444
|
+
defaultValue: ""
|
|
8445
|
+
}
|
|
8446
|
+
}, {
|
|
8447
|
+
label: "ES_FSM_REGISTRY_NEW_GENDER",
|
|
8448
|
+
isMandatory: true,
|
|
8449
|
+
type: "component",
|
|
8450
|
+
route: "select-gender",
|
|
8451
|
+
hideInEmployee: false,
|
|
8452
|
+
key: "selectGender",
|
|
8453
|
+
component: "SelectGender"
|
|
8454
|
+
}, {
|
|
8455
|
+
label: t("ES_FSM_REGISTRY_NEW_DOB"),
|
|
8456
|
+
isMandatory: true,
|
|
8457
|
+
type: "custom",
|
|
8458
|
+
key: "dob",
|
|
8459
|
+
populators: {
|
|
8460
|
+
name: "dob",
|
|
8461
|
+
validation: {
|
|
8462
|
+
required: true
|
|
8463
|
+
},
|
|
8464
|
+
component: (props, customProps) => /*#__PURE__*/React__default.createElement(DatePicker$3, _extends({
|
|
8465
|
+
onChange: props.onChange,
|
|
8466
|
+
date: props.value
|
|
8467
|
+
}, customProps, {
|
|
8468
|
+
max: (() => {
|
|
8469
|
+
const date = new Date();
|
|
8470
|
+
date.setFullYear(date.getFullYear() - 18);
|
|
8471
|
+
return date.toISOString().split("T")[0];
|
|
8472
|
+
})()
|
|
8473
|
+
}))
|
|
8474
|
+
}
|
|
8475
|
+
}, {
|
|
8476
|
+
label: "ES_FSM_REGISTRY_NEW_EMAIL",
|
|
8477
|
+
isMandatory: false,
|
|
8478
|
+
type: "text",
|
|
8479
|
+
key: "emailId",
|
|
8480
|
+
populators: {
|
|
8481
|
+
name: "emailId",
|
|
8482
|
+
validation: {
|
|
8483
|
+
required: false,
|
|
8484
|
+
pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
|
|
8485
|
+
},
|
|
8486
|
+
error: t("FSM_REGISTRY_INVALID_EMAIL"),
|
|
8487
|
+
defaultValue: ""
|
|
8488
|
+
}
|
|
8489
|
+
}]
|
|
8490
|
+
}];
|
|
8491
|
+
};
|
|
8492
|
+
|
|
8493
|
+
const AddVehicle = _ref => {
|
|
8494
|
+
var _Digit$UserService$ge, _Digit$UserService$ge2;
|
|
8495
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
8496
|
+
const stateId = Digit.ULBService.getStateId();
|
|
8497
|
+
const _useState = React.useState(null),
|
|
8498
|
+
showToast = _useState[0],
|
|
8499
|
+
setShowToast = _useState[1];
|
|
8500
|
+
const history = reactRouterDom.useHistory();
|
|
8501
|
+
const _useTranslation = reactI18next.useTranslation(),
|
|
8502
|
+
t = _useTranslation.t;
|
|
8503
|
+
const queryClient = reactQuery.useQueryClient();
|
|
8504
|
+
const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
|
|
8505
|
+
setMutationHappened = _Digit$Hooks$useSessi[1];
|
|
8506
|
+
const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
|
|
8507
|
+
clearError = _Digit$Hooks$useSessi2[2];
|
|
8508
|
+
const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
|
|
8509
|
+
clearSuccessData = _Digit$Hooks$useSessi3[2];
|
|
8510
|
+
const isCitizen = Digit.UserService.getType() === "WT_VENDOR" || Digit.UserService.hasAccess(["WT_VENDOR"]);
|
|
8511
|
+
const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVehicleCreate(stateId),
|
|
8512
|
+
mutate = _Digit$Hooks$fsm$useV.mutate;
|
|
8513
|
+
const _Digit$Hooks$fsm$useV2 = Digit.Hooks.fsm.useVendorUpdate("dl.djb"),
|
|
8514
|
+
mutateVendor = _Digit$Hooks$fsm$useV2.mutate;
|
|
8515
|
+
const mobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
|
|
8516
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
8517
|
+
mobileNumber: mobileNumber
|
|
8518
|
+
}, {
|
|
8519
|
+
enabled: !!(isCitizen && mobileNumber)
|
|
8520
|
+
}),
|
|
8521
|
+
vendorData = _Digit$Hooks$fsm$useD.data;
|
|
8522
|
+
React.useEffect(() => {
|
|
8523
|
+
setMutationHappened(false);
|
|
8524
|
+
clearSuccessData();
|
|
8525
|
+
clearError();
|
|
8526
|
+
}, []);
|
|
8527
|
+
const Config = VehicleConfig(t);
|
|
8528
|
+
Config[0].body.forEach(item => {
|
|
8529
|
+
if (item.label === "ES_FSM_REGISTRY_VEHICLE_NUMBER") {
|
|
8530
|
+
item.labelChildren = /*#__PURE__*/React__default.createElement("div", {
|
|
8531
|
+
className: "tooltip",
|
|
8532
|
+
style: {
|
|
8533
|
+
paddingLeft: "10px",
|
|
8534
|
+
marginBottom: "-3px"
|
|
8535
|
+
}
|
|
8536
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.InfoIcon, null), /*#__PURE__*/React__default.createElement("span", {
|
|
8537
|
+
className: "tooltiptext",
|
|
8538
|
+
style: {
|
|
8539
|
+
width: "320px",
|
|
8540
|
+
left: "230%",
|
|
8541
|
+
fontSize: "14px"
|
|
8542
|
+
}
|
|
8543
|
+
}, item.populators.validation.title));
|
|
8544
|
+
}
|
|
8545
|
+
});
|
|
8546
|
+
const _useState2 = React.useState(false),
|
|
8547
|
+
canSubmit = _useState2[0],
|
|
8548
|
+
setSubmitValve = _useState2[1];
|
|
8549
|
+
const defaultValues = {
|
|
8550
|
+
serviceType: {
|
|
8551
|
+
code: "WT",
|
|
8552
|
+
name: "WT",
|
|
8553
|
+
i18nKey: "WT"
|
|
8554
|
+
},
|
|
8555
|
+
tripData: {
|
|
8556
|
+
noOfTrips: 1,
|
|
8557
|
+
amountPerTrip: null,
|
|
8558
|
+
amount: null
|
|
8559
|
+
}
|
|
8560
|
+
};
|
|
8561
|
+
const formatVehicleNumber = input => {
|
|
8562
|
+
const cleaned = input.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
8563
|
+
if (cleaned.length <= 2) return cleaned;
|
|
8564
|
+
const state = cleaned.slice(0, 2);
|
|
8565
|
+
const rest = cleaned.slice(2);
|
|
8566
|
+
if (!rest) return state;
|
|
8567
|
+
const rtoMatch = rest.match(/^(\d{1,2})/);
|
|
8568
|
+
if (!rtoMatch) return state + "-" + rest;
|
|
8569
|
+
const rtoDigits = rtoMatch[1];
|
|
8570
|
+
const afterRto = rest.slice(rtoDigits.length);
|
|
8571
|
+
const lettersMatch = afterRto.match(/^([A-Z]*)/);
|
|
8572
|
+
const middleLetters = lettersMatch ? lettersMatch[1] : "";
|
|
8573
|
+
const number = afterRto.slice(middleLetters.length);
|
|
8574
|
+
if (!number) {
|
|
8575
|
+
return state + "-" + rtoDigits + middleLetters;
|
|
8576
|
+
}
|
|
8577
|
+
if (middleLetters.length >= 3) {
|
|
8578
|
+
const splitAt = middleLetters.length <= 3 ? 1 : 2;
|
|
8579
|
+
const series = middleLetters.slice(0, splitAt);
|
|
8580
|
+
const subSeries = middleLetters.slice(splitAt);
|
|
8581
|
+
return state + "-" + rtoDigits + series + "-" + subSeries + "-" + number.slice(0, 4);
|
|
8582
|
+
}
|
|
8583
|
+
return state + "-" + rtoDigits + middleLetters + "-" + number.slice(0, 4);
|
|
8584
|
+
};
|
|
8585
|
+
const onFormValueChange = (setValue, formData) => {
|
|
8586
|
+
var _formData$vehicle, _formData$vehicle2;
|
|
8587
|
+
if (formData !== null && formData !== void 0 && formData.registrationNumber) {
|
|
8588
|
+
let updatedRegNo = formatVehicleNumber(formData.registrationNumber);
|
|
8589
|
+
if (updatedRegNo.length > 15) {
|
|
8590
|
+
updatedRegNo = updatedRegNo.slice(0, 15);
|
|
8591
|
+
}
|
|
8592
|
+
if (updatedRegNo !== formData.registrationNumber) {
|
|
8593
|
+
setValue("registrationNumber", updatedRegNo);
|
|
8594
|
+
}
|
|
8595
|
+
}
|
|
8596
|
+
if (formData !== null && formData !== void 0 && formData.registrationNumber && formData !== null && formData !== void 0 && formData.ownerName && formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$vehicle = formData.vehicle) !== null && _formData$vehicle !== void 0 && _formData$vehicle.modal && formData !== null && formData !== void 0 && (_formData$vehicle2 = formData.vehicle) !== null && _formData$vehicle2 !== void 0 && _formData$vehicle2.type && formData !== null && formData !== void 0 && formData.selectGender && formData !== null && formData !== void 0 && formData.dob && new Date(formData === null || formData === void 0 ? void 0 : formData.dob).getTime() <= new Date().setFullYear(new Date().getFullYear() - 18)) {
|
|
8597
|
+
setSubmitValve(true);
|
|
8598
|
+
} else {
|
|
8599
|
+
setSubmitValve(false);
|
|
8600
|
+
}
|
|
8601
|
+
};
|
|
8602
|
+
const closeToast = () => {
|
|
8603
|
+
setShowToast(null);
|
|
8604
|
+
};
|
|
8605
|
+
const onSubmit = data => {
|
|
8606
|
+
var _data$vehicle, _data$vehicle$type, _data$vehicle2, _data$vehicle2$modal, _data$vehicle3, _data$vehicle3$type, _data$serviceType, _data$selectGender;
|
|
8607
|
+
const registrationNumber = data === null || data === void 0 ? void 0 : data.registrationNumber;
|
|
8608
|
+
const vehicleType = data === null || data === void 0 ? void 0 : (_data$vehicle = data.vehicle) === null || _data$vehicle === void 0 ? void 0 : (_data$vehicle$type = _data$vehicle.type) === null || _data$vehicle$type === void 0 ? void 0 : _data$vehicle$type.code;
|
|
8609
|
+
const vehicleModal = data === null || data === void 0 ? void 0 : (_data$vehicle2 = data.vehicle) === null || _data$vehicle2 === void 0 ? void 0 : (_data$vehicle2$modal = _data$vehicle2.modal) === null || _data$vehicle2$modal === void 0 ? void 0 : _data$vehicle2$modal.code;
|
|
8610
|
+
const tankCapacity = data === null || data === void 0 ? void 0 : (_data$vehicle3 = data.vehicle) === null || _data$vehicle3 === void 0 ? void 0 : (_data$vehicle3$type = _data$vehicle3.type) === null || _data$vehicle3$type === void 0 ? void 0 : _data$vehicle3$type.capacity;
|
|
8611
|
+
const pollutionCert = new Date("" + (data === null || data === void 0 ? void 0 : data.pollutionCert)).getTime();
|
|
8612
|
+
const insurance = new Date("" + (data === null || data === void 0 ? void 0 : data.insurance)).getTime();
|
|
8613
|
+
const roadTax = new Date("" + (data === null || data === void 0 ? void 0 : data.roadTax)).getTime();
|
|
8614
|
+
const fitnessValidity = new Date("" + (data === null || data === void 0 ? void 0 : data.fitnessValidity)).getTime();
|
|
8615
|
+
const ownerName = data === null || data === void 0 ? void 0 : data.ownerName;
|
|
8616
|
+
const phone = data === null || data === void 0 ? void 0 : data.phone;
|
|
8617
|
+
const additionalDetails = data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code;
|
|
8618
|
+
const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
|
|
8619
|
+
const emailId = data === null || data === void 0 ? void 0 : data.emailId;
|
|
8620
|
+
const dob = new Date("" + data.dob).getTime() || new Date("1/1/1970").getTime();
|
|
8621
|
+
const formData = {
|
|
8622
|
+
vehicle: {
|
|
8623
|
+
tenantId: "dl.djb",
|
|
8624
|
+
registrationNumber: registrationNumber,
|
|
8625
|
+
model: vehicleModal,
|
|
8626
|
+
type: vehicleType,
|
|
8627
|
+
tankCapacity: tankCapacity,
|
|
8628
|
+
suctionType: "SEWER_SUCTION_MACHINE",
|
|
8629
|
+
pollutionCertiValidTill: pollutionCert,
|
|
8630
|
+
InsuranceCertValidTill: insurance,
|
|
8631
|
+
fitnessValidTill: fitnessValidity,
|
|
8632
|
+
roadTaxPaidTill: roadTax,
|
|
8633
|
+
gpsEnabled: true,
|
|
8634
|
+
source: "Municipal records",
|
|
8635
|
+
owner: {
|
|
8636
|
+
tenantId: stateId,
|
|
8637
|
+
name: ownerName,
|
|
8638
|
+
fatherOrHusbandName: ownerName,
|
|
8639
|
+
relationship: "OTHER",
|
|
8640
|
+
correspondenceAddress: "",
|
|
8641
|
+
mobileNumber: phone,
|
|
8642
|
+
gender: gender,
|
|
8643
|
+
dob: dob,
|
|
8644
|
+
emailId: emailId || "abc@egov.com"
|
|
8645
|
+
},
|
|
8646
|
+
additionalDetails: {
|
|
8647
|
+
serviceType: additionalDetails
|
|
8590
8648
|
},
|
|
8591
|
-
|
|
8592
|
-
onChange: props.onChange,
|
|
8593
|
-
date: props.value
|
|
8594
|
-
}, customProps, {
|
|
8595
|
-
max: (() => {
|
|
8596
|
-
const date = new Date();
|
|
8597
|
-
date.setFullYear(date.getFullYear() - 18);
|
|
8598
|
-
return date.toISOString().split("T")[0];
|
|
8599
|
-
})()
|
|
8600
|
-
}))
|
|
8649
|
+
vehicleOwner: "ULB"
|
|
8601
8650
|
}
|
|
8602
|
-
}
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8651
|
+
};
|
|
8652
|
+
mutate(formData, {
|
|
8653
|
+
onError: (error, variables) => {
|
|
8654
|
+
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
8655
|
+
const errorMessage = (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || (error === null || error === void 0 ? void 0 : error.message) || "An error occurred";
|
|
8656
|
+
setShowToast({
|
|
8657
|
+
key: "error",
|
|
8658
|
+
action: errorMessage
|
|
8659
|
+
});
|
|
8660
|
+
setTimeout(closeToast, 5000);
|
|
8661
|
+
},
|
|
8662
|
+
onSuccess: (data, variables) => {
|
|
8663
|
+
var _data$Errors, _data$data, _data$data$Errors, _vendorData$;
|
|
8664
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors = data.Errors) === null || _data$Errors === void 0 ? void 0 : _data$Errors.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$Errors = _data$data.Errors) === null || _data$data$Errors === void 0 ? void 0 : _data$data$Errors.length) > 0;
|
|
8665
|
+
if (isError) {
|
|
8666
|
+
var _data$data2, _data$data2$Errors, _data$data2$Errors$, _data$Errors2, _data$Errors2$;
|
|
8667
|
+
const errorMessage = (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$Errors = _data$data2.Errors) === null || _data$data2$Errors === void 0 ? void 0 : (_data$data2$Errors$ = _data$data2$Errors[0]) === null || _data$data2$Errors$ === void 0 ? void 0 : _data$data2$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors2 = data.Errors) === null || _data$Errors2 === void 0 ? void 0 : (_data$Errors2$ = _data$Errors2[0]) === null || _data$Errors2$ === void 0 ? void 0 : _data$Errors2$.message) || (data === null || data === void 0 ? void 0 : data.message) || "An error occurred";
|
|
8668
|
+
setShowToast({
|
|
8669
|
+
key: "error",
|
|
8670
|
+
action: errorMessage
|
|
8671
|
+
});
|
|
8672
|
+
setTimeout(closeToast, 5000);
|
|
8673
|
+
return;
|
|
8674
|
+
}
|
|
8675
|
+
setShowToast({
|
|
8676
|
+
key: "success",
|
|
8677
|
+
action: "ADD_VEHICLE"
|
|
8678
|
+
});
|
|
8679
|
+
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
8680
|
+
if (isCitizen && vendorData !== null && vendorData !== void 0 && (_vendorData$ = vendorData[0]) !== null && _vendorData$ !== void 0 && _vendorData$.dsoDetails) {
|
|
8681
|
+
var _data$vehicle4;
|
|
8682
|
+
const newVehicle = (data === null || data === void 0 ? void 0 : (_data$vehicle4 = data.vehicle) === null || _data$vehicle4 === void 0 ? void 0 : _data$vehicle4.map(v => _extends({}, v, {
|
|
8683
|
+
vendorVehicleStatus: "ACTIVE",
|
|
8684
|
+
status: "ACTIVE"
|
|
8685
|
+
}))) || [];
|
|
8686
|
+
const vendor = vendorData[0].dsoDetails;
|
|
8687
|
+
const updatedVendor = {
|
|
8688
|
+
vendor: _extends({}, vendor, {
|
|
8689
|
+
vehicles: vendor.vehicles ? [...vendor.vehicles, ...newVehicle] : [...newVehicle]
|
|
8690
|
+
})
|
|
8691
|
+
};
|
|
8692
|
+
mutateVendor(updatedVendor, {
|
|
8693
|
+
onError: error => {
|
|
8694
|
+
var _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
8695
|
+
const errorMessage = (error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "An error occurred";
|
|
8696
|
+
setShowToast({
|
|
8697
|
+
key: "error",
|
|
8698
|
+
action: errorMessage
|
|
8699
|
+
});
|
|
8700
|
+
setTimeout(closeToast, 5000);
|
|
8701
|
+
},
|
|
8702
|
+
onSuccess: vendorDataRes => {
|
|
8703
|
+
var _vendorDataRes$Errors, _vendorDataRes$data, _vendorDataRes$data$E, _Digit$UserService$ge3, _Digit$UserService$ge4, _Digit$UserService$ge5;
|
|
8704
|
+
const isError = (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : vendorDataRes.error) === true || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$Errors = vendorDataRes.Errors) === null || _vendorDataRes$Errors === void 0 ? void 0 : _vendorDataRes$Errors.length) > 0 || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$data = vendorDataRes.data) === null || _vendorDataRes$data === void 0 ? void 0 : (_vendorDataRes$data$E = _vendorDataRes$data.Errors) === null || _vendorDataRes$data$E === void 0 ? void 0 : _vendorDataRes$data$E.length) > 0;
|
|
8705
|
+
if (isError) {
|
|
8706
|
+
var _vendorDataRes$data2, _vendorDataRes$data2$, _vendorDataRes$data2$2, _vendorDataRes$Errors2, _vendorDataRes$Errors3;
|
|
8707
|
+
const errorMessage = (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$data2 = vendorDataRes.data) === null || _vendorDataRes$data2 === void 0 ? void 0 : (_vendorDataRes$data2$ = _vendorDataRes$data2.Errors) === null || _vendorDataRes$data2$ === void 0 ? void 0 : (_vendorDataRes$data2$2 = _vendorDataRes$data2$[0]) === null || _vendorDataRes$data2$2 === void 0 ? void 0 : _vendorDataRes$data2$2.message) || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$Errors2 = vendorDataRes.Errors) === null || _vendorDataRes$Errors2 === void 0 ? void 0 : (_vendorDataRes$Errors3 = _vendorDataRes$Errors2[0]) === null || _vendorDataRes$Errors3 === void 0 ? void 0 : _vendorDataRes$Errors3.message) || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : vendorDataRes.message) || "An error occurred";
|
|
8708
|
+
setShowToast({
|
|
8709
|
+
key: "error",
|
|
8710
|
+
action: errorMessage
|
|
8711
|
+
});
|
|
8712
|
+
setTimeout(closeToast, 5000);
|
|
8713
|
+
return;
|
|
8714
|
+
}
|
|
8715
|
+
setShowToast({
|
|
8716
|
+
key: "success",
|
|
8717
|
+
action: "ADD_VEHICLE"
|
|
8718
|
+
});
|
|
8719
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
8720
|
+
const userType = ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : (_Digit$UserService$ge5 = _Digit$UserService$ge4.type) === null || _Digit$UserService$ge5 === void 0 ? void 0 : _Digit$UserService$ge5.toLowerCase()) || "citizen";
|
|
8721
|
+
setTimeout(() => {
|
|
8722
|
+
closeToast();
|
|
8723
|
+
history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VEHICLE");
|
|
8724
|
+
}, 3000);
|
|
8725
|
+
}
|
|
8726
|
+
});
|
|
8727
|
+
} else {
|
|
8728
|
+
var _Digit$UserService$ge6, _Digit$UserService$ge7, _Digit$UserService$ge8;
|
|
8729
|
+
const userType = ((_Digit$UserService$ge6 = Digit.UserService.getUser()) === null || _Digit$UserService$ge6 === void 0 ? void 0 : (_Digit$UserService$ge7 = _Digit$UserService$ge6.info) === null || _Digit$UserService$ge7 === void 0 ? void 0 : (_Digit$UserService$ge8 = _Digit$UserService$ge7.type) === null || _Digit$UserService$ge8 === void 0 ? void 0 : _Digit$UserService$ge8.toLowerCase()) || "citizen";
|
|
8730
|
+
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
8731
|
+
setTimeout(() => {
|
|
8732
|
+
closeToast();
|
|
8733
|
+
history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VEHICLE");
|
|
8734
|
+
}, 3000);
|
|
8735
|
+
}
|
|
8615
8736
|
}
|
|
8616
|
-
}
|
|
8617
|
-
}
|
|
8737
|
+
});
|
|
8738
|
+
};
|
|
8739
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
|
|
8740
|
+
config: [{
|
|
8741
|
+
route: "vendor-details",
|
|
8742
|
+
timeLine: [{
|
|
8743
|
+
actions: t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE"),
|
|
8744
|
+
currentStep: 1
|
|
8745
|
+
}]
|
|
8746
|
+
}],
|
|
8747
|
+
currentActiveIndex: 0,
|
|
8748
|
+
showFinalStep: false
|
|
8749
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
8750
|
+
style: {
|
|
8751
|
+
flex: "1",
|
|
8752
|
+
overflowY: "auto"
|
|
8753
|
+
}
|
|
8754
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
8755
|
+
isDisabled: !canSubmit,
|
|
8756
|
+
label: t("ES_COMMON_APPLICATION_SUBMIT"),
|
|
8757
|
+
config: Config.filter(i => !i.hideInEmployee).map(config => {
|
|
8758
|
+
return _extends({}, config, {
|
|
8759
|
+
isCollapsible: true,
|
|
8760
|
+
isDefaultOpen: true,
|
|
8761
|
+
body: config.body.filter(a => !a.hideInEmployee)
|
|
8762
|
+
});
|
|
8763
|
+
}),
|
|
8764
|
+
fieldStyle: {
|
|
8765
|
+
marginRight: 0
|
|
8766
|
+
},
|
|
8767
|
+
onSubmit: onSubmit,
|
|
8768
|
+
defaultValues: defaultValues,
|
|
8769
|
+
onFormValueChange: onFormValueChange,
|
|
8770
|
+
noBreakLine: true,
|
|
8771
|
+
mode: "onChange",
|
|
8772
|
+
noCard: true
|
|
8773
|
+
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
8774
|
+
error: showToast.key === "error" ? true : false,
|
|
8775
|
+
label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
|
|
8776
|
+
onClose: closeToast
|
|
8777
|
+
})));
|
|
8618
8778
|
};
|
|
8619
8779
|
|
|
8620
|
-
const
|
|
8621
|
-
|
|
8780
|
+
const Heading$3 = props => {
|
|
8781
|
+
return /*#__PURE__*/React__default.createElement("h1", {
|
|
8782
|
+
className: "heading-m"
|
|
8783
|
+
}, props.label);
|
|
8784
|
+
};
|
|
8785
|
+
const CloseBtn$2 = props => {
|
|
8786
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
8787
|
+
onClick: props.onClick
|
|
8788
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
8789
|
+
};
|
|
8790
|
+
const VehicleDetails = props => {
|
|
8791
|
+
var _vehicleData$6, _vehicleData$6$employ;
|
|
8622
8792
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
8623
|
-
const stateId = Digit.ULBService.getStateId();
|
|
8624
|
-
const _useState = React.useState(null),
|
|
8625
|
-
showToast = _useState[0],
|
|
8626
|
-
setShowToast = _useState[1];
|
|
8627
|
-
const history = reactRouterDom.useHistory();
|
|
8628
8793
|
const _useTranslation = reactI18next.useTranslation(),
|
|
8629
8794
|
t = _useTranslation.t;
|
|
8795
|
+
const history = reactRouterDom.useHistory();
|
|
8630
8796
|
const queryClient = reactQuery.useQueryClient();
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
const
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
const
|
|
8643
|
-
|
|
8644
|
-
|
|
8797
|
+
let _useParams = reactRouterDom.useParams(),
|
|
8798
|
+
vehicleNumber = _useParams.id;
|
|
8799
|
+
const _useState = React.useState(false),
|
|
8800
|
+
displayMenu = _useState[0],
|
|
8801
|
+
setDisplayMenu = _useState[1];
|
|
8802
|
+
const _useState2 = React.useState(null),
|
|
8803
|
+
selectedAction = _useState2[0],
|
|
8804
|
+
setSelectedAction = _useState2[1];
|
|
8805
|
+
const _useState3 = React.useState(false),
|
|
8806
|
+
showModal = _useState3[0],
|
|
8807
|
+
setShowModal = _useState3[1];
|
|
8808
|
+
const _useState4 = React.useState(null),
|
|
8809
|
+
showToast = _useState4[0],
|
|
8810
|
+
setShowToast = _useState4[1];
|
|
8811
|
+
const _useState5 = React.useState([]),
|
|
8812
|
+
vendors = _useState5[0],
|
|
8813
|
+
setVendors = _useState5[1];
|
|
8814
|
+
const _useState6 = React.useState({}),
|
|
8815
|
+
selectedOption = _useState6[0],
|
|
8816
|
+
setSelectedOption = _useState6[1];
|
|
8817
|
+
const _useState7 = React.useState(null),
|
|
8818
|
+
vehicleId = _useState7[0],
|
|
8819
|
+
setVehicleId = _useState7[1];
|
|
8820
|
+
const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVehicleDetails(tenantId, {
|
|
8821
|
+
registrationNumber: vehicleNumber
|
|
8645
8822
|
}, {
|
|
8646
|
-
|
|
8823
|
+
staleTime: Infinity
|
|
8647
8824
|
}),
|
|
8825
|
+
vehicleData = _Digit$Hooks$fsm$useV.data,
|
|
8826
|
+
isLoading = _Digit$Hooks$fsm$useV.isLoading,
|
|
8827
|
+
refetch = _Digit$Hooks$fsm$useV.refetch;
|
|
8828
|
+
React.useEffect(() => {
|
|
8829
|
+
if (!isLoading && vehicleData) {
|
|
8830
|
+
var _vehicleData$, _vehicleData$$vehicle;
|
|
8831
|
+
setVehicleId(vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$ = vehicleData[0]) === null || _vehicleData$ === void 0 ? void 0 : (_vehicleData$$vehicle = _vehicleData$.vehicleData) === null || _vehicleData$$vehicle === void 0 ? void 0 : _vehicleData$$vehicle.id);
|
|
8832
|
+
}
|
|
8833
|
+
}, [vehicleData, isLoading]);
|
|
8834
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
8835
|
+
sortBy: "name",
|
|
8836
|
+
sortOrder: "ASC",
|
|
8837
|
+
status: "ACTIVE"
|
|
8838
|
+
}, {}),
|
|
8648
8839
|
vendorData = _Digit$Hooks$fsm$useD.data;
|
|
8649
8840
|
React.useEffect(() => {
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
}, []);
|
|
8654
|
-
const Config = VehicleConfig(t);
|
|
8655
|
-
Config[0].body.forEach(item => {
|
|
8656
|
-
if (item.label === "ES_FSM_REGISTRY_VEHICLE_NUMBER") {
|
|
8657
|
-
item.labelChildren = /*#__PURE__*/React__default.createElement("div", {
|
|
8658
|
-
className: "tooltip",
|
|
8659
|
-
style: {
|
|
8660
|
-
paddingLeft: "10px",
|
|
8661
|
-
marginBottom: "-3px"
|
|
8662
|
-
}
|
|
8663
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.InfoIcon, null), /*#__PURE__*/React__default.createElement("span", {
|
|
8664
|
-
className: "tooltiptext",
|
|
8665
|
-
style: {
|
|
8666
|
-
width: "320px",
|
|
8667
|
-
left: "230%",
|
|
8668
|
-
fontSize: "14px"
|
|
8669
|
-
}
|
|
8670
|
-
}, item.populators.validation.title));
|
|
8841
|
+
if (vendorData) {
|
|
8842
|
+
let vendors = vendorData.map(data => data.dsoDetails);
|
|
8843
|
+
setVendors(vendors);
|
|
8671
8844
|
}
|
|
8672
|
-
});
|
|
8673
|
-
const
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8845
|
+
}, [vendorData]);
|
|
8846
|
+
const _Digit$Hooks$fsm$useU = Digit.Hooks.fsm.useUpdateVehicle(tenantId),
|
|
8847
|
+
mutate = _Digit$Hooks$fsm$useU.mutate;
|
|
8848
|
+
const _Digit$Hooks$fsm$useV2 = Digit.Hooks.fsm.useVendorUpdate(tenantId),
|
|
8849
|
+
mutateVendor = _Digit$Hooks$fsm$useV2.mutate;
|
|
8850
|
+
function onActionSelect(action) {
|
|
8851
|
+
setDisplayMenu(false);
|
|
8852
|
+
setSelectedAction(action);
|
|
8853
|
+
}
|
|
8854
|
+
React.useEffect(() => {
|
|
8855
|
+
refetch();
|
|
8856
|
+
}, []);
|
|
8857
|
+
React.useEffect(() => {
|
|
8858
|
+
switch (selectedAction) {
|
|
8859
|
+
case "DELETE":
|
|
8860
|
+
case "ADD_VENDOR":
|
|
8861
|
+
case "EDIT_VENDOR":
|
|
8862
|
+
case "DELETE_VENDOR":
|
|
8863
|
+
return setShowModal(true);
|
|
8864
|
+
case "EDIT":
|
|
8865
|
+
return history.push("/digit-ui/employee/fsm/registry/modify-vehicle/" + vehicleNumber);
|
|
8866
|
+
case "HOME":
|
|
8867
|
+
return history.push("/digit-ui/employee/fsm/registry?selectedTabs=VEHICLE");
|
|
8686
8868
|
}
|
|
8869
|
+
}, [selectedAction]);
|
|
8870
|
+
const closeToast = () => {
|
|
8871
|
+
setShowToast(null);
|
|
8687
8872
|
};
|
|
8688
|
-
const
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
const rest = cleaned.slice(2);
|
|
8693
|
-
if (!rest) return state;
|
|
8694
|
-
const rtoMatch = rest.match(/^(\d{1,2})/);
|
|
8695
|
-
if (!rtoMatch) return state + "-" + rest;
|
|
8696
|
-
const rtoDigits = rtoMatch[1];
|
|
8697
|
-
const afterRto = rest.slice(rtoDigits.length);
|
|
8698
|
-
const lettersMatch = afterRto.match(/^([A-Z]*)/);
|
|
8699
|
-
const middleLetters = lettersMatch ? lettersMatch[1] : "";
|
|
8700
|
-
const number = afterRto.slice(middleLetters.length);
|
|
8701
|
-
if (!number) {
|
|
8702
|
-
return state + "-" + rtoDigits + middleLetters;
|
|
8703
|
-
}
|
|
8704
|
-
if (middleLetters.length >= 3) {
|
|
8705
|
-
const splitAt = middleLetters.length <= 3 ? 1 : 2;
|
|
8706
|
-
const series = middleLetters.slice(0, splitAt);
|
|
8707
|
-
const subSeries = middleLetters.slice(splitAt);
|
|
8708
|
-
return state + "-" + rtoDigits + series + "-" + subSeries + "-" + number.slice(0, 4);
|
|
8709
|
-
}
|
|
8710
|
-
return state + "-" + rtoDigits + middleLetters + "-" + number.slice(0, 4);
|
|
8873
|
+
const closeModal = () => {
|
|
8874
|
+
setSelectedAction(null);
|
|
8875
|
+
setSelectedOption({});
|
|
8876
|
+
setShowModal(false);
|
|
8711
8877
|
};
|
|
8712
|
-
const
|
|
8713
|
-
var
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
}
|
|
8719
|
-
|
|
8720
|
-
|
|
8878
|
+
const handleAddVendor = () => {
|
|
8879
|
+
var _vehicleData$2, _dsoDetails$owner;
|
|
8880
|
+
let dsoDetails = selectedOption;
|
|
8881
|
+
let vehicleDetails = vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$2 = vehicleData[0]) === null || _vehicleData$2 === void 0 ? void 0 : _vehicleData$2.vehicleData;
|
|
8882
|
+
vehicleDetails.vendorVehicleStatus = "ACTIVE";
|
|
8883
|
+
const formData = {
|
|
8884
|
+
vendor: _extends({}, dsoDetails, {
|
|
8885
|
+
owner: _extends({}, dsoDetails.owner, {
|
|
8886
|
+
gender: ((_dsoDetails$owner = dsoDetails.owner) === null || _dsoDetails$owner === void 0 ? void 0 : _dsoDetails$owner.gender) || "OTHERS"
|
|
8887
|
+
}),
|
|
8888
|
+
vehicles: dsoDetails.vehicles ? [...dsoDetails.vehicles, vehicleDetails] : [vehicleDetails]
|
|
8889
|
+
})
|
|
8890
|
+
};
|
|
8891
|
+
mutateVendor(formData, {
|
|
8892
|
+
onError: (error, variables) => {
|
|
8893
|
+
setShowToast({
|
|
8894
|
+
key: "error",
|
|
8895
|
+
action: error
|
|
8896
|
+
});
|
|
8897
|
+
setTimeout(closeToast, 5000);
|
|
8898
|
+
},
|
|
8899
|
+
onSuccess: (data, variables) => {
|
|
8900
|
+
setShowToast({
|
|
8901
|
+
key: "success",
|
|
8902
|
+
action: "EDIT_VENDOR"
|
|
8903
|
+
});
|
|
8904
|
+
refetch();
|
|
8905
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
8906
|
+
setTimeout(closeToast, 5000);
|
|
8721
8907
|
}
|
|
8722
|
-
}
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
} else {
|
|
8726
|
-
setSubmitValve(false);
|
|
8727
|
-
}
|
|
8728
|
-
};
|
|
8729
|
-
const closeToast = () => {
|
|
8730
|
-
setShowToast(null);
|
|
8908
|
+
});
|
|
8909
|
+
setShowModal(false);
|
|
8910
|
+
setSelectedAction(null);
|
|
8731
8911
|
};
|
|
8732
|
-
const
|
|
8733
|
-
var
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
const tankCapacity = data === null || data === void 0 ? void 0 : (_data$vehicle3 = data.vehicle) === null || _data$vehicle3 === void 0 ? void 0 : (_data$vehicle3$type = _data$vehicle3.type) === null || _data$vehicle3$type === void 0 ? void 0 : _data$vehicle3$type.capacity;
|
|
8738
|
-
const pollutionCert = new Date("" + (data === null || data === void 0 ? void 0 : data.pollutionCert)).getTime();
|
|
8739
|
-
const insurance = new Date("" + (data === null || data === void 0 ? void 0 : data.insurance)).getTime();
|
|
8740
|
-
const roadTax = new Date("" + (data === null || data === void 0 ? void 0 : data.roadTax)).getTime();
|
|
8741
|
-
const fitnessValidity = new Date("" + (data === null || data === void 0 ? void 0 : data.fitnessValidity)).getTime();
|
|
8742
|
-
const ownerName = data === null || data === void 0 ? void 0 : data.ownerName;
|
|
8743
|
-
const phone = data === null || data === void 0 ? void 0 : data.phone;
|
|
8744
|
-
const additionalDetails = data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code;
|
|
8745
|
-
const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
|
|
8746
|
-
const emailId = data === null || data === void 0 ? void 0 : data.emailId;
|
|
8747
|
-
const dob = new Date("" + data.dob).getTime() || new Date("1/1/1970").getTime();
|
|
8912
|
+
const handleEditVendor = () => {
|
|
8913
|
+
var _vehicleData$3, _dsoDetails$owner2;
|
|
8914
|
+
let dsoDetails = selectedOption;
|
|
8915
|
+
let vehicleDetails = vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$3 = vehicleData[0]) === null || _vehicleData$3 === void 0 ? void 0 : _vehicleData$3.vehicleData;
|
|
8916
|
+
vehicleDetails.vendorVehicleStatus = "ACTIVE";
|
|
8748
8917
|
const formData = {
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8918
|
+
vendor: _extends({}, dsoDetails, {
|
|
8919
|
+
owner: _extends({}, dsoDetails.owner, {
|
|
8920
|
+
gender: ((_dsoDetails$owner2 = dsoDetails.owner) === null || _dsoDetails$owner2 === void 0 ? void 0 : _dsoDetails$owner2.gender) || "OTHERS"
|
|
8921
|
+
}),
|
|
8922
|
+
vehicles: dsoDetails.vehicles ? [...dsoDetails.vehicles, vehicleDetails] : [vehicleDetails]
|
|
8923
|
+
})
|
|
8924
|
+
};
|
|
8925
|
+
mutateVendor(formData, {
|
|
8926
|
+
onError: (error, variables) => {
|
|
8927
|
+
setShowToast({
|
|
8928
|
+
key: "error",
|
|
8929
|
+
action: error
|
|
8930
|
+
});
|
|
8931
|
+
setTimeout(closeToast, 5000);
|
|
8932
|
+
},
|
|
8933
|
+
onSuccess: (data, variables) => {
|
|
8934
|
+
setShowToast({
|
|
8935
|
+
key: "success",
|
|
8936
|
+
action: "EDIT_VENDOR"
|
|
8937
|
+
});
|
|
8938
|
+
refetch();
|
|
8939
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
8940
|
+
setTimeout(closeToast, 5000);
|
|
8941
|
+
}
|
|
8942
|
+
});
|
|
8943
|
+
setShowModal(false);
|
|
8944
|
+
setSelectedAction(null);
|
|
8945
|
+
};
|
|
8946
|
+
const handleDeleteVendor = () => {
|
|
8947
|
+
var _vehicleData$4, _vehicleData$4$vendor, _vehicleData$4$vendor2, _dsoDetails$owner3;
|
|
8948
|
+
let formData = {};
|
|
8949
|
+
let dsoDetails = vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$4 = vehicleData[0]) === null || _vehicleData$4 === void 0 ? void 0 : (_vehicleData$4$vendor = _vehicleData$4.vendorDetails) === null || _vehicleData$4$vendor === void 0 ? void 0 : (_vehicleData$4$vendor2 = _vehicleData$4$vendor.vendor) === null || _vehicleData$4$vendor2 === void 0 ? void 0 : _vehicleData$4$vendor2[0];
|
|
8950
|
+
let getVehicleVendorDetails = dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.vehicles;
|
|
8951
|
+
getVehicleVendorDetails = getVehicleVendorDetails.map(data => {
|
|
8952
|
+
if (data.id === vehicleId) {
|
|
8953
|
+
data.vendorVehicleStatus = "INACTIVE";
|
|
8954
|
+
}
|
|
8955
|
+
return data;
|
|
8956
|
+
});
|
|
8957
|
+
formData = {
|
|
8958
|
+
vendor: _extends({}, dsoDetails, {
|
|
8959
|
+
owner: _extends({}, dsoDetails.owner, {
|
|
8960
|
+
gender: ((_dsoDetails$owner3 = dsoDetails.owner) === null || _dsoDetails$owner3 === void 0 ? void 0 : _dsoDetails$owner3.gender) || "OTHERS"
|
|
8961
|
+
}),
|
|
8962
|
+
vehicles: getVehicleVendorDetails
|
|
8963
|
+
})
|
|
8964
|
+
};
|
|
8965
|
+
mutateVendor(formData, {
|
|
8966
|
+
onError: (error, variables) => {
|
|
8967
|
+
setShowToast({
|
|
8968
|
+
key: "error",
|
|
8969
|
+
action: error
|
|
8970
|
+
});
|
|
8971
|
+
setTimeout(closeToast, 5000);
|
|
8972
|
+
},
|
|
8973
|
+
onSuccess: (data, variables) => {
|
|
8974
|
+
setShowToast({
|
|
8975
|
+
key: "success",
|
|
8976
|
+
action: "DELETE_VENDOR"
|
|
8977
|
+
});
|
|
8978
|
+
queryClient.invalidateQueries("FSM_VENDOR_SEARCH");
|
|
8979
|
+
refetch();
|
|
8980
|
+
setTimeout(closeToast, 5000);
|
|
8777
8981
|
}
|
|
8982
|
+
});
|
|
8983
|
+
setShowModal(false);
|
|
8984
|
+
};
|
|
8985
|
+
const handleModalAction = () => {
|
|
8986
|
+
switch (selectedAction) {
|
|
8987
|
+
case "DELETE":
|
|
8988
|
+
return handleDelete();
|
|
8989
|
+
case "DELETE_VENDOR":
|
|
8990
|
+
return handleDeleteVendor();
|
|
8991
|
+
case "ADD_VENDOR":
|
|
8992
|
+
return handleAddVendor();
|
|
8993
|
+
case "EDIT_VENDOR":
|
|
8994
|
+
return handleEditVendor();
|
|
8995
|
+
}
|
|
8996
|
+
};
|
|
8997
|
+
const handleDelete = () => {
|
|
8998
|
+
var _vehicleData$5;
|
|
8999
|
+
let vehicleDetails = vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$5 = vehicleData[0]) === null || _vehicleData$5 === void 0 ? void 0 : _vehicleData$5.vehicleData;
|
|
9000
|
+
const formData = {
|
|
9001
|
+
vehicle: _extends({}, vehicleDetails, {
|
|
9002
|
+
status: "INACTIVE"
|
|
9003
|
+
})
|
|
8778
9004
|
};
|
|
8779
9005
|
mutate(formData, {
|
|
8780
9006
|
onError: (error, variables) => {
|
|
8781
|
-
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
8782
|
-
const errorMessage = (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || (error === null || error === void 0 ? void 0 : error.message) || "An error occurred";
|
|
8783
9007
|
setShowToast({
|
|
8784
9008
|
key: "error",
|
|
8785
|
-
action:
|
|
9009
|
+
action: error
|
|
8786
9010
|
});
|
|
8787
9011
|
setTimeout(closeToast, 5000);
|
|
8788
9012
|
},
|
|
8789
9013
|
onSuccess: (data, variables) => {
|
|
8790
|
-
var _data$Errors, _data$data, _data$data$Errors, _vendorData$;
|
|
8791
|
-
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors = data.Errors) === null || _data$Errors === void 0 ? void 0 : _data$Errors.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$Errors = _data$data.Errors) === null || _data$data$Errors === void 0 ? void 0 : _data$data$Errors.length) > 0;
|
|
8792
|
-
if (isError) {
|
|
8793
|
-
var _data$data2, _data$data2$Errors, _data$data2$Errors$, _data$Errors2, _data$Errors2$;
|
|
8794
|
-
const errorMessage = (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$Errors = _data$data2.Errors) === null || _data$data2$Errors === void 0 ? void 0 : (_data$data2$Errors$ = _data$data2$Errors[0]) === null || _data$data2$Errors$ === void 0 ? void 0 : _data$data2$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors2 = data.Errors) === null || _data$Errors2 === void 0 ? void 0 : (_data$Errors2$ = _data$Errors2[0]) === null || _data$Errors2$ === void 0 ? void 0 : _data$Errors2$.message) || (data === null || data === void 0 ? void 0 : data.message) || "An error occurred";
|
|
8795
|
-
setShowToast({
|
|
8796
|
-
key: "error",
|
|
8797
|
-
action: errorMessage
|
|
8798
|
-
});
|
|
8799
|
-
setTimeout(closeToast, 5000);
|
|
8800
|
-
return;
|
|
8801
|
-
}
|
|
8802
9014
|
setShowToast({
|
|
8803
9015
|
key: "success",
|
|
8804
|
-
action: "
|
|
9016
|
+
action: "DELETE_VEHICLE"
|
|
8805
9017
|
});
|
|
8806
9018
|
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
status: "ACTIVE"
|
|
8812
|
-
}))) || [];
|
|
8813
|
-
const vendor = vendorData[0].dsoDetails;
|
|
8814
|
-
const updatedVendor = {
|
|
8815
|
-
vendor: _extends({}, vendor, {
|
|
8816
|
-
vehicles: vendor.vehicles ? [...vendor.vehicles, ...newVehicle] : [...newVehicle]
|
|
8817
|
-
})
|
|
8818
|
-
};
|
|
8819
|
-
mutateVendor(updatedVendor, {
|
|
8820
|
-
onError: error => {
|
|
8821
|
-
var _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
|
|
8822
|
-
const errorMessage = (error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message) || (error === null || error === void 0 ? void 0 : error.message) || "An error occurred";
|
|
8823
|
-
setShowToast({
|
|
8824
|
-
key: "error",
|
|
8825
|
-
action: errorMessage
|
|
8826
|
-
});
|
|
8827
|
-
setTimeout(closeToast, 5000);
|
|
8828
|
-
},
|
|
8829
|
-
onSuccess: vendorDataRes => {
|
|
8830
|
-
var _vendorDataRes$Errors, _vendorDataRes$data, _vendorDataRes$data$E, _Digit$UserService$ge3, _Digit$UserService$ge4, _Digit$UserService$ge5;
|
|
8831
|
-
const isError = (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : vendorDataRes.error) === true || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$Errors = vendorDataRes.Errors) === null || _vendorDataRes$Errors === void 0 ? void 0 : _vendorDataRes$Errors.length) > 0 || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$data = vendorDataRes.data) === null || _vendorDataRes$data === void 0 ? void 0 : (_vendorDataRes$data$E = _vendorDataRes$data.Errors) === null || _vendorDataRes$data$E === void 0 ? void 0 : _vendorDataRes$data$E.length) > 0;
|
|
8832
|
-
if (isError) {
|
|
8833
|
-
var _vendorDataRes$data2, _vendorDataRes$data2$, _vendorDataRes$data2$2, _vendorDataRes$Errors2, _vendorDataRes$Errors3;
|
|
8834
|
-
const errorMessage = (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$data2 = vendorDataRes.data) === null || _vendorDataRes$data2 === void 0 ? void 0 : (_vendorDataRes$data2$ = _vendorDataRes$data2.Errors) === null || _vendorDataRes$data2$ === void 0 ? void 0 : (_vendorDataRes$data2$2 = _vendorDataRes$data2$[0]) === null || _vendorDataRes$data2$2 === void 0 ? void 0 : _vendorDataRes$data2$2.message) || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : (_vendorDataRes$Errors2 = vendorDataRes.Errors) === null || _vendorDataRes$Errors2 === void 0 ? void 0 : (_vendorDataRes$Errors3 = _vendorDataRes$Errors2[0]) === null || _vendorDataRes$Errors3 === void 0 ? void 0 : _vendorDataRes$Errors3.message) || (vendorDataRes === null || vendorDataRes === void 0 ? void 0 : vendorDataRes.message) || "An error occurred";
|
|
8835
|
-
setShowToast({
|
|
8836
|
-
key: "error",
|
|
8837
|
-
action: errorMessage
|
|
8838
|
-
});
|
|
8839
|
-
setTimeout(closeToast, 5000);
|
|
8840
|
-
return;
|
|
8841
|
-
}
|
|
8842
|
-
setShowToast({
|
|
8843
|
-
key: "success",
|
|
8844
|
-
action: "ADD_VEHICLE"
|
|
8845
|
-
});
|
|
8846
|
-
queryClient.invalidateQueries("DSO_SEARCH");
|
|
8847
|
-
const userType = ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : (_Digit$UserService$ge5 = _Digit$UserService$ge4.type) === null || _Digit$UserService$ge5 === void 0 ? void 0 : _Digit$UserService$ge5.toLowerCase()) || "citizen";
|
|
8848
|
-
setTimeout(() => {
|
|
8849
|
-
closeToast();
|
|
8850
|
-
history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VEHICLE");
|
|
8851
|
-
}, 3000);
|
|
8852
|
-
}
|
|
8853
|
-
});
|
|
8854
|
-
} else {
|
|
8855
|
-
var _Digit$UserService$ge6, _Digit$UserService$ge7, _Digit$UserService$ge8;
|
|
8856
|
-
const userType = ((_Digit$UserService$ge6 = Digit.UserService.getUser()) === null || _Digit$UserService$ge6 === void 0 ? void 0 : (_Digit$UserService$ge7 = _Digit$UserService$ge6.info) === null || _Digit$UserService$ge7 === void 0 ? void 0 : (_Digit$UserService$ge8 = _Digit$UserService$ge7.type) === null || _Digit$UserService$ge8 === void 0 ? void 0 : _Digit$UserService$ge8.toLowerCase()) || "citizen";
|
|
8857
|
-
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
8858
|
-
setTimeout(() => {
|
|
8859
|
-
closeToast();
|
|
8860
|
-
history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VEHICLE");
|
|
8861
|
-
}, 3000);
|
|
8862
|
-
}
|
|
9019
|
+
setTimeout(() => {
|
|
9020
|
+
closeToast();
|
|
9021
|
+
history.push("/digit-ui/employee/fsm/registry");
|
|
9022
|
+
}, 5000);
|
|
8863
9023
|
}
|
|
8864
9024
|
});
|
|
9025
|
+
setShowModal(false);
|
|
8865
9026
|
};
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
9027
|
+
const renderModalContent = () => {
|
|
9028
|
+
if (selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR") {
|
|
9029
|
+
return /*#__PURE__*/React__default.createElement(ConfirmationBox, {
|
|
9030
|
+
t: t,
|
|
9031
|
+
title: "ES_FSM_REGISTRY_DELETE_TEXT"
|
|
9032
|
+
});
|
|
9033
|
+
}
|
|
9034
|
+
if (selectedAction === "ADD_VENDOR") {
|
|
9035
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardText, null, t("ES_FSM_REGISTRY_SELECT_VENODOR")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9036
|
+
t: t,
|
|
9037
|
+
option: vendors,
|
|
9038
|
+
value: selectedOption,
|
|
9039
|
+
selected: selectedOption,
|
|
9040
|
+
select: setSelectedOption,
|
|
9041
|
+
optionKey: "name"
|
|
9042
|
+
}));
|
|
9043
|
+
}
|
|
9044
|
+
if (selectedAction === "EDIT_VENDOR") {
|
|
9045
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardText, null, t("ES_FSM_REGISTRY_SELECT_VENODOR")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9046
|
+
t: t,
|
|
9047
|
+
option: vendors,
|
|
9048
|
+
value: selectedOption,
|
|
9049
|
+
selected: selectedOption,
|
|
9050
|
+
select: setSelectedOption,
|
|
9051
|
+
optionKey: "name"
|
|
9052
|
+
}));
|
|
9053
|
+
}
|
|
9054
|
+
};
|
|
9055
|
+
const modalHeading = () => {
|
|
9056
|
+
switch (selectedAction) {
|
|
9057
|
+
case "DELETE":
|
|
9058
|
+
case "DELETE_VENDOR":
|
|
9059
|
+
return "ES_FSM_REGISTRY_DELETE_POPUP_HEADER";
|
|
9060
|
+
case "ADD_VENDOR":
|
|
9061
|
+
return "ES_FSM_REGISTRY_ADD_VENDOR_POPUP_HEADER";
|
|
9062
|
+
case "EDIT_VENDOR":
|
|
9063
|
+
return "ES_FSM_REGISTRY_ADD_VENDOR_POPUP_HEADER";
|
|
9064
|
+
}
|
|
9065
|
+
};
|
|
9066
|
+
if (isLoading) {
|
|
9067
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
9068
|
+
}
|
|
9069
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
9070
|
+
className: "employee-form-content"
|
|
9071
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
9072
|
+
className: "vehicle-details-card",
|
|
8877
9073
|
style: {
|
|
8878
|
-
|
|
8879
|
-
overflowY: "auto"
|
|
9074
|
+
position: "relative"
|
|
8880
9075
|
}
|
|
8881
|
-
},
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
}
|
|
9076
|
+
}, vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$6 = vehicleData[0]) === null || _vehicleData$6 === void 0 ? void 0 : (_vehicleData$6$employ = _vehicleData$6.employeeResponse) === null || _vehicleData$6$employ === void 0 ? void 0 : _vehicleData$6$employ.map((detail, index) => {
|
|
9077
|
+
var _detail$values;
|
|
9078
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
9079
|
+
key: index
|
|
9080
|
+
}, index > 0 && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
9081
|
+
style: {
|
|
9082
|
+
marginBottom: "16px",
|
|
9083
|
+
marginTop: "32px"
|
|
9084
|
+
}
|
|
9085
|
+
}, t(detail.title)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
9086
|
+
className: "card-with-background",
|
|
9087
|
+
style: {
|
|
9088
|
+
margin: "10px 16px",
|
|
9089
|
+
padding: "20px"
|
|
9090
|
+
}
|
|
9091
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9092
|
+
className: "additional-grid"
|
|
9093
|
+
}, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
|
|
9094
|
+
return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
9095
|
+
key: index
|
|
9096
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9097
|
+
className: "additional-label"
|
|
9098
|
+
}, t(value.title)), /*#__PURE__*/React__default.createElement("div", {
|
|
9099
|
+
className: "additional-value",
|
|
9100
|
+
style: {
|
|
9101
|
+
display: "flex",
|
|
9102
|
+
alignItems: "center",
|
|
9103
|
+
gap: "8px"
|
|
9104
|
+
}
|
|
9105
|
+
}, value.value === "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React__default.createElement("div", {
|
|
9106
|
+
onClick: () => onActionSelect("ADD_VENDOR"),
|
|
9107
|
+
style: {
|
|
9108
|
+
color: "#a82227",
|
|
9109
|
+
display: "flex",
|
|
9110
|
+
alignItems: "center",
|
|
9111
|
+
gap: "8px",
|
|
9112
|
+
cursor: "pointer"
|
|
9113
|
+
}
|
|
9114
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.AddIcon, {
|
|
9115
|
+
className: "",
|
|
9116
|
+
fill: "#a82227"
|
|
9117
|
+
}), " ", t(value.value) || "N/A"), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", null, value.value), /*#__PURE__*/React__default.createElement("div", {
|
|
9118
|
+
className: "add-details-link hover-button",
|
|
9119
|
+
onClick: () => onActionSelect("EDIT_VENDOR"),
|
|
9120
|
+
style: {
|
|
9121
|
+
cursor: "pointer"
|
|
9122
|
+
}
|
|
9123
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.EditIcon, {
|
|
9124
|
+
fill: "#a82227"
|
|
9125
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9126
|
+
className: "add-details-link hover-button",
|
|
9127
|
+
onClick: () => onActionSelect("DELETE_VENDOR"),
|
|
9128
|
+
style: {
|
|
9129
|
+
cursor: "pointer"
|
|
9130
|
+
}
|
|
9131
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.DeleteIcon, {
|
|
9132
|
+
className: "delete",
|
|
9133
|
+
fill: "#a82227"
|
|
9134
|
+
}))))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
9135
|
+
key: index
|
|
9136
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9137
|
+
className: "additional-label"
|
|
9138
|
+
}, t(value.title)), /*#__PURE__*/React__default.createElement("div", {
|
|
9139
|
+
className: "additional-value",
|
|
9140
|
+
style: value.value === "ACTIVE" ? {
|
|
9141
|
+
color: "green"
|
|
9142
|
+
} : {}
|
|
9143
|
+
}, t(value.value) || "N/A"));
|
|
9144
|
+
}))));
|
|
9145
|
+
})), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
9146
|
+
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$3, {
|
|
9147
|
+
label: t(modalHeading())
|
|
8890
9148
|
}),
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
},
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
9149
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$2, {
|
|
9150
|
+
onClick: closeModal
|
|
9151
|
+
}),
|
|
9152
|
+
actionCancelLabel: t("CS_COMMON_CANCEL"),
|
|
9153
|
+
actionCancelOnSubmit: closeModal,
|
|
9154
|
+
actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
|
|
9155
|
+
actionSaveOnSubmit: handleModalAction
|
|
9156
|
+
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
9157
|
+
style: {
|
|
9158
|
+
boxShadow: "none"
|
|
9159
|
+
}
|
|
9160
|
+
}, renderModalContent())), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
8901
9161
|
error: showToast.key === "error" ? true : false,
|
|
8902
9162
|
label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
|
|
8903
9163
|
onClose: closeToast
|
|
8904
|
-
})
|
|
9164
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, {
|
|
9165
|
+
style: {
|
|
9166
|
+
zIndex: "19"
|
|
9167
|
+
}
|
|
9168
|
+
}, displayMenu ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
|
|
9169
|
+
localeKeyPrefix: "ES_FSM_REGISTRY_ACTION",
|
|
9170
|
+
options: ["EDIT", "DELETE"],
|
|
9171
|
+
t: t,
|
|
9172
|
+
onSelect: onActionSelect
|
|
9173
|
+
}) : null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
9174
|
+
label: t("ES_COMMON_TAKE_ACTION"),
|
|
9175
|
+
onSubmit: () => setDisplayMenu(!displayMenu)
|
|
9176
|
+
}))) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null));
|
|
8905
9177
|
};
|
|
8906
9178
|
|
|
8907
|
-
const
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
onClick: props.onClick
|
|
8915
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
8916
|
-
};
|
|
8917
|
-
const VehicleDetails = props => {
|
|
8918
|
-
var _vehicleData$6, _vehicleData$6$employ;
|
|
9179
|
+
const SelectEkycZones = _ref => {
|
|
9180
|
+
let config = _ref.config,
|
|
9181
|
+
onSelect = _ref.onSelect,
|
|
9182
|
+
t = _ref.t,
|
|
9183
|
+
formData = _ref.formData,
|
|
9184
|
+
_ref$isMultiSelect = _ref.isMultiSelect,
|
|
9185
|
+
isMultiSelect = _ref$isMultiSelect === void 0 ? true : _ref$isMultiSelect;
|
|
8919
9186
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
8920
|
-
const
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
const
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
const
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
selectedAction = _useState2[0],
|
|
8931
|
-
setSelectedAction = _useState2[1];
|
|
8932
|
-
const _useState3 = React.useState(false),
|
|
8933
|
-
showModal = _useState3[0],
|
|
8934
|
-
setShowModal = _useState3[1];
|
|
8935
|
-
const _useState4 = React.useState(null),
|
|
8936
|
-
showToast = _useState4[0],
|
|
8937
|
-
setShowToast = _useState4[1];
|
|
8938
|
-
const _useState5 = React.useState([]),
|
|
8939
|
-
vendors = _useState5[0],
|
|
8940
|
-
setVendors = _useState5[1];
|
|
8941
|
-
const _useState6 = React.useState({}),
|
|
8942
|
-
selectedOption = _useState6[0],
|
|
8943
|
-
setSelectedOption = _useState6[1];
|
|
8944
|
-
const _useState7 = React.useState(null),
|
|
8945
|
-
vehicleId = _useState7[0],
|
|
8946
|
-
setVehicleId = _useState7[1];
|
|
8947
|
-
const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVehicleDetails(tenantId, {
|
|
8948
|
-
registrationNumber: vehicleNumber
|
|
8949
|
-
}, {
|
|
8950
|
-
staleTime: Infinity
|
|
8951
|
-
}),
|
|
8952
|
-
vehicleData = _Digit$Hooks$fsm$useV.data,
|
|
8953
|
-
isLoading = _Digit$Hooks$fsm$useV.isLoading,
|
|
8954
|
-
refetch = _Digit$Hooks$fsm$useV.refetch;
|
|
9187
|
+
const _useState = React.useState([]),
|
|
9188
|
+
zones = _useState[0],
|
|
9189
|
+
setZones = _useState[1];
|
|
9190
|
+
const _useState2 = React.useState([]),
|
|
9191
|
+
selectedZones = _useState2[0],
|
|
9192
|
+
setSelectedZones = _useState2[1];
|
|
9193
|
+
const initialized = React.useRef(false);
|
|
9194
|
+
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9195
|
+
boundaryData = _Digit$Hooks$useCommo.data,
|
|
9196
|
+
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
8955
9197
|
React.useEffect(() => {
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
9198
|
+
var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
|
|
9199
|
+
const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
|
|
9200
|
+
const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
|
|
9201
|
+
if (Array.isArray(boundaries === null || boundaries === void 0 ? void 0 : boundaries.children)) {
|
|
9202
|
+
const allZones = boundaries.children.flatMap(assembly => (assembly.children || []).map(zone => ({
|
|
9203
|
+
code: zone.code,
|
|
9204
|
+
name: zone.name
|
|
9205
|
+
})));
|
|
9206
|
+
const zonesList = [...new Map(allZones.map(z => [z.code, z])).values()];
|
|
9207
|
+
setZones(zonesList);
|
|
8959
9208
|
}
|
|
8960
|
-
}, [
|
|
8961
|
-
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
8962
|
-
sortBy: "name",
|
|
8963
|
-
sortOrder: "ASC",
|
|
8964
|
-
status: "ACTIVE"
|
|
8965
|
-
}, {}),
|
|
8966
|
-
vendorData = _Digit$Hooks$fsm$useD.data;
|
|
9209
|
+
}, [boundaryData]);
|
|
8967
9210
|
React.useEffect(() => {
|
|
8968
|
-
if (
|
|
8969
|
-
|
|
8970
|
-
|
|
9211
|
+
if (!zones.length || !Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds)) return;
|
|
9212
|
+
if (formData.zoneIds.length && typeof formData.zoneIds[0] === "object") {
|
|
9213
|
+
setSelectedZones(formData.zoneIds);
|
|
9214
|
+
return;
|
|
8971
9215
|
}
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
case "EDIT_VENDOR":
|
|
8989
|
-
case "DELETE_VENDOR":
|
|
8990
|
-
return setShowModal(true);
|
|
8991
|
-
case "EDIT":
|
|
8992
|
-
return history.push("/digit-ui/employee/fsm/registry/modify-vehicle/" + vehicleNumber);
|
|
8993
|
-
case "HOME":
|
|
8994
|
-
return history.push("/digit-ui/employee/fsm/registry?selectedTabs=VEHICLE");
|
|
9216
|
+
const selected = zones.filter(zone => formData.zoneIds.includes(zone.name));
|
|
9217
|
+
setSelectedZones(selected);
|
|
9218
|
+
if (!initialized.current) {
|
|
9219
|
+
initialized.current = true;
|
|
9220
|
+
onSelect(config.key, selected);
|
|
9221
|
+
}
|
|
9222
|
+
}, [zones, formData === null || formData === void 0 ? void 0 : formData.zoneIds, config.key, onSelect]);
|
|
9223
|
+
const handleSelect = value => {
|
|
9224
|
+
if (isMultiSelect) {
|
|
9225
|
+
const selected = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : [];
|
|
9226
|
+
setSelectedZones(selected);
|
|
9227
|
+
onSelect(config.key, selected);
|
|
9228
|
+
} else {
|
|
9229
|
+
const selectedZone = Array.isArray(value) ? Array.isArray(value[0]) ? value[0][1] : value[0] : value;
|
|
9230
|
+
setSelectedZones(selectedZone ? [selectedZone] : []);
|
|
9231
|
+
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.code) || "");
|
|
8995
9232
|
}
|
|
8996
|
-
}, [selectedAction]);
|
|
8997
|
-
const closeToast = () => {
|
|
8998
|
-
setShowToast(null);
|
|
8999
|
-
};
|
|
9000
|
-
const closeModal = () => {
|
|
9001
|
-
setSelectedAction(null);
|
|
9002
|
-
setSelectedOption({});
|
|
9003
|
-
setShowModal(false);
|
|
9004
|
-
};
|
|
9005
|
-
const handleAddVendor = () => {
|
|
9006
|
-
var _vehicleData$2, _dsoDetails$owner;
|
|
9007
|
-
let dsoDetails = selectedOption;
|
|
9008
|
-
let vehicleDetails = vehicleData === null || vehicleData === void 0 ? void 0 : (_vehicleData$2 = vehicleData[0]) === null || _vehicleData$2 === void 0 ? void 0 : _vehicleData$2.vehicleData;
|
|
9009
|
-
vehicleDetails.vendorVehicleStatus = "ACTIVE";
|
|
9010
|
-
const formData = {
|
|
9011
|
-
vendor: _extends({}, dsoDetails, {
|
|
9012
|
-
owner: _extends({}, dsoDetails.owner, {
|
|
9013
|
-
gender: ((_dsoDetails$owner = dsoDetails.owner) === null || _dsoDetails$owner === void 0 ? void 0 : _dsoDetails$owner.gender) || "OTHERS"
|
|
9014
|
-
}),
|
|
9015
|
-
vehicles: dsoDetails.vehicles ? [...dsoDetails.vehicles, vehicleDetails] : [vehicleDetails]
|
|
9016
|
-
})
|
|
9017
|
-
};
|
|
9018
|
-
mutateVendor(formData, {
|
|
9019
|
-
onError: (error, variables) => {
|
|
9020
|
-
setShowToast({
|
|
9021
|
-
key: "error",
|
|
9022
|
-
action: error
|
|
9023
|
-
});
|
|
9024
|
-
setTimeout(closeToast, 5000);
|
|
9025
|
-
},
|
|
9026
|
-
onSuccess: (data, variables) => {
|
|
9027
|
-
setShowToast({
|
|
9028
|
-
key: "success",
|
|
9029
|
-
action: "EDIT_VENDOR"
|
|
9030
|
-
});
|
|
9031
|
-
refetch();
|
|
9032
|
-
queryClient.invalidateQueries("DSO_SEARCH");
|
|
9033
|
-
setTimeout(closeToast, 5000);
|
|
9034
|
-
}
|
|
9035
|
-
});
|
|
9036
|
-
setShowModal(false);
|
|
9037
|
-
setSelectedAction(null);
|
|
9038
9233
|
};
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9234
|
+
if (isLoading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
9235
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label), config.isMandatory ? " *" : ""), /*#__PURE__*/React__default.createElement("div", {
|
|
9236
|
+
className: "field",
|
|
9237
|
+
style: {
|
|
9238
|
+
position: "relative",
|
|
9239
|
+
zIndex: 10
|
|
9240
|
+
}
|
|
9241
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MultiSelectDropdown, {
|
|
9242
|
+
options: zones,
|
|
9243
|
+
selected: selectedZones,
|
|
9244
|
+
onSelect: handleSelect,
|
|
9245
|
+
optionsKey: "name",
|
|
9246
|
+
t: t,
|
|
9247
|
+
multiple: isMultiSelect,
|
|
9248
|
+
isMultiSelect: isMultiSelect,
|
|
9249
|
+
showSelectedLabels: !isMultiSelect,
|
|
9250
|
+
ServerStyle: {
|
|
9251
|
+
backgroundColor: "#fff"
|
|
9252
|
+
},
|
|
9253
|
+
defaultLabel: isMultiSelect ? selectedZones.length + " Selected" : ""
|
|
9254
|
+
})), isMultiSelect && selectedZones.length > 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
9255
|
+
className: "selected-zones"
|
|
9256
|
+
}, selectedZones.map(zone => /*#__PURE__*/React__default.createElement("span", {
|
|
9257
|
+
key: zone.code,
|
|
9258
|
+
className: "selected-zone-chip"
|
|
9259
|
+
}, zone.name))));
|
|
9260
|
+
};
|
|
9261
|
+
|
|
9262
|
+
const SelectEkycClusters = _ref => {
|
|
9263
|
+
let config = _ref.config,
|
|
9264
|
+
onSelect = _ref.onSelect,
|
|
9265
|
+
t = _ref.t,
|
|
9266
|
+
formData = _ref.formData;
|
|
9267
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
9268
|
+
const _useState = React.useState([]),
|
|
9269
|
+
clusters = _useState[0],
|
|
9270
|
+
setClusters = _useState[1];
|
|
9271
|
+
const _useState2 = React.useState(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.clusterIds) ? formData.clusterIds : []),
|
|
9272
|
+
selectedClusters = _useState2[0],
|
|
9273
|
+
setSelectedClusters = _useState2[1];
|
|
9274
|
+
const selectedZones = React__default.useMemo(() => Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [], [formData === null || formData === void 0 ? void 0 : formData.zoneIds]);
|
|
9275
|
+
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9276
|
+
boundaryData = _Digit$Hooks$useCommo.data;
|
|
9277
|
+
React.useEffect(() => {
|
|
9278
|
+
var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
|
|
9279
|
+
const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
|
|
9280
|
+
const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
|
|
9281
|
+
let allClusters = [];
|
|
9282
|
+
if (selectedZones.length > 0 && Array.isArray(boundaries) && boundaries.length > 0) {
|
|
9283
|
+
selectedZones.forEach(zone => {
|
|
9284
|
+
const zoneBoundary = boundaries.find(b => b.code === ((zone === null || zone === void 0 ? void 0 : zone.code) || zone));
|
|
9285
|
+
const children = (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.children) || (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.boundary) || [];
|
|
9286
|
+
if (Array.isArray(children)) {
|
|
9287
|
+
children.forEach(child => {
|
|
9288
|
+
allClusters.push({
|
|
9289
|
+
code: child.code,
|
|
9290
|
+
name: child.name
|
|
9291
|
+
});
|
|
9292
|
+
});
|
|
9293
|
+
}
|
|
9294
|
+
});
|
|
9295
|
+
}
|
|
9296
|
+
if (allClusters.length === 0) {
|
|
9297
|
+
const staticClusters = {
|
|
9298
|
+
"ZONE-01": [{
|
|
9299
|
+
code: "CLUSTER-01",
|
|
9300
|
+
name: "CLUSTER-01"
|
|
9301
|
+
}],
|
|
9302
|
+
"ZONE-02": [{
|
|
9303
|
+
code: "CLUSTER-02",
|
|
9304
|
+
name: "CLUSTER-02"
|
|
9305
|
+
}],
|
|
9306
|
+
"ZONE-03": [{
|
|
9307
|
+
code: "CLUSTER-03",
|
|
9308
|
+
name: "CLUSTER-03"
|
|
9309
|
+
}],
|
|
9310
|
+
"ZONE-04": [{
|
|
9311
|
+
code: "CLUSTER-04",
|
|
9312
|
+
name: "CLUSTER-04"
|
|
9313
|
+
}],
|
|
9314
|
+
"ZONE-05": [{
|
|
9315
|
+
code: "CLUSTER-05",
|
|
9316
|
+
name: "CLUSTER-05"
|
|
9317
|
+
}]
|
|
9318
|
+
};
|
|
9319
|
+
if (selectedZones.length > 0) {
|
|
9320
|
+
selectedZones.forEach(z => {
|
|
9321
|
+
const zCode = (z === null || z === void 0 ? void 0 : z.code) || z;
|
|
9322
|
+
const zName = (z === null || z === void 0 ? void 0 : z.name) || z;
|
|
9323
|
+
if (staticClusters[zCode]) {
|
|
9324
|
+
allClusters = [...allClusters, ...staticClusters[zCode]];
|
|
9325
|
+
} else {
|
|
9326
|
+
allClusters.push({
|
|
9327
|
+
code: zCode + "-C1",
|
|
9328
|
+
name: zName + " Cluster 1"
|
|
9329
|
+
});
|
|
9330
|
+
}
|
|
9064
9331
|
});
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9332
|
+
} else {
|
|
9333
|
+
allClusters = [{
|
|
9334
|
+
code: "CLUSTER-01",
|
|
9335
|
+
name: "CLUSTER-01"
|
|
9336
|
+
}, {
|
|
9337
|
+
code: "CLUSTER-02",
|
|
9338
|
+
name: "CLUSTER-02"
|
|
9339
|
+
}, {
|
|
9340
|
+
code: "CLUSTER-03",
|
|
9341
|
+
name: "CLUSTER-03"
|
|
9342
|
+
}];
|
|
9068
9343
|
}
|
|
9069
|
-
}
|
|
9070
|
-
|
|
9071
|
-
|
|
9344
|
+
}
|
|
9345
|
+
if (allClusters.length > 0) {
|
|
9346
|
+
allClusters = Array.from(new Map(allClusters.map(item => [item.code, item])).values());
|
|
9347
|
+
}
|
|
9348
|
+
setClusters(allClusters);
|
|
9349
|
+
}, [selectedZones, boundaryData]);
|
|
9350
|
+
const handleSelect = value => {
|
|
9351
|
+
const extractedValue = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : value;
|
|
9352
|
+
setSelectedClusters(extractedValue);
|
|
9353
|
+
onSelect(config.key, extractedValue);
|
|
9072
9354
|
};
|
|
9073
|
-
const
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9355
|
+
const isDisabled = selectedZones.length === 0;
|
|
9356
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React__default.createElement("div", {
|
|
9357
|
+
className: "field",
|
|
9358
|
+
style: {
|
|
9359
|
+
position: "relative",
|
|
9360
|
+
zIndex: 9
|
|
9361
|
+
}
|
|
9362
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MultiSelectDropdown, {
|
|
9363
|
+
options: clusters,
|
|
9364
|
+
selected: selectedClusters,
|
|
9365
|
+
onSelect: handleSelect,
|
|
9366
|
+
optionsKey: "name",
|
|
9367
|
+
t: t,
|
|
9368
|
+
ServerStyle: {
|
|
9369
|
+
backgroundColor: "#fff"
|
|
9370
|
+
},
|
|
9371
|
+
disable: isDisabled
|
|
9372
|
+
})));
|
|
9373
|
+
};
|
|
9374
|
+
|
|
9375
|
+
const SelectEkycDropdown = _ref => {
|
|
9376
|
+
var _config$populators, _config$populators2;
|
|
9377
|
+
let config = _ref.config,
|
|
9378
|
+
onSelect = _ref.onSelect,
|
|
9379
|
+
t = _ref.t,
|
|
9380
|
+
formData = _ref.formData;
|
|
9381
|
+
const options = (config === null || config === void 0 ? void 0 : (_config$populators = config.populators) === null || _config$populators === void 0 ? void 0 : _config$populators.options) || [];
|
|
9382
|
+
const optionsKey = (config === null || config === void 0 ? void 0 : (_config$populators2 = config.populators) === null || _config$populators2 === void 0 ? void 0 : _config$populators2.optionsKey) || "name";
|
|
9383
|
+
const selected = formData === null || formData === void 0 ? void 0 : formData[config.key];
|
|
9384
|
+
const handleSelect = value => {
|
|
9385
|
+
onSelect(config.key, value);
|
|
9386
|
+
};
|
|
9387
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label)), /*#__PURE__*/React__default.createElement("div", {
|
|
9388
|
+
className: "field"
|
|
9389
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9390
|
+
selected: selected,
|
|
9391
|
+
option: options,
|
|
9392
|
+
select: handleSelect,
|
|
9393
|
+
optionKey: optionsKey,
|
|
9394
|
+
t: t
|
|
9395
|
+
})));
|
|
9396
|
+
};
|
|
9397
|
+
|
|
9398
|
+
const AdditionalDetails = _ref => {
|
|
9399
|
+
var _formData$ownerKey, _formData$ownerKey2, _formData$ownerKey3, _formData$ownerKey4;
|
|
9400
|
+
let t = _ref.t,
|
|
9401
|
+
config = _ref.config,
|
|
9402
|
+
onSelect = _ref.onSelect,
|
|
9403
|
+
userType = _ref.userType,
|
|
9404
|
+
formData = _ref.formData;
|
|
9405
|
+
let index = 0;
|
|
9406
|
+
const user = Digit.UserService.getUser().info;
|
|
9407
|
+
const applicantName = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].applicantName || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey = formData.ownerKey) === null || _formData$ownerKey === void 0 ? void 0 : _formData$ownerKey.applicantName) || "";
|
|
9408
|
+
const emailId = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].emailId || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey2 = formData.ownerKey) === null || _formData$ownerKey2 === void 0 ? void 0 : _formData$ownerKey2.emailId) || "";
|
|
9409
|
+
const mobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].mobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey3 = formData.ownerKey) === null || _formData$ownerKey3 === void 0 ? void 0 : _formData$ownerKey3.mobileNumber) || (user === null || user === void 0 ? void 0 : user.mobileNumber);
|
|
9410
|
+
const altMobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].altMobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey4 = formData.ownerKey) === null || _formData$ownerKey4 === void 0 ? void 0 : _formData$ownerKey4.altmobileNumber) || "";
|
|
9411
|
+
const _useState = React.useState(""),
|
|
9412
|
+
VendorCategory = _useState[0],
|
|
9413
|
+
setVendorCategory = _useState[1];
|
|
9414
|
+
const _useState2 = React.useState(""),
|
|
9415
|
+
VendorId = _useState2[0],
|
|
9416
|
+
setVendorId = _useState2[1];
|
|
9417
|
+
const _useState3 = React.useState(""),
|
|
9418
|
+
userName = _useState3[0],
|
|
9419
|
+
setUserName = _useState3[1];
|
|
9420
|
+
const _useState4 = React.useState(""),
|
|
9421
|
+
Bank = _useState4[0],
|
|
9422
|
+
setBank = _useState4[1];
|
|
9423
|
+
const _useState5 = React.useState(),
|
|
9424
|
+
BankbranchName = _useState5[0],
|
|
9425
|
+
setBankbranchName = _useState5[1];
|
|
9426
|
+
const _useState6 = React.useState(""),
|
|
9427
|
+
IFSC = _useState6[0],
|
|
9428
|
+
setIFSC = _useState6[1];
|
|
9429
|
+
const _useState7 = React.useState(""),
|
|
9430
|
+
AccountNo = _useState7[0],
|
|
9431
|
+
setAccountNo = _useState7[1];
|
|
9432
|
+
const _useState8 = React.useState(""),
|
|
9433
|
+
PanNo = _useState8[0],
|
|
9434
|
+
setPanNo = _useState8[1];
|
|
9435
|
+
const _useState9 = React.useState(""),
|
|
9436
|
+
GstNo = _useState9[0],
|
|
9437
|
+
setGstNo = _useState9[1];
|
|
9438
|
+
const _useState0 = React.useState(""),
|
|
9439
|
+
GstState = _useState0[0],
|
|
9440
|
+
setGstState = _useState0[1];
|
|
9441
|
+
const _useState1 = React.useState(""),
|
|
9442
|
+
RegistrationNo = _useState1[0],
|
|
9443
|
+
setRegistrationNo = _useState1[1];
|
|
9444
|
+
const _useState10 = React.useState(""),
|
|
9445
|
+
EpfNo = _useState10[0],
|
|
9446
|
+
setEpfNo = _useState10[1];
|
|
9447
|
+
const _useState11 = React.useState(""),
|
|
9448
|
+
EsiNo = _useState11[0],
|
|
9449
|
+
setEsiNo = _useState11[1];
|
|
9450
|
+
const _useState12 = React.useState(""),
|
|
9451
|
+
VendorType = _useState12[0],
|
|
9452
|
+
setVendorType = _useState12[1];
|
|
9453
|
+
const _useState13 = React.useState(""),
|
|
9454
|
+
Status = _useState13[0],
|
|
9455
|
+
setStatus = _useState13[1];
|
|
9456
|
+
const _useState14 = React.useState(""),
|
|
9457
|
+
micrNo = _useState14[0],
|
|
9458
|
+
setmicrNo = _useState14[1];
|
|
9459
|
+
const _useState15 = React.useState(""),
|
|
9460
|
+
PhoneNo = _useState15[0],
|
|
9461
|
+
setPhoneNo = _useState15[1];
|
|
9462
|
+
const _useState16 = React.useState(""),
|
|
9463
|
+
ContactPerson = _useState16[0],
|
|
9464
|
+
setContactPerson = _useState16[1];
|
|
9465
|
+
React.useEffect(() => {
|
|
9466
|
+
if (IFSC.length === 11 && !Bank && !BankbranchName && !micrNo) {
|
|
9467
|
+
fetch("https://ifsc.razorpay.com/" + IFSC).then(response => response.json()).then(data => {
|
|
9468
|
+
if (data && data.BANK && data.BRANCH && data.MICR) {
|
|
9469
|
+
setBank(data.BANK);
|
|
9470
|
+
setBankbranchName(data.BRANCH);
|
|
9471
|
+
setmicrNo(data.MICR);
|
|
9472
|
+
}
|
|
9473
|
+
}).catch(() => {});
|
|
9474
|
+
} else {
|
|
9475
|
+
if (IFSC.length === 11 && Bank && BankbranchName) {
|
|
9476
|
+
setBank(Bank);
|
|
9477
|
+
setBankbranchName(BankbranchName);
|
|
9478
|
+
setmicrNo(micrNo);
|
|
9479
|
+
} else {
|
|
9480
|
+
setBank("");
|
|
9481
|
+
setBankbranchName("");
|
|
9482
|
+
setmicrNo("");
|
|
9081
9483
|
}
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9484
|
+
}
|
|
9485
|
+
}, [IFSC]);
|
|
9486
|
+
function setvendorbank(e) {
|
|
9487
|
+
setBank(e.target.value);
|
|
9488
|
+
}
|
|
9489
|
+
function setBankbranch(e) {
|
|
9490
|
+
setBankbranchName(e.target.value);
|
|
9491
|
+
}
|
|
9492
|
+
function setvendorifsc(e) {
|
|
9493
|
+
const input = e.target.value.replace(/[^a-zA-Z0-9]/g, "");
|
|
9494
|
+
if (input.length <= 11) {
|
|
9495
|
+
setIFSC(input);
|
|
9496
|
+
}
|
|
9497
|
+
}
|
|
9498
|
+
function setvendoraccountno(e) {
|
|
9499
|
+
setAccountNo(e.target.value);
|
|
9500
|
+
}
|
|
9501
|
+
function setpanno(e) {
|
|
9502
|
+
setPanNo(e.target.value);
|
|
9503
|
+
}
|
|
9504
|
+
function setgstno(e) {
|
|
9505
|
+
setGstNo(e.target.value);
|
|
9506
|
+
}
|
|
9507
|
+
function setgststate(e) {
|
|
9508
|
+
setGstState(e.target.value);
|
|
9509
|
+
}
|
|
9510
|
+
function setregistrationno(e) {
|
|
9511
|
+
setRegistrationNo(e.target.value);
|
|
9512
|
+
}
|
|
9513
|
+
function setepfno(e) {
|
|
9514
|
+
setEpfNo(e.target.value);
|
|
9515
|
+
}
|
|
9516
|
+
function setesino(e) {
|
|
9517
|
+
setEsiNo(e.target.value);
|
|
9518
|
+
}
|
|
9519
|
+
function setcontactperson(e) {
|
|
9520
|
+
setContactPerson(e.target.value);
|
|
9521
|
+
}
|
|
9522
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
9523
|
+
const _useForm = reactHookForm.useForm(),
|
|
9524
|
+
control = _useForm.control;
|
|
9525
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
9526
|
+
staleTime: Infinity
|
|
9527
|
+
}),
|
|
9528
|
+
dsoData = _Digit$Hooks$fsm$useD.data;
|
|
9529
|
+
React.useEffect(() => {
|
|
9530
|
+
if (dsoData) {
|
|
9531
|
+
const vendor = dsoData.find(item => item.id);
|
|
9532
|
+
if (vendor) {
|
|
9533
|
+
setUserName(vendor.name);
|
|
9534
|
+
setVendorId(vendor.id);
|
|
9108
9535
|
}
|
|
9109
|
-
});
|
|
9110
|
-
setShowModal(false);
|
|
9111
|
-
};
|
|
9112
|
-
const handleModalAction = () => {
|
|
9113
|
-
switch (selectedAction) {
|
|
9114
|
-
case "DELETE":
|
|
9115
|
-
return handleDelete();
|
|
9116
|
-
case "DELETE_VENDOR":
|
|
9117
|
-
return handleDeleteVendor();
|
|
9118
|
-
case "ADD_VENDOR":
|
|
9119
|
-
return handleAddVendor();
|
|
9120
|
-
case "EDIT_VENDOR":
|
|
9121
|
-
return handleEditVendor();
|
|
9122
9536
|
}
|
|
9123
|
-
};
|
|
9124
|
-
const
|
|
9125
|
-
|
|
9126
|
-
let
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
if (selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR") {
|
|
9156
|
-
return /*#__PURE__*/React__default.createElement(ConfirmationBox, {
|
|
9157
|
-
t: t,
|
|
9158
|
-
title: "ES_FSM_REGISTRY_DELETE_TEXT"
|
|
9537
|
+
}, [dsoData]);
|
|
9538
|
+
const goNext = () => {
|
|
9539
|
+
let owner = formData.ownerKey && formData.ownerKey[index];
|
|
9540
|
+
let ownerStep;
|
|
9541
|
+
if (userType === "citizen") {
|
|
9542
|
+
ownerStep = _extends({}, owner, {
|
|
9543
|
+
applicantName,
|
|
9544
|
+
mobileNumber,
|
|
9545
|
+
altMobileNumber,
|
|
9546
|
+
emailId
|
|
9547
|
+
});
|
|
9548
|
+
onSelect(config.key, _extends({}, formData[config.key], ownerStep), false, index);
|
|
9549
|
+
} else {
|
|
9550
|
+
ownerStep = _extends({}, owner, {
|
|
9551
|
+
VendorCategory,
|
|
9552
|
+
name: userName,
|
|
9553
|
+
VendorId: VendorId,
|
|
9554
|
+
Bank,
|
|
9555
|
+
BankbranchName,
|
|
9556
|
+
IFSC,
|
|
9557
|
+
AccountNo,
|
|
9558
|
+
PanNo,
|
|
9559
|
+
GstNo,
|
|
9560
|
+
GstState,
|
|
9561
|
+
RegistrationNo,
|
|
9562
|
+
EpfNo,
|
|
9563
|
+
EsiNo,
|
|
9564
|
+
VendorType,
|
|
9565
|
+
Status,
|
|
9566
|
+
micrNo,
|
|
9567
|
+
PhoneNo,
|
|
9568
|
+
ContactPerson
|
|
9159
9569
|
});
|
|
9570
|
+
onSelect(config.key, ownerStep, false, index);
|
|
9160
9571
|
}
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
value: selectedOption,
|
|
9166
|
-
selected: selectedOption,
|
|
9167
|
-
select: setSelectedOption,
|
|
9168
|
-
optionKey: "name"
|
|
9169
|
-
}));
|
|
9572
|
+
};
|
|
9573
|
+
React.useEffect(() => {
|
|
9574
|
+
if (userType === "citizen") {
|
|
9575
|
+
goNext();
|
|
9170
9576
|
}
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9577
|
+
}, [VendorCategory, VendorId, userName, Bank, BankbranchName, IFSC, AccountNo, PanNo, GstNo, GstState, RegistrationNo, EpfNo, EsiNo, VendorType, Status, micrNo, PhoneNo, ContactPerson, userType]);
|
|
9578
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
|
|
9579
|
+
config: [{
|
|
9580
|
+
timeLine: [{
|
|
9581
|
+
actions: t("VENDOR_ADDITIONAL_DETAILS"),
|
|
9582
|
+
currentStep: 1
|
|
9583
|
+
}]
|
|
9584
|
+
}, {
|
|
9585
|
+
timeLine: [{
|
|
9586
|
+
actions: t("VENDOR_DOCUMENT_DETAILS"),
|
|
9587
|
+
currentStep: 2
|
|
9588
|
+
}]
|
|
9589
|
+
}, {
|
|
9590
|
+
timeLine: [{
|
|
9591
|
+
actions: t("VENDOR_SUMMARY"),
|
|
9592
|
+
currentStep: 3
|
|
9593
|
+
}]
|
|
9594
|
+
}],
|
|
9595
|
+
currentActiveIndex: 0,
|
|
9596
|
+
showFinalStep: false
|
|
9597
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9598
|
+
style: {
|
|
9599
|
+
flex: "1",
|
|
9600
|
+
overflowY: "auto"
|
|
9601
|
+
}
|
|
9602
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormStep, {
|
|
9603
|
+
config: config,
|
|
9604
|
+
onSelect: goNext,
|
|
9605
|
+
t: t,
|
|
9606
|
+
className: "formcomposer-grid-container-form"
|
|
9607
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
|
|
9608
|
+
className: "card-label-smaller"
|
|
9609
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CustomTooltip, {
|
|
9610
|
+
label: "" + t("IFSC_CODE"),
|
|
9611
|
+
isMandatory: false,
|
|
9612
|
+
message: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
|
|
9613
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9614
|
+
t: t,
|
|
9615
|
+
type: "text",
|
|
9616
|
+
isMandatory: false,
|
|
9617
|
+
optionKey: "i18nKey",
|
|
9618
|
+
name: "IFSC",
|
|
9619
|
+
value: IFSC,
|
|
9620
|
+
placeholder: "Enter IFSC Code",
|
|
9621
|
+
onChange: setvendorifsc,
|
|
9622
|
+
style: {
|
|
9623
|
+
width: "100%"
|
|
9624
|
+
},
|
|
9625
|
+
maxLength: 11,
|
|
9626
|
+
ValidationRequired: true,
|
|
9627
|
+
validation: {
|
|
9628
|
+
isRequired: true,
|
|
9629
|
+
pattern: "^[A-Z]{4}0[A-Z0-9]{6}$",
|
|
9630
|
+
type: "text",
|
|
9631
|
+
title: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
|
|
9632
|
+
}
|
|
9633
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_BANK_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
9634
|
+
className: "check-page-link-button"
|
|
9635
|
+
}, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9636
|
+
t: t,
|
|
9637
|
+
type: "text",
|
|
9638
|
+
isMandatory: false,
|
|
9639
|
+
optionKey: "i18nKey",
|
|
9640
|
+
name: "bankName",
|
|
9641
|
+
placeholder: "Bank Name Auto Select",
|
|
9642
|
+
style: {
|
|
9643
|
+
width: "100%"
|
|
9644
|
+
},
|
|
9645
|
+
value: Bank,
|
|
9646
|
+
onChange: setvendorbank,
|
|
9647
|
+
disabled: true
|
|
9648
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_BANK_BRANCH_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
9649
|
+
className: "check-page-link-button"
|
|
9650
|
+
}, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9651
|
+
t: t,
|
|
9652
|
+
type: "text",
|
|
9653
|
+
isMandatory: false,
|
|
9654
|
+
optionKey: "i18nKey",
|
|
9655
|
+
name: "BankbranchName",
|
|
9656
|
+
value: BankbranchName,
|
|
9657
|
+
style: {
|
|
9658
|
+
width: "100%"
|
|
9659
|
+
},
|
|
9660
|
+
placeholder: "Bank Branch Name Auto Select",
|
|
9661
|
+
onChange: setBankbranch,
|
|
9662
|
+
disabled: false
|
|
9663
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_MICR_NO"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
9664
|
+
className: "check-page-link-button"
|
|
9665
|
+
}, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9666
|
+
t: t,
|
|
9667
|
+
type: "text",
|
|
9668
|
+
isMandatory: false,
|
|
9669
|
+
optionKey: "i18nKey",
|
|
9670
|
+
name: "MicrNo",
|
|
9671
|
+
value: micrNo,
|
|
9672
|
+
style: {
|
|
9673
|
+
width: "100%"
|
|
9674
|
+
},
|
|
9675
|
+
placeholder: "MICR No",
|
|
9676
|
+
onChange: setmicrNo,
|
|
9677
|
+
disabled: false
|
|
9678
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("ACCOUNT_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9679
|
+
t: t,
|
|
9680
|
+
type: "text",
|
|
9681
|
+
isMandatory: false,
|
|
9682
|
+
optionKey: "i18nKey",
|
|
9683
|
+
name: "AccountNo",
|
|
9684
|
+
value: AccountNo,
|
|
9685
|
+
onChange: setvendoraccountno,
|
|
9686
|
+
style: {
|
|
9687
|
+
width: "100%"
|
|
9688
|
+
},
|
|
9689
|
+
ValidationRequired: true,
|
|
9690
|
+
validation: {
|
|
9691
|
+
isRequired: true,
|
|
9692
|
+
pattern: "[0-9]{9,18}",
|
|
9693
|
+
type: "text",
|
|
9694
|
+
title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
|
|
9695
|
+
}
|
|
9696
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("PHONE_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.MobileNumber, {
|
|
9697
|
+
value: PhoneNo,
|
|
9698
|
+
name: "PhoneNo",
|
|
9699
|
+
onChange: setPhoneNo,
|
|
9700
|
+
style: {
|
|
9701
|
+
width: "100%"
|
|
9702
|
+
}
|
|
9703
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("CONTACT_PERSON")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9704
|
+
t: t,
|
|
9705
|
+
type: "text",
|
|
9706
|
+
isMandatory: false,
|
|
9707
|
+
optionKey: "i18nKey",
|
|
9708
|
+
name: "ContactPerson",
|
|
9709
|
+
value: ContactPerson,
|
|
9710
|
+
onChange: setcontactperson,
|
|
9711
|
+
style: {
|
|
9712
|
+
width: "100%"
|
|
9713
|
+
},
|
|
9714
|
+
ValidationRequired: true,
|
|
9715
|
+
validation: {
|
|
9716
|
+
isRequired: true,
|
|
9717
|
+
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
9718
|
+
type: "text",
|
|
9719
|
+
title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
|
|
9180
9720
|
}
|
|
9181
|
-
}
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9721
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("PAN_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9722
|
+
t: t,
|
|
9723
|
+
type: "text",
|
|
9724
|
+
isMandatory: false,
|
|
9725
|
+
optionKey: "i18nKey",
|
|
9726
|
+
name: "PanNo",
|
|
9727
|
+
value: PanNo,
|
|
9728
|
+
onChange: setpanno,
|
|
9729
|
+
style: {
|
|
9730
|
+
width: "100%"
|
|
9731
|
+
},
|
|
9732
|
+
ValidationRequired: true,
|
|
9733
|
+
validation: {
|
|
9734
|
+
isRequired: true,
|
|
9735
|
+
pattern: "[A-Z]{5}[0-9]{4}[A-Z]{1}",
|
|
9736
|
+
type: "text",
|
|
9737
|
+
title: t("INVALID_PAN_NO_ERROR_MESSAGE")
|
|
9191
9738
|
}
|
|
9192
|
-
}
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9739
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9740
|
+
t: t,
|
|
9741
|
+
type: "text",
|
|
9742
|
+
isMandatory: false,
|
|
9743
|
+
optionKey: "i18nKey",
|
|
9744
|
+
name: "GstNo",
|
|
9745
|
+
value: GstNo,
|
|
9746
|
+
onChange: setgstno,
|
|
9200
9747
|
style: {
|
|
9201
|
-
|
|
9748
|
+
width: "100%"
|
|
9749
|
+
},
|
|
9750
|
+
ValidationRequired: true,
|
|
9751
|
+
validation: {
|
|
9752
|
+
isRequired: true,
|
|
9753
|
+
pattern: "^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$",
|
|
9754
|
+
type: "text",
|
|
9755
|
+
title: t("INVALID_GST_NO_ERROR_MESSAGE")
|
|
9202
9756
|
}
|
|
9203
|
-
},
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
}
|
|
9212
|
-
}, t(detail.title)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
9213
|
-
className: "card-with-background",
|
|
9214
|
-
style: {
|
|
9215
|
-
margin: "10px 16px",
|
|
9216
|
-
padding: "20px"
|
|
9217
|
-
}
|
|
9218
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9219
|
-
className: "additional-grid"
|
|
9220
|
-
}, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
|
|
9221
|
-
return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
9222
|
-
key: index
|
|
9223
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9224
|
-
className: "additional-label"
|
|
9225
|
-
}, t(value.title)), /*#__PURE__*/React__default.createElement("div", {
|
|
9226
|
-
className: "additional-value",
|
|
9227
|
-
style: {
|
|
9228
|
-
display: "flex",
|
|
9229
|
-
alignItems: "center",
|
|
9230
|
-
gap: "8px"
|
|
9231
|
-
}
|
|
9232
|
-
}, value.value === "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React__default.createElement("div", {
|
|
9233
|
-
onClick: () => onActionSelect("ADD_VENDOR"),
|
|
9234
|
-
style: {
|
|
9235
|
-
color: "#a82227",
|
|
9236
|
-
display: "flex",
|
|
9237
|
-
alignItems: "center",
|
|
9238
|
-
gap: "8px",
|
|
9239
|
-
cursor: "pointer"
|
|
9240
|
-
}
|
|
9241
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.AddIcon, {
|
|
9242
|
-
className: "",
|
|
9243
|
-
fill: "#a82227"
|
|
9244
|
-
}), " ", t(value.value) || "N/A"), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", null, value.value), /*#__PURE__*/React__default.createElement("div", {
|
|
9245
|
-
className: "add-details-link hover-button",
|
|
9246
|
-
onClick: () => onActionSelect("EDIT_VENDOR"),
|
|
9247
|
-
style: {
|
|
9248
|
-
cursor: "pointer"
|
|
9249
|
-
}
|
|
9250
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.EditIcon, {
|
|
9251
|
-
fill: "#a82227"
|
|
9252
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9253
|
-
className: "add-details-link hover-button",
|
|
9254
|
-
onClick: () => onActionSelect("DELETE_VENDOR"),
|
|
9255
|
-
style: {
|
|
9256
|
-
cursor: "pointer"
|
|
9257
|
-
}
|
|
9258
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.DeleteIcon, {
|
|
9259
|
-
className: "delete",
|
|
9260
|
-
fill: "#a82227"
|
|
9261
|
-
}))))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
9262
|
-
key: index
|
|
9263
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9264
|
-
className: "additional-label"
|
|
9265
|
-
}, t(value.title)), /*#__PURE__*/React__default.createElement("div", {
|
|
9266
|
-
className: "additional-value",
|
|
9267
|
-
style: value.value === "ACTIVE" ? {
|
|
9268
|
-
color: "green"
|
|
9269
|
-
} : {}
|
|
9270
|
-
}, t(value.value) || "N/A"));
|
|
9271
|
-
}))));
|
|
9272
|
-
})), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
9273
|
-
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$4, {
|
|
9274
|
-
label: t(modalHeading())
|
|
9275
|
-
}),
|
|
9276
|
-
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$3, {
|
|
9277
|
-
onClick: closeModal
|
|
9278
|
-
}),
|
|
9279
|
-
actionCancelLabel: t("CS_COMMON_CANCEL"),
|
|
9280
|
-
actionCancelOnSubmit: closeModal,
|
|
9281
|
-
actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
|
|
9282
|
-
actionSaveOnSubmit: handleModalAction
|
|
9283
|
-
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
9757
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_REGISTERED_STATE/UT")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9758
|
+
t: t,
|
|
9759
|
+
type: "text",
|
|
9760
|
+
isMandatory: false,
|
|
9761
|
+
optionKey: "i18nKey",
|
|
9762
|
+
name: "GstState",
|
|
9763
|
+
value: GstState,
|
|
9764
|
+
onChange: setgststate,
|
|
9284
9765
|
style: {
|
|
9285
|
-
|
|
9766
|
+
width: "100%"
|
|
9767
|
+
},
|
|
9768
|
+
ValidationRequired: true,
|
|
9769
|
+
validation: {
|
|
9770
|
+
isRequired: true,
|
|
9771
|
+
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
9772
|
+
type: "text",
|
|
9773
|
+
title: t("PT_NAME_ERROR_MESSAGE")
|
|
9286
9774
|
}
|
|
9287
|
-
},
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9775
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("REGISTRATION_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9776
|
+
t: t,
|
|
9777
|
+
type: "text",
|
|
9778
|
+
isMandatory: false,
|
|
9779
|
+
optionKey: "i18nKey",
|
|
9780
|
+
name: "RegistrationNo",
|
|
9781
|
+
value: RegistrationNo,
|
|
9782
|
+
onChange: setregistrationno,
|
|
9292
9783
|
style: {
|
|
9293
|
-
|
|
9784
|
+
width: "100%"
|
|
9785
|
+
},
|
|
9786
|
+
ValidationRequired: true,
|
|
9787
|
+
validation: {
|
|
9788
|
+
isRequired: true,
|
|
9789
|
+
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
9790
|
+
type: "text",
|
|
9791
|
+
title: t("INVALID_REGISTRATION_NO_ERROR_MESSAGE")
|
|
9294
9792
|
}
|
|
9295
|
-
},
|
|
9296
|
-
localeKeyPrefix: "ES_FSM_REGISTRY_ACTION",
|
|
9297
|
-
options: ["EDIT", "DELETE"],
|
|
9793
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("EPF_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9298
9794
|
t: t,
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
9315
|
-
const _useState = React.useState([]),
|
|
9316
|
-
zones = _useState[0],
|
|
9317
|
-
setZones = _useState[1];
|
|
9318
|
-
const _useState2 = React.useState([]),
|
|
9319
|
-
selectedZones = _useState2[0],
|
|
9320
|
-
setSelectedZones = _useState2[1];
|
|
9321
|
-
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9322
|
-
boundaryData = _Digit$Hooks$useCommo.data,
|
|
9323
|
-
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
9324
|
-
React.useEffect(() => {
|
|
9325
|
-
if (!zones.length) return;
|
|
9326
|
-
if (isMultiSelect) {
|
|
9327
|
-
setSelectedZones(Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? zones.filter(ele => formData.zoneIds.includes(ele.code)) : []);
|
|
9328
|
-
} else {
|
|
9329
|
-
const selected = zones.find(ele => {
|
|
9330
|
-
return ele.code === (formData === null || formData === void 0 ? void 0 : formData.zoneIds);
|
|
9331
|
-
});
|
|
9332
|
-
setSelectedZones(selected ? [selected] : []);
|
|
9795
|
+
type: "text",
|
|
9796
|
+
isMandatory: false,
|
|
9797
|
+
optionKey: "i18nKey",
|
|
9798
|
+
name: "EpfNo",
|
|
9799
|
+
value: EpfNo,
|
|
9800
|
+
onChange: setepfno,
|
|
9801
|
+
style: {
|
|
9802
|
+
width: "100%"
|
|
9803
|
+
},
|
|
9804
|
+
ValidationRequired: true,
|
|
9805
|
+
validation: {
|
|
9806
|
+
isRequired: true,
|
|
9807
|
+
pattern: "^[a-zA-Z0-9/-]{1,15}$",
|
|
9808
|
+
type: "text",
|
|
9809
|
+
title: t("INVALID_EPF_NO_ERROR_MESSAGE")
|
|
9333
9810
|
}
|
|
9334
|
-
},
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9811
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("ESI_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
9812
|
+
t: t,
|
|
9813
|
+
type: "text",
|
|
9814
|
+
isMandatory: false,
|
|
9815
|
+
optionKey: "i18nKey",
|
|
9816
|
+
name: "EsiNo",
|
|
9817
|
+
value: EsiNo,
|
|
9818
|
+
onChange: setesino,
|
|
9819
|
+
style: {
|
|
9820
|
+
width: "100%"
|
|
9821
|
+
},
|
|
9822
|
+
ValidationRequired: true,
|
|
9823
|
+
validation: {
|
|
9824
|
+
isRequired: true,
|
|
9825
|
+
pattern: "^[a-zA-Z0-9/-]{1,20}$",
|
|
9826
|
+
type: "text",
|
|
9827
|
+
title: t("INVALID_ESI_NO_ERROR_MESSAGE")
|
|
9346
9828
|
}
|
|
9347
|
-
},
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.code) || "");
|
|
9829
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENDOR_TYPE"), /*#__PURE__*/React__default.createElement("div", {
|
|
9830
|
+
className: "tooltip",
|
|
9831
|
+
style: {
|
|
9832
|
+
width: "12px",
|
|
9833
|
+
height: "5px",
|
|
9834
|
+
marginLeft: "10px",
|
|
9835
|
+
display: "inline-flex",
|
|
9836
|
+
alignItems: "center"
|
|
9356
9837
|
}
|
|
9357
|
-
}
|
|
9358
|
-
|
|
9359
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React__default.createElement("div", {
|
|
9360
|
-
className: "field",
|
|
9838
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9839
|
+
className: "tooltiptext",
|
|
9361
9840
|
style: {
|
|
9362
|
-
|
|
9363
|
-
|
|
9841
|
+
whiteSpace: "pre-wrap",
|
|
9842
|
+
fontSize: "small",
|
|
9843
|
+
wordWrap: "break-word",
|
|
9844
|
+
width: "300px",
|
|
9845
|
+
marginLeft: "15px",
|
|
9846
|
+
marginBottom: "-10px"
|
|
9364
9847
|
}
|
|
9365
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
multiple: isMultiSelect,
|
|
9372
|
-
ServerStyle: {
|
|
9373
|
-
backgroundColor: "#fff"
|
|
9848
|
+
}, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
9849
|
+
control: control,
|
|
9850
|
+
name: "VendorType",
|
|
9851
|
+
defaultValue: VendorType,
|
|
9852
|
+
rules: {
|
|
9853
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
9374
9854
|
},
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
}
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
setSelectedClusters = _useState2[1];
|
|
9398
|
-
const selectedZones = React__default.useMemo(() => Array.isArray(formData === null || formData === void 0 ? void 0 : formData.zoneIds) ? formData.zoneIds : [], [formData === null || formData === void 0 ? void 0 : formData.zoneIds]);
|
|
9399
|
-
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9400
|
-
boundaryData = _Digit$Hooks$useCommo.data;
|
|
9401
|
-
React.useEffect(() => {
|
|
9402
|
-
var _boundaryData$egovLo, _boundaryData$egovLo$, _boundaryData$MdmsRes, _boundaryData$MdmsRes2, _boundaryData$MdmsRes3;
|
|
9403
|
-
const tenantBoundary = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : (_boundaryData$egovLo$ = _boundaryData$egovLo.TenantBoundary) === null || _boundaryData$egovLo$ === void 0 ? void 0 : _boundaryData$egovLo$[0]) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : (_boundaryData$MdmsRes3 = _boundaryData$MdmsRes2.TenantBoundary) === null || _boundaryData$MdmsRes3 === void 0 ? void 0 : _boundaryData$MdmsRes3[0]);
|
|
9404
|
-
const boundaries = (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.boundary) || (tenantBoundary === null || tenantBoundary === void 0 ? void 0 : tenantBoundary.children) || [];
|
|
9405
|
-
let allClusters = [];
|
|
9406
|
-
if (selectedZones.length > 0 && Array.isArray(boundaries) && boundaries.length > 0) {
|
|
9407
|
-
selectedZones.forEach(zone => {
|
|
9408
|
-
const zoneBoundary = boundaries.find(b => b.code === zone.code);
|
|
9409
|
-
const children = (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.children) || (zoneBoundary === null || zoneBoundary === void 0 ? void 0 : zoneBoundary.boundary) || [];
|
|
9410
|
-
if (Array.isArray(children)) {
|
|
9411
|
-
children.forEach(child => {
|
|
9412
|
-
allClusters.push({
|
|
9413
|
-
code: child.code,
|
|
9414
|
-
name: child.name
|
|
9415
|
-
});
|
|
9416
|
-
});
|
|
9417
|
-
}
|
|
9418
|
-
});
|
|
9855
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9856
|
+
selected: VendorType,
|
|
9857
|
+
select: setVendorType,
|
|
9858
|
+
option: [{
|
|
9859
|
+
i18nKey: "Supplier",
|
|
9860
|
+
code: "SUPPLIER"
|
|
9861
|
+
}, {
|
|
9862
|
+
i18nKey: "Contractor",
|
|
9863
|
+
code: "CONTRACTOR"
|
|
9864
|
+
}],
|
|
9865
|
+
optionKey: "i18nKey",
|
|
9866
|
+
placeholder: "Select",
|
|
9867
|
+
t: t
|
|
9868
|
+
})
|
|
9869
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENOR_CATEGORY"), /*#__PURE__*/React__default.createElement("div", {
|
|
9870
|
+
className: "tooltip",
|
|
9871
|
+
style: {
|
|
9872
|
+
width: "12px",
|
|
9873
|
+
height: "5px",
|
|
9874
|
+
marginLeft: "10px",
|
|
9875
|
+
display: "inline-flex",
|
|
9876
|
+
alignItems: "center"
|
|
9419
9877
|
}
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
}],
|
|
9430
|
-
"ZONE-03": [{
|
|
9431
|
-
code: "CLUSTER-03",
|
|
9432
|
-
name: "CLUSTER-03"
|
|
9433
|
-
}],
|
|
9434
|
-
"ZONE-04": [{
|
|
9435
|
-
code: "CLUSTER-04",
|
|
9436
|
-
name: "CLUSTER-04"
|
|
9437
|
-
}],
|
|
9438
|
-
"ZONE-05": [{
|
|
9439
|
-
code: "CLUSTER-05",
|
|
9440
|
-
name: "CLUSTER-05"
|
|
9441
|
-
}]
|
|
9442
|
-
};
|
|
9443
|
-
if (selectedZones.length > 0) {
|
|
9444
|
-
selectedZones.forEach(z => {
|
|
9445
|
-
if (staticClusters[z.code]) {
|
|
9446
|
-
allClusters = [...allClusters, ...staticClusters[z.code]];
|
|
9447
|
-
} else {
|
|
9448
|
-
allClusters.push({
|
|
9449
|
-
code: z.code + "-C1",
|
|
9450
|
-
name: z.name + " Cluster 1"
|
|
9451
|
-
});
|
|
9452
|
-
}
|
|
9453
|
-
});
|
|
9454
|
-
} else {
|
|
9455
|
-
allClusters = [{
|
|
9456
|
-
code: "CLUSTER-01",
|
|
9457
|
-
name: "CLUSTER-01"
|
|
9458
|
-
}, {
|
|
9459
|
-
code: "CLUSTER-02",
|
|
9460
|
-
name: "CLUSTER-02"
|
|
9461
|
-
}, {
|
|
9462
|
-
code: "CLUSTER-03",
|
|
9463
|
-
name: "CLUSTER-03"
|
|
9464
|
-
}];
|
|
9465
|
-
}
|
|
9878
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9879
|
+
className: "tooltiptext",
|
|
9880
|
+
style: {
|
|
9881
|
+
whiteSpace: "pre-wrap",
|
|
9882
|
+
fontSize: "small",
|
|
9883
|
+
wordWrap: "break-word",
|
|
9884
|
+
width: "300px",
|
|
9885
|
+
marginLeft: "15px",
|
|
9886
|
+
marginBottom: "-10px"
|
|
9466
9887
|
}
|
|
9467
|
-
|
|
9468
|
-
|
|
9888
|
+
}))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
9889
|
+
control: control,
|
|
9890
|
+
name: "VendorCategory",
|
|
9891
|
+
defaultValue: VendorCategory,
|
|
9892
|
+
rules: {
|
|
9893
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
9894
|
+
},
|
|
9895
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9896
|
+
selected: VendorCategory,
|
|
9897
|
+
select: setVendorCategory,
|
|
9898
|
+
option: [{
|
|
9899
|
+
i18nKey: "Firm",
|
|
9900
|
+
code: "FIRM"
|
|
9901
|
+
}, {
|
|
9902
|
+
i18nKey: "Individual",
|
|
9903
|
+
code: "Individual"
|
|
9904
|
+
}],
|
|
9905
|
+
optionKey: "i18nKey",
|
|
9906
|
+
placeholder: "Select",
|
|
9907
|
+
t: t
|
|
9908
|
+
})
|
|
9909
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("STATUS"), /*#__PURE__*/React__default.createElement("div", {
|
|
9910
|
+
className: "tooltip",
|
|
9911
|
+
style: {
|
|
9912
|
+
width: "12px",
|
|
9913
|
+
height: "5px",
|
|
9914
|
+
marginLeft: "10px",
|
|
9915
|
+
display: "inline-flex",
|
|
9916
|
+
alignItems: "center"
|
|
9469
9917
|
}
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
const handleSelect = value => {
|
|
9473
|
-
const extractedValue = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : value;
|
|
9474
|
-
setSelectedClusters(extractedValue);
|
|
9475
|
-
onSelect(config.key, extractedValue);
|
|
9476
|
-
};
|
|
9477
|
-
const isDisabled = selectedZones.length === 0;
|
|
9478
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label) + (config.isMandatory ? " *" : "")), /*#__PURE__*/React__default.createElement("div", {
|
|
9479
|
-
className: "field",
|
|
9918
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
9919
|
+
className: "tooltiptext",
|
|
9480
9920
|
style: {
|
|
9481
|
-
|
|
9482
|
-
|
|
9921
|
+
whiteSpace: "pre-wrap",
|
|
9922
|
+
fontSize: "small",
|
|
9923
|
+
wordWrap: "break-word",
|
|
9924
|
+
width: "300px",
|
|
9925
|
+
marginLeft: "15px",
|
|
9926
|
+
marginBottom: "-10px"
|
|
9483
9927
|
}
|
|
9484
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
ServerStyle: {
|
|
9491
|
-
backgroundColor: "#fff"
|
|
9928
|
+
}, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
9929
|
+
control: control,
|
|
9930
|
+
name: "Status",
|
|
9931
|
+
defaultValue: Status,
|
|
9932
|
+
rules: {
|
|
9933
|
+
required: t("CORE_COMMON_REQUIRED_ERRMSG")
|
|
9492
9934
|
},
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
};
|
|
9509
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label)), /*#__PURE__*/React__default.createElement("div", {
|
|
9510
|
-
className: "field"
|
|
9511
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9512
|
-
selected: selected,
|
|
9513
|
-
option: options,
|
|
9514
|
-
select: handleSelect,
|
|
9515
|
-
optionKey: optionsKey,
|
|
9516
|
-
t: t
|
|
9517
|
-
})));
|
|
9935
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
9936
|
+
selected: Status,
|
|
9937
|
+
select: setStatus,
|
|
9938
|
+
option: [{
|
|
9939
|
+
i18nKey: "Active",
|
|
9940
|
+
code: "ACTIVE"
|
|
9941
|
+
}, {
|
|
9942
|
+
i18nKey: "Inactive",
|
|
9943
|
+
code: "INACTIVE"
|
|
9944
|
+
}],
|
|
9945
|
+
optionKey: "i18nKey",
|
|
9946
|
+
placeholder: "Select",
|
|
9947
|
+
t: t
|
|
9948
|
+
})
|
|
9949
|
+
})))));
|
|
9518
9950
|
};
|
|
9519
9951
|
|
|
9520
9952
|
const componentsToRegister = {
|
|
9521
|
-
VendorDetails,
|
|
9522
9953
|
VendorDocuments,
|
|
9523
9954
|
ServiceDoc,
|
|
9524
9955
|
VendorSelectAddress,
|
|
@@ -9534,7 +9965,10 @@ const componentsToRegister = {
|
|
|
9534
9965
|
SupervisorAreaAssignment,
|
|
9535
9966
|
SelectEkycZones,
|
|
9536
9967
|
SelectEkycClusters,
|
|
9537
|
-
SelectEkycDropdown
|
|
9968
|
+
SelectEkycDropdown,
|
|
9969
|
+
VendorDetails,
|
|
9970
|
+
EditVendor,
|
|
9971
|
+
AdditionalDetails
|
|
9538
9972
|
};
|
|
9539
9973
|
const addComponentsToRegistry = () => {
|
|
9540
9974
|
Object.entries(componentsToRegister).forEach(_ref => {
|