@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.8
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/index.d.ts +2 -66
- package/index.js +1 -66
- package/package.json +1 -1
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,1213 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
View,
|
|
3
|
-
Text,
|
|
4
|
-
BackHandler,
|
|
5
|
-
Dimensions,
|
|
6
|
-
ScrollView,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
} from 'react-native';
|
|
9
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
10
|
-
import CDetailView from '../CustomComponents/CDetailView';
|
|
11
|
-
import HeaderBlock from '../Screens/HeaderBlock';
|
|
12
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
13
|
-
|
|
14
|
-
import ContextBio from '../ContextAPI/ContextBio';
|
|
15
|
-
import ConfirmOverlay from '../HOC/ConfirmOverlay';
|
|
16
|
-
import { CButtonShadow, getLoading, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
17
|
-
import Loader from '../Custom/Loader';
|
|
18
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
19
|
-
import CFooterView from '../CustomComponents/CFooterView';
|
|
20
|
-
import CustomButton from '../Components/CustomButton';
|
|
21
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
22
|
-
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
23
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
24
|
-
import CContainerView from '../CustomComponents/CContainerView';
|
|
25
|
-
import CTextHeader from '../Custom/TableComponent/CTextHeader';
|
|
26
|
-
import STextInput from '../StaticComponents/STextInput';
|
|
27
|
-
import SDropDownIcon from '../StaticComponents/SDropDownIcon';
|
|
28
|
-
import SDropDownNew from '../Components/SDropDownNew';
|
|
29
|
-
|
|
30
|
-
import HOverlay from '../HOC/HOverlay';
|
|
31
|
-
import STextInputNew from '../Components/STextInputNew';
|
|
32
|
-
import HHeading from '../HOC/HHeading';
|
|
33
|
-
import HShadowCountButton from '../HOC/HShadowCountButton';
|
|
34
|
-
|
|
35
|
-
export default function WorkOrderDetailsPage({ route }) {
|
|
36
|
-
const { orderIndex } = route.params || {};
|
|
37
|
-
const { invoiceData, setInvoiceData } = useContext(ContextBio);
|
|
38
|
-
const navigation = useNavigation();
|
|
39
|
-
const [backHandler, setBackHandler] = useState(false);
|
|
40
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
41
|
-
const [loading, setLoading] = useState(false);
|
|
42
|
-
const [overlay, setOverlay] = useState(false);
|
|
43
|
-
const [overlayComponent, setOverlayComponent] = useState('');
|
|
44
|
-
|
|
45
|
-
const workOrder = invoiceData.workOrder[orderIndex];
|
|
46
|
-
|
|
47
|
-
const FooterArr = [
|
|
48
|
-
{
|
|
49
|
-
keyid: 1,
|
|
50
|
-
displaytext: 'Save',
|
|
51
|
-
size: 10,
|
|
52
|
-
iconname: 'save',
|
|
53
|
-
iconcolor: '#a30e0e',
|
|
54
|
-
fontcolor: '#a30e0e',
|
|
55
|
-
shadowcolor: '#ffe5e5',
|
|
56
|
-
selected: false,
|
|
57
|
-
visibility: true,
|
|
58
|
-
iconsize: 20,
|
|
59
|
-
functionid: 'D01',
|
|
60
|
-
count: false,
|
|
61
|
-
countValue: 0,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
keyid: 2,
|
|
65
|
-
displaytext: 'Preview',
|
|
66
|
-
size: 10,
|
|
67
|
-
iconname: 'file-invoice',
|
|
68
|
-
iconcolor: '#a30e0e',
|
|
69
|
-
fontcolor: '#a30e0e',
|
|
70
|
-
shadowcolor: '#ffe5e5',
|
|
71
|
-
selected: false,
|
|
72
|
-
visibility: false,
|
|
73
|
-
iconsize: 20,
|
|
74
|
-
functionid: 'D01',
|
|
75
|
-
count: false,
|
|
76
|
-
countValue: 0,
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
const ButtonsArray = [
|
|
81
|
-
{
|
|
82
|
-
keyid: 3,
|
|
83
|
-
displaytext: 'Raw Material',
|
|
84
|
-
size: 10,
|
|
85
|
-
iconname: 'box-open',
|
|
86
|
-
iconcolor: '#a30e0e',
|
|
87
|
-
fontcolor: '#a30e0e',
|
|
88
|
-
shadowcolor: '#ffe5e5',
|
|
89
|
-
selected: false,
|
|
90
|
-
visibility: true,
|
|
91
|
-
iconsize: 20,
|
|
92
|
-
functionid: 'D01',
|
|
93
|
-
count: false,
|
|
94
|
-
countValue: 0,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
keyid: 4,
|
|
98
|
-
displaytext: 'Equipment',
|
|
99
|
-
size: 10,
|
|
100
|
-
iconname: 'toolbox',
|
|
101
|
-
iconcolor: '#a30e0e',
|
|
102
|
-
fontcolor: '#a30e0e',
|
|
103
|
-
shadowcolor: '#ffe5e5',
|
|
104
|
-
selected: false,
|
|
105
|
-
visibility: true,
|
|
106
|
-
iconsize: 20,
|
|
107
|
-
functionid: 'D01',
|
|
108
|
-
count: false,
|
|
109
|
-
countValue: 0,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
keyid: 5,
|
|
113
|
-
displaytext: 'By-product',
|
|
114
|
-
size: 10,
|
|
115
|
-
iconname: 'boxes',
|
|
116
|
-
iconcolor: '#a30e0e',
|
|
117
|
-
fontcolor: '#a30e0e',
|
|
118
|
-
shadowcolor: '#ffe5e5',
|
|
119
|
-
selected: false,
|
|
120
|
-
visibility: true,
|
|
121
|
-
iconsize: 20,
|
|
122
|
-
functionid: 'D01',
|
|
123
|
-
count: false,
|
|
124
|
-
countValue: 0,
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
keyid: 6,
|
|
128
|
-
displaytext: 'Stage By-product',
|
|
129
|
-
size: 10,
|
|
130
|
-
iconname: 'file-alt',
|
|
131
|
-
iconcolor: '#a30e0e',
|
|
132
|
-
fontcolor: '#a30e0e',
|
|
133
|
-
shadowcolor: '#ffe5e5',
|
|
134
|
-
selected: false,
|
|
135
|
-
visibility: true,
|
|
136
|
-
iconsize: 20,
|
|
137
|
-
functionid: 'D01',
|
|
138
|
-
count: false,
|
|
139
|
-
countValue: 0,
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
// UseEffect for backhandler
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
const backAction = () => {
|
|
146
|
-
if (invoiceData?.EditStatus) {
|
|
147
|
-
setBackHandler(true);
|
|
148
|
-
return true; // Block default back action
|
|
149
|
-
}
|
|
150
|
-
return false; // Allow default back action
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const backHandler = BackHandler.addEventListener(
|
|
154
|
-
'hardwareBackPress',
|
|
155
|
-
backAction
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
// Cleanup on unmount
|
|
159
|
-
return () => backHandler.remove();
|
|
160
|
-
}, [invoiceData]);
|
|
161
|
-
|
|
162
|
-
// useEffect for API call
|
|
163
|
-
useEffect(() => {
|
|
164
|
-
getData();
|
|
165
|
-
}, []);
|
|
166
|
-
|
|
167
|
-
// Function for fetch data from API
|
|
168
|
-
function getData() {
|
|
169
|
-
setIsLoading(true);
|
|
170
|
-
let buttonapi = `${APIURL}invget/invcommonget/rnintrworkorderdetail ${workOrder.insuworkorder}`;
|
|
171
|
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
|
|
172
|
-
NetworkServiceCall('get', buttonapi).then(function (response) {
|
|
173
|
-
if (response.httpstatus == 200) {
|
|
174
|
-
setInvoiceData(prevData => {
|
|
175
|
-
const updatedWorkOrder = prevData.workOrder.map((item, index) => {
|
|
176
|
-
if (index === orderIndex) {
|
|
177
|
-
return { ...item, details: response.data.data };
|
|
178
|
-
}
|
|
179
|
-
return item;
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
return {
|
|
183
|
-
...prevData,
|
|
184
|
-
workOrder: updatedWorkOrder,
|
|
185
|
-
EditStatus: false,
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
setIsLoading(false);
|
|
189
|
-
// console.log(
|
|
190
|
-
// 'RESPONSEEEEEEEEEEE FROM CONSULTATTION22222222',
|
|
191
|
-
// JSON.stringify(response.data.data),
|
|
192
|
-
// );
|
|
193
|
-
} else {
|
|
194
|
-
notifyMessage('Data Not Found.....');
|
|
195
|
-
setIsLoading(false);
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
// getLoading(v => setIsLoading(false));
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Function for handle data change
|
|
202
|
-
function hanldeDataChange(workOrderIndex, value, field) {
|
|
203
|
-
// Clone the workOrder data to ensure immutability
|
|
204
|
-
const updatedWorkOrders = [...invoiceData.workOrder];
|
|
205
|
-
|
|
206
|
-
// Update the object at the specified index
|
|
207
|
-
updatedWorkOrders[workOrderIndex] = {
|
|
208
|
-
...updatedWorkOrders[workOrderIndex],
|
|
209
|
-
[field]: value, // Dynamically update the specific field with the new value
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
// Update the state with the modified workOrder data
|
|
213
|
-
setInvoiceData(prevState => ({
|
|
214
|
-
...prevState,
|
|
215
|
-
workOrder: updatedWorkOrders,
|
|
216
|
-
EditStatus: true, // Mark edit status as true indicating a change has occurred
|
|
217
|
-
}));
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Function for handle work order details data change
|
|
221
|
-
function handleWorkOrderDetailDataChange(
|
|
222
|
-
workOrderIndex,
|
|
223
|
-
detailIndex,
|
|
224
|
-
value,
|
|
225
|
-
field,
|
|
226
|
-
) {
|
|
227
|
-
// Clone the workOrder data to ensure immutability
|
|
228
|
-
const updatedWorkOrders = [...invoiceData.workOrder];
|
|
229
|
-
|
|
230
|
-
// Clone the details array for the specific workOrder at workOrderIndex
|
|
231
|
-
const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
|
|
232
|
-
|
|
233
|
-
// Update the specific detail at detailIndex in the details array
|
|
234
|
-
updatedDetails[detailIndex] = {
|
|
235
|
-
...updatedDetails[detailIndex],
|
|
236
|
-
[field]: value,
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// Update the workOrder with the modified details array
|
|
240
|
-
updatedWorkOrders[workOrderIndex] = {
|
|
241
|
-
...updatedWorkOrders[workOrderIndex],
|
|
242
|
-
details: updatedDetails,
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// Update the state with the modified workOrder data
|
|
246
|
-
setInvoiceData(prevState => ({
|
|
247
|
-
...prevState,
|
|
248
|
-
workOrder: updatedWorkOrders,
|
|
249
|
-
EditStatus: true,
|
|
250
|
-
}));
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Function for handle dropdown data change
|
|
254
|
-
function hanldeWorkOrderDropdownDataChange(
|
|
255
|
-
workOrderIndex,
|
|
256
|
-
value,
|
|
257
|
-
datavalue,
|
|
258
|
-
displayvalue,
|
|
259
|
-
) {
|
|
260
|
-
// Clone the workOrder data to ensure immutability
|
|
261
|
-
const updatedWorkOrders = [...invoiceData.workOrder];
|
|
262
|
-
|
|
263
|
-
// Update the object at the specified index
|
|
264
|
-
updatedWorkOrders[workOrderIndex] = {
|
|
265
|
-
...updatedWorkOrders[workOrderIndex],
|
|
266
|
-
[datavalue]: value.datavalue,
|
|
267
|
-
[displayvalue]: value.displayvalue,
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
// Update the state with the modified workOrder data
|
|
271
|
-
setInvoiceData(prevState => ({
|
|
272
|
-
...prevState,
|
|
273
|
-
workOrder: updatedWorkOrders,
|
|
274
|
-
EditStatus: true, // Mark edit status as true indicating a change has occurred
|
|
275
|
-
}));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Function for handle work order details dropdown data change
|
|
279
|
-
function handleWorkOrderDetailDropdownDataChange(
|
|
280
|
-
workOrderIndex,
|
|
281
|
-
detailIndex,
|
|
282
|
-
value,
|
|
283
|
-
datavalue,
|
|
284
|
-
displayvalue,
|
|
285
|
-
) {
|
|
286
|
-
// Clone the workOrder data to ensure immutability
|
|
287
|
-
const updatedWorkOrders = [...invoiceData.workOrder];
|
|
288
|
-
|
|
289
|
-
// Clone the details array for the specific workOrder at workOrderIndex
|
|
290
|
-
const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
|
|
291
|
-
|
|
292
|
-
// Update the specific detail based on detailIndex
|
|
293
|
-
updatedDetails[detailIndex] = {
|
|
294
|
-
...updatedDetails[detailIndex],
|
|
295
|
-
[datavalue]: value.datavalue,
|
|
296
|
-
[displayvalue]: value.displayvalue,
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
// Update the workOrder with the modified details array
|
|
300
|
-
updatedWorkOrders[workOrderIndex] = {
|
|
301
|
-
...updatedWorkOrders[workOrderIndex],
|
|
302
|
-
details: updatedDetails,
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
// Update the state with the modified workOrder data
|
|
306
|
-
setInvoiceData(prevState => ({
|
|
307
|
-
...prevState,
|
|
308
|
-
workOrder: updatedWorkOrders,
|
|
309
|
-
EditStatus: true,
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// Save function
|
|
314
|
-
function getFooterFunctions(params) {
|
|
315
|
-
// Prepare data for saving
|
|
316
|
-
var groups = {
|
|
317
|
-
option: 'rnintrworkorder1',
|
|
318
|
-
userdata: Global.userData,
|
|
319
|
-
workOrder: invoiceData.workOrder[orderIndex],
|
|
320
|
-
};
|
|
321
|
-
var dataset = { groups };
|
|
322
|
-
|
|
323
|
-
console.log(
|
|
324
|
-
'------------------SAVE----------------------------',
|
|
325
|
-
JSON.stringify(dataset),
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
if (groups.workOrder != undefined) {
|
|
329
|
-
let buttonapi = `${APIURL}invsave/FlCommonSave`;
|
|
330
|
-
setLoading(true);
|
|
331
|
-
NetworkServiceCall('post', buttonapi, dataset).then(function (response) {
|
|
332
|
-
if (response.httpstatus == 200) {
|
|
333
|
-
notifyMessage('Data Saved!!!!!');
|
|
334
|
-
setInvoiceData(prevData => ({
|
|
335
|
-
workOrder: [],
|
|
336
|
-
EditStatus: false,
|
|
337
|
-
EquipmentUpdate: false,
|
|
338
|
-
}));
|
|
339
|
-
setLoading(false);
|
|
340
|
-
setTimeout(() => {
|
|
341
|
-
navigation.goBack();
|
|
342
|
-
}, 100);
|
|
343
|
-
} else {
|
|
344
|
-
notifyMessage('Data Not Saved!!!!! Network Error');
|
|
345
|
-
setLoading(false);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
} else {
|
|
349
|
-
notifyMessage('No data to save');
|
|
350
|
-
}
|
|
351
|
-
getLoading(v => setLoading(false));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
function handleToggleExpand(index) {
|
|
355
|
-
// Clone the data and update the specific index
|
|
356
|
-
const updatedData = [...invoiceData.verification];
|
|
357
|
-
|
|
358
|
-
// Toggle the 'expand' property of the specific section (index)
|
|
359
|
-
updatedData[index] = {
|
|
360
|
-
...updatedData[index],
|
|
361
|
-
expand: !updatedData[index].expand,
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
// Update the state with the modified data
|
|
365
|
-
setInvoiceData(prevState => ({
|
|
366
|
-
...prevState,
|
|
367
|
-
verification: updatedData,
|
|
368
|
-
}));
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Json for pdf unsaved viewr
|
|
372
|
-
function getDataForPreview(invoiceData) {
|
|
373
|
-
let jsondata = {
|
|
374
|
-
groups: {
|
|
375
|
-
userdata: Global.userData,
|
|
376
|
-
verification: invoiceData?.verification?.map(item => ({
|
|
377
|
-
...item,
|
|
378
|
-
currentreportbuttonapi: '',
|
|
379
|
-
})),
|
|
380
|
-
},
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
return jsondata;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
// Function for get arguments HOverlay
|
|
387
|
-
function getArguments(overlayComponent, rawMaterial, detailIndex) {
|
|
388
|
-
if (overlayComponent == 'RawMaterial') {
|
|
389
|
-
return {
|
|
390
|
-
argument: rawMaterial,
|
|
391
|
-
workOrderIndex: orderIndex,
|
|
392
|
-
detailIndex: detailIndex,
|
|
393
|
-
};
|
|
394
|
-
} else if (overlayComponent == 'EquipmentPage') {
|
|
395
|
-
return {
|
|
396
|
-
argument: workOrder.insuworkorder,
|
|
397
|
-
workOrderIndex: orderIndex,
|
|
398
|
-
detailIndex: detailIndex,
|
|
399
|
-
};
|
|
400
|
-
} else if (overlayComponent == 'ByProductPage') {
|
|
401
|
-
return {
|
|
402
|
-
argument: workOrder.insuworkorder,
|
|
403
|
-
workOrderIndex: orderIndex,
|
|
404
|
-
detailIndex: detailIndex,
|
|
405
|
-
};
|
|
406
|
-
} else if (overlayComponent == 'StageByProduct') {
|
|
407
|
-
return {
|
|
408
|
-
argument: workOrder.insuworkorder,
|
|
409
|
-
workOrderIndex: orderIndex,
|
|
410
|
-
detailIndex: detailIndex,
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
return (
|
|
416
|
-
<CContainerView>
|
|
417
|
-
<HeaderBlock
|
|
418
|
-
navigation={navigation}
|
|
419
|
-
callback={val => {
|
|
420
|
-
invoiceData.EditStatus ? setBackHandler(true) : navigation.goBack();
|
|
421
|
-
}}
|
|
422
|
-
/>
|
|
423
|
-
<CDetailView>
|
|
424
|
-
{isLoading ? (
|
|
425
|
-
<View
|
|
426
|
-
style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
427
|
-
<Loader />
|
|
428
|
-
</View>
|
|
429
|
-
) : (
|
|
430
|
-
<ScrollView
|
|
431
|
-
style={
|
|
432
|
-
{
|
|
433
|
-
// flex: 1,
|
|
434
|
-
// marginVertical: normalize(9),
|
|
435
|
-
// marginTop: normalize(10),
|
|
436
|
-
// paddingHorizontal: normalize(8),
|
|
437
|
-
// alignSelf: 'center',
|
|
438
|
-
// width: Dimensions.get('screen').width * 0.99,
|
|
439
|
-
}
|
|
440
|
-
}>
|
|
441
|
-
{/* Container for the page title */}
|
|
442
|
-
<View style={{ marginBottom: normalize(5) }}>
|
|
443
|
-
<HHeading
|
|
444
|
-
styles={{
|
|
445
|
-
iconname: 'file-invoice',
|
|
446
|
-
bgcolor: '#f2efef',
|
|
447
|
-
iconsize: 14,
|
|
448
|
-
iconcolor: Global.AppTheme.primary_color,
|
|
449
|
-
displaytext: workOrder.workordername,
|
|
450
|
-
textsize: 13,
|
|
451
|
-
textcolor: Global.AppTheme.primary_color,
|
|
452
|
-
}}
|
|
453
|
-
callBack={val =>
|
|
454
|
-
val == undefined ? null : console.log(val)
|
|
455
|
-
} />
|
|
456
|
-
</View>
|
|
457
|
-
{invoiceData?.workOrder != undefined &&
|
|
458
|
-
invoiceData?.workOrder?.length != 0 ? (
|
|
459
|
-
<View
|
|
460
|
-
style={{
|
|
461
|
-
flex: 1,
|
|
462
|
-
paddingHorizontal: normalize(8),
|
|
463
|
-
alignSelf: 'center',
|
|
464
|
-
width: Dimensions.get('screen').width * 0.99,
|
|
465
|
-
}}>
|
|
466
|
-
{/* Container for the page title */}
|
|
467
|
-
{/* <View
|
|
468
|
-
style={{
|
|
469
|
-
borderWidth: 0,
|
|
470
|
-
justifyContent: 'center',
|
|
471
|
-
alignItems: 'center',
|
|
472
|
-
marginTop: normalize(5),
|
|
473
|
-
marginVertical: normalize(5),
|
|
474
|
-
alignSelf: 'center',
|
|
475
|
-
}}>
|
|
476
|
-
<Text
|
|
477
|
-
style={{
|
|
478
|
-
fontSize: normalize(17),
|
|
479
|
-
fontWeight: 'bold',
|
|
480
|
-
color: '#094485',
|
|
481
|
-
}}>
|
|
482
|
-
{workOrder.workordername}
|
|
483
|
-
</Text>
|
|
484
|
-
|
|
485
|
-
<View>
|
|
486
|
-
<Text>{workOrder.productname}</Text>
|
|
487
|
-
</View>
|
|
488
|
-
</View> */}
|
|
489
|
-
|
|
490
|
-
<View>
|
|
491
|
-
<Text style={{ fontSize: normalize(12) }}>
|
|
492
|
-
{workOrder.productname}
|
|
493
|
-
</Text>
|
|
494
|
-
</View>
|
|
495
|
-
|
|
496
|
-
{/* Product details section */}
|
|
497
|
-
<View>
|
|
498
|
-
{/* <Text
|
|
499
|
-
style={{
|
|
500
|
-
fontSize:normalize(11)
|
|
501
|
-
}}>Request #${workOrder.requestno} | Ref #
|
|
502
|
-
${workOrder.intrworkorderrequest} | Entered By:
|
|
503
|
-
${workOrder.username} | On:${workOrder.entrydate}</Text> */}
|
|
504
|
-
{/* <CTextHeader
|
|
505
|
-
text={workOrder.productname}
|
|
506
|
-
widthArr={Dimensions.get('screen').width * 99}
|
|
507
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
508
|
-
color={'#094485'}
|
|
509
|
-
borderColor={'white'}
|
|
510
|
-
marginHorizontal={normalize(2)}
|
|
511
|
-
borderRadius={5}
|
|
512
|
-
elevation={0}
|
|
513
|
-
/> */}
|
|
514
|
-
|
|
515
|
-
<View
|
|
516
|
-
style={{
|
|
517
|
-
flexDirection: 'row',
|
|
518
|
-
}}>
|
|
519
|
-
{/* Quantity */}
|
|
520
|
-
<View>
|
|
521
|
-
<CTextHeader
|
|
522
|
-
text={'Quantity'}
|
|
523
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
524
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
525
|
-
color={'#094485'}
|
|
526
|
-
borderColor={'#f5f5f5'}
|
|
527
|
-
marginHorizontal={normalize(2)}
|
|
528
|
-
borderRadius={5}
|
|
529
|
-
elevation={0}
|
|
530
|
-
/>
|
|
531
|
-
<STextInputNew
|
|
532
|
-
data={{
|
|
533
|
-
borderWidth: 1,
|
|
534
|
-
value: workOrder.requestedquantity || '',
|
|
535
|
-
// backgroundColor: 'rgba(161, 188, 196,0.2)',
|
|
536
|
-
borderColor: 'lightgrey',
|
|
537
|
-
elevation: 0,
|
|
538
|
-
borderRadius: 5,
|
|
539
|
-
fontWeight: 'normal',
|
|
540
|
-
color: 'black',
|
|
541
|
-
itemwidth: Dimensions.get('screen').width * 0.2,
|
|
542
|
-
paddingTop: 5,
|
|
543
|
-
paddingBottom: 5,
|
|
544
|
-
height: Dimensions.get('screen').height * 0.05,
|
|
545
|
-
textAlign: 'start',
|
|
546
|
-
marginTop: normalize(2),
|
|
547
|
-
marginHorizontal: normalize(2),
|
|
548
|
-
fontSize: normalize(12),
|
|
549
|
-
}}
|
|
550
|
-
keyboardType={'numeric'}
|
|
551
|
-
callBack={val => {
|
|
552
|
-
hanldeDataChange(
|
|
553
|
-
orderIndex,
|
|
554
|
-
val,
|
|
555
|
-
'requestedquantity',
|
|
556
|
-
);
|
|
557
|
-
}}
|
|
558
|
-
/>
|
|
559
|
-
</View>
|
|
560
|
-
|
|
561
|
-
{/* Unit */}
|
|
562
|
-
<View>
|
|
563
|
-
<CTextHeader
|
|
564
|
-
text={'Unit'}
|
|
565
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
566
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
567
|
-
color={'#094485'}
|
|
568
|
-
borderColor={'#f5f5f5'}
|
|
569
|
-
marginHorizontal={normalize(2)}
|
|
570
|
-
borderRadius={5}
|
|
571
|
-
elevation={0}
|
|
572
|
-
/>
|
|
573
|
-
<SDropDownNew
|
|
574
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
575
|
-
heightArr={Dimensions.get('screen').height * 0.051}
|
|
576
|
-
dropdowndata={workOrder.unitname}
|
|
577
|
-
fontSize={normalize(12)}
|
|
578
|
-
fontWeight={'normal'}
|
|
579
|
-
onChangeData={val => {
|
|
580
|
-
hanldeWorkOrderDropdownDataChange(
|
|
581
|
-
orderIndex,
|
|
582
|
-
val,
|
|
583
|
-
'insuunit',
|
|
584
|
-
'unitname',
|
|
585
|
-
);
|
|
586
|
-
}}
|
|
587
|
-
editable={false}
|
|
588
|
-
dropdownarray={workOrder.dropdowndata}
|
|
589
|
-
refreshCount={val =>
|
|
590
|
-
// val == undefined ? setRefresh(refresh + 1) : null
|
|
591
|
-
console.log(val)
|
|
592
|
-
}
|
|
593
|
-
/>
|
|
594
|
-
</View>
|
|
595
|
-
|
|
596
|
-
{/* Amount */}
|
|
597
|
-
<View>
|
|
598
|
-
<CTextHeader
|
|
599
|
-
text={'Amount'}
|
|
600
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
601
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
602
|
-
color={'#094485'}
|
|
603
|
-
borderColor={'#f5f5f5'}
|
|
604
|
-
marginHorizontal={normalize(2)}
|
|
605
|
-
borderRadius={5}
|
|
606
|
-
elevation={0}
|
|
607
|
-
/>
|
|
608
|
-
<STextInputNew
|
|
609
|
-
data={{
|
|
610
|
-
borderWidth: 1,
|
|
611
|
-
value: workOrder.totalamount || '',
|
|
612
|
-
// backgroundColor: 'rgba(161, 188, 196,0.2)',
|
|
613
|
-
borderColor: 'lightgrey',
|
|
614
|
-
elevation: 0,
|
|
615
|
-
borderRadius: 5,
|
|
616
|
-
fontWeight: 'normal',
|
|
617
|
-
color: 'black',
|
|
618
|
-
itemwidth: Dimensions.get('screen').width * 0.2,
|
|
619
|
-
paddingTop: 5,
|
|
620
|
-
paddingBottom: 5,
|
|
621
|
-
height: Dimensions.get('screen').height * 0.05,
|
|
622
|
-
textAlign: 'start',
|
|
623
|
-
marginTop: normalize(2),
|
|
624
|
-
marginHorizontal: normalize(2),
|
|
625
|
-
fontSize: normalize(12),
|
|
626
|
-
}}
|
|
627
|
-
keyboardType={'numeric'}
|
|
628
|
-
callBack={val => {
|
|
629
|
-
hanldeDataChange(orderIndex, val, 'totalamount');
|
|
630
|
-
}}
|
|
631
|
-
/>
|
|
632
|
-
</View>
|
|
633
|
-
</View>
|
|
634
|
-
</View>
|
|
635
|
-
{/* <View
|
|
636
|
-
style={{
|
|
637
|
-
borderBottomColor: '#094485',
|
|
638
|
-
borderBottomWidth: 0.5,
|
|
639
|
-
marginVertical: normalize(6),
|
|
640
|
-
}}
|
|
641
|
-
/> */}
|
|
642
|
-
<View
|
|
643
|
-
style={{
|
|
644
|
-
flexDirection: 'row',
|
|
645
|
-
justifyContent: 'space-between',
|
|
646
|
-
alignItems: 'center',
|
|
647
|
-
paddingHorizontal: 5,
|
|
648
|
-
marginVertical: normalize(10),
|
|
649
|
-
}}>
|
|
650
|
-
{ButtonsArray != undefined
|
|
651
|
-
? ButtonsArray.map((item, i) => {
|
|
652
|
-
return item.visibility ? (
|
|
653
|
-
<View key={i} style={{ marginLeft: 5 }}>
|
|
654
|
-
{/* <CustomButton
|
|
655
|
-
data={{
|
|
656
|
-
...item,
|
|
657
|
-
shadowcolor: '#fff',
|
|
658
|
-
iconcolor: '#094485',
|
|
659
|
-
fontcolor: '#094485',
|
|
660
|
-
}}
|
|
661
|
-
callBack={val => {
|
|
662
|
-
if (val.keyid === 3) {
|
|
663
|
-
setOverlayComponent('RawMaterial');
|
|
664
|
-
setTimeout(() => {
|
|
665
|
-
setOverlay(true);
|
|
666
|
-
}, 0);
|
|
667
|
-
} else if (val.keyid === 4) {
|
|
668
|
-
setOverlayComponent('EquipmentPage');
|
|
669
|
-
setTimeout(() => {
|
|
670
|
-
setOverlay(true);
|
|
671
|
-
}, 0);
|
|
672
|
-
} else if (val.keyid === 5) {
|
|
673
|
-
setOverlayComponent('ByProductPage');
|
|
674
|
-
setTimeout(() => {
|
|
675
|
-
setOverlay(true);
|
|
676
|
-
}, 0);
|
|
677
|
-
} else if (val.keyid === 6) {
|
|
678
|
-
setOverlayComponent('StageByProduct');
|
|
679
|
-
setTimeout(() => {
|
|
680
|
-
setOverlay(true);
|
|
681
|
-
}, 0);
|
|
682
|
-
}
|
|
683
|
-
}}
|
|
684
|
-
/> */}
|
|
685
|
-
<HShadowCountButton
|
|
686
|
-
useicon={true}
|
|
687
|
-
usetext={true}
|
|
688
|
-
disabled={false}
|
|
689
|
-
buttonstyle={{
|
|
690
|
-
...CButtonShadow(),
|
|
691
|
-
alignItems: 'center',
|
|
692
|
-
justifyContent: 'center',
|
|
693
|
-
borderWidth: 1,
|
|
694
|
-
borderColor: 'lightblue',
|
|
695
|
-
borderRadius: 10,
|
|
696
|
-
height: Dimensions.get('screen').height * 0.055,
|
|
697
|
-
width: Dimensions.get('screen').height * 0.065,
|
|
698
|
-
marginVertical: normalize(0),
|
|
699
|
-
marginHorizontal: normalize(5),
|
|
700
|
-
}}
|
|
701
|
-
iconcolor={Global.AppTheme.primary_color}
|
|
702
|
-
icongroup={item.icongroup ? item.icongroup : 5}
|
|
703
|
-
iconname={item.iconname}
|
|
704
|
-
iconsize={normalize(24)}
|
|
705
|
-
displaytext={item.displaytext}
|
|
706
|
-
count={item.count}
|
|
707
|
-
countValue={item.countValue}
|
|
708
|
-
buttonCallback={() => {
|
|
709
|
-
if (item.keyid === 3) {
|
|
710
|
-
setOverlayComponent('RawMaterial');
|
|
711
|
-
setTimeout(() => {
|
|
712
|
-
setOverlay(true);
|
|
713
|
-
}, 0);
|
|
714
|
-
} else if (item.keyid === 4) {
|
|
715
|
-
setOverlayComponent('EquipmentPage');
|
|
716
|
-
setTimeout(() => {
|
|
717
|
-
setOverlay(true);
|
|
718
|
-
}, 0);
|
|
719
|
-
} else if (item.keyid === 5) {
|
|
720
|
-
setOverlayComponent('ByProductPage');
|
|
721
|
-
setTimeout(() => {
|
|
722
|
-
setOverlay(true);
|
|
723
|
-
}, 0);
|
|
724
|
-
} else if (item.keyid === 6) {
|
|
725
|
-
setOverlayComponent('StageByProduct');
|
|
726
|
-
setTimeout(() => {
|
|
727
|
-
setOverlay(true);
|
|
728
|
-
}, 0);
|
|
729
|
-
}
|
|
730
|
-
}}
|
|
731
|
-
textstyle={{
|
|
732
|
-
color: Global.AppTheme.primary_color,
|
|
733
|
-
fontSize: normalize(9),
|
|
734
|
-
textAlign: 'center',
|
|
735
|
-
alignSelf: 'center',
|
|
736
|
-
}}
|
|
737
|
-
/>
|
|
738
|
-
</View>
|
|
739
|
-
) : null;
|
|
740
|
-
})
|
|
741
|
-
: null}
|
|
742
|
-
</View>
|
|
743
|
-
{/* <View
|
|
744
|
-
style={{
|
|
745
|
-
borderBottomColor: '#094485',
|
|
746
|
-
borderBottomWidth: 0.5,
|
|
747
|
-
marginVertical: normalize(6),
|
|
748
|
-
}}
|
|
749
|
-
/> */}
|
|
750
|
-
|
|
751
|
-
{/* Preperation section */}
|
|
752
|
-
{workOrder.details != undefined
|
|
753
|
-
? workOrder.details.map((wodetail, index) => (
|
|
754
|
-
<View key={index}>
|
|
755
|
-
{/* Stage */}
|
|
756
|
-
<View
|
|
757
|
-
style={{
|
|
758
|
-
borderWidth: 0,
|
|
759
|
-
justifyContent: 'center',
|
|
760
|
-
alignItems: 'flex-start',
|
|
761
|
-
marginTop: normalize(5),
|
|
762
|
-
marginVertical: normalize(5),
|
|
763
|
-
alignSelf: 'flex-start',
|
|
764
|
-
}}>
|
|
765
|
-
{/* <Text
|
|
766
|
-
style={{
|
|
767
|
-
fontSize: normalize(15),
|
|
768
|
-
fontWeight: 'bold',
|
|
769
|
-
color: '#094485',
|
|
770
|
-
}}>
|
|
771
|
-
{wodetail.stagename}
|
|
772
|
-
</Text> */}
|
|
773
|
-
<View style={{ marginBottom: normalize(5) }}>
|
|
774
|
-
<HHeading
|
|
775
|
-
styles={{
|
|
776
|
-
iconname: 'file-invoice',
|
|
777
|
-
bgcolor: '#f2efef',
|
|
778
|
-
iconsize: 14,
|
|
779
|
-
iconcolor: Global.AppTheme.primary_color,
|
|
780
|
-
displaytext: wodetail.stagename,
|
|
781
|
-
textsize: 13,
|
|
782
|
-
textcolor: Global.AppTheme.primary_color,
|
|
783
|
-
}}
|
|
784
|
-
callBack={val =>
|
|
785
|
-
val == undefined ? null : console.log(val)
|
|
786
|
-
} />
|
|
787
|
-
</View>
|
|
788
|
-
|
|
789
|
-
<View>
|
|
790
|
-
<Text style={{ fontSize: normalize(12) }}>
|
|
791
|
-
{wodetail.productname}
|
|
792
|
-
</Text>
|
|
793
|
-
</View>
|
|
794
|
-
</View>
|
|
795
|
-
<ScrollView
|
|
796
|
-
horizontal={true}
|
|
797
|
-
style={{
|
|
798
|
-
marginVertical: normalize(3),
|
|
799
|
-
}}>
|
|
800
|
-
<View
|
|
801
|
-
style={{
|
|
802
|
-
flexDirection: 'row',
|
|
803
|
-
}}>
|
|
804
|
-
{/* Status */}
|
|
805
|
-
<View>
|
|
806
|
-
<CTextHeader
|
|
807
|
-
text={'Status'}
|
|
808
|
-
widthArr={Dimensions.get('screen').width * 0.25}
|
|
809
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
810
|
-
color={'#094485'}
|
|
811
|
-
borderColor={'#f5f5f5'}
|
|
812
|
-
marginHorizontal={normalize(2)}
|
|
813
|
-
borderRadius={5}
|
|
814
|
-
elevation={0}
|
|
815
|
-
/>
|
|
816
|
-
<SDropDownNew
|
|
817
|
-
widthArr={Dimensions.get('screen').width * 0.25}
|
|
818
|
-
heightArr={
|
|
819
|
-
Dimensions.get('screen').height * 0.051
|
|
820
|
-
}
|
|
821
|
-
fontSize={normalize(12)}
|
|
822
|
-
fontWeight={'normal'}
|
|
823
|
-
dropdowndata={wodetail.statusname}
|
|
824
|
-
onChangeData={val => {
|
|
825
|
-
handleWorkOrderDetailDropdownDataChange(
|
|
826
|
-
orderIndex,
|
|
827
|
-
index,
|
|
828
|
-
val,
|
|
829
|
-
'hrsustatus',
|
|
830
|
-
'statusname',
|
|
831
|
-
);
|
|
832
|
-
}}
|
|
833
|
-
editable={false}
|
|
834
|
-
dropdownarray={wodetail.dropdownstatusdata}
|
|
835
|
-
refreshCount={val =>
|
|
836
|
-
// val == undefined ? setRefresh(refresh + 1) : null
|
|
837
|
-
console.log(val)
|
|
838
|
-
}
|
|
839
|
-
/>
|
|
840
|
-
</View>
|
|
841
|
-
|
|
842
|
-
{/* Priority */}
|
|
843
|
-
<View>
|
|
844
|
-
<CTextHeader
|
|
845
|
-
text={'Priority'}
|
|
846
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
847
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
848
|
-
color={'#094485'}
|
|
849
|
-
borderColor={'#f5f5f5'}
|
|
850
|
-
marginHorizontal={normalize(2)}
|
|
851
|
-
borderRadius={5}
|
|
852
|
-
elevation={0}
|
|
853
|
-
/>
|
|
854
|
-
<STextInputNew
|
|
855
|
-
data={{
|
|
856
|
-
borderWidth: 1,
|
|
857
|
-
value: wodetail.orderofprecedence || 0,
|
|
858
|
-
// backgroundColor: 'rgba(161, 188, 196,0.2)',
|
|
859
|
-
borderColor: 'lightgrey',
|
|
860
|
-
elevation: 0,
|
|
861
|
-
borderRadius: 5,
|
|
862
|
-
fontWeight: 'normal',
|
|
863
|
-
color: 'black',
|
|
864
|
-
itemwidth:
|
|
865
|
-
Dimensions.get('screen').width * 0.2,
|
|
866
|
-
paddingTop: 5,
|
|
867
|
-
paddingBottom: 5,
|
|
868
|
-
height:
|
|
869
|
-
Dimensions.get('screen').height * 0.05,
|
|
870
|
-
textAlign: 'start',
|
|
871
|
-
marginTop: normalize(2),
|
|
872
|
-
marginHorizontal: normalize(2),
|
|
873
|
-
fontSize: normalize(12),
|
|
874
|
-
}}
|
|
875
|
-
keyboardType={'numeric'}
|
|
876
|
-
callBack={val => {
|
|
877
|
-
handleWorkOrderDetailDataChange(
|
|
878
|
-
orderIndex,
|
|
879
|
-
index,
|
|
880
|
-
val,
|
|
881
|
-
'orderofprecedence',
|
|
882
|
-
);
|
|
883
|
-
}}
|
|
884
|
-
/>
|
|
885
|
-
</View>
|
|
886
|
-
|
|
887
|
-
{/* Location */}
|
|
888
|
-
<View>
|
|
889
|
-
<CTextHeader
|
|
890
|
-
text={'Location'}
|
|
891
|
-
widthArr={Dimensions.get('screen').width * 0.25}
|
|
892
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
893
|
-
color={'#094485'}
|
|
894
|
-
borderColor={'#f5f5f5'}
|
|
895
|
-
marginHorizontal={normalize(2)}
|
|
896
|
-
borderRadius={5}
|
|
897
|
-
elevation={0}
|
|
898
|
-
/>
|
|
899
|
-
{console.log(
|
|
900
|
-
'location',
|
|
901
|
-
wodetail.locationdropdowndata,
|
|
902
|
-
)}
|
|
903
|
-
<SDropDownNew
|
|
904
|
-
widthArr={Dimensions.get('screen').width * 0.25}
|
|
905
|
-
heightArr={
|
|
906
|
-
Dimensions.get('screen').height * 0.051
|
|
907
|
-
}
|
|
908
|
-
fontSize={normalize(12)}
|
|
909
|
-
fontWeight={'normal'}
|
|
910
|
-
dropdowndata={wodetail.locationname}
|
|
911
|
-
onChangeData={val => {
|
|
912
|
-
console.log(val);
|
|
913
|
-
handleWorkOrderDetailDropdownDataChange(
|
|
914
|
-
orderIndex,
|
|
915
|
-
index,
|
|
916
|
-
val,
|
|
917
|
-
'sulocation',
|
|
918
|
-
'locationname',
|
|
919
|
-
);
|
|
920
|
-
}}
|
|
921
|
-
editable={false}
|
|
922
|
-
dropdownarray={wodetail.locationdropdowndata}
|
|
923
|
-
refreshCount={val =>
|
|
924
|
-
// val == undefined ? setRefresh(refresh + 1) : null
|
|
925
|
-
console.log(val)
|
|
926
|
-
}
|
|
927
|
-
/>
|
|
928
|
-
</View>
|
|
929
|
-
|
|
930
|
-
{/* Quantity */}
|
|
931
|
-
<View>
|
|
932
|
-
<CTextHeader
|
|
933
|
-
text={'Quantity'}
|
|
934
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
935
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
936
|
-
color={'#094485'}
|
|
937
|
-
borderColor={'#f5f5f5'}
|
|
938
|
-
marginHorizontal={normalize(2)}
|
|
939
|
-
borderRadius={5}
|
|
940
|
-
elevation={0}
|
|
941
|
-
/>
|
|
942
|
-
<STextInputNew
|
|
943
|
-
data={{
|
|
944
|
-
borderWidth: 1,
|
|
945
|
-
value: wodetail.quantity || '',
|
|
946
|
-
// backgroundColor: 'rgba(161, 188, 196,0.2)',
|
|
947
|
-
borderColor: 'lightgrey',
|
|
948
|
-
elevation: 0,
|
|
949
|
-
borderRadius: 5,
|
|
950
|
-
fontWeight: 'normal',
|
|
951
|
-
color: 'black',
|
|
952
|
-
itemwidth:
|
|
953
|
-
Dimensions.get('screen').width * 0.2,
|
|
954
|
-
paddingTop: 5,
|
|
955
|
-
paddingBottom: 5,
|
|
956
|
-
height:
|
|
957
|
-
Dimensions.get('screen').height * 0.05,
|
|
958
|
-
textAlign: 'start',
|
|
959
|
-
marginTop: normalize(2),
|
|
960
|
-
marginHorizontal: normalize(2),
|
|
961
|
-
fontSize: normalize(12),
|
|
962
|
-
}}
|
|
963
|
-
keyboardType={'numeric'}
|
|
964
|
-
callBack={val => {
|
|
965
|
-
handleWorkOrderDetailDataChange(
|
|
966
|
-
orderIndex,
|
|
967
|
-
index,
|
|
968
|
-
val,
|
|
969
|
-
'quantity',
|
|
970
|
-
);
|
|
971
|
-
}}
|
|
972
|
-
/>
|
|
973
|
-
</View>
|
|
974
|
-
|
|
975
|
-
{/* Unit */}
|
|
976
|
-
<View>
|
|
977
|
-
<CTextHeader
|
|
978
|
-
text={'Unit'}
|
|
979
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
980
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
981
|
-
color={'#094485'}
|
|
982
|
-
borderColor={'#f5f5f5'}
|
|
983
|
-
marginHorizontal={normalize(2)}
|
|
984
|
-
borderRadius={5}
|
|
985
|
-
elevation={0}
|
|
986
|
-
/>
|
|
987
|
-
<SDropDownNew
|
|
988
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
989
|
-
heightArr={
|
|
990
|
-
Dimensions.get('screen').height * 0.051
|
|
991
|
-
}
|
|
992
|
-
fontSize={normalize(12)}
|
|
993
|
-
fontWeight={'normal'}
|
|
994
|
-
dropdowndata={wodetail.unitname}
|
|
995
|
-
onChangeData={val => {
|
|
996
|
-
handleWorkOrderDetailDropdownDataChange(
|
|
997
|
-
orderIndex,
|
|
998
|
-
index,
|
|
999
|
-
val,
|
|
1000
|
-
'insuunit',
|
|
1001
|
-
'unitname',
|
|
1002
|
-
);
|
|
1003
|
-
}}
|
|
1004
|
-
editable={false}
|
|
1005
|
-
dropdownarray={wodetail.dropdowndata}
|
|
1006
|
-
refreshCount={val =>
|
|
1007
|
-
// val == undefined ? setRefresh(refresh + 1) : null
|
|
1008
|
-
console.log(val)
|
|
1009
|
-
}
|
|
1010
|
-
/>
|
|
1011
|
-
</View>
|
|
1012
|
-
|
|
1013
|
-
{/* Amount */}
|
|
1014
|
-
<View>
|
|
1015
|
-
<CTextHeader
|
|
1016
|
-
text={'Amount'}
|
|
1017
|
-
widthArr={Dimensions.get('screen').width * 0.2}
|
|
1018
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
1019
|
-
color={'#094485'}
|
|
1020
|
-
borderColor={'#f5f5f5'}
|
|
1021
|
-
marginHorizontal={normalize(2)}
|
|
1022
|
-
borderRadius={5}
|
|
1023
|
-
elevation={0}
|
|
1024
|
-
/>
|
|
1025
|
-
<STextInputNew
|
|
1026
|
-
data={{
|
|
1027
|
-
borderWidth: 1,
|
|
1028
|
-
value:
|
|
1029
|
-
wodetail.amountperqty * wodetail.quantity ||
|
|
1030
|
-
0,
|
|
1031
|
-
// backgroundColor: 'rgba(161, 188, 196,0.2)',
|
|
1032
|
-
borderColor: 'lightgrey',
|
|
1033
|
-
elevation: 0,
|
|
1034
|
-
borderRadius: 5,
|
|
1035
|
-
fontWeight: 'normal',
|
|
1036
|
-
color: 'black',
|
|
1037
|
-
itemwidth:
|
|
1038
|
-
Dimensions.get('screen').width * 0.2,
|
|
1039
|
-
paddingTop: 5,
|
|
1040
|
-
paddingBottom: 5,
|
|
1041
|
-
height:
|
|
1042
|
-
Dimensions.get('screen').height * 0.05,
|
|
1043
|
-
textAlign: 'start',
|
|
1044
|
-
marginTop: normalize(2),
|
|
1045
|
-
marginHorizontal: normalize(2),
|
|
1046
|
-
fontSize: normalize(12),
|
|
1047
|
-
}}
|
|
1048
|
-
editable={false}
|
|
1049
|
-
keyboardType={'numeric'}
|
|
1050
|
-
callBack={val => {
|
|
1051
|
-
console.log(val);
|
|
1052
|
-
// hanldeDataChange(
|
|
1053
|
-
// orderIndex,
|
|
1054
|
-
// val,
|
|
1055
|
-
// 'totalamount',
|
|
1056
|
-
// );
|
|
1057
|
-
}}
|
|
1058
|
-
/>
|
|
1059
|
-
</View>
|
|
1060
|
-
</View>
|
|
1061
|
-
</ScrollView>
|
|
1062
|
-
{overlay ? (
|
|
1063
|
-
<HOverlay
|
|
1064
|
-
component={overlayComponent}
|
|
1065
|
-
visibility={val =>
|
|
1066
|
-
val == undefined ? null : setOverlay(val)
|
|
1067
|
-
}
|
|
1068
|
-
argument={getArguments(
|
|
1069
|
-
overlayComponent,
|
|
1070
|
-
wodetail.insuworkorderdetail,
|
|
1071
|
-
index,
|
|
1072
|
-
)}
|
|
1073
|
-
/>
|
|
1074
|
-
) : null}
|
|
1075
|
-
</View>
|
|
1076
|
-
))
|
|
1077
|
-
: null}
|
|
1078
|
-
</View>
|
|
1079
|
-
) : null}
|
|
1080
|
-
</ScrollView>
|
|
1081
|
-
)}
|
|
1082
|
-
|
|
1083
|
-
{backHandler ? (
|
|
1084
|
-
<ConfirmOverlay
|
|
1085
|
-
confirmtext={'Are your sure you want to exit without save ?'}
|
|
1086
|
-
navigation={navigation}
|
|
1087
|
-
saveHandler={val => (val == undefined ? null : setBackHandler(val))}
|
|
1088
|
-
callback={val => {
|
|
1089
|
-
if (val === true) {
|
|
1090
|
-
// setEditStatus(false);
|
|
1091
|
-
setInvoiceData(prevData => ({
|
|
1092
|
-
...prevData,
|
|
1093
|
-
EditStatus: false,
|
|
1094
|
-
EquipmentUpdate: false,
|
|
1095
|
-
}));
|
|
1096
|
-
setTimeout(() => {
|
|
1097
|
-
navigation.goBack();
|
|
1098
|
-
}, 0);
|
|
1099
|
-
}
|
|
1100
|
-
}}
|
|
1101
|
-
/>
|
|
1102
|
-
) : null}
|
|
1103
|
-
</CDetailView>
|
|
1104
|
-
<CFooterView style={{ backgroundColor: '#fff' }}>
|
|
1105
|
-
{/* Bottom buttons section */}
|
|
1106
|
-
{FooterArr != undefined
|
|
1107
|
-
? FooterArr.map((item, i) => {
|
|
1108
|
-
return item.visibility ? (
|
|
1109
|
-
// <View key={i} style={{marginLeft: 5}}>
|
|
1110
|
-
// <CustomButton
|
|
1111
|
-
// data={{
|
|
1112
|
-
// ...item,
|
|
1113
|
-
// shadowcolor: '#fff',
|
|
1114
|
-
// iconcolor: '#094485',
|
|
1115
|
-
// fontcolor: '#094485',
|
|
1116
|
-
// }}
|
|
1117
|
-
// callBack={val => {
|
|
1118
|
-
// if (val.keyid === 1) {
|
|
1119
|
-
// val == undefined ? null : getFooterFunctions(val);
|
|
1120
|
-
// } else if (val.keyid === 2) {
|
|
1121
|
-
// navigation.navigate('PdfUnSavedViewer', {
|
|
1122
|
-
// headerblockstyle: {marginBottom: normalize(35)},
|
|
1123
|
-
// data: getDataForPreview(invoiceData),
|
|
1124
|
-
// link:
|
|
1125
|
-
// APIURL +
|
|
1126
|
-
// 'jremr/jrcommonjreport/' +
|
|
1127
|
-
// 'rnintrverificationpreview/0/IndentPreview',
|
|
1128
|
-
// });
|
|
1129
|
-
// }
|
|
1130
|
-
// }}
|
|
1131
|
-
// />
|
|
1132
|
-
// </View>
|
|
1133
|
-
<View
|
|
1134
|
-
style={{
|
|
1135
|
-
flexDirection: 'row',
|
|
1136
|
-
alignItems: 'center',
|
|
1137
|
-
justifyContent: 'flex-start',
|
|
1138
|
-
paddingHorizontal: 2,
|
|
1139
|
-
}}>
|
|
1140
|
-
{FooterArr != undefined
|
|
1141
|
-
? FooterArr.map((item, i) => {
|
|
1142
|
-
return item.visibility ? (
|
|
1143
|
-
<HShadowCountButton
|
|
1144
|
-
useicon={true}
|
|
1145
|
-
usetext={true}
|
|
1146
|
-
disabled={false}
|
|
1147
|
-
buttonstyle={{
|
|
1148
|
-
...CButtonShadow(),
|
|
1149
|
-
alignItems: 'center',
|
|
1150
|
-
justifyContent: 'center',
|
|
1151
|
-
borderWidth: 1,
|
|
1152
|
-
borderColor: 'lightblue',
|
|
1153
|
-
borderRadius: 10,
|
|
1154
|
-
height: Dimensions.get('screen').height * 0.055,
|
|
1155
|
-
width: Dimensions.get('screen').height * 0.065,
|
|
1156
|
-
marginVertical: normalize(5),
|
|
1157
|
-
marginHorizontal: normalize(5),
|
|
1158
|
-
}}
|
|
1159
|
-
iconcolor={Global.AppTheme.primary_color}
|
|
1160
|
-
icongroup={item.icongroup ? item.icongroup : 5}
|
|
1161
|
-
iconname={item.iconname}
|
|
1162
|
-
iconsize={normalize(24)}
|
|
1163
|
-
displaytext={item.displaytext}
|
|
1164
|
-
count={item.count}
|
|
1165
|
-
countValue={item.countValue}
|
|
1166
|
-
buttonCallback={() => {
|
|
1167
|
-
if (item.keyid === 1) {
|
|
1168
|
-
val == undefined ? null : getFooterFunctions(val);
|
|
1169
|
-
} else if (item.keyid === 2) {
|
|
1170
|
-
navigation.navigate('PdfUnSavedViewer', {
|
|
1171
|
-
headerblockstyle: { marginBottom: normalize(35) },
|
|
1172
|
-
data: getDataForPreview(invoiceData),
|
|
1173
|
-
link:
|
|
1174
|
-
APIURL +
|
|
1175
|
-
'jremr/jrcommonjreport/' +
|
|
1176
|
-
'rnintrverificationpreview/0/IndentPreview',
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
// if (item.keyid === 1) {
|
|
1180
|
-
// item == undefined
|
|
1181
|
-
// ? null
|
|
1182
|
-
// : getFooterFunctions(item);
|
|
1183
|
-
// } else if (item.keyid === 2) {
|
|
1184
|
-
// navigation.navigate('PdfUnSavedViewer', {
|
|
1185
|
-
// headerblockstyle: {
|
|
1186
|
-
// marginBottom: normalize(35),
|
|
1187
|
-
// },
|
|
1188
|
-
// data: getDataForPreview(invoiceData),
|
|
1189
|
-
// link:
|
|
1190
|
-
// APIURL +
|
|
1191
|
-
// 'jremr/jrcommonjreport/' +
|
|
1192
|
-
// 'rnintrverificationpreview/0/Procurement',
|
|
1193
|
-
// });
|
|
1194
|
-
// }
|
|
1195
|
-
}}
|
|
1196
|
-
textstyle={{
|
|
1197
|
-
color: Global.AppTheme.primary_color,
|
|
1198
|
-
fontSize: normalize(9),
|
|
1199
|
-
textAlign: 'center',
|
|
1200
|
-
alignSelf: 'center',
|
|
1201
|
-
}}
|
|
1202
|
-
/>
|
|
1203
|
-
) : null;
|
|
1204
|
-
})
|
|
1205
|
-
: null}
|
|
1206
|
-
</View>
|
|
1207
|
-
) : null;
|
|
1208
|
-
})
|
|
1209
|
-
: null}
|
|
1210
|
-
</CFooterView>
|
|
1211
|
-
</CContainerView>
|
|
1212
|
-
);
|
|
1213
|
-
}
|