@bjsdistribution/dms-client-return 0.1.93-prod → 0.1.94-prod
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/fakedata.js +0 -14
- package/dist/components/order-view/fakedata.js.map +1 -1
- package/dist/components/order-view/general-information/dropdowns/Print.js +64 -51
- package/dist/components/order-view/general-information/dropdowns/Print.js.map +1 -1
- package/dist/components/order-view/index.js +151 -160
- package/dist/components/order-view/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -46,22 +46,8 @@ const e = [
|
|
|
46
46
|
},
|
|
47
47
|
{ label: "Charge Log", value: "charge-log" },
|
|
48
48
|
{ label: "Force Debrief", value: "force-debrief" }
|
|
49
|
-
], r = [
|
|
50
|
-
{
|
|
51
|
-
label: "Proof of Delivery",
|
|
52
|
-
value: "proofofdelivery"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: "Return Labels",
|
|
56
|
-
value: "returnlabels"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "Return Cover Notes",
|
|
60
|
-
value: "returncovernote"
|
|
61
|
-
}
|
|
62
49
|
];
|
|
63
50
|
export {
|
|
64
|
-
r as PrintMenu,
|
|
65
51
|
e as bjsMenu,
|
|
66
52
|
a as optionsMenu,
|
|
67
53
|
l as optionsMenuClientPortal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakedata.js","sources":["../../../src/components/order-view/fakedata.ts"],"sourcesContent":["import { ChargeLogData } from './types';\n\nexport const bjsMenu = [\n {\n label: 'Add Order Resources',\n value: 'add-resources',\n },\n {\n label: 'Split Order',\n value: 'split-order',\n },\n];\n\nexport const optionsMenuClientPortal = [\n { label: 'Create Task', value: 'create-task' },\n {\n label: 'On Hold',\n value: 'hold-order',\n },\n {\n label: 'Un Hold',\n value: 'unhold-order',\n },\n {\n label: 'Cancel',\n value: 'cancel-order',\n },\n {\n label: 'Un-Cancel',\n value: 'uncancel-order',\n },\n];\n\nexport const optionsMenu = [\n { label: 'Create Reminder', value: 'create-reminder' },\n { label: 'Create Task', value: 'create-task' },\n { label: 'Confirm', value: 'confirm-order' },\n { label: 'Hold', value: 'hold-order' },\n { label: 'Cancel', value: 'cancel-order' },\n { label: 'Un Hold', value: 'unhold-order' },\n {\n label: 'Remove from Route',\n value: 'remove-from-route',\n },\n {\n label: 'Un-Cancel',\n value: 'uncancel-order',\n },\n {\n label: 'Clear Booking Status',\n value: 'clear-date',\n },\n { label: 'Charge Log', value: 'charge-log' },\n { label: 'Force Debrief', value: 'force-debrief' },\n];\n\nexport const PrintMenu = [\n {\n label: 'Proof of Delivery',\n value: 'proofofdelivery',\n },\n {\n label: 'Return Labels',\n value: 'returnlabels',\n },\n {\n label: 'Return Cover Notes',\n value: 'returncovernote',\n },\n];\n\nexport const orderResources = [\n {\n date: '15/01/2024 06:22:47',\n updated_at: '15/01/2024 06:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 1,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 2,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 3,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 4,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 5,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 6,\n },\n];\n\nexport const HoldOptionMenu = [\n {\n label: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / EXTRA ITEMS - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / EXTRA ITEMS - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / NO STOCK - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / NO STOCK - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / NO STOCK - CANX',\n value: 'STOCK RECEIPT / NO STOCK - CANX',\n },\n {\n label: 'STOCK RECEIPT / RE-ALLOCATION',\n value: 'STOCK RECEIPT / RE-ALLOCATION',\n },\n {\n label: 'CONTACT DETAILS / MISSING TEL NUMBER',\n value: 'CONTACT DETAILS / MISSING TEL NUMBER',\n },\n {\n label: 'CONTACT DETAILS / INCORRECT ADDRESS',\n value: 'CONTACT DETAILS / INCORRECT ADDRESS',\n },\n];\n\nexport const initialData: ChargeLogData[] = [\n {\n id: 1,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.00',\n status: '2024-06-02 - Moreham Wood Direct - 34113',\n },\n {\n id: 2,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.45',\n status: '2024-06-02 - Moreham Wood Direct - 34113',\n },\n {\n id: 3,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.00',\n status: '',\n },\n {\n id: 4,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.78',\n status: 'Awaiting Invoice',\n },\n {\n id: 5,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.108',\n status: 'Awaiting',\n },\n];\n"],"names":["bjsMenu","optionsMenuClientPortal","optionsMenu"
|
|
1
|
+
{"version":3,"file":"fakedata.js","sources":["../../../src/components/order-view/fakedata.ts"],"sourcesContent":["import { ChargeLogData } from './types';\n\nexport const bjsMenu = [\n {\n label: 'Add Order Resources',\n value: 'add-resources',\n },\n {\n label: 'Split Order',\n value: 'split-order',\n },\n];\n\nexport const optionsMenuClientPortal = [\n { label: 'Create Task', value: 'create-task' },\n {\n label: 'On Hold',\n value: 'hold-order',\n },\n {\n label: 'Un Hold',\n value: 'unhold-order',\n },\n {\n label: 'Cancel',\n value: 'cancel-order',\n },\n {\n label: 'Un-Cancel',\n value: 'uncancel-order',\n },\n];\n\nexport const optionsMenu = [\n { label: 'Create Reminder', value: 'create-reminder' },\n { label: 'Create Task', value: 'create-task' },\n { label: 'Confirm', value: 'confirm-order' },\n { label: 'Hold', value: 'hold-order' },\n { label: 'Cancel', value: 'cancel-order' },\n { label: 'Un Hold', value: 'unhold-order' },\n {\n label: 'Remove from Route',\n value: 'remove-from-route',\n },\n {\n label: 'Un-Cancel',\n value: 'uncancel-order',\n },\n {\n label: 'Clear Booking Status',\n value: 'clear-date',\n },\n { label: 'Charge Log', value: 'charge-log' },\n { label: 'Force Debrief', value: 'force-debrief' },\n];\n\nexport const PrintMenu = [\n {\n label: 'Proof of Delivery',\n value: 'proofofdelivery',\n },\n {\n label: 'Return Labels',\n value: 'returnlabels',\n },\n {\n label: 'Return Cover Notes',\n value: 'returncovernote',\n },\n];\n\nexport const orderResources = [\n {\n date: '15/01/2024 06:22:47',\n updated_at: '15/01/2024 06:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 1,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 2,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 3,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 4,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 5,\n },\n {\n date: '22/01/2024 07:22:47',\n updated_at: '22/01/2024 07:22:47',\n type: 'Workflow',\n category: 'Epod',\n reference: 'Success Note',\n id: 6,\n },\n];\n\nexport const HoldOptionMenu = [\n {\n label: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / EXTRA ITEMS - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / EXTRA ITEMS - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / NO STOCK - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / NO STOCK - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n value: 'STOCK RECEIPT / DAMAGED - Awaiting Client Instructions',\n },\n {\n label: 'STOCK RECEIPT / NO STOCK - CANX',\n value: 'STOCK RECEIPT / NO STOCK - CANX',\n },\n {\n label: 'STOCK RECEIPT / RE-ALLOCATION',\n value: 'STOCK RECEIPT / RE-ALLOCATION',\n },\n {\n label: 'CONTACT DETAILS / MISSING TEL NUMBER',\n value: 'CONTACT DETAILS / MISSING TEL NUMBER',\n },\n {\n label: 'CONTACT DETAILS / INCORRECT ADDRESS',\n value: 'CONTACT DETAILS / INCORRECT ADDRESS',\n },\n];\n\nexport const initialData: ChargeLogData[] = [\n {\n id: 1,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.00',\n status: '2024-06-02 - Moreham Wood Direct - 34113',\n },\n {\n id: 2,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.45',\n status: '2024-06-02 - Moreham Wood Direct - 34113',\n },\n {\n id: 3,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.00',\n status: '',\n },\n {\n id: 4,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.78',\n status: 'Awaiting Invoice',\n },\n {\n id: 5,\n date: '17/05/2024',\n description: 'Delivery Success - 17/05/2024',\n amount: '0.108',\n status: 'Awaiting',\n },\n];\n"],"names":["bjsMenu","optionsMenuClientPortal","optionsMenu"],"mappings":"AAEO,MAAMA,IAAU;AAAA,EACrB;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX,GAEaC,IAA0B;AAAA,EACrC,EAAE,OAAO,eAAe,OAAO,cAAA;AAAA,EAC/B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX,GAEaC,IAAc;AAAA,EACzB,EAAE,OAAO,mBAAmB,OAAO,kBAAA;AAAA,EACnC,EAAE,OAAO,eAAe,OAAO,cAAA;AAAA,EAC/B,EAAE,OAAO,WAAW,OAAO,gBAAA;AAAA,EAC3B,EAAE,OAAO,QAAQ,OAAO,aAAA;AAAA,EACxB,EAAE,OAAO,UAAU,OAAO,eAAA;AAAA,EAC1B,EAAE,OAAO,WAAW,OAAO,eAAA;AAAA,EAC3B;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET,EAAE,OAAO,cAAc,OAAO,aAAA;AAAA,EAC9B,EAAE,OAAO,iBAAiB,OAAO,gBAAA;AACnC;"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Space as h, Dropdown as b } from "antd";
|
|
1
|
+
import { jsx as o, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as f } from "react";
|
|
3
|
+
import a from "styled-components";
|
|
4
|
+
import { useOrderDetails as g } from "../../store.js";
|
|
5
|
+
import { Space as h, Dropdown as _ } from "antd";
|
|
7
6
|
import y from "../../../../assets/icons/ArrowDownIcon.js";
|
|
8
|
-
import { getBaseEndpoint as
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { getBaseEndpoint as i } from "@bjsdistribution/dms-component-library";
|
|
8
|
+
const l = [
|
|
9
|
+
{ key: "pdf", label: "PDF", noteFormat: "pdf" },
|
|
10
|
+
{ key: "doc", label: "Word", noteFormat: "word" },
|
|
11
|
+
{ key: "zpl", label: "ZPL", noteFormat: "zpl" }
|
|
12
|
+
];
|
|
13
|
+
function D() {
|
|
14
|
+
const [t] = g(), n = t?.consignment, s = f(() => t?.id, [t]), c = () => {
|
|
11
15
|
const e = process.env.REACT_APP_PROJECT_ENV, r = process.env.REACT_APP_API_PATH;
|
|
12
16
|
return r === "https://us.dms.api.bjshomedelivery.com" ? "release_us" : r === "https://development.dms.api.bjshomedelivery.com" ? "development" : r === "https://staging.dms.api.bjshomedelivery.com" ? "staging" : e === "release_uk" ? "release_uk" : e === "release_us" ? "release_us" : e === "staging" ? "staging" : "development";
|
|
13
17
|
}, d = () => {
|
|
14
|
-
switch (
|
|
18
|
+
switch (c()) {
|
|
15
19
|
case "release_uk":
|
|
16
20
|
return "https://api.bjshomedelivery.com/v2/orders/labels";
|
|
17
21
|
case "release_us":
|
|
@@ -21,51 +25,60 @@ function T() {
|
|
|
21
25
|
default:
|
|
22
26
|
return "https://api.development.bjshomedelivery.com/v2/orders/labels";
|
|
23
27
|
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
}, p = (e) => n ? `${d()}/generate_labels?consignment_no=${n}&product_type=Return&${e}=1` : (console.error(
|
|
29
|
+
"Missing consignment number. Cannot generate Return Labels URL."
|
|
30
|
+
), ""), m = (e) => `${i()}/orders/generate_note/?order_id=${s}&output_format=${e}`, u = () => {
|
|
31
|
+
const e = i();
|
|
32
|
+
window.open(
|
|
33
|
+
`${e}/orders/return_cover_notes/?order_id=${s}`,
|
|
34
|
+
"_blank"
|
|
35
|
+
);
|
|
36
|
+
}, v = {
|
|
37
|
+
items: [
|
|
38
|
+
...l.map((e) => ({
|
|
39
|
+
key: `proofofdelivery-${e.key}`,
|
|
40
|
+
label: /* @__PURE__ */ o(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
onClick: (r) => {
|
|
44
|
+
r.stopPropagation(), window.open(m(e.noteFormat), "_blank");
|
|
45
|
+
},
|
|
46
|
+
children: `Proof of Delivery - ${e.label}`
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
})),
|
|
50
|
+
...l.map((e) => ({
|
|
51
|
+
key: `returnlabels-${e.key}`,
|
|
52
|
+
label: /* @__PURE__ */ o(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
onClick: (r) => {
|
|
56
|
+
r.stopPropagation(), window.open(p(e.key), "_blank");
|
|
57
|
+
},
|
|
58
|
+
children: `Return Labels - ${e.label}`
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
})),
|
|
62
|
+
{
|
|
63
|
+
key: "returncovernote",
|
|
64
|
+
label: /* @__PURE__ */ o(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
onClick: (e) => {
|
|
68
|
+
e.stopPropagation(), u();
|
|
69
|
+
},
|
|
70
|
+
children: "Return Cover Notes"
|
|
71
|
+
}
|
|
72
|
+
)
|
|
43
73
|
}
|
|
44
|
-
|
|
45
|
-
items: g?.map((e) => ({
|
|
46
|
-
key: e.value,
|
|
47
|
-
label: e.label,
|
|
48
|
-
value: e.value
|
|
49
|
-
}))?.map((e) => ({
|
|
50
|
-
key: e.value,
|
|
51
|
-
label: /* @__PURE__ */ t(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
onClick: (r) => {
|
|
55
|
-
r.stopPropagation(), p(e);
|
|
56
|
-
},
|
|
57
|
-
children: e.label
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
// disabled,
|
|
61
|
-
}))
|
|
74
|
+
]
|
|
62
75
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(_, { menu: v, trigger: ["hover"], children: /* @__PURE__ */ o("a", { onClick: (e) => e.preventDefault(), style: { cursor: "pointer" }, children: /* @__PURE__ */ b(P, { children: [
|
|
64
77
|
"PRINT",
|
|
65
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ o(y, { fill: "#f0f2f2" })
|
|
66
79
|
] }) }) }) });
|
|
67
80
|
}
|
|
68
|
-
const
|
|
81
|
+
const k = a.div``, P = a(h)`
|
|
69
82
|
.ant-space-item {
|
|
70
83
|
color: #6a7378;
|
|
71
84
|
text-align: center;
|
|
@@ -76,6 +89,6 @@ const P = i.div``, j = i(h)`
|
|
|
76
89
|
}
|
|
77
90
|
`;
|
|
78
91
|
export {
|
|
79
|
-
|
|
92
|
+
D as default
|
|
80
93
|
};
|
|
81
94
|
//# sourceMappingURL=Print.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Print.js","sources":["../../../../../src/components/order-view/general-information/dropdowns/Print.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport {
|
|
1
|
+
{"version":3,"file":"Print.js","sources":["../../../../../src/components/order-view/general-information/dropdowns/Print.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { useOrderDetails } from '../../store';\nimport { Dropdown, Space } from 'antd';\nimport ArrowDownIcon from '../../../../assets/icons/ArrowDownIcon';\nimport { getBaseEndpoint } from '@bjsdistribution/dms-component-library';\n\nconst LABEL_FORMATS = [\n { key: 'pdf', label: 'PDF', noteFormat: 'pdf' },\n { key: 'doc', label: 'Word', noteFormat: 'word' },\n { key: 'zpl', label: 'ZPL', noteFormat: 'zpl' },\n] as const;\n\nfunction Print() {\n const [orderDetails] = useOrderDetails();\n const consignmentNo = orderDetails?.consignment;\n\n const orderId = useMemo(() => {\n return orderDetails?.id;\n }, [orderDetails]);\n\n const getEnvironment = ():\n | 'development'\n | 'release_us'\n | 'release_uk'\n | 'staging' => {\n const projectEnv = process.env.REACT_APP_PROJECT_ENV;\n const apiPath = process.env.REACT_APP_API_PATH;\n\n if (apiPath === 'https://us.dms.api.bjshomedelivery.com') {\n return 'release_us';\n }\n if (apiPath === 'https://development.dms.api.bjshomedelivery.com') {\n return 'development';\n }\n if (apiPath === 'https://staging.dms.api.bjshomedelivery.com') {\n return 'staging';\n }\n\n if (projectEnv === 'release_uk') {\n return 'release_uk';\n }\n if (projectEnv === 'release_us') {\n return 'release_us';\n }\n if (projectEnv === 'staging') {\n return 'staging';\n }\n return 'development';\n };\n\n const getBaseUrl = (): string => {\n const environment = getEnvironment();\n switch (environment) {\n case 'release_uk':\n return 'https://api.bjshomedelivery.com/v2/orders/labels';\n case 'release_us':\n return 'https://us.api.bjshomedelivery.com/v2/orders/labels';\n case 'staging':\n return 'https://staging.api.bjshomedelivery.com/v2/orders/labels';\n default:\n return 'https://api.development.bjshomedelivery.com/v2/orders/labels';\n }\n };\n\n const getReturnLabelUrl = (format: (typeof LABEL_FORMATS)[number]['key']) => {\n if (!consignmentNo) {\n console.error(\n 'Missing consignment number. Cannot generate Return Labels URL.'\n );\n return '';\n }\n const baseUrl = getBaseUrl();\n return `${baseUrl}/generate_labels?consignment_no=${consignmentNo}&product_type=Return&${format}=1`;\n };\n\n const getProofOfDeliveryUrl = (\n noteFormat: (typeof LABEL_FORMATS)[number]['noteFormat']\n ) => {\n const baseEndpoint = getBaseEndpoint();\n return `${baseEndpoint}/orders/generate_note/?order_id=${orderId}&output_format=${noteFormat}`;\n };\n\n const handleReturnCoverNote = () => {\n const baseEndpoint = getBaseEndpoint();\n window.open(\n `${baseEndpoint}/orders/return_cover_notes/?order_id=${orderId}`,\n '_blank'\n );\n };\n\n const menuItems = {\n items: [\n ...LABEL_FORMATS.map(format => ({\n key: `proofofdelivery-${format.key}`,\n label: (\n <div\n onClick={e => {\n e.stopPropagation();\n window.open(getProofOfDeliveryUrl(format.noteFormat), '_blank');\n }}\n >\n {`Proof of Delivery - ${format.label}`}\n </div>\n ),\n })),\n ...LABEL_FORMATS.map(format => ({\n key: `returnlabels-${format.key}`,\n label: (\n <div\n onClick={e => {\n e.stopPropagation();\n window.open(getReturnLabelUrl(format.key), '_blank');\n }}\n >\n {`Return Labels - ${format.label}`}\n </div>\n ),\n })),\n {\n key: 'returncovernote',\n label: (\n <div\n onClick={e => {\n e.stopPropagation();\n handleReturnCoverNote();\n }}\n >\n Return Cover Notes\n </div>\n ),\n },\n ],\n };\n\n return (\n <Container>\n <Dropdown menu={menuItems} trigger={['hover']}>\n <a onClick={e => e.preventDefault()} style={{ cursor: 'pointer' }}>\n <StyledSpace>\n PRINT\n <ArrowDownIcon fill={'#f0f2f2'} />\n </StyledSpace>\n </a>\n </Dropdown>\n </Container>\n );\n}\n\nconst Container = styled.div``;\n\nconst StyledSpace = styled(Space)`\n .ant-space-item {\n color: #6a7378;\n text-align: center;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n`;\n\nexport default Print;\n"],"names":["LABEL_FORMATS","Print","orderDetails","useOrderDetails","consignmentNo","orderId","useMemo","getEnvironment","projectEnv","apiPath","getBaseUrl","getReturnLabelUrl","format","getProofOfDeliveryUrl","noteFormat","getBaseEndpoint","handleReturnCoverNote","baseEndpoint","menuItems","jsx","e","Container","Dropdown","jsxs","StyledSpace","ArrowDownIcon","styled","Space"],"mappings":";;;;;;;AAOA,MAAMA,IAAgB;AAAA,EACpB,EAAE,KAAK,OAAO,OAAO,OAAO,YAAY,MAAA;AAAA,EACxC,EAAE,KAAK,OAAO,OAAO,QAAQ,YAAY,OAAA;AAAA,EACzC,EAAE,KAAK,OAAO,OAAO,OAAO,YAAY,MAAA;AAC1C;AAEA,SAASC,IAAQ;AACf,QAAM,CAACC,CAAY,IAAIC,EAAA,GACjBC,IAAgBF,GAAc,aAE9BG,IAAUC,EAAQ,MACfJ,GAAc,IACpB,CAACA,CAAY,CAAC,GAEXK,IAAiB,MAIN;AACf,UAAMC,IAAa,QAAA,IAAY,uBACzBC,IAAU,QAAA,IAAY;AAE5B,WAAIA,MAAY,2CACP,eAELA,MAAY,oDACP,gBAELA,MAAY,gDACP,YAGLD,MAAe,eACV,eAELA,MAAe,eACV,eAELA,MAAe,YACV,YAEF;AAAA,EACT,GAEME,IAAa,MAAc;AAE/B,YADoBH,EAAA,GACZ;AAAA,MACN,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT,KAAK;AACH,eAAO;AAAA,MACT;AACE,eAAO;AAAA,IAAA;AAAA,EAEb,GAEMI,IAAoB,CAACC,MACpBR,IAOE,GADSM,EAAA,CACC,mCAAmCN,CAAa,wBAAwBQ,CAAM,QAN7F,QAAQ;AAAA,IACN;AAAA,EAAA,GAEK,KAMLC,IAAwB,CAC5BC,MAGO,GADcC,EAAA,CACC,mCAAmCV,CAAO,kBAAkBS,CAAU,IAGxFE,IAAwB,MAAM;AAClC,UAAMC,IAAeF,EAAA;AACrB,WAAO;AAAA,MACL,GAAGE,CAAY,wCAAwCZ,CAAO;AAAA,MAC9D;AAAA,IAAA;AAAA,EAEJ,GAEMa,IAAY;AA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A,CACF,GACF;AAEJ;AAEA,MAAMJ,IAAYK,EAAO,OAEnBF,IAAcE,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { jsxs as C, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useAxios as
|
|
11
|
-
import { useOrderId as
|
|
12
|
-
import { useLocation as
|
|
13
|
-
import { notification as
|
|
14
|
-
import
|
|
15
|
-
import { useSubContracterData as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { useAllOrderStatus as
|
|
19
|
-
import { POSTCODE_LABEL as
|
|
20
|
-
import { getEnvironment as
|
|
21
|
-
import
|
|
22
|
-
import { useAtom as
|
|
23
|
-
function
|
|
24
|
-
|
|
2
|
+
import { useState as Q, useEffect as o, useRef as Ne } from "react";
|
|
3
|
+
import f from "styled-components";
|
|
4
|
+
import ke from "./order-details/index.js";
|
|
5
|
+
import He from "./notes/index.js";
|
|
6
|
+
import Fe from "./system-event-logs/expanded-content/index.js";
|
|
7
|
+
import Ke from "./general-information/index.js";
|
|
8
|
+
import Ve from "./products-info/index.js";
|
|
9
|
+
import je from "./order-actions/index.js";
|
|
10
|
+
import { useAxios as l, useApiHook as i, DocumentTitle as qe } from "@bjsdistribution/dms-component-library";
|
|
11
|
+
import { useOrderId as ze, useGsitOrderId as Ye, useOrderDetails as Ze, usePrevOrderDetails as Qe, useStatusDetails as Be, useDepotOptions as Je, useCustomerInfo as Me, useLocationOptions as We, useOrderProductsResources as Xe, useGsitCUstomerId as et, useOrderProductId as tt, useCUstomerId as ot, useRouteId as st, useLiveRecalling as rt, useGlobalStateHitOrder as at, usegetClientData as nt, useGlobalEscData as it, useEpodImages as dt, skeletonTomTom as ct, useOrderProductSystemLogs as lt } from "./store.js";
|
|
12
|
+
import { useLocation as ut, useNavigate as pt } from "react-router-dom";
|
|
13
|
+
import { notification as ft, message as B } from "antd";
|
|
14
|
+
import mt from "./details-filters/DetailsFilters.js";
|
|
15
|
+
import { useSubContracterData as gt, useIsShowNorthSouth as ht, useClientPortal as Dt } from "../store.js";
|
|
16
|
+
import _t from "./notification/index.js";
|
|
17
|
+
import St from "./order-resources/expanded-content/index.js";
|
|
18
|
+
import { useAllOrderStatus as Et, setResourcesCall as It } from "./order-actions/store.js";
|
|
19
|
+
import { POSTCODE_LABEL as Ot } from "../../common/utils.js";
|
|
20
|
+
import { getEnvironment as Pt } from "./utils.js";
|
|
21
|
+
import At from "./toolbox-resources/expanded-content/index.js";
|
|
22
|
+
import { useAtom as J } from "jotai";
|
|
23
|
+
function Mt({ locationloading: M }) {
|
|
24
|
+
ft.config({
|
|
25
25
|
top: 150
|
|
26
26
|
});
|
|
27
|
-
const [s,
|
|
27
|
+
const [s, y] = ze(), [W, G] = Ye(), [a, X] = Ze(), [, ee] = Qe(), [, m] = Q(!1), [, te] = Be(), [, x] = Je(), [R, oe] = Me(), [, se] = We(), [re, b] = Xe(), [g, ae] = et(), [, ne] = tt(), [, ie] = ot(), [, de] = st(), [$] = rt(), [, ce] = gt(), [w] = at(), [, le] = Et(), U = a?.id, [N] = J(It), [, ue] = nt(), [, k] = it(), [, pe] = ht(), [, fe] = dt(), [, me] = J(ct), [ge] = Dt();
|
|
28
28
|
o(() => {
|
|
29
|
-
|
|
29
|
+
le(a?.status_value);
|
|
30
30
|
}, [a?.status_value]);
|
|
31
31
|
const {
|
|
32
|
-
data:
|
|
33
|
-
fetchData:
|
|
32
|
+
data: h,
|
|
33
|
+
fetchData: he,
|
|
34
34
|
loading: H
|
|
35
|
-
} =
|
|
35
|
+
} = l({
|
|
36
36
|
endpoint: "/events/get/event/",
|
|
37
37
|
method: "GET",
|
|
38
38
|
pagination: { page: 1, per_page: 100 },
|
|
@@ -44,10 +44,10 @@ function Me({ locationloading: M }) {
|
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
showLoader: !1
|
|
47
|
-
}),
|
|
48
|
-
data:
|
|
49
|
-
loading:
|
|
50
|
-
setShouldPerformAction:
|
|
47
|
+
}), D = ut(), De = pt(), [F, _e] = Q([]), {
|
|
48
|
+
data: Se,
|
|
49
|
+
loading: Ee,
|
|
50
|
+
setShouldPerformAction: Ie
|
|
51
51
|
} = i({
|
|
52
52
|
endpoint: "orders/",
|
|
53
53
|
method: "GET",
|
|
@@ -55,42 +55,42 @@ function Me({ locationloading: M }) {
|
|
|
55
55
|
performAction: !1
|
|
56
56
|
});
|
|
57
57
|
o(() => {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
const e = new URLSearchParams(D.search);
|
|
59
|
+
if (e?.toString()) {
|
|
60
|
+
const t = [];
|
|
61
|
+
e?.forEach((n, p) => {
|
|
62
|
+
p === "order" ? t.push({
|
|
63
63
|
field: "gsit_order_id",
|
|
64
64
|
op: "=",
|
|
65
65
|
value: n
|
|
66
|
-
}) :
|
|
67
|
-
field:
|
|
66
|
+
}) : t.push({
|
|
67
|
+
field: p,
|
|
68
68
|
op: "=",
|
|
69
69
|
value: n
|
|
70
70
|
});
|
|
71
|
-
}),
|
|
71
|
+
}), _e(t), F && (Ie(!0), y(Se?.data[0]?.id));
|
|
72
72
|
} else {
|
|
73
|
-
const
|
|
74
|
-
|
|
73
|
+
const t = D.pathname.split("/");
|
|
74
|
+
y(t[t?.length - 1]);
|
|
75
75
|
}
|
|
76
|
-
}, [
|
|
76
|
+
}, [D.search, Ee]);
|
|
77
77
|
const {
|
|
78
|
-
data:
|
|
78
|
+
data: _,
|
|
79
79
|
loading: S,
|
|
80
|
-
setShouldPerformAction:
|
|
80
|
+
setShouldPerformAction: Oe
|
|
81
81
|
} = i({
|
|
82
82
|
endpoint: `orders/${s}`,
|
|
83
83
|
method: "GET",
|
|
84
84
|
performAction: !1
|
|
85
85
|
}), {
|
|
86
|
-
data:
|
|
87
|
-
loading:
|
|
86
|
+
data: u,
|
|
87
|
+
loading: E,
|
|
88
88
|
setShouldPerformAction: K
|
|
89
89
|
} = i({
|
|
90
90
|
endpoint: `/orders/get_live_status/${s}`,
|
|
91
91
|
method: "GET",
|
|
92
92
|
performAction: !1
|
|
93
|
-
}), { data:
|
|
93
|
+
}), { data: I, loading: O } = i({
|
|
94
94
|
endpoint: "/depot/",
|
|
95
95
|
method: "GET",
|
|
96
96
|
filters: [{ field: "visibility", op: "=", value: !0 }],
|
|
@@ -98,67 +98,58 @@ function Me({ locationloading: M }) {
|
|
|
98
98
|
pagination: { is_pagination: !1 }
|
|
99
99
|
});
|
|
100
100
|
o(() => {
|
|
101
|
-
s && (
|
|
101
|
+
s && (Oe(w), K(!$));
|
|
102
102
|
}, [s, $, w]), o(() => {
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
103
|
+
if (m(S), _ && _.data) {
|
|
104
|
+
const e = _?.data;
|
|
105
|
+
if (e[0]?.order_type?.type && e[0]?.order_type?.type !== "return") {
|
|
106
|
+
De(`/orders/view/${s}`, { replace: !0 });
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
X(
|
|
110
|
-
recipient_name:
|
|
111
|
-
postcode:
|
|
112
|
-
return_action:
|
|
113
|
-
}),
|
|
114
|
-
"dbSyncAPICall",
|
|
115
|
-
JSON.stringify({
|
|
116
|
-
status: !0,
|
|
117
|
-
gsit_orderId: c?.data[0]?.gsit_order_id
|
|
118
|
-
})
|
|
119
|
-
) : localStorage.setItem("dbSyncAPICall", JSON.stringify({}));
|
|
109
|
+
X(e[0]), ie(e[0]?.customer_id), de(e[0]?.order_routes?.route_id), G(e[0]?.gsit_order_id), ne(e[0]?.id), oe({
|
|
110
|
+
recipient_name: e[0]?.order_recipient?.recipient_name ?? null,
|
|
111
|
+
postcode: e[0]?.order_recipient?.postcode ?? null,
|
|
112
|
+
return_action: e[0]?.return_action ?? null
|
|
113
|
+
}), ee(e[0]);
|
|
120
114
|
}
|
|
121
|
-
return () => {
|
|
122
|
-
localStorage.removeItem("dbSyncAPICall");
|
|
123
|
-
};
|
|
124
115
|
}, [S]), o(() => {
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
|
|
116
|
+
if (m(E), u && u.data) {
|
|
117
|
+
const e = u?.data;
|
|
118
|
+
e && te(e);
|
|
128
119
|
}
|
|
129
|
-
}, [
|
|
120
|
+
}, [E, u]);
|
|
130
121
|
const {
|
|
131
|
-
fetchData:
|
|
132
|
-
loading:
|
|
133
|
-
data:
|
|
134
|
-
} =
|
|
122
|
+
fetchData: Pe,
|
|
123
|
+
loading: Ae,
|
|
124
|
+
data: P
|
|
125
|
+
} = l({
|
|
135
126
|
endpoint: "/v1/client/list",
|
|
136
127
|
method: "GET"
|
|
137
128
|
});
|
|
138
129
|
o(() => {
|
|
139
|
-
s && (
|
|
130
|
+
s && (Pe(), Ge());
|
|
140
131
|
}, [s]), o(() => {
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
|
|
132
|
+
if (P && P?.data) {
|
|
133
|
+
const e = P?.data;
|
|
134
|
+
ue(e);
|
|
144
135
|
}
|
|
145
|
-
}, [
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
136
|
+
}, [Ae]), o(() => {
|
|
137
|
+
if (m(O), I && I.data) {
|
|
138
|
+
const e = I?.data;
|
|
139
|
+
if (e.length > 0) {
|
|
140
|
+
const t = e?.map((n) => ({
|
|
150
141
|
label: n.name,
|
|
151
142
|
value: n.id
|
|
152
143
|
}));
|
|
153
|
-
x(
|
|
144
|
+
x(t);
|
|
154
145
|
} else
|
|
155
146
|
x([]);
|
|
156
147
|
}
|
|
157
|
-
}, [
|
|
148
|
+
}, [O]);
|
|
158
149
|
const {
|
|
159
150
|
data: V,
|
|
160
151
|
setShouldPerformAction: d,
|
|
161
|
-
loading:
|
|
152
|
+
loading: Le
|
|
162
153
|
} = i({
|
|
163
154
|
endpoint: `/orders/${s}/order_resources/`,
|
|
164
155
|
method: "GET",
|
|
@@ -173,161 +164,161 @@ function Me({ locationloading: M }) {
|
|
|
173
164
|
s && d(!0);
|
|
174
165
|
}, [s, d]), o(() => {
|
|
175
166
|
s && b(V);
|
|
176
|
-
}, [V,
|
|
167
|
+
}, [V, re, b]);
|
|
177
168
|
const {
|
|
178
169
|
data: A,
|
|
179
170
|
loading: j,
|
|
180
|
-
fetchData:
|
|
181
|
-
} =
|
|
171
|
+
fetchData: ve
|
|
172
|
+
} = l({
|
|
182
173
|
endpoint: `orders/${s}/epod_resources/?finance=false`,
|
|
183
174
|
method: "GET"
|
|
184
175
|
});
|
|
185
176
|
o(() => {
|
|
186
|
-
s && (
|
|
177
|
+
s && (ve(), a?.order_recipient?.postcode != null && Y({
|
|
187
178
|
endPointQuery: `?postcode=${a?.order_recipient?.postcode}`
|
|
188
179
|
}));
|
|
189
180
|
}, [s]), o(() => {
|
|
190
181
|
if (A && A?.data) {
|
|
191
|
-
const
|
|
192
|
-
|
|
182
|
+
const e = A?.data?.resources;
|
|
183
|
+
fe(e);
|
|
193
184
|
}
|
|
194
|
-
|
|
185
|
+
me(j);
|
|
195
186
|
}, [j]), o(() => () => {
|
|
196
|
-
|
|
187
|
+
ae((e) => ({ ...e, id: void 0 }));
|
|
197
188
|
}, []);
|
|
198
189
|
const {
|
|
199
|
-
data:
|
|
200
|
-
loading:
|
|
190
|
+
data: L,
|
|
191
|
+
loading: Te,
|
|
201
192
|
setShouldPerformAction: q
|
|
202
193
|
} = i({
|
|
203
|
-
endpoint: `/return_locations/?customer_id=${
|
|
194
|
+
endpoint: `/return_locations/?customer_id=${g?.id}`,
|
|
204
195
|
method: "GET",
|
|
205
196
|
performAction: !1
|
|
206
197
|
});
|
|
207
198
|
o(() => {
|
|
208
|
-
|
|
209
|
-
}, [
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
label:
|
|
213
|
-
value:
|
|
214
|
-
is_default:
|
|
199
|
+
g?.id ? q(!0) : q(!1);
|
|
200
|
+
}, [g]), o(() => {
|
|
201
|
+
if (L && L?.data) {
|
|
202
|
+
const e = L?.data?.map((t) => ({
|
|
203
|
+
label: t?.location_name + ", " + t?.postcode,
|
|
204
|
+
value: t?.token,
|
|
205
|
+
is_default: t?.is_default === "True"
|
|
215
206
|
}));
|
|
216
|
-
|
|
207
|
+
se(e);
|
|
217
208
|
}
|
|
218
|
-
}, [
|
|
219
|
-
const [,
|
|
209
|
+
}, [Te]);
|
|
210
|
+
const [, Ce] = lt();
|
|
220
211
|
o(() => {
|
|
221
|
-
|
|
222
|
-
}, [H]), o(() => (W &&
|
|
212
|
+
h && h?.data && Ce(h?.data);
|
|
213
|
+
}, [H]), o(() => (W && he(), () => {
|
|
223
214
|
G(void 0);
|
|
224
215
|
}), [U]);
|
|
225
|
-
const { data:
|
|
216
|
+
const { data: c, loading: ye } = i({
|
|
226
217
|
endpoint: "/sub-contractor/sub_contractor/get/",
|
|
227
218
|
method: "GET"
|
|
228
219
|
});
|
|
229
220
|
o(() => {
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
(
|
|
233
|
-
id:
|
|
234
|
-
name:
|
|
221
|
+
if (c && c?.data) {
|
|
222
|
+
const e = c?.data?.map(
|
|
223
|
+
(t) => ({
|
|
224
|
+
id: t.id,
|
|
225
|
+
name: t.name
|
|
235
226
|
})
|
|
236
227
|
);
|
|
237
|
-
|
|
228
|
+
ce(e);
|
|
238
229
|
}
|
|
239
|
-
}, [
|
|
230
|
+
}, [c, c, ye]);
|
|
240
231
|
const {
|
|
241
232
|
data: z,
|
|
242
|
-
fetchData:
|
|
243
|
-
loading:
|
|
244
|
-
} =
|
|
233
|
+
fetchData: Ge,
|
|
234
|
+
loading: xe
|
|
235
|
+
} = l({
|
|
245
236
|
endpoint: `/orders/escalations/${s}`,
|
|
246
237
|
method: "GET"
|
|
247
238
|
});
|
|
248
239
|
o(() => {
|
|
249
240
|
if (z?.data) {
|
|
250
|
-
const
|
|
251
|
-
(
|
|
252
|
-
), n =
|
|
253
|
-
k(n ?
|
|
241
|
+
const t = z?.data?.sort(
|
|
242
|
+
(p, Ue) => new Date(Ue?.created_at).getTime() - new Date(p?.created_at).getTime()
|
|
243
|
+
), n = t != null && t.length > 0;
|
|
244
|
+
k(n ? t : []);
|
|
254
245
|
}
|
|
255
|
-
}, [
|
|
256
|
-
const
|
|
246
|
+
}, [xe]);
|
|
247
|
+
const Re = `${R?.recipient_name}, ${R?.postcode}`, v = Pt(), { fetchData: Y } = l({
|
|
257
248
|
endpoint: "v1/orders/customs/postcode/check/",
|
|
258
249
|
method: "GET"
|
|
259
|
-
}),
|
|
250
|
+
}), be = async () => {
|
|
260
251
|
try {
|
|
261
|
-
const
|
|
252
|
+
const e = await Y({
|
|
262
253
|
endPointQuery: `?postcode=${a?.order_recipient?.postcode}`
|
|
263
254
|
});
|
|
264
|
-
if (
|
|
265
|
-
const
|
|
266
|
-
|
|
255
|
+
if (e?.code === 200) {
|
|
256
|
+
const t = e?.data?.order_customs_postcodes;
|
|
257
|
+
pe(t);
|
|
267
258
|
} else
|
|
268
|
-
|
|
259
|
+
B.open({
|
|
269
260
|
type: "error",
|
|
270
261
|
//@ts-ignore
|
|
271
|
-
content:
|
|
262
|
+
content: e?.error || "Something went wrong"
|
|
272
263
|
});
|
|
273
264
|
} catch {
|
|
274
|
-
|
|
265
|
+
B.open({
|
|
275
266
|
type: "error",
|
|
276
|
-
content: `Failed to check ${
|
|
267
|
+
content: `Failed to check ${Ot.toLowerCase()}. Please try again.`
|
|
277
268
|
});
|
|
278
269
|
}
|
|
279
|
-
},
|
|
270
|
+
}, T = {
|
|
280
271
|
UK: /\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\b/,
|
|
281
272
|
IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,
|
|
282
273
|
US: /^\d{5}(-\d{4})?$/
|
|
283
|
-
}, $
|
|
274
|
+
}, $e = v === "development" || v === "staging" || v === "release_uk", we = (e) => $e ? T.UK.test(e) || T.IRISH.test(e) : T.US.test(e), Z = Ne(!1);
|
|
284
275
|
return o(() => {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
}, [a?.order_recipient?.postcode]), /* @__PURE__ */ C(
|
|
288
|
-
/* @__PURE__ */ r(
|
|
289
|
-
/* @__PURE__ */ r(
|
|
290
|
-
/* @__PURE__ */ r(
|
|
291
|
-
/* @__PURE__ */ r(
|
|
276
|
+
const e = a?.order_recipient?.postcode?.trim();
|
|
277
|
+
e && we(e) && !Z.current && (Z.current = !0, be());
|
|
278
|
+
}, [a?.order_recipient?.postcode]), /* @__PURE__ */ C(Lt, { children: [
|
|
279
|
+
/* @__PURE__ */ r(qe, { title: Re }),
|
|
280
|
+
/* @__PURE__ */ r(Ke, { statusDataLoading: E }),
|
|
281
|
+
/* @__PURE__ */ r(mt, {}),
|
|
282
|
+
/* @__PURE__ */ r(_t, {}),
|
|
292
283
|
/* @__PURE__ */ r(
|
|
293
|
-
|
|
284
|
+
ke,
|
|
294
285
|
{
|
|
295
286
|
orderLoading: S,
|
|
296
|
-
depotDataLoading:
|
|
287
|
+
depotDataLoading: O
|
|
297
288
|
}
|
|
298
289
|
),
|
|
299
|
-
/* @__PURE__ */ r(
|
|
300
|
-
/* @__PURE__ */ C(
|
|
301
|
-
/* @__PURE__ */ r(
|
|
302
|
-
/* @__PURE__ */ C(
|
|
303
|
-
/* @__PURE__ */ r(
|
|
304
|
-
!
|
|
305
|
-
/* @__PURE__ */ r(
|
|
290
|
+
/* @__PURE__ */ r(Ve, { locationloading: M }),
|
|
291
|
+
/* @__PURE__ */ C(vt, { children: [
|
|
292
|
+
/* @__PURE__ */ r(Tt, { children: /* @__PURE__ */ r(He, {}) }),
|
|
293
|
+
/* @__PURE__ */ C(Ct, { children: [
|
|
294
|
+
/* @__PURE__ */ r(St, { loading: Le }),
|
|
295
|
+
!ge && /* @__PURE__ */ r(At, {}),
|
|
296
|
+
/* @__PURE__ */ r(Fe, { loading: H })
|
|
306
297
|
] })
|
|
307
298
|
] }),
|
|
308
|
-
/* @__PURE__ */ r(
|
|
299
|
+
/* @__PURE__ */ r(je, {})
|
|
309
300
|
] });
|
|
310
301
|
}
|
|
311
|
-
const
|
|
302
|
+
const Lt = f.div`
|
|
312
303
|
display: flex;
|
|
313
304
|
flex-direction: column;
|
|
314
305
|
gap: 10px;
|
|
315
306
|
padding-bottom: 30px;
|
|
316
|
-
`,
|
|
307
|
+
`, vt = f.div`
|
|
317
308
|
display: flex;
|
|
318
309
|
gap: 15px;
|
|
319
310
|
@media (max-width: 1024px) {
|
|
320
311
|
display: contents;
|
|
321
312
|
}
|
|
322
|
-
`,
|
|
313
|
+
`, Tt = f.div`
|
|
323
314
|
flex: 1;
|
|
324
|
-
`,
|
|
315
|
+
`, Ct = f.div`
|
|
325
316
|
flex: 1;
|
|
326
317
|
display: flex;
|
|
327
318
|
flex-direction: column;
|
|
328
319
|
gap: 15px;
|
|
329
320
|
`;
|
|
330
321
|
export {
|
|
331
|
-
|
|
322
|
+
Mt as default
|
|
332
323
|
};
|
|
333
324
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/order-view/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport OrderDetails from './order-details';\nimport Notes from './notes';\nimport SystemLogs from './system-event-logs/expanded-content';\nimport GeneralHeader from './general-information';\nimport ProductsInfo from './products-info';\nimport OrderActions from './order-actions';\nimport {\n DocumentTitle,\n useApiHook,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useOrderDetails,\n // useOrderStaticData,\n useStatusDetails,\n useOrderId,\n useDepotOptions,\n usePrevOrderDetails,\n useOrderProductsResources,\n useCustomerInfo,\n useLocationOptions,\n useOrderProductSystemLogs,\n useGsitCUstomerId,\n useCUstomerId,\n useRouteId,\n useGsitOrderId,\n useOrderProductId,\n useLiveRecalling,\n useGlobalStateHitOrder,\n useAtom,\n usegetClientData,\n useGlobalEscData,\n useEpodImages,\n skeletonTomTom,\n} from './store';\nimport { OrdersType } from './types';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { message, notification } from 'antd';\nimport DetailsFilters from './details-filters/DetailsFilters';\nimport {\n useClientPortal,\n useIsShowNorthSouth,\n useSubContracterData,\n} from '../store';\nimport Notification from './notification';\nimport Order from './order-resources/expanded-content';\nimport { setResourcesCall, useAllOrderStatus } from './order-actions/store';\nimport { ClientType } from '../order-daily-overview/common/interface';\nimport { POSTCODE_LABEL } from '../../common/utils';\nimport { getEnvironment } from './utils';\nimport Toolbox from './toolbox-resources/expanded-content';\n\ninterface ApiResponse {\n message: string;\n code: number;\n error: string | null;\n error_traceback: string | null;\n data: [];\n setShouldPerformAction: boolean;\n}\n\nfunction OrderView({ locationloading }: any) {\n notification.config({\n top: 150,\n });\n const [orderId, setOrderId] = useOrderId();\n const [gsitOrderId, setGsitOrderId] = useGsitOrderId();\n // For API Call\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [, setPrevOrderDetails] = usePrevOrderDetails();\n const [, setLoading] = useState<boolean>(false);\n const [, setOrderStatus] = useStatusDetails();\n const [, setDepotOptions] = useDepotOptions();\n const [customerInfo, setCustomerInfo] = useCustomerInfo();\n const [, setLocationOptions] = useLocationOptions();\n const [orderResources, setOrderResources] = useOrderProductsResources();\n const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();\n const [, setOrderProductId] = useOrderProductId();\n const [, setCUstomerId] = useCUstomerId();\n const [, setRouteId] = useRouteId();\n const [liveRecalling] = useLiveRecalling();\n const [, setSubContracterData] = useSubContracterData();\n const [recallOrders] = useGlobalStateHitOrder();\n const [, setStatusVal] = useAllOrderStatus();\n const order_id = orderDetails?.id;\n const [getResources] = useAtom(setResourcesCall);\n const [, setClientData] = usegetClientData();\n const [, setGlobalEscData] = useGlobalEscData();\n const [, setIsNorthSouth] = useIsShowNorthSouth();\n const [, setEpodImages] = useEpodImages();\n const [, setSkeletonTomTom] = useAtom(skeletonTomTom);\n const [clientPortal] = useClientPortal();\n\n useEffect(() => {\n setStatusVal(orderDetails?.status_value);\n }, [orderDetails?.status_value]);\n\n //get system event logs\n const {\n data: fetchedSystemLogsData,\n fetchData: callSystemLogsAPI,\n loading: logsLoading,\n } = useAxios<{\n data: any[];\n }>({\n endpoint: `/events/get/event/`,\n method: 'GET',\n pagination: { page: 1, per_page: 100 },\n filters: [\n {\n field: 'order_id',\n op: '=',\n value: `${order_id}`,\n },\n ],\n showLoader: false,\n });\n\n // query param\n const location = useLocation();\n const navigate = useNavigate();\n const [filters, setFilters] = useState<\n Array<{ field: string; op: string; value: string | null }>\n >([]);\n\n // for third party apps\n const {\n data: fetchedDataExternal,\n loading: loadingExternal,\n setShouldPerformAction: setShouldPerformExternal,\n } = useApiHook<{\n data: any[];\n }>({\n endpoint: `orders/`,\n method: 'GET',\n filters: filters,\n performAction: false,\n });\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n if (searchParams?.toString()) {\n const dynamicFilters: Array<{\n field: string;\n op: string;\n value: string | null;\n }> = [];\n searchParams?.forEach((value, key) => {\n if (key === 'order') {\n dynamicFilters.push({\n field: 'gsit_order_id',\n op: '=',\n value: value,\n });\n } else {\n dynamicFilters.push({\n field: key,\n op: '=',\n value: value,\n });\n }\n });\n setFilters(dynamicFilters);\n if (filters) {\n setShouldPerformExternal(true);\n setOrderId(fetchedDataExternal?.data[0]?.id);\n }\n } else {\n const paths = location.pathname.split('/');\n setOrderId(paths[paths?.length - 1]);\n }\n }, [location.search, loadingExternal]);\n\n const {\n data: fetchedData,\n loading,\n setShouldPerformAction: orderUpdate,\n } = useApiHook<{\n data: OrdersType[];\n }>({\n endpoint: `orders/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n\n //Order status api\n const {\n data: fetchedStatusData,\n loading: statusDataLoading,\n setShouldPerformAction: setLivePerformAction,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/get_live_status/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n const { data: fetchedDepotData, loading: depotDataLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/depot/`,\n method: 'GET',\n filters: [{ field: 'visibility', op: '=', value: true }],\n //@ts-ignore\n pagination: { is_pagination: false },\n });\n useEffect(() => {\n if (orderId) {\n orderUpdate(recallOrders);\n liveRecalling ? setLivePerformAction(false) : setLivePerformAction(true);\n }\n }, [orderId, liveRecalling, recallOrders]);\n\n useEffect(() => {\n setLoading(loading);\n if (fetchedData && fetchedData.data) {\n const requiredData = fetchedData?.data;\n\n if (requiredData[0]?.order_type?.type && requiredData[0]?.order_type?.type !== 'return') {\n navigate(`/orders/view/${orderId}`, { replace: true });\n return;\n }\n \n setOrderDetails(requiredData[0]);\n //@ts-ignore\n setCUstomerId(requiredData[0]?.customer_id);\n setRouteId(requiredData[0]?.order_routes?.route_id);\n //@ts-ignore\n setGsitOrderId(requiredData[0]?.gsit_order_id);\n //@ts-ignore\n setOrderProductId(requiredData[0]?.id);\n setCustomerInfo({\n recipient_name:\n requiredData[0]?.order_recipient?.recipient_name ?? null,\n postcode: requiredData[0]?.order_recipient?.postcode ?? null,\n return_action: requiredData[0]?.return_action ?? null,\n });\n\n setPrevOrderDetails(requiredData[0]);\n\n //dbSync Api call\n if (fetchedData?.data[0]?.gsit_order_id) {\n localStorage.setItem(\n 'dbSyncAPICall',\n JSON.stringify({\n status: true,\n gsit_orderId: fetchedData?.data[0]?.gsit_order_id,\n })\n );\n } else {\n localStorage.setItem('dbSyncAPICall', JSON.stringify({}));\n }\n }\n return () => {\n localStorage.removeItem('dbSyncAPICall');\n };\n }, [loading]);\n\n useEffect(() => {\n setLoading(statusDataLoading);\n if (fetchedStatusData && fetchedStatusData.data) {\n const requiredData = fetchedStatusData?.data;\n if (requiredData) {\n setOrderStatus(requiredData);\n } else {\n // setOrderStatus(null);\n }\n }\n }, [statusDataLoading, fetchedStatusData]);\n\n const {\n fetchData: callCLientApi,\n loading: clientLoading,\n data: clientData,\n } = useAxios<{\n data: ClientType[];\n }>({\n endpoint: `/v1/client/list`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n callCLientApi();\n callEscalationApi();\n }\n }, [orderId]);\n\n useEffect(() => {\n if (clientData && clientData?.data) {\n const res = clientData?.data;\n setClientData(res);\n }\n }, [clientLoading]);\n\n useEffect(() => {\n setLoading(depotDataLoading);\n if (fetchedDepotData && fetchedDepotData.data) {\n const requiredData = fetchedDepotData?.data;\n if (requiredData.length > 0) {\n const options = requiredData?.map((x: any) => {\n return {\n label: x.name,\n value: x.id,\n };\n });\n setDepotOptions(options);\n } else {\n setDepotOptions([]);\n }\n }\n }, [depotDataLoading]);\n\n // Order resources\n const {\n data: fetchedResourcesData,\n setShouldPerformAction: setActions,\n loading: loadingResources,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/${orderId}/order_resources/`,\n method: 'GET',\n performAction: false,\n showLoader: false,\n });\n\n useEffect(() => {\n if (orderId) {\n if (getResources) {\n setActions(false);\n setTimeout(() => {\n setActions(true);\n }, 200);\n } else {\n setActions(true);\n }\n }\n }, [orderId, setActions, getResources]);\n\n useEffect(() => {\n if (orderId) {\n setActions(true);\n }\n }, [orderId, setActions]);\n\n useEffect(() => {\n if (orderId) {\n setOrderResources(fetchedResourcesData);\n }\n }, [fetchedResourcesData, orderResources, setOrderResources]);\n\n //EPOD Images\n const {\n data: fetchedEpodImages,\n loading: epodLoading,\n fetchData: fetchEpodImages,\n } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `orders/${orderId}/epod_resources/?finance=false`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n fetchEpodImages();\n if (orderDetails?.order_recipient?.postcode != null) {\n callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n }\n }\n }, [orderId]);\n\n useEffect(() => {\n if (fetchedEpodImages && fetchedEpodImages?.data) {\n //@ts-ignore\n const result = fetchedEpodImages?.data?.resources;\n setEpodImages(result);\n }\n setSkeletonTomTom(epodLoading);\n }, [epodLoading]);\n\n useEffect(() => {\n return () => {\n setGsitCUstomerId((prev: any) => ({ ...prev, id: undefined }));\n };\n }, []);\n\n const {\n data: fetchedLocationData,\n loading: dataLoading,\n setShouldPerformAction: shouldFetch,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/return_locations/?customer_id=${GsitCUstomerId?.id}`,\n method: 'GET',\n performAction: false,\n });\n\n useEffect(() => {\n if (GsitCUstomerId?.id) {\n shouldFetch(true);\n } else {\n shouldFetch(false);\n }\n }, [GsitCUstomerId]);\n\n useEffect(() => {\n if (fetchedLocationData && fetchedLocationData?.data) {\n const locationOptions = fetchedLocationData?.data?.map((item: any) => {\n return {\n label: item?.location_name + ', ' + item?.postcode,\n value: item?.token,\n is_default: item?.is_default === 'True' ? true : false,\n };\n });\n setLocationOptions(locationOptions);\n }\n }, [dataLoading]);\n const [, setSystemLogsEvents] = useOrderProductSystemLogs();\n\n useEffect(() => {\n if (fetchedSystemLogsData && fetchedSystemLogsData?.data) {\n setSystemLogsEvents(fetchedSystemLogsData?.data);\n }\n }, [logsLoading]);\n\n useEffect(() => {\n if (gsitOrderId) {\n callSystemLogsAPI();\n }\n return () => {\n setGsitOrderId(undefined);\n };\n }, [order_id]);\n\n const { data: fetchedSubcontractotData, loading: apiLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/sub-contractor/sub_contractor/get/`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedSubcontractotData && fetchedSubcontractotData?.data) {\n const formattedData = fetchedSubcontractotData?.data?.map(\n (item: any) => ({\n id: item.id,\n name: item.name,\n })\n );\n setSubContracterData(formattedData);\n }\n }, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);\n\n // ESCALATIONS API\n\n const {\n data: fetchedEscalationData,\n fetchData: callEscalationApi,\n loading: escalationDataLoading,\n } = useAxios<{\n data: any;\n }>({\n endpoint: `/orders/escalations/${orderId}`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedEscalationData?.data) {\n const escalationData = fetchedEscalationData?.data;\n const sortedEscData = escalationData?.sort(\n (a: any, b: any) =>\n new Date(b?.created_at).getTime() - new Date(a?.created_at).getTime()\n );\n const showEsc = sortedEscData != null && sortedEscData.length > 0;\n showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);\n }\n }, [escalationDataLoading]);\n\n const docTitle = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n const environment = getEnvironment();\n const { fetchData: callCheckPostcode } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/orders/customs/postcode/check/`,\n method: 'GET',\n });\n\n //northern southern\n const callCheckPostcodeAPI = async () => {\n try {\n const response = await callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n //@ts-ignore\n if (response?.code === 200) {\n //@ts-ignore\n const isNorthSouth = response?.data?.order_customs_postcodes;\n setIsNorthSouth(isNorthSouth);\n } else {\n message.open({\n type: 'error',\n //@ts-ignore\n content: response?.error || 'Something went wrong',\n });\n }\n } catch (err) {\n message.open({\n type: 'error',\n content: `Failed to check ${POSTCODE_LABEL.toLowerCase()}. Please try again.`,\n });\n }\n };\n const POSTCODE_REGEX = {\n UK: /\\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\\b/,\n IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,\n US: /^\\d{5}(-\\d{4})?$/,\n };\n const isDevelopmentOrStagingOrReleaseUK =\n environment === 'development' ||\n environment === 'staging' ||\n environment === 'release_uk';\n const isValidPostcode = (val: any) => {\n if (isDevelopmentOrStagingOrReleaseUK) {\n return POSTCODE_REGEX.UK.test(val) || POSTCODE_REGEX.IRISH.test(val);\n } else {\n return POSTCODE_REGEX.US.test(val);\n }\n };\n const hasCalledInitialAPI = useRef(false);\n\n useEffect(() => {\n const currentPostcode = orderDetails?.order_recipient?.postcode?.trim();\n\n if (\n currentPostcode &&\n isValidPostcode(currentPostcode) &&\n !hasCalledInitialAPI.current\n ) {\n hasCalledInitialAPI.current = true;\n callCheckPostcodeAPI();\n }\n }, [orderDetails?.order_recipient?.postcode]);\n return (\n <MainContainer>\n <DocumentTitle title={docTitle} />\n <GeneralHeader statusDataLoading={statusDataLoading} />\n\n <DetailsFilters />\n <Notification />\n <OrderDetails\n orderLoading={loading}\n depotDataLoading={depotDataLoading}\n />\n <ProductsInfo locationloading={locationloading} />\n <SplitLayout>\n <NotesContainer>\n <Notes />\n </NotesContainer>\n <TablesContainer>\n <Order loading={loadingResources} />\n {!clientPortal && <Toolbox />}\n\n <SystemLogs loading={logsLoading} />\n </TablesContainer>\n </SplitLayout>\n <OrderActions />\n </MainContainer>\n );\n}\n\nconst MainContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding-bottom: 30px;\n`;\n\nconst SplitLayout = styled.div`\n display: flex;\n gap: 15px;\n @media (max-width: 1024px) {\n display: contents;\n }\n`;\n\nconst NotesContainer = styled.div`\n flex: 1;\n`;\n\nconst TablesContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nexport default OrderView;\n"],"names":["OrderView","locationloading","notification","orderId","setOrderId","useOrderId","gsitOrderId","setGsitOrderId","useGsitOrderId","orderDetails","setOrderDetails","useOrderDetails","setPrevOrderDetails","usePrevOrderDetails","setLoading","useState","setOrderStatus","useStatusDetails","setDepotOptions","useDepotOptions","customerInfo","setCustomerInfo","useCustomerInfo","setLocationOptions","useLocationOptions","orderResources","setOrderResources","useOrderProductsResources","GsitCUstomerId","setGsitCUstomerId","useGsitCUstomerId","setOrderProductId","useOrderProductId","setCUstomerId","useCUstomerId","setRouteId","useRouteId","liveRecalling","useLiveRecalling","setSubContracterData","useSubContracterData","recallOrders","useGlobalStateHitOrder","setStatusVal","useAllOrderStatus","order_id","getResources","useAtom","setResourcesCall","setClientData","usegetClientData","setGlobalEscData","useGlobalEscData","setIsNorthSouth","useIsShowNorthSouth","setEpodImages","useEpodImages","setSkeletonTomTom","skeletonTomTom","clientPortal","useClientPortal","useEffect","fetchedSystemLogsData","callSystemLogsAPI","logsLoading","useAxios","location","useLocation","navigate","useNavigate","filters","setFilters","fetchedDataExternal","loadingExternal","setShouldPerformExternal","useApiHook","searchParams","dynamicFilters","value","key","paths","fetchedData","loading","orderUpdate","fetchedStatusData","statusDataLoading","setLivePerformAction","fetchedDepotData","depotDataLoading","requiredData","callCLientApi","clientLoading","clientData","callEscalationApi","res","options","x","fetchedResourcesData","setActions","loadingResources","fetchedEpodImages","epodLoading","fetchEpodImages","callCheckPostcode","result","prev","fetchedLocationData","dataLoading","shouldFetch","locationOptions","item","setSystemLogsEvents","useOrderProductSystemLogs","fetchedSubcontractotData","apiLoading","formattedData","fetchedEscalationData","escalationDataLoading","sortedEscData","a","b","showEsc","docTitle","environment","getEnvironment","callCheckPostcodeAPI","response","isNorthSouth","message","POSTCODE_LABEL","POSTCODE_REGEX","isDevelopmentOrStagingOrReleaseUK","isValidPostcode","val","hasCalledInitialAPI","useRef","currentPostcode","MainContainer","jsx","DocumentTitle","GeneralHeader","DetailsFilters","Notification","OrderDetails","ProductsInfo","SplitLayout","NotesContainer","Notes","TablesContainer","Order","Toolbox","SystemLogs","OrderActions","styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAASA,GAAU,EAAE,iBAAAC,KAAwB;AAC3C,EAAAC,GA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,IAAA,EACC,UAAA;AAAA,QAAA,gBAAAV,EAACW,IAAA,EAAM,SAASlD,GAAA,CAAkB;AAAA,QACjC,CAACxC,MAAgB,gBAAA+E,EAACY,IAAA,EAAQ;AAAA,QAE3B,gBAAAZ,EAACa,IAAA,EAAW,SAASvF,EAAA,CAAa;AAAA,MAAA,EAAA,CACpC;AAAA,IAAA,GACF;AAAA,sBACCwF,IAAA,CAAA,CAAa;AAAA,EAAA,GAChB;AAEJ;AAEA,MAAMf,KAAgBgB,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBR,KAAcQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBP,KAAiBO,EAAO;AAAA;AAAA,GAIxBL,KAAkBK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/order-view/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport OrderDetails from './order-details';\nimport Notes from './notes';\nimport SystemLogs from './system-event-logs/expanded-content';\nimport GeneralHeader from './general-information';\nimport ProductsInfo from './products-info';\nimport OrderActions from './order-actions';\nimport {\n DocumentTitle,\n useApiHook,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport {\n useOrderDetails,\n // useOrderStaticData,\n useStatusDetails,\n useOrderId,\n useDepotOptions,\n usePrevOrderDetails,\n useOrderProductsResources,\n useCustomerInfo,\n useLocationOptions,\n useOrderProductSystemLogs,\n useGsitCUstomerId,\n useCUstomerId,\n useRouteId,\n useGsitOrderId,\n useOrderProductId,\n useLiveRecalling,\n useGlobalStateHitOrder,\n useAtom,\n usegetClientData,\n useGlobalEscData,\n useEpodImages,\n skeletonTomTom,\n} from './store';\nimport { OrdersType } from './types';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { message, notification } from 'antd';\nimport DetailsFilters from './details-filters/DetailsFilters';\nimport {\n useClientPortal,\n useIsShowNorthSouth,\n useSubContracterData,\n} from '../store';\nimport Notification from './notification';\nimport Order from './order-resources/expanded-content';\nimport { setResourcesCall, useAllOrderStatus } from './order-actions/store';\nimport { ClientType } from '../order-daily-overview/common/interface';\nimport { POSTCODE_LABEL } from '../../common/utils';\nimport { getEnvironment } from './utils';\nimport Toolbox from './toolbox-resources/expanded-content';\n\ninterface ApiResponse {\n message: string;\n code: number;\n error: string | null;\n error_traceback: string | null;\n data: [];\n setShouldPerformAction: boolean;\n}\n\nfunction OrderView({ locationloading }: any) {\n notification.config({\n top: 150,\n });\n const [orderId, setOrderId] = useOrderId();\n const [gsitOrderId, setGsitOrderId] = useGsitOrderId();\n // For API Call\n const [orderDetails, setOrderDetails] = useOrderDetails();\n const [, setPrevOrderDetails] = usePrevOrderDetails();\n const [, setLoading] = useState<boolean>(false);\n const [, setOrderStatus] = useStatusDetails();\n const [, setDepotOptions] = useDepotOptions();\n const [customerInfo, setCustomerInfo] = useCustomerInfo();\n const [, setLocationOptions] = useLocationOptions();\n const [orderResources, setOrderResources] = useOrderProductsResources();\n const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();\n const [, setOrderProductId] = useOrderProductId();\n const [, setCUstomerId] = useCUstomerId();\n const [, setRouteId] = useRouteId();\n const [liveRecalling] = useLiveRecalling();\n const [, setSubContracterData] = useSubContracterData();\n const [recallOrders] = useGlobalStateHitOrder();\n const [, setStatusVal] = useAllOrderStatus();\n const order_id = orderDetails?.id;\n const [getResources] = useAtom(setResourcesCall);\n const [, setClientData] = usegetClientData();\n const [, setGlobalEscData] = useGlobalEscData();\n const [, setIsNorthSouth] = useIsShowNorthSouth();\n const [, setEpodImages] = useEpodImages();\n const [, setSkeletonTomTom] = useAtom(skeletonTomTom);\n const [clientPortal] = useClientPortal();\n\n useEffect(() => {\n setStatusVal(orderDetails?.status_value);\n }, [orderDetails?.status_value]);\n\n //get system event logs\n const {\n data: fetchedSystemLogsData,\n fetchData: callSystemLogsAPI,\n loading: logsLoading,\n } = useAxios<{\n data: any[];\n }>({\n endpoint: `/events/get/event/`,\n method: 'GET',\n pagination: { page: 1, per_page: 100 },\n filters: [\n {\n field: 'order_id',\n op: '=',\n value: `${order_id}`,\n },\n ],\n showLoader: false,\n });\n\n // query param\n const location = useLocation();\n const navigate = useNavigate();\n const [filters, setFilters] = useState<\n Array<{ field: string; op: string; value: string | null }>\n >([]);\n\n // for third party apps\n const {\n data: fetchedDataExternal,\n loading: loadingExternal,\n setShouldPerformAction: setShouldPerformExternal,\n } = useApiHook<{\n data: any[];\n }>({\n endpoint: `orders/`,\n method: 'GET',\n filters: filters,\n performAction: false,\n });\n\n useEffect(() => {\n const searchParams = new URLSearchParams(location.search);\n if (searchParams?.toString()) {\n const dynamicFilters: Array<{\n field: string;\n op: string;\n value: string | null;\n }> = [];\n searchParams?.forEach((value, key) => {\n if (key === 'order') {\n dynamicFilters.push({\n field: 'gsit_order_id',\n op: '=',\n value: value,\n });\n } else {\n dynamicFilters.push({\n field: key,\n op: '=',\n value: value,\n });\n }\n });\n setFilters(dynamicFilters);\n if (filters) {\n setShouldPerformExternal(true);\n setOrderId(fetchedDataExternal?.data[0]?.id);\n }\n } else {\n const paths = location.pathname.split('/');\n setOrderId(paths[paths?.length - 1]);\n }\n }, [location.search, loadingExternal]);\n\n const {\n data: fetchedData,\n loading,\n setShouldPerformAction: orderUpdate,\n } = useApiHook<{\n data: OrdersType[];\n }>({\n endpoint: `orders/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n\n //Order status api\n const {\n data: fetchedStatusData,\n loading: statusDataLoading,\n setShouldPerformAction: setLivePerformAction,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/get_live_status/${orderId}`,\n method: 'GET',\n performAction: false,\n });\n const { data: fetchedDepotData, loading: depotDataLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/depot/`,\n method: 'GET',\n filters: [{ field: 'visibility', op: '=', value: true }],\n //@ts-ignore\n pagination: { is_pagination: false },\n });\n useEffect(() => {\n if (orderId) {\n orderUpdate(recallOrders);\n liveRecalling ? setLivePerformAction(false) : setLivePerformAction(true);\n }\n }, [orderId, liveRecalling, recallOrders]);\n\n useEffect(() => {\n setLoading(loading);\n if (fetchedData && fetchedData.data) {\n const requiredData = fetchedData?.data;\n\n if (requiredData[0]?.order_type?.type && requiredData[0]?.order_type?.type !== 'return') {\n navigate(`/orders/view/${orderId}`, { replace: true });\n return;\n }\n \n setOrderDetails(requiredData[0]);\n //@ts-ignore\n setCUstomerId(requiredData[0]?.customer_id);\n setRouteId(requiredData[0]?.order_routes?.route_id);\n //@ts-ignore\n setGsitOrderId(requiredData[0]?.gsit_order_id);\n //@ts-ignore\n setOrderProductId(requiredData[0]?.id);\n setCustomerInfo({\n recipient_name:\n requiredData[0]?.order_recipient?.recipient_name ?? null,\n postcode: requiredData[0]?.order_recipient?.postcode ?? null,\n return_action: requiredData[0]?.return_action ?? null,\n });\n\n setPrevOrderDetails(requiredData[0]);\n\n //dbSync Api call\n // if (fetchedData?.data[0]?.gsit_order_id) {\n // localStorage.setItem(\n // 'dbSyncAPICall',\n // JSON.stringify({\n // status: true,\n // gsit_orderId: fetchedData?.data[0]?.gsit_order_id,\n // })\n // );\n // } else {\n // localStorage.setItem('dbSyncAPICall', JSON.stringify({}));\n // }\n }\n // return () => {\n // localStorage.removeItem('dbSyncAPICall');\n // };\n }, [loading]);\n\n useEffect(() => {\n setLoading(statusDataLoading);\n if (fetchedStatusData && fetchedStatusData.data) {\n const requiredData = fetchedStatusData?.data;\n if (requiredData) {\n setOrderStatus(requiredData);\n } else {\n // setOrderStatus(null);\n }\n }\n }, [statusDataLoading, fetchedStatusData]);\n\n const {\n fetchData: callCLientApi,\n loading: clientLoading,\n data: clientData,\n } = useAxios<{\n data: ClientType[];\n }>({\n endpoint: `/v1/client/list`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n callCLientApi();\n callEscalationApi();\n }\n }, [orderId]);\n\n useEffect(() => {\n if (clientData && clientData?.data) {\n const res = clientData?.data;\n setClientData(res);\n }\n }, [clientLoading]);\n\n useEffect(() => {\n setLoading(depotDataLoading);\n if (fetchedDepotData && fetchedDepotData.data) {\n const requiredData = fetchedDepotData?.data;\n if (requiredData.length > 0) {\n const options = requiredData?.map((x: any) => {\n return {\n label: x.name,\n value: x.id,\n };\n });\n setDepotOptions(options);\n } else {\n setDepotOptions([]);\n }\n }\n }, [depotDataLoading]);\n\n // Order resources\n const {\n data: fetchedResourcesData,\n setShouldPerformAction: setActions,\n loading: loadingResources,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/orders/${orderId}/order_resources/`,\n method: 'GET',\n performAction: false,\n showLoader: false,\n });\n\n useEffect(() => {\n if (orderId) {\n if (getResources) {\n setActions(false);\n setTimeout(() => {\n setActions(true);\n }, 200);\n } else {\n setActions(true);\n }\n }\n }, [orderId, setActions, getResources]);\n\n useEffect(() => {\n if (orderId) {\n setActions(true);\n }\n }, [orderId, setActions]);\n\n useEffect(() => {\n if (orderId) {\n setOrderResources(fetchedResourcesData);\n }\n }, [fetchedResourcesData, orderResources, setOrderResources]);\n\n //EPOD Images\n const {\n data: fetchedEpodImages,\n loading: epodLoading,\n fetchData: fetchEpodImages,\n } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `orders/${orderId}/epod_resources/?finance=false`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (orderId) {\n fetchEpodImages();\n if (orderDetails?.order_recipient?.postcode != null) {\n callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n }\n }\n }, [orderId]);\n\n useEffect(() => {\n if (fetchedEpodImages && fetchedEpodImages?.data) {\n //@ts-ignore\n const result = fetchedEpodImages?.data?.resources;\n setEpodImages(result);\n }\n setSkeletonTomTom(epodLoading);\n }, [epodLoading]);\n\n useEffect(() => {\n return () => {\n setGsitCUstomerId((prev: any) => ({ ...prev, id: undefined }));\n };\n }, []);\n\n const {\n data: fetchedLocationData,\n loading: dataLoading,\n setShouldPerformAction: shouldFetch,\n } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/return_locations/?customer_id=${GsitCUstomerId?.id}`,\n method: 'GET',\n performAction: false,\n });\n\n useEffect(() => {\n if (GsitCUstomerId?.id) {\n shouldFetch(true);\n } else {\n shouldFetch(false);\n }\n }, [GsitCUstomerId]);\n\n useEffect(() => {\n if (fetchedLocationData && fetchedLocationData?.data) {\n const locationOptions = fetchedLocationData?.data?.map((item: any) => {\n return {\n label: item?.location_name + ', ' + item?.postcode,\n value: item?.token,\n is_default: item?.is_default === 'True' ? true : false,\n };\n });\n setLocationOptions(locationOptions);\n }\n }, [dataLoading]);\n const [, setSystemLogsEvents] = useOrderProductSystemLogs();\n\n useEffect(() => {\n if (fetchedSystemLogsData && fetchedSystemLogsData?.data) {\n setSystemLogsEvents(fetchedSystemLogsData?.data);\n }\n }, [logsLoading]);\n\n useEffect(() => {\n if (gsitOrderId) {\n callSystemLogsAPI();\n }\n return () => {\n setGsitOrderId(undefined);\n };\n }, [order_id]);\n\n const { data: fetchedSubcontractotData, loading: apiLoading } = useApiHook<{\n data: ApiResponse[];\n }>({\n endpoint: `/sub-contractor/sub_contractor/get/`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedSubcontractotData && fetchedSubcontractotData?.data) {\n const formattedData = fetchedSubcontractotData?.data?.map(\n (item: any) => ({\n id: item.id,\n name: item.name,\n })\n );\n setSubContracterData(formattedData);\n }\n }, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);\n\n // ESCALATIONS API\n\n const {\n data: fetchedEscalationData,\n fetchData: callEscalationApi,\n loading: escalationDataLoading,\n } = useAxios<{\n data: any;\n }>({\n endpoint: `/orders/escalations/${orderId}`,\n method: 'GET',\n });\n\n useEffect(() => {\n if (fetchedEscalationData?.data) {\n const escalationData = fetchedEscalationData?.data;\n const sortedEscData = escalationData?.sort(\n (a: any, b: any) =>\n new Date(b?.created_at).getTime() - new Date(a?.created_at).getTime()\n );\n const showEsc = sortedEscData != null && sortedEscData.length > 0;\n showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);\n }\n }, [escalationDataLoading]);\n\n const docTitle = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;\n const environment = getEnvironment();\n const { fetchData: callCheckPostcode } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/orders/customs/postcode/check/`,\n method: 'GET',\n });\n\n //northern southern\n const callCheckPostcodeAPI = async () => {\n try {\n const response = await callCheckPostcode({\n endPointQuery: `?postcode=${orderDetails?.order_recipient?.postcode}`,\n });\n //@ts-ignore\n if (response?.code === 200) {\n //@ts-ignore\n const isNorthSouth = response?.data?.order_customs_postcodes;\n setIsNorthSouth(isNorthSouth);\n } else {\n message.open({\n type: 'error',\n //@ts-ignore\n content: response?.error || 'Something went wrong',\n });\n }\n } catch (err) {\n message.open({\n type: 'error',\n content: `Failed to check ${POSTCODE_LABEL.toLowerCase()}. Please try again.`,\n });\n }\n };\n const POSTCODE_REGEX = {\n UK: /\\b(?:[A-Za-z][A-HJ-Ya-hj-y]?[0-9][0-9A-Za-z]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})\\b/,\n IRISH: /^(?:^[AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/,\n US: /^\\d{5}(-\\d{4})?$/,\n };\n const isDevelopmentOrStagingOrReleaseUK =\n environment === 'development' ||\n environment === 'staging' ||\n environment === 'release_uk';\n const isValidPostcode = (val: any) => {\n if (isDevelopmentOrStagingOrReleaseUK) {\n return POSTCODE_REGEX.UK.test(val) || POSTCODE_REGEX.IRISH.test(val);\n } else {\n return POSTCODE_REGEX.US.test(val);\n }\n };\n const hasCalledInitialAPI = useRef(false);\n\n useEffect(() => {\n const currentPostcode = orderDetails?.order_recipient?.postcode?.trim();\n\n if (\n currentPostcode &&\n isValidPostcode(currentPostcode) &&\n !hasCalledInitialAPI.current\n ) {\n hasCalledInitialAPI.current = true;\n callCheckPostcodeAPI();\n }\n }, [orderDetails?.order_recipient?.postcode]);\n return (\n <MainContainer>\n <DocumentTitle title={docTitle} />\n <GeneralHeader statusDataLoading={statusDataLoading} />\n\n <DetailsFilters />\n <Notification />\n <OrderDetails\n orderLoading={loading}\n depotDataLoading={depotDataLoading}\n />\n <ProductsInfo locationloading={locationloading} />\n <SplitLayout>\n <NotesContainer>\n <Notes />\n </NotesContainer>\n <TablesContainer>\n <Order loading={loadingResources} />\n {!clientPortal && <Toolbox />}\n\n <SystemLogs loading={logsLoading} />\n </TablesContainer>\n </SplitLayout>\n <OrderActions />\n </MainContainer>\n );\n}\n\nconst MainContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding-bottom: 30px;\n`;\n\nconst SplitLayout = styled.div`\n display: flex;\n gap: 15px;\n @media (max-width: 1024px) {\n display: contents;\n }\n`;\n\nconst NotesContainer = styled.div`\n flex: 1;\n`;\n\nconst TablesContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 15px;\n`;\n\nexport default OrderView;\n"],"names":["OrderView","locationloading","notification","orderId","setOrderId","useOrderId","gsitOrderId","setGsitOrderId","useGsitOrderId","orderDetails","setOrderDetails","useOrderDetails","setPrevOrderDetails","usePrevOrderDetails","setLoading","useState","setOrderStatus","useStatusDetails","setDepotOptions","useDepotOptions","customerInfo","setCustomerInfo","useCustomerInfo","setLocationOptions","useLocationOptions","orderResources","setOrderResources","useOrderProductsResources","GsitCUstomerId","setGsitCUstomerId","useGsitCUstomerId","setOrderProductId","useOrderProductId","setCUstomerId","useCUstomerId","setRouteId","useRouteId","liveRecalling","useLiveRecalling","setSubContracterData","useSubContracterData","recallOrders","useGlobalStateHitOrder","setStatusVal","useAllOrderStatus","order_id","getResources","useAtom","setResourcesCall","setClientData","usegetClientData","setGlobalEscData","useGlobalEscData","setIsNorthSouth","useIsShowNorthSouth","setEpodImages","useEpodImages","setSkeletonTomTom","skeletonTomTom","clientPortal","useClientPortal","useEffect","fetchedSystemLogsData","callSystemLogsAPI","logsLoading","useAxios","location","useLocation","navigate","useNavigate","filters","setFilters","fetchedDataExternal","loadingExternal","setShouldPerformExternal","useApiHook","searchParams","dynamicFilters","value","key","paths","fetchedData","loading","orderUpdate","fetchedStatusData","statusDataLoading","setLivePerformAction","fetchedDepotData","depotDataLoading","requiredData","callCLientApi","clientLoading","clientData","callEscalationApi","res","options","x","fetchedResourcesData","setActions","loadingResources","fetchedEpodImages","epodLoading","fetchEpodImages","callCheckPostcode","result","prev","fetchedLocationData","dataLoading","shouldFetch","locationOptions","item","setSystemLogsEvents","useOrderProductSystemLogs","fetchedSubcontractotData","apiLoading","formattedData","fetchedEscalationData","escalationDataLoading","sortedEscData","a","b","showEsc","docTitle","environment","getEnvironment","callCheckPostcodeAPI","response","isNorthSouth","message","POSTCODE_LABEL","POSTCODE_REGEX","isDevelopmentOrStagingOrReleaseUK","isValidPostcode","val","hasCalledInitialAPI","useRef","currentPostcode","MainContainer","jsx","DocumentTitle","GeneralHeader","DetailsFilters","Notification","OrderDetails","ProductsInfo","SplitLayout","NotesContainer","Notes","TablesContainer","Order","Toolbox","SystemLogs","OrderActions","styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAASA,GAAU,EAAE,iBAAAC,KAAwB;AAC3C,EAAAC,GAAa,OAAO;AAAA,IAClB,KAAK;AAAA,EAAA,CACN;AACD,QAAM,CAACC,GAASC,CAAU,IAAIC,GAAA,GACxB,CAACC,GAAaC,CAAc,IAAIC,GAAA,GAEhC,CAACC,GAAcC,CAAe,IAAIC,GAAA,GAClC,CAAA,EAAGC,EAAmB,IAAIC,GAAA,GAC1B,GAAGC,CAAU,IAAIC,EAAkB,EAAK,GACxC,CAAA,EAAGC,EAAc,IAAIC,GAAA,GACrB,CAAA,EAAGC,CAAe,IAAIC,GAAA,GACtB,CAACC,GAAcC,EAAe,IAAIC,GAAA,GAClC,CAAA,EAAGC,EAAkB,IAAIC,G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