@jescon-technologies/react-native-ui-kit 0.0.3 → 0.0.5

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.
Files changed (177) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +0 -4
  3. package/package.json +3 -34
  4. package/src/Alerts/AAlert.js +3 -3
  5. package/src/Alerts/AAlertIOS.js +3 -3
  6. package/src/{common → Common}/NetworkServiceCall.js +1 -1
  7. package/src/CommonStyle/CommonTheme.js +11 -0
  8. package/src/CommonStyle/ComponentFunctions.js +632 -0
  9. package/src/CommonStyle/PopupStyle.js +146 -0
  10. package/src/CommonStyle/commonStyle.js +93 -0
  11. package/src/CommonStyle/componentStyle.js +545 -0
  12. package/src/CommonStyle/optionListStyles.js +175 -0
  13. package/src/Components/ByProductPage.js +200 -0
  14. package/src/Components/CDropDownListNew.js +153 -0
  15. package/src/Components/CSupplierList.js +88 -0
  16. package/src/Components/CVerificationCard.js +2822 -0
  17. package/src/Components/CustomButton.js +67 -0
  18. package/src/Components/CustomCard.js +127 -0
  19. package/src/Components/CustomTextInput.js +47 -0
  20. package/src/Components/EquipmentPage.js +313 -0
  21. package/src/Components/FilterInput.Copy.js +723 -0
  22. package/src/Components/FilterInput.js +569 -0
  23. package/src/Components/HSubHeading.js +68 -0
  24. package/src/Components/HeaderCard.js +40 -0
  25. package/src/Components/MoreOptionsScreen.js +251 -0
  26. package/src/Components/NonSwipableProductCard.js +226 -0
  27. package/src/Components/NonSwipableSupplierCard.js +348 -0
  28. package/src/Components/ProductCard.js +1336 -0
  29. package/src/Components/QualityProductCard.js +1059 -0
  30. package/src/Components/RateProductCard.js +1452 -0
  31. package/src/Components/RawMaterial.js +261 -0
  32. package/src/Components/SDropDownEdited.js +549 -0
  33. package/src/Components/SDropDownNew.js +529 -0
  34. package/src/Components/SHelpDescription.js +147 -0
  35. package/src/Components/STextInputNew.js +510 -0
  36. package/src/Components/SearchProductCard.js +470 -0
  37. package/src/Components/StageByProduct.js +199 -0
  38. package/src/Components/SupplierCard.js +243 -0
  39. package/src/Components/SupplierInvoiceCard.js +405 -0
  40. package/src/Components/SwipableSupplierCard.js +136 -0
  41. package/src/Components/TagTemplate.js +74 -0
  42. package/src/Components/WrappedComponent.js +25 -0
  43. package/src/Custom/CBooking.js +944 -0
  44. package/src/Custom/CBookingPostpone.js +1822 -0
  45. package/src/Custom/CCalendar.js +560 -0
  46. package/src/Custom/CCard.js +880 -0
  47. package/src/Custom/CDetailCard.js +205 -0
  48. package/src/Custom/CHelpImage.js +52 -0
  49. package/src/Custom/CReport.js +569 -0
  50. package/src/Custom/CScrollView.js +73 -0
  51. package/src/Custom/CSignature.js +112 -0
  52. package/src/Custom/CSliderMenu.js +339 -0
  53. package/src/Custom/CSupplierCard.js +99 -0
  54. package/src/Custom/CTemplateCard.js +438 -0
  55. package/src/Custom/CTokenAllocation.js +1402 -0
  56. package/src/Custom/CTokenListOverlay.js +122 -0
  57. package/src/Custom/CWardStatus.js +444 -0
  58. package/src/Custom/Charts/CBarChart.js +218 -0
  59. package/src/Custom/Charts/CDashBoardList.js +133 -0
  60. package/src/Custom/Charts/CDashBoardTable.js +172 -0
  61. package/src/Custom/Charts/CLineChart.js +193 -0
  62. package/src/Custom/Charts/CPieChart.js +186 -0
  63. package/src/Custom/Loader.js +182 -0
  64. package/src/Custom/OUserView.js +1121 -0
  65. package/src/Custom/PreviewDosage.js +115 -0
  66. package/src/Custom/SearchLoader.js +32 -0
  67. package/src/Custom/TableComponent/CActivityTable.js +707 -0
  68. package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
  69. package/src/Custom/TableComponent/CTable.js +185 -0
  70. package/src/Custom/TableComponent/CTextBody.js +40 -0
  71. package/src/Custom/TableComponent/CTextHeader.js +17 -0
  72. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
  73. package/src/Custom/TableComponent/SDropdownTable.js +491 -0
  74. package/src/Custom/TableComponent/TagTable.js +1200 -0
  75. package/src/CustomComponents/CAddColumn.js +140 -0
  76. package/src/CustomComponents/CAssessmentDelete.js +307 -0
  77. package/src/CustomComponents/CAwesomeButton.js +83 -0
  78. package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
  79. package/src/CustomComponents/CBackHandler.js +273 -0
  80. package/src/CustomComponents/CCalendar.js +243 -0
  81. package/src/CustomComponents/CCommentOverlay.js +202 -0
  82. package/src/CustomComponents/CComments.js +162 -0
  83. package/src/CustomComponents/CContainerView.js +24 -0
  84. package/src/CustomComponents/CCustomTextInput.js +336 -0
  85. package/src/CustomComponents/CDetailView.js +40 -0
  86. package/src/CustomComponents/CDropDownList.js +153 -0
  87. package/src/CustomComponents/CDropdownSelect.js +555 -0
  88. package/src/CustomComponents/CFooterView.js +42 -0
  89. package/src/CustomComponents/CImagePickerSave.js +316 -0
  90. package/src/CustomComponents/CModalOverlay.js +91 -0
  91. package/src/CustomComponents/CNetworkStatus.js +327 -0
  92. package/src/CustomComponents/CNotesInstructions.js +1000 -0
  93. package/src/CustomComponents/COverlay.js +81 -0
  94. package/src/CustomComponents/CRemarks.js +176 -0
  95. package/src/CustomComponents/CRowAdd.js +143 -0
  96. package/src/CustomComponents/CSummaryDropDown.js +327 -0
  97. package/src/CustomComponents/CText.js +9 -0
  98. package/src/CustomComponents/CVectorIcon.js +34 -0
  99. package/src/CustomComponents/HtmlContentViewer.js +65 -0
  100. package/src/CustomComponents/PdfContentViewer.js +90 -0
  101. package/src/CustomComponents/SDropDownDosage.js +1087 -0
  102. package/src/CustomComponents/SwipableProductCard.js +246 -0
  103. package/src/CustomComponents/SwipableProductImageCard.js +254 -0
  104. package/src/CustomComponents/WorkOrderDetails.js +1216 -0
  105. package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
  106. package/src/HOC/ConfirmOverlay.js +2 -2
  107. package/src/HOC/HMoreButton.js +1 -1
  108. package/src/HOC/HNatureHeading.js +1 -1
  109. package/src/HOC/HShadowButton.js +1 -1
  110. package/src/HOC/HShadowCountButton.js +1 -1
  111. package/src/Json/Chart.json +818 -0
  112. package/src/Json/Consultation.json +622 -0
  113. package/src/Json/CreditBill.json +490 -0
  114. package/src/Json/Dropdown.json +216 -0
  115. package/src/Json/DropdownConsultation.json +228 -0
  116. package/src/Json/DynamicReports.json +623 -0
  117. package/src/Json/Footer.json +79 -0
  118. package/src/Media/AudioScreen.js +2 -7
  119. package/src/Media/CCaptureImageWithoutEdit.js +1 -1
  120. package/src/Media/CImageGallery.js +2 -2
  121. package/src/Media/CSingleImage.js +2 -2
  122. package/src/Media/CVideoPlay.js +1 -1
  123. package/src/Media/DocumentScreen.js +2 -7
  124. package/src/Media/DrawingScreen.js +2 -6
  125. package/src/Media/ImageScreen.js +2 -6
  126. package/src/Media/VideoScreen.js +2 -7
  127. package/src/Navigation/PageNavigation.js +224 -0
  128. package/src/Navigation/useFocusEffect.js +2 -0
  129. package/src/Navigation/useFocusEffect.native.js +1 -0
  130. package/src/Navigation/useFocusEffect.web.js +1 -0
  131. package/src/Navigation/useIsFocused.js +1 -0
  132. package/src/Navigation/useIsFocused.native.js +1 -0
  133. package/src/Navigation/useIsFocused.web.js +1 -0
  134. package/src/Navigation/useNavigation.js +2 -0
  135. package/src/Navigation/useNavigation.native.js +1 -0
  136. package/src/Navigation/useNavigation.web.js +1 -0
  137. package/src/Screens/CMedications.js +528 -0
  138. package/src/Screens/CWebViewGallery.js +203 -0
  139. package/src/Screens/ChartScan.js +279 -0
  140. package/src/Screens/ChartScreenNew.js +1579 -0
  141. package/src/Screens/Consultation.js +1500 -0
  142. package/src/Screens/Dashboard.js +778 -0
  143. package/src/Screens/FileExplorer.js +288 -0
  144. package/src/Screens/Footer.js +340 -0
  145. package/src/Screens/ForgotPassword.js +288 -0
  146. package/src/Screens/HeaderBlock.js +353 -0
  147. package/src/Screens/Login.js +328 -0
  148. package/src/Screens/Notification.js +149 -0
  149. package/src/Screens/OcrScreen.js +20 -0
  150. package/src/Screens/PdfPreview.js +507 -0
  151. package/src/Screens/RegistrationDetails.js +467 -0
  152. package/src/Screens/SearchScreen.js +582 -0
  153. package/src/Screens/Splash.js +788 -0
  154. package/src/Screens/SwipeLeftView.js +1867 -0
  155. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  156. package/src/StaticComponents/SDatePickerNew.js +1 -1
  157. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  158. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  159. package/src/StaticComponents/SDropDownHoc.js +4 -4
  160. package/src/StaticComponents/SDropDownIcon.js +1 -1
  161. package/src/StaticComponents/SMenuBox.js +2 -2
  162. package/src/StaticComponents/SSearch.js +2 -2
  163. package/src/StaticComponents/STextInput.js +1 -1
  164. package/src/StaticComponents/STimePicker.js +1 -1
  165. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  166. package/src/StaticComponents/STimingSwitch.js +1 -1
  167. package/src/layout/CContainerView.js +1 -1
  168. package/src/layout/CDetailView.js +3 -3
  169. package/src/layout/HeaderBlock.js +5 -5
  170. package/src/layout/INVLoginLayout.js +3 -4
  171. package/src/layout/Loader.js +2 -2
  172. package/src/HOC/HAbsolute.js +0 -56
  173. package/src/HOC/HDiscontinue.js +0 -105
  174. package/src/HOC/HOverlay.js +0 -99
  175. package/src/layout/FooterBlock.js +0 -821
  176. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  177. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,1059 @@
