@mseva/digit-ui-module-garbagecollection 1.0.31 → 1.0.33-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +966 -218
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CardHeader, Toast, CardLabel, TextInput, Dropdown, ActionBar, SubmitBar, MobileNumber, TextArea, FormComposer, Loader as Loader$1, CardSubHeader, StatusTable, Card, CardSectionHeader, Menu,
|
|
1
|
+
import { CardHeader, Toast, LabelFieldPair, CardLabel, TextInput, Dropdown, ActionBar, SubmitBar, MobileNumber, TextArea, FormComposer, Loader as Loader$1, CardSubHeader, StatusTable, Card, CardSectionHeader, Menu, UploadFile, SearchField, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, Header, InboxComposer, PrivateRoute, BreadCrumb, AppContainer, KeyNote, MultiLink, Row, Banner, Modal, Table, CitizenHomeCard, PTIcon } from '@mseva/digit-ui-react-components';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1, useMemo, useReducer, useCallback } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useHistory, Link, useLocation,
|
|
4
|
+
import { useHistory, Link, useLocation, useRouteMatch, Switch, useParams } from 'react-router-dom';
|
|
5
5
|
import { useDispatch, useSelector } from 'react-redux';
|
|
6
6
|
import { useForm, Controller, useFormContext } from 'react-hook-form';
|
|
7
7
|
import { combineReducers } from 'redux';
|
|
@@ -2814,12 +2814,15 @@ const CHBCitizenSecond = ({
|
|
|
2814
2814
|
currentStepData,
|
|
2815
2815
|
t
|
|
2816
2816
|
}) => {
|
|
2817
|
+
var _amountData$gcServic;
|
|
2817
2818
|
const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
|
|
2818
2819
|
const isCitizen = window.location.href.includes("citizen");
|
|
2819
2820
|
const [getPropertyId, setPropertyId] = useState(null);
|
|
2820
2821
|
const [loader, setLoader] = useState(false);
|
|
2821
2822
|
const [showToast, setShowToast] = useState(false);
|
|
2822
2823
|
const [error, setError] = useState("");
|
|
2824
|
+
const [getPUnits, setPUnits] = useState([]);
|
|
2825
|
+
const [getActiveStatus, setActiveStatus] = useState(false);
|
|
2823
2826
|
const {
|
|
2824
2827
|
data: GCData = [],
|
|
2825
2828
|
isLoading: GCLoading
|
|
@@ -2844,6 +2847,13 @@ const CHBCitizenSecond = ({
|
|
|
2844
2847
|
} = Digit.Hooks.useCustomMDMS(tenantId, "gc-services-masters", [{
|
|
2845
2848
|
name: "connectionCategory"
|
|
2846
2849
|
}]);
|
|
2850
|
+
const {
|
|
2851
|
+
data: amountData = [],
|
|
2852
|
+
isLoading: amountDataLoading
|
|
2853
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "gc-services-calculation", [{
|
|
2854
|
+
name: "GCBillingSlab"
|
|
2855
|
+
}]);
|
|
2856
|
+
console.log("amountData", amountData === null || amountData === void 0 ? void 0 : (_amountData$gcServic = amountData["gc-services-calculation"]) === null || _amountData$gcServic === void 0 ? void 0 : _amountData$gcServic.GCBillingSlab);
|
|
2847
2857
|
const {
|
|
2848
2858
|
control,
|
|
2849
2859
|
handleSubmit,
|
|
@@ -2866,7 +2876,7 @@ const CHBCitizenSecond = ({
|
|
|
2866
2876
|
const onSubmit = async data => {
|
|
2867
2877
|
var _currentStepData$venu, _currentStepData$apiR;
|
|
2868
2878
|
if (currentStepData !== null && currentStepData !== void 0 && (_currentStepData$venu = currentStepData.venueDetails) !== null && _currentStepData$venu !== void 0 && _currentStepData$venu.applicationNo || currentStepData !== null && currentStepData !== void 0 && (_currentStepData$apiR = currentStepData.apiResponseData) !== null && _currentStepData$apiR !== void 0 && _currentStepData$apiR.applicationNo) {
|
|
2869
|
-
var _data$frequency, _data$typeOfWaste, _data$propertyType, _data$connectionCateg, _currentStepData$venu2, _data$connectionCateg2;
|
|
2879
|
+
var _data$frequency, _data$typeOfWaste, _data$propertyType, _data$connectionCateg, _currentStepData$venu2, _data$connectionCateg2, _propertyDetailsFetch, _propertyDetailsFetch2, _propertyDetailsFetch3, _propertyDetailsFetch4;
|
|
2870
2880
|
const ownerData = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails;
|
|
2871
2881
|
const updatedDatacheck = (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData);
|
|
2872
2882
|
const payload = {
|
|
@@ -2892,30 +2902,26 @@ const CHBCitizenSecond = ({
|
|
|
2892
2902
|
action: "DRAFT"
|
|
2893
2903
|
},
|
|
2894
2904
|
additionalDetails: {
|
|
2895
|
-
connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg2 = data.connectionCategory) === null || _data$connectionCateg2 === void 0 ? void 0 : _data$connectionCateg2.name
|
|
2905
|
+
connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg2 = data.connectionCategory) === null || _data$connectionCateg2 === void 0 ? void 0 : _data$connectionCateg2.name,
|
|
2906
|
+
locality: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch2 = _propertyDetailsFetch[0]) === null || _propertyDetailsFetch2 === void 0 ? void 0 : (_propertyDetailsFetch3 = _propertyDetailsFetch2.address) === null || _propertyDetailsFetch3 === void 0 ? void 0 : (_propertyDetailsFetch4 = _propertyDetailsFetch3.locality) === null || _propertyDetailsFetch4 === void 0 ? void 0 : _propertyDetailsFetch4.code
|
|
2896
2907
|
}
|
|
2897
2908
|
}
|
|
2898
2909
|
};
|
|
2899
|
-
console.log("payload check", payload);
|
|
2900
2910
|
setLoader(true);
|
|
2901
2911
|
try {
|
|
2902
2912
|
var _response$GarbageConn;
|
|
2903
2913
|
const response = await Digit.GCService.update(payload);
|
|
2904
2914
|
setLoader(false);
|
|
2905
|
-
console.log("response", response);
|
|
2906
2915
|
goNext(response === null || response === void 0 ? void 0 : (_response$GarbageConn = response.GarbageConnection) === null || _response$GarbageConn === void 0 ? void 0 : _response$GarbageConn[0]);
|
|
2907
2916
|
} catch (error) {
|
|
2908
2917
|
var _error$response$data, _error$response$data$, _error$response$data$2;
|
|
2909
2918
|
setLoader(false);
|
|
2910
|
-
console.log("Response Data:", error.response.data);
|
|
2911
2919
|
setShowToast(true);
|
|
2912
2920
|
setError((_error$response$data = error.response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message);
|
|
2913
2921
|
}
|
|
2914
2922
|
} else {
|
|
2915
|
-
var _data$frequency2, _data$typeOfWaste2, _data$propertyType2, _data$connectionCateg3, _data$connectionCateg4;
|
|
2923
|
+
var _data$frequency2, _data$typeOfWaste2, _data$propertyType2, _data$connectionCateg3, _data$unitId, _data$connectionCateg4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8;
|
|
2916
2924
|
setLoader(true);
|
|
2917
|
-
console.log("data", data);
|
|
2918
|
-
console.log("currentStepData", currentStepData);
|
|
2919
2925
|
const ownerData = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails;
|
|
2920
2926
|
const payload = {
|
|
2921
2927
|
GarbageConnection: {
|
|
@@ -2924,10 +2930,12 @@ const CHBCitizenSecond = ({
|
|
|
2924
2930
|
frequency: data === null || data === void 0 ? void 0 : (_data$frequency2 = data.frequency) === null || _data$frequency2 === void 0 ? void 0 : _data$frequency2.name,
|
|
2925
2931
|
typeOfWaste: data === null || data === void 0 ? void 0 : (_data$typeOfWaste2 = data.typeOfWaste) === null || _data$typeOfWaste2 === void 0 ? void 0 : _data$typeOfWaste2.name,
|
|
2926
2932
|
propertyType: data === null || data === void 0 ? void 0 : (_data$propertyType2 = data.propertyType) === null || _data$propertyType2 === void 0 ? void 0 : _data$propertyType2.name,
|
|
2933
|
+
connectionType: "Non Metered",
|
|
2927
2934
|
plotSize: data === null || data === void 0 ? void 0 : data.plotSize,
|
|
2928
2935
|
location: data === null || data === void 0 ? void 0 : data.location,
|
|
2929
2936
|
applicationType: "NEW_GARBAGE_CONNECTION",
|
|
2930
2937
|
connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg3 = data.connectionCategory) === null || _data$connectionCateg3 === void 0 ? void 0 : _data$connectionCateg3.name,
|
|
2938
|
+
unitId: data === null || data === void 0 ? void 0 : (_data$unitId = data.unitId) === null || _data$unitId === void 0 ? void 0 : _data$unitId.id,
|
|
2931
2939
|
connectionHolders: [{
|
|
2932
2940
|
name: ownerData === null || ownerData === void 0 ? void 0 : ownerData.name,
|
|
2933
2941
|
mobileNumber: ownerData === null || ownerData === void 0 ? void 0 : ownerData.mobileNumber,
|
|
@@ -2941,10 +2949,12 @@ const CHBCitizenSecond = ({
|
|
|
2941
2949
|
moduleName: "gc-services"
|
|
2942
2950
|
},
|
|
2943
2951
|
additionalDetails: {
|
|
2944
|
-
connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg4 = data.connectionCategory) === null || _data$connectionCateg4 === void 0 ? void 0 : _data$connectionCateg4.name
|
|
2952
|
+
connectionCategory: data === null || data === void 0 ? void 0 : (_data$connectionCateg4 = data.connectionCategory) === null || _data$connectionCateg4 === void 0 ? void 0 : _data$connectionCateg4.name,
|
|
2953
|
+
locality: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch5 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch5 === void 0 ? void 0 : (_propertyDetailsFetch6 = _propertyDetailsFetch5[0]) === null || _propertyDetailsFetch6 === void 0 ? void 0 : (_propertyDetailsFetch7 = _propertyDetailsFetch6.address) === null || _propertyDetailsFetch7 === void 0 ? void 0 : (_propertyDetailsFetch8 = _propertyDetailsFetch7.locality) === null || _propertyDetailsFetch8 === void 0 ? void 0 : _propertyDetailsFetch8.code
|
|
2945
2954
|
}
|
|
2946
2955
|
}
|
|
2947
2956
|
};
|
|
2957
|
+
console.log("payload=====", payload);
|
|
2948
2958
|
try {
|
|
2949
2959
|
var _response$GarbageConn2;
|
|
2950
2960
|
const response = await Digit.GCService.create(payload);
|
|
@@ -2954,7 +2964,6 @@ const CHBCitizenSecond = ({
|
|
|
2954
2964
|
} catch (error) {
|
|
2955
2965
|
var _error$response$data2, _error$response$data3, _error$response$data4;
|
|
2956
2966
|
setLoader(false);
|
|
2957
|
-
console.log("Response Data:", error.response.data);
|
|
2958
2967
|
setShowToast(true);
|
|
2959
2968
|
setError((_error$response$data2 = error.response.data) === null || _error$response$data2 === void 0 ? void 0 : (_error$response$data3 = _error$response$data2.Errors) === null || _error$response$data3 === void 0 ? void 0 : (_error$response$data4 = _error$response$data3[0]) === null || _error$response$data4 === void 0 ? void 0 : _error$response$data4.message);
|
|
2960
2969
|
}
|
|
@@ -2976,23 +2985,50 @@ const CHBCitizenSecond = ({
|
|
|
2976
2985
|
enabled: getPropertyId ? true : false,
|
|
2977
2986
|
privacy: Digit.Utils.getPrivacyObject()
|
|
2978
2987
|
});
|
|
2988
|
+
const checkConnection = async (propertyId, unitId) => {
|
|
2989
|
+
setLoader(true);
|
|
2990
|
+
const filters = {
|
|
2991
|
+
propertyId: propertyId,
|
|
2992
|
+
unitId: unitId,
|
|
2993
|
+
tenantId
|
|
2994
|
+
};
|
|
2995
|
+
try {
|
|
2996
|
+
const responseData = await Digit.GCService.validateConnection({
|
|
2997
|
+
tenantId,
|
|
2998
|
+
filters
|
|
2999
|
+
});
|
|
3000
|
+
setLoader(false);
|
|
3001
|
+
if (responseData !== null && responseData !== void 0 && responseData.canCreateConnection) {
|
|
3002
|
+
setActiveStatus(true);
|
|
3003
|
+
} else {
|
|
3004
|
+
setShowToast(true);
|
|
3005
|
+
setError(responseData === null || responseData === void 0 ? void 0 : responseData.message);
|
|
3006
|
+
}
|
|
3007
|
+
} catch (error) {
|
|
3008
|
+
var _error$response$data5, _error$response$data6, _error$response$data7;
|
|
3009
|
+
setLoader(false);
|
|
3010
|
+
setActiveStatus(false);
|
|
3011
|
+
setShowToast(true);
|
|
3012
|
+
setError((_error$response$data5 = error.response.data) === null || _error$response$data5 === void 0 ? void 0 : (_error$response$data6 = _error$response$data5.Errors) === null || _error$response$data6 === void 0 ? void 0 : (_error$response$data7 = _error$response$data6[0]) === null || _error$response$data7 === void 0 ? void 0 : _error$response$data7.message);
|
|
3013
|
+
}
|
|
3014
|
+
};
|
|
2979
3015
|
useEffect(() => {
|
|
2980
3016
|
if (propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties[0]) {
|
|
3017
|
+
var _propertyDetailsFetch9;
|
|
3018
|
+
setPUnits(propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch9 = propertyDetailsFetch.Properties[0]) === null || _propertyDetailsFetch9 === void 0 ? void 0 : _propertyDetailsFetch9.units);
|
|
2981
3019
|
if (propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties || currentStepData !== null && currentStepData !== void 0 && currentStepData.venueDetails || currentStepData !== null && currentStepData !== void 0 && currentStepData.apiResponseData) {
|
|
2982
|
-
var
|
|
3020
|
+
var _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _GCData$swServicesC, _FreqType$gcServices, _WasteType$gcService, _connectionCategory$g, _propertyDetailsFetch18, _propertyDetailsFetch19;
|
|
2983
3021
|
const backStepData = (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData);
|
|
2984
|
-
const location = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (
|
|
2985
|
-
const plotSize = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (
|
|
3022
|
+
const location = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch0 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch0 === void 0 ? void 0 : (_propertyDetailsFetch1 = _propertyDetailsFetch0[0]) === null || _propertyDetailsFetch1 === void 0 ? void 0 : (_propertyDetailsFetch10 = _propertyDetailsFetch1.owners) === null || _propertyDetailsFetch10 === void 0 ? void 0 : (_propertyDetailsFetch11 = _propertyDetailsFetch10[0]) === null || _propertyDetailsFetch11 === void 0 ? void 0 : _propertyDetailsFetch11.permanentAddress) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.location) || (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch12 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch12 === void 0 ? void 0 : (_propertyDetailsFetch13 = _propertyDetailsFetch12[0]) === null || _propertyDetailsFetch13 === void 0 ? void 0 : (_propertyDetailsFetch14 = _propertyDetailsFetch13.address) === null || _propertyDetailsFetch14 === void 0 ? void 0 : (_propertyDetailsFetch15 = _propertyDetailsFetch14.locality) === null || _propertyDetailsFetch15 === void 0 ? void 0 : _propertyDetailsFetch15.name);
|
|
3023
|
+
const plotSize = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch16 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch16 === void 0 ? void 0 : (_propertyDetailsFetch17 = _propertyDetailsFetch16[0]) === null || _propertyDetailsFetch17 === void 0 ? void 0 : _propertyDetailsFetch17.landArea) || (backStepData === null || backStepData === void 0 ? void 0 : backStepData.plotSize);
|
|
2986
3024
|
if (backStepData !== null && backStepData !== void 0 && backStepData.propertyId) setValue("propertyId", backStepData === null || backStepData === void 0 ? void 0 : backStepData.propertyId);
|
|
2987
3025
|
setValue("location", location);
|
|
2988
3026
|
setValue("plotSize", plotSize);
|
|
2989
3027
|
const pTypeOptions = (GCData === null || GCData === void 0 ? void 0 : (_GCData$swServicesC = GCData["sw-services-calculation"]) === null || _GCData$swServicesC === void 0 ? void 0 : _GCData$swServicesC.PropertyUsageType) || [];
|
|
2990
|
-
console.log("pTypeOptions", pTypeOptions);
|
|
2991
3028
|
const freqTypeOptions = (FreqType === null || FreqType === void 0 ? void 0 : (_FreqType$gcServices = FreqType["gc-services-masters"]) === null || _FreqType$gcServices === void 0 ? void 0 : _FreqType$gcServices.GarbageCollectionFrequency) || [];
|
|
2992
3029
|
const wasteTypeOptions = (WasteType === null || WasteType === void 0 ? void 0 : (_WasteType$gcService = WasteType["gc-services-masters"]) === null || _WasteType$gcService === void 0 ? void 0 : _WasteType$gcService.TypeOfWaste) || [];
|
|
2993
3030
|
const connectionCatoptions = (connectionCategory === null || connectionCategory === void 0 ? void 0 : (_connectionCategory$g = connectionCategory["gc-services-masters"]) === null || _connectionCategory$g === void 0 ? void 0 : _connectionCategory$g.connectionCategory) || [];
|
|
2994
|
-
|
|
2995
|
-
const usage = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch7 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch7 === void 0 ? void 0 : (_propertyDetailsFetch8 = _propertyDetailsFetch7[0]) === null || _propertyDetailsFetch8 === void 0 ? void 0 : _propertyDetailsFetch8.usageCategory;
|
|
3031
|
+
const usage = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch18 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch18 === void 0 ? void 0 : (_propertyDetailsFetch19 = _propertyDetailsFetch18[0]) === null || _propertyDetailsFetch19 === void 0 ? void 0 : _propertyDetailsFetch19.usageCategory;
|
|
2996
3032
|
const frequency = backStepData === null || backStepData === void 0 ? void 0 : backStepData.frequency;
|
|
2997
3033
|
const typeOfWaste = backStepData === null || backStepData === void 0 ? void 0 : backStepData.typeOfWaste;
|
|
2998
3034
|
const connetionType = backStepData === null || backStepData === void 0 ? void 0 : backStepData.connectionCategory;
|
|
@@ -3031,27 +3067,67 @@ const CHBCitizenSecond = ({
|
|
|
3031
3067
|
setValue("connectionCategory", null);
|
|
3032
3068
|
setPropertyId(null);
|
|
3033
3069
|
};
|
|
3070
|
+
const uniqueFloors = React.useMemo(() => {
|
|
3071
|
+
if (!(getPUnits !== null && getPUnits !== void 0 && getPUnits.length)) return [];
|
|
3072
|
+
const map = new Map();
|
|
3073
|
+
getPUnits.forEach(item => {
|
|
3074
|
+
if (!map.has(item.floorNo)) {
|
|
3075
|
+
map.set(item.floorNo, item);
|
|
3076
|
+
}
|
|
3077
|
+
});
|
|
3078
|
+
return Array.from(map.values()).sort((a, b) => a.floorNo - b.floorNo);
|
|
3079
|
+
}, [getPUnits]);
|
|
3080
|
+
const selectedFloorUnits = React.useMemo(() => {
|
|
3081
|
+
if (!watch("floorNo")) return [];
|
|
3082
|
+
return getPUnits.filter(unit => {
|
|
3083
|
+
var _watch;
|
|
3084
|
+
return unit.floorNo === ((_watch = watch("floorNo")) === null || _watch === void 0 ? void 0 : _watch.floorNo);
|
|
3085
|
+
});
|
|
3086
|
+
}, [watch("floorNo"), getPUnits]);
|
|
3087
|
+
const uniqueUsageCategories = React.useMemo(() => {
|
|
3088
|
+
if (!(selectedFloorUnits !== null && selectedFloorUnits !== void 0 && selectedFloorUnits.length)) return [];
|
|
3089
|
+
const map = new Map();
|
|
3090
|
+
selectedFloorUnits.forEach(unit => {
|
|
3091
|
+
if (!map.has(unit.usageCategory)) {
|
|
3092
|
+
map.set(unit.usageCategory, unit);
|
|
3093
|
+
}
|
|
3094
|
+
});
|
|
3095
|
+
return Array.from(map.values());
|
|
3096
|
+
}, [selectedFloorUnits]);
|
|
3097
|
+
const filterAmountData = (freq, propertyType) => {
|
|
3098
|
+
var _amountData$gcServic2, _finalData$;
|
|
3099
|
+
const filterData = amountData === null || amountData === void 0 ? void 0 : (_amountData$gcServic2 = amountData["gc-services-calculation"]) === null || _amountData$gcServic2 === void 0 ? void 0 : _amountData$gcServic2.GCBillingSlab;
|
|
3100
|
+
const finalData = filterData === null || filterData === void 0 ? void 0 : filterData.filter(item => item.billingCycle === freq && item.buildingType === propertyType);
|
|
3101
|
+
console.log("finalData", finalData[0]);
|
|
3102
|
+
setValue("defAmount", (_finalData$ = finalData[0]) === null || _finalData$ === void 0 ? void 0 : _finalData$.minimumCharge);
|
|
3103
|
+
};
|
|
3034
3104
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("form", {
|
|
3035
3105
|
style: {
|
|
3036
3106
|
paddingBottom: "150px"
|
|
3037
3107
|
},
|
|
3038
3108
|
onSubmit: handleSubmit(onSubmit)
|
|
3039
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
3109
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3040
3110
|
style: {
|
|
3041
|
-
marginBottom: "
|
|
3111
|
+
marginBottom: "16px"
|
|
3042
3112
|
}
|
|
3043
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3113
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3114
|
+
className: "card-label-smaller"
|
|
3115
|
+
}, `${t("NDC_MSG_PROPERTY_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3044
3116
|
style: {
|
|
3045
3117
|
color: "red"
|
|
3046
3118
|
}
|
|
3047
3119
|
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3120
|
+
className: "form-field"
|
|
3121
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3048
3122
|
style: {
|
|
3049
|
-
display: "
|
|
3050
|
-
gap: "
|
|
3051
|
-
alignItems: "
|
|
3123
|
+
display: "block",
|
|
3124
|
+
gap: "8px",
|
|
3125
|
+
alignItems: "flex-start"
|
|
3052
3126
|
}
|
|
3053
3127
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3054
|
-
|
|
3128
|
+
style: {
|
|
3129
|
+
flex: 1
|
|
3130
|
+
}
|
|
3055
3131
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3056
3132
|
control: control,
|
|
3057
3133
|
name: "propertyId",
|
|
@@ -3070,27 +3146,28 @@ const CHBCitizenSecond = ({
|
|
|
3070
3146
|
t: t
|
|
3071
3147
|
})
|
|
3072
3148
|
})), /*#__PURE__*/React.createElement("button", {
|
|
3073
|
-
className: "submit-bar",
|
|
3149
|
+
className: "submit-bar gcButton",
|
|
3074
3150
|
type: "button",
|
|
3075
|
-
style: {
|
|
3076
|
-
color: "white",
|
|
3077
|
-
width: "100%",
|
|
3078
|
-
maxWidth: "100px"
|
|
3079
|
-
},
|
|
3080
3151
|
onClick: searchProperty
|
|
3081
3152
|
}, `${t("PT_SEARCH")}`)), (errors === null || errors === void 0 ? void 0 : errors.propertyId) && /*#__PURE__*/React.createElement("p", {
|
|
3082
3153
|
style: {
|
|
3083
|
-
color: "red"
|
|
3154
|
+
color: "red",
|
|
3155
|
+
marginTop: "4px",
|
|
3156
|
+
marginBottom: "0"
|
|
3084
3157
|
}
|
|
3085
|
-
}, errors.propertyId.message)), ((propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
3158
|
+
}, errors.propertyId.message))), ((propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.apiResponseData)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3086
3159
|
style: {
|
|
3087
|
-
marginBottom: "
|
|
3160
|
+
marginBottom: "16px"
|
|
3088
3161
|
}
|
|
3089
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3162
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3163
|
+
className: "card-label-smaller"
|
|
3164
|
+
}, `${t("NDC_MSG_PROPERTY_TYPE_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3090
3165
|
style: {
|
|
3091
3166
|
color: "red"
|
|
3092
3167
|
}
|
|
3093
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3168
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3169
|
+
className: "form-field"
|
|
3170
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3094
3171
|
control: control,
|
|
3095
3172
|
name: "propertyType",
|
|
3096
3173
|
rules: {
|
|
@@ -3113,18 +3190,23 @@ const CHBCitizenSecond = ({
|
|
|
3113
3190
|
}
|
|
3114
3191
|
}), (errors === null || errors === void 0 ? void 0 : errors.propertyType) && /*#__PURE__*/React.createElement("p", {
|
|
3115
3192
|
style: {
|
|
3116
|
-
color: "red"
|
|
3193
|
+
color: "red",
|
|
3194
|
+
marginTop: "4px",
|
|
3195
|
+
marginBottom: "0"
|
|
3117
3196
|
}
|
|
3118
|
-
}, errors.propertyType.message)), /*#__PURE__*/React.createElement(
|
|
3119
|
-
className: "form-field",
|
|
3197
|
+
}, errors.propertyType.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3120
3198
|
style: {
|
|
3121
|
-
marginBottom: "
|
|
3199
|
+
marginBottom: "16px"
|
|
3122
3200
|
}
|
|
3123
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3201
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3202
|
+
className: "card-label-smaller"
|
|
3203
|
+
}, `${t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_PLOT_SIZE")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3124
3204
|
style: {
|
|
3125
3205
|
color: "red"
|
|
3126
3206
|
}
|
|
3127
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3207
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3208
|
+
className: "form-field"
|
|
3209
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3128
3210
|
control: control,
|
|
3129
3211
|
name: "plotSize",
|
|
3130
3212
|
rules: {
|
|
@@ -3142,18 +3224,23 @@ const CHBCitizenSecond = ({
|
|
|
3142
3224
|
})
|
|
3143
3225
|
}), (errors === null || errors === void 0 ? void 0 : errors.plotSize) && /*#__PURE__*/React.createElement("p", {
|
|
3144
3226
|
style: {
|
|
3145
|
-
color: "red"
|
|
3227
|
+
color: "red",
|
|
3228
|
+
marginTop: "4px",
|
|
3229
|
+
marginBottom: "0"
|
|
3146
3230
|
}
|
|
3147
|
-
}, errors.plotSize.message)), /*#__PURE__*/React.createElement(
|
|
3148
|
-
className: "form-field",
|
|
3231
|
+
}, errors.plotSize.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3149
3232
|
style: {
|
|
3150
|
-
marginBottom: "
|
|
3233
|
+
marginBottom: "16px"
|
|
3151
3234
|
}
|
|
3152
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3235
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3236
|
+
className: "card-label-smaller"
|
|
3237
|
+
}, `${t("GC_LOCATION")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3153
3238
|
style: {
|
|
3154
3239
|
color: "red"
|
|
3155
3240
|
}
|
|
3156
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3241
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3242
|
+
className: "form-field"
|
|
3243
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3157
3244
|
control: control,
|
|
3158
3245
|
name: "location",
|
|
3159
3246
|
rules: {
|
|
@@ -3171,17 +3258,23 @@ const CHBCitizenSecond = ({
|
|
|
3171
3258
|
})
|
|
3172
3259
|
}), (errors === null || errors === void 0 ? void 0 : errors.location) && /*#__PURE__*/React.createElement("p", {
|
|
3173
3260
|
style: {
|
|
3174
|
-
color: "red"
|
|
3261
|
+
color: "red",
|
|
3262
|
+
marginTop: "4px",
|
|
3263
|
+
marginBottom: "0"
|
|
3175
3264
|
}
|
|
3176
|
-
}, errors.location.message)), /*#__PURE__*/React.createElement(
|
|
3265
|
+
}, errors.location.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3177
3266
|
style: {
|
|
3178
|
-
marginBottom: "
|
|
3267
|
+
marginBottom: "16px"
|
|
3179
3268
|
}
|
|
3180
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3269
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3270
|
+
className: "card-label-smaller"
|
|
3271
|
+
}, `${t("GC_FREQUENCY")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3181
3272
|
style: {
|
|
3182
3273
|
color: "red"
|
|
3183
3274
|
}
|
|
3184
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3275
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3276
|
+
className: "form-field"
|
|
3277
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3185
3278
|
control: control,
|
|
3186
3279
|
name: "frequency",
|
|
3187
3280
|
rules: {
|
|
@@ -3195,7 +3288,11 @@ const CHBCitizenSecond = ({
|
|
|
3195
3288
|
},
|
|
3196
3289
|
className: "form-field",
|
|
3197
3290
|
select: e => {
|
|
3291
|
+
var _watch2, _watch3;
|
|
3198
3292
|
props.onChange(e);
|
|
3293
|
+
console.log("frequency", e === null || e === void 0 ? void 0 : e.name);
|
|
3294
|
+
console.log("property type", (_watch2 = watch("propertyType")) === null || _watch2 === void 0 ? void 0 : _watch2.code);
|
|
3295
|
+
filterAmountData(e === null || e === void 0 ? void 0 : e.name, (_watch3 = watch("propertyType")) === null || _watch3 === void 0 ? void 0 : _watch3.code);
|
|
3199
3296
|
},
|
|
3200
3297
|
selected: props.value,
|
|
3201
3298
|
option: FreqType === null || FreqType === void 0 ? void 0 : (_FreqType$gcServices2 = FreqType["gc-services-masters"]) === null || _FreqType$gcServices2 === void 0 ? void 0 : _FreqType$gcServices2.GarbageCollectionFrequency,
|
|
@@ -3204,17 +3301,51 @@ const CHBCitizenSecond = ({
|
|
|
3204
3301
|
}
|
|
3205
3302
|
}), (errors === null || errors === void 0 ? void 0 : errors.frequency) && /*#__PURE__*/React.createElement("p", {
|
|
3206
3303
|
style: {
|
|
3207
|
-
color: "red"
|
|
3304
|
+
color: "red",
|
|
3305
|
+
marginTop: "4px",
|
|
3306
|
+
marginBottom: "0"
|
|
3208
3307
|
}
|
|
3209
|
-
}, errors.frequency.message)), /*#__PURE__*/React.createElement(
|
|
3308
|
+
}, errors.frequency.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3210
3309
|
style: {
|
|
3211
|
-
marginBottom: "
|
|
3310
|
+
marginBottom: "16px"
|
|
3212
3311
|
}
|
|
3213
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3312
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3313
|
+
className: "card-label-smaller"
|
|
3314
|
+
}, `${t("Amount")}`), /*#__PURE__*/React.createElement("div", {
|
|
3315
|
+
className: "form-field"
|
|
3316
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3317
|
+
control: control,
|
|
3318
|
+
name: "defAmount",
|
|
3319
|
+
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
3320
|
+
style: {
|
|
3321
|
+
marginBottom: 0
|
|
3322
|
+
},
|
|
3323
|
+
value: props.value,
|
|
3324
|
+
onChange: e => {
|
|
3325
|
+
props.onChange(e.target.value);
|
|
3326
|
+
},
|
|
3327
|
+
disabled: true,
|
|
3328
|
+
t: t
|
|
3329
|
+
})
|
|
3330
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.location) && /*#__PURE__*/React.createElement("p", {
|
|
3331
|
+
style: {
|
|
3332
|
+
color: "red",
|
|
3333
|
+
marginTop: "4px",
|
|
3334
|
+
marginBottom: "0"
|
|
3335
|
+
}
|
|
3336
|
+
}, errors.location.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3337
|
+
style: {
|
|
3338
|
+
marginBottom: "16px"
|
|
3339
|
+
}
|
|
3340
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3341
|
+
className: "card-label-smaller"
|
|
3342
|
+
}, `${t("GC_WASTE_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3214
3343
|
style: {
|
|
3215
3344
|
color: "red"
|
|
3216
3345
|
}
|
|
3217
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3346
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3347
|
+
className: "form-field"
|
|
3348
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3218
3349
|
control: control,
|
|
3219
3350
|
name: "typeOfWaste",
|
|
3220
3351
|
rules: {
|
|
@@ -3237,17 +3368,23 @@ const CHBCitizenSecond = ({
|
|
|
3237
3368
|
}
|
|
3238
3369
|
}), (errors === null || errors === void 0 ? void 0 : errors.typeOfWaste) && /*#__PURE__*/React.createElement("p", {
|
|
3239
3370
|
style: {
|
|
3240
|
-
color: "red"
|
|
3371
|
+
color: "red",
|
|
3372
|
+
marginTop: "4px",
|
|
3373
|
+
marginBottom: "0"
|
|
3241
3374
|
}
|
|
3242
|
-
}, errors.typeOfWaste.message)), /*#__PURE__*/React.createElement(
|
|
3375
|
+
}, errors.typeOfWaste.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3243
3376
|
style: {
|
|
3244
|
-
marginBottom: "
|
|
3377
|
+
marginBottom: "16px"
|
|
3245
3378
|
}
|
|
3246
|
-
}, /*#__PURE__*/React.createElement(CardLabel,
|
|
3379
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3380
|
+
className: "card-label-smaller"
|
|
3381
|
+
}, `${t("GC_CONNECTION_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3247
3382
|
style: {
|
|
3248
3383
|
color: "red"
|
|
3249
3384
|
}
|
|
3250
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
3385
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3386
|
+
className: "form-field"
|
|
3387
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3251
3388
|
control: control,
|
|
3252
3389
|
name: "connectionCategory",
|
|
3253
3390
|
rules: {
|
|
@@ -3269,10 +3406,89 @@ const CHBCitizenSecond = ({
|
|
|
3269
3406
|
});
|
|
3270
3407
|
}
|
|
3271
3408
|
}), (errors === null || errors === void 0 ? void 0 : errors.connectionCategory) && /*#__PURE__*/React.createElement("p", {
|
|
3409
|
+
style: {
|
|
3410
|
+
color: "red",
|
|
3411
|
+
marginTop: "4px",
|
|
3412
|
+
marginBottom: "0"
|
|
3413
|
+
}
|
|
3414
|
+
}, errors.connectionCategory.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3415
|
+
style: {
|
|
3416
|
+
marginBottom: "16px"
|
|
3417
|
+
}
|
|
3418
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3419
|
+
className: "card-label-smaller"
|
|
3420
|
+
}, `${t("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3421
|
+
style: {
|
|
3422
|
+
color: "red"
|
|
3423
|
+
}
|
|
3424
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3425
|
+
className: "form-field"
|
|
3426
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3427
|
+
control: control,
|
|
3428
|
+
name: "floorNo",
|
|
3429
|
+
rules: {
|
|
3430
|
+
required: t("units is required")
|
|
3431
|
+
},
|
|
3432
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
3433
|
+
style: {
|
|
3434
|
+
marginBottom: 0
|
|
3435
|
+
},
|
|
3436
|
+
className: "form-field",
|
|
3437
|
+
select: e => {
|
|
3438
|
+
props.onChange(e);
|
|
3439
|
+
},
|
|
3440
|
+
selected: props.value,
|
|
3441
|
+
option: uniqueFloors,
|
|
3442
|
+
optionKey: "floorNo",
|
|
3443
|
+
t: t
|
|
3444
|
+
})
|
|
3445
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.floorNo) && /*#__PURE__*/React.createElement("p", {
|
|
3446
|
+
style: {
|
|
3447
|
+
color: "red",
|
|
3448
|
+
marginTop: "4px",
|
|
3449
|
+
marginBottom: "0"
|
|
3450
|
+
}
|
|
3451
|
+
}, errors.floorNo.message))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
3452
|
+
style: {
|
|
3453
|
+
marginBottom: "16px"
|
|
3454
|
+
}
|
|
3455
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
3456
|
+
className: "card-label-smaller"
|
|
3457
|
+
}, `${t("Select Unit")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
3272
3458
|
style: {
|
|
3273
3459
|
color: "red"
|
|
3274
3460
|
}
|
|
3275
|
-
},
|
|
3461
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
3462
|
+
className: "form-field"
|
|
3463
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
3464
|
+
control: control,
|
|
3465
|
+
name: "unitId",
|
|
3466
|
+
rules: {
|
|
3467
|
+
required: t("Usage category is required")
|
|
3468
|
+
},
|
|
3469
|
+
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
3470
|
+
style: {
|
|
3471
|
+
marginBottom: 0
|
|
3472
|
+
},
|
|
3473
|
+
className: "form-field",
|
|
3474
|
+
select: e => {
|
|
3475
|
+
var _propertyDetailsFetch20;
|
|
3476
|
+
props.onChange(e);
|
|
3477
|
+
const pID = propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch20 = propertyDetailsFetch.Properties[0]) === null || _propertyDetailsFetch20 === void 0 ? void 0 : _propertyDetailsFetch20.propertyId;
|
|
3478
|
+
checkConnection(pID, e === null || e === void 0 ? void 0 : e.id);
|
|
3479
|
+
},
|
|
3480
|
+
selected: props.value,
|
|
3481
|
+
option: uniqueUsageCategories,
|
|
3482
|
+
optionKey: "usageCategory",
|
|
3483
|
+
t: t
|
|
3484
|
+
})
|
|
3485
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.unitId) && /*#__PURE__*/React.createElement("p", {
|
|
3486
|
+
style: {
|
|
3487
|
+
color: "red",
|
|
3488
|
+
marginTop: "4px",
|
|
3489
|
+
marginBottom: "0"
|
|
3490
|
+
}
|
|
3491
|
+
}, errors.unitId.message))))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3276
3492
|
style: {
|
|
3277
3493
|
background: " white",
|
|
3278
3494
|
color: "black",
|
|
@@ -3283,13 +3499,14 @@ const CHBCitizenSecond = ({
|
|
|
3283
3499
|
onSubmit: onGoBack
|
|
3284
3500
|
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
3285
3501
|
label: "Next",
|
|
3286
|
-
submit: "submit"
|
|
3502
|
+
submit: "submit",
|
|
3503
|
+
disabled: !getActiveStatus
|
|
3287
3504
|
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
3288
3505
|
isDleteBtn: true,
|
|
3289
3506
|
error: true,
|
|
3290
3507
|
label: error,
|
|
3291
3508
|
onClose: closeToast
|
|
3292
|
-
}), (loader || isLoading || GCLoading || WasteTypeLoading || FreqTypeLoading || connectionCategoryLoading) && /*#__PURE__*/React.createElement(Loader, {
|
|
3509
|
+
}), (amountDataLoading || loader || isLoading || GCLoading || WasteTypeLoading || FreqTypeLoading || connectionCategoryLoading) && /*#__PURE__*/React.createElement(Loader, {
|
|
3293
3510
|
page: true
|
|
3294
3511
|
}));
|
|
3295
3512
|
};
|
|
@@ -9126,6 +9343,7 @@ const NewADSStepFormOne = ({
|
|
|
9126
9343
|
onGoNext,
|
|
9127
9344
|
onBackClick
|
|
9128
9345
|
}) => {
|
|
9346
|
+
var _window$location, _window$location$href;
|
|
9129
9347
|
const dispatch = useDispatch();
|
|
9130
9348
|
const {
|
|
9131
9349
|
t
|
|
@@ -9147,12 +9365,15 @@ const NewADSStepFormOne = ({
|
|
|
9147
9365
|
setShowToast(false);
|
|
9148
9366
|
setError("");
|
|
9149
9367
|
};
|
|
9150
|
-
|
|
9368
|
+
const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
|
|
9369
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
9370
|
+
className: !isCitizen ? "employeeCard" : ""
|
|
9371
|
+
}, /*#__PURE__*/React.createElement(CHBCitizenSecond, {
|
|
9151
9372
|
onGoBack: onGoBack,
|
|
9152
9373
|
goNext: goNext,
|
|
9153
9374
|
currentStepData: currentStepData,
|
|
9154
9375
|
t: t
|
|
9155
|
-
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9376
|
+
})), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9156
9377
|
isDleteBtn: true,
|
|
9157
9378
|
error: true,
|
|
9158
9379
|
label: error,
|
|
@@ -9266,17 +9487,17 @@ const CHBCitizenDetailsNew = ({
|
|
|
9266
9487
|
onSubmit: handleSubmit(onSubmit)
|
|
9267
9488
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9268
9489
|
style: {
|
|
9269
|
-
|
|
9270
|
-
}
|
|
9271
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9272
|
-
style: {
|
|
9273
|
-
marginBottom: "20px"
|
|
9490
|
+
maxWidth: !isCitizen ? "100%" : "100%"
|
|
9274
9491
|
}
|
|
9275
|
-
}, /*#__PURE__*/React.createElement(
|
|
9492
|
+
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
9493
|
+
className: "card-label-smaller"
|
|
9494
|
+
}, `${t("NOC_APPLICANT_MOBILE_NO_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
9276
9495
|
style: {
|
|
9277
9496
|
color: "red"
|
|
9278
9497
|
}
|
|
9279
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
9498
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
9499
|
+
className: "form-field"
|
|
9500
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
9280
9501
|
control: control,
|
|
9281
9502
|
name: "mobileNumber",
|
|
9282
9503
|
rules: {
|
|
@@ -9289,7 +9510,6 @@ const CHBCitizenDetailsNew = ({
|
|
|
9289
9510
|
render: props => /*#__PURE__*/React.createElement(MobileNumber, {
|
|
9290
9511
|
value: props.value,
|
|
9291
9512
|
onChange: e => {
|
|
9292
|
-
console.log("eee", e);
|
|
9293
9513
|
props.onChange(e);
|
|
9294
9514
|
setValue("name", "");
|
|
9295
9515
|
if (e.length === 10) {
|
|
@@ -9301,17 +9521,19 @@ const CHBCitizenDetailsNew = ({
|
|
|
9301
9521
|
})
|
|
9302
9522
|
}), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/React.createElement("p", {
|
|
9303
9523
|
style: {
|
|
9304
|
-
color: "red"
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
style: {
|
|
9308
|
-
marginBottom: "20px"
|
|
9524
|
+
color: "red",
|
|
9525
|
+
marginTop: "4px",
|
|
9526
|
+
marginBottom: "0"
|
|
9309
9527
|
}
|
|
9310
|
-
}, /*#__PURE__*/React.createElement(
|
|
9528
|
+
}, errors.mobileNumber.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
9529
|
+
className: "card-label-smaller"
|
|
9530
|
+
}, `${t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
9311
9531
|
style: {
|
|
9312
9532
|
color: "red"
|
|
9313
9533
|
}
|
|
9314
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
9534
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
9535
|
+
className: "form-field"
|
|
9536
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
9315
9537
|
control: control,
|
|
9316
9538
|
name: "name",
|
|
9317
9539
|
rules: {
|
|
@@ -9337,17 +9559,19 @@ const CHBCitizenDetailsNew = ({
|
|
|
9337
9559
|
}
|
|
9338
9560
|
}), (errors === null || errors === void 0 ? void 0 : errors.name) && /*#__PURE__*/React.createElement("p", {
|
|
9339
9561
|
style: {
|
|
9340
|
-
color: "red"
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
style: {
|
|
9344
|
-
marginBottom: "20px"
|
|
9562
|
+
color: "red",
|
|
9563
|
+
marginTop: "4px",
|
|
9564
|
+
marginBottom: "0"
|
|
9345
9565
|
}
|
|
9346
|
-
}, /*#__PURE__*/React.createElement(
|
|
9566
|
+
}, errors.name.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
9567
|
+
className: "card-label-smaller"
|
|
9568
|
+
}, `${t("NOC_APPLICANT_EMAIL_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
9347
9569
|
style: {
|
|
9348
9570
|
color: "red"
|
|
9349
9571
|
}
|
|
9350
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
9572
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
9573
|
+
className: "form-field"
|
|
9574
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
9351
9575
|
control: control,
|
|
9352
9576
|
name: "emailId",
|
|
9353
9577
|
rules: {
|
|
@@ -9369,17 +9593,19 @@ const CHBCitizenDetailsNew = ({
|
|
|
9369
9593
|
})
|
|
9370
9594
|
}), (errors === null || errors === void 0 ? void 0 : errors.emailId) && /*#__PURE__*/React.createElement("p", {
|
|
9371
9595
|
style: {
|
|
9372
|
-
color: "red"
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
style: {
|
|
9376
|
-
marginBottom: "20px"
|
|
9596
|
+
color: "red",
|
|
9597
|
+
marginTop: "4px",
|
|
9598
|
+
marginBottom: "0"
|
|
9377
9599
|
}
|
|
9378
|
-
}, /*#__PURE__*/React.createElement(
|
|
9600
|
+
}, errors.emailId.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
9601
|
+
className: "card-label-smaller"
|
|
9602
|
+
}, `${t("PT_COMMON_COL_ADDRESS")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
9379
9603
|
style: {
|
|
9380
9604
|
color: "red"
|
|
9381
9605
|
}
|
|
9382
|
-
}, "*")), /*#__PURE__*/React.createElement(
|
|
9606
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
9607
|
+
className: "form-field"
|
|
9608
|
+
}, /*#__PURE__*/React.createElement(Controller, {
|
|
9383
9609
|
control: control,
|
|
9384
9610
|
name: "address",
|
|
9385
9611
|
rules: {
|
|
@@ -9402,9 +9628,11 @@ const CHBCitizenDetailsNew = ({
|
|
|
9402
9628
|
})
|
|
9403
9629
|
}), (errors === null || errors === void 0 ? void 0 : errors.address) && /*#__PURE__*/React.createElement("p", {
|
|
9404
9630
|
style: {
|
|
9405
|
-
color: "red"
|
|
9631
|
+
color: "red",
|
|
9632
|
+
marginTop: "4px",
|
|
9633
|
+
marginBottom: "0"
|
|
9406
9634
|
}
|
|
9407
|
-
}, errors.address.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
9635
|
+
}, errors.address.message)))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
9408
9636
|
label: "Next",
|
|
9409
9637
|
submit: "submit"
|
|
9410
9638
|
}))), loader && /*#__PURE__*/React.createElement(Loader, {
|
|
@@ -9417,6 +9645,7 @@ const NewADSStepFormTwo = ({
|
|
|
9417
9645
|
onBackClick,
|
|
9418
9646
|
onGoNext
|
|
9419
9647
|
}) => {
|
|
9648
|
+
var _window$location, _window$location$href;
|
|
9420
9649
|
const {
|
|
9421
9650
|
t
|
|
9422
9651
|
} = useTranslation();
|
|
@@ -9438,12 +9667,15 @@ const NewADSStepFormTwo = ({
|
|
|
9438
9667
|
setShowToast(false);
|
|
9439
9668
|
setError("");
|
|
9440
9669
|
};
|
|
9441
|
-
|
|
9670
|
+
const isCitizen = typeof window !== "undefined" && ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : (_window$location$href = _window$location.href) === null || _window$location$href === void 0 ? void 0 : _window$location$href.includes("citizen"));
|
|
9671
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
9672
|
+
className: !isCitizen ? "employeeCard" : ""
|
|
9673
|
+
}, /*#__PURE__*/React.createElement(CHBCitizenDetailsNew, {
|
|
9442
9674
|
onGoBack: onGoBack,
|
|
9443
9675
|
goNext: goNext,
|
|
9444
9676
|
currentStepData: currentStepData,
|
|
9445
9677
|
t: t
|
|
9446
|
-
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9678
|
+
})), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9447
9679
|
isDleteBtn: true,
|
|
9448
9680
|
error: true,
|
|
9449
9681
|
label: error,
|
|
@@ -10212,7 +10444,8 @@ const SearchFormFieldsComponents = ({
|
|
|
10212
10444
|
}, /*#__PURE__*/React.createElement("div", {
|
|
10213
10445
|
className: "complaint-input-container",
|
|
10214
10446
|
style: {
|
|
10215
|
-
textAlign: "start"
|
|
10447
|
+
textAlign: "start",
|
|
10448
|
+
display: "flex"
|
|
10216
10449
|
}
|
|
10217
10450
|
}, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
|
|
10218
10451
|
name: "applicationNumber",
|
|
@@ -10227,11 +10460,11 @@ const SearchFormFieldsComponents = ({
|
|
|
10227
10460
|
}
|
|
10228
10461
|
}, searchFieldComponents)))));
|
|
10229
10462
|
}
|
|
10230
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("
|
|
10463
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
|
|
10231
10464
|
name: "applicationNumber",
|
|
10232
10465
|
inputRef: registerRef({})
|
|
10233
|
-
})), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("
|
|
10234
|
-
name: "
|
|
10466
|
+
})), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
|
|
10467
|
+
name: "mobileNumber",
|
|
10235
10468
|
inputRef: registerRef({})
|
|
10236
10469
|
})));
|
|
10237
10470
|
};
|
|
@@ -10730,6 +10963,39 @@ const Inbox = ({
|
|
|
10730
10963
|
}))));
|
|
10731
10964
|
};
|
|
10732
10965
|
|
|
10966
|
+
const GCBreadCrumbs = ({
|
|
10967
|
+
location,
|
|
10968
|
+
t
|
|
10969
|
+
}) => {
|
|
10970
|
+
const crumbs = [{
|
|
10971
|
+
path: "/digit-ui/employee",
|
|
10972
|
+
content: t("ES_COMMON_HOME"),
|
|
10973
|
+
show: true
|
|
10974
|
+
}, {
|
|
10975
|
+
path: "/digit-ui/employee/garbagecollection/inbox",
|
|
10976
|
+
content: t("CS_COMMON_INBOX"),
|
|
10977
|
+
show: location.pathname.includes("/garbagecollection/inbox") ? true : false
|
|
10978
|
+
}, {
|
|
10979
|
+
path: "/digit-ui/employee/garbagecollection/create-application",
|
|
10980
|
+
content: "Create Application",
|
|
10981
|
+
show: location.pathname.includes("/garbagecollection/create-application") ? true : false
|
|
10982
|
+
}, {
|
|
10983
|
+
path: "/digit-ui/employee/garbagecollection/applicationsearch/application-details",
|
|
10984
|
+
content: "Application Overview",
|
|
10985
|
+
show: location.pathname.includes("/garbagecollection/applicationsearch/application-details") ? true : false
|
|
10986
|
+
}, {
|
|
10987
|
+
path: "/digit-ui/employee/garbagecollection/generate-bill",
|
|
10988
|
+
content: "Generate Bill",
|
|
10989
|
+
show: location.pathname.includes("/garbagecollection/generate-bill") ? true : false
|
|
10990
|
+
}, {
|
|
10991
|
+
path: "/digit-ui/employee/garbagecollection/bill-genie",
|
|
10992
|
+
content: "Bill-Genie",
|
|
10993
|
+
show: location.pathname.includes("/garbagecollection/bill-genie") ? true : false
|
|
10994
|
+
}];
|
|
10995
|
+
return /*#__PURE__*/React.createElement(BreadCrumb, {
|
|
10996
|
+
crumbs: crumbs
|
|
10997
|
+
});
|
|
10998
|
+
};
|
|
10733
10999
|
const EmployeeApp = ({
|
|
10734
11000
|
path,
|
|
10735
11001
|
url,
|
|
@@ -10761,20 +11027,15 @@ const EmployeeApp = ({
|
|
|
10761
11027
|
const BillGenie = (_Digit5 = Digit) === null || _Digit5 === void 0 ? void 0 : (_Digit5$ComponentRegi = _Digit5.ComponentRegistryService) === null || _Digit5$ComponentRegi === void 0 ? void 0 : _Digit5$ComponentRegi.getComponent("BillGenie");
|
|
10762
11028
|
const isRes = window.location.href.includes("garbagecollection/response");
|
|
10763
11029
|
const isNewRegistration = window.location.href.includes("searchhall") || window.location.href.includes("modify-application") || window.location.href.includes("garbagecollection/application-details");
|
|
10764
|
-
return /*#__PURE__*/React.createElement(
|
|
11030
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
10765
11031
|
className: "ground-container"
|
|
10766
11032
|
}, !isRes ? /*#__PURE__*/React.createElement("div", {
|
|
10767
|
-
style:
|
|
10768
|
-
marginLeft: "
|
|
10769
|
-
display: "flex",
|
|
10770
|
-
alignItems: "center"
|
|
10771
|
-
} : {
|
|
10772
|
-
marginLeft: "-4px",
|
|
10773
|
-
display: "flex",
|
|
10774
|
-
alignItems: "center"
|
|
11033
|
+
style: {
|
|
11034
|
+
marginLeft: "10px"
|
|
10775
11035
|
}
|
|
10776
|
-
}, /*#__PURE__*/React.createElement(
|
|
10777
|
-
location: location
|
|
11036
|
+
}, /*#__PURE__*/React.createElement(GCBreadCrumbs, {
|
|
11037
|
+
location: location,
|
|
11038
|
+
t: t
|
|
10778
11039
|
})) : null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
10779
11040
|
path: `${path}/inbox`,
|
|
10780
11041
|
component: () => /*#__PURE__*/React.createElement(Inbox, {
|
|
@@ -10802,11 +11063,35 @@ const EmployeeApp = ({
|
|
|
10802
11063
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
10803
11064
|
path: `${path}/response/:id`,
|
|
10804
11065
|
component: GCResponseCitizen
|
|
10805
|
-
})))
|
|
11066
|
+
})));
|
|
10806
11067
|
};
|
|
10807
11068
|
|
|
11069
|
+
const GCBreadCrumbs$1 = ({
|
|
11070
|
+
location
|
|
11071
|
+
}) => {
|
|
11072
|
+
const {
|
|
11073
|
+
t
|
|
11074
|
+
} = useTranslation();
|
|
11075
|
+
const crumbs = [{
|
|
11076
|
+
path: "/digit-ui/citizen",
|
|
11077
|
+
content: t("ES_COMMON_HOME"),
|
|
11078
|
+
show: true
|
|
11079
|
+
}, {
|
|
11080
|
+
path: "/digit-ui/citizen/garbagecollection-home",
|
|
11081
|
+
content: `${t("Garbage Collection")} Home`,
|
|
11082
|
+
show: location.pathname.includes("garbagecollection/") ? true : false
|
|
11083
|
+
}, {
|
|
11084
|
+
path: "/digit-ui/citizen/ptr-home",
|
|
11085
|
+
content: t("PET_NDCSERVICE"),
|
|
11086
|
+
show: location.pathname.includes("ptr/petservice/test") ? true : false
|
|
11087
|
+
}];
|
|
11088
|
+
return /*#__PURE__*/React.createElement(BreadCrumb, {
|
|
11089
|
+
crumbs: crumbs
|
|
11090
|
+
});
|
|
11091
|
+
};
|
|
10808
11092
|
const App = () => {
|
|
10809
11093
|
var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi;
|
|
11094
|
+
const location = useLocation();
|
|
10810
11095
|
const {
|
|
10811
11096
|
path,
|
|
10812
11097
|
url,
|
|
@@ -10816,13 +11101,22 @@ const App = () => {
|
|
|
10816
11101
|
const GCMyApplications = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("GCMyApplications");
|
|
10817
11102
|
const GCApplicationDetails = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent("GCApplicationDetails");
|
|
10818
11103
|
const GCResponseCitizen = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent("GCResponseCitizen");
|
|
11104
|
+
const isResponse = window.location.href.includes("/response");
|
|
11105
|
+
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
10819
11106
|
return /*#__PURE__*/React.createElement("span", {
|
|
10820
|
-
className: "
|
|
10821
|
-
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(BackButton, {
|
|
11107
|
+
className: "chb-citizen",
|
|
10822
11108
|
style: {
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
11109
|
+
width: "100%",
|
|
11110
|
+
paddingRight: "25px",
|
|
11111
|
+
paddingLeft: "25px"
|
|
11112
|
+
}
|
|
11113
|
+
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, !isResponse ? /*#__PURE__*/React.createElement("div", {
|
|
11114
|
+
style: window.location.href.includes("application-overview") || isMobile ? {
|
|
11115
|
+
marginLeft: "10px"
|
|
11116
|
+
} : {}
|
|
11117
|
+
}, /*#__PURE__*/React.createElement(GCBreadCrumbs$1, {
|
|
11118
|
+
location: location
|
|
11119
|
+
})) : null, " ", /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
10826
11120
|
path: `${path}/my-applications`,
|
|
10827
11121
|
component: GCMyApplications
|
|
10828
11122
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
@@ -11363,8 +11657,8 @@ ListCache.prototype.has = _listCacheHas;
|
|
|
11363
11657
|
ListCache.prototype.set = _listCacheSet;
|
|
11364
11658
|
var _ListCache = ListCache;
|
|
11365
11659
|
|
|
11366
|
-
var Map = _getNative(_root, 'Map');
|
|
11367
|
-
var _Map = Map;
|
|
11660
|
+
var Map$1 = _getNative(_root, 'Map');
|
|
11661
|
+
var _Map = Map$1;
|
|
11368
11662
|
|
|
11369
11663
|
function mapCacheClear() {
|
|
11370
11664
|
this.size = 0;
|
|
@@ -11478,6 +11772,86 @@ var stringToPath = _memoizeCapped(function (string) {
|
|
|
11478
11772
|
return result;
|
|
11479
11773
|
});
|
|
11480
11774
|
|
|
11775
|
+
const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles = {}, t) => {
|
|
11776
|
+
var _workflowDetails$data, _workflowDetails$data2, _processInstances$, _processInstances$2, _processInstances$3, _timeline$, _timeline$2, _timeline$3, _timeline$4;
|
|
11777
|
+
console.log('pdfFiles', pdfFiles);
|
|
11778
|
+
const timeline = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.timeline) || [];
|
|
11779
|
+
const processInstances = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.processInstances) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.processInstances) || [];
|
|
11780
|
+
const businessId = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$ = processInstances[0]) === null || _processInstances$ === void 0 ? void 0 : _processInstances$.businessId) || "N/A";
|
|
11781
|
+
const businessService = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$2 = processInstances[0]) === null || _processInstances$2 === void 0 ? void 0 : _processInstances$2.businessService) || "N/A";
|
|
11782
|
+
const moduleName = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$3 = processInstances[0]) === null || _processInstances$3 === void 0 ? void 0 : _processInstances$3.moduleName) || "N/A";
|
|
11783
|
+
const pdfDownloadLink = (documents, fileStoreId) => {
|
|
11784
|
+
var _downloadLink$split;
|
|
11785
|
+
const downloadLink = (documents === null || documents === void 0 ? void 0 : documents[fileStoreId]) || "";
|
|
11786
|
+
const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
|
|
11787
|
+
return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
|
|
11788
|
+
};
|
|
11789
|
+
const pattern = /\[#\?.*?\*\*\]/;
|
|
11790
|
+
const timelineRows = timeline.map((item, index) => {
|
|
11791
|
+
var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
|
|
11792
|
+
const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
|
|
11793
|
+
const timing = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.timing) || "N/A";
|
|
11794
|
+
const assignerName = (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A";
|
|
11795
|
+
const assignerType = (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.type) || "N/A";
|
|
11796
|
+
const mobileNumber = (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.mobileNumber) || "N/A";
|
|
11797
|
+
const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
|
|
11798
|
+
const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
|
|
11799
|
+
const rawComment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
|
|
11800
|
+
const comment = typeof rawComment === "string" ? rawComment.split(pattern)[0] : rawComment;
|
|
11801
|
+
const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
|
|
11802
|
+
const sla = (item === null || item === void 0 ? void 0 : item.sla) || "N/A";
|
|
11803
|
+
const assignedTo = Array.isArray(item === null || item === void 0 ? void 0 : item.assignes) ? item.assignes.map(a => a === null || a === void 0 ? void 0 : a.name).filter(Boolean).join(", ") : "";
|
|
11804
|
+
return {
|
|
11805
|
+
sNo: index + 1,
|
|
11806
|
+
action: t ? t(action) : action,
|
|
11807
|
+
status: t ? t(status) : status,
|
|
11808
|
+
assignerName,
|
|
11809
|
+
assignerType,
|
|
11810
|
+
mobileNumber,
|
|
11811
|
+
designation: assignerType,
|
|
11812
|
+
date: createdDate,
|
|
11813
|
+
time: timing,
|
|
11814
|
+
dateTime: `${createdDate} ${timing !== "N/A" ? timing : ""}`.trim(),
|
|
11815
|
+
comment,
|
|
11816
|
+
documents: documents.map(doc => ({
|
|
11817
|
+
name: (doc === null || doc === void 0 ? void 0 : doc.fileName) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
|
|
11818
|
+
type: (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
|
|
11819
|
+
fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
|
|
11820
|
+
link: pdfDownloadLink(pdfFiles, doc === null || doc === void 0 ? void 0 : doc.fileStoreId)
|
|
11821
|
+
})),
|
|
11822
|
+
hasDocuments: documents.length > 0,
|
|
11823
|
+
sla,
|
|
11824
|
+
assignedTo
|
|
11825
|
+
};
|
|
11826
|
+
});
|
|
11827
|
+
return {
|
|
11828
|
+
t,
|
|
11829
|
+
tenantId: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code) || "",
|
|
11830
|
+
tenantName: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.i18nKey) || "Government Department",
|
|
11831
|
+
name: t ? t("TIMELINE_PDF_TITLE") : "Application Timeline",
|
|
11832
|
+
heading: t ? t("TIMELINE_PDF_HEADING") : "File Movement Report",
|
|
11833
|
+
businessId,
|
|
11834
|
+
businessService: t ? t(`CS_COMMON_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`) : businessService,
|
|
11835
|
+
moduleName,
|
|
11836
|
+
currentStatus: t ? t((timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$2 = timeline[0]) === null || _timeline$2 === void 0 ? void 0 : _timeline$2.state) || "N/A") : (timeline === null || timeline === void 0 ? void 0 : (_timeline$3 = timeline[0]) === null || _timeline$3 === void 0 ? void 0 : _timeline$3.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$4 = timeline[0]) === null || _timeline$4 === void 0 ? void 0 : _timeline$4.state) || "N/A",
|
|
11837
|
+
generatedDate: new Date().toLocaleDateString("en-IN", {
|
|
11838
|
+
day: "2-digit",
|
|
11839
|
+
month: "long",
|
|
11840
|
+
year: "numeric"
|
|
11841
|
+
}),
|
|
11842
|
+
generatedDateTime: new Date().toLocaleString("en-IN", {
|
|
11843
|
+
day: "2-digit",
|
|
11844
|
+
month: "2-digit",
|
|
11845
|
+
year: "numeric",
|
|
11846
|
+
hour: "2-digit",
|
|
11847
|
+
minute: "2-digit",
|
|
11848
|
+
hour12: true
|
|
11849
|
+
}),
|
|
11850
|
+
timelineRows,
|
|
11851
|
+
totalSteps: timelineRows.length
|
|
11852
|
+
};
|
|
11853
|
+
};
|
|
11854
|
+
|
|
11481
11855
|
const PDFSvg$1 = React.memo(({
|
|
11482
11856
|
width: _width = 20,
|
|
11483
11857
|
height: _height = 20,
|
|
@@ -11520,7 +11894,7 @@ const TimelineDocument = React.memo(({
|
|
|
11520
11894
|
return /*#__PURE__*/React.createElement("div", {
|
|
11521
11895
|
className: "custom-doc-container"
|
|
11522
11896
|
}, documents === null || documents === void 0 ? void 0 : documents.map((document, idx) => {
|
|
11523
|
-
const documentLink = pdfDownloadLink$1(data === null || data === void 0 ? void 0 : data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
|
|
11897
|
+
const documentLink = pdfDownloadLink$1(data === null || data === void 0 ? void 0 : data.pdfFiles, (document === null || document === void 0 ? void 0 : document.fileStoreId) || (document === null || document === void 0 ? void 0 : document.documentUid));
|
|
11524
11898
|
if (!documentLink) return null;
|
|
11525
11899
|
return /*#__PURE__*/React.createElement("a", {
|
|
11526
11900
|
key: idx,
|
|
@@ -11533,8 +11907,28 @@ const TimelineDocument = React.memo(({
|
|
|
11533
11907
|
});
|
|
11534
11908
|
function NewApplicationTimeline({
|
|
11535
11909
|
workflowDetails,
|
|
11536
|
-
t
|
|
11910
|
+
t,
|
|
11911
|
+
tenantId = Digit.ULBService.getCurrentTenantId(),
|
|
11912
|
+
timeObj,
|
|
11913
|
+
empUserName = null,
|
|
11914
|
+
handleSetEmpDesignation = () => {}
|
|
11537
11915
|
}) {
|
|
11916
|
+
var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
|
|
11917
|
+
const {
|
|
11918
|
+
isLoading,
|
|
11919
|
+
data: docData
|
|
11920
|
+
} = Digit.Hooks.ads.useADSDocumentSearch({
|
|
11921
|
+
value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : (_workflowDetails$data2 = _workflowDetails$data.timeline) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
|
|
11922
|
+
}, {
|
|
11923
|
+
value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
|
|
11924
|
+
}, null, 0);
|
|
11925
|
+
const handleDownloadPDF = React.useCallback(() => {
|
|
11926
|
+
if (!isLoading) {
|
|
11927
|
+
const tenantInfo = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY") || {};
|
|
11928
|
+
const acknowledgementData = getTimelineAcknowledgementData(workflowDetails, tenantInfo, (docData === null || docData === void 0 ? void 0 : docData.pdfFiles) || {}, t);
|
|
11929
|
+
Digit.Utils.pdf.generateTimelinePDF(acknowledgementData);
|
|
11930
|
+
}
|
|
11931
|
+
}, [workflowDetails, docData, t, isLoading]);
|
|
11538
11932
|
const parseActionDateTime = auditDetails => {
|
|
11539
11933
|
if (!(auditDetails !== null && auditDetails !== void 0 && auditDetails.created) || !(auditDetails !== null && auditDetails !== void 0 && auditDetails.timing)) return null;
|
|
11540
11934
|
const [day, month, year] = auditDetails.created.split("/");
|
|
@@ -11573,11 +11967,37 @@ function NewApplicationTimeline({
|
|
|
11573
11967
|
return normalized.reverse();
|
|
11574
11968
|
};
|
|
11575
11969
|
const data = useMemo(() => normalizeTimeline(workflowDetails), [workflowDetails]);
|
|
11576
|
-
const sortedData = data || [];
|
|
11577
|
-
|
|
11970
|
+
const sortedData = (data === null || data === void 0 ? void 0 : data.filter(val => !((val === null || val === void 0 ? void 0 : val.performedAction) === "SAVE_AS_DRAFT"))) || [];
|
|
11971
|
+
const codesArray = sortedData.map(item => {
|
|
11972
|
+
var _item$assigner;
|
|
11973
|
+
return item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.userName;
|
|
11974
|
+
}).filter(Boolean);
|
|
11975
|
+
const uniqueCodes = [...new Set(codesArray)].join(",");
|
|
11976
|
+
const employeeData = Digit.Hooks.useEmployeeSearch(tenantId, {
|
|
11977
|
+
codes: uniqueCodes,
|
|
11978
|
+
isActive: true
|
|
11979
|
+
}, {
|
|
11980
|
+
enabled: !!uniqueCodes
|
|
11981
|
+
});
|
|
11982
|
+
const deptMap = {};
|
|
11983
|
+
employeeData === null || employeeData === void 0 ? void 0 : (_employeeData$data = employeeData.data) === null || _employeeData$data === void 0 ? void 0 : (_employeeData$data$Em = _employeeData$data.Employees) === null || _employeeData$data$Em === void 0 ? void 0 : _employeeData$data$Em.forEach(emp => {
|
|
11984
|
+
var _emp$assignments;
|
|
11985
|
+
const assignment = emp === null || emp === void 0 ? void 0 : (_emp$assignments = emp.assignments) === null || _emp$assignments === void 0 ? void 0 : _emp$assignments[0];
|
|
11986
|
+
const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
|
|
11987
|
+
deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
|
|
11988
|
+
});
|
|
11989
|
+
if (employeeData && empUserName) {
|
|
11990
|
+
handleSetEmpDesignation(t(deptMap[empUserName]));
|
|
11991
|
+
}
|
|
11992
|
+
if (isLoading) return /*#__PURE__*/React.createElement(Loader$1, null);
|
|
11578
11993
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
11579
11994
|
className: "custom-timeline-container"
|
|
11580
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
11995
|
+
}, timeObj && /*#__PURE__*/React.createElement("div", {
|
|
11996
|
+
style: {
|
|
11997
|
+
marginBottom: "8px",
|
|
11998
|
+
fontStyle: "italic"
|
|
11999
|
+
}
|
|
12000
|
+
}, t("TOTAL_TIME_TAKEN"), ": ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.days, " ", t("DAYS"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.hours, " ", t("HOURS"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.minutes, " ", t("MINUTES"), " ", timeObj === null || timeObj === void 0 ? void 0 : timeObj.seconds, " ", t("SECONDS")), /*#__PURE__*/React.createElement("div", {
|
|
11581
12001
|
className: "custom-timeline-header"
|
|
11582
12002
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11583
12003
|
className: "custom-tracking-status-header"
|
|
@@ -11591,12 +12011,15 @@ function NewApplicationTimeline({
|
|
|
11591
12011
|
className: "custom-title-bar-row"
|
|
11592
12012
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
11593
12013
|
className: "custom-timeline-title"
|
|
11594
|
-
}, t("Application History")), /*#__PURE__*/React.createElement("
|
|
12014
|
+
}, t("Application History")), /*#__PURE__*/React.createElement("span", {
|
|
12015
|
+
onClick: handleDownloadPDF,
|
|
12016
|
+
className: "download-button"
|
|
12017
|
+
}, t("CS_COMMON_DOWNLOAD")), /*#__PURE__*/React.createElement("div", {
|
|
11595
12018
|
className: "custom-blue-bar"
|
|
11596
12019
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
11597
12020
|
className: "custom-timeline-entries"
|
|
11598
12021
|
}, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
|
|
11599
|
-
var _item$auditDetails, _item$auditDetails2, _item$
|
|
12022
|
+
var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$assigner5, _item$assigner6, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
|
|
11600
12023
|
return /*#__PURE__*/React.createElement("div", {
|
|
11601
12024
|
key: index,
|
|
11602
12025
|
className: "custom-timeline-entry"
|
|
@@ -11626,46 +12049,58 @@ function NewApplicationTimeline({
|
|
|
11626
12049
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11627
12050
|
className: "custom-card-top"
|
|
11628
12051
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11629
|
-
className: "custom-card-
|
|
12052
|
+
className: "custom-card-column"
|
|
11630
12053
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
11631
12054
|
className: "custom-action-title"
|
|
11632
12055
|
}, t("Action taken by")), (item === null || item === void 0 ? void 0 : item.assigner) && /*#__PURE__*/React.createElement("div", {
|
|
11633
12056
|
className: "custom-officer-info"
|
|
11634
12057
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11635
12058
|
className: "custom-officer-name"
|
|
11636
|
-
}, (item === null || item === void 0 ? void 0 : (_item$
|
|
12059
|
+
}, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("span", {
|
|
12060
|
+
className: "custom-officer-name"
|
|
12061
|
+
}, "- ", t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName]))), (item === null || item === void 0 ? void 0 : (_item$assigner5 = item.assigner) === null || _item$assigner5 === void 0 ? void 0 : _item$assigner5.emailId) && /*#__PURE__*/React.createElement("div", {
|
|
11637
12062
|
className: "custom-officer-email"
|
|
11638
12063
|
}, /*#__PURE__*/React.createElement("span", {
|
|
11639
12064
|
className: "custom-email-label"
|
|
11640
|
-
}, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$
|
|
11641
|
-
className: "custom-card-
|
|
11642
|
-
}, /*#__PURE__*/React.createElement("h3", {
|
|
12065
|
+
}, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
|
|
12066
|
+
className: "custom-card-column custom-card-column-mid"
|
|
12067
|
+
}, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
11643
12068
|
className: "custom-action-title"
|
|
11644
12069
|
}, t("Time Taken")), /*#__PURE__*/React.createElement("div", {
|
|
11645
12070
|
className: "custom-officer-email"
|
|
11646
12071
|
}, /*#__PURE__*/React.createElement("span", {
|
|
11647
12072
|
className: "custom-email-label"
|
|
11648
|
-
}, item === null || item === void 0 ? void 0 : item.sla))), /*#__PURE__*/React.createElement("div", {
|
|
11649
|
-
className: "custom-card-right"
|
|
12073
|
+
}, item === null || item === void 0 ? void 0 : item.sla)))), /*#__PURE__*/React.createElement("div", {
|
|
12074
|
+
className: "custom-card-column custom-card-column-right"
|
|
11650
12075
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
11651
12076
|
className: "custom-action-title"
|
|
11652
12077
|
}, t("Action")), /*#__PURE__*/React.createElement("div", {
|
|
11653
12078
|
className: "custom-status-text"
|
|
11654
12079
|
}, t((item === null || item === void 0 ? void 0 : item.performedAction) || "CS_COMMON_NA")))), (item === null || item === void 0 ? void 0 : item.wfComment) && (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment.length) > 0 && (item === null || item === void 0 ? void 0 : (_item$wfComment2 = item.wfComment) === null || _item$wfComment2 === void 0 ? void 0 : _item$wfComment2.some(c => c === null || c === void 0 ? void 0 : c.trim())) && /*#__PURE__*/React.createElement("div", {
|
|
11655
|
-
className: "custom-comments-section"
|
|
12080
|
+
className: "custom-comments-section container-full-width"
|
|
11656
12081
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11657
|
-
className: "custom-
|
|
12082
|
+
className: "custom-comments-content"
|
|
11658
12083
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
11659
12084
|
className: "custom-comments-title"
|
|
11660
|
-
}, t("Officer Comments")),
|
|
11661
|
-
|
|
11662
|
-
},
|
|
12085
|
+
}, t("Officer Comments")), /*#__PURE__*/React.createElement("div", {
|
|
12086
|
+
className: "custom-comment-text"
|
|
12087
|
+
}, item === null || item === void 0 ? void 0 : (_item$wfComment3 = item.wfComment) === null || _item$wfComment3 === void 0 ? void 0 : _item$wfComment3.map((comment, idx) => {
|
|
12088
|
+
const pattern = /\[#\?.*?\*\*\]/;
|
|
12089
|
+
const truncatedComment = typeof comment === "string" ? comment === null || comment === void 0 ? void 0 : comment.split(pattern)[0] : comment;
|
|
12090
|
+
return /*#__PURE__*/React.createElement("p", {
|
|
12091
|
+
key: idx
|
|
12092
|
+
}, truncatedComment);
|
|
12093
|
+
}))), (item === null || item === void 0 ? void 0 : (_item$assignes = item.assignes) === null || _item$assignes === void 0 ? void 0 : _item$assignes.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
12094
|
+
className: "custom-assigned-to-footer"
|
|
12095
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
11663
12096
|
className: "custom-comments-title"
|
|
11664
12097
|
}, t("Assigned To")), /*#__PURE__*/React.createElement("div", {
|
|
11665
12098
|
className: "custom-officer-info"
|
|
11666
12099
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11667
12100
|
className: "custom-officer-name"
|
|
11668
|
-
}, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name
|
|
12101
|
+
}, (_item$assignes$ = item.assignes[0]) === null || _item$assignes$ === void 0 ? void 0 : _item$assignes$.name, deptMap[(_item$assignes$2 = item.assignes[0]) === null || _item$assignes$2 === void 0 ? void 0 : _item$assignes$2.userName] && /*#__PURE__*/React.createElement("span", {
|
|
12102
|
+
className: "custom-officer-email"
|
|
12103
|
+
}, "- ", t(deptMap[(_item$assignes$3 = item.assignes[0]) === null || _item$assignes$3 === void 0 ? void 0 : _item$assignes$3.userName])))))), (item === null || item === void 0 ? void 0 : item.wfDocuments) && (item === null || item === void 0 ? void 0 : (_item$wfDocuments = item.wfDocuments) === null || _item$wfDocuments === void 0 ? void 0 : _item$wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
11669
12104
|
className: "custom-comments-section-no-border"
|
|
11670
12105
|
}, /*#__PURE__*/React.createElement("h4", {
|
|
11671
12106
|
className: "custom-comments-title"
|
|
@@ -12263,6 +12698,7 @@ const NDCModal = ({
|
|
|
12263
12698
|
formId: "modal-action"
|
|
12264
12699
|
}, /*#__PURE__*/React.createElement(FormComposer, {
|
|
12265
12700
|
config: config.form,
|
|
12701
|
+
className: "BPAemployeeCard bpa-workflow-modal-form",
|
|
12266
12702
|
noBoxShadow: true,
|
|
12267
12703
|
inline: true,
|
|
12268
12704
|
childrenAtTheBottom: true,
|
|
@@ -12279,7 +12715,7 @@ const NDCModal = ({
|
|
|
12279
12715
|
};
|
|
12280
12716
|
|
|
12281
12717
|
const ChallanApplicationDetails$1 = () => {
|
|
12282
|
-
var _getChallanData$proce, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _getChallanData$conne, _getChallanData$conne2, _getChallanData$conne3, _getChallanData$conne4, _getChallanData$conne5, _getChallanData$conne6, _getChallanData$conne7, _getChallanData$conne8, _getChallanData$conne9, _getChallanData$conne0, _getChallanData$docum, _getChallanData$docum2, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12;
|
|
12718
|
+
var _getChallanData$proce, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _user$info2, _user$info2$roles$fin, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _getChallanData$conne, _getChallanData$conne2, _getChallanData$conne3, _getChallanData$conne4, _getChallanData$conne5, _getChallanData$conne6, _getChallanData$conne7, _getChallanData$conne8, _getChallanData$conne9, _getChallanData$conne0, _getChallanData$docum, _getChallanData$docum2, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12;
|
|
12283
12719
|
const {
|
|
12284
12720
|
t
|
|
12285
12721
|
} = useTranslation();
|
|
@@ -12302,6 +12738,13 @@ const ChallanApplicationDetails$1 = () => {
|
|
|
12302
12738
|
const [getEmployees, setEmployees] = useState([]);
|
|
12303
12739
|
const [errorOne, setErrorOne] = useState(null);
|
|
12304
12740
|
const menuRef = useRef();
|
|
12741
|
+
const [showOptions, setShowOptions] = useState(false);
|
|
12742
|
+
const {
|
|
12743
|
+
data: storeData
|
|
12744
|
+
} = Digit.Hooks.useStore.getInitData();
|
|
12745
|
+
const {
|
|
12746
|
+
tenants
|
|
12747
|
+
} = storeData || {};
|
|
12305
12748
|
const fetchChallans = async filters => {
|
|
12306
12749
|
setLoader(true);
|
|
12307
12750
|
try {
|
|
@@ -12356,6 +12799,82 @@ const ChallanApplicationDetails$1 = () => {
|
|
|
12356
12799
|
console.log("workflowDetails", workflowDetails);
|
|
12357
12800
|
let user = Digit.UserService.getUser();
|
|
12358
12801
|
const userRoles = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
|
|
12802
|
+
const isCemp = user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : (_user$info2$roles$fin = _user$info2.roles.find(role => role.code === "GC_CEMP")) === null || _user$info2$roles$fin === void 0 ? void 0 : _user$info2$roles$fin.code;
|
|
12803
|
+
const getAcknowledgement = async () => {
|
|
12804
|
+
setLoader(true);
|
|
12805
|
+
try {
|
|
12806
|
+
const applications = getChallanData;
|
|
12807
|
+
const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
|
|
12808
|
+
const acknowldgementDataAPI = await getAcknowledgementData({
|
|
12809
|
+
...applications
|
|
12810
|
+
}, tenantInfo, t);
|
|
12811
|
+
setTimeout(() => {
|
|
12812
|
+
Digit.Utils.pdf.generate(acknowldgementDataAPI);
|
|
12813
|
+
setLoader(false);
|
|
12814
|
+
}, 0);
|
|
12815
|
+
} catch (error) {
|
|
12816
|
+
console.error("Error generating acknowledgement:", error);
|
|
12817
|
+
setLoader(false);
|
|
12818
|
+
}
|
|
12819
|
+
};
|
|
12820
|
+
const {
|
|
12821
|
+
data: reciept_data,
|
|
12822
|
+
isLoading: recieptDataLoading
|
|
12823
|
+
} = Digit.Hooks.useRecieptSearch({
|
|
12824
|
+
tenantId: tenantId,
|
|
12825
|
+
businessService: "GC.ONE_TIME_FEE",
|
|
12826
|
+
consumerCodes: id,
|
|
12827
|
+
isEmployee: true
|
|
12828
|
+
}, {
|
|
12829
|
+
enabled: id ? true : false
|
|
12830
|
+
});
|
|
12831
|
+
const dowloadOptions = [];
|
|
12832
|
+
dowloadOptions.push({
|
|
12833
|
+
label: t("CHB_DOWNLOAD_ACK_FORM"),
|
|
12834
|
+
onClick: () => getAcknowledgement()
|
|
12835
|
+
});
|
|
12836
|
+
async function getRecieptSearch({
|
|
12837
|
+
tenantId,
|
|
12838
|
+
payments,
|
|
12839
|
+
...params
|
|
12840
|
+
}) {
|
|
12841
|
+
setLoader(true);
|
|
12842
|
+
try {
|
|
12843
|
+
var _response;
|
|
12844
|
+
let response = null;
|
|
12845
|
+
if (payments !== null && payments !== void 0 && payments.fileStoreId) {
|
|
12846
|
+
response = {
|
|
12847
|
+
filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
|
|
12848
|
+
};
|
|
12849
|
+
} else {
|
|
12850
|
+
response = await Digit.PaymentService.generatePdf(tenantId, {
|
|
12851
|
+
Payments: [{
|
|
12852
|
+
...payments
|
|
12853
|
+
}]
|
|
12854
|
+
}, "garbage-receipt");
|
|
12855
|
+
}
|
|
12856
|
+
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
12857
|
+
fileStoreIds: response.filestoreIds[0]
|
|
12858
|
+
});
|
|
12859
|
+
setLoader(false);
|
|
12860
|
+
window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
|
|
12861
|
+
} catch (error) {
|
|
12862
|
+
console.error(error);
|
|
12863
|
+
setLoader(false);
|
|
12864
|
+
}
|
|
12865
|
+
}
|
|
12866
|
+
if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
|
|
12867
|
+
dowloadOptions.push({
|
|
12868
|
+
label: t("PTR_FEE_RECIEPT"),
|
|
12869
|
+
onClick: () => {
|
|
12870
|
+
var _reciept_data$Payment;
|
|
12871
|
+
return getRecieptSearch({
|
|
12872
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
|
|
12873
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
|
|
12874
|
+
});
|
|
12875
|
+
}
|
|
12876
|
+
});
|
|
12877
|
+
}
|
|
12359
12878
|
let actions = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : (_workflowDetails$data7 = _workflowDetails$data6.actionState) === null || _workflowDetails$data7 === void 0 ? void 0 : (_workflowDetails$data8 = _workflowDetails$data7.nextActions) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.filter(e => {
|
|
12360
12879
|
return (userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => {
|
|
12361
12880
|
var _e$roles;
|
|
@@ -12433,7 +12952,48 @@ const ChallanApplicationDetails$1 = () => {
|
|
|
12433
12952
|
setLoader(false);
|
|
12434
12953
|
}
|
|
12435
12954
|
};
|
|
12436
|
-
|
|
12955
|
+
console.log("getChallanData", getChallanData);
|
|
12956
|
+
const handleDiscontinue = async data => {
|
|
12957
|
+
console.log("data", data);
|
|
12958
|
+
setLoader(true);
|
|
12959
|
+
const payload = {
|
|
12960
|
+
GarbageConnection: {
|
|
12961
|
+
...data,
|
|
12962
|
+
applicationType: "DISCONNECT_GARBAGE_CONNECTION",
|
|
12963
|
+
processInstance: {
|
|
12964
|
+
...(data === null || data === void 0 ? void 0 : data.processInstance),
|
|
12965
|
+
action: "INITIATE"
|
|
12966
|
+
}
|
|
12967
|
+
},
|
|
12968
|
+
disconnectRequest: true
|
|
12969
|
+
};
|
|
12970
|
+
console.log("payload===", payload);
|
|
12971
|
+
try {
|
|
12972
|
+
const response = await Digit.GCService.create(payload);
|
|
12973
|
+
console.log("response", response);
|
|
12974
|
+
setLable("Connection Disconnected Successfully");
|
|
12975
|
+
setError(false);
|
|
12976
|
+
setShowToast(true);
|
|
12977
|
+
setTimeout(() => {
|
|
12978
|
+
history.push("/digit-ui/employee/garbagecollection/inbox");
|
|
12979
|
+
window.location.reload();
|
|
12980
|
+
}, 2000);
|
|
12981
|
+
setLoader(false);
|
|
12982
|
+
} catch (error) {
|
|
12983
|
+
setLoader(false);
|
|
12984
|
+
}
|
|
12985
|
+
};
|
|
12986
|
+
const hideStatuses = ["INITIATED", "CONNECTION_ACTIVATED", "APPROVED"];
|
|
12987
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
12988
|
+
className: "cardHeaderWithOptions ral-app-details-header"
|
|
12989
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
12990
|
+
className: "ral-header-32"
|
|
12991
|
+
}, t("Application Details")), isCemp && ((getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) === "APPROVED" || (getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) === "CONNECTION_ACTIVATED") && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
|
|
12992
|
+
className: "multilinkWrapper",
|
|
12993
|
+
onHeadClick: () => setShowOptions(!showOptions),
|
|
12994
|
+
displayOptions: showOptions,
|
|
12995
|
+
options: dowloadOptions
|
|
12996
|
+
})), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, {
|
|
12437
12997
|
style: {
|
|
12438
12998
|
fontSize: "24px",
|
|
12439
12999
|
margin: "30px 0 5px"
|
|
@@ -12525,7 +13085,7 @@ const ChallanApplicationDetails$1 = () => {
|
|
|
12525
13085
|
}, t(doc === null || doc === void 0 ? void 0 : doc.documentType))))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), /*#__PURE__*/React.createElement(NewApplicationTimeline, {
|
|
12526
13086
|
workflowDetails: workflowDetails,
|
|
12527
13087
|
t: t
|
|
12528
|
-
}), (getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus)
|
|
13088
|
+
}), !hideStatuses.includes(getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && (_workflowDetails$data10 = _workflowDetails$data1.actionState) !== null && _workflowDetails$data10 !== void 0 && _workflowDetails$data10.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
|
|
12529
13089
|
localeKeyPrefix: `WF_GC`,
|
|
12530
13090
|
options: actions,
|
|
12531
13091
|
optionKey: "action",
|
|
@@ -12541,6 +13101,13 @@ const ChallanApplicationDetails$1 = () => {
|
|
|
12541
13101
|
const id = getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationNo;
|
|
12542
13102
|
history.push(`/digit-ui/employee/garbagecollection/create-application/${id}`);
|
|
12543
13103
|
}
|
|
13104
|
+
})), (getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.applicationStatus) == "CONNECTION_ACTIVATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
13105
|
+
style: {
|
|
13106
|
+
width: "200px"
|
|
13107
|
+
},
|
|
13108
|
+
label: t("GC_DISCONTINUE_SERVICE"),
|
|
13109
|
+
onSubmit: () => handleDiscontinue(getChallanData),
|
|
13110
|
+
disabled: loader
|
|
12544
13111
|
}))), showModal ? /*#__PURE__*/React.createElement(NDCModal, {
|
|
12545
13112
|
t: t,
|
|
12546
13113
|
action: selectedAction,
|
|
@@ -12580,6 +13147,15 @@ const GenerateBill = () => {
|
|
|
12580
13147
|
const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
|
|
12581
13148
|
const [loader, setLoader] = useState(false);
|
|
12582
13149
|
const [getData, setData] = useState();
|
|
13150
|
+
const [showToast, setShowToast] = useState(false);
|
|
13151
|
+
const [error, setError] = useState("");
|
|
13152
|
+
const [getLable, setLable] = useState(false);
|
|
13153
|
+
const {
|
|
13154
|
+
data: FreqType = [],
|
|
13155
|
+
isLoading: FreqTypeLoading
|
|
13156
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "gc-services-masters", [{
|
|
13157
|
+
name: "GarbageCollectionFrequency"
|
|
13158
|
+
}]);
|
|
12583
13159
|
const {
|
|
12584
13160
|
control,
|
|
12585
13161
|
handleSubmit,
|
|
@@ -12592,7 +13168,32 @@ const GenerateBill = () => {
|
|
|
12592
13168
|
clearErrors
|
|
12593
13169
|
} = useForm();
|
|
12594
13170
|
const onSubmit = async data => {
|
|
12595
|
-
|
|
13171
|
+
var _data$batch, _data$locality, _data$frequency, _data$batchOrLocality;
|
|
13172
|
+
setLoader(true);
|
|
13173
|
+
const payload = {
|
|
13174
|
+
billScheduler: {
|
|
13175
|
+
tenantId: tenantId,
|
|
13176
|
+
locality: (data === null || data === void 0 ? void 0 : (_data$batch = data.batch) === null || _data$batch === void 0 ? void 0 : _data$batch.code) || (data === null || data === void 0 ? void 0 : (_data$locality = data.locality) === null || _data$locality === void 0 ? void 0 : _data$locality.code),
|
|
13177
|
+
billingcycleStartdate: 0,
|
|
13178
|
+
transactionType: data === null || data === void 0 ? void 0 : (_data$frequency = data.frequency) === null || _data$frequency === void 0 ? void 0 : _data$frequency.name,
|
|
13179
|
+
billingcycleEnddate: 0,
|
|
13180
|
+
isBatch: (data === null || data === void 0 ? void 0 : (_data$batchOrLocality = data.batchOrLocality) === null || _data$batchOrLocality === void 0 ? void 0 : _data$batchOrLocality.name) == "Batch" ? true : false,
|
|
13181
|
+
isGroup: false
|
|
13182
|
+
}
|
|
13183
|
+
};
|
|
13184
|
+
try {
|
|
13185
|
+
const response = await Digit.GCService.schedulerCreate(payload);
|
|
13186
|
+
setLoader(false);
|
|
13187
|
+
setLable("Bill Generated Successfully");
|
|
13188
|
+
setError(false);
|
|
13189
|
+
setShowToast(true);
|
|
13190
|
+
console.log("response", response);
|
|
13191
|
+
} catch (error) {
|
|
13192
|
+
setLoader(false);
|
|
13193
|
+
}
|
|
13194
|
+
};
|
|
13195
|
+
const closeToast = () => {
|
|
13196
|
+
setShowToast(null);
|
|
12596
13197
|
};
|
|
12597
13198
|
const batchLocality = [{
|
|
12598
13199
|
name: "Batch",
|
|
@@ -12648,7 +13249,7 @@ const GenerateBill = () => {
|
|
|
12648
13249
|
control: control,
|
|
12649
13250
|
name: "batchOrLocality",
|
|
12650
13251
|
rules: {
|
|
12651
|
-
required: t("
|
|
13252
|
+
required: t("This field is required")
|
|
12652
13253
|
},
|
|
12653
13254
|
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
12654
13255
|
style: {
|
|
@@ -12721,7 +13322,39 @@ const GenerateBill = () => {
|
|
|
12721
13322
|
style: {
|
|
12722
13323
|
color: "red"
|
|
12723
13324
|
}
|
|
12724
|
-
}, errors.batch.message))
|
|
13325
|
+
}, errors.batch.message)), /*#__PURE__*/React.createElement("div", {
|
|
13326
|
+
style: {
|
|
13327
|
+
flex: "0 0 20%",
|
|
13328
|
+
maxWidth: "20%"
|
|
13329
|
+
}
|
|
13330
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("GC_FREQUENCY")}`, "*"), /*#__PURE__*/React.createElement(Controller, {
|
|
13331
|
+
control: control,
|
|
13332
|
+
name: "frequency",
|
|
13333
|
+
rules: {
|
|
13334
|
+
required: t("GC_FREQUENCY_REQUIRED")
|
|
13335
|
+
},
|
|
13336
|
+
render: props => {
|
|
13337
|
+
var _FreqType$gcServices;
|
|
13338
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
13339
|
+
style: {
|
|
13340
|
+
marginBottom: 0,
|
|
13341
|
+
width: "100%"
|
|
13342
|
+
},
|
|
13343
|
+
className: "form-field",
|
|
13344
|
+
select: e => {
|
|
13345
|
+
props.onChange(e);
|
|
13346
|
+
},
|
|
13347
|
+
selected: props.value,
|
|
13348
|
+
option: FreqType === null || FreqType === void 0 ? void 0 : (_FreqType$gcServices = FreqType["gc-services-masters"]) === null || _FreqType$gcServices === void 0 ? void 0 : _FreqType$gcServices.GarbageCollectionFrequency,
|
|
13349
|
+
optionKey: "name",
|
|
13350
|
+
t: t
|
|
13351
|
+
});
|
|
13352
|
+
}
|
|
13353
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.frequency) && /*#__PURE__*/React.createElement("p", {
|
|
13354
|
+
style: {
|
|
13355
|
+
color: "red"
|
|
13356
|
+
}
|
|
13357
|
+
}, errors.frequency.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
12725
13358
|
style: {
|
|
12726
13359
|
background: "#eee",
|
|
12727
13360
|
color: "black",
|
|
@@ -12732,11 +13365,55 @@ const GenerateBill = () => {
|
|
|
12732
13365
|
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
12733
13366
|
label: "Generate Bill",
|
|
12734
13367
|
submit: "submit"
|
|
12735
|
-
}))),
|
|
13368
|
+
}))), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
13369
|
+
isDleteBtn: true,
|
|
13370
|
+
error: error,
|
|
13371
|
+
label: getLable,
|
|
13372
|
+
onClose: closeToast
|
|
13373
|
+
}), (loader || FreqTypeLoading) && /*#__PURE__*/React.createElement(Loader, {
|
|
12736
13374
|
page: true
|
|
12737
13375
|
}));
|
|
12738
13376
|
};
|
|
12739
13377
|
|
|
13378
|
+
const ApplicationTable = ({
|
|
13379
|
+
t,
|
|
13380
|
+
currentPage,
|
|
13381
|
+
columns,
|
|
13382
|
+
data,
|
|
13383
|
+
getCellProps,
|
|
13384
|
+
disableSort,
|
|
13385
|
+
onSort,
|
|
13386
|
+
onNextPage,
|
|
13387
|
+
onPrevPage,
|
|
13388
|
+
onPageSizeChange,
|
|
13389
|
+
isPaginationRequired,
|
|
13390
|
+
pageSizeLimit,
|
|
13391
|
+
sortParams,
|
|
13392
|
+
totalRecords
|
|
13393
|
+
}) => {
|
|
13394
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
13395
|
+
t: t,
|
|
13396
|
+
data: data,
|
|
13397
|
+
currentPage: currentPage,
|
|
13398
|
+
columns: columns,
|
|
13399
|
+
getCellProps: getCellProps,
|
|
13400
|
+
onNextPage: onNextPage,
|
|
13401
|
+
onPrevPage: onPrevPage,
|
|
13402
|
+
pageSizeLimit: pageSizeLimit,
|
|
13403
|
+
disableSort: disableSort,
|
|
13404
|
+
isPaginationRequired: isPaginationRequired,
|
|
13405
|
+
onPageSizeChange: onPageSizeChange,
|
|
13406
|
+
onSort: onSort,
|
|
13407
|
+
sortParams: sortParams,
|
|
13408
|
+
totalRecords: totalRecords
|
|
13409
|
+
});
|
|
13410
|
+
};
|
|
13411
|
+
|
|
13412
|
+
const defaultValues = {
|
|
13413
|
+
locality: null,
|
|
13414
|
+
billNo: "",
|
|
13415
|
+
mobileNumber: ""
|
|
13416
|
+
};
|
|
12740
13417
|
const BillGenie = () => {
|
|
12741
13418
|
const dispatch = useDispatch();
|
|
12742
13419
|
const history = useHistory();
|
|
@@ -12746,6 +13423,10 @@ const BillGenie = () => {
|
|
|
12746
13423
|
const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
|
|
12747
13424
|
const [loader, setLoader] = useState(false);
|
|
12748
13425
|
const [getData, setData] = useState();
|
|
13426
|
+
const [getBills, setBills] = useState([]);
|
|
13427
|
+
const GetCell = value => /*#__PURE__*/React.createElement("span", {
|
|
13428
|
+
className: "cell-text styled-cell"
|
|
13429
|
+
}, value);
|
|
12749
13430
|
const {
|
|
12750
13431
|
control,
|
|
12751
13432
|
handleSubmit,
|
|
@@ -12755,10 +13436,117 @@ const BillGenie = () => {
|
|
|
12755
13436
|
},
|
|
12756
13437
|
getValues,
|
|
12757
13438
|
watch,
|
|
12758
|
-
clearErrors
|
|
12759
|
-
|
|
13439
|
+
clearErrors,
|
|
13440
|
+
reset
|
|
13441
|
+
} = useForm({
|
|
13442
|
+
defaultValues
|
|
13443
|
+
});
|
|
12760
13444
|
const onSubmit = async data => {
|
|
12761
|
-
|
|
13445
|
+
var _data$billNo, _data$mobileNumber, _data$locality;
|
|
13446
|
+
const hasAtLeastOneField = (data === null || data === void 0 ? void 0 : data.locality) || (data === null || data === void 0 ? void 0 : (_data$billNo = data.billNo) === null || _data$billNo === void 0 ? void 0 : _data$billNo.trim()) || (data === null || data === void 0 ? void 0 : (_data$mobileNumber = data.mobileNumber) === null || _data$mobileNumber === void 0 ? void 0 : _data$mobileNumber.trim());
|
|
13447
|
+
if (!hasAtLeastOneField) {
|
|
13448
|
+
alert(t("Please select at least one search criteria"));
|
|
13449
|
+
return;
|
|
13450
|
+
}
|
|
13451
|
+
setLoader(true);
|
|
13452
|
+
const payload = {
|
|
13453
|
+
searchCriteria: {
|
|
13454
|
+
tenantId: tenantId,
|
|
13455
|
+
url: "egov-searcher/bill-genie/garbagecollectionbills/_get",
|
|
13456
|
+
businesService: "GC",
|
|
13457
|
+
...((data === null || data === void 0 ? void 0 : (_data$locality = data.locality) === null || _data$locality === void 0 ? void 0 : _data$locality.code) && {
|
|
13458
|
+
locality: data.locality.code
|
|
13459
|
+
}),
|
|
13460
|
+
...((data === null || data === void 0 ? void 0 : data.billNo) && {
|
|
13461
|
+
consumerCode: data.billNo
|
|
13462
|
+
}),
|
|
13463
|
+
...((data === null || data === void 0 ? void 0 : data.mobileNumber) && {
|
|
13464
|
+
mobileNumber: data.mobileNumber
|
|
13465
|
+
})
|
|
13466
|
+
}
|
|
13467
|
+
};
|
|
13468
|
+
try {
|
|
13469
|
+
const response = await Digit.GCService.billGenieSearch(payload);
|
|
13470
|
+
setLoader(false);
|
|
13471
|
+
setBills(response === null || response === void 0 ? void 0 : response.Bills);
|
|
13472
|
+
} catch (error) {
|
|
13473
|
+
setLoader(false);
|
|
13474
|
+
}
|
|
13475
|
+
};
|
|
13476
|
+
const handleApiData = async () => {
|
|
13477
|
+
setLoader(true);
|
|
13478
|
+
const filters = {};
|
|
13479
|
+
filters.hierarchyTypeCode = "REVENUE";
|
|
13480
|
+
filters.boundaryType = "Locality";
|
|
13481
|
+
try {
|
|
13482
|
+
var _response$TenantBound, _response$TenantBound2;
|
|
13483
|
+
const response = await Digit.GCService.location({
|
|
13484
|
+
tenantId,
|
|
13485
|
+
filters
|
|
13486
|
+
});
|
|
13487
|
+
setLoader(false);
|
|
13488
|
+
setData(response === null || response === void 0 ? void 0 : (_response$TenantBound = response.TenantBoundary) === null || _response$TenantBound === void 0 ? void 0 : (_response$TenantBound2 = _response$TenantBound[0]) === null || _response$TenantBound2 === void 0 ? void 0 : _response$TenantBound2.boundary);
|
|
13489
|
+
} catch (error) {
|
|
13490
|
+
setLoader(false);
|
|
13491
|
+
}
|
|
13492
|
+
};
|
|
13493
|
+
useEffect(() => {
|
|
13494
|
+
handleApiData();
|
|
13495
|
+
}, []);
|
|
13496
|
+
const columns = [{
|
|
13497
|
+
Header: `${t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")}`,
|
|
13498
|
+
accessor: "uuid"
|
|
13499
|
+
}, {
|
|
13500
|
+
Header: `${t("TL_COMMON_TABLE_COL_APP_DATE")}`,
|
|
13501
|
+
accessor: "createdtime",
|
|
13502
|
+
Cell: ({
|
|
13503
|
+
row
|
|
13504
|
+
}) => {
|
|
13505
|
+
var _row$original, _row$original2;
|
|
13506
|
+
console.log("row", row);
|
|
13507
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, (_row$original = row.original) !== null && _row$original !== void 0 && _row$original.createdtime ? GetCell(format(new Date((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.createdtime), "dd/MM/yyyy")) : ""));
|
|
13508
|
+
}
|
|
13509
|
+
}, {
|
|
13510
|
+
Header: `${t("PT_COMMON_TABLE_COL_STATUS_LABEL")}`,
|
|
13511
|
+
accessor: "status"
|
|
13512
|
+
}, {
|
|
13513
|
+
Header: `${t("Action")}`,
|
|
13514
|
+
accessor: "action",
|
|
13515
|
+
Cell: ({
|
|
13516
|
+
row
|
|
13517
|
+
}) => {
|
|
13518
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
13519
|
+
label: "Download",
|
|
13520
|
+
onSubmit: () => getRecieptSearch({
|
|
13521
|
+
tenantId,
|
|
13522
|
+
bills: getBills
|
|
13523
|
+
})
|
|
13524
|
+
}));
|
|
13525
|
+
}
|
|
13526
|
+
}];
|
|
13527
|
+
const slotlistRows = (getBills === null || getBills === void 0 ? void 0 : getBills.map(bills => ({
|
|
13528
|
+
uuid: bills === null || bills === void 0 ? void 0 : bills.consumerCode,
|
|
13529
|
+
createdtime: bills === null || bills === void 0 ? void 0 : bills.billDate,
|
|
13530
|
+
status: t(bills.status)
|
|
13531
|
+
}))) || [];
|
|
13532
|
+
const getRecieptSearch = async ({
|
|
13533
|
+
tenantId,
|
|
13534
|
+
bills
|
|
13535
|
+
}) => {
|
|
13536
|
+
try {
|
|
13537
|
+
setLoader(true);
|
|
13538
|
+
const response = await Digit.PaymentService.generatePdf(tenantId, {
|
|
13539
|
+
Bills: [...bills]
|
|
13540
|
+
}, "garbage-bill");
|
|
13541
|
+
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
13542
|
+
fileStoreIds: response.filestoreIds[0]
|
|
13543
|
+
});
|
|
13544
|
+
window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
|
|
13545
|
+
} catch (error) {
|
|
13546
|
+
console.error("Receipt generation failed", error);
|
|
13547
|
+
} finally {
|
|
13548
|
+
setLoader(false);
|
|
13549
|
+
}
|
|
12762
13550
|
};
|
|
12763
13551
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSubHeader, {
|
|
12764
13552
|
style: {
|
|
@@ -12779,7 +13567,7 @@ const BillGenie = () => {
|
|
|
12779
13567
|
flex: "0 0 20%",
|
|
12780
13568
|
maxWidth: "20%"
|
|
12781
13569
|
}
|
|
12782
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("
|
|
13570
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CS_SWACH_LOCALITY")}`, "*"), /*#__PURE__*/React.createElement(Controller, {
|
|
12783
13571
|
control: control,
|
|
12784
13572
|
name: "locality",
|
|
12785
13573
|
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
@@ -12792,33 +13580,7 @@ const BillGenie = () => {
|
|
|
12792
13580
|
props.onChange(e);
|
|
12793
13581
|
},
|
|
12794
13582
|
selected: props.value,
|
|
12795
|
-
option:
|
|
12796
|
-
optionKey: "name",
|
|
12797
|
-
t: t
|
|
12798
|
-
})
|
|
12799
|
-
}), (errors === null || errors === void 0 ? void 0 : errors.locality) && /*#__PURE__*/React.createElement("p", {
|
|
12800
|
-
style: {
|
|
12801
|
-
color: "red"
|
|
12802
|
-
}
|
|
12803
|
-
}, errors.locality.message)), /*#__PURE__*/React.createElement("div", {
|
|
12804
|
-
style: {
|
|
12805
|
-
flex: "0 0 20%",
|
|
12806
|
-
maxWidth: "20%"
|
|
12807
|
-
}
|
|
12808
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Service Category")}`), /*#__PURE__*/React.createElement(Controller, {
|
|
12809
|
-
control: control,
|
|
12810
|
-
name: "locality",
|
|
12811
|
-
render: props => /*#__PURE__*/React.createElement(Dropdown, {
|
|
12812
|
-
style: {
|
|
12813
|
-
marginBottom: 0,
|
|
12814
|
-
width: "100%"
|
|
12815
|
-
},
|
|
12816
|
-
className: "form-field",
|
|
12817
|
-
select: e => {
|
|
12818
|
-
props.onChange(e);
|
|
12819
|
-
},
|
|
12820
|
-
selected: props.value,
|
|
12821
|
-
option: [],
|
|
13583
|
+
option: getData,
|
|
12822
13584
|
optionKey: "name",
|
|
12823
13585
|
t: t
|
|
12824
13586
|
})
|
|
@@ -12831,40 +13593,7 @@ const BillGenie = () => {
|
|
|
12831
13593
|
flex: "0 0 20%",
|
|
12832
13594
|
maxWidth: "20%"
|
|
12833
13595
|
}
|
|
12834
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("
|
|
12835
|
-
style: {
|
|
12836
|
-
color: "red"
|
|
12837
|
-
}
|
|
12838
|
-
}, "*")), /*#__PURE__*/React.createElement(Controller, {
|
|
12839
|
-
control: control,
|
|
12840
|
-
name: "propertyId",
|
|
12841
|
-
render: props => {
|
|
12842
|
-
var _errors$name;
|
|
12843
|
-
return /*#__PURE__*/React.createElement(TextInput, {
|
|
12844
|
-
style: {
|
|
12845
|
-
marginBottom: 0
|
|
12846
|
-
},
|
|
12847
|
-
value: props.value,
|
|
12848
|
-
error: errors === null || errors === void 0 ? void 0 : (_errors$name = errors.name) === null || _errors$name === void 0 ? void 0 : _errors$name.message,
|
|
12849
|
-
onChange: e => {
|
|
12850
|
-
props.onChange(e.target.value);
|
|
12851
|
-
},
|
|
12852
|
-
onBlur: e => {
|
|
12853
|
-
props.onBlur(e);
|
|
12854
|
-
},
|
|
12855
|
-
t: t
|
|
12856
|
-
});
|
|
12857
|
-
}
|
|
12858
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
12859
|
-
style: {
|
|
12860
|
-
flex: "0 0 20%",
|
|
12861
|
-
maxWidth: "20%"
|
|
12862
|
-
}
|
|
12863
|
-
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Bill No.")}`, " ", /*#__PURE__*/React.createElement("span", {
|
|
12864
|
-
style: {
|
|
12865
|
-
color: "red"
|
|
12866
|
-
}
|
|
12867
|
-
}, "*")), /*#__PURE__*/React.createElement(Controller, {
|
|
13596
|
+
}, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Bill No.")}`), /*#__PURE__*/React.createElement(Controller, {
|
|
12868
13597
|
control: control,
|
|
12869
13598
|
name: "billNo",
|
|
12870
13599
|
render: props => /*#__PURE__*/React.createElement(TextInput, {
|
|
@@ -12905,14 +13634,33 @@ const BillGenie = () => {
|
|
|
12905
13634
|
onBlur: props.onBlur,
|
|
12906
13635
|
t: t
|
|
12907
13636
|
})
|
|
12908
|
-
}))),
|
|
13637
|
+
}))), getBills.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
13638
|
+
className: "tableClass"
|
|
13639
|
+
}, /*#__PURE__*/React.createElement(ApplicationTable, {
|
|
13640
|
+
t: t,
|
|
13641
|
+
data: slotlistRows,
|
|
13642
|
+
columns: columns,
|
|
13643
|
+
getCellProps: cellInfo => ({
|
|
13644
|
+
style: {
|
|
13645
|
+
minWidth: "150px",
|
|
13646
|
+
padding: "10px",
|
|
13647
|
+
fontSize: "16px",
|
|
13648
|
+
paddingLeft: "20px"
|
|
13649
|
+
}
|
|
13650
|
+
}),
|
|
13651
|
+
isPaginationRequired: false,
|
|
13652
|
+
totalRecords: slotlistRows.length
|
|
13653
|
+
})), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
12909
13654
|
style: {
|
|
12910
13655
|
background: "#eee",
|
|
12911
13656
|
color: "black",
|
|
12912
13657
|
border: "1px solid"
|
|
12913
13658
|
},
|
|
12914
13659
|
label: "Reset",
|
|
12915
|
-
|
|
13660
|
+
onSubmit: () => {
|
|
13661
|
+
reset(defaultValues);
|
|
13662
|
+
setBills([]);
|
|
13663
|
+
}
|
|
12916
13664
|
}), /*#__PURE__*/React.createElement(SubmitBar, {
|
|
12917
13665
|
label: "Search",
|
|
12918
13666
|
submit: "submit"
|