@djb25/digit-ui-module-ekyc 1.0.54 → 1.0.56
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 +802 -365
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +802 -365
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -223,7 +223,7 @@ const StatusCards = _ref => {
|
|
|
223
223
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
const excludedKeys = ["status", "source", "
|
|
226
|
+
const excludedKeys = ["status", "source", "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"];
|
|
227
227
|
const headerMapping = {
|
|
228
228
|
kno: t("KNO"),
|
|
229
229
|
firstName: t("FIRST_NAME"),
|
|
@@ -352,9 +352,16 @@ const StatusCards = _ref => {
|
|
|
352
352
|
if (name) {
|
|
353
353
|
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
|
|
354
354
|
}
|
|
355
|
-
Object.keys(item)
|
|
355
|
+
const keys = Object.keys(item);
|
|
356
|
+
const orderedKeys = [...keys.filter(key => key !== "submittedAt"), ...(keys.includes("submittedAt") ? ["submittedAt"] : [])];
|
|
357
|
+
orderedKeys.forEach(key => {
|
|
356
358
|
if (excludedKeys.includes(key)) return;
|
|
357
359
|
let val = item[key];
|
|
360
|
+
if (key === "submittedAt" && val) {
|
|
361
|
+
const date = new Date(Number(val));
|
|
362
|
+
const pad = n => String(n).padStart(2, "0");
|
|
363
|
+
val = pad(date.getDate()) + "/" + pad(date.getMonth() + 1) + "/" + date.getFullYear() + " " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds());
|
|
364
|
+
}
|
|
358
365
|
if (typeof val === "object" && val !== null) {
|
|
359
366
|
return;
|
|
360
367
|
}
|
|
@@ -2085,57 +2092,174 @@ const VendorDetailsCard = () => {
|
|
|
2085
2092
|
const _useState3 = useState(false),
|
|
2086
2093
|
ekycDownloadLoading = _useState3[0],
|
|
2087
2094
|
setEkycDownloadLoading = _useState3[1];
|
|
2088
|
-
const handleDownloadEkycData = function () {
|
|
2095
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
2089
2096
|
try {
|
|
2090
2097
|
setEkycDownloadLoading(true);
|
|
2091
2098
|
return Promise.resolve(_finallyRethrows(function () {
|
|
2092
2099
|
return _catch(function () {
|
|
2093
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
2100
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
2094
2101
|
tenantId: tenantId,
|
|
2095
2102
|
offset: 0,
|
|
2096
2103
|
limit: 10000,
|
|
2097
2104
|
reportDownload: true
|
|
2098
|
-
}
|
|
2105
|
+
}, fromDate && {
|
|
2106
|
+
fromDate
|
|
2107
|
+
}, toDate && {
|
|
2108
|
+
toDate
|
|
2109
|
+
}))).then(function (response) {
|
|
2099
2110
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
2100
2111
|
if (!consumerList || consumerList.length === 0) {
|
|
2101
2112
|
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
2102
2113
|
return;
|
|
2103
2114
|
}
|
|
2104
|
-
const excludedKeys = ["status", "source", "
|
|
2115
|
+
const excludedKeys = ["status", "source", "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
2116
|
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
|
-
|
|
2117
|
+
kno: t("KNO"),
|
|
2118
|
+
firstName: t("FIRST_NAME"),
|
|
2119
|
+
middleName: t("MIDDLE_NAME"),
|
|
2120
|
+
lastName: t("LAST_NAME"),
|
|
2121
|
+
status: t("STATUS"),
|
|
2122
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
2123
|
+
zoneName: t("ZONE"),
|
|
2124
|
+
zoneCode: t("ZONE_CODE"),
|
|
2125
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
2126
|
+
ward: t("WARD"),
|
|
2127
|
+
pincode: t("EKYC_PINCODE"),
|
|
2128
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
2129
|
+
locality: t("EKYC_LOCALITY"),
|
|
2130
|
+
subLocality: t("SUB_LOCALITY"),
|
|
2131
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
2132
|
+
streetName: t("STREET_NAME"),
|
|
2133
|
+
landmark: t("EKYC_LANDMARK"),
|
|
2134
|
+
city: t("CITY"),
|
|
2135
|
+
state: t("STATE"),
|
|
2136
|
+
addressType: t("ADDRESS_TYPE"),
|
|
2137
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
2138
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
2139
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
2140
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
2141
|
+
email: t("EMAIL"),
|
|
2142
|
+
landlineNo: t("LANDLINE_NO"),
|
|
2143
|
+
mrkey: t("MR_KEY"),
|
|
2144
|
+
mrcode: t("MR_CODE"),
|
|
2145
|
+
areacode: t("AREA_CODE"),
|
|
2146
|
+
source: t("SOURCE"),
|
|
2147
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
2148
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
2149
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
2150
|
+
Type: t("CONSUMER_TYPE"),
|
|
2151
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
2152
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
2153
|
+
approvedAt: t("APPROVED_AT"),
|
|
2154
|
+
gender: t("GENDER"),
|
|
2155
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
2156
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
2157
|
+
relationship: t("RELATIONSHIP"),
|
|
2158
|
+
informantName: t("INFORMANT_NAME"),
|
|
2159
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
2160
|
+
informantIs: t("INFORMANT_IS"),
|
|
2161
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
2162
|
+
relation: t("RELATION"),
|
|
2163
|
+
entityName: t("ENTITY_NAME"),
|
|
2164
|
+
designation: t("DESIGNATION"),
|
|
2165
|
+
department: t("DEPARTMENT"),
|
|
2166
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
2167
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
2168
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
2169
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
2170
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
2171
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
2172
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
2173
|
+
latitude: t("LATITUDE"),
|
|
2174
|
+
longitude: t("LONGITUDE"),
|
|
2175
|
+
gpsValid: t("GPS_VALID"),
|
|
2176
|
+
meterNumber: t("METER_NUMBER"),
|
|
2177
|
+
meterMake: t("METER_MAKE"),
|
|
2178
|
+
meterStatus: t("METER_STATUS"),
|
|
2179
|
+
meterCondition: t("METER_CONDITION"),
|
|
2180
|
+
meterLocation: t("METER_LOCATION"),
|
|
2181
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
2182
|
+
workingStatus: t("WORKING_STATUS"),
|
|
2183
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
2184
|
+
septicTank: t("SEPTIC_TANK"),
|
|
2185
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
2186
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
2187
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
2188
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
2189
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
2190
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
2191
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
2192
|
+
pidNumber: t("PID_NUMBER"),
|
|
2193
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
2194
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
2195
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
2196
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
2197
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
2198
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
2199
|
+
floorNo: t("FLOOR_NO"),
|
|
2200
|
+
userType: t("USER_TYPE"),
|
|
2201
|
+
tenantName: t("TENANT_NAME"),
|
|
2202
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
2203
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
2204
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
2205
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
2206
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
2207
|
+
vendorId: t("VENDOR_ID"),
|
|
2208
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
2209
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
2210
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
2211
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
2212
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
2213
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
2214
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
2215
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
2216
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
2217
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
2218
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
2219
|
+
emailId: t("EMAIL_ID"),
|
|
2220
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
2221
|
+
dob: t("DOB"),
|
|
2222
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
2223
|
+
createdTime: t("CREATED_TIME"),
|
|
2224
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
2225
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
2226
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
2227
|
+
};
|
|
2228
|
+
const toTitleCase = str => {
|
|
2229
|
+
if (!str) return "";
|
|
2230
|
+
let cleanStr = String(str);
|
|
2231
|
+
if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
|
|
2232
|
+
cleanStr = cleanStr.split(".").pop();
|
|
2233
|
+
}
|
|
2234
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
2124
2235
|
};
|
|
2236
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
2237
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
2125
2238
|
const excelData = consumerList.map(item => {
|
|
2126
2239
|
const cleanObj = {};
|
|
2127
2240
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
2128
2241
|
if (fullName) {
|
|
2129
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
2242
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
2130
2243
|
}
|
|
2131
2244
|
Object.keys(item).forEach(key => {
|
|
2132
2245
|
if (excludedKeys.includes(key)) return;
|
|
2133
|
-
|
|
2246
|
+
let val = item[key];
|
|
2134
2247
|
if (typeof val === "object" && val !== null) {
|
|
2135
2248
|
return;
|
|
2136
2249
|
}
|
|
2250
|
+
if (String(val).toLowerCase() === "true") {
|
|
2251
|
+
val = t("CS_YES");
|
|
2252
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
2253
|
+
val = t("CS_NO");
|
|
2254
|
+
}
|
|
2137
2255
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
2138
|
-
|
|
2256
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
2257
|
+
cleanObj[friendlyHeader] = t(val);
|
|
2258
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
2259
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
2260
|
+
} else {
|
|
2261
|
+
cleanObj[friendlyHeader] = val;
|
|
2262
|
+
}
|
|
2139
2263
|
});
|
|
2140
2264
|
return cleanObj;
|
|
2141
2265
|
});
|
|
@@ -2155,6 +2279,34 @@ const VendorDetailsCard = () => {
|
|
|
2155
2279
|
return Promise.reject(e);
|
|
2156
2280
|
}
|
|
2157
2281
|
};
|
|
2282
|
+
const getDateRange = filter => {
|
|
2283
|
+
const now = new Date();
|
|
2284
|
+
const start = new Date(now);
|
|
2285
|
+
if (filter === "today") {
|
|
2286
|
+
start.setHours(0, 0, 0, 0);
|
|
2287
|
+
return {
|
|
2288
|
+
from: start,
|
|
2289
|
+
to: now
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
if (filter === "week") {
|
|
2293
|
+
start.setDate(now.getDate() - now.getDay());
|
|
2294
|
+
start.setHours(0, 0, 0, 0);
|
|
2295
|
+
return {
|
|
2296
|
+
from: start,
|
|
2297
|
+
to: now
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
if (filter === "month") {
|
|
2301
|
+
start.setDate(1);
|
|
2302
|
+
start.setHours(0, 0, 0, 0);
|
|
2303
|
+
return {
|
|
2304
|
+
from: start,
|
|
2305
|
+
to: now
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
return null;
|
|
2309
|
+
};
|
|
2158
2310
|
const paginatedSupervisors = useMemo(() => {
|
|
2159
2311
|
const start = currentPage * pageSize;
|
|
2160
2312
|
const end = start + pageSize;
|
|
@@ -2269,19 +2421,35 @@ const VendorDetailsCard = () => {
|
|
|
2269
2421
|
console.error("Failed to generate report:", err);
|
|
2270
2422
|
} finally {
|
|
2271
2423
|
setReportLoading(false);
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
const handlePresetDownload = function (filter) {
|
|
2427
|
+
try {
|
|
2428
|
+
const range = getDateRange(filter);
|
|
2429
|
+
if (!range) return Promise.resolve();
|
|
2272
2430
|
setShowReportMenu(false);
|
|
2273
2431
|
setShowCustomPicker(false);
|
|
2432
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
2433
|
+
} catch (e) {
|
|
2434
|
+
return Promise.reject(e);
|
|
2274
2435
|
}
|
|
2275
2436
|
};
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2437
|
+
const handleCustomDownload = function () {
|
|
2438
|
+
try {
|
|
2439
|
+
if (!customDate.from || !customDate.to) {
|
|
2440
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
2441
|
+
return Promise.resolve();
|
|
2442
|
+
}
|
|
2443
|
+
const from = new Date(customDate.from);
|
|
2444
|
+
from.setHours(0, 0, 0, 0);
|
|
2445
|
+
const to = new Date(customDate.to);
|
|
2446
|
+
to.setHours(23, 59, 59, 999);
|
|
2447
|
+
setShowReportMenu(false);
|
|
2448
|
+
setShowCustomPicker(false);
|
|
2449
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
2450
|
+
} catch (e) {
|
|
2451
|
+
return Promise.reject(e);
|
|
2283
2452
|
}
|
|
2284
|
-
handleDownload();
|
|
2285
2453
|
};
|
|
2286
2454
|
const StatCard = _ref3 => {
|
|
2287
2455
|
let title = _ref3.title,
|
|
@@ -2329,65 +2497,12 @@ const VendorDetailsCard = () => {
|
|
|
2329
2497
|
}, vendorName), /*#__PURE__*/React.createElement("div", {
|
|
2330
2498
|
className: "designation"
|
|
2331
2499
|
}, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React.createElement("div", {
|
|
2332
|
-
className: "report-download"
|
|
2333
|
-
ref: reportMenuRef
|
|
2500
|
+
className: "report-download"
|
|
2334
2501
|
}, /*#__PURE__*/React.createElement("button", {
|
|
2335
2502
|
className: "download-btn",
|
|
2336
2503
|
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", {
|
|
2504
|
+
onClick: handleDownload
|
|
2505
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
2391
2506
|
className: "stats-wrapper"
|
|
2392
2507
|
}, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
|
|
2393
2508
|
key: idx,
|
|
@@ -2438,10 +2553,16 @@ const VendorDetailsCard = () => {
|
|
|
2438
2553
|
className: "details-right"
|
|
2439
2554
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2440
2555
|
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("
|
|
2556
|
+
}, /*#__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", {
|
|
2557
|
+
className: "report-download",
|
|
2558
|
+
ref: reportMenuRef
|
|
2559
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2442
2560
|
className: "download-excel-btn",
|
|
2443
2561
|
disabled: ekycDownloadLoading,
|
|
2444
|
-
onClick:
|
|
2562
|
+
onClick: () => {
|
|
2563
|
+
setShowReportMenu(p => !p);
|
|
2564
|
+
setShowCustomPicker(false);
|
|
2565
|
+
}
|
|
2445
2566
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
2446
2567
|
width: "16",
|
|
2447
2568
|
height: "16",
|
|
@@ -2460,19 +2581,75 @@ const VendorDetailsCard = () => {
|
|
|
2460
2581
|
y1: "15",
|
|
2461
2582
|
x2: "12",
|
|
2462
2583
|
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
|
-
|
|
2584
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
2585
|
+
className: "report-menu"
|
|
2586
|
+
}, [{
|
|
2587
|
+
label: t("TODAY") || "Today",
|
|
2588
|
+
key: "today"
|
|
2589
|
+
}, {
|
|
2590
|
+
label: t("THIS_WEEK") || "This Week",
|
|
2591
|
+
key: "week"
|
|
2592
|
+
}, {
|
|
2593
|
+
label: t("THIS_MONTH") || "This Month",
|
|
2594
|
+
key: "month"
|
|
2595
|
+
}].map(_ref4 => {
|
|
2596
|
+
let label = _ref4.label,
|
|
2597
|
+
key = _ref4.key;
|
|
2598
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2599
|
+
key: key,
|
|
2600
|
+
className: "menu-item",
|
|
2601
|
+
onClick: () => handlePresetDownload(key)
|
|
2602
|
+
}, label);
|
|
2603
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
2604
|
+
className: "custom-date-trigger",
|
|
2605
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
2606
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
2607
|
+
className: "custom-picker"
|
|
2608
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2609
|
+
className: "date-inputs"
|
|
2610
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
2611
|
+
type: "date",
|
|
2612
|
+
value: customDate.from,
|
|
2613
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
2614
|
+
from: e.target.value
|
|
2615
|
+
}))
|
|
2616
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
2617
|
+
type: "date",
|
|
2618
|
+
value: customDate.to,
|
|
2619
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
2620
|
+
to: e.target.value
|
|
2621
|
+
}))
|
|
2622
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
2623
|
+
style: {
|
|
2624
|
+
display: "flex",
|
|
2625
|
+
gap: "10px",
|
|
2626
|
+
marginTop: "10px"
|
|
2627
|
+
}
|
|
2628
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
2629
|
+
className: "picker-cancel-btn",
|
|
2630
|
+
onClick: () => {
|
|
2631
|
+
setShowCustomPicker(false);
|
|
2632
|
+
setCustomDate({
|
|
2633
|
+
from: "",
|
|
2634
|
+
to: ""
|
|
2635
|
+
});
|
|
2636
|
+
}
|
|
2637
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
2638
|
+
className: "picker-apply-btn",
|
|
2639
|
+
onClick: handleCustomDownload
|
|
2640
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
2641
|
+
className: "dashboard-card"
|
|
2642
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
2643
|
+
t: t,
|
|
2644
|
+
tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
|
|
2645
|
+
tableClass: "ekycTable",
|
|
2646
|
+
data: paginatedSupervisors,
|
|
2647
|
+
columns: supervisorColumns,
|
|
2648
|
+
isLoading: isPageLoading,
|
|
2649
|
+
totalRecords: vendorSupervisors.length,
|
|
2650
|
+
currentPage: currentPage,
|
|
2651
|
+
pageSizeLimit: pageSize,
|
|
2652
|
+
isPaginationRequired: true,
|
|
2476
2653
|
onNextPage: () => {
|
|
2477
2654
|
if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
|
|
2478
2655
|
setCurrentPage(prev => prev + 1);
|
|
@@ -3612,7 +3789,7 @@ const ReviewSection = _ref2 => {
|
|
|
3612
3789
|
})))));
|
|
3613
3790
|
};
|
|
3614
3791
|
const Review = () => {
|
|
3615
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8;
|
|
3792
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8, _Digit$UserService$ge, _supervisorData;
|
|
3616
3793
|
const _useTranslation = useTranslation(),
|
|
3617
3794
|
t = _useTranslation.t;
|
|
3618
3795
|
const history = useHistory();
|
|
@@ -3673,7 +3850,9 @@ const Review = () => {
|
|
|
3673
3850
|
isSearchLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
3674
3851
|
const userRoles = ((_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.map(ele => ele.code)) || [];
|
|
3675
3852
|
const isZRO = userRoles.includes("EKYC_ZRO") || userRoles.includes("ZRO");
|
|
3676
|
-
const isSupervisorOrSurveyorOrVendor = userRoles.includes("
|
|
3853
|
+
const isSupervisorOrSurveyorOrVendor = userRoles.includes("EKYC_SURVEYOR") || userRoles.includes("EKYC_VENDOR");
|
|
3854
|
+
const EKYC_ROLE_PRIORITY = ["EKYC_ZRO", "ZRO", "EKYC_SUPERVISOR", "EKYC_SURVEYOR", "EKYC_VENDOR"];
|
|
3855
|
+
const currentUserRole = EKYC_ROLE_PRIORITY.find(r => userRoles.includes(r)) || userRoles[0] || "EMPLOYEE";
|
|
3677
3856
|
const isStatusView = location.pathname.includes("/status/");
|
|
3678
3857
|
const hideEditButton = isSupervisorOrSurveyorOrVendor && !isZRO || isStatusView;
|
|
3679
3858
|
const _extractReviewData = extractReviewData(searchData, flowState),
|
|
@@ -4107,34 +4286,48 @@ const Review = () => {
|
|
|
4107
4286
|
label: "EKYC_METER_LONGITUDE1"
|
|
4108
4287
|
}];
|
|
4109
4288
|
const handleDeclaration = () => setAgree(!agree);
|
|
4289
|
+
const loggedInUserInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
4290
|
+
const matchedSupervisor = (_supervisorData = supervisorData) === null || _supervisorData === void 0 ? void 0 : _supervisorData.find(s => (s === null || s === void 0 ? void 0 : s.uuid) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid) || (s === null || s === void 0 ? void 0 : s.userName) === (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.userName));
|
|
4291
|
+
const supervisorId = (matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.uuid) || (loggedInUserInfo === null || loggedInUserInfo === void 0 ? void 0 : loggedInUserInfo.uuid);
|
|
4110
4292
|
const handleReject = function () {
|
|
4111
4293
|
try {
|
|
4112
|
-
var _Digit$UserService$
|
|
4294
|
+
var _Digit$UserService$ge2;
|
|
4113
4295
|
const payload = {
|
|
4114
4296
|
RequestInfo: {
|
|
4115
4297
|
apiId: "Rainmaker",
|
|
4116
4298
|
ver: "1.0",
|
|
4117
4299
|
msgId: "message-id",
|
|
4118
4300
|
tenantId: tenantId,
|
|
4119
|
-
authToken: (_Digit$UserService$
|
|
4301
|
+
authToken: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.access_token
|
|
4120
4302
|
},
|
|
4121
4303
|
kno: activeKno,
|
|
4122
4304
|
action: "REJECTED",
|
|
4123
4305
|
remarks: "Application rejected by reviewer",
|
|
4124
|
-
reviewedBy:
|
|
4125
|
-
role:
|
|
4306
|
+
reviewedBy: supervisorId,
|
|
4307
|
+
role: currentUserRole
|
|
4126
4308
|
};
|
|
4127
4309
|
const _temp = _catch(function () {
|
|
4128
4310
|
return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
|
|
4129
4311
|
if (result) {
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4312
|
+
setToastData({
|
|
4313
|
+
error: true,
|
|
4314
|
+
label: t("EKYC_APPLICATION_REJECT_SUCCESSFUL") || "Application Rejected Successfully"
|
|
4133
4315
|
});
|
|
4316
|
+
setShowToast(true);
|
|
4317
|
+
setTimeout(() => {
|
|
4318
|
+
history.push("/digit-ui/employee/ekyc/inbox");
|
|
4319
|
+
}, 2000);
|
|
4134
4320
|
}
|
|
4135
4321
|
});
|
|
4136
4322
|
}, function (err) {
|
|
4323
|
+
var _err$response, _err$response$data, _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2, _err$Errors, _err$Errors$;
|
|
4137
4324
|
console.error("Reject Error:", err);
|
|
4325
|
+
const errMsg = (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || (err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : (_err$response2$data$E = _err$response2$data.Errors) === null || _err$response2$data$E === void 0 ? void 0 : (_err$response2$data$E2 = _err$response2$data$E[0]) === null || _err$response2$data$E2 === void 0 ? void 0 : _err$response2$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors = err.Errors) === null || _err$Errors === void 0 ? void 0 : (_err$Errors$ = _err$Errors[0]) === null || _err$Errors$ === void 0 ? void 0 : _err$Errors$.message) || t("EKYC_REJECT_ERROR") || "Reject failed. Please try again.";
|
|
4326
|
+
setToastData({
|
|
4327
|
+
error: true,
|
|
4328
|
+
label: errMsg
|
|
4329
|
+
});
|
|
4330
|
+
setShowToast(true);
|
|
4138
4331
|
});
|
|
4139
4332
|
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
4140
4333
|
} catch (e) {
|
|
@@ -4143,20 +4336,20 @@ const Review = () => {
|
|
|
4143
4336
|
};
|
|
4144
4337
|
const handleApprove = function () {
|
|
4145
4338
|
try {
|
|
4146
|
-
var _Digit$UserService$
|
|
4339
|
+
var _Digit$UserService$ge3;
|
|
4147
4340
|
const payload = {
|
|
4148
4341
|
RequestInfo: {
|
|
4149
4342
|
apiId: "Rainmaker",
|
|
4150
4343
|
ver: "1.0",
|
|
4151
4344
|
msgId: "message-id",
|
|
4152
4345
|
tenantId: tenantId,
|
|
4153
|
-
authToken: (_Digit$UserService$
|
|
4346
|
+
authToken: (_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.access_token
|
|
4154
4347
|
},
|
|
4155
4348
|
kno: activeKno,
|
|
4156
4349
|
action: "APPROVED",
|
|
4157
4350
|
remarks: "All documents verified",
|
|
4158
|
-
reviewedBy:
|
|
4159
|
-
role:
|
|
4351
|
+
reviewedBy: supervisorId,
|
|
4352
|
+
role: currentUserRole
|
|
4160
4353
|
};
|
|
4161
4354
|
const _temp2 = _catch(function () {
|
|
4162
4355
|
return Promise.resolve(workflowMutation.mutateAsync(payload)).then(function (result) {
|
|
@@ -4172,11 +4365,12 @@ const Review = () => {
|
|
|
4172
4365
|
}
|
|
4173
4366
|
});
|
|
4174
4367
|
}, function (err) {
|
|
4175
|
-
var _err$
|
|
4368
|
+
var _err$response3, _err$response3$data, _err$response3$data$E, _err$response3$data$E2, _err$Errors2, _err$Errors2$;
|
|
4176
4369
|
console.error("Approve Error:", err);
|
|
4370
|
+
const errMsg = (err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : (_err$response3$data$E = _err$response3$data.Errors) === null || _err$response3$data$E === void 0 ? void 0 : (_err$response3$data$E2 = _err$response3$data$E[0]) === null || _err$response3$data$E2 === void 0 ? void 0 : _err$response3$data$E2.message) || (err === null || err === void 0 ? void 0 : (_err$Errors2 = err.Errors) === null || _err$Errors2 === void 0 ? void 0 : (_err$Errors2$ = _err$Errors2[0]) === null || _err$Errors2$ === void 0 ? void 0 : _err$Errors2$.message) || (err === null || err === void 0 ? void 0 : err.message) || t("EKYC_APPROVE_ERROR") || "Approve failed. Please try again.";
|
|
4177
4371
|
setToastData({
|
|
4178
4372
|
error: true,
|
|
4179
|
-
label:
|
|
4373
|
+
label: errMsg
|
|
4180
4374
|
});
|
|
4181
4375
|
setShowToast(true);
|
|
4182
4376
|
});
|
|
@@ -4206,9 +4400,9 @@ const Review = () => {
|
|
|
4206
4400
|
};
|
|
4207
4401
|
const handleMenuSelect = option => {
|
|
4208
4402
|
setShowOptions(false);
|
|
4209
|
-
if (option.action === t("
|
|
4403
|
+
if (option.action === t("APPROVE")) {
|
|
4210
4404
|
handleApprove();
|
|
4211
|
-
} else if (option.action === t("
|
|
4405
|
+
} else if (option.action === t("REJECT")) {
|
|
4212
4406
|
handleReject();
|
|
4213
4407
|
}
|
|
4214
4408
|
};
|
|
@@ -5684,21 +5878,37 @@ const SupervisorDetailsCard = () => {
|
|
|
5684
5878
|
console.error("Failed to generate supervisor report:", err);
|
|
5685
5879
|
} finally {
|
|
5686
5880
|
setReportLoading(false);
|
|
5881
|
+
}
|
|
5882
|
+
};
|
|
5883
|
+
const handlePresetDownload = function (filter) {
|
|
5884
|
+
try {
|
|
5885
|
+
const range = getDateRange(filter);
|
|
5886
|
+
if (!range) return Promise.resolve();
|
|
5687
5887
|
setShowReportMenu(false);
|
|
5688
5888
|
setShowCustomPicker(false);
|
|
5889
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
5890
|
+
} catch (e) {
|
|
5891
|
+
return Promise.reject(e);
|
|
5689
5892
|
}
|
|
5690
5893
|
};
|
|
5691
|
-
const
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5894
|
+
const handleCustomDownload = function () {
|
|
5895
|
+
try {
|
|
5896
|
+
if (!customDate.from || !customDate.to) {
|
|
5897
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
5898
|
+
return Promise.resolve();
|
|
5899
|
+
}
|
|
5900
|
+
const from = new Date(customDate.from);
|
|
5901
|
+
from.setHours(0, 0, 0, 0);
|
|
5902
|
+
const to = new Date(customDate.to);
|
|
5903
|
+
to.setHours(23, 59, 59, 999);
|
|
5904
|
+
setShowReportMenu(false);
|
|
5905
|
+
setShowCustomPicker(false);
|
|
5906
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
5907
|
+
} catch (e) {
|
|
5908
|
+
return Promise.reject(e);
|
|
5698
5909
|
}
|
|
5699
|
-
handleDownload();
|
|
5700
5910
|
};
|
|
5701
|
-
const handleDownloadEkycData = function () {
|
|
5911
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
5702
5912
|
try {
|
|
5703
5913
|
if (!surveyors || surveyors.length === 0) {
|
|
5704
5914
|
alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
|
|
@@ -5707,45 +5917,144 @@ const SupervisorDetailsCard = () => {
|
|
|
5707
5917
|
setEkycDownloadLoading(true);
|
|
5708
5918
|
return Promise.resolve(_finallyRethrows(function () {
|
|
5709
5919
|
return _catch(function () {
|
|
5710
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
5920
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
5711
5921
|
tenantId: tenantId || "dl.djb",
|
|
5712
5922
|
offset: 0,
|
|
5713
5923
|
limit: 10000,
|
|
5714
5924
|
reportDownload: true
|
|
5715
|
-
}
|
|
5925
|
+
}, fromDate && {
|
|
5926
|
+
fromDate
|
|
5927
|
+
}, toDate && {
|
|
5928
|
+
toDate
|
|
5929
|
+
}))).then(function (response) {
|
|
5716
5930
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
5717
5931
|
if (consumerList.length === 0) {
|
|
5718
5932
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
5719
5933
|
return;
|
|
5720
5934
|
}
|
|
5721
|
-
const excludedKeys = ["status", "source", "
|
|
5935
|
+
const excludedKeys = ["status", "source", "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"];
|
|
5722
5936
|
const headerMapping = {
|
|
5723
|
-
kno: t("KNO")
|
|
5724
|
-
firstName: t("FIRST_NAME")
|
|
5725
|
-
middleName: t("MIDDLE_NAME")
|
|
5726
|
-
lastName: t("LAST_NAME")
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5937
|
+
kno: t("KNO"),
|
|
5938
|
+
firstName: t("FIRST_NAME"),
|
|
5939
|
+
middleName: t("MIDDLE_NAME"),
|
|
5940
|
+
lastName: t("LAST_NAME"),
|
|
5941
|
+
status: t("STATUS"),
|
|
5942
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
5943
|
+
zoneName: t("ZONE"),
|
|
5944
|
+
zoneCode: t("ZONE_CODE"),
|
|
5945
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
5946
|
+
ward: t("WARD"),
|
|
5947
|
+
pincode: t("EKYC_PINCODE"),
|
|
5948
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
5949
|
+
locality: t("EKYC_LOCALITY"),
|
|
5950
|
+
subLocality: t("SUB_LOCALITY"),
|
|
5951
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
5952
|
+
streetName: t("STREET_NAME"),
|
|
5953
|
+
landmark: t("EKYC_LANDMARK"),
|
|
5954
|
+
city: t("CITY"),
|
|
5955
|
+
state: t("STATE"),
|
|
5956
|
+
addressType: t("ADDRESS_TYPE"),
|
|
5957
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
5958
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
5959
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
5960
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
5961
|
+
email: t("EMAIL"),
|
|
5962
|
+
landlineNo: t("LANDLINE_NO"),
|
|
5963
|
+
mrkey: t("MR_KEY"),
|
|
5964
|
+
mrcode: t("MR_CODE"),
|
|
5965
|
+
areacode: t("AREA_CODE"),
|
|
5966
|
+
source: t("SOURCE"),
|
|
5967
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
5968
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
5969
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
5970
|
+
Type: t("CONSUMER_TYPE"),
|
|
5971
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
5972
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
5973
|
+
approvedAt: t("APPROVED_AT"),
|
|
5974
|
+
gender: t("GENDER"),
|
|
5975
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
5976
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
5977
|
+
relationship: t("RELATIONSHIP"),
|
|
5978
|
+
informantName: t("INFORMANT_NAME"),
|
|
5979
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
5980
|
+
informantIs: t("INFORMANT_IS"),
|
|
5981
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
5982
|
+
relation: t("RELATION"),
|
|
5983
|
+
entityName: t("ENTITY_NAME"),
|
|
5984
|
+
designation: t("DESIGNATION"),
|
|
5985
|
+
department: t("DEPARTMENT"),
|
|
5986
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
5987
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
5988
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
5989
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
5990
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
5991
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
5992
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
5993
|
+
latitude: t("LATITUDE"),
|
|
5994
|
+
longitude: t("LONGITUDE"),
|
|
5995
|
+
gpsValid: t("GPS_VALID"),
|
|
5996
|
+
meterNumber: t("METER_NUMBER"),
|
|
5997
|
+
meterMake: t("METER_MAKE"),
|
|
5998
|
+
meterStatus: t("METER_STATUS"),
|
|
5999
|
+
meterCondition: t("METER_CONDITION"),
|
|
6000
|
+
meterLocation: t("METER_LOCATION"),
|
|
6001
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
6002
|
+
workingStatus: t("WORKING_STATUS"),
|
|
6003
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
6004
|
+
septicTank: t("SEPTIC_TANK"),
|
|
6005
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
6006
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
6007
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
6008
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
6009
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
6010
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
6011
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
6012
|
+
pidNumber: t("PID_NUMBER"),
|
|
6013
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
6014
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
6015
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
6016
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
6017
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
6018
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
6019
|
+
floorNo: t("FLOOR_NO"),
|
|
6020
|
+
userType: t("USER_TYPE"),
|
|
6021
|
+
tenantName: t("TENANT_NAME"),
|
|
6022
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
6023
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
6024
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
6025
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
6026
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
6027
|
+
vendorId: t("VENDOR_ID"),
|
|
6028
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
6029
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
6030
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
6031
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
6032
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
6033
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
6034
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
6035
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
6036
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
6037
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
6038
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
6039
|
+
emailId: t("EMAIL_ID"),
|
|
6040
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
6041
|
+
dob: t("DOB"),
|
|
6042
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
6043
|
+
createdTime: t("CREATED_TIME"),
|
|
6044
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
6045
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
6046
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
5742
6047
|
};
|
|
5743
6048
|
const toTitleCase = str => {
|
|
5744
6049
|
if (!str) return "";
|
|
5745
|
-
|
|
6050
|
+
let cleanStr = String(str);
|
|
6051
|
+
if (cleanStr.includes(".") && !cleanStr.includes("@") && isNaN(Number(cleanStr))) {
|
|
6052
|
+
cleanStr = cleanStr.split(".").pop();
|
|
6053
|
+
}
|
|
5746
6054
|
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
5747
6055
|
};
|
|
5748
|
-
const
|
|
6056
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
6057
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
5749
6058
|
const excelData = consumerList.map(item => {
|
|
5750
6059
|
const cleanObj = {};
|
|
5751
6060
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
@@ -5754,12 +6063,19 @@ const SupervisorDetailsCard = () => {
|
|
|
5754
6063
|
}
|
|
5755
6064
|
Object.keys(item).forEach(key => {
|
|
5756
6065
|
if (excludedKeys.includes(key)) return;
|
|
5757
|
-
|
|
6066
|
+
let val = item[key];
|
|
5758
6067
|
if (typeof val === "object" && val !== null) {
|
|
5759
6068
|
return;
|
|
5760
6069
|
}
|
|
6070
|
+
if (String(val).toLowerCase() === "true") {
|
|
6071
|
+
val = t("CS_YES");
|
|
6072
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
6073
|
+
val = t("CS_NO");
|
|
6074
|
+
}
|
|
5761
6075
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
5762
|
-
if (typeof val === "string" &&
|
|
6076
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
6077
|
+
cleanObj[friendlyHeader] = t(val);
|
|
6078
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
5763
6079
|
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
5764
6080
|
} else {
|
|
5765
6081
|
cleanObj[friendlyHeader] = val;
|
|
@@ -5782,6 +6098,34 @@ const SupervisorDetailsCard = () => {
|
|
|
5782
6098
|
return Promise.reject(e);
|
|
5783
6099
|
}
|
|
5784
6100
|
};
|
|
6101
|
+
const getDateRange = filter => {
|
|
6102
|
+
const now = new Date();
|
|
6103
|
+
const start = new Date(now);
|
|
6104
|
+
if (filter === "today") {
|
|
6105
|
+
start.setHours(0, 0, 0, 0);
|
|
6106
|
+
return {
|
|
6107
|
+
from: start,
|
|
6108
|
+
to: now
|
|
6109
|
+
};
|
|
6110
|
+
}
|
|
6111
|
+
if (filter === "week") {
|
|
6112
|
+
start.setDate(now.getDate() - now.getDay());
|
|
6113
|
+
start.setHours(0, 0, 0, 0);
|
|
6114
|
+
return {
|
|
6115
|
+
from: start,
|
|
6116
|
+
to: now
|
|
6117
|
+
};
|
|
6118
|
+
}
|
|
6119
|
+
if (filter === "month") {
|
|
6120
|
+
start.setDate(1);
|
|
6121
|
+
start.setHours(0, 0, 0, 0);
|
|
6122
|
+
return {
|
|
6123
|
+
from: start,
|
|
6124
|
+
to: now
|
|
6125
|
+
};
|
|
6126
|
+
}
|
|
6127
|
+
return null;
|
|
6128
|
+
};
|
|
5785
6129
|
const StatCard = _ref3 => {
|
|
5786
6130
|
let title = _ref3.title,
|
|
5787
6131
|
value = _ref3.value,
|
|
@@ -5828,65 +6172,12 @@ const SupervisorDetailsCard = () => {
|
|
|
5828
6172
|
}, fullName), /*#__PURE__*/React.createElement("div", {
|
|
5829
6173
|
className: "designation"
|
|
5830
6174
|
}, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React.createElement("div", {
|
|
5831
|
-
className: "report-download"
|
|
5832
|
-
ref: reportMenuRef
|
|
6175
|
+
className: "report-download"
|
|
5833
6176
|
}, /*#__PURE__*/React.createElement("button", {
|
|
5834
6177
|
className: "download-btn",
|
|
5835
6178
|
disabled: reportLoading,
|
|
5836
|
-
onClick:
|
|
5837
|
-
|
|
5838
|
-
setShowCustomPicker(false);
|
|
5839
|
-
}
|
|
5840
|
-
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
5841
|
-
className: "report-menu"
|
|
5842
|
-
}, [{
|
|
5843
|
-
label: t("TODAY") || "Today",
|
|
5844
|
-
key: "today"
|
|
5845
|
-
}, {
|
|
5846
|
-
label: t("THIS_WEEK") || "This Week",
|
|
5847
|
-
key: "week"
|
|
5848
|
-
}, {
|
|
5849
|
-
label: t("THIS_MONTH") || "This Month",
|
|
5850
|
-
key: "month"
|
|
5851
|
-
}].map(_ref4 => {
|
|
5852
|
-
let label = _ref4.label,
|
|
5853
|
-
key = _ref4.key;
|
|
5854
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
5855
|
-
key: key,
|
|
5856
|
-
className: "menu-item",
|
|
5857
|
-
onClick: () => handlePresetDownload()
|
|
5858
|
-
}, label);
|
|
5859
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
5860
|
-
className: "custom-date-trigger",
|
|
5861
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
5862
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
5863
|
-
className: "custom-picker"
|
|
5864
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
5865
|
-
className: "date-field"
|
|
5866
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
5867
|
-
className: "date-label"
|
|
5868
|
-
}, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
|
|
5869
|
-
type: "date",
|
|
5870
|
-
className: "date-input",
|
|
5871
|
-
value: customDate.from,
|
|
5872
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
5873
|
-
from: e.target.value
|
|
5874
|
-
}))
|
|
5875
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
5876
|
-
className: "date-field"
|
|
5877
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
5878
|
-
className: "date-label"
|
|
5879
|
-
}, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
|
|
5880
|
-
type: "date",
|
|
5881
|
-
className: "date-input",
|
|
5882
|
-
value: customDate.to,
|
|
5883
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
5884
|
-
to: e.target.value
|
|
5885
|
-
}))
|
|
5886
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
5887
|
-
className: "download-action-btn",
|
|
5888
|
-
onClick: handleCustomDownload
|
|
5889
|
-
}, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
|
|
6179
|
+
onClick: handleDownload
|
|
6180
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
5890
6181
|
className: "stats-wrapper"
|
|
5891
6182
|
}, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
|
|
5892
6183
|
key: idx,
|
|
@@ -5950,10 +6241,16 @@ const SupervisorDetailsCard = () => {
|
|
|
5950
6241
|
className: "details-right"
|
|
5951
6242
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5952
6243
|
className: "download-card"
|
|
5953
|
-
}, /*#__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("
|
|
6244
|
+
}, /*#__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", {
|
|
6245
|
+
className: "report-download",
|
|
6246
|
+
ref: reportMenuRef
|
|
6247
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
5954
6248
|
className: "download-excel-btn",
|
|
5955
6249
|
disabled: ekycDownloadLoading,
|
|
5956
|
-
onClick:
|
|
6250
|
+
onClick: () => {
|
|
6251
|
+
setShowReportMenu(p => !p);
|
|
6252
|
+
setShowCustomPicker(false);
|
|
6253
|
+
}
|
|
5957
6254
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
5958
6255
|
width: "16",
|
|
5959
6256
|
height: "16",
|
|
@@ -5972,7 +6269,63 @@ const SupervisorDetailsCard = () => {
|
|
|
5972
6269
|
y1: "15",
|
|
5973
6270
|
x2: "12",
|
|
5974
6271
|
y2: "3"
|
|
5975
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")
|
|
6272
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
6273
|
+
className: "report-menu"
|
|
6274
|
+
}, [{
|
|
6275
|
+
label: t("TODAY") || "Today",
|
|
6276
|
+
key: "today"
|
|
6277
|
+
}, {
|
|
6278
|
+
label: t("THIS_WEEK") || "This Week",
|
|
6279
|
+
key: "week"
|
|
6280
|
+
}, {
|
|
6281
|
+
label: t("THIS_MONTH") || "This Month",
|
|
6282
|
+
key: "month"
|
|
6283
|
+
}].map(_ref4 => {
|
|
6284
|
+
let label = _ref4.label,
|
|
6285
|
+
key = _ref4.key;
|
|
6286
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6287
|
+
key: key,
|
|
6288
|
+
className: "menu-item",
|
|
6289
|
+
onClick: () => handlePresetDownload(key)
|
|
6290
|
+
}, label);
|
|
6291
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
6292
|
+
className: "custom-date-trigger",
|
|
6293
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
6294
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
6295
|
+
className: "custom-picker"
|
|
6296
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6297
|
+
className: "date-inputs"
|
|
6298
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
6299
|
+
type: "date",
|
|
6300
|
+
value: customDate.from,
|
|
6301
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
6302
|
+
from: e.target.value
|
|
6303
|
+
}))
|
|
6304
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
6305
|
+
type: "date",
|
|
6306
|
+
value: customDate.to,
|
|
6307
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
6308
|
+
to: e.target.value
|
|
6309
|
+
}))
|
|
6310
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
6311
|
+
style: {
|
|
6312
|
+
display: "flex",
|
|
6313
|
+
gap: "10px",
|
|
6314
|
+
marginTop: "10px"
|
|
6315
|
+
}
|
|
6316
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
6317
|
+
className: "picker-cancel-btn",
|
|
6318
|
+
onClick: () => {
|
|
6319
|
+
setShowCustomPicker(false);
|
|
6320
|
+
setCustomDate({
|
|
6321
|
+
from: "",
|
|
6322
|
+
to: ""
|
|
6323
|
+
});
|
|
6324
|
+
}
|
|
6325
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
6326
|
+
className: "picker-apply-btn",
|
|
6327
|
+
onClick: handleCustomDownload
|
|
6328
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
5976
6329
|
className: "dashboard-card"
|
|
5977
6330
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
5978
6331
|
t: t,
|
|
@@ -6514,7 +6867,7 @@ const AssignEkycModal = _ref => {
|
|
|
6514
6867
|
};
|
|
6515
6868
|
|
|
6516
6869
|
const SurveyorDetailsDashboard = () => {
|
|
6517
|
-
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$
|
|
6870
|
+
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;
|
|
6518
6871
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
6519
6872
|
const _useState = useState(null),
|
|
6520
6873
|
showModal = _useState[0],
|
|
@@ -6726,10 +7079,8 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6726
7079
|
}
|
|
6727
7080
|
return null;
|
|
6728
7081
|
};
|
|
6729
|
-
const
|
|
7082
|
+
const handleDownload = function () {
|
|
6730
7083
|
try {
|
|
6731
|
-
const range = getDateRange(filter);
|
|
6732
|
-
if (!range) return Promise.resolve();
|
|
6733
7084
|
setReportLoading(true);
|
|
6734
7085
|
const _temp = _finallyRethrows(function () {
|
|
6735
7086
|
return _catch(function () {
|
|
@@ -6738,9 +7089,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6738
7089
|
tenantId: "dl.djb",
|
|
6739
7090
|
offset: 0,
|
|
6740
7091
|
limit: 1000,
|
|
6741
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
|
|
6742
|
-
fromDate: range.from.getTime(),
|
|
6743
|
-
toDate: range.to.getTime()
|
|
7092
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
|
|
6744
7093
|
})).then(function (response) {
|
|
6745
7094
|
var _response$dashboardIn;
|
|
6746
7095
|
const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
|
|
@@ -6760,8 +7109,6 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6760
7109
|
});
|
|
6761
7110
|
}, function (_wasThrown, _result) {
|
|
6762
7111
|
setReportLoading(false);
|
|
6763
|
-
setShowReportMenu(false);
|
|
6764
|
-
setShowCustomPicker(false);
|
|
6765
7112
|
if (_wasThrown) throw _result;
|
|
6766
7113
|
return _result;
|
|
6767
7114
|
});
|
|
@@ -6770,52 +7117,30 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6770
7117
|
return Promise.reject(e);
|
|
6771
7118
|
}
|
|
6772
7119
|
};
|
|
6773
|
-
const
|
|
7120
|
+
const handlePresetDownload = function (filter) {
|
|
6774
7121
|
try {
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
downloadSurveyorPDF({
|
|
6798
|
-
rows: rows,
|
|
6799
|
-
surveyorName: fullName,
|
|
6800
|
-
vendorName,
|
|
6801
|
-
supervisorName,
|
|
6802
|
-
employeeId,
|
|
6803
|
-
mobileNumber,
|
|
6804
|
-
dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
|
|
6805
|
-
t
|
|
6806
|
-
});
|
|
6807
|
-
});
|
|
6808
|
-
}, function (err) {
|
|
6809
|
-
console.error("Failed to fetch custom dashboard data for report download:", err);
|
|
6810
|
-
});
|
|
6811
|
-
}, function (_wasThrown2, _result2) {
|
|
6812
|
-
setReportLoading(false);
|
|
6813
|
-
setShowReportMenu(false);
|
|
6814
|
-
setShowCustomPicker(false);
|
|
6815
|
-
if (_wasThrown2) throw _result2;
|
|
6816
|
-
return _result2;
|
|
6817
|
-
});
|
|
6818
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7122
|
+
const range = getDateRange(filter);
|
|
7123
|
+
if (!range) return Promise.resolve();
|
|
7124
|
+
setShowReportMenu(false);
|
|
7125
|
+
setShowCustomPicker(false);
|
|
7126
|
+
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
7127
|
+
} catch (e) {
|
|
7128
|
+
return Promise.reject(e);
|
|
7129
|
+
}
|
|
7130
|
+
};
|
|
7131
|
+
const handleCustomDownload = function () {
|
|
7132
|
+
try {
|
|
7133
|
+
if (!customDate.from || !customDate.to) {
|
|
7134
|
+
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
7135
|
+
return Promise.resolve();
|
|
7136
|
+
}
|
|
7137
|
+
const from = new Date(customDate.from);
|
|
7138
|
+
from.setHours(0, 0, 0, 0);
|
|
7139
|
+
const to = new Date(customDate.to);
|
|
7140
|
+
to.setHours(23, 59, 59, 999);
|
|
7141
|
+
setShowReportMenu(false);
|
|
7142
|
+
setShowCustomPicker(false);
|
|
7143
|
+
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
6819
7144
|
} catch (e) {
|
|
6820
7145
|
return Promise.reject(e);
|
|
6821
7146
|
}
|
|
@@ -6849,61 +7174,164 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6849
7174
|
setShowOptions(false);
|
|
6850
7175
|
setShowModal(option.action);
|
|
6851
7176
|
};
|
|
6852
|
-
const handleDownloadEkycData = function () {
|
|
7177
|
+
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
6853
7178
|
try {
|
|
6854
7179
|
setEkycDownloadLoading(true);
|
|
6855
7180
|
return Promise.resolve(_finallyRethrows(function () {
|
|
6856
7181
|
return _catch(function () {
|
|
6857
|
-
var _surveyor$
|
|
6858
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
7182
|
+
var _surveyor$owner6;
|
|
7183
|
+
return Promise.resolve(Digit.EkycService.application_list(_extends({
|
|
6859
7184
|
tenantId: tenantId || "dl.djb",
|
|
6860
7185
|
offset: 0,
|
|
6861
7186
|
limit: 10000,
|
|
6862
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7187
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
|
|
6863
7188
|
reportDownload: true
|
|
6864
|
-
}
|
|
7189
|
+
}, fromDate && {
|
|
7190
|
+
fromDate
|
|
7191
|
+
}, toDate && {
|
|
7192
|
+
toDate
|
|
7193
|
+
}))).then(function (response) {
|
|
6865
7194
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
6866
7195
|
if (consumerList.length === 0) {
|
|
6867
7196
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
6868
7197
|
return;
|
|
6869
7198
|
}
|
|
6870
|
-
const excludedKeys = ["status", "source", "
|
|
7199
|
+
const excludedKeys = ["status", "source", "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"];
|
|
6871
7200
|
const headerMapping = {
|
|
6872
|
-
kno: t("KNO")
|
|
6873
|
-
firstName: t("FIRST_NAME")
|
|
6874
|
-
middleName: t("MIDDLE_NAME")
|
|
6875
|
-
lastName: t("LAST_NAME")
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
7201
|
+
kno: t("KNO"),
|
|
7202
|
+
firstName: t("FIRST_NAME"),
|
|
7203
|
+
middleName: t("MIDDLE_NAME"),
|
|
7204
|
+
lastName: t("LAST_NAME"),
|
|
7205
|
+
status: t("STATUS"),
|
|
7206
|
+
ekycStatus: t("EKYC_STATUS"),
|
|
7207
|
+
zoneName: t("ZONE"),
|
|
7208
|
+
zoneCode: t("ZONE_CODE"),
|
|
7209
|
+
assembly: t("EKYC_ASSEMBLY"),
|
|
7210
|
+
ward: t("WARD"),
|
|
7211
|
+
pincode: t("EKYC_PINCODE"),
|
|
7212
|
+
addressRaw: t("ADDRESS_RAW"),
|
|
7213
|
+
locality: t("EKYC_LOCALITY"),
|
|
7214
|
+
subLocality: t("SUB_LOCALITY"),
|
|
7215
|
+
flatHouseNumber: t("FLAT_HOUSE_NUMBER"),
|
|
7216
|
+
streetName: t("STREET_NAME"),
|
|
7217
|
+
landmark: t("EKYC_LANDMARK"),
|
|
7218
|
+
city: t("CITY"),
|
|
7219
|
+
state: t("STATE"),
|
|
7220
|
+
addressType: t("ADDRESS_TYPE"),
|
|
7221
|
+
addressProofType: t("ADDRESS_PROOF_TYPE"),
|
|
7222
|
+
mobileNo: t("MOBILE_NUMBER"),
|
|
7223
|
+
alternateMobileNo: t("ALTERNATE_MOBILE_NUMBER"),
|
|
7224
|
+
whatsappNo: t("WHATSAPP_NO"),
|
|
7225
|
+
email: t("EMAIL"),
|
|
7226
|
+
landlineNo: t("LANDLINE_NO"),
|
|
7227
|
+
mrkey: t("MR_KEY"),
|
|
7228
|
+
mrcode: t("MR_CODE"),
|
|
7229
|
+
areacode: t("AREA_CODE"),
|
|
7230
|
+
source: t("SOURCE"),
|
|
7231
|
+
submittedAt: t("SUBMITTED_AT"),
|
|
7232
|
+
assignedAt: t("ASSIGNED_AT"),
|
|
7233
|
+
connectionType: t("CONNECTION_TYPE"),
|
|
7234
|
+
Type: t("CONSUMER_TYPE"),
|
|
7235
|
+
occupantType: t("OCCUPANT_TYPE"),
|
|
7236
|
+
knoCategory: t("KNO_CATEGORY"),
|
|
7237
|
+
approvedAt: t("APPROVED_AT"),
|
|
7238
|
+
gender: t("GENDER"),
|
|
7239
|
+
parentSpouse: t("PARENT_SPOUSE"),
|
|
7240
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
7241
|
+
relationship: t("RELATIONSHIP"),
|
|
7242
|
+
informantName: t("INFORMANT_NAME"),
|
|
7243
|
+
informantRelation: t("INFORMANT_RELATION"),
|
|
7244
|
+
informantIs: t("INFORMANT_IS"),
|
|
7245
|
+
contactPerson: t("CONTACT_PERSON"),
|
|
7246
|
+
relation: t("RELATION"),
|
|
7247
|
+
entityName: t("ENTITY_NAME"),
|
|
7248
|
+
designation: t("DESIGNATION"),
|
|
7249
|
+
department: t("DEPARTMENT"),
|
|
7250
|
+
employeeId: t("EMPLOYEE_ID"),
|
|
7251
|
+
ownerMobile: t("OWNER_MOBILE"),
|
|
7252
|
+
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
7253
|
+
consentGiven: t("CONSENT_GIVEN"),
|
|
7254
|
+
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
7255
|
+
documentNumber: t("DOCUMENT_NUMBER"),
|
|
7256
|
+
noOfPerson: t("NUMBER_OF_PERSON"),
|
|
7257
|
+
latitude: t("LATITUDE"),
|
|
7258
|
+
longitude: t("LONGITUDE"),
|
|
7259
|
+
gpsValid: t("GPS_VALID"),
|
|
7260
|
+
meterNumber: t("METER_NUMBER"),
|
|
7261
|
+
meterMake: t("METER_MAKE"),
|
|
7262
|
+
meterStatus: t("METER_STATUS"),
|
|
7263
|
+
meterCondition: t("METER_CONDITION"),
|
|
7264
|
+
meterLocation: t("METER_LOCATION"),
|
|
7265
|
+
meterLocationAddress: t("METER_LOCATION_ADDRESS"),
|
|
7266
|
+
workingStatus: t("WORKING_STATUS"),
|
|
7267
|
+
sewerConnection: t("SEWER_CONNECTION"),
|
|
7268
|
+
septicTank: t("SEPTIC_TANK"),
|
|
7269
|
+
lastBillRaised: t("LAST_BILL_RAISED"),
|
|
7270
|
+
lastBillReceivedDate: t("LAST_BILL_RECEIVED_DATE"),
|
|
7271
|
+
accessToMeter: t("ACCESS_TO_METER"),
|
|
7272
|
+
systemMeterId: t("SYSTEM_METER_ID"),
|
|
7273
|
+
lastBillNotRaisedReason: t("LAST_BILL_NOT_RAISED_REASON"),
|
|
7274
|
+
waterConnectionYears: t("WATER_CONNECTION_YEARS"),
|
|
7275
|
+
sewerConnectionYears: t("SEWER_CONNECTION_YEARS"),
|
|
7276
|
+
pidNumber: t("PID_NUMBER"),
|
|
7277
|
+
propertyType: t("PROPERTY_TYPE"),
|
|
7278
|
+
subPropertyCategory: t("SUB_PROPERTY_CATEGORY"),
|
|
7279
|
+
noOfFloor: t("NO_OF_FLOOR"),
|
|
7280
|
+
noOfRooms: t("NO_OF_ROOMS"),
|
|
7281
|
+
noOfBeds: t("NO_OF_BEDS"),
|
|
7282
|
+
numberOfDwellingUnits: t("NUMBER_OF_DWELLING_UNITS"),
|
|
7283
|
+
floorNo: t("FLOOR_NO"),
|
|
7284
|
+
userType: t("USER_TYPE"),
|
|
7285
|
+
tenantName: t("TENANT_NAME"),
|
|
7286
|
+
tenantMobile: t("TENANT_MOBILE"),
|
|
7287
|
+
verificationStatus: t("VERIFICATION_STATUS"),
|
|
7288
|
+
houseBuiltDuration: t("HOUSE_BUILT_DURATION"),
|
|
7289
|
+
surveyorId: t("SURVEYOR_ID"),
|
|
7290
|
+
supervisorId: t("SUPERVISOR_ID"),
|
|
7291
|
+
vendorId: t("VENDOR_ID"),
|
|
7292
|
+
assignmentType: t("ASSIGNMENT_TYPE"),
|
|
7293
|
+
assignmentValue: t("ASSIGNMENT_VALUE"),
|
|
7294
|
+
assignedTime: t("ASSIGNED_TIME"),
|
|
7295
|
+
isSelfAssigned: t("IS_SELF_ASSIGNED"),
|
|
7296
|
+
doorPhotoFilestoreId: t("DOOR_PHOTO_FILESTORE_ID"),
|
|
7297
|
+
panFilestoreId: t("PAN_FILESTORE_ID"),
|
|
7298
|
+
documentProofFilestoreId: t("DOCUMENT_PROOF_FILESTORE_ID"),
|
|
7299
|
+
buildingImageFileStoreId: t("BUILDING_IMAGE_FILESTORE_ID"),
|
|
7300
|
+
propertyDocumentFileStoreId: t("PROPERTY_DOCUMENT_FILESTORE_ID"),
|
|
7301
|
+
meterPhotoFileStoreId: t("METER_PHOTO_FILESTORE_ID"),
|
|
7302
|
+
modifiedBy: t("MODIFIED_BY"),
|
|
7303
|
+
emailId: t("EMAIL_ID"),
|
|
7304
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME"),
|
|
7305
|
+
dob: t("DOB"),
|
|
7306
|
+
consumerType: t("CONSUMER_TYPE"),
|
|
7307
|
+
createdTime: t("CREATED_TIME"),
|
|
7308
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME"),
|
|
7309
|
+
meterLatitude: t("EKYC_METER_LATITUDE1"),
|
|
7310
|
+
meterLongitude: t("EKYC_METER_LONGITUDE1")
|
|
6891
7311
|
};
|
|
7312
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "email", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime", "meterLatitude", "meterLongitude"];
|
|
7313
|
+
const translatedFields = ["meterMake", "meterLocation"];
|
|
6892
7314
|
const excelData = consumerList.map(item => {
|
|
6893
7315
|
const cleanObj = {};
|
|
6894
7316
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6895
7317
|
if (fullName) {
|
|
6896
7318
|
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6897
7319
|
}
|
|
6898
|
-
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
6899
7320
|
Object.keys(item).forEach(key => {
|
|
6900
7321
|
if (excludedKeys.includes(key)) return;
|
|
6901
|
-
|
|
7322
|
+
let val = item[key];
|
|
6902
7323
|
if (typeof val === "object" && val !== null) {
|
|
6903
7324
|
return;
|
|
6904
7325
|
}
|
|
7326
|
+
if (String(val).toLowerCase() === "true") {
|
|
7327
|
+
val = t("CS_YES");
|
|
7328
|
+
} else if (String(val).toLowerCase() === "false") {
|
|
7329
|
+
val = t("CS_NO");
|
|
7330
|
+
}
|
|
6905
7331
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6906
|
-
if (typeof val === "string" &&
|
|
7332
|
+
if (typeof val === "string" && translatedFields.includes(key)) {
|
|
7333
|
+
cleanObj[friendlyHeader] = t(val);
|
|
7334
|
+
} else if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
6907
7335
|
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6908
7336
|
} else {
|
|
6909
7337
|
cleanObj[friendlyHeader] = val;
|
|
@@ -6917,10 +7345,10 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6917
7345
|
}, function (error) {
|
|
6918
7346
|
console.error("Error downloading eKYC Excel:", error);
|
|
6919
7347
|
});
|
|
6920
|
-
}, function (
|
|
7348
|
+
}, function (_wasThrown2, _result2) {
|
|
6921
7349
|
setEkycDownloadLoading(false);
|
|
6922
|
-
if (
|
|
6923
|
-
return
|
|
7350
|
+
if (_wasThrown2) throw _result2;
|
|
7351
|
+
return _result2;
|
|
6924
7352
|
}));
|
|
6925
7353
|
} catch (e) {
|
|
6926
7354
|
return Promise.reject(e);
|
|
@@ -6949,65 +7377,12 @@ const SurveyorDetailsDashboard = () => {
|
|
|
6949
7377
|
}, fullName), /*#__PURE__*/React.createElement("div", {
|
|
6950
7378
|
className: "designation"
|
|
6951
7379
|
}, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR")))), /*#__PURE__*/React.createElement("div", {
|
|
6952
|
-
className: "report-download"
|
|
6953
|
-
ref: reportMenuRef
|
|
7380
|
+
className: "report-download"
|
|
6954
7381
|
}, /*#__PURE__*/React.createElement("button", {
|
|
6955
7382
|
className: "download-btn",
|
|
6956
7383
|
disabled: reportLoading,
|
|
6957
|
-
onClick:
|
|
6958
|
-
|
|
6959
|
-
setShowCustomPicker(false);
|
|
6960
|
-
}
|
|
6961
|
-
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
6962
|
-
className: "report-menu"
|
|
6963
|
-
}, [{
|
|
6964
|
-
label: t("TODAY") || "Today",
|
|
6965
|
-
key: "today"
|
|
6966
|
-
}, {
|
|
6967
|
-
label: t("THIS_WEEK") || "This Week",
|
|
6968
|
-
key: "week"
|
|
6969
|
-
}, {
|
|
6970
|
-
label: t("THIS_MONTH") || "This Month",
|
|
6971
|
-
key: "month"
|
|
6972
|
-
}].map(_ref5 => {
|
|
6973
|
-
let label = _ref5.label,
|
|
6974
|
-
key = _ref5.key;
|
|
6975
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6976
|
-
key: key,
|
|
6977
|
-
className: "menu-item",
|
|
6978
|
-
onClick: () => handlePresetDownload(key)
|
|
6979
|
-
}, label);
|
|
6980
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
6981
|
-
className: "custom-date-trigger",
|
|
6982
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
6983
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
6984
|
-
className: "custom-picker"
|
|
6985
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
6986
|
-
className: "date-field"
|
|
6987
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
6988
|
-
className: "date-label"
|
|
6989
|
-
}, t("FROM_DATE") || "From"), /*#__PURE__*/React.createElement("input", {
|
|
6990
|
-
type: "date",
|
|
6991
|
-
className: "date-input",
|
|
6992
|
-
value: customDate.from,
|
|
6993
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
6994
|
-
from: e.target.value
|
|
6995
|
-
}))
|
|
6996
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6997
|
-
className: "date-field"
|
|
6998
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
6999
|
-
className: "date-label"
|
|
7000
|
-
}, t("TO_DATE") || "To"), /*#__PURE__*/React.createElement("input", {
|
|
7001
|
-
type: "date",
|
|
7002
|
-
className: "date-input",
|
|
7003
|
-
value: customDate.to,
|
|
7004
|
-
onChange: e => setCustomDate(d => _extends({}, d, {
|
|
7005
|
-
to: e.target.value
|
|
7006
|
-
}))
|
|
7007
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
7008
|
-
className: "download-action-btn",
|
|
7009
|
-
onClick: handleCustomDownload
|
|
7010
|
-
}, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React.createElement("div", {
|
|
7384
|
+
onClick: handleDownload
|
|
7385
|
+
}, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
|
|
7011
7386
|
className: "stats-wrapper"
|
|
7012
7387
|
}, /*#__PURE__*/React.createElement(StatCard, {
|
|
7013
7388
|
title: t("TOTAL_ASSIGNED"),
|
|
@@ -7049,19 +7424,19 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7049
7424
|
className: "label"
|
|
7050
7425
|
}, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
|
|
7051
7426
|
className: "value"
|
|
7052
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7427
|
+
}, (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", {
|
|
7053
7428
|
className: "detail-item"
|
|
7054
7429
|
}, /*#__PURE__*/React.createElement("span", {
|
|
7055
7430
|
className: "label"
|
|
7056
7431
|
}, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
|
|
7057
7432
|
className: "value"
|
|
7058
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7433
|
+
}, (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", {
|
|
7059
7434
|
className: "detail-item"
|
|
7060
7435
|
}, /*#__PURE__*/React.createElement("span", {
|
|
7061
7436
|
className: "label"
|
|
7062
7437
|
}, t("GENDER")), /*#__PURE__*/React.createElement("span", {
|
|
7063
7438
|
className: "value"
|
|
7064
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
7439
|
+
}, (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", {
|
|
7065
7440
|
className: "detail-item"
|
|
7066
7441
|
}, /*#__PURE__*/React.createElement("span", {
|
|
7067
7442
|
className: "label"
|
|
@@ -7083,10 +7458,16 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7083
7458
|
className: "details-right"
|
|
7084
7459
|
}, /*#__PURE__*/React.createElement("div", {
|
|
7085
7460
|
className: "download-card"
|
|
7086
|
-
}, /*#__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("
|
|
7461
|
+
}, /*#__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", {
|
|
7462
|
+
className: "report-download",
|
|
7463
|
+
ref: reportMenuRef
|
|
7464
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7087
7465
|
className: "download-excel-btn",
|
|
7088
7466
|
disabled: ekycDownloadLoading,
|
|
7089
|
-
onClick:
|
|
7467
|
+
onClick: () => {
|
|
7468
|
+
setShowReportMenu(p => !p);
|
|
7469
|
+
setShowCustomPicker(false);
|
|
7470
|
+
}
|
|
7090
7471
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
7091
7472
|
width: "16",
|
|
7092
7473
|
height: "16",
|
|
@@ -7105,7 +7486,63 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7105
7486
|
y1: "15",
|
|
7106
7487
|
x2: "12",
|
|
7107
7488
|
y2: "3"
|
|
7108
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")
|
|
7489
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
|
|
7490
|
+
className: "report-menu"
|
|
7491
|
+
}, [{
|
|
7492
|
+
label: t("TODAY") || "Today",
|
|
7493
|
+
key: "today"
|
|
7494
|
+
}, {
|
|
7495
|
+
label: t("THIS_WEEK") || "This Week",
|
|
7496
|
+
key: "week"
|
|
7497
|
+
}, {
|
|
7498
|
+
label: t("THIS_MONTH") || "This Month",
|
|
7499
|
+
key: "month"
|
|
7500
|
+
}].map(_ref5 => {
|
|
7501
|
+
let label = _ref5.label,
|
|
7502
|
+
key = _ref5.key;
|
|
7503
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7504
|
+
key: key,
|
|
7505
|
+
className: "menu-item",
|
|
7506
|
+
onClick: () => handlePresetDownload(key)
|
|
7507
|
+
}, label);
|
|
7508
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7509
|
+
className: "custom-date-trigger",
|
|
7510
|
+
onClick: () => setShowCustomPicker(p => !p)
|
|
7511
|
+
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
|
|
7512
|
+
className: "custom-picker"
|
|
7513
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7514
|
+
className: "date-inputs"
|
|
7515
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
|
|
7516
|
+
type: "date",
|
|
7517
|
+
value: customDate.from,
|
|
7518
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
7519
|
+
from: e.target.value
|
|
7520
|
+
}))
|
|
7521
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
|
|
7522
|
+
type: "date",
|
|
7523
|
+
value: customDate.to,
|
|
7524
|
+
onChange: e => setCustomDate(_extends({}, customDate, {
|
|
7525
|
+
to: e.target.value
|
|
7526
|
+
}))
|
|
7527
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
7528
|
+
style: {
|
|
7529
|
+
display: "flex",
|
|
7530
|
+
gap: "10px",
|
|
7531
|
+
marginTop: "10px"
|
|
7532
|
+
}
|
|
7533
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7534
|
+
className: "picker-cancel-btn",
|
|
7535
|
+
onClick: () => {
|
|
7536
|
+
setShowCustomPicker(false);
|
|
7537
|
+
setCustomDate({
|
|
7538
|
+
from: "",
|
|
7539
|
+
to: ""
|
|
7540
|
+
});
|
|
7541
|
+
}
|
|
7542
|
+
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
|
|
7543
|
+
className: "picker-apply-btn",
|
|
7544
|
+
onClick: handleCustomDownload
|
|
7545
|
+
}, t("APPLY") || "Apply"))))))))), /*#__PURE__*/React.createElement(Card, {
|
|
7109
7546
|
className: "dashboard-card"
|
|
7110
7547
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
7111
7548
|
t: t,
|
|
@@ -9576,7 +10013,7 @@ const CitizenApp = () => {
|
|
|
9576
10013
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9577
10014
|
path: path + "/review",
|
|
9578
10015
|
component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
|
|
9579
|
-
layoutClass: "
|
|
10016
|
+
layoutClass: "action"
|
|
9580
10017
|
}, /*#__PURE__*/React.createElement(Review, null))
|
|
9581
10018
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
9582
10019
|
path: path + "/assign",
|