@djb25/digit-ui-module-ekyc 1.0.53 → 1.0.55
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 +1105 -577
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1105 -577
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2085,57 +2085,174 @@ const VendorDetailsCard = () => {
|
|
|
2085
2085
|
const _useState3 = useState(false),
|
|
2086
2086
|
ekycDownloadLoading = _useState3[0],
|
|
2087
2087
|
setEkycDownloadLoading = _useState3[1];
|
|
2088
|
-
const handleDownloadEkycData = function () {
|
|
2088
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
2089
2089
|
try {
|
|
2090
2090
|
setEkycDownloadLoading(true);
|
|
2091
2091
|
return Promise.resolve(_finallyRethrows(function () {
|
|
2092
2092
|
return _catch(function () {
|
|
2093
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
2093
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
2094
2094
|
tenantId: tenantId,
|
|
2095
2095
|
offset: 0,
|
|
2096
2096
|
limit: 10000,
|
|
2097
2097
|
reportDownload: true
|
|
2098
|
-
}
|
|
2098
|
+
}, fromDate && {
|
|
2099
|
+
fromDate
|
|
2100
|
+
}, toDate && {
|
|
2101
|
+
toDate
|
|
2102
|
+
}))).then(function (response) {
|
|
2099
2103
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
2100
2104
|
if (!consumerList || consumerList.length === 0) {
|
|
2101
2105
|
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
2102
2106
|
return;
|
|
2103
2107
|
}
|
|
2104
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
2108
|
+
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
|
|
2105
2109
|
const headerMapping = {
|
|
2106
|
-
kno: t("KNO")
|
|
2107
|
-
firstName: t("FIRST_NAME")
|
|
2108
|
-
middleName: t("MIDDLE_NAME")
|
|
2109
|
-
lastName: t("LAST_NAME")
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2110
|
+
kno: t("KNO"),
|
|
2111
|
+
firstName: t("FIRST_NAME"),
|
|
2112
|
+
middleName: t("MIDDLE_NAME"),
|
|
2113
|
+
lastName: t("LAST_NAME"),
|
|
2114
|
+
status: t("STATUS"),
|
|
2115
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
2116
|
+
zoneName: t("ZONE"),
|
|
2117
|
+
zoneCode: t("ZONE_CODE"),
|
|
2118
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
2119
|
+
ward: t("WARD"),
|
|
2120
|
+
pincode: t("EKYC_PINCODE"),
|
|
2121
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
2122
|
+
locality: t("EKYC_LOCALITY"),
|
|
2123
|
+
subLocality: t("SUB_LOCALITY"),
|
|
2124
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
2125
|
+
streetName: t("STREET_NAME"),
|
|
2126
|
+
landmark: t("EKYC_LANDMARK"),
|
|
2127
|
+
city: t("CITY"),
|
|
2128
|
+
state: t("STATE"),
|
|
2129
|
+
addressType: t("ADDRESS_TYPE"),
|
|
2130
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
2131
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
2132
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
2133
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
2134
|
+
email: t("EMAIL"),
|
|
2135
|
+
landlineNo: t("LANDLINE_NO"),
|
|
2136
|
+
mrkey: t("MR_KEY"),
|
|
2137
|
+
mrcode: t("MR_CODE"),
|
|
2138
|
+
areacode: t("AREA_CODE"),
|
|
2139
|
+
source: t("SOURCE"),
|
|
2140
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
2141
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
2142
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
2143
|
+
Type: t("CONSUMER_TYPE"),
|
|
2144
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
2145
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
2146
|
+
approvedAt: t("APPROVED_AT"),
|
|
2147
|
+
gender: t("GENDER"),
|
|
2148
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
2149
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
2150
|
+
relationship: t("RELATIONSHIP"),
|
|
2151
|
+
informantName: t("INFORMANT_NAME"),
|
|
2152
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
2153
|
+
informantIs: t("INFORMANT_IS"),
|
|
2154
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
2155
|
+
relation: t("RELATION"),
|
|
2156
|
+
entityName: t("ENTITY_NAME"),
|
|
2157
|
+
designation: t("DESIGNATION"),
|
|
2158
|
+
department: t("DEPARTMENT"),
|
|
2159
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
2160
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
2161
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
2162
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
2163
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
2164
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
2165
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
2166
|
+
latitude: t("LATITUDE"),
|
|
2167
|
+
longitude: t("LONGITUDE"),
|
|
2168
|
+
gpsValid: t("GPS_VALID"),
|
|
2169
|
+
meterNumber: t("METER_NUMBER"),
|
|
2170
|
+
meterMake: t("METER_MAKE"),
|
|
2171
|
+
meterStatus: t("METER_STATUS"),
|
|
2172
|
+
meterCondition: t("METER_CONDITION"),
|
|
2173
|
+
meterLocation: t("METER_LOCATION"),
|
|
2174
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
2175
|
+
workingStatus: t("WORKING_STATUS"),
|
|
2176
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
2177
|
+
septicTank: t("SEPTIC_TANK"),
|
|
2178
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
2179
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
2180
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
2181
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
2182
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
2183
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
2184
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
2185
|
+
pidNumber: t("PID_NUMBER"),
|
|
2186
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
2187
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
2188
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
2189
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
2190
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
2191
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
2192
|
+
floorNo: t("FLOOR_NO"),
|
|
2193
|
+
userType: t("USER_TYPE"),
|
|
2194
|
+
tenantName: t("TENANT_NAME"),
|
|
2195
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
2196
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
2197
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
2198
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
2199
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
2200
|
+
vendorId: t("VENDOR_ID"),
|
|
2201
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
2202
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
2203
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
2204
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
2205
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
2206
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
2207
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
2208
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
2209
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
2210
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
2211
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
2212
|
+
emailId: t("EMAIL_ID"),
|
|
2213
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
2214
|
+
dob: t("DOB"),
|
|
2215
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
2216
|
+
createdTime: t("CREATED_TIME"),
|
|
2217
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
2218
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
2219
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
2220
|
+
};
|
|
2221
|
+
const toTitleCase = str => {
|
|
2222
|
+
if (!str) return "";
|
|
2223
|
+
let cleanStr = String(str);
|
|
2224
|
+
if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
|
|
2225
|
+
cleanStr = cleanStr.split(".").pop();
|
|
2226
|
+
}
|
|
2227
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
2124
2228
|
};
|
|
2229
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
2230
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
2125
2231
|
const excelData = consumerList.map(item => {
|
|
2126
2232
|
const cleanObj = {};
|
|
2127
2233
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
2128
2234
|
if (fullName) {
|
|
2129
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
2235
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
2130
2236
|
}
|
|
2131
2237
|
Object.keys(item).forEach(key => {
|
|
2132
2238
|
if (excludedKeys.includes(key)) return;
|
|
2133
|
-
|
|
2239
|
+
let val = item[key];
|
|
2134
2240
|
if (typeof val === "object" && val !== null) {
|
|
2135
2241
|
return;
|
|
2136
2242
|
}
|
|
2243
|
+
if (String(val).toLowerCase() === "true") {
|
|
2244
|
+
val = t("CS_YES");
|
|
2245
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
2246
|
+
val = t("CS_NO");
|
|
2247
|
+
}
|
|
2137
2248
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
2138
|
-
|
|
2249
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
2250
|
+
cleanObj[friendlyHeader] = t(val);
|
|
2251
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
2252
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
2253
|
+
} else {
|
|
2254
|
+
cleanObj[friendlyHeader] = val;
|
|
2255
|
+
}
|
|
2139
2256
|
});
|
|
2140
2257
|
return cleanObj;
|
|
2141
2258
|
});
|
|
@@ -2155,6 +2272,34 @@ const VendorDetailsCard = () => {
|
|
|
2155
2272
|
return Promise.reject(e);
|
|
2156
2273
|
}
|
|
2157
2274
|
};
|
|
2275
|
+
const getDateRange = filter => {
|
|
2276
|
+
const now = new Date();
|
|
2277
|
+
const start = new Date(now);
|
|
2278
|
+
if (filter === "today") {
|
|
2279
|
+
start.setHours(0, 0, 0, 0);
|
|
2280
|
+
return {
|
|
2281
|
+
from: start,
|
|
2282
|
+
to: now
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
if (filter === "week") {
|
|
2286
|
+
start.setDate(now.getDate() - now.getDay());
|
|
2287
|
+
start.setHours(0, 0, 0, 0);
|
|
2288
|
+
return {
|
|
2289
|
+
from: start,
|
|
2290
|
+
to: now
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
if (filter === "month") {
|
|
2294
|
+
start.setDate(1);
|
|
2295
|
+
start.setHours(0, 0, 0, 0);
|
|
2296
|
+
return {
|
|
2297
|
+
from: start,
|
|
2298
|
+
to: now
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
return null;
|
|
2302
|
+
};
|
|
2158
2303
|
const paginatedSupervisors = useMemo(() => {
|
|
2159
2304
|
const start = currentPage * pageSize;
|
|
2160
2305
|
const end = start + pageSize;
|
|
@@ -2269,19 +2414,35 @@ const VendorDetailsCard = () => {
|
|
|
2269
2414
|
console.error("Failed to generate report:", err);
|
|
2270
2415
|
} finally {
|
|
2271
2416
|
setReportLoading(false);
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
const handlePresetDownload = function (filter) {
|
|
2420
|
+
try {
|
|
2421
|
+
const range = getDateRange(filter);
|
|
2422
|
+
if (!range) return Promise.resolve();
|
|
2272
2423
|
setShowReportMenu(false);
|
|
2273
2424
|
setShowCustomPicker(false);
|
|
2425
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
2426
|
+
} catch (e) {
|
|
2427
|
+
return Promise.reject(e);
|
|
2274
2428
|
}
|
|
2275
2429
|
};
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2430
|
+
const handleCustomDownload = function () {
|
|
2431
|
+
try {
|
|
2432
|
+
if (!customDate.from || !customDate.to) {
|
|
2433
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
2434
|
+
return Promise.resolve();
|
|
2435
|
+
}
|
|
2436
|
+
const from = new Date(customDate.from);
|
|
2437
|
+
from.setHours(0, 0, 0, 0);
|
|
2438
|
+
const to = new Date(customDate.to);
|
|
2439
|
+
to.setHours(23, 59, 59, 999);
|
|
2440
|
+
setShowReportMenu(false);
|
|
2441
|
+
setShowCustomPicker(false);
|
|
2442
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
2443
|
+
} catch (e) {
|
|
2444
|
+
return Promise.reject(e);
|
|
2283
2445
|
}
|
|
2284
|
-
handleDownload();
|
|
2285
2446
|
};
|
|
2286
2447
|
const StatCard = _ref3 => {
|
|
2287
2448
|
let title = _ref3.title,
|
|
@@ -2329,65 +2490,12 @@ const VendorDetailsCard = () => {
|
|
|
2329
2490
|
}, vendorName), /*#__PURE__*/React.createElement("div", {
|
|
2330
2491
|
className: "designation"
|
|
2331
2492
|
}, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React.createElement("div", {
|
|
2332
|
-
className: "report-download"
|
|
2333
|
-
ref: reportMenuRef
|
|
2493
|
+
className: "report-download"
|
|
2334
2494
|
}, /*#__PURE__*/React.createElement("button", {
|
|
2335
2495
|
className: "download-btn",
|
|
2336
2496
|
disabled: reportLoading,
|
|
2337
|
-
onClick:
|
|
2338
|
-
|
|
2339
|
-
setShowCustomPicker(false);
|
|
2340
|
-
}
|
|
2341
|
-
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
2342
|
-
className: "report-menu"
|
|
2343
|
-
}, [{
|
|
2344
|
-
label: t("TODAY") || "Today",
|
|
2345
|
-
key: "today"
|
|
2346
|
-
}, {
|
|
2347
|
-
label: t("THIS_WEEK") || "This Week",
|
|
2348
|
-
key: "week"
|
|
2349
|
-
}, {
|
|
2350
|
-
label: t("THIS_MONTH") || "This Month",
|
|
2351
|
-
key: "month"
|
|
2352
|
-
}].map(_ref4 => {
|
|
2353
|
-
let label = _ref4.label,
|
|
2354
|
-
key = _ref4.key;
|
|
2355
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2356
|
-
key: key,
|
|
2357
|
-
className: "menu-item",
|
|
2358
|
-
onClick: () => handlePresetDownload()
|
|
2359
|
-
}, label);
|
|
2360
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2361
|
-
className: "custom-date-trigger",
|
|
2362
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
2363
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
2364
|
-
className: "custom-picker"
|
|
2365
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2366
|
-
className: "date-field"
|
|
2367
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
2368
|
-
className: "date-label"
|
|
2369
|
-
}, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
|
|
2370
|
-
type: "date",
|
|
2371
|
-
className: "date-input",
|
|
2372
|
-
value: customDate.from,
|
|
2373
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
2374
|
-
from: e.target.value
|
|
2375
|
-
}))
|
|
2376
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
2377
|
-
className: "date-field"
|
|
2378
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
2379
|
-
className: "date-label"
|
|
2380
|
-
}, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
|
|
2381
|
-
type: "date",
|
|
2382
|
-
className: "date-input",
|
|
2383
|
-
value: customDate.to,
|
|
2384
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
2385
|
-
to: e.target.value
|
|
2386
|
-
}))
|
|
2387
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
2388
|
-
className: "download-action-btn",
|
|
2389
|
-
onClick: handleCustomDownload
|
|
2390
|
-
}, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
|
|
2497
|
+
onClick: handleDownload
|
|
2498
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
2391
2499
|
className: "stats-wrapper"
|
|
2392
2500
|
}, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
|
|
2393
2501
|
key: idx,
|
|
@@ -2438,10 +2546,16 @@ const VendorDetailsCard = () => {
|
|
|
2438
2546
|
className: "details-right"
|
|
2439
2547
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2440
2548
|
className: "download-card"
|
|
2441
|
-
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("
|
|
2549
|
+
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
|
|
2550
|
+
className: "report-download",
|
|
2551
|
+
ref: reportMenuRef
|
|
2552
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2442
2553
|
className: "download-excel-btn",
|
|
2443
2554
|
disabled: ekycDownloadLoading,
|
|
2444
|
-
onClick:
|
|
2555
|
+
onClick: () => {
|
|
2556
|
+
setShowReportMenu(p => !p);
|
|
2557
|
+
setShowCustomPicker(false);
|
|
2558
|
+
}
|
|
2445
2559
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
2446
2560
|
width: "16",
|
|
2447
2561
|
height: "16",
|
|
@@ -2460,20 +2574,76 @@ const VendorDetailsCard = () => {
|
|
|
2460
2574
|
y1: "15",
|
|
2461
2575
|
x2: "12",
|
|
2462
2576
|
y2: "3"
|
|
2463
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")
|
|
2464
|
-
className: "
|
|
2465
|
-
},
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2577
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
2578
|
+
className: "report-menu"
|
|
2579
|
+
}, [{
|
|
2580
|
+
label: t("TODAY") || "Today",
|
|
2581
|
+
key: "today"
|
|
2582
|
+
}, {
|
|
2583
|
+
label: t("THIS_WEEK") || "This Week",
|
|
2584
|
+
key: "week"
|
|
2585
|
+
}, {
|
|
2586
|
+
label: t("THIS_MONTH") || "This Month",
|
|
2587
|
+
key: "month"
|
|
2588
|
+
}].map(_ref4 => {
|
|
2589
|
+
let label = _ref4.label,
|
|
2590
|
+
key = _ref4.key;
|
|
2591
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2592
|
+
key: key,
|
|
2593
|
+
className: "menu-item",
|
|
2594
|
+
onClick: () => handlePresetDownload(key)
|
|
2595
|
+
}, label);
|
|
2596
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
2597
|
+
className: "custom-date-trigger",
|
|
2598
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
2599
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
2600
|
+
className: "custom-picker"
|
|
2601
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2602
|
+
className: "date-inputs"
|
|
2603
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
2604
|
+
type: "date",
|
|
2605
|
+
value: customDate.from,
|
|
2606
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
2607
|
+
from: e.target.value
|
|
2608
|
+
}))
|
|
2609
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
2610
|
+
type: "date",
|
|
2611
|
+
value: customDate.to,
|
|
2612
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
2613
|
+
to: e.target.value
|
|
2614
|
+
}))
|
|
2615
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
2616
|
+
style: {
|
|
2617
|
+
display: "flex",
|
|
2618
|
+
gap: "10px",
|
|
2619
|
+
marginTop: "10px"
|
|
2620
|
+
}
|
|
2621
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2622
|
+
className: "picker-cancel-btn",
|
|
2623
|
+
onClick: () => {
|
|
2624
|
+
setShowCustomPicker(false);
|
|
2625
|
+
setCustomDate({
|
|
2626
|
+
from: "",
|
|
2627
|
+
to: ""
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
2631
|
+
className: "picker-apply-btn",
|
|
2632
|
+
onClick: handleCustomDownload
|
|
2633
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
2634
|
+
className: "dashboard-card"
|
|
2635
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
2636
|
+
t: t,
|
|
2637
|
+
tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
|
|
2638
|
+
tableClass: "ekycTable",
|
|
2639
|
+
data: paginatedSupervisors,
|
|
2640
|
+
columns: supervisorColumns,
|
|
2641
|
+
isLoading: isPageLoading,
|
|
2642
|
+
totalRecords: vendorSupervisors.length,
|
|
2643
|
+
currentPage: currentPage,
|
|
2644
|
+
pageSizeLimit: pageSize,
|
|
2645
|
+
isPaginationRequired: true,
|
|
2646
|
+
onNextPage: () => {
|
|
2477
2647
|
if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
|
|
2478
2648
|
setCurrentPage(prev => prev + 1);
|
|
2479
2649
|
}
|
|
@@ -3147,25 +3317,10 @@ const Inbox = _ref2 => {
|
|
|
3147
3317
|
targetVendorId: matchedId,
|
|
3148
3318
|
allVendorIds: allIds
|
|
3149
3319
|
};
|
|
3150
|
-
}, [vendorSearchResponse])
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
if (targetVendorId) {
|
|
3155
|
-
return {
|
|
3156
|
-
vendorId: targetVendorId,
|
|
3157
|
-
vendorIds: [targetVendorId]
|
|
3158
|
-
};
|
|
3159
|
-
}
|
|
3160
|
-
if (allVendorIds && allVendorIds.length > 0) {
|
|
3161
|
-
return {
|
|
3162
|
-
vendorId: allVendorIds[0],
|
|
3163
|
-
vendorIds: allVendorIds
|
|
3164
|
-
};
|
|
3165
|
-
}
|
|
3166
|
-
return {};
|
|
3167
|
-
}, [targetVendorId, allVendorIds]);
|
|
3168
|
-
const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress(progressParams, {
|
|
3320
|
+
}, [vendorSearchResponse]);
|
|
3321
|
+
const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
3322
|
+
tenantId
|
|
3323
|
+
}, {
|
|
3169
3324
|
enabled: !!tenantId,
|
|
3170
3325
|
keepPreviousData: true
|
|
3171
3326
|
}),
|
|
@@ -3227,65 +3382,56 @@ const Inbox = _ref2 => {
|
|
|
3227
3382
|
}, [sourceData]);
|
|
3228
3383
|
const _useTranslation = useTranslation(),
|
|
3229
3384
|
t = _useTranslation.t;
|
|
3230
|
-
const
|
|
3231
|
-
var
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
const progressPercent = totalKnos > 0 ? Math.round(submittedKnos / totalKnos * 100) : 0;
|
|
3249
|
-
return {
|
|
3250
|
-
totalKnos,
|
|
3251
|
-
submittedKnos,
|
|
3252
|
-
pendingKnos,
|
|
3253
|
-
progressPercent
|
|
3254
|
-
};
|
|
3255
|
-
}
|
|
3256
|
-
return null;
|
|
3385
|
+
const progressMetrics = useMemo(() => {
|
|
3386
|
+
var _ref3, _progressData$totalKn, _ref4, _progressData$complet, _progressData$pending, _ref5, _progressData$overall;
|
|
3387
|
+
if (!progressData) return {
|
|
3388
|
+
totalKnos: 0,
|
|
3389
|
+
submittedKnos: 0,
|
|
3390
|
+
pendingKnos: 0,
|
|
3391
|
+
progressPercent: 0
|
|
3392
|
+
};
|
|
3393
|
+
const totalKnos = (_ref3 = (_progressData$totalKn = progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) != null ? _progressData$totalKn : progressData === null || progressData === void 0 ? void 0 : progressData.totalAssignments) != null ? _ref3 : 0;
|
|
3394
|
+
const submittedKnos = (_ref4 = (_progressData$complet = progressData === null || progressData === void 0 ? void 0 : progressData.completedKnos) != null ? _progressData$complet : progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnos) != null ? _ref4 : 0;
|
|
3395
|
+
const pendingKnos = (_progressData$pending = progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnos) != null ? _progressData$pending : totalKnos >= submittedKnos ? totalKnos - submittedKnos : 0;
|
|
3396
|
+
const progressPercent = (_ref5 = (_progressData$overall = progressData === null || progressData === void 0 ? void 0 : progressData.overallProgressPercent) != null ? _progressData$overall : progressData === null || progressData === void 0 ? void 0 : progressData.progressPercent) != null ? _ref5 : totalKnos > 0 ? (submittedKnos / totalKnos * 100).toFixed(1) : 0;
|
|
3397
|
+
return {
|
|
3398
|
+
totalKnos,
|
|
3399
|
+
submittedKnos,
|
|
3400
|
+
pendingKnos,
|
|
3401
|
+
progressPercent
|
|
3402
|
+
};
|
|
3257
3403
|
}, [progressData]);
|
|
3258
3404
|
const cards = useMemo(() => [{
|
|
3259
3405
|
label: t("TOTAL_EKYC_APPLICATIONS"),
|
|
3260
|
-
count: (
|
|
3406
|
+
count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.totalKnos) || 0,
|
|
3261
3407
|
color: "#0B2559",
|
|
3262
3408
|
type: "today",
|
|
3263
3409
|
icon: /*#__PURE__*/React.createElement(FaUsers, null)
|
|
3264
3410
|
}, {
|
|
3265
3411
|
label: t("EKYC_COMPLETED"),
|
|
3266
|
-
count: (
|
|
3412
|
+
count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.submittedKnos) || 0,
|
|
3267
3413
|
color: "#10B981",
|
|
3268
3414
|
type: "month",
|
|
3269
3415
|
icon: /*#__PURE__*/React.createElement(FaCheckCircle, null)
|
|
3270
3416
|
}, {
|
|
3271
3417
|
label: t("PENDING_APPLICATIONS"),
|
|
3272
|
-
count: (
|
|
3418
|
+
count: (progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.pendingKnos) || 0,
|
|
3273
3419
|
color: "#F59E0B",
|
|
3274
3420
|
type: "pending",
|
|
3275
3421
|
icon: /*#__PURE__*/React.createElement(FaClock, null)
|
|
3276
3422
|
}, {
|
|
3277
3423
|
label: t("OVERALL_PROGRESS"),
|
|
3278
|
-
count: ((
|
|
3424
|
+
count: ((progressMetrics === null || progressMetrics === void 0 ? void 0 : progressMetrics.progressPercent) || 0) + "%",
|
|
3279
3425
|
color: "#A855F7",
|
|
3280
3426
|
type: "progress",
|
|
3281
3427
|
icon: /*#__PURE__*/React.createElement(FaChartLine, null)
|
|
3282
|
-
}], [
|
|
3428
|
+
}], [progressMetrics, t]);
|
|
3283
3429
|
const totalRecords = (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
|
|
3284
3430
|
const checkPathName = location.pathname.includes("ekyc/inbox");
|
|
3285
|
-
const SearchFormFields = useCallback(
|
|
3286
|
-
let registerRef =
|
|
3287
|
-
searchFormState =
|
|
3288
|
-
controlSearchForm =
|
|
3431
|
+
const SearchFormFields = useCallback(_ref6 => {
|
|
3432
|
+
let registerRef = _ref6.registerRef,
|
|
3433
|
+
searchFormState = _ref6.searchFormState,
|
|
3434
|
+
controlSearchForm = _ref6.controlSearchForm;
|
|
3289
3435
|
return /*#__PURE__*/React.createElement(SearchFormFieldsComponents, {
|
|
3290
3436
|
registerRef,
|
|
3291
3437
|
searchFormState,
|
|
@@ -3590,7 +3736,8 @@ const ReviewSection = _ref2 => {
|
|
|
3590
3736
|
}, t("EKYC_PROPOSED_UPDATES")))), /*#__PURE__*/React.createElement("tbody", null, fields.map((field, idx) => {
|
|
3591
3737
|
const valNew = newData === null || newData === void 0 ? void 0 : newData[field.key];
|
|
3592
3738
|
const valOld = oldData === null || oldData === void 0 ? void 0 : oldData[field.key];
|
|
3593
|
-
const
|
|
3739
|
+
const normalizeVal = v => v === null || v === undefined || v === "" ? "" : String(v);
|
|
3740
|
+
const isChanged = oldData && valOld !== undefined && normalizeVal(valNew) !== normalizeVal(valOld);
|
|
3594
3741
|
return /*#__PURE__*/React.createElement("tr", {
|
|
3595
3742
|
key: idx,
|
|
3596
3743
|
style: {
|
|
@@ -3603,7 +3750,7 @@ const ReviewSection = _ref2 => {
|
|
|
3603
3750
|
color: "#344054",
|
|
3604
3751
|
fontWeight: "500"
|
|
3605
3752
|
}
|
|
3606
|
-
}, t(field.label)), /*#__PURE__*/React.createElement("td", {
|
|
3753
|
+
}, field.preTranslated ? field.label : t(field.label)), /*#__PURE__*/React.createElement("td", {
|
|
3607
3754
|
style: {
|
|
3608
3755
|
padding: "16px 0",
|
|
3609
3756
|
fontSize: "14px",
|
|
@@ -3702,6 +3849,8 @@ const Review = () => {
|
|
|
3702
3849
|
const _extractReviewData = extractReviewData(searchData, flowState),
|
|
3703
3850
|
apiNewData = _extractReviewData.newData,
|
|
3704
3851
|
apiOldData = _extractReviewData.oldData;
|
|
3852
|
+
const flatNewData = apiNewData ? _extends({}, apiNewData || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.connectionDetails) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.addressDetails) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.propertyInfo) || {}, (apiNewData === null || apiNewData === void 0 ? void 0 : apiNewData.meterDetails) || {}) : null;
|
|
3853
|
+
const flatOldData = apiOldData ? _extends({}, apiOldData || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.connectionDetails) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.addressDetails) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.propertyInfo) || {}, (apiOldData === null || apiOldData === void 0 ? void 0 : apiOldData.meterDetails) || {}) : null;
|
|
3705
3854
|
const prepareConsolidatedData = data => {
|
|
3706
3855
|
if (!data) return null;
|
|
3707
3856
|
const apiConn = (data === null || data === void 0 ? void 0 : data.connectionDetails) || data || {};
|
|
@@ -3736,7 +3885,7 @@ const Review = () => {
|
|
|
3736
3885
|
email: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.email,
|
|
3737
3886
|
noOfPerson: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPerson) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPersons),
|
|
3738
3887
|
knumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.kno),
|
|
3739
|
-
doorPhotoFilestoreId: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId
|
|
3888
|
+
doorPhotoFilestoreId: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFileStoreId) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId)
|
|
3740
3889
|
},
|
|
3741
3890
|
property: {
|
|
3742
3891
|
kno: apiProp === null || apiProp === void 0 ? void 0 : apiProp.kno,
|
|
@@ -3749,7 +3898,7 @@ const Review = () => {
|
|
|
3749
3898
|
tenantMobile: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantMobile,
|
|
3750
3899
|
ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
|
|
3751
3900
|
propertyDocumentFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId,
|
|
3752
|
-
buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
|
|
3901
|
+
buildingImageFileStoreId: (apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFilestoreId)
|
|
3753
3902
|
},
|
|
3754
3903
|
meter: {
|
|
3755
3904
|
kno: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.kno,
|
|
@@ -3762,12 +3911,11 @@ const Review = () => {
|
|
|
3762
3911
|
workingStatus: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.workingStatus,
|
|
3763
3912
|
lastBillRaised: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.lastBillRaised,
|
|
3764
3913
|
systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
|
|
3765
|
-
meterPhotoFileStoreId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId
|
|
3914
|
+
meterPhotoFileStoreId: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFilestoreId)
|
|
3766
3915
|
}
|
|
3767
3916
|
};
|
|
3768
3917
|
};
|
|
3769
3918
|
const newDataRaw = prepareConsolidatedData(apiNewData);
|
|
3770
|
-
const oldDataRaw = prepareConsolidatedData(apiOldData);
|
|
3771
3919
|
const connectionData = _extends({}, newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.connection, {
|
|
3772
3920
|
consumerName: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.name) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio = newDataRaw.connection) === null || _newDataRaw$connectio === void 0 ? void 0 : _newDataRaw$connectio.consumerName),
|
|
3773
3921
|
phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio2 = newDataRaw.connection) === null || _newDataRaw$connectio2 === void 0 ? void 0 : _newDataRaw$connectio2.phoneNumber),
|
|
@@ -3810,136 +3958,323 @@ const Review = () => {
|
|
|
3810
3958
|
lastBillRaised: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$lastBill = editedMeter.lastBillRaisedData) === null || _editedMeter$lastBill === void 0 ? void 0 : _editedMeter$lastBill.value) === "Yes" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter7 = newDataRaw.meter) === null || _newDataRaw$meter7 === void 0 ? void 0 : _newDataRaw$meter7.lastBillRaised),
|
|
3811
3959
|
meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter8 = newDataRaw.meter) === null || _newDataRaw$meter8 === void 0 ? void 0 : _newDataRaw$meter8.meterPhotoFileStoreId)
|
|
3812
3960
|
});
|
|
3813
|
-
const
|
|
3814
|
-
|
|
3815
|
-
|
|
3961
|
+
const headerMapping = [{
|
|
3962
|
+
key: "kno",
|
|
3963
|
+
label: "KNO"
|
|
3816
3964
|
}, {
|
|
3817
|
-
|
|
3818
|
-
|
|
3965
|
+
key: "firstName",
|
|
3966
|
+
label: "FIRST_NAME"
|
|
3819
3967
|
}, {
|
|
3820
|
-
|
|
3821
|
-
|
|
3968
|
+
key: "middleName",
|
|
3969
|
+
label: "MIDDLE_NAME"
|
|
3822
3970
|
}, {
|
|
3823
|
-
|
|
3824
|
-
|
|
3971
|
+
key: "lastName",
|
|
3972
|
+
label: "LAST_NAME"
|
|
3825
3973
|
}, {
|
|
3826
|
-
|
|
3827
|
-
|
|
3974
|
+
key: "status",
|
|
3975
|
+
label: "STATUS"
|
|
3828
3976
|
}, {
|
|
3829
|
-
|
|
3830
|
-
|
|
3977
|
+
key: "ekycStatus",
|
|
3978
|
+
label: "EKYC_STATUS"
|
|
3831
3979
|
}, {
|
|
3832
|
-
|
|
3833
|
-
|
|
3980
|
+
key: "zoneName",
|
|
3981
|
+
label: "ZONE"
|
|
3834
3982
|
}, {
|
|
3835
|
-
|
|
3836
|
-
|
|
3983
|
+
key: "zoneCode",
|
|
3984
|
+
label: "ZONE_CODE"
|
|
3837
3985
|
}, {
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
}];
|
|
3841
|
-
const addressFields = [{
|
|
3842
|
-
label: "EKYC_FULL_ADDRESS",
|
|
3843
|
-
key: "fullAddress"
|
|
3986
|
+
key: "assembly",
|
|
3987
|
+
label: "EKYC_ASSEMBLY"
|
|
3844
3988
|
}, {
|
|
3845
|
-
|
|
3846
|
-
|
|
3989
|
+
key: "ward",
|
|
3990
|
+
label: "WARD"
|
|
3847
3991
|
}, {
|
|
3848
|
-
|
|
3849
|
-
|
|
3992
|
+
key: "pincode",
|
|
3993
|
+
label: "EKYC_PINCODE"
|
|
3850
3994
|
}, {
|
|
3851
|
-
|
|
3852
|
-
|
|
3995
|
+
key: "addressRaw",
|
|
3996
|
+
label: "ADDRESS_RAW"
|
|
3853
3997
|
}, {
|
|
3854
|
-
|
|
3855
|
-
|
|
3998
|
+
key: "locality",
|
|
3999
|
+
label: "EKYC_LOCALITY"
|
|
3856
4000
|
}, {
|
|
3857
|
-
|
|
3858
|
-
|
|
4001
|
+
key: "subLocality",
|
|
4002
|
+
label: "SUB_LOCALITY"
|
|
3859
4003
|
}, {
|
|
3860
|
-
|
|
3861
|
-
|
|
4004
|
+
key: "flatHouseNumber",
|
|
4005
|
+
label: "FLAT_HOUSE_NUMBER"
|
|
3862
4006
|
}, {
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
isBool: true
|
|
4007
|
+
key: "streetName",
|
|
4008
|
+
label: "STREET_NAME"
|
|
3866
4009
|
}, {
|
|
3867
|
-
|
|
3868
|
-
|
|
4010
|
+
key: "landmark",
|
|
4011
|
+
label: "EKYC_LANDMARK"
|
|
3869
4012
|
}, {
|
|
3870
|
-
|
|
3871
|
-
|
|
4013
|
+
key: "city",
|
|
4014
|
+
label: "CITY"
|
|
3872
4015
|
}, {
|
|
3873
|
-
|
|
3874
|
-
|
|
4016
|
+
key: "state",
|
|
4017
|
+
label: "STATE"
|
|
3875
4018
|
}, {
|
|
3876
|
-
|
|
3877
|
-
|
|
4019
|
+
key: "addressType",
|
|
4020
|
+
label: "ADDRESS_TYPE"
|
|
3878
4021
|
}, {
|
|
3879
|
-
|
|
3880
|
-
|
|
4022
|
+
key: "addressProofType",
|
|
4023
|
+
label: "ADDRESS_PROOF_TYPE"
|
|
3881
4024
|
}, {
|
|
3882
|
-
|
|
3883
|
-
|
|
4025
|
+
key: "mobileNo",
|
|
4026
|
+
label: "MOBILE_NUMBER"
|
|
3884
4027
|
}, {
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
}];
|
|
3888
|
-
const propertyFields = [{
|
|
3889
|
-
label: "EKYC_CONNECTION_CATEGORY",
|
|
3890
|
-
key: "connectionCategory"
|
|
4028
|
+
key: "alternateMobileNo",
|
|
4029
|
+
label: "ALTERNATE_MOBILE_NUMBER"
|
|
3891
4030
|
}, {
|
|
3892
|
-
|
|
3893
|
-
|
|
4031
|
+
key: "whatsappNo",
|
|
4032
|
+
label: "WHATSAPP_NO"
|
|
3894
4033
|
}, {
|
|
3895
|
-
|
|
3896
|
-
|
|
4034
|
+
key: "email",
|
|
4035
|
+
label: "EMAIL"
|
|
3897
4036
|
}, {
|
|
3898
|
-
|
|
3899
|
-
|
|
4037
|
+
key: "landlineNo",
|
|
4038
|
+
label: "LANDLINE_NO"
|
|
3900
4039
|
}, {
|
|
3901
|
-
|
|
3902
|
-
|
|
4040
|
+
key: "mrkey",
|
|
4041
|
+
label: "MR_KEY"
|
|
3903
4042
|
}, {
|
|
3904
|
-
|
|
3905
|
-
|
|
4043
|
+
key: "mrcode",
|
|
4044
|
+
label: "MR_CODE"
|
|
3906
4045
|
}, {
|
|
3907
|
-
|
|
3908
|
-
|
|
4046
|
+
key: "areacode",
|
|
4047
|
+
label: "AREA_CODE"
|
|
3909
4048
|
}, {
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
}
|
|
3913
|
-
|
|
3914
|
-
label: "
|
|
3915
|
-
|
|
4049
|
+
key: "source",
|
|
4050
|
+
label: "SOURCE"
|
|
4051
|
+
}, {
|
|
4052
|
+
key: "submittedAt",
|
|
4053
|
+
label: "SUBMITTED_AT"
|
|
4054
|
+
}, {
|
|
4055
|
+
key: "assignedAt",
|
|
4056
|
+
label: "ASSIGNED_AT"
|
|
4057
|
+
}, {
|
|
4058
|
+
key: "connectionType",
|
|
4059
|
+
label: "CONNECTION_TYPE"
|
|
4060
|
+
}, {
|
|
4061
|
+
key: "Type",
|
|
4062
|
+
label: "CONSUMER_TYPE"
|
|
4063
|
+
}, {
|
|
4064
|
+
key: "occupantType",
|
|
4065
|
+
label: "OCCUPANT_TYPE"
|
|
4066
|
+
}, {
|
|
4067
|
+
key: "knoCategory",
|
|
4068
|
+
label: "KNO_CATEGORY"
|
|
4069
|
+
}, {
|
|
4070
|
+
key: "approvedAt",
|
|
4071
|
+
label: "APPROVED_AT"
|
|
4072
|
+
}, {
|
|
4073
|
+
key: "gender",
|
|
4074
|
+
label: "GENDER"
|
|
4075
|
+
}, {
|
|
4076
|
+
key: "parentSpouse",
|
|
4077
|
+
label: "PARENT_SPOUSE"
|
|
4078
|
+
}, {
|
|
4079
|
+
key: "fatherOrHusbandName",
|
|
4080
|
+
label: "FATHER_HUSBUND_NAME"
|
|
4081
|
+
}, {
|
|
4082
|
+
key: "relationship",
|
|
4083
|
+
label: "RELATIONSHIP"
|
|
4084
|
+
}, {
|
|
4085
|
+
key: "informantName",
|
|
4086
|
+
label: "INFORMANT_NAME"
|
|
4087
|
+
}, {
|
|
4088
|
+
key: "informantRelation",
|
|
4089
|
+
label: "INFORMANT_RELATION"
|
|
4090
|
+
}, {
|
|
4091
|
+
key: "informantIs",
|
|
4092
|
+
label: "INFORMANT_IS"
|
|
4093
|
+
}, {
|
|
4094
|
+
key: "contactPerson",
|
|
4095
|
+
label: "CONTACT_PERSON"
|
|
4096
|
+
}, {
|
|
4097
|
+
key: "relation",
|
|
4098
|
+
label: "RELATION"
|
|
4099
|
+
}, {
|
|
4100
|
+
key: "entityName",
|
|
4101
|
+
label: "ENTITY_NAME"
|
|
4102
|
+
}, {
|
|
4103
|
+
key: "designation",
|
|
4104
|
+
label: "DESIGNATION"
|
|
4105
|
+
}, {
|
|
4106
|
+
key: "department",
|
|
4107
|
+
label: "DEPARTMENT"
|
|
4108
|
+
}, {
|
|
4109
|
+
key: "employeeId",
|
|
4110
|
+
label: "EMPLOYEE_ID"
|
|
4111
|
+
}, {
|
|
4112
|
+
key: "ownerMobile",
|
|
4113
|
+
label: "OWNER_MOBILE"
|
|
4114
|
+
}, {
|
|
4115
|
+
key: "ownerVerificationDone",
|
|
4116
|
+
label: "OWNER_VERIFICATION_DONE",
|
|
4117
|
+
isBool: true
|
|
4118
|
+
}, {
|
|
4119
|
+
key: "consentGiven",
|
|
4120
|
+
label: "CONSENT_GIVEN",
|
|
4121
|
+
isBool: true
|
|
4122
|
+
}, {
|
|
4123
|
+
key: "proofOfIdentityType",
|
|
4124
|
+
label: "PROOF_OF_IDENTITY_TYPE"
|
|
4125
|
+
}, {
|
|
4126
|
+
key: "documentNumber",
|
|
4127
|
+
label: "DOCUMENT_NUMBER"
|
|
4128
|
+
}, {
|
|
4129
|
+
key: "noOfPerson",
|
|
4130
|
+
label: "NUMBER_OF_PERSON"
|
|
4131
|
+
}, {
|
|
4132
|
+
key: "latitude",
|
|
4133
|
+
label: "LATITUDE"
|
|
4134
|
+
}, {
|
|
4135
|
+
key: "longitude",
|
|
4136
|
+
label: "LONGITUDE"
|
|
4137
|
+
}, {
|
|
4138
|
+
key: "gpsValid",
|
|
4139
|
+
label: "GPS_VALID",
|
|
3916
4140
|
isBool: true
|
|
3917
4141
|
}, {
|
|
3918
|
-
|
|
3919
|
-
|
|
4142
|
+
key: "meterNumber",
|
|
4143
|
+
label: "METER_NUMBER"
|
|
4144
|
+
}, {
|
|
4145
|
+
key: "meterMake",
|
|
4146
|
+
label: "METER_MAKE"
|
|
3920
4147
|
}, {
|
|
3921
|
-
|
|
3922
|
-
|
|
4148
|
+
key: "meterStatus",
|
|
4149
|
+
label: "METER_STATUS"
|
|
3923
4150
|
}, {
|
|
3924
|
-
|
|
3925
|
-
|
|
4151
|
+
key: "meterCondition",
|
|
4152
|
+
label: "METER_CONDITION"
|
|
3926
4153
|
}, {
|
|
3927
|
-
|
|
3928
|
-
|
|
4154
|
+
key: "meterLocation",
|
|
4155
|
+
label: "METER_LOCATION"
|
|
3929
4156
|
}, {
|
|
3930
|
-
|
|
3931
|
-
|
|
4157
|
+
key: "meterLocationAddress",
|
|
4158
|
+
label: "METER_LOCATION_ADDRESS"
|
|
3932
4159
|
}, {
|
|
3933
|
-
label: "EKYC_WORKING_STATUS",
|
|
3934
4160
|
key: "workingStatus",
|
|
4161
|
+
label: "WORKING_STATUS"
|
|
4162
|
+
}, {
|
|
4163
|
+
key: "sewerConnection",
|
|
4164
|
+
label: "SEWER_CONNECTION",
|
|
4165
|
+
isBool: true
|
|
4166
|
+
}, {
|
|
4167
|
+
key: "septicTank",
|
|
4168
|
+
label: "SEPTIC_TANK",
|
|
3935
4169
|
isBool: true
|
|
3936
4170
|
}, {
|
|
3937
|
-
label: "EKYC_LAST_BILL_RAISED",
|
|
3938
4171
|
key: "lastBillRaised",
|
|
4172
|
+
label: "LAST_BILL_RAISED",
|
|
4173
|
+
isBool: true
|
|
4174
|
+
}, {
|
|
4175
|
+
key: "lastBillReceivedDate",
|
|
4176
|
+
label: "LAST_BILL_RECEIVED_DATE"
|
|
4177
|
+
}, {
|
|
4178
|
+
key: "accessToMeter",
|
|
4179
|
+
label: "ACCESS_TO_METER",
|
|
4180
|
+
isBool: true
|
|
4181
|
+
}, {
|
|
4182
|
+
key: "systemMeterId",
|
|
4183
|
+
label: "SYSTEM_METER_ID"
|
|
4184
|
+
}, {
|
|
4185
|
+
key: "lastBillNotRaisedReason",
|
|
4186
|
+
label: "LAST_BILL_NOT_RAISED_REASON"
|
|
4187
|
+
}, {
|
|
4188
|
+
key: "waterConnectionYears",
|
|
4189
|
+
label: "WATER_CONNECTION_YEARS"
|
|
4190
|
+
}, {
|
|
4191
|
+
key: "sewerConnectionYears",
|
|
4192
|
+
label: "SEWER_CONNECTION_YEARS"
|
|
4193
|
+
}, {
|
|
4194
|
+
key: "pidNumber",
|
|
4195
|
+
label: "PID_NUMBER"
|
|
4196
|
+
}, {
|
|
4197
|
+
key: "propertyType",
|
|
4198
|
+
label: "PROPERTY_TYPE"
|
|
4199
|
+
}, {
|
|
4200
|
+
key: "subPropertyCategory",
|
|
4201
|
+
label: "SUB_PROPERTY_CATEGORY"
|
|
4202
|
+
}, {
|
|
4203
|
+
key: "noOfFloor",
|
|
4204
|
+
label: "NO_OF_FLOOR"
|
|
4205
|
+
}, {
|
|
4206
|
+
key: "noOfRooms",
|
|
4207
|
+
label: "NO_OF_ROOMS"
|
|
4208
|
+
}, {
|
|
4209
|
+
key: "noOfBeds",
|
|
4210
|
+
label: "NO_OF_BEDS"
|
|
4211
|
+
}, {
|
|
4212
|
+
key: "numberOfDwellingUnits",
|
|
4213
|
+
label: "NUMBER_OF_DWELLING_UNITS"
|
|
4214
|
+
}, {
|
|
4215
|
+
key: "floorNo",
|
|
4216
|
+
label: "FLOOR_NO"
|
|
4217
|
+
}, {
|
|
4218
|
+
key: "userType",
|
|
4219
|
+
label: "USER_TYPE"
|
|
4220
|
+
}, {
|
|
4221
|
+
key: "tenantName",
|
|
4222
|
+
label: "TENANT_NAME"
|
|
4223
|
+
}, {
|
|
4224
|
+
key: "tenantMobile",
|
|
4225
|
+
label: "TENANT_MOBILE"
|
|
4226
|
+
}, {
|
|
4227
|
+
key: "verificationStatus",
|
|
4228
|
+
label: "VERIFICATION_STATUS"
|
|
4229
|
+
}, {
|
|
4230
|
+
key: "houseBuiltDuration",
|
|
4231
|
+
label: "HOUSE_BUILT_DURATION"
|
|
4232
|
+
}, {
|
|
4233
|
+
key: "surveyorId",
|
|
4234
|
+
label: "SURVEYOR_ID"
|
|
4235
|
+
}, {
|
|
4236
|
+
key: "supervisorId",
|
|
4237
|
+
label: "SUPERVISOR_ID"
|
|
4238
|
+
}, {
|
|
4239
|
+
key: "vendorId",
|
|
4240
|
+
label: "VENDOR_ID"
|
|
4241
|
+
}, {
|
|
4242
|
+
key: "assignmentType",
|
|
4243
|
+
label: "ASSIGNMENT_TYPE"
|
|
4244
|
+
}, {
|
|
4245
|
+
key: "assignmentValue",
|
|
4246
|
+
label: "ASSIGNMENT_VALUE"
|
|
4247
|
+
}, {
|
|
4248
|
+
key: "assignedTime",
|
|
4249
|
+
label: "ASSIGNED_TIME"
|
|
4250
|
+
}, {
|
|
4251
|
+
key: "isSelfAssigned",
|
|
4252
|
+
label: "IS_SELF_ASSIGNED",
|
|
3939
4253
|
isBool: true
|
|
3940
4254
|
}, {
|
|
3941
|
-
|
|
3942
|
-
|
|
4255
|
+
key: "modifiedBy",
|
|
4256
|
+
label: "MODIFIED_BY"
|
|
4257
|
+
}, {
|
|
4258
|
+
key: "emailId",
|
|
4259
|
+
label: "EMAIL_ID"
|
|
4260
|
+
}, {
|
|
4261
|
+
key: "dob",
|
|
4262
|
+
label: "DOB"
|
|
4263
|
+
}, {
|
|
4264
|
+
key: "consumerType",
|
|
4265
|
+
label: "CONSUMER_TYPE"
|
|
4266
|
+
}, {
|
|
4267
|
+
key: "createdTime",
|
|
4268
|
+
label: "CREATED_TIME"
|
|
4269
|
+
}, {
|
|
4270
|
+
key: "lastModifiedTime",
|
|
4271
|
+
label: "LAST_MODIFIED_TIME"
|
|
4272
|
+
}, {
|
|
4273
|
+
key: "meterLatitude",
|
|
4274
|
+
label: "EKYC_METER_LATITUDE1"
|
|
4275
|
+
}, {
|
|
4276
|
+
key: "meterLongitude",
|
|
4277
|
+
label: "EKYC_METER_LONGITUDE1"
|
|
3943
4278
|
}];
|
|
3944
4279
|
const handleDeclaration = () => setAgree(!agree);
|
|
3945
4280
|
const handleReject = function () {
|
|
@@ -4048,65 +4383,15 @@ const Review = () => {
|
|
|
4048
4383
|
}
|
|
4049
4384
|
};
|
|
4050
4385
|
if (isSearchLoading || isSubmitting) return /*#__PURE__*/React.createElement(Loader, null);
|
|
4051
|
-
const baseUrl = "/digit-ui/employee/ekyc";
|
|
4052
4386
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
|
|
4053
4387
|
className: "overflow-y-scroll"
|
|
4054
4388
|
}, /*#__PURE__*/React.createElement(ReviewSection, {
|
|
4055
|
-
title: t("
|
|
4056
|
-
fields:
|
|
4057
|
-
newData:
|
|
4058
|
-
oldData:
|
|
4059
|
-
t: t,
|
|
4060
|
-
jumpTo: baseUrl + "/consumer-details?kno=" + activeKno,
|
|
4061
|
-
state: _extends({}, flowState, {
|
|
4062
|
-
kNumber: activeKno,
|
|
4063
|
-
kno: activeKno,
|
|
4064
|
-
reviewData: searchData,
|
|
4065
|
-
edits
|
|
4066
|
-
}),
|
|
4067
|
-
hideEditButton: hideEditButton
|
|
4068
|
-
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
4069
|
-
title: t("EKYC_ADDRESS_DETAILS"),
|
|
4070
|
-
fields: addressFields,
|
|
4071
|
-
newData: addressData,
|
|
4072
|
-
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.address,
|
|
4073
|
-
t: t,
|
|
4074
|
-
jumpTo: baseUrl + "/address-details?kno=" + activeKno,
|
|
4075
|
-
state: _extends({}, flowState, {
|
|
4076
|
-
kNumber: activeKno,
|
|
4077
|
-
kno: activeKno,
|
|
4078
|
-
reviewData: searchData,
|
|
4079
|
-
edits
|
|
4080
|
-
}),
|
|
4081
|
-
hideEditButton: hideEditButton
|
|
4082
|
-
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
4083
|
-
title: t("EKYC_PROPERTY_INFO"),
|
|
4084
|
-
fields: propertyFields,
|
|
4085
|
-
newData: propertyData,
|
|
4086
|
-
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.property,
|
|
4087
|
-
t: t,
|
|
4088
|
-
jumpTo: baseUrl + "/property-info?kno=" + activeKno,
|
|
4089
|
-
state: _extends({}, flowState, {
|
|
4090
|
-
kNumber: activeKno,
|
|
4091
|
-
kno: activeKno,
|
|
4092
|
-
reviewData: searchData,
|
|
4093
|
-
edits
|
|
4094
|
-
}),
|
|
4095
|
-
hideEditButton: hideEditButton
|
|
4096
|
-
}), /*#__PURE__*/React.createElement(ReviewSection, {
|
|
4097
|
-
title: t("EKYC_METER_DETAILS"),
|
|
4098
|
-
fields: meterFields,
|
|
4099
|
-
newData: meterData,
|
|
4100
|
-
oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.meter,
|
|
4389
|
+
title: t("EKYC_ALL_DETAILS") || "All Details",
|
|
4390
|
+
fields: headerMapping,
|
|
4391
|
+
newData: flatNewData,
|
|
4392
|
+
oldData: flatOldData,
|
|
4101
4393
|
t: t,
|
|
4102
|
-
|
|
4103
|
-
state: _extends({}, flowState, {
|
|
4104
|
-
kNumber: activeKno,
|
|
4105
|
-
kno: activeKno,
|
|
4106
|
-
reviewData: searchData,
|
|
4107
|
-
edits
|
|
4108
|
-
}),
|
|
4109
|
-
hideEditButton: hideEditButton
|
|
4394
|
+
hideEditButton: true
|
|
4110
4395
|
}), /*#__PURE__*/React.createElement("div", {
|
|
4111
4396
|
style: {
|
|
4112
4397
|
marginTop: "40px"
|
|
@@ -5569,21 +5854,37 @@ const SupervisorDetailsCard = () => {
|
|
|
5569
5854
|
console.error("Failed to generate supervisor report:", err);
|
|
5570
5855
|
} finally {
|
|
5571
5856
|
setReportLoading(false);
|
|
5857
|
+
}
|
|
5858
|
+
};
|
|
5859
|
+
const handlePresetDownload = function (filter) {
|
|
5860
|
+
try {
|
|
5861
|
+
const range = getDateRange(filter);
|
|
5862
|
+
if (!range) return Promise.resolve();
|
|
5572
5863
|
setShowReportMenu(false);
|
|
5573
5864
|
setShowCustomPicker(false);
|
|
5865
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
5866
|
+
} catch (e) {
|
|
5867
|
+
return Promise.reject(e);
|
|
5574
5868
|
}
|
|
5575
5869
|
};
|
|
5576
|
-
const
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5870
|
+
const handleCustomDownload = function () {
|
|
5871
|
+
try {
|
|
5872
|
+
if (!customDate.from || !customDate.to) {
|
|
5873
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
5874
|
+
return Promise.resolve();
|
|
5875
|
+
}
|
|
5876
|
+
const from = new Date(customDate.from);
|
|
5877
|
+
from.setHours(0, 0, 0, 0);
|
|
5878
|
+
const to = new Date(customDate.to);
|
|
5879
|
+
to.setHours(23, 59, 59, 999);
|
|
5880
|
+
setShowReportMenu(false);
|
|
5881
|
+
setShowCustomPicker(false);
|
|
5882
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
5883
|
+
} catch (e) {
|
|
5884
|
+
return Promise.reject(e);
|
|
5583
5885
|
}
|
|
5584
|
-
handleDownload();
|
|
5585
5886
|
};
|
|
5586
|
-
const handleDownloadEkycData = function () {
|
|
5887
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
5587
5888
|
try {
|
|
5588
5889
|
if (!surveyors || surveyors.length === 0) {
|
|
5589
5890
|
alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
|
|
@@ -5592,69 +5893,175 @@ const SupervisorDetailsCard = () => {
|
|
|
5592
5893
|
setEkycDownloadLoading(true);
|
|
5593
5894
|
return Promise.resolve(_finallyRethrows(function () {
|
|
5594
5895
|
return _catch(function () {
|
|
5595
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
5896
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
5596
5897
|
tenantId: tenantId || "dl.djb",
|
|
5597
5898
|
offset: 0,
|
|
5598
5899
|
limit: 10000,
|
|
5599
5900
|
reportDownload: true
|
|
5600
|
-
}
|
|
5901
|
+
}, fromDate && {
|
|
5902
|
+
fromDate
|
|
5903
|
+
}, toDate && {
|
|
5904
|
+
toDate
|
|
5905
|
+
}))).then(function (response) {
|
|
5601
5906
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
5602
5907
|
if (consumerList.length === 0) {
|
|
5603
5908
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
5604
5909
|
return;
|
|
5605
5910
|
}
|
|
5606
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
5911
|
+
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
|
|
5607
5912
|
const headerMapping = {
|
|
5608
|
-
kno: t("KNO")
|
|
5609
|
-
firstName: t("FIRST_NAME")
|
|
5610
|
-
middleName: t("MIDDLE_NAME")
|
|
5611
|
-
lastName: t("LAST_NAME")
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5913
|
+
kno: t("KNO"),
|
|
5914
|
+
firstName: t("FIRST_NAME"),
|
|
5915
|
+
middleName: t("MIDDLE_NAME"),
|
|
5916
|
+
lastName: t("LAST_NAME"),
|
|
5917
|
+
status: t("STATUS"),
|
|
5918
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
5919
|
+
zoneName: t("ZONE"),
|
|
5920
|
+
zoneCode: t("ZONE_CODE"),
|
|
5921
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
5922
|
+
ward: t("WARD"),
|
|
5923
|
+
pincode: t("EKYC_PINCODE"),
|
|
5924
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
5925
|
+
locality: t("EKYC_LOCALITY"),
|
|
5926
|
+
subLocality: t("SUB_LOCALITY"),
|
|
5927
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
5928
|
+
streetName: t("STREET_NAME"),
|
|
5929
|
+
landmark: t("EKYC_LANDMARK"),
|
|
5930
|
+
city: t("CITY"),
|
|
5931
|
+
state: t("STATE"),
|
|
5932
|
+
addressType: t("ADDRESS_TYPE"),
|
|
5933
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
5934
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
5935
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
5936
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
5937
|
+
email: t("EMAIL"),
|
|
5938
|
+
landlineNo: t("LANDLINE_NO"),
|
|
5939
|
+
mrkey: t("MR_KEY"),
|
|
5940
|
+
mrcode: t("MR_CODE"),
|
|
5941
|
+
areacode: t("AREA_CODE"),
|
|
5942
|
+
source: t("SOURCE"),
|
|
5943
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
5944
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
5945
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
5946
|
+
Type: t("CONSUMER_TYPE"),
|
|
5947
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
5948
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
5949
|
+
approvedAt: t("APPROVED_AT"),
|
|
5950
|
+
gender: t("GENDER"),
|
|
5951
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
5952
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
5953
|
+
relationship: t("RELATIONSHIP"),
|
|
5954
|
+
informantName: t("INFORMANT_NAME"),
|
|
5955
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
5956
|
+
informantIs: t("INFORMANT_IS"),
|
|
5957
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
5958
|
+
relation: t("RELATION"),
|
|
5959
|
+
entityName: t("ENTITY_NAME"),
|
|
5960
|
+
designation: t("DESIGNATION"),
|
|
5961
|
+
department: t("DEPARTMENT"),
|
|
5962
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
5963
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
5964
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
5965
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
5966
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
5967
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
5968
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
5969
|
+
latitude: t("LATITUDE"),
|
|
5970
|
+
longitude: t("LONGITUDE"),
|
|
5971
|
+
gpsValid: t("GPS_VALID"),
|
|
5972
|
+
meterNumber: t("METER_NUMBER"),
|
|
5973
|
+
meterMake: t("METER_MAKE"),
|
|
5974
|
+
meterStatus: t("METER_STATUS"),
|
|
5975
|
+
meterCondition: t("METER_CONDITION"),
|
|
5976
|
+
meterLocation: t("METER_LOCATION"),
|
|
5977
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
5978
|
+
workingStatus: t("WORKING_STATUS"),
|
|
5979
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
5980
|
+
septicTank: t("SEPTIC_TANK"),
|
|
5981
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
5982
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
5983
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
5984
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
5985
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
5986
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
5987
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
5988
|
+
pidNumber: t("PID_NUMBER"),
|
|
5989
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
5990
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
5991
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
5992
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
5993
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
5994
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
5995
|
+
floorNo: t("FLOOR_NO"),
|
|
5996
|
+
userType: t("USER_TYPE"),
|
|
5997
|
+
tenantName: t("TENANT_NAME"),
|
|
5998
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
5999
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
6000
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
6001
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
6002
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
6003
|
+
vendorId: t("VENDOR_ID"),
|
|
6004
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
6005
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
6006
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
6007
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
6008
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
6009
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
6010
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
6011
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
6012
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
6013
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
6014
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
6015
|
+
emailId: t("EMAIL_ID"),
|
|
6016
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
6017
|
+
dob: t("DOB"),
|
|
6018
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
6019
|
+
createdTime: t("CREATED_TIME"),
|
|
6020
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
6021
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
6022
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
6023
|
+
};
|
|
6024
|
+
const toTitleCase = str => {
|
|
6025
|
+
if (!str) return "";
|
|
6026
|
+
let cleanStr = String(str);
|
|
6027
|
+
if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
|
|
6028
|
+
cleanStr = cleanStr.split(".").pop();
|
|
6029
|
+
}
|
|
6030
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
6031
|
+
};
|
|
6032
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
6033
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
6034
|
+
const excelData = consumerList.map(item => {
|
|
6035
|
+
const cleanObj = {};
|
|
6036
|
+
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6037
|
+
if (fullName) {
|
|
6038
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6039
|
+
}
|
|
6040
|
+
Object.keys(item).forEach(key => {
|
|
6041
|
+
if (excludedKeys.includes(key)) return;
|
|
6042
|
+
let val = item[key];
|
|
6043
|
+
if (typeof val === "object" && val !== null) {
|
|
6044
|
+
return;
|
|
6045
|
+
}
|
|
6046
|
+
if (String(val).toLowerCase() === "true") {
|
|
6047
|
+
val = t("CS_YES");
|
|
6048
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
6049
|
+
val = t("CS_NO");
|
|
6050
|
+
}
|
|
6051
|
+
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6052
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
6053
|
+
cleanObj[friendlyHeader] = t(val);
|
|
6054
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
6055
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6056
|
+
} else {
|
|
6057
|
+
cleanObj[friendlyHeader] = val;
|
|
6058
|
+
}
|
|
6059
|
+
});
|
|
6060
|
+
return cleanObj;
|
|
6061
|
+
});
|
|
6062
|
+
const cleanFileName = "eKYC_Data_Supervisor_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
|
|
6063
|
+
Digit.Download.Excel(excelData, cleanFileName);
|
|
6064
|
+
});
|
|
5658
6065
|
}, function (error) {
|
|
5659
6066
|
console.error("Error downloading eKYC Excel:", error);
|
|
5660
6067
|
});
|
|
@@ -5667,6 +6074,34 @@ const SupervisorDetailsCard = () => {
|
|
|
5667
6074
|
return Promise.reject(e);
|
|
5668
6075
|
}
|
|
5669
6076
|
};
|
|
6077
|
+
const getDateRange = filter => {
|
|
6078
|
+
const now = new Date();
|
|
6079
|
+
const start = new Date(now);
|
|
6080
|
+
if (filter === "today") {
|
|
6081
|
+
start.setHours(0, 0, 0, 0);
|
|
6082
|
+
return {
|
|
6083
|
+
from: start,
|
|
6084
|
+
to: now
|
|
6085
|
+
};
|
|
6086
|
+
}
|
|
6087
|
+
if (filter === "week") {
|
|
6088
|
+
start.setDate(now.getDate() - now.getDay());
|
|
6089
|
+
start.setHours(0, 0, 0, 0);
|
|
6090
|
+
return {
|
|
6091
|
+
from: start,
|
|
6092
|
+
to: now
|
|
6093
|
+
};
|
|
6094
|
+
}
|
|
6095
|
+
if (filter === "month") {
|
|
6096
|
+
start.setDate(1);
|
|
6097
|
+
start.setHours(0, 0, 0, 0);
|
|
6098
|
+
return {
|
|
6099
|
+
from: start,
|
|
6100
|
+
to: now
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
return null;
|
|
6104
|
+
};
|
|
5670
6105
|
const StatCard = _ref3 => {
|
|
5671
6106
|
let title = _ref3.title,
|
|
5672
6107
|
value = _ref3.value,
|
|
@@ -5713,65 +6148,12 @@ const SupervisorDetailsCard = () => {
|
|
|
5713
6148
|
}, fullName), /*#__PURE__*/React.createElement("div", {
|
|
5714
6149
|
className: "designation"
|
|
5715
6150
|
}, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React.createElement("div", {
|
|
5716
|
-
className: "report-download"
|
|
5717
|
-
ref: reportMenuRef
|
|
6151
|
+
className: "report-download"
|
|
5718
6152
|
}, /*#__PURE__*/React.createElement("button", {
|
|
5719
6153
|
className: "download-btn",
|
|
5720
6154
|
disabled: reportLoading,
|
|
5721
|
-
onClick:
|
|
5722
|
-
|
|
5723
|
-
setShowCustomPicker(false);
|
|
5724
|
-
}
|
|
5725
|
-
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
5726
|
-
className: "report-menu"
|
|
5727
|
-
}, [{
|
|
5728
|
-
label: t("TODAY") || "Today",
|
|
5729
|
-
key: "today"
|
|
5730
|
-
}, {
|
|
5731
|
-
label: t("THIS_WEEK") || "This Week",
|
|
5732
|
-
key: "week"
|
|
5733
|
-
}, {
|
|
5734
|
-
label: t("THIS_MONTH") || "This Month",
|
|
5735
|
-
key: "month"
|
|
5736
|
-
}].map(_ref4 => {
|
|
5737
|
-
let label = _ref4.label,
|
|
5738
|
-
key = _ref4.key;
|
|
5739
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
5740
|
-
key: key,
|
|
5741
|
-
className: "menu-item",
|
|
5742
|
-
onClick: () => handlePresetDownload()
|
|
5743
|
-
}, label);
|
|
5744
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
5745
|
-
className: "custom-date-trigger",
|
|
5746
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
5747
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
5748
|
-
className: "custom-picker"
|
|
5749
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5750
|
-
className: "date-field"
|
|
5751
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
5752
|
-
className: "date-label"
|
|
5753
|
-
}, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
|
|
5754
|
-
type: "date",
|
|
5755
|
-
className: "date-input",
|
|
5756
|
-
value: customDate.from,
|
|
5757
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
5758
|
-
from: e.target.value
|
|
5759
|
-
}))
|
|
5760
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
5761
|
-
className: "date-field"
|
|
5762
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
5763
|
-
className: "date-label"
|
|
5764
|
-
}, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
|
|
5765
|
-
type: "date",
|
|
5766
|
-
className: "date-input",
|
|
5767
|
-
value: customDate.to,
|
|
5768
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
5769
|
-
to: e.target.value
|
|
5770
|
-
}))
|
|
5771
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
5772
|
-
className: "download-action-btn",
|
|
5773
|
-
onClick: handleCustomDownload
|
|
5774
|
-
}, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
|
|
6155
|
+
onClick: handleDownload
|
|
6156
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
5775
6157
|
className: "stats-wrapper"
|
|
5776
6158
|
}, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
|
|
5777
6159
|
key: idx,
|
|
@@ -5835,10 +6217,16 @@ const SupervisorDetailsCard = () => {
|
|
|
5835
6217
|
className: "details-right"
|
|
5836
6218
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5837
6219
|
className: "download-card"
|
|
5838
|
-
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("
|
|
6220
|
+
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
|
|
6221
|
+
className: "report-download",
|
|
6222
|
+
ref: reportMenuRef
|
|
6223
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5839
6224
|
className: "download-excel-btn",
|
|
5840
6225
|
disabled: ekycDownloadLoading,
|
|
5841
|
-
onClick:
|
|
6226
|
+
onClick: () => {
|
|
6227
|
+
setShowReportMenu(p => !p);
|
|
6228
|
+
setShowCustomPicker(false);
|
|
6229
|
+
}
|
|
5842
6230
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
5843
6231
|
width: "16",
|
|
5844
6232
|
height: "16",
|
|
@@ -5857,7 +6245,63 @@ const SupervisorDetailsCard = () => {
|
|
|
5857
6245
|
y1: "15",
|
|
5858
6246
|
x2: "12",
|
|
5859
6247
|
y2: "3"
|
|
5860
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")
|
|
6248
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
6249
|
+
className: "report-menu"
|
|
6250
|
+
}, [{
|
|
6251
|
+
label: t("TODAY") || "Today",
|
|
6252
|
+
key: "today"
|
|
6253
|
+
}, {
|
|
6254
|
+
label: t("THIS_WEEK") || "This Week",
|
|
6255
|
+
key: "week"
|
|
6256
|
+
}, {
|
|
6257
|
+
label: t("THIS_MONTH") || "This Month",
|
|
6258
|
+
key: "month"
|
|
6259
|
+
}].map(_ref4 => {
|
|
6260
|
+
let label = _ref4.label,
|
|
6261
|
+
key = _ref4.key;
|
|
6262
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6263
|
+
key: key,
|
|
6264
|
+
className: "menu-item",
|
|
6265
|
+
onClick: () => handlePresetDownload(key)
|
|
6266
|
+
}, label);
|
|
6267
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
6268
|
+
className: "custom-date-trigger",
|
|
6269
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
6270
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
6271
|
+
className: "custom-picker"
|
|
6272
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6273
|
+
className: "date-inputs"
|
|
6274
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
6275
|
+
type: "date",
|
|
6276
|
+
value: customDate.from,
|
|
6277
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
6278
|
+
from: e.target.value
|
|
6279
|
+
}))
|
|
6280
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
6281
|
+
type: "date",
|
|
6282
|
+
value: customDate.to,
|
|
6283
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
6284
|
+
to: e.target.value
|
|
6285
|
+
}))
|
|
6286
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
6287
|
+
style: {
|
|
6288
|
+
display: "flex",
|
|
6289
|
+
gap: "10px",
|
|
6290
|
+
marginTop: "10px"
|
|
6291
|
+
}
|
|
6292
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
6293
|
+
className: "picker-cancel-btn",
|
|
6294
|
+
onClick: () => {
|
|
6295
|
+
setShowCustomPicker(false);
|
|
6296
|
+
setCustomDate({
|
|
6297
|
+
from: "",
|
|
6298
|
+
to: ""
|
|
6299
|
+
});
|
|
6300
|
+
}
|
|
6301
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
6302
|
+
className: "picker-apply-btn",
|
|
6303
|
+
onClick: handleCustomDownload
|
|
6304
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
5861
6305
|
className: "dashboard-card"
|
|
5862
6306
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
5863
6307
|
t: t,
|
|
@@ -6399,7 +6843,7 @@ const AssignEkycModal = _ref => {
|
|
|
6399
6843
|
};
|
|
6400
6844
|
|
|
6401
6845
|
const SurveyorDetailsDashboard = () => {
|
|
6402
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$
|
|
6846
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner7, _surveyor$owner8, _surveyor$owner9, _dashboardData$dashbo5, _dashboardData$dashbo6;
|
|
6403
6847
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
6404
6848
|
const _useState = useState(null),
|
|
6405
6849
|
showModal = _useState[0],
|
|
@@ -6611,10 +7055,8 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6611
7055
|
}
|
|
6612
7056
|
return null;
|
|
6613
7057
|
};
|
|
6614
|
-
const
|
|
7058
|
+
const handleDownload = function () {
|
|
6615
7059
|
try {
|
|
6616
|
-
const range = getDateRange(filter);
|
|
6617
|
-
if (!range) return Promise.resolve();
|
|
6618
7060
|
setReportLoading(true);
|
|
6619
7061
|
const _temp = _finallyRethrows(function () {
|
|
6620
7062
|
return _catch(function () {
|
|
@@ -6623,9 +7065,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6623
7065
|
tenantId: "dl.djb",
|
|
6624
7066
|
offset: 0,
|
|
6625
7067
|
limit: 1000,
|
|
6626
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
|
|
6627
|
-
fromDate: range.from.getTime(),
|
|
6628
|
-
toDate: range.to.getTime()
|
|
7068
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
|
|
6629
7069
|
})).then(function (response) {
|
|
6630
7070
|
var _response$dashboardIn;
|
|
6631
7071
|
const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
|
|
@@ -6645,8 +7085,6 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6645
7085
|
});
|
|
6646
7086
|
}, function (_wasThrown, _result) {
|
|
6647
7087
|
setReportLoading(false);
|
|
6648
|
-
setShowReportMenu(false);
|
|
6649
|
-
setShowCustomPicker(false);
|
|
6650
7088
|
if (_wasThrown) throw _result;
|
|
6651
7089
|
return _result;
|
|
6652
7090
|
});
|
|
@@ -6655,52 +7093,30 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6655
7093
|
return Promise.reject(e);
|
|
6656
7094
|
}
|
|
6657
7095
|
};
|
|
6658
|
-
const
|
|
7096
|
+
const handlePresetDownload = function (filter) {
|
|
6659
7097
|
try {
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
downloadSurveyorPDF({
|
|
6683
|
-
rows: rows,
|
|
6684
|
-
surveyorName: fullName,
|
|
6685
|
-
vendorName,
|
|
6686
|
-
supervisorName,
|
|
6687
|
-
employeeId,
|
|
6688
|
-
mobileNumber,
|
|
6689
|
-
dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
|
|
6690
|
-
t
|
|
6691
|
-
});
|
|
6692
|
-
});
|
|
6693
|
-
}, function (err) {
|
|
6694
|
-
console.error("Failed to fetch custom dashboard data for report download:", err);
|
|
6695
|
-
});
|
|
6696
|
-
}, function (_wasThrown2, _result2) {
|
|
6697
|
-
setReportLoading(false);
|
|
6698
|
-
setShowReportMenu(false);
|
|
6699
|
-
setShowCustomPicker(false);
|
|
6700
|
-
if (_wasThrown2) throw _result2;
|
|
6701
|
-
return _result2;
|
|
6702
|
-
});
|
|
6703
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7098
|
+
const range = getDateRange(filter);
|
|
7099
|
+
if (!range) return Promise.resolve();
|
|
7100
|
+
setShowReportMenu(false);
|
|
7101
|
+
setShowCustomPicker(false);
|
|
7102
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
7103
|
+
} catch (e) {
|
|
7104
|
+
return Promise.reject(e);
|
|
7105
|
+
}
|
|
7106
|
+
};
|
|
7107
|
+
const handleCustomDownload = function () {
|
|
7108
|
+
try {
|
|
7109
|
+
if (!customDate.from || !customDate.to) {
|
|
7110
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
7111
|
+
return Promise.resolve();
|
|
7112
|
+
}
|
|
7113
|
+
const from = new Date(customDate.from);
|
|
7114
|
+
from.setHours(0, 0, 0, 0);
|
|
7115
|
+
const to = new Date(customDate.to);
|
|
7116
|
+
to.setHours(23, 59, 59, 999);
|
|
7117
|
+
setShowReportMenu(false);
|
|
7118
|
+
setShowCustomPicker(false);
|
|
7119
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
6704
7120
|
} catch (e) {
|
|
6705
7121
|
return Promise.reject(e);
|
|
6706
7122
|
}
|
|
@@ -6734,61 +7150,164 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6734
7150
|
setShowOptions(false);
|
|
6735
7151
|
setShowModal(option.action);
|
|
6736
7152
|
};
|
|
6737
|
-
const handleDownloadEkycData = function () {
|
|
7153
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
6738
7154
|
try {
|
|
6739
7155
|
setEkycDownloadLoading(true);
|
|
6740
7156
|
return Promise.resolve(_finallyRethrows(function () {
|
|
6741
7157
|
return _catch(function () {
|
|
6742
|
-
var _surveyor$
|
|
6743
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
7158
|
+
var _surveyor$owner6;
|
|
7159
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
6744
7160
|
tenantId: tenantId || "dl.djb",
|
|
6745
7161
|
offset: 0,
|
|
6746
7162
|
limit: 10000,
|
|
6747
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7163
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
|
|
6748
7164
|
reportDownload: true
|
|
6749
|
-
}
|
|
7165
|
+
}, fromDate && {
|
|
7166
|
+
fromDate
|
|
7167
|
+
}, toDate && {
|
|
7168
|
+
toDate
|
|
7169
|
+
}))).then(function (response) {
|
|
6750
7170
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
6751
7171
|
if (consumerList.length === 0) {
|
|
6752
7172
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
6753
7173
|
return;
|
|
6754
7174
|
}
|
|
6755
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
7175
|
+
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
|
|
6756
7176
|
const headerMapping = {
|
|
6757
|
-
kno: t("KNO")
|
|
6758
|
-
firstName: t("FIRST_NAME")
|
|
6759
|
-
middleName: t("MIDDLE_NAME")
|
|
6760
|
-
lastName: t("LAST_NAME")
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
7177
|
+
kno: t("KNO"),
|
|
7178
|
+
firstName: t("FIRST_NAME"),
|
|
7179
|
+
middleName: t("MIDDLE_NAME"),
|
|
7180
|
+
lastName: t("LAST_NAME"),
|
|
7181
|
+
status: t("STATUS"),
|
|
7182
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
7183
|
+
zoneName: t("ZONE"),
|
|
7184
|
+
zoneCode: t("ZONE_CODE"),
|
|
7185
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
7186
|
+
ward: t("WARD"),
|
|
7187
|
+
pincode: t("EKYC_PINCODE"),
|
|
7188
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
7189
|
+
locality: t("EKYC_LOCALITY"),
|
|
7190
|
+
subLocality: t("SUB_LOCALITY"),
|
|
7191
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
7192
|
+
streetName: t("STREET_NAME"),
|
|
7193
|
+
landmark: t("EKYC_LANDMARK"),
|
|
7194
|
+
city: t("CITY"),
|
|
7195
|
+
state: t("STATE"),
|
|
7196
|
+
addressType: t("ADDRESS_TYPE"),
|
|
7197
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
7198
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
7199
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
7200
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
7201
|
+
email: t("EMAIL"),
|
|
7202
|
+
landlineNo: t("LANDLINE_NO"),
|
|
7203
|
+
mrkey: t("MR_KEY"),
|
|
7204
|
+
mrcode: t("MR_CODE"),
|
|
7205
|
+
areacode: t("AREA_CODE"),
|
|
7206
|
+
source: t("SOURCE"),
|
|
7207
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
7208
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
7209
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
7210
|
+
Type: t("CONSUMER_TYPE"),
|
|
7211
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
7212
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
7213
|
+
approvedAt: t("APPROVED_AT"),
|
|
7214
|
+
gender: t("GENDER"),
|
|
7215
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
7216
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
7217
|
+
relationship: t("RELATIONSHIP"),
|
|
7218
|
+
informantName: t("INFORMANT_NAME"),
|
|
7219
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
7220
|
+
informantIs: t("INFORMANT_IS"),
|
|
7221
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
7222
|
+
relation: t("RELATION"),
|
|
7223
|
+
entityName: t("ENTITY_NAME"),
|
|
7224
|
+
designation: t("DESIGNATION"),
|
|
7225
|
+
department: t("DEPARTMENT"),
|
|
7226
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
7227
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
7228
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
7229
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
7230
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
7231
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
7232
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
7233
|
+
latitude: t("LATITUDE"),
|
|
7234
|
+
longitude: t("LONGITUDE"),
|
|
7235
|
+
gpsValid: t("GPS_VALID"),
|
|
7236
|
+
meterNumber: t("METER_NUMBER"),
|
|
7237
|
+
meterMake: t("METER_MAKE"),
|
|
7238
|
+
meterStatus: t("METER_STATUS"),
|
|
7239
|
+
meterCondition: t("METER_CONDITION"),
|
|
7240
|
+
meterLocation: t("METER_LOCATION"),
|
|
7241
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
7242
|
+
workingStatus: t("WORKING_STATUS"),
|
|
7243
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
7244
|
+
septicTank: t("SEPTIC_TANK"),
|
|
7245
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
7246
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
7247
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
7248
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
7249
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
7250
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
7251
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
7252
|
+
pidNumber: t("PID_NUMBER"),
|
|
7253
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
7254
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
7255
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
7256
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
7257
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
7258
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
7259
|
+
floorNo: t("FLOOR_NO"),
|
|
7260
|
+
userType: t("USER_TYPE"),
|
|
7261
|
+
tenantName: t("TENANT_NAME"),
|
|
7262
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
7263
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
7264
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
7265
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
7266
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
7267
|
+
vendorId: t("VENDOR_ID"),
|
|
7268
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
7269
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
7270
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
7271
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
7272
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
7273
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
7274
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
7275
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
7276
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
7277
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
7278
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
7279
|
+
emailId: t("EMAIL_ID"),
|
|
7280
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
7281
|
+
dob: t("DOB"),
|
|
7282
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
7283
|
+
createdTime: t("CREATED_TIME"),
|
|
7284
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
7285
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
7286
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
6776
7287
|
};
|
|
7288
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
7289
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
6777
7290
|
const excelData = consumerList.map(item => {
|
|
6778
7291
|
const cleanObj = {};
|
|
6779
7292
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6780
7293
|
if (fullName) {
|
|
6781
7294
|
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6782
7295
|
}
|
|
6783
|
-
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
6784
7296
|
Object.keys(item).forEach(key => {
|
|
6785
7297
|
if (excludedKeys.includes(key)) return;
|
|
6786
|
-
|
|
7298
|
+
let val = item[key];
|
|
6787
7299
|
if (typeof val === "object" && val !== null) {
|
|
6788
7300
|
return;
|
|
6789
7301
|
}
|
|
7302
|
+
if (String(val).toLowerCase() === "true") {
|
|
7303
|
+
val = t("CS_YES");
|
|
7304
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
7305
|
+
val = t("CS_NO");
|
|
7306
|
+
}
|
|
6790
7307
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6791
|
-
if (typeof val === "string" &&
|
|
7308
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
7309
|
+
cleanObj[friendlyHeader] = t(val);
|
|
7310
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
6792
7311
|
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6793
7312
|
} else {
|
|
6794
7313
|
cleanObj[friendlyHeader] = val;
|
|
@@ -6802,10 +7321,10 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6802
7321
|
}, function (error) {
|
|
6803
7322
|
console.error("Error downloading eKYC Excel:", error);
|
|
6804
7323
|
});
|
|
6805
|
-
}, function (
|
|
7324
|
+
}, function (_wasThrown2, _result2) {
|
|
6806
7325
|
setEkycDownloadLoading(false);
|
|
6807
|
-
if (
|
|
6808
|
-
return
|
|
7326
|
+
if (_wasThrown2) throw _result2;
|
|
7327
|
+
return _result2;
|
|
6809
7328
|
}));
|
|
6810
7329
|
} catch (e) {
|
|
6811
7330
|
return Promise.reject(e);
|
|
@@ -6834,65 +7353,12 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6834
7353
|
}, fullName), /*#__PURE__*/React.createElement("div", {
|
|
6835
7354
|
className: "designation"
|
|
6836
7355
|
}, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR")))), /*#__PURE__*/React.createElement("div", {
|
|
6837
|
-
className: "report-download"
|
|
6838
|
-
ref: reportMenuRef
|
|
7356
|
+
className: "report-download"
|
|
6839
7357
|
}, /*#__PURE__*/React.createElement("button", {
|
|
6840
7358
|
className: "download-btn",
|
|
6841
7359
|
disabled: reportLoading,
|
|
6842
|
-
onClick:
|
|
6843
|
-
|
|
6844
|
-
setShowCustomPicker(false);
|
|
6845
|
-
}
|
|
6846
|
-
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
6847
|
-
className: "report-menu"
|
|
6848
|
-
}, [{
|
|
6849
|
-
label: t("TODAY") || "Today",
|
|
6850
|
-
key: "today"
|
|
6851
|
-
}, {
|
|
6852
|
-
label: t("THIS_WEEK") || "This Week",
|
|
6853
|
-
key: "week"
|
|
6854
|
-
}, {
|
|
6855
|
-
label: t("THIS_MONTH") || "This Month",
|
|
6856
|
-
key: "month"
|
|
6857
|
-
}].map(_ref5 => {
|
|
6858
|
-
let label = _ref5.label,
|
|
6859
|
-
key = _ref5.key;
|
|
6860
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6861
|
-
key: key,
|
|
6862
|
-
className: "menu-item",
|
|
6863
|
-
onClick: () => handlePresetDownload(key)
|
|
6864
|
-
}, label);
|
|
6865
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
6866
|
-
className: "custom-date-trigger",
|
|
6867
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
6868
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
6869
|
-
className: "custom-picker"
|
|
6870
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
6871
|
-
className: "date-field"
|
|
6872
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
6873
|
-
className: "date-label"
|
|
6874
|
-
}, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
|
|
6875
|
-
type: "date",
|
|
6876
|
-
className: "date-input",
|
|
6877
|
-
value: customDate.from,
|
|
6878
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
6879
|
-
from: e.target.value
|
|
6880
|
-
}))
|
|
6881
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6882
|
-
className: "date-field"
|
|
6883
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
6884
|
-
className: "date-label"
|
|
6885
|
-
}, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
|
|
6886
|
-
type: "date",
|
|
6887
|
-
className: "date-input",
|
|
6888
|
-
value: customDate.to,
|
|
6889
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
6890
|
-
to: e.target.value
|
|
6891
|
-
}))
|
|
6892
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
6893
|
-
className: "download-action-btn",
|
|
6894
|
-
onClick: handleCustomDownload
|
|
6895
|
-
}, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
|
|
7360
|
+
onClick: handleDownload
|
|
7361
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
6896
7362
|
className: "stats-wrapper"
|
|
6897
7363
|
}, /*#__PURE__*/React.createElement(StatCard, {
|
|
6898
7364
|
title: t("TOTAL_ASSIGNED"),
|
|
@@ -6934,19 +7400,19 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6934
7400
|
className: "label"
|
|
6935
7401
|
}, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
|
|
6936
7402
|
className: "value"
|
|
6937
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7403
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A")), /*#__PURE__*/React.createElement("div", {
|
|
6938
7404
|
className: "detail-item"
|
|
6939
7405
|
}, /*#__PURE__*/React.createElement("span", {
|
|
6940
7406
|
className: "label"
|
|
6941
7407
|
}, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
|
|
6942
7408
|
className: "value"
|
|
6943
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7409
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner8 = surveyor.owner) === null || _surveyor$owner8 === void 0 ? void 0 : _surveyor$owner8.emailId) || "N/A")), /*#__PURE__*/React.createElement("div", {
|
|
6944
7410
|
className: "detail-item"
|
|
6945
7411
|
}, /*#__PURE__*/React.createElement("span", {
|
|
6946
7412
|
className: "label"
|
|
6947
7413
|
}, t("GENDER")), /*#__PURE__*/React.createElement("span", {
|
|
6948
7414
|
className: "value"
|
|
6949
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7415
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner9 = surveyor.owner) === null || _surveyor$owner9 === void 0 ? void 0 : _surveyor$owner9.gender) || "N/A")), /*#__PURE__*/React.createElement("div", {
|
|
6950
7416
|
className: "detail-item"
|
|
6951
7417
|
}, /*#__PURE__*/React.createElement("span", {
|
|
6952
7418
|
className: "label"
|
|
@@ -6968,10 +7434,16 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6968
7434
|
className: "details-right"
|
|
6969
7435
|
}, /*#__PURE__*/React.createElement("div", {
|
|
6970
7436
|
className: "download-card"
|
|
6971
|
-
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("
|
|
7437
|
+
}, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React.createElement("div", {
|
|
7438
|
+
className: "report-download",
|
|
7439
|
+
ref: reportMenuRef
|
|
7440
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
6972
7441
|
className: "download-excel-btn",
|
|
6973
7442
|
disabled: ekycDownloadLoading,
|
|
6974
|
-
onClick:
|
|
7443
|
+
onClick: () => {
|
|
7444
|
+
setShowReportMenu(p => !p);
|
|
7445
|
+
setShowCustomPicker(false);
|
|
7446
|
+
}
|
|
6975
7447
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
6976
7448
|
width: "16",
|
|
6977
7449
|
height: "16",
|
|
@@ -6990,7 +7462,63 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6990
7462
|
y1: "15",
|
|
6991
7463
|
x2: "12",
|
|
6992
7464
|
y2: "3"
|
|
6993
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")
|
|
7465
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
7466
|
+
className: "report-menu"
|
|
7467
|
+
}, [{
|
|
7468
|
+
label: t("TODAY") || "Today",
|
|
7469
|
+
key: "today"
|
|
7470
|
+
}, {
|
|
7471
|
+
label: t("THIS_WEEK") || "This Week",
|
|
7472
|
+
key: "week"
|
|
7473
|
+
}, {
|
|
7474
|
+
label: t("THIS_MONTH") || "This Month",
|
|
7475
|
+
key: "month"
|
|
7476
|
+
}].map(_ref5 => {
|
|
7477
|
+
let label = _ref5.label,
|
|
7478
|
+
key = _ref5.key;
|
|
7479
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7480
|
+
key: key,
|
|
7481
|
+
className: "menu-item",
|
|
7482
|
+
onClick: () => handlePresetDownload(key)
|
|
7483
|
+
}, label);
|
|
7484
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7485
|
+
className: "custom-date-trigger",
|
|
7486
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
7487
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
7488
|
+
className: "custom-picker"
|
|
7489
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7490
|
+
className: "date-inputs"
|
|
7491
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
7492
|
+
type: "date",
|
|
7493
|
+
value: customDate.from,
|
|
7494
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
7495
|
+
from: e.target.value
|
|
7496
|
+
}))
|
|
7497
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
7498
|
+
type: "date",
|
|
7499
|
+
value: customDate.to,
|
|
7500
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
7501
|
+
to: e.target.value
|
|
7502
|
+
}))
|
|
7503
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
7504
|
+
style: {
|
|
7505
|
+
display: "flex",
|
|
7506
|
+
gap: "10px",
|
|
7507
|
+
marginTop: "10px"
|
|
7508
|
+
}
|
|
7509
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7510
|
+
className: "picker-cancel-btn",
|
|
7511
|
+
onClick: () => {
|
|
7512
|
+
setShowCustomPicker(false);
|
|
7513
|
+
setCustomDate({
|
|
7514
|
+
from: "",
|
|
7515
|
+
to: ""
|
|
7516
|
+
});
|
|
7517
|
+
}
|
|
7518
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
7519
|
+
className: "picker-apply-btn",
|
|
7520
|
+
onClick: handleCustomDownload
|
|
7521
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
6994
7522
|
className: "dashboard-card"
|
|
6995
7523
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
6996
7524
|
t: t,
|