@bjsdistribution/dms-client-return 0.0.84 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/order-view/notification/OrderTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/store.d.ts +1 -0
- package/dist/components/order-view/order-details/expanded-content/orders-section/Depot.d.ts +2 -0
- package/dist/components/order-view/store.d.ts +1 -0
- package/dist/components/order-view/utils.d.ts +1 -0
- package/dist/dms-client-return.cjs.development.js +423 -285
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +424 -286
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-view/index.tsx +26 -2
- package/src/components/order-view/notification/OrderTemplate.tsx +349 -0
- package/src/components/order-view/notification/Tabs.tsx +10 -6
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +6 -63
- package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +7 -0
- package/src/components/order-view/order-actions/actions/order-lock/index.tsx +13 -1
- package/src/components/order-view/order-actions/actions/split-order/index.tsx +15 -20
- package/src/components/order-view/order-actions/actions/uncancel-order/UncancelOrder.tsx +4 -3
- package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +1 -1
- package/src/components/order-view/order-actions/store.ts +6 -0
- package/src/components/order-view/order-actions/utils.ts +1 -1
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +6 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +5 -3
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +3 -2
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +1 -1
- package/src/components/order-view/store.ts +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import SplitOrderTable from './SplitOrderTable';
|
|
@@ -37,28 +37,23 @@ function SplitOrder() {
|
|
|
37
37
|
const onSubmitSplitOrder = () => {
|
|
38
38
|
if (orderId) {
|
|
39
39
|
setPerformAction(true);
|
|
40
|
-
//@ts-ignore
|
|
41
|
-
if (response?.data && response?.code === 200) {
|
|
42
|
-
notification.success({
|
|
43
|
-
message: 'Success',
|
|
44
|
-
description:
|
|
45
|
-
//@ts-ignore
|
|
46
|
-
response?.message || 'Sucess',
|
|
47
|
-
});
|
|
48
|
-
} else {
|
|
49
|
-
// alert(response?.error_traceback);
|
|
50
|
-
notification.error({
|
|
51
|
-
message: 'Error',
|
|
52
|
-
description:
|
|
53
|
-
//@ts-ignore
|
|
54
|
-
response?.message ||
|
|
55
|
-
'An error has occurred. Please try again later.',
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
setSelectedSplit([]);
|
|
59
40
|
}
|
|
60
41
|
};
|
|
61
42
|
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
//@ts-ignore
|
|
45
|
+
if (response?.code === 200) {
|
|
46
|
+
notification.success({
|
|
47
|
+
message: 'Success',
|
|
48
|
+
description:
|
|
49
|
+
//@ts-ignore
|
|
50
|
+
response?.message || 'Sucess',
|
|
51
|
+
});
|
|
52
|
+
setCurrentAction(undefined);
|
|
53
|
+
setSelectedSplit([]);
|
|
54
|
+
}
|
|
55
|
+
}, [response]);
|
|
56
|
+
|
|
62
57
|
const isSubmitDisabled = () => {
|
|
63
58
|
if (seledtedSplitOrder?.length > 0) {
|
|
64
59
|
return !seledtedSplitOrder;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
AntSelect,
|
|
4
|
+
Label,
|
|
4
5
|
TextArea,
|
|
5
6
|
useApiHook,
|
|
6
7
|
} from '@bjsdistribution/dms-component-library';
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
usePrevOrderDetails,
|
|
14
15
|
} from '../../../store';
|
|
15
16
|
import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
|
|
16
|
-
import { HoldContentContainer, HoldRow,
|
|
17
|
+
import { HoldContentContainer, HoldRow, SplitText } from '../modalstyle';
|
|
17
18
|
import { ApiResponse, OrdersType } from '../../../types';
|
|
18
19
|
import styled from 'styled-components';
|
|
19
20
|
import { useLoading } from '../../../../order-daily-overview/store/store';
|
|
@@ -136,7 +137,7 @@ function UncancelOrder() {
|
|
|
136
137
|
<HoldContentContainer>
|
|
137
138
|
<SplitText>
|
|
138
139
|
<HoldRow>
|
|
139
|
-
<Label
|
|
140
|
+
<Label label="Un-cancel Reason" required></Label>
|
|
140
141
|
<AntSelect
|
|
141
142
|
options={unCancelReasonOptions || []}
|
|
142
143
|
placeholder="Select un-cancel Reason"
|
|
@@ -150,7 +151,7 @@ function UncancelOrder() {
|
|
|
150
151
|
/>
|
|
151
152
|
</HoldRow>
|
|
152
153
|
<HoldRow>
|
|
153
|
-
<Label
|
|
154
|
+
<Label label="Un-cancel Note"></Label>
|
|
154
155
|
<CustomTextArea rows={5} onChange={onChange} />
|
|
155
156
|
</HoldRow>
|
|
156
157
|
</SplitText>
|
|
@@ -258,6 +258,12 @@ export function useUpdateReminderData() {
|
|
|
258
258
|
export function useRouteDetails() {
|
|
259
259
|
return useAtom(routeDetails);
|
|
260
260
|
}
|
|
261
|
+
const allOrderStatus = atom<string | null>(null);
|
|
262
|
+
|
|
263
|
+
export function useAllOrderStatus() {
|
|
264
|
+
return useAtom(allOrderStatus);
|
|
265
|
+
}
|
|
266
|
+
|
|
261
267
|
|
|
262
268
|
export const selectedCategoryIdAtom = atom<any>(null);
|
|
263
269
|
export const selectedDocumentTypeAtom = atom<any>(null);
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useUpdateApiCall,
|
|
12
12
|
useLiveRecalling,
|
|
13
13
|
useGlobalStateHitAuditLog,
|
|
14
|
+
useGlobalStateHitOrder,
|
|
14
15
|
} from '../../../store';
|
|
15
16
|
import useUpdateOrder from '../../../hooks/useUpdateOrder';
|
|
16
17
|
import { compareOrderDetailsStates, filterObject } from '../../../utils';
|
|
@@ -25,6 +26,8 @@ function OrderDetailsFooter() {
|
|
|
25
26
|
const [, setCallApi] = useUpdateApiCall(); //single detail
|
|
26
27
|
const [, setRecalling] = useLiveRecalling();
|
|
27
28
|
const [, setRecallAuditLog] = useGlobalStateHitAuditLog();
|
|
29
|
+
const [, setRecallOrders] = useGlobalStateHitOrder();
|
|
30
|
+
|
|
28
31
|
const errorFound = () => {
|
|
29
32
|
const isError =
|
|
30
33
|
errorState?.w3wError.length > 0 ||
|
|
@@ -77,9 +80,12 @@ function OrderDetailsFooter() {
|
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
const onSave = async () => {
|
|
83
|
+
setRecallAuditLog(false);
|
|
84
|
+
setRecallOrders(false);
|
|
80
85
|
const payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
|
|
81
86
|
const response = await updateOrder([payload]);
|
|
82
87
|
setCallApi(false);
|
|
88
|
+
setRecallOrders(true);
|
|
83
89
|
// setLogsCallAPi(prev => !prev);
|
|
84
90
|
if (response && response?.data?.length > 0) {
|
|
85
91
|
setOrderDetails(response?.data[0]);
|
|
@@ -21,7 +21,7 @@ function DepotDropdown() {
|
|
|
21
21
|
return (
|
|
22
22
|
<FormContainer>
|
|
23
23
|
<Label label="Depot" htmlFor="depotDropdown" />
|
|
24
|
-
<
|
|
24
|
+
<StyledSelectDropdown
|
|
25
25
|
placeholder="Select Depot"
|
|
26
26
|
inputId="depotDropdown"
|
|
27
27
|
openMenuOnFocus={false}
|
|
@@ -33,7 +33,7 @@ function DepotDropdown() {
|
|
|
33
33
|
styles={{
|
|
34
34
|
...dropdownStyles,
|
|
35
35
|
|
|
36
|
-
control: styles => ({
|
|
36
|
+
control: (styles: any) => ({
|
|
37
37
|
...styles,
|
|
38
38
|
borderRadius: '25px',
|
|
39
39
|
cursor: 'pointer',
|
|
@@ -50,5 +50,7 @@ const FormContainer = styled.div`
|
|
|
50
50
|
gap: 6px;
|
|
51
51
|
flex: 1;
|
|
52
52
|
`;
|
|
53
|
-
|
|
53
|
+
export const StyledSelectDropdown = styled(SelectDropdown)`
|
|
54
|
+
min-width: 160px;
|
|
55
|
+
`;
|
|
54
56
|
export default DepotDropdown;
|
package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx
CHANGED
|
@@ -52,7 +52,8 @@ function ScheduleAfter() {
|
|
|
52
52
|
onChange={onChange}
|
|
53
53
|
value={scheduleDate === null ? scheduleDate : dayjs(scheduleDate)}
|
|
54
54
|
format="DD/MM/YY"
|
|
55
|
-
|
|
55
|
+
disabledDate={current => current && current < dayjs().startOf('day')}
|
|
56
|
+
allowClear={false}
|
|
56
57
|
/>
|
|
57
58
|
</MainContainer>
|
|
58
59
|
);
|
package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Label
|
|
1
|
+
import { Label } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { vehicleTypeOptions } from '../../helper';
|
|
5
5
|
import { useOrderDetails } from '../../../store';
|
|
6
|
+
import { StyledSelectDropdown } from './Depot';
|
|
6
7
|
|
|
7
8
|
function VehicleTypeDropdown() {
|
|
8
9
|
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
@@ -18,7 +19,7 @@ function VehicleTypeDropdown() {
|
|
|
18
19
|
return (
|
|
19
20
|
<FormContainer>
|
|
20
21
|
<Label label="Vehicle Type" htmlFor="vehicleType" />
|
|
21
|
-
<
|
|
22
|
+
<StyledSelectDropdown
|
|
22
23
|
placeholder="Select vehicle type"
|
|
23
24
|
options={vehicleTypeOptions}
|
|
24
25
|
inputId="vehicleType"
|
package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx
CHANGED
|
@@ -31,7 +31,7 @@ function DeliveryPointDropdown() {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Container>
|
|
34
|
-
<Label label="Delivery Point"
|
|
34
|
+
<Label label="Delivery Point" />
|
|
35
35
|
<StyledSelectDropdown
|
|
36
36
|
placeholder="Select Delivery Point"
|
|
37
37
|
options={deliveryPointOptions || []}
|
|
@@ -477,6 +477,13 @@ export function useGlobalStateHitAuditLog() {
|
|
|
477
477
|
return useAtom(globalStateHitAuditLog);
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
+
const globalOrderGetApi = atom<boolean>(true);
|
|
481
|
+
|
|
482
|
+
export function useGlobalStateHitOrder() {
|
|
483
|
+
return useAtom(globalOrderGetApi);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
|
|
480
487
|
// Popup state Manage
|
|
481
488
|
const initialState = null;
|
|
482
489
|
|