@bjsdistribution/dms-client-return 0.0.2 → 0.0.3
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-daily-overview/common/interface.d.ts +22 -0
- package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
- package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
- package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
- package/dist/components/order-daily-overview/store/store.d.ts +4 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/store.d.ts +5 -1
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +1065 -964
- 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 +1067 -966
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
- package/src/components/order-daily-overview/common/interface.ts +120 -97
- package/src/components/order-daily-overview/filters/Filters.tsx +1 -8
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +59 -6
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
- package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/index.tsx +6 -4
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
- package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +2 -2
- package/src/components/order-view/store.ts +40 -12
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
- package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
- package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
- package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
- package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
- package/src/components/order-daily-overview/table/Return.tsx +0 -156
- package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
- package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.3",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"testEnvironment": "jest-environment-jsdom-sixteen"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@bjsdistribution/dms-component-library": "^0.0.
|
|
62
|
+
"@bjsdistribution/dms-component-library": "^0.0.94",
|
|
63
63
|
"@size-limit/preset-small-lib": "^11.0.1",
|
|
64
64
|
"@tippyjs/react": "^4.2.6",
|
|
65
65
|
"@types/react": "^18.2.47",
|
|
@@ -94,12 +94,11 @@ export const TableData = [
|
|
|
94
94
|
];
|
|
95
95
|
|
|
96
96
|
export const optionsPrint = [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{ icon: 'deliveryLables', label: '
|
|
100
|
-
{ icon: 'customerLables', label: '
|
|
101
|
-
{ icon: 'collectionLables', label: '
|
|
102
|
-
// { icon: 'collectionLables', label: 'Returns Cover Note' },
|
|
97
|
+
{ icon: 'runSheet', label: 'Print Runsheet' },
|
|
98
|
+
{ icon: 'loadSheet', label: 'Print Loadsheet' },
|
|
99
|
+
{ icon: 'deliveryLables', label: 'Print Delivery Labels' },
|
|
100
|
+
{ icon: 'customerLables', label: 'Print Customer Labels' },
|
|
101
|
+
{ icon: 'collectionLables', label: 'Print Collection Labels' },
|
|
103
102
|
];
|
|
104
103
|
|
|
105
104
|
export const Depots = [
|
|
@@ -1,98 +1,121 @@
|
|
|
1
1
|
export interface TableColumn {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
alwaysVisible?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface TableBodyItem {
|
|
8
|
+
startFinish: {
|
|
9
|
+
status: string;
|
|
10
|
+
startTime: string;
|
|
11
|
+
endTime: string;
|
|
12
|
+
};
|
|
13
|
+
routeDetails: {
|
|
14
|
+
name: string;
|
|
15
|
+
lockRoute: boolean;
|
|
16
|
+
overnight: boolean;
|
|
17
|
+
};
|
|
18
|
+
tomtom: {
|
|
19
|
+
id: string;
|
|
20
|
+
allEventCompleted: boolean;
|
|
21
|
+
};
|
|
22
|
+
vehicle: {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
driver: {
|
|
26
|
+
pdaId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
mate: {
|
|
30
|
+
pdaId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
asset: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
orders: {
|
|
37
|
+
countOrdersInRoute: number;
|
|
38
|
+
collection: boolean;
|
|
39
|
+
assembly: boolean;
|
|
40
|
+
};
|
|
41
|
+
weight: {
|
|
42
|
+
totalWeight: string;
|
|
43
|
+
overweighted: string;
|
|
44
|
+
overweightedIcon: boolean;
|
|
45
|
+
heavyItems: boolean;
|
|
46
|
+
};
|
|
47
|
+
distance: {
|
|
48
|
+
totalDistance: number;
|
|
49
|
+
};
|
|
50
|
+
duration: {
|
|
51
|
+
totalDuration: string;
|
|
52
|
+
};
|
|
53
|
+
escalations: {
|
|
54
|
+
numberOfEscalations: number;
|
|
55
|
+
};
|
|
56
|
+
crewInstructions: {
|
|
57
|
+
deliveryTeamMessage: string;
|
|
58
|
+
};
|
|
59
|
+
action: {
|
|
60
|
+
print: boolean;
|
|
61
|
+
trackerPage: boolean;
|
|
62
|
+
deBriefing: boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface TableDataInterface {
|
|
67
|
+
tableHead: TableColumn[];
|
|
68
|
+
tableBody: TableBodyItem[];
|
|
69
|
+
}
|
|
70
|
+
export interface FilterRoute {
|
|
71
|
+
icon: string;
|
|
72
|
+
label: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// types
|
|
76
|
+
|
|
77
|
+
export type PrintData = {
|
|
78
|
+
icon: string;
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//route details
|
|
83
|
+
export interface TableBodyVal {
|
|
84
|
+
created: {
|
|
85
|
+
auditid: string;
|
|
86
|
+
date: string;
|
|
87
|
+
};
|
|
88
|
+
notesDetails: {
|
|
89
|
+
info: string;
|
|
90
|
+
IP: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface NotesDataInterface {
|
|
95
|
+
tableHead: TableColumn[];
|
|
96
|
+
tableBody: TableBodyVal[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ClientData {
|
|
100
|
+
trading_as: string;
|
|
101
|
+
customer_name: string;
|
|
102
|
+
return_orders: number;
|
|
103
|
+
return_order_products: number;
|
|
104
|
+
DISPOSE: number;
|
|
105
|
+
'RE-DEL': number;
|
|
106
|
+
CLAIMS_PAID: number;
|
|
107
|
+
'RE-ALLOCATE': number;
|
|
108
|
+
RTS: number;
|
|
109
|
+
RECYCLE: number;
|
|
110
|
+
PENDING: number;
|
|
111
|
+
UNKNOWN: number;
|
|
112
|
+
[key: string]: any;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ApiResponse {
|
|
116
|
+
message: string;
|
|
117
|
+
code: number;
|
|
118
|
+
error: string | null;
|
|
119
|
+
error_traceback: string | null;
|
|
120
|
+
data: any[];
|
|
121
|
+
}
|
|
@@ -3,13 +3,10 @@ import {
|
|
|
3
3
|
StyledFIlterELements,
|
|
4
4
|
StyledFiter,
|
|
5
5
|
StyledTableFilter,
|
|
6
|
-
Text,
|
|
7
6
|
} from './FilterStyle';
|
|
8
|
-
|
|
9
7
|
import BulkFilter from './BulkFilter';
|
|
10
8
|
import { TableRowType } from '../shared/interface';
|
|
11
|
-
import { filtersReducerAtom } from '../
|
|
12
|
-
|
|
9
|
+
import { filtersReducerAtom } from '../header-filters/filterStore';
|
|
13
10
|
import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
14
11
|
|
|
15
12
|
import {
|
|
@@ -20,10 +17,7 @@ import {
|
|
|
20
17
|
import { useAtom } from 'jotai';
|
|
21
18
|
|
|
22
19
|
const Filters = () => {
|
|
23
|
-
// const [apiData, setApiData] = useState<TableRowType[] | undefined>(undefined);
|
|
24
|
-
// Stats and variables
|
|
25
20
|
const [, setData] = useRoutesTable();
|
|
26
|
-
// const [loading, setLoading] = useLoading();
|
|
27
21
|
const [state] = useAtom(filtersReducerAtom);
|
|
28
22
|
const [, setPaginationObject] = UsePaginationData();
|
|
29
23
|
const [, setCount] = useCountData();
|
|
@@ -67,7 +61,6 @@ const Filters = () => {
|
|
|
67
61
|
<>
|
|
68
62
|
<StyledFiter>
|
|
69
63
|
<StyledFIlterELements>
|
|
70
|
-
<Text>Client Return</Text>
|
|
71
64
|
<StyledTableFilter />
|
|
72
65
|
</StyledFIlterELements>
|
|
73
66
|
<BulkFilter />
|
|
@@ -1,79 +1,68 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
// import styled from 'styled-components';
|
|
3
|
-
// import { CoverPage, StatusPanel } from '../invoice-header/InvoiceStyles';
|
|
4
|
-
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
5
2
|
import { CoverPage } from './Styledfilters';
|
|
6
3
|
import SelectionFilter from './SelectionFilter';
|
|
4
|
+
import { ApiResponse } from '../../types';
|
|
5
|
+
import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
6
|
+
import { useActionType, useCustomerData, useLocationData } from '../../store';
|
|
7
7
|
|
|
8
8
|
function HeaderFilter() {
|
|
9
|
+
const [, setCustomers] = useCustomerData();
|
|
10
|
+
const [, setActionType] = useActionType();
|
|
11
|
+
const [, setLocationData] = useLocationData();
|
|
12
|
+
|
|
13
|
+
//API for client data
|
|
14
|
+
const { data: fetchedCustomerData, loading: loading } = useApiHook<
|
|
15
|
+
ApiResponse
|
|
16
|
+
>({
|
|
17
|
+
endpoint: `/customers/`,
|
|
18
|
+
method: 'GET',
|
|
19
|
+
pagination: { page: 1, per_page: 50 },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//API for action type
|
|
23
|
+
const { data: fetchedStaticData, loading: actionLoading } = useApiHook<
|
|
24
|
+
ApiResponse
|
|
25
|
+
>({
|
|
26
|
+
endpoint: `/orders/getStaticData/all/`,
|
|
27
|
+
method: 'GET',
|
|
28
|
+
pagination: { page: 1, per_page: 50 },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//API for return locations
|
|
32
|
+
const { data: fetchedLocationData, loading: locationloading } = useApiHook<
|
|
33
|
+
ApiResponse
|
|
34
|
+
>({
|
|
35
|
+
endpoint: `/return_locations/`,
|
|
36
|
+
method: 'GET',
|
|
37
|
+
pagination: { page: 1, per_page: 50 },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (fetchedCustomerData && fetchedCustomerData?.data) {
|
|
42
|
+
setCustomers(fetchedCustomerData?.data);
|
|
43
|
+
}
|
|
44
|
+
}, [loading, fetchedCustomerData]);
|
|
9
45
|
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (fetchedStaticData && fetchedStaticData?.data) {
|
|
48
|
+
setActionType(
|
|
49
|
+
fetchedStaticData?.data?.flatMap(
|
|
50
|
+
(i: any) => i.order_contact_action_type
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}, [actionLoading, fetchedStaticData]);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (fetchedLocationData && fetchedLocationData?.data) {
|
|
58
|
+
setLocationData(fetchedLocationData?.data);
|
|
59
|
+
}
|
|
60
|
+
}, [locationloading, fetchedLocationData]);
|
|
10
61
|
|
|
11
62
|
return (
|
|
12
63
|
<CoverPage>
|
|
13
|
-
|
|
14
|
-
<SelectionFilter />
|
|
64
|
+
<SelectionFilter />
|
|
15
65
|
</CoverPage>
|
|
16
66
|
);
|
|
17
67
|
}
|
|
18
|
-
|
|
19
|
-
// const Row = styled.div`
|
|
20
|
-
// display: flex;
|
|
21
|
-
// flex-direction: row;
|
|
22
|
-
// gap: 15px;
|
|
23
|
-
// align-items: center;
|
|
24
|
-
// `;
|
|
25
|
-
|
|
26
|
-
// const ExportButton = styled.button`
|
|
27
|
-
// display: flex;
|
|
28
|
-
// align-items: center;
|
|
29
|
-
// background-color: #f0f2f2;
|
|
30
|
-
// border-radius: 25px;
|
|
31
|
-
// border: 1px solid #cdcdcd !important;
|
|
32
|
-
// color: #3a3630;
|
|
33
|
-
// padding: 4px 10px;
|
|
34
|
-
// gap: 8px;
|
|
35
|
-
// height: 34px;
|
|
36
|
-
|
|
37
|
-
// > svg {
|
|
38
|
-
// height: 20px;
|
|
39
|
-
// width: 20px;
|
|
40
|
-
// }
|
|
41
|
-
// `;
|
|
42
|
-
// const FilterList = styled.li`
|
|
43
|
-
// color: #6a7378;
|
|
44
|
-
// text-align: center;
|
|
45
|
-
// font-size: 14px;
|
|
46
|
-
// font-style: normal;
|
|
47
|
-
// font-weight: 400;
|
|
48
|
-
// line-height: 18px;
|
|
49
|
-
// &:first-child {
|
|
50
|
-
// border-radius: 13px 0 0 13px;
|
|
51
|
-
// overflow: hidden;
|
|
52
|
-
// }
|
|
53
|
-
// &:last-child {
|
|
54
|
-
// border-radius: 0 13px 13px 0;
|
|
55
|
-
// overflow: hidden;
|
|
56
|
-
// }
|
|
57
|
-
// `;
|
|
58
|
-
// const StyledFilterList = styled(FilterList)<{ $isActive: boolean }>`
|
|
59
|
-
// cursor: pointer;
|
|
60
|
-
// list-style: none;
|
|
61
|
-
// border-radius: 0;
|
|
62
|
-
// background: ${props =>
|
|
63
|
-
// props.$isActive ? 'rgba(117, 133, 136, 0.12)' : 'transparent'};
|
|
64
|
-
// color: ${props => (props.$isActive ? '#3a3630' : '#6A7378')};
|
|
65
|
-
// &:hover {
|
|
66
|
-
// color: #3a3630;
|
|
67
|
-
// }
|
|
68
|
-
// a {
|
|
69
|
-
// display: block;
|
|
70
|
-
// padding: 8px 16px;
|
|
71
|
-
// color: inherit;
|
|
72
|
-
// text-decoration: none;
|
|
73
|
-
// &.active {
|
|
74
|
-
// background-color: rgba(117, 133, 136, 0.12);
|
|
75
|
-
// color: #3a3630;
|
|
76
|
-
// }
|
|
77
|
-
// }
|
|
78
|
-
// `;
|
|
79
68
|
export default HeaderFilter;
|