@axelor/aos-mobile-manufacturing 0.0.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.
Files changed (196) hide show
  1. package/README.md +45 -0
  2. package/lib/api/index.d.ts +7 -0
  3. package/lib/api/index.js +25 -0
  4. package/lib/api/index.js.map +1 -0
  5. package/lib/api/machine-api.d.ts +3 -0
  6. package/lib/api/machine-api.js +47 -0
  7. package/lib/api/machine-api.js.map +1 -0
  8. package/lib/api/manufacturing-order-api.d.ts +22 -0
  9. package/lib/api/manufacturing-order-api.js +225 -0
  10. package/lib/api/manufacturing-order-api.js.map +1 -0
  11. package/lib/api/operation-order-api.d.ts +14 -0
  12. package/lib/api/operation-order-api.js +153 -0
  13. package/lib/api/operation-order-api.js.map +1 -0
  14. package/lib/api/prod-product-api.d.ts +21 -0
  15. package/lib/api/prod-product-api.js +59 -0
  16. package/lib/api/prod-product-api.js.map +1 -0
  17. package/lib/api/production-file-api.d.ts +4 -0
  18. package/lib/api/production-file-api.js +51 -0
  19. package/lib/api/production-file-api.js.map +1 -0
  20. package/lib/api/waste-product-api.d.ts +27 -0
  21. package/lib/api/waste-product-api.js +123 -0
  22. package/lib/api/waste-product-api.js.map +1 -0
  23. package/lib/api/work-center-api.d.ts +3 -0
  24. package/lib/api/work-center-api.js +47 -0
  25. package/lib/api/work-center-api.js.map +1 -0
  26. package/lib/components/index.d.ts +2 -0
  27. package/lib/components/index.js +20 -0
  28. package/lib/components/index.js.map +1 -0
  29. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.d.ts +7 -0
  30. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.js +32 -0
  31. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.js.map +1 -0
  32. package/lib/components/molecules/index.d.ts +1 -0
  33. package/lib/components/molecules/index.js +19 -0
  34. package/lib/components/molecules/index.js.map +1 -0
  35. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.d.ts +17 -0
  36. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.js +92 -0
  37. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.js.map +1 -0
  38. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.d.ts +17 -0
  39. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.js +81 -0
  40. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.js.map +1 -0
  41. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.d.ts +16 -0
  42. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.js +83 -0
  43. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.js.map +1 -0
  44. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.d.ts +8 -0
  45. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.js +68 -0
  46. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.js.map +1 -0
  47. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.d.ts +11 -0
  48. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.js +76 -0
  49. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.js.map +1 -0
  50. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.d.ts +17 -0
  51. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.js +86 -0
  52. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.js.map +1 -0
  53. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.d.ts +8 -0
  54. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.js +72 -0
  55. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.js.map +1 -0
  56. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.d.ts +11 -0
  57. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.js +61 -0
  58. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.js.map +1 -0
  59. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.d.ts +10 -0
  60. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.js +62 -0
  61. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.js.map +1 -0
  62. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.d.ts +10 -0
  63. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.js +52 -0
  64. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.js.map +1 -0
  65. package/lib/components/organisms/WasteProductCard/WasteProductCard.d.ts +9 -0
  66. package/lib/components/organisms/WasteProductCard/WasteProductCard.js +47 -0
  67. package/lib/components/organisms/WasteProductCard/WasteProductCard.js.map +1 -0
  68. package/lib/components/organisms/index.d.ts +11 -0
  69. package/lib/components/organisms/index.js +29 -0
  70. package/lib/components/organisms/index.js.map +1 -0
  71. package/lib/features/asyncFunctions-index.d.ts +7 -0
  72. package/lib/features/asyncFunctions-index.js +25 -0
  73. package/lib/features/asyncFunctions-index.js.map +1 -0
  74. package/lib/features/index.d.ts +7 -0
  75. package/lib/features/index.js +25 -0
  76. package/lib/features/index.js.map +1 -0
  77. package/lib/features/machinesSlice.d.ts +14 -0
  78. package/lib/features/machinesSlice.js +48 -0
  79. package/lib/features/machinesSlice.js.map +1 -0
  80. package/lib/features/manufacturingOrderSlice.d.ts +66 -0
  81. package/lib/features/manufacturingOrderSlice.js +186 -0
  82. package/lib/features/manufacturingOrderSlice.js.map +1 -0
  83. package/lib/features/operationOrderSlice.d.ts +49 -0
  84. package/lib/features/operationOrderSlice.js +124 -0
  85. package/lib/features/operationOrderSlice.js.map +1 -0
  86. package/lib/features/prodProductSlice.d.ts +46 -0
  87. package/lib/features/prodProductSlice.js +114 -0
  88. package/lib/features/prodProductSlice.js.map +1 -0
  89. package/lib/features/productionFileSlice.d.ts +16 -0
  90. package/lib/features/productionFileSlice.js +71 -0
  91. package/lib/features/productionFileSlice.js.map +1 -0
  92. package/lib/features/wasteProductsSlice.d.ts +48 -0
  93. package/lib/features/wasteProductsSlice.js +117 -0
  94. package/lib/features/wasteProductsSlice.js.map +1 -0
  95. package/lib/features/workCentersSlice.d.ts +14 -0
  96. package/lib/features/workCentersSlice.js +48 -0
  97. package/lib/features/workCentersSlice.js.map +1 -0
  98. package/lib/i18n/en.json +45 -0
  99. package/lib/i18n/fr.json +45 -0
  100. package/lib/index.d.ts +13 -0
  101. package/lib/index.js +68 -0
  102. package/lib/index.js.map +1 -0
  103. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.d.ts +5 -0
  104. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js +158 -0
  105. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js.map +1 -0
  106. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.d.ts +5 -0
  107. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.js +72 -0
  108. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.js.map +1 -0
  109. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.d.ts +4 -0
  110. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.js +60 -0
  111. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.js.map +1 -0
  112. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.d.ts +4 -0
  113. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.js +182 -0
  114. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.js.map +1 -0
  115. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.d.ts +5 -0
  116. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.js +150 -0
  117. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.js.map +1 -0
  118. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.d.ts +5 -0
  119. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.js +184 -0
  120. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.js.map +1 -0
  121. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.d.ts +5 -0
  122. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.js +103 -0
  123. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.js.map +1 -0
  124. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.d.ts +5 -0
  125. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.js +160 -0
  126. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.js.map +1 -0
  127. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.d.ts +5 -0
  128. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.js +56 -0
  129. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.js.map +1 -0
  130. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.d.ts +5 -0
  131. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.js +51 -0
  132. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.js.map +1 -0
  133. package/lib/screens/manufactoringOrder/consumedProduct/index.d.ts +55 -0
  134. package/lib/screens/manufactoringOrder/consumedProduct/index.js +60 -0
  135. package/lib/screens/manufactoringOrder/consumedProduct/index.js.map +1 -0
  136. package/lib/screens/manufactoringOrder/index.d.ts +171 -0
  137. package/lib/screens/manufactoringOrder/index.js +66 -0
  138. package/lib/screens/manufactoringOrder/index.js.map +1 -0
  139. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.d.ts +5 -0
  140. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.js +103 -0
  141. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.js.map +1 -0
  142. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.d.ts +5 -0
  143. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js +141 -0
  144. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js.map +1 -0
  145. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.d.ts +5 -0
  146. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.js +56 -0
  147. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.js.map +1 -0
  148. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.d.ts +5 -0
  149. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.js +74 -0
  150. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.js.map +1 -0
  151. package/lib/screens/manufactoringOrder/producedProduct/index.d.ts +44 -0
  152. package/lib/screens/manufactoringOrder/producedProduct/index.js +52 -0
  153. package/lib/screens/manufactoringOrder/producedProduct/index.js.map +1 -0
  154. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.d.ts +5 -0
  155. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.js +100 -0
  156. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.js.map +1 -0
  157. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.d.ts +5 -0
  158. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.js +103 -0
  159. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.js.map +1 -0
  160. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.d.ts +5 -0
  161. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.js +48 -0
  162. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.js.map +1 -0
  163. package/lib/screens/manufactoringOrder/wasteProduct/index.d.ts +33 -0
  164. package/lib/screens/manufactoringOrder/wasteProduct/index.js +44 -0
  165. package/lib/screens/manufactoringOrder/wasteProduct/index.js.map +1 -0
  166. package/lib/screens/operationOrder/OperationOrderDetailsScreen.d.ts +5 -0
  167. package/lib/screens/operationOrder/OperationOrderDetailsScreen.js +87 -0
  168. package/lib/screens/operationOrder/OperationOrderDetailsScreen.js.map +1 -0
  169. package/lib/screens/operationOrder/OperationOrderListScreen.d.ts +4 -0
  170. package/lib/screens/operationOrder/OperationOrderListScreen.js +178 -0
  171. package/lib/screens/operationOrder/OperationOrderListScreen.js.map +1 -0
  172. package/lib/screens/operationOrder/OperationOrderPlanningScreen.d.ts +2 -0
  173. package/lib/screens/operationOrder/OperationOrderPlanningScreen.js +126 -0
  174. package/lib/screens/operationOrder/OperationOrderPlanningScreen.js.map +1 -0
  175. package/lib/screens/operationOrder/ProductionFileScreen.d.ts +5 -0
  176. package/lib/screens/operationOrder/ProductionFileScreen.js +45 -0
  177. package/lib/screens/operationOrder/ProductionFileScreen.js.map +1 -0
  178. package/lib/screens/operationOrder/index.d.ts +44 -0
  179. package/lib/screens/operationOrder/index.js +52 -0
  180. package/lib/screens/operationOrder/index.js.map +1 -0
  181. package/lib/types/index.d.ts +2 -0
  182. package/lib/types/index.js +20 -0
  183. package/lib/types/index.js.map +1 -0
  184. package/lib/types/manufacturing-order.d.ts +29 -0
  185. package/lib/types/manufacturing-order.js +117 -0
  186. package/lib/types/manufacturing-order.js.map +1 -0
  187. package/lib/types/operation-order.d.ts +25 -0
  188. package/lib/types/operation-order.js +169 -0
  189. package/lib/types/operation-order.js.map +1 -0
  190. package/lib/utils/displayers.d.ts +1 -0
  191. package/lib/utils/displayers.js +19 -0
  192. package/lib/utils/displayers.js.map +1 -0
  193. package/lib/utils/formaters.d.ts +4 -0
  194. package/lib/utils/formaters.js +23 -0
  195. package/lib/utils/formaters.js.map +1 -0
  196. package/package.json +51 -0
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useEffect, useMemo } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { DropdownMenuItem, HeaderContainer, LabelText, Screen, } from '@axelor/aos-mobile-ui';
21
+ import { formatDuration, HeaderOptionsMenu, isEmpty, Stopwatch, StopwatchType, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
22
+ import { OperationOrderDatesCard } from '../../components/molecules';
23
+ import { OperationOrderHeader } from '../../components/organisms';
24
+ import OperationOrder from '../../types/operation-order';
25
+ import { fetchOperationOrderById, updateOperationOrder, } from '../../features/operationOrderSlice';
26
+ function OperationOrderDetailsScreen({ route, navigation }) {
27
+ const I18n = useTranslator();
28
+ const dispatch = useDispatch();
29
+ const { mobileSettings } = useSelector(state => state.config);
30
+ const { loadingOrder, operationOrder } = useSelector(state => state.operationOrder);
31
+ const updateStatus = useCallback(status => {
32
+ dispatch(updateOperationOrder({
33
+ operationOrderId: operationOrder?.id,
34
+ version: operationOrder?.version,
35
+ status,
36
+ }));
37
+ }, [dispatch, operationOrder]);
38
+ const [startDate, endDate] = useMemo(() => {
39
+ if (!isEmpty(operationOrder)) {
40
+ return OperationOrder.getDates(operationOrder?.statusSelect, operationOrder?.plannedStartDateT, operationOrder?.plannedEndDateT, operationOrder?.realStartDateT, operationOrder?.realEndDateT, I18n, false);
41
+ }
42
+ return [];
43
+ }, [I18n, operationOrder]);
44
+ const { status: timerStatus, time } = useMemo(() => {
45
+ if (!isEmpty(operationOrder)) {
46
+ return OperationOrder.getTimerState(operationOrder);
47
+ }
48
+ return { status: StopwatchType.status.Ready, time: 0 };
49
+ }, [operationOrder]);
50
+ useEffect(() => {
51
+ dispatch(fetchOperationOrderById({
52
+ operationOrderId: route.params.operationOrderId,
53
+ }));
54
+ }, [dispatch, route.params.operationOrderId]);
55
+ React.useLayoutEffect(() => {
56
+ navigation.setOptions({
57
+ headerRight: () => (<HeaderOptionsMenu model="com.axelor.apps.production.db.OperationOrder" modelId={operationOrder?.id} navigation={navigation} disableMailMessages={!mobileSettings?.isTrackerMessageOnStockApp}>
58
+ <DropdownMenuItem icon="folder-open" placeholder={I18n.t('Manufacturing_ProductionFile')} onPress={() => navigation.navigate('ProductionFileScreen', {
59
+ prodProcessLineId: operationOrder?.prodProcessLine?.id,
60
+ })}/>
61
+ </HeaderOptionsMenu>),
62
+ });
63
+ }, [I18n, navigation, mobileSettings, operationOrder]);
64
+ return (<Screen removeSpaceOnTop={true} loading={loadingOrder}>
65
+ <HeaderContainer fixedItems={<OperationOrderHeader manufOrderRef={operationOrder?.manufOrder?.manufOrderSeq} name={operationOrder?.operationName} status={operationOrder?.statusSelect} priority={operationOrder?.priority}/>} expandableFilter={false}/>
66
+ <View style={styles.contentContainer}>
67
+ <OperationOrderDatesCard status={operationOrder?.statusSelect} startDate={startDate?.value} endDate={endDate?.value}/>
68
+ <View style={styles.detailsContainer}>
69
+ <LabelText iconName="stopwatch" size={20} title={I18n.t('Manufacturing_PlannedDuration') + ':'} value={formatDuration(operationOrder?.plannedDuration)}/>
70
+ {operationOrder?.workCenter && (<LabelText iconName="warehouse" size={15} title={I18n.t('Manufacturing_WorkCenter') + ':'} value={operationOrder?.workCenter?.name}/>)}
71
+ {operationOrder?.machine && (<LabelText iconName="tools" size={18} title={I18n.t('Manufacturing_Machine') + ':'} value={operationOrder?.machine?.name}/>)}
72
+ </View>
73
+ <Stopwatch startTime={time} status={timerStatus} timerFormat={I18n.t('Stopwatch_TimerFormat')} onPlay={() => updateStatus(OperationOrder.status.InProgress)} onPause={() => updateStatus(OperationOrder.status.StandBy)} onStop={() => updateStatus(OperationOrder.status.Finished)} disableStop={operationOrder?.statusSelect === OperationOrder.status.StandBy} disableCancel={operationOrder?.statusSelect === OperationOrder.status.Finished} hideCancel={true}/>
74
+ </View>
75
+ </Screen>);
76
+ }
77
+ const styles = StyleSheet.create({
78
+ contentContainer: {
79
+ paddingTop: 10,
80
+ },
81
+ detailsContainer: {
82
+ marginHorizontal: 20,
83
+ marginVertical: 15,
84
+ },
85
+ });
86
+ export default OperationOrderDetailsScreen;
87
+ //# sourceMappingURL=OperationOrderDetailsScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationOrderDetailsScreen.js","sourceRoot":"","sources":["../../../src/screens/operationOrder/OperationOrderDetailsScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,MAAM,GACP,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;A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AC,CAAC,CAAC,uBAAuB,CAAC,GAAG,GAAG,CAAC,CAC7C,KAAK,CAAC,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EACrC,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,SAAS,CACR,SAAS,CAAC,CAAC,IAAI,CAAC,CAChB,MAAM,CAAC,CAAC,WAAW,CAAC,CACpB,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAC7C,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAC7D,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAC3D,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAC3D,WAAW,CAAC,CACV,cAAc,EAAE,YAAY,KAAK,cAAc,CAAC,MAAM,CAAC,OAAO,CAC/D,CACD,aAAa,CAAC,CACZ,cAAc,EAAE,YAAY,KAAK,cAAc,CAAC,MAAM,CAAC,QAAQ,CAChE,CACD,UAAU,CAAC,CAAC,IAAI,CAAC,EAErB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,gBAAgB,EAAE;QAChB,UAAU,EAAE,EAAE;KACf;IACD,gBAAgB,EAAE;QAChB,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,EAAE;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export default OperationOrderListScreen;
2
+ declare function OperationOrderListScreen({ navigation }: {
3
+ navigation: any;
4
+ }): JSX.Element;
@@ -0,0 +1,178 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useEffect, useState } from 'react';
19
+ import { Dimensions, StyleSheet } from 'react-native';
20
+ import { AutoCompleteSearch, Chip, ChipSelect, HeaderContainer, Screen, ScrollList, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ import { displayItemName, filterList, ScannerAutocompleteSearch, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
22
+ import OperationOrder from '../../types/operation-order';
23
+ import { fetchOperationOrders } from '../../features/operationOrderSlice';
24
+ import { displayManufOrderSeq } from '../../utils/displayers';
25
+ import { OperationOrderDetailsCard } from '../../components/organisms';
26
+ import { searchWorkCenters } from '../../features/workCentersSlice';
27
+ import { searchMachines } from '../../features/machinesSlice';
28
+ const refScanKey = 'manufOrderSeq_manufacturing-order-list';
29
+ function OperationOrderListScreen({ navigation }) {
30
+ const Colors = useThemeColor();
31
+ const I18n = useTranslator();
32
+ const { loading, moreLoading, isListEnd, operationOrderList } = useSelector(state => state.operationOrder);
33
+ const { workCenterList } = useSelector(state => state.workCenters);
34
+ const { machineList } = useSelector(state => state.machines);
35
+ const [workCenter, setWorkCenter] = useState(null);
36
+ const [machine, setMachine] = useState(null);
37
+ const [filteredList, setFilteredList] = useState(operationOrderList);
38
+ const [plannedStatus, setPlannedStatus] = useState(false);
39
+ const [progressStatus, setProgressStatus] = useState(false);
40
+ const [standByStatus, setStandByStatus] = useState(false);
41
+ const [finishedStatus, setFinishedStatus] = useState(false);
42
+ const [filter, setFilter] = useState(null);
43
+ const [navigate, setNavigate] = useState(false);
44
+ const dispatch = useDispatch();
45
+ const desactivateChip = () => {
46
+ setPlannedStatus(false);
47
+ setProgressStatus(false);
48
+ setStandByStatus(false);
49
+ setFinishedStatus(false);
50
+ };
51
+ const handlePlannedStatus = () => {
52
+ if (progressStatus && standByStatus && finishedStatus) {
53
+ desactivateChip();
54
+ }
55
+ else {
56
+ setPlannedStatus(!plannedStatus);
57
+ }
58
+ };
59
+ const handleProgressStatus = () => {
60
+ if (plannedStatus && standByStatus && finishedStatus) {
61
+ desactivateChip();
62
+ }
63
+ else {
64
+ setProgressStatus(!progressStatus);
65
+ }
66
+ };
67
+ const handleStandByStatus = () => {
68
+ if (plannedStatus && progressStatus && finishedStatus) {
69
+ desactivateChip();
70
+ }
71
+ else {
72
+ setStandByStatus(!standByStatus);
73
+ }
74
+ };
75
+ const handleFinishedStatus = () => {
76
+ if (plannedStatus && progressStatus && standByStatus) {
77
+ desactivateChip();
78
+ }
79
+ else {
80
+ setFinishedStatus(!finishedStatus);
81
+ }
82
+ };
83
+ const filterOnStatus = useCallback(list => {
84
+ if (list == null || list === []) {
85
+ return list;
86
+ }
87
+ else {
88
+ const listFilter = [];
89
+ if (plannedStatus ||
90
+ progressStatus ||
91
+ standByStatus ||
92
+ finishedStatus) {
93
+ if (plannedStatus) {
94
+ list.forEach(item => {
95
+ if (item.statusSelect === OperationOrder.status.Planned) {
96
+ listFilter.push(item);
97
+ }
98
+ });
99
+ }
100
+ if (progressStatus) {
101
+ list.forEach(item => {
102
+ if (item.statusSelect === OperationOrder.status.InProgress) {
103
+ listFilter.push(item);
104
+ }
105
+ });
106
+ }
107
+ if (standByStatus) {
108
+ list.forEach(item => {
109
+ if (item.statusSelect === OperationOrder.status.StandBy) {
110
+ listFilter.push(item);
111
+ }
112
+ });
113
+ }
114
+ if (finishedStatus) {
115
+ list.forEach(item => {
116
+ if (item.statusSelect === OperationOrder.status.Finished) {
117
+ listFilter.push(item);
118
+ }
119
+ });
120
+ }
121
+ }
122
+ else {
123
+ return list;
124
+ }
125
+ return listFilter;
126
+ }
127
+ }, [finishedStatus, plannedStatus, progressStatus, standByStatus]);
128
+ useEffect(() => {
129
+ setFilteredList(filterOnStatus(filterList(operationOrderList, ['workCenter', 'machine'], ['id', 'id'], [workCenter?.id ?? '', machine?.id ?? ''])));
130
+ }, [filterOnStatus, operationOrderList, workCenter, machine]);
131
+ const navigateToOperationOrder = item => {
132
+ if (item != null) {
133
+ setNavigate(true);
134
+ navigation.navigate('OperationOrderDetailsScreen', {
135
+ operationOrderId: item.id,
136
+ });
137
+ }
138
+ };
139
+ const fetchOperationOrderAPI = useCallback(page => {
140
+ dispatch(fetchOperationOrders({
141
+ searchValue: filter,
142
+ page: page,
143
+ }));
144
+ }, [dispatch, filter]);
145
+ const handleRefChange = useCallback(searchValue => {
146
+ setFilter(searchValue);
147
+ dispatch(fetchOperationOrders({
148
+ searchValue: searchValue,
149
+ page: 0,
150
+ }));
151
+ }, [dispatch]);
152
+ const fetchWorkCentersAPI = useCallback(searchValue => {
153
+ dispatch(searchWorkCenters({ searchValue: searchValue }));
154
+ }, [dispatch]);
155
+ const fetchMachinesAPI = useCallback(searchValue => {
156
+ dispatch(searchMachines({ searchValue: searchValue }));
157
+ }, [dispatch]);
158
+ return (<Screen removeSpaceOnTop={true}>
159
+ <HeaderContainer fixedItems={<ScannerAutocompleteSearch objectList={operationOrderList} onChangeValue={item => navigateToOperationOrder(item)} fetchData={handleRefChange} displayValue={displayManufOrderSeq} placeholder={I18n.t('Manufacturing_Ref')} scanKeySearch={refScanKey} oneFilter={true} navigate={navigate}/>} chipComponent={<ChipSelect style={styles.chipContainer} scrollable={true}>
160
+ <Chip selected={plannedStatus} title={I18n.t('Manufacturing_Status_Planned')} onPress={handlePlannedStatus} selectedColor={OperationOrder.getStatusColor(OperationOrder.status.Planned, Colors)} width={Dimensions.get('window').width * 0.35} marginHorizontal={3}/>
161
+ <Chip selected={progressStatus} title={I18n.t('Manufacturing_Status_InProgress')} onPress={handleProgressStatus} selectedColor={OperationOrder.getStatusColor(OperationOrder.status.InProgress, Colors)} width={Dimensions.get('window').width * 0.35} marginHorizontal={3}/>
162
+ <Chip selected={standByStatus} title={I18n.t('Manufacturing_Status_StandBy')} onPress={handleStandByStatus} selectedColor={OperationOrder.getStatusColor(OperationOrder.status.StandBy, Colors)} width={Dimensions.get('window').width * 0.35} marginHorizontal={3}/>
163
+ <Chip selected={finishedStatus} title={I18n.t('Manufacturing_Status_Finished')} onPress={handleFinishedStatus} selectedColor={OperationOrder.getStatusColor(OperationOrder.status.Finished, Colors)} width={Dimensions.get('window').width * 0.35} marginHorizontal={3}/>
164
+ </ChipSelect>}>
165
+ <AutoCompleteSearch objectList={workCenterList} value={workCenter} onChangeValue={item => setWorkCenter(item)} fetchData={fetchWorkCentersAPI} displayValue={displayItemName} placeholder={I18n.t('Manufacturing_WorkCenter')}/>
166
+ <AutoCompleteSearch objectList={machineList} value={machine} onChangeValue={item => setMachine(item)} fetchData={fetchMachinesAPI} displayValue={displayItemName} placeholder={I18n.t('Manufacturing_Machine')}/>
167
+ </HeaderContainer>
168
+ <ScrollList loadingList={loading} data={filteredList} renderItem={({ item }) => (<OperationOrderDetailsCard style={styles.item} status={item.statusSelect} manufOrder={item.manufOrder?.manufOrderSeq} operationName={item.operationName} workcenter={item.workCenter?.name} machine={item.machine?.name} plannedStartDate={item.plannedStartDateT} plannedEndDate={item.plannedEndDateT} plannedDuration={item.plannedDuration} realStartDate={item.realStartDateT} realEndDate={item.realEndDateT} priority={item.priority} onPress={() => navigateToOperationOrder(item)}/>)} fetchData={fetchOperationOrderAPI} moreLoading={moreLoading} isListEnd={isListEnd}/>
169
+ </Screen>);
170
+ }
171
+ const styles = StyleSheet.create({
172
+ item: {
173
+ marginHorizontal: 12,
174
+ marginVertical: 4,
175
+ },
176
+ });
177
+ export default OperationOrderListScreen;
178
+ //# sourceMappingURL=OperationOrderListScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationOrderListScreen.js","sourceRoot":"","sources":["../../../src/screens/operationOrder/OperationOrderListScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,UAAU,EACV,eAAe,EACf,MAAM,EACN,UAAU,EACV,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,UAAU,EACV,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,yBAAyB,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAE5D,MAAM,UAAU,GAAG,wCAAwC,CAAC;AAE5D,SAAS,wBAAwB,CAAC,EAAC,UAAU,EAAC;IAC5C,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAC,GAAG,WAAW,CACvE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAC9B,CAAC;IACF,MAAM,EAAC,cAAc,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,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AAC,CACV,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,CAAC;KAClB;CACF,CAAC,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default OperationOrderPlanningScreen;
2
+ declare function OperationOrderPlanningScreen(): JSX.Element;
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useMemo } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { Card, LabelText, Screen, Text, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ import { PlanningView, useDispatch, useSelector } from '@axelor/aos-mobile-core';
22
+ import { fetchPlannedOperationOrder } from '../../features/operationOrderSlice';
23
+ import OperationOrder from '../../types/operation-order';
24
+ function OperationOrderPlanningScreen() {
25
+ const { plannedOperationOrderList, loading } = useSelector(state => state.operationOrder);
26
+ const dispatch = useDispatch();
27
+ const Colors = useThemeColor();
28
+ const styles = useMemo(() => {
29
+ return getStyles(Colors);
30
+ }, [Colors]);
31
+ const listItem = useMemo(() => {
32
+ if (plannedOperationOrderList !== undefined &&
33
+ plannedOperationOrderList.length > 1) {
34
+ return plannedOperationOrderList.map(elt => {
35
+ const borderColor = OperationOrder.getStatusColor(elt.statusSelect, Colors);
36
+ const startDate = new Date(elt.plannedStartDateT);
37
+ const endDate = new Date(elt.plannedEndDateT);
38
+ return {
39
+ id: elt.id,
40
+ date: elt.plannedStartDateT,
41
+ name: elt.operationName,
42
+ ref: elt.manufOrder.manufOrderSeq,
43
+ workCenter: elt.workCenter.name,
44
+ startHour: startDate.getHours() +
45
+ 'h' +
46
+ (startDate.getMinutes() < 10 ? '0' : '') +
47
+ startDate.getMinutes(),
48
+ endHour: endDate.getHours() +
49
+ 'h' +
50
+ (endDate.getMinutes() < 10 ? '0' : '') +
51
+ +endDate.getMinutes(),
52
+ border: borderColor.background,
53
+ };
54
+ });
55
+ }
56
+ }, [Colors, plannedOperationOrderList]);
57
+ const fetchItemsByMonth = useCallback(date => {
58
+ dispatch(fetchPlannedOperationOrder(date));
59
+ }, [dispatch]);
60
+ const rendBorderColor = borderColor => {
61
+ return {
62
+ borderLeftWidth: 7,
63
+ borderLeftColor: borderColor,
64
+ };
65
+ };
66
+ const renderDayItem = (agendaItem, isFirst) => {
67
+ if (agendaItem) {
68
+ return (<View style={isFirst ? styles.firstItemContainer : styles.containerListItem}>
69
+ {isFirst ? <View style={styles.borderTop}/> : null}
70
+ <View style={styles.containerTime}>
71
+ <Text>{agendaItem.startHour}</Text>
72
+ <Text>{agendaItem.endHour}</Text>
73
+ </View>
74
+ <Card style={[styles.container, rendBorderColor(agendaItem.border)]}>
75
+ <Text style={styles.bold}>{agendaItem.ref}</Text>
76
+ <Text>{agendaItem.name}</Text>
77
+ <LabelText iconName="pallet" title={agendaItem.workCenter}/>
78
+ </Card>
79
+ <View style={styles.borderBottom}/>
80
+ </View>);
81
+ }
82
+ };
83
+ return (<Screen removeSpaceOnTop={true}>
84
+ <PlanningView itemList={listItem} renderItem={renderDayItem} fetchbyMonth={fetchItemsByMonth} loading={loading}/>
85
+ </Screen>);
86
+ }
87
+ const getStyles = Colors => StyleSheet.create({
88
+ containerListItem: {
89
+ flexDirection: 'row',
90
+ marginVertical: '3%',
91
+ },
92
+ firstItemContainer: {
93
+ flexDirection: 'row',
94
+ marginTop: '5%',
95
+ marginBottom: '3%',
96
+ },
97
+ containerTime: {
98
+ flexDirection: 'column',
99
+ },
100
+ container: {
101
+ alignSelf: 'center',
102
+ width: '80%',
103
+ marginHorizontal: 12,
104
+ },
105
+ bold: {
106
+ fontWeight: 'bold',
107
+ },
108
+ borderBottom: {
109
+ position: 'absolute',
110
+ width: '80%',
111
+ borderBottomWidth: 1.5,
112
+ borderBottomColor: Colors.secondaryColor.background,
113
+ bottom: -10,
114
+ right: '10%',
115
+ },
116
+ borderTop: {
117
+ position: 'absolute',
118
+ width: '80%',
119
+ borderTopWidth: 1.5,
120
+ borderTopColor: Colors.secondaryColor.background,
121
+ top: -10,
122
+ right: '10%',
123
+ },
124
+ });
125
+ export default OperationOrderPlanningScreen;
126
+ //# sourceMappingURL=OperationOrderPlanningScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationOrderPlanningScreen.js","sourceRoot":"","sources":["../../../src/screens/operationOrder/OperationOrderPlanningScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,IAAI,EACJ,SAAS,EACT,MAAM,EACN,IAAI,EACJ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAC,0BAA0B,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAEzD,SAAS,4BAA4B;IACnC,MAAM,EAAC,yBAAyB,EAAE,OAAO,EAAC,GAAG,WAAW,CACtD,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAC9B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AAG;QACtB,iBAAiB,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QACnD,MAAM,EAAE,CAAC,EAAE;QACX,KAAK,EAAE,KAAK;KACb;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE,GAAG;QACnB,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAChD,GAAG,EAAE,CAAC,EAAE;QACR,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEL,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export default ProductionFileScreen;
2
+ declare function ProductionFileScreen({ route, navigation }: {
3
+ route: any;
4
+ navigation: any;
5
+ }): JSX.Element;
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useState } from 'react';
19
+ import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
20
+ import { fetchProductionFile } from '../../features/productionFileSlice';
21
+ import { ProductionFileLargeCard, ProductionFileSmallCard, } from '../../components/organisms';
22
+ import { Screen, ScrollList, HeaderContainer, ToggleSwitch, } from '@axelor/aos-mobile-ui';
23
+ const ProductionFileScreen = ({ route, navigation }) => {
24
+ const [tab, setTab] = useState(false);
25
+ const { loading, moreLoading, isListEnd, productionFileList } = useSelector(state => state.productionFile);
26
+ const I18n = useTranslator();
27
+ const dispatch = useDispatch();
28
+ const fetchProductionFileAPI = useCallback(page => {
29
+ dispatch(fetchProductionFile({
30
+ prodProcessLineId: route?.params?.prodProcessLineId,
31
+ page: page,
32
+ }));
33
+ }, [dispatch, route?.params?.prodProcessLineId]);
34
+ return (<Screen removeSpaceOnTop={true}>
35
+ <HeaderContainer fixedItems={<ToggleSwitch leftTitle={I18n.t('Base_Large')} rightTitle={I18n.t('Base_Small')} onSwitch={() => setTab(!tab)}/>} expandableFilter={false}/>
36
+ <ScrollList loadingList={loading} data={productionFileList} renderItem={({ item }) => {
37
+ if (tab) {
38
+ return (<ProductionFileSmallCard image={item.image} description={item.description}/>);
39
+ }
40
+ return (<ProductionFileLargeCard image={item.image} description={item.description}/>);
41
+ }} fetchData={fetchProductionFileAPI} moreLoading={moreLoading} isListEnd={isListEnd}/>
42
+ </Screen>);
43
+ };
44
+ export default ProductionFileScreen;
45
+ //# sourceMappingURL=ProductionFileScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductionFileScreen.js","sourceRoot":"","sources":["../../../src/screens/operationOrder/ProductionFileScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AACvE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,UAAU,EACV,eAAe,EACf,YAAY,GACb,MAAM,uBAAuB,CAAC;AAE/B,MAAM,oBAAoB,GAAG,CAAC,EAAC,KAAK,EAAE,UAAU,EAAC,EAAE,EAAE;IACnD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,C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;YACD,OAAO,CACL,CAAC,uBAAuB,CACtB,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAC9B,CACH,CAAC;QACJ,CAAC,CAAC,CACF,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAClC,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,SAAS,CAAC,CAAC,SAAS,CAAC,EAEzB;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,44 @@
1
+ declare namespace _default {
2
+ namespace OperationOrderListScreen {
3
+ export const title: string;
4
+ export { OperationOrderListScreen as component };
5
+ export namespace options {
6
+ const shadedHeader: boolean;
7
+ }
8
+ }
9
+ namespace OperationOrderDetailsScreen {
10
+ const title_1: string;
11
+ export { title_1 as title };
12
+ export { OperationOrderDetailsScreen as component };
13
+ export namespace options_1 {
14
+ const shadedHeader_1: boolean;
15
+ export { shadedHeader_1 as shadedHeader };
16
+ }
17
+ export { options_1 as options };
18
+ }
19
+ namespace ProductionFileScreen {
20
+ const title_2: string;
21
+ export { title_2 as title };
22
+ export { ProductionFileScreen as component };
23
+ export namespace options_2 {
24
+ const shadedHeader_2: boolean;
25
+ export { shadedHeader_2 as shadedHeader };
26
+ }
27
+ export { options_2 as options };
28
+ }
29
+ namespace OperationOrderPlanningScreen {
30
+ const title_3: string;
31
+ export { title_3 as title };
32
+ export { OperationOrderPlanningScreen as component };
33
+ export namespace options_3 {
34
+ const shadedHeader_3: boolean;
35
+ export { shadedHeader_3 as shadedHeader };
36
+ }
37
+ export { options_3 as options };
38
+ }
39
+ }
40
+ export default _default;
41
+ import OperationOrderListScreen_1 from "./OperationOrderListScreen";
42
+ import OperationOrderDetailsScreen_1 from "./OperationOrderDetailsScreen";
43
+ import ProductionFileScreen_1 from "./ProductionFileScreen";
44
+ import OperationOrderPlanningScreen_1 from "./OperationOrderPlanningScreen";
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import OperationOrderDetailsScreen from './OperationOrderDetailsScreen';
19
+ import OperationOrderListScreen from './OperationOrderListScreen';
20
+ import OperationOrderPlanningScreen from './OperationOrderPlanningScreen';
21
+ import ProductionFileScreen from './ProductionFileScreen';
22
+ export default {
23
+ OperationOrderListScreen: {
24
+ title: 'Manufacturing_OperationOrder',
25
+ component: OperationOrderListScreen,
26
+ options: {
27
+ shadedHeader: false,
28
+ },
29
+ },
30
+ OperationOrderDetailsScreen: {
31
+ title: 'Manufacturing_OperationOrder',
32
+ component: OperationOrderDetailsScreen,
33
+ options: {
34
+ shadedHeader: false,
35
+ },
36
+ },
37
+ ProductionFileScreen: {
38
+ title: 'Manufacturing_ProductionFile',
39
+ component: ProductionFileScreen,
40
+ options: {
41
+ shadedHeader: false,
42
+ },
43
+ },
44
+ OperationOrderPlanningScreen: {
45
+ title: 'Manufacturing_OperationOrder',
46
+ component: OperationOrderPlanningScreen,
47
+ options: {
48
+ shadedHeader: false,
49
+ },
50
+ },
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screens/operationOrder/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,eAAe;IACb,wBAAwB,EAAE;QACxB,KAAK,EAAE,8BAA8B;QACrC,SAAS,EAAE,wBAAwB;QACnC,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,8BAA8B;QACrC,SAAS,EAAE,2BAA2B;QACtC,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,8BAA8B;QACrC,SAAS,EAAE,oBAAoB;QAC/B,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;IACD,4BAA4B,EAAE;QAC5B,KAAK,EAAE,8BAA8B;QACrC,SAAS,EAAE,4BAA4B;QACvC,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as ManufacturingOrder } from './manufacturing-order';
2
+ export { default as OperationOrder } from './operation-order';
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { default as ManufacturingOrder } from './manufacturing-order';
19
+ export { default as OperationOrder } from './operation-order';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,mBAAmB,CAAC"}