1
+ import { View, Text, Dimensions, StyleSheet, TouchableOpacity, Image, ScrollView, Platform } from 'react-native';
2
+ import React, { useContext, useEffect, useState } from 'react';
3
+ import { normalize } from '../CommonStyle/componentStyle';
4
+ import { Icons } from '@jescon-technologies/react-native-ui-kit';;
5
+ //import { useNavigation } from '../Navigation/useNavigation';
6
+
7
+ import SOverlay from '../StaticComponents/SOverlay';
8
+ import CTextHeader from '../Custom/TableComponent/CTextHeader';
9
+ import SDropDownNew from '../Components/SDropDownNew';
10
+
11
+ import ContextBio from '../ContextAPI/ContextBio';
12
+ import SCheckBox from '../StaticComponents/SCheckBox';
13
+ import { Global } from '../../../../../src/Common/Global';
14
+ import STextInputNew from './STextInputNew';
15
+ import { CButtonShadow, isNUQ } from '../CommonStyle/ComponentFunctions';
16
+ import HOCIcons from '../HOC/HOCIcons';
17
+ import { APIURL } from '../../../../../src/Common/apiConstants';
18
+ import { useNavigation } from '../Navigation/useNavigation';
19
+
20
+ import { SwipeRow } from 'react-native-swipe-list-view';//mmmmmmmmmmmmmmmmmmmm
21
+
22
+ const QualityProductCard = ({
23
+ sectionIndex,
24
+ productIndex,
25
+ selectall,
26
+ setSelectAll,
27
+ }) => {
28
+ const {
29
+ responseJSON,
30
+ setResponseJSON,
31
+ verifyData,
32
+ invoiceData,
33
+ setInvoiceData,
34
+ } = useContext(ContextBio);
35
+ const [refresh, setRefresh] = useState(0);
36
+ const [verify, setVerify] = useState(0);
37
+ const navigation = useNavigation();
38
+ const [FilesData, setFilesData] = useState({
39
+ savedaudio: [],
40
+ saveddoc: [],
41
+ savedimages: [],
42
+ savedvideo: [],
43
+ });
44
+
45
+ const item = invoiceData.data[sectionIndex].productdetail[productIndex];
46
+
47
+ function groupExpand(item) {
48
+ item.groupexpand = !item.groupexpand;
49
+ setVerify(verify + 1);
50
+ }
51
+
52
+ useEffect(() => {
53
+ if (selectall != null || selectall != undefined) {
54
+ console.log('Applying select all: true to index', productIndex);
55
+ handleGlobalFieldUpdate('productqualityverify', selectall);
56
+ }
57
+ }, [selectall]);
58
+
59
+ function calculateTotalProductFreeLength(data) {
60
+ if (!data?.batchdetail || !Array.isArray(data.batchdetail)) {
61
+ return 0;
62
+ }
63
+
64
+ const totalLength = data.batchdetail.reduce((sum, batch) => {
65
+ const productFreeArray = batch?.productfree;
66
+ const productFreeLength = Array.isArray(productFreeArray)
67
+ ? productFreeArray.length
68
+ : 0;
69
+ return sum + productFreeLength;
70
+ }, 0);
71
+
72
+ return totalLength;
73
+ }
74
+
75
+ function navigationTo(
76
+ flag,
77
+ batchname,
78
+ productname,
79
+ batchcode,
80
+ quality,
81
+ batchIndex,
82
+ ) {
83
+ let freeproductdetails = {
84
+ componentname: 'CFreeProductTable',
85
+ productname: productname,
86
+ batchname: batchname,
87
+ qualityentry: true,
88
+ qualityverification: false,
89
+ flag: flag,
90
+ batchcode: batchcode,
91
+ quality: quality,
92
+ productIndex: productIndex,
93
+ batchIndex: batchIndex,
94
+ };
95
+ setResponseJSON({
96
+ ...responseJSON,
97
+ freeproductdetails: freeproductdetails,
98
+ });
99
+ navigation.navigate('BiodataEdit', {
100
+ data: freeproductdetails,
101
+ });
102
+ }
103
+
104
+ function getLength(params) {
105
+ const arraylength =
106
+ params != undefined && params != null && params != '' ? params.length : 0;
107
+ return arraylength;
108
+ }
109
+
110
+ function handleGlobalFieldUpdate(fieldName, val) {
111
+ const updatedData = JSON.parse(JSON.stringify(invoiceData.data));
112
+
113
+ updatedData.forEach(section => {
114
+ section.productdetail = section.productdetail.map(product => {
115
+ product[fieldName] = val;
116
+
117
+ let batchField = '';
118
+ if (fieldName === 'productverify') {
119
+ batchField = 'batchverify';
120
+ } else if (fieldName === 'productqualityverify') {
121
+ batchField = 'batchqualityverify';
122
+ }
123
+
124
+ if (batchField && Array.isArray(product.batchdetail)) {
125
+ product.batchdetail = product.batchdetail.map(batch => ({
126
+ ...batch,
127
+ [batchField]: val,
128
+ }));
129
+ }
130
+
131
+ return product;
132
+ });
133
+ });
134
+
135
+ setInvoiceData(prevState => ({
136
+ ...prevState,
137
+ data: updatedData,
138
+ EditStatus: true,
139
+ }));
140
+ }
141
+
142
+ function handleProductUpdate(sectionIndex, productIndex, val, field) {
143
+ const updatedData = JSON.parse(JSON.stringify(invoiceData.data));
144
+ const section = updatedData[sectionIndex];
145
+ let product = section.productdetail[productIndex];
146
+
147
+ product[field] = val;
148
+
149
+ if (
150
+ field === 'productqualityverify' &&
151
+ Array.isArray(product.batchdetail)
152
+ ) {
153
+ product.batchdetail = product.batchdetail.map(batch => ({
154
+ ...batch,
155
+ batchqualityverify: val,
156
+ }));
157
+ }
158
+
159
+ section.productdetail[productIndex] = product;
160
+
161
+ setInvoiceData(prevState => ({
162
+ ...prevState,
163
+ data: updatedData,
164
+ EditStatus: true,
165
+ }));
166
+ }
167
+
168
+ function handleBatchQualityNatureUpdate(
169
+ sectionIndex,
170
+ productIndex,
171
+ batchIndex,
172
+ val,
173
+ ) {
174
+ const updatedData = JSON.parse(JSON.stringify(invoiceData.data));
175
+ const section = updatedData[sectionIndex];
176
+ const product = section.productdetail[productIndex];
177
+ const batch = product.batchdetail[batchIndex];
178
+
179
+ product.batchdetail[batchIndex] = {
180
+ ...batch,
181
+ qualitynature: val.datavalue,
182
+ qualitynaturename: val.displayvalue,
183
+ };
184
+
185
+ setInvoiceData(prevState => ({
186
+ ...prevState,
187
+ data: updatedData,
188
+ EditStatus: true,
189
+ }));
190
+ }
191
+
192
+ function handleBatchFieldUpdate(
193
+ sectionIndex,
194
+ productIndex,
195
+ batchIndex,
196
+ val,
197
+ fieldName,
198
+ ) {
199
+ const updatedData = JSON.parse(JSON.stringify(invoiceData.data));
200
+ const section = updatedData[sectionIndex];
201
+ const product = section.productdetail[productIndex];
202
+ const batch = product.batchdetail[batchIndex];
203
+
204
+ product.batchdetail[batchIndex] = {
205
+ ...batch,
206
+ [fieldName]: val,
207
+ };
208
+
209
+ setInvoiceData(prevState => ({
210
+ ...prevState,
211
+ data: updatedData,
212
+ EditStatus: true,
213
+ }));
214
+ }
215
+
216
+ function handleUpdateMedia(sectionIndex, productIndex, batchIndex, val) {
217
+ const updatedData = [...invoiceData.data];
218
+ const section = updatedData[sectionIndex];
219
+ const product = section.productdetail[productIndex];
220
+ const currentBatch = product.batchdetail[batchIndex];
221
+
222
+ section.productdetail[productIndex].batchdetail[batchIndex] = {
223
+ ...currentBatch,
224
+ media: [val],
225
+ };
226
+
227
+ setInvoiceData(prevState => ({
228
+ ...prevState,
229
+ data: updatedData,
230
+ EditStatus: true,
231
+ }));
232
+ }
233
+
234
+ function handleUpdateMediaProduct(
235
+ sectionIndex,
236
+ productIndex,
237
+ batchIndex,
238
+ val,
239
+ ) {
240
+ console.log('##############################', val);
241
+ const updatedData = [...invoiceData.data];
242
+ const section = updatedData[sectionIndex];
243
+ const product = section.productdetail[productIndex];
244
+ const currentBatch = product.batchdetail[batchIndex];
245
+
246
+ section.productdetail[productIndex].batchdetail[batchIndex] = {
247
+ ...currentBatch,
248
+ productimage: val.savedimages,
249
+ };
250
+
251
+ section.productdetail[productIndex] = {
252
+ ...product,
253
+ productimage: val.savedimages,
254
+ };
255
+
256
+ setInvoiceData(prevState => ({
257
+ ...prevState,
258
+ data: updatedData,
259
+ EditStatus: true,
260
+ }));
261
+ }
262
+
263
+ useEffect(() => {
264
+ console.log(
265
+ 'invoice data from quality entry screen product card',
266
+ JSON.stringify(invoiceData),
267
+ );
268
+ }, [invoiceData]);
269
+
270
+ const renderLeftActions = () => (
271
+ <View style={styles.leftActionsContainer}>
272
+ <TouchableOpacity
273
+ style={styles.actionButton}
274
+ onPress={() => {
275
+ navigation.navigate('CPurchaseDetails', {
276
+ productCode:
277
+ invoiceData?.data[sectionIndex]?.productdetail[productIndex]
278
+ ?.insuproduct,
279
+ });
280
+ }}>
281
+ <View style={[styles.actionIconContainer, styles.detailsButton]}>
282
+ <HOCIcons.Entypo
283
+ name={'info-with-circle'}
284
+ size={normalize(20)}
285
+ color={Global.AppTheme.primary_color}
286
+ />
287
+ <Text numberOfLines={1} style={styles.actionText}>
288
+ Details
289
+ </Text>
290
+ </View>
291
+ </TouchableOpacity>
292
+ <TouchableOpacity
293
+ style={styles.actionButton}
294
+ onPress={() => {
295
+ navigation.navigate('CSupplierList', {
296
+ productCode: item?.insuproduct,
297
+ });
298
+ }}>
299
+ <View style={[styles.actionIconContainer, styles.supplierButton]}>
300
+ <HOCIcons.MaterialCommunityIcons
301
+ name={'human-dolly'}
302
+ size={normalize(20)}
303
+ color={Global.AppTheme.primary_color}
304
+ />
305
+ <Text numberOfLines={1} style={styles.actionText}>
306
+ Supplier
307
+ </Text>
308
+ </View>
309
+ </TouchableOpacity>
310
+ </View>
311
+ );
312
+
313
+ const renderRightActions = () => (
314
+ <View style={styles.rightActionsContainer}>
315
+ <TouchableOpacity
316
+ style={styles.actionButton}
317
+ onPress={() => { }} />
318
+ </View>
319
+ );
320
+
321
+ async function Media_Upload(image) {
322
+ console.log('imageeeeeeeeeee upload', JSON.stringify(image));
323
+ let date = new Date().getDate();
324
+ let month = new Date().getMonth() + 1;
325
+ let year = new Date().getFullYear();
326
+ let hours = new Date().getHours();
327
+ let min = new Date().getMinutes();
328
+ let sec = new Date().getSeconds();
329
+ let millisec = new Date().getMilliseconds();
330
+ let uniquename = '.jpg';
331
+ let fileid_autogenerate = data != null && data.length > 0 ? data.length : 0;
332
+ let dataset2 = {
333
+ fileid: fileid_autogenerate + 1,
334
+ filename: uniquename,
335
+ filetype: image.filetype,
336
+ uri: image.uri,
337
+ uritype: false,
338
+ };
339
+
340
+ if (!dataset2.uritype) {
341
+ if (dataset2.uri) {
342
+ var formData = new FormData();
343
+ formData.append('file', {
344
+ uri: dataset2.uri,
345
+ type: 'image/jpeg',
346
+ name: dataset2.filename,
347
+ });
348
+ console.log('formData>>>>>>>>>>>>>', JSON.stringify(formData));
349
+ console.log(
350
+ 'formData>>>>>>>>>>>>>',
351
+ JSON.stringify(APIURL + 'invfile/fileupload/emr/image'),
352
+ );
353
+ NetworkServiceCall(
354
+ 'multiform',
355
+ APIURL + 'invfile/fileupload/emr/image',
356
+ formData,
357
+ )
358
+ .then(function (responsedata) {
359
+ console.log(
360
+ 'responsedata>>>>>>>>>>>>>>>',
361
+ JSON.stringify(responsedata),
362
+ );
363
+ if (responsedata.httpstatus == 200) {
364
+ console.log(
365
+ 'INSIDE IMAGE SCREENNENENENENNENENENENENENNEN',
366
+ JSON.stringify(responsedata),
367
+ );
368
+ dataset2.filename = responsedata.data.fileuri;
369
+ setData(
370
+ data != null
371
+ ? prevData => [...prevData, dataset2.filename]
372
+ : [dataset2.filename],
373
+ );
374
+ responseJSON.consultationEdit.editStatus = true;
375
+ setrefreshCount(refreshCount + 1);
376
+ props.editStatus(1);
377
+ props.data.usertype =
378
+ Global.PatientDetails != undefined &&
379
+ Global.PatientDetails.usertype != undefined &&
380
+ Global.PatientDetails.usertype != null
381
+ ? Global.PatientDetails.usertype
382
+ : 'Z';
383
+ props.data.suuser =
384
+ Global.userData != undefined &&
385
+ Global.userData.suuser != undefined &&
386
+ Global.userData.suuser != null
387
+ ? Global.userData.suuser
388
+ : 0;
389
+ setLoading(false);
390
+ setOpen(false);
391
+ } else {
392
+ setLoading(false);
393
+ setOpen(false);
394
+ }
395
+ })
396
+ .catch(error => {
397
+ console.log('errorrrrrrrrrr', JSON.stringify(error));
398
+ setLoading(false);
399
+ });
400
+ }
401
+ }
402
+ }
403
+
404
+ function CaptureImageWithoutEdit() {
405
+ navigation.navigate('CCaptureImageWithoutEdit', { onSelect: Media_Upload });
406
+ }
407
+
408
+ return (
409
+ <View>
410
+ <SwipeRow
411
+ leftOpenValue={190}
412
+ rightOpenValue={-190}
413
+ disableLeftSwipe={false}
414
+ disableRightSwipe={false}
415
+ friction={10}
416
+ tension={40}
417
+ preview={false}
418
+ key={`product-${sectionIndex}-${productIndex}`}
419
+ >
420
+ {renderLeftActions()}
421
+ <TouchableOpacity
422
+ onPress={() => groupExpand(item)}
423
+ style={[
424
+ styles.productCard,
425
+ {
426
+ borderLeftColor: isNUQ(item?.color) ? item?.color : '#870808',
427
+ },
428
+ ]}>
429
+ <View>
430
+ <View style={[
431
+ styles.productHeader,
432
+ { justifyContent: verifyData == true ? 'space-between' : 'flex-start' },
433
+ ]}>
434
+ <Icons.FontAwesome5
435
+ name={'box-open'}
436
+ size={normalize(19)}
437
+ color={'#094485'}
438
+ />
439
+ <Text
440
+ adjustsFontSizeToFit
441
+ numberOfLines={2}
442
+ style={styles.productName}>
443
+ {item.purchaseproduct}
444
+ </Text>
445
+
446
+ {verifyData == true ? (
447
+ <SCheckBox
448
+ data={{ value: item.productqualityverify, size: 20 }}
449
+ callBack={val => {
450
+ handleProductUpdate(
451
+ sectionIndex,
452
+ productIndex,
453
+ val,
454
+ 'productqualityverify',
455
+ );
456
+ }}
457
+ />
458
+ ) : null}
459
+ </View>
460
+
461
+ <View style={styles.productInfoRow}>
462
+ <Text style={styles.infoText}>
463
+ TOTAL NO.OF BATCHS :{' '}
464
+ <Text style={styles.infoValue}>
465
+ {item?.batchdetail?.length}
466
+ </Text>{' '}
467
+ </Text>
468
+ <Text style={styles.infoText}>
469
+ FREE PRODUCTS :{' '}
470
+ <Text style={styles.infoValue}>
471
+ {calculateTotalProductFreeLength(item)}
472
+ </Text>{' '}
473
+ </Text>
474
+ </View>
475
+ </View>
476
+ </TouchableOpacity>
477
+ {renderRightActions()}
478
+ </SwipeRow>
479
+
480
+ {item.groupexpand != true ? (
481
+ <View style={styles.expandedContent}>
482
+ <View style={styles.notesContainer}>
483
+ {verifyData != true ? (
484
+ <TouchableOpacity
485
+ style={styles.notesButton}
486
+ onPress={() => { }}>
487
+ <SOverlay
488
+ iconcolor={'#094485'}
489
+ value={item.notes}
490
+ size={16}
491
+ onChangeText={val => {
492
+ handleProductUpdate(
493
+ sectionIndex,
494
+ productIndex,
495
+ val,
496
+ 'notes',
497
+ );
498
+ }}
499
+ />
500
+ </TouchableOpacity>
501
+ ) : null}
502
+ </View>
503
+
504
+ <ScrollView
505
+ horizontal={true}
506
+ showsHorizontalScrollIndicator={true}
507
+ keyboardShouldPersistTaps="handled"
508
+ style={styles.scrollView}>
509
+ <View style={styles.tableContainer}>
510
+ <View style={styles.tableHeader} />
511
+
512
+ {item?.batchdetail?.map((batchdata, i) => {
513
+ batchdata.batchcode = i + 1;
514
+ return (
515
+ <View key={i} style={styles.tableRow}>
516
+ <View>
517
+ <CTextHeader
518
+ text={'BATCH'}
519
+ widthArr={Dimensions.get('screen').width * 0.25}
520
+ bgColor={'rgba(184, 184, 191,0.3)'}
521
+ color={'#094485'}
522
+ borderColor={'lightgrey'}
523
+ marginHorizontal={normalize(2)}
524
+ borderRadius={5}
525
+ elevation={0}
526
+ />
527
+ <STextInputNew
528
+ data={{
529
+ borderWidth: 1,
530
+ borderColor: 'lightgrey',
531
+ elevation: 0,
532
+ borderRadius: 5,
533
+ fontWeight: 'bold',
534
+ color: 'black',
535
+ itemwidth: Dimensions.get('screen').width * 0.25,
536
+ paddingTop: 5,
537
+ paddingBottom: 5,
538
+ height: Dimensions.get('screen').height * 0.052,
539
+ textAlign: 'center',
540
+ marginTop: normalize(2),
541
+ marginHorizontal: normalize(2),
542
+ value: batchdata.batch,
543
+ editable: false,
544
+ }}
545
+ />
546
+ </View>
547
+
548
+ <View>
549
+ <CTextHeader
550
+ text={'QUALITY'}
551
+ widthArr={Dimensions.get('screen').width * 0.4}
552
+ bgColor={'rgba(184, 184, 191,0.3)'}
553
+ color={'#094485'}
554
+ borderColor={'lightgrey'}
555
+ marginHorizontal={normalize(2)}
556
+ borderRadius={5}
557
+ elevation={0}
558
+ />
559
+ <View style={styles.qualityDropdownContainer}>
560
+ <SDropDownNew
561
+ fontSize={normalize(11)}
562
+ fontWeight={'bold'}
563
+ dropdownapi={
564
+ 'invget/invcommonget/rndddwdropdownselect 14,0,0,0,0,0,0'
565
+ }
566
+ iconName={'award'}
567
+ widthArr={Dimensions.get('screen').width * 0.4}
568
+ heightArr={Dimensions.get('screen').height * 0.052}
569
+ dropdowndata={batchdata.qualitynaturename}
570
+ onChangeData={val => {
571
+ handleBatchQualityNatureUpdate(
572
+ sectionIndex,
573
+ productIndex,
574
+ i,
575
+ val,
576
+ );
577
+ }}
578
+ disabled={verifyData == true ? true : false}
579
+ editable={true}
580
+ refreshCount={val =>
581
+ val == undefined ? setRefresh(refresh + 1) : null
582
+ }
583
+ />
584
+ </View>
585
+ </View>
586
+
587
+ <View>
588
+ <CTextHeader
589
+ text={'IMAGE'}
590
+ widthArr={Dimensions.get('screen').width * 0.25}
591
+ bgColor={'rgba(184, 184, 191,0.3)'}
592
+ color={'#094485'}
593
+ borderColor={'lightgrey'}
594
+ marginHorizontal={normalize(2)}
595
+ borderRadius={5}
596
+ elevation={0}
597
+ />
598
+ <View style={styles.imageContainer}>
599
+ {verifyData != true ? (
600
+ <TouchableOpacity
601
+ style={styles.imageButton}
602
+ onPress={() => {
603
+ if (Platform.OS != 'web') {
604
+ navigation.navigate('FileExplorer', {
605
+ visibility: 1,
606
+ data: invoiceData.data[
607
+ sectionIndex
608
+ ].productdetail[productIndex].batchdetail[
609
+ i
610
+ ].media.map(item => ({
611
+ ...item,
612
+ savedimages: item?.savedimages
613
+ ? item?.savedimages?.split(',')
614
+ : [],
615
+ savedvideo: item.savedvideo
616
+ ? item?.savedvideo?.split(',')
617
+ : [],
618
+ savedaudio: item.savedaudio
619
+ ? item.savedaudio.split(',')
620
+ : [],
621
+ savedpdf: item.savedpdf
622
+ ? item.savedpdf.split(',')
623
+ : [],
624
+ })),
625
+ callBack: val => {
626
+ setFilesData(val);
627
+ handleUpdateMediaProduct(
628
+ sectionIndex,
629
+ productIndex,
630
+ i,
631
+ val,
632
+ );
633
+ },
634
+ });
635
+ }
636
+ }}>
637
+ {isNUQ(batchdata?.productimage) ? (
638
+ <Image
639
+ resizeMode="cover"
640
+ style={styles.productImage}
641
+ source={{
642
+ uri: `${APIURL}invfile/getFile/image/${batchdata?.productimage}`,
643
+ }}
644
+ />
645
+ ) : (
646
+ <Icons.FontAwesome5
647
+ name="camera"
648
+ color="#094485"
649
+ size={normalize(15)}
650
+ />
651
+ )}
652
+ </TouchableOpacity>
653
+ ) : (
654
+ <Image
655
+ resizeMode="cover"
656
+ style={styles.productImage}
657
+ source={{
658
+ uri: `${APIURL}invfile/getFile/image/${batchdata?.productimage}`,
659
+ }}
660
+ />
661
+ )}
662
+ </View>
663
+ </View>
664
+
665
+ {verifyData != true ? (
666
+ <View>
667
+ <CTextHeader
668
+ text={'REMARKS'}
669
+ widthArr={Dimensions.get('screen').width * 0.25}
670
+ bgColor={'rgba(184, 184, 191,0.3)'}
671
+ color={'#094485'}
672
+ borderColor={'lightgrey'}
673
+ marginHorizontal={normalize(2)}
674
+ borderRadius={5}
675
+ elevation={0}
676
+ />
677
+ <STextInputNew
678
+ data={{
679
+ borderWidth: 1,
680
+ borderColor: 'lightgrey',
681
+ elevation: 0,
682
+ borderRadius: 5,
683
+ fontWeight: 'bold',
684
+ color: 'black',
685
+ itemwidth: Dimensions.get('screen').width * 0.25,
686
+ paddingTop: 5,
687
+ paddingBottom: 5,
688
+ height: Dimensions.get('screen').height * 0.05,
689
+ textAlign: 'center',
690
+ marginTop: normalize(2),
691
+ marginHorizontal: normalize(2),
692
+ value: batchdata.remarks,
693
+ }}
694
+ callBack={val => {
695
+ handleBatchFieldUpdate(
696
+ sectionIndex,
697
+ productIndex,
698
+ i,
699
+ val,
700
+ 'remarks',
701
+ );
702
+ }}
703
+ />
704
+ </View>
705
+ ) : null}
706
+
707
+ <View>
708
+ <CTextHeader
709
+ text={'MEDIA'}
710
+ fontSize={10}
711
+ widthArr={Dimensions.get('screen').width * 0.26}
712
+ bgColor={'rgba(184, 184, 191,0.3)'}
713
+ color={'#094485'}
714
+ borderColor={'lightgrey'}
715
+ marginHorizontal={normalize(2)}
716
+ borderRadius={5}
717
+ elevation={0}
718
+ />
719
+ <View style={styles.mediaContainer}>
720
+ <TouchableOpacity
721
+ style={styles.mediaButton}
722
+ onPress={() => {
723
+ if (Platform.OS != 'web') {
724
+ navigation.navigate('FileExplorer', {
725
+ visibility: 0,
726
+ data: invoiceData.data[
727
+ sectionIndex
728
+ ].productdetail[productIndex].batchdetail[
729
+ i
730
+ ].media.map(item => ({
731
+ ...item,
732
+ savedimages: item?.savedimages
733
+ ? item.savedimages.split(',')
734
+ : [],
735
+ savedvideo: item?.savedvideo
736
+ ? item?.savedvideo?.split(',')
737
+ : [],
738
+ savedaudio: item?.savedaudio
739
+ ? item.savedaudio.split(',')
740
+ : [],
741
+ savedpdf: item?.savedpdf
742
+ ? item.savedpdf.split(',')
743
+ : [],
744
+ })),
745
+ callBack: val => {
746
+ console.log(
747
+ '********************************',
748
+ val,
749
+ );
750
+ setFilesData(val);
751
+ handleUpdateMedia(
752
+ sectionIndex,
753
+ productIndex,
754
+ i,
755
+ val,
756
+ );
757
+ },
758
+ });
759
+ }
760
+ }}>
761
+ <Icons.FontAwesome5
762
+ name="play"
763
+ color="#094485"
764
+ size={normalize(15)}
765
+ />
766
+ </TouchableOpacity>
767
+ </View>
768
+ </View>
769
+
770
+ {verifyData == true ? (
771
+ <View>
772
+ <CTextHeader
773
+ text={'VERIFY'}
774
+ widthArr={Dimensions.get('screen').width * 0.15}
775
+ bgColor={'rgba(184, 184, 191,0.3)'}
776
+ color={'#094485'}
777
+ borderColor={'lightgrey'}
778
+ marginHorizontal={normalize(2)}
779
+ borderRadius={5}
780
+ elevation={0}
781
+ />
782
+ <View style={styles.verifyContainer}>
783
+ <SCheckBox
784
+ data={{
785
+ value: batchdata.batchqualityverify,
786
+ size: 20,
787
+ }}
788
+ callBack={val => {
789
+ handleBatchFieldUpdate(
790
+ sectionIndex,
791
+ productIndex,
792
+ i,
793
+ val,
794
+ 'batchqualityverify',
795
+ );
796
+ }}
797
+ />
798
+ </View>
799
+ </View>
800
+ ) : null}
801
+
802
+ <View>
803
+ <CTextHeader
804
+ text={''}
805
+ widthArr={Dimensions.get('screen').width * 0.3}
806
+ bgColor={'rgba(184, 184, 191,0.3)'}
807
+ color={'#094485'}
808
+ borderColor={'lightgrey'}
809
+ marginHorizontal={normalize(2)}
810
+ borderRadius={5}
811
+ elevation={0}
812
+ />
813
+ <View style={styles.freeContainer}>
814
+ <TouchableOpacity
815
+ style={styles.freeButton}
816
+ onPress={() => {
817
+ navigationTo(
818
+ false,
819
+ batchdata.batch,
820
+ item.purchaseproduct,
821
+ batchdata.batchcode,
822
+ true,
823
+ i,
824
+ );
825
+ }}>
826
+ <View style={styles.freeBadge}>
827
+ <Text style={styles.freeBadgeText}>
828
+ {getLength(batchdata.productfree)}
829
+ </Text>
830
+ </View>
831
+ <Icons.FontAwesome5
832
+ name="cart-arrow-down"
833
+ color="#094485"
834
+ size={normalize(15)}
835
+ />
836
+ </TouchableOpacity>
837
+ </View>
838
+ </View>
839
+ </View>
840
+ );
841
+ })}
842
+ </View>
843
+ </ScrollView>
844
+ </View>
845
+ ) : null}
846
+ </View>
847
+ );
848
+ };
849
+
850
+ const styles = StyleSheet.create({
851
+ // Left Actions Styles
852
+ leftActionsContainer: {
853
+ // justifyContent: 'flex-start',
854
+ // alignItems: 'center',
855
+ // borderTopLeftRadius: 10,
856
+ // borderBottomLeftRadius: 10,
857
+ // flexDirection: 'row',
858
+ // paddingHorizontal: normalize(10),
859
+ // marginBottom: normalize(7),
860
+ flexDirection: 'row',
861
+ marginTop: normalize(10),
862
+ paddingHorizontal: normalize(10),
863
+ },
864
+ actionButton: {
865
+ marginLeft: normalize(5),
866
+ },
867
+ actionIconContainer: {
868
+ justifyContent: 'center',
869
+ alignItems: 'center',
870
+ ...CButtonShadow(),
871
+ borderRadius: normalize(5),
872
+ paddingHorizontal: normalize(3),
873
+ paddingVertical: normalize(5),
874
+ height: normalize(30),
875
+ width: normalize(30),
876
+ },
877
+ detailsButton: {
878
+ backgroundColor: '#f4f5ae',
879
+ },
880
+ supplierButton: {
881
+ backgroundColor: '#aef5b4',
882
+ },
883
+ actionText: {
884
+ fontSize: normalize(8),
885
+ fontWeight: 'bold',
886
+ color: Global.AppTheme.primary_color,
887
+ },
888
+
889
+ // Right Actions Styles
890
+ rightActionsContainer: {
891
+ justifyContent: 'flex-start',
892
+ alignItems: 'center',
893
+ borderTopLeftRadius: 10,
894
+ borderBottomLeftRadius: 10,
895
+ flexDirection: 'row',
896
+ paddingHorizontal: normalize(10),
897
+ marginBottom: normalize(7),
898
+ },
899
+
900
+ // Product Card Styles
901
+ productCard: {
902
+ padding: normalize(5),
903
+ marginVertical: 5,
904
+ borderLeftWidth: normalize(10),
905
+ backgroundColor: '#faeeeb',
906
+ marginHorizontal: normalize(10),
907
+ marginBottom: normalize(10),
908
+ borderRadius: normalize(5),
909
+ shadowColor: Global.AppTheme.primary_color,
910
+ shadowOffset: { width: 4, height: 4 },
911
+ shadowOpacity: 0.6,
912
+ shadowRadius: 10,
913
+ elevation: 8,
914
+ ...CButtonShadow(),
915
+ },
916
+ productHeader: {
917
+ alignItems: 'center',
918
+ flexDirection: 'row',
919
+ padding: normalize(2),
920
+ },
921
+ productName: {
922
+ fontWeight: 'bold',
923
+ marginLeft: normalize(20),
924
+ fontSize: normalize(13),
925
+ color: '#094485',
926
+ marginHorizontal: normalize(5),
927
+ width: '60%',
928
+ },
929
+ productInfoRow: {
930
+ justifyContent: 'space-between',
931
+ flexDirection: 'row',
932
+ },
933
+ infoText: {
934
+ color: '#094485',
935
+ fontWeight: '500',
936
+ fontSize: normalize(10),
937
+ },
938
+ infoValue: {
939
+ fontSize: normalize(10),
940
+ fontWeight: 'bold',
941
+ },
942
+
943
+ // Expanded Content Styles
944
+ expandedContent: {
945
+ paddingHorizontal: normalize(5),
946
+ marginHorizontal: normalize(10),
947
+ marginBottom: normalize(10),
948
+ },
949
+ notesContainer: {
950
+ paddingHorizontal: normalize(5),
951
+ marginHorizontal: normalize(10),
952
+ justifyContent: 'flex-end',
953
+ alignItems: 'center',
954
+ flexDirection: 'row',
955
+ },
956
+ notesButton: {
957
+ marginVertical: normalize(5),
958
+ },
959
+ scrollView: {
960
+ marginVertical: normalize(3),
961
+ },
962
+ tableContainer: {
963
+ flex: 1,
964
+ marginTop: 0,
965
+ marginVertical: normalize(3),
966
+ alignSelf: 'center',
967
+ },
968
+ tableHeader: {
969
+ flexDirection: 'row',
970
+ },
971
+ tableRow: {
972
+ flexDirection: 'row',
973
+ marginTop: normalize(1),
974
+ backgroundColor: 'white',
975
+ },
976
+
977
+ // Quality Dropdown Styles
978
+ qualityDropdownContainer: {
979
+ justifyContent: 'center',
980
+ borderWidth: 0,
981
+ },
982
+
983
+ // Image Styles
984
+ imageContainer: {
985
+ width: Dimensions.get('screen').width * 0.26,
986
+ height: Dimensions.get('screen').height * 0.052,
987
+ justifyContent: 'center',
988
+ alignItems: 'center',
989
+ borderWidth: 1,
990
+ borderRadius: 5,
991
+ borderColor: 'lightgrey',
992
+ },
993
+ imageButton: {
994
+ marginHorizontal: normalize(5),
995
+ },
996
+ productImage: {
997
+ width: normalize(65),
998
+ padding: normalize(25),
999
+ alignSelf: 'center',
1000
+ paddingTop: normalize(5),
1001
+ },
1002
+
1003
+ // Media Styles
1004
+ mediaContainer: {
1005
+ width: Dimensions.get('screen').width * 0.26,
1006
+ height: Dimensions.get('screen').height * 0.052,
1007
+ justifyContent: 'center',
1008
+ alignItems: 'center',
1009
+ borderWidth: 1,
1010
+ borderRadius: 5,
1011
+ borderColor: 'lightgrey',
1012
+ },
1013
+ mediaButton: {
1014
+ marginHorizontal: normalize(5),
1015
+ },
1016
+
1017
+ // Verify Styles
1018
+ verifyContainer: {
1019
+ borderWidth: 1,
1020
+ borderColor: 'lightgrey',
1021
+ elevation: 0,
1022
+ borderRadius: 5,
1023
+ width: Dimensions.get('screen').width * 0.15,
1024
+ paddingTop: 5,
1025
+ paddingBottom: 5,
1026
+ height: Dimensions.get('screen').height * 0.052,
1027
+ alignItems: 'center',
1028
+ justifyContent: 'center',
1029
+ },
1030
+
1031
+ // Free Product Styles
1032
+ freeContainer: {
1033
+ borderWidth: 0,
1034
+ alignItems: 'flex-start',
1035
+ justifyContent: 'center',
1036
+ height: Dimensions.get('screen').height * 0.056,
1037
+ },
1038
+ freeButton: {
1039
+ marginHorizontal: normalize(5),
1040
+ },
1041
+ freeBadge: {
1042
+ position: 'absolute',
1043
+ right: normalize(-5),
1044
+ top: normalize(-10),
1045
+ backgroundColor: 'white',
1046
+ alignItems: 'center',
1047
+ borderRadius: 20,
1048
+ width: normalize(15),
1049
+ borderWidth: 0.5,
1050
+ zIndex: 10,
1051
+ },
1052
+ freeBadgeText: {
1053
+ color: 'black',
1054
+ fontSize: normalize(11),
1055
+ fontWeight: 'bold',
1056
+ },
1057
+ });
1058
+
1059
+ export default QualityProductCard;