@bjsdistribution/dms-client-return 0.1.7-prod → 0.1.8-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/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
- package/dist/components/order-view/products-info/expanded-content/index.d.ts +4 -1
- package/dist/components/order-view/return-client-products/ProductTable.d.ts +4 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +4 -1
- package/dist/components/order-view/store.d.ts +14 -2
- package/dist/components/order-view/types.d.ts +49 -1
- package/dist/components/order-view/utils.d.ts +3 -0
- package/dist/dms-client-return.cjs.development.js +2636 -335
- 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 +2700 -399
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +5 -3
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +24 -11
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/index.tsx +29 -0
- package/src/components/order-view/notes/AddNote.tsx +14 -34
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
- package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
- package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
- package/src/components/order-view/order-actions/index.tsx +10 -0
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +27 -11
- package/src/components/order-view/products-info/index.tsx +4 -4
- package/src/components/order-view/return-client-products/ProductTable.tsx +6 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +54 -15
- package/src/components/order-view/store.ts +106 -0
- package/src/components/order-view/types.ts +54 -1
- package/src/components/order-view/utils.ts +37 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
CurrencySymbol,
|
|
5
|
+
FieldRow,
|
|
6
|
+
Input,
|
|
7
|
+
MainContainer,
|
|
8
|
+
Title,
|
|
9
|
+
} from '../../styles';
|
|
10
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
11
|
+
import { useChargesState } from '../../../../../store';
|
|
12
|
+
|
|
13
|
+
function AdhocSection() {
|
|
14
|
+
const [charges, setCharges] = useChargesState();
|
|
15
|
+
const [inputValues, setInputValues] = useState<any>(charges?.adhoc_charges);
|
|
16
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
17
|
+
|
|
18
|
+
const handleLabelChange = (id: string, newLabel: string) => {
|
|
19
|
+
setCharges(prev => ({
|
|
20
|
+
...prev,
|
|
21
|
+
adhoc_charges: prev.adhoc_charges.map(charge =>
|
|
22
|
+
charge.id === id
|
|
23
|
+
? { ...charge, adhoc_charges_description: newLabel }
|
|
24
|
+
: charge
|
|
25
|
+
),
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleValueChange = (id: string, value: string) => {
|
|
30
|
+
setInputValues((prev: any) => ({
|
|
31
|
+
...prev,
|
|
32
|
+
[id]: value,
|
|
33
|
+
}));
|
|
34
|
+
let val = parseFloat(value);
|
|
35
|
+
if (value === '') {
|
|
36
|
+
setCharges(prev => ({
|
|
37
|
+
...prev,
|
|
38
|
+
adhoc_charges: prev.adhoc_charges.map(charge =>
|
|
39
|
+
charge.id === id ? { ...charge, adhoc_charges: 0 } : charge
|
|
40
|
+
),
|
|
41
|
+
}));
|
|
42
|
+
} else if (!isNaN(val)) {
|
|
43
|
+
val = val >= 0 ? val : 0;
|
|
44
|
+
setCharges(prev => ({
|
|
45
|
+
...prev,
|
|
46
|
+
adhoc_charges: prev.adhoc_charges.map(charge =>
|
|
47
|
+
charge.id === id ? { ...charge, adhoc_charges: val } : charge
|
|
48
|
+
),
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<MainContainer>
|
|
55
|
+
<Title>Adhoc</Title>
|
|
56
|
+
<Container>
|
|
57
|
+
{charges?.adhoc_charges?.map(item => {
|
|
58
|
+
return (
|
|
59
|
+
<FieldRow key={item.id}>
|
|
60
|
+
<Input
|
|
61
|
+
placeholder=""
|
|
62
|
+
value={item.adhoc_charges_description}
|
|
63
|
+
onChange={(e: any) =>
|
|
64
|
+
handleLabelChange(item.id, e.target.value)
|
|
65
|
+
}
|
|
66
|
+
style={{ marginRight: '8px', flex: 1 }}
|
|
67
|
+
/>
|
|
68
|
+
<div
|
|
69
|
+
style={{ display: 'flex', gap: '3px', alignItems: 'center' }}
|
|
70
|
+
>
|
|
71
|
+
<CurrencySymbol>{baseUrlSymbol}</CurrencySymbol>
|
|
72
|
+
<Input
|
|
73
|
+
type="number"
|
|
74
|
+
min={0}
|
|
75
|
+
max={10000}
|
|
76
|
+
placeholder="0.00"
|
|
77
|
+
onWheel={(e: any) => e.target.blur()}
|
|
78
|
+
value={inputValues[item.id] ?? ''}
|
|
79
|
+
onChange={(e: any) =>
|
|
80
|
+
handleValueChange(item.id, e.target.value)
|
|
81
|
+
}
|
|
82
|
+
style={{ flex: 1 }}
|
|
83
|
+
onKeyDown={handleKeyDownDebrief}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</FieldRow>
|
|
87
|
+
);
|
|
88
|
+
})}
|
|
89
|
+
</Container>
|
|
90
|
+
</MainContainer>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default AdhocSection;
|
package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
// Container,
|
|
4
|
+
FieldRow,
|
|
5
|
+
Input,
|
|
6
|
+
Label,
|
|
7
|
+
MainContainer,
|
|
8
|
+
Title,
|
|
9
|
+
} from '../../styles';
|
|
10
|
+
import { AntSelect } from '@bjsdistribution/dms-component-library';
|
|
11
|
+
import styled from 'styled-components';
|
|
12
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
13
|
+
import { useChargesState } from '../../../../../store';
|
|
14
|
+
import { ChargesType } from '../../../../../types';
|
|
15
|
+
|
|
16
|
+
interface IProps {
|
|
17
|
+
inputValue: Record<string, string>;
|
|
18
|
+
setInputValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
19
|
+
staticData: any;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function BaseCharges(props: IProps) {
|
|
23
|
+
const [chargesState, setCharges] = useChargesState();
|
|
24
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
25
|
+
|
|
26
|
+
// const [inputValue, setInputValue] = useState<Record<string, string>>({});
|
|
27
|
+
const handleChange = (field: string, value: string) => {
|
|
28
|
+
props?.setInputValue((prev: any) => ({
|
|
29
|
+
...prev,
|
|
30
|
+
[field]: value,
|
|
31
|
+
}));
|
|
32
|
+
let val = parseFloat(value);
|
|
33
|
+
if (value === '') {
|
|
34
|
+
setCharges(prev => ({
|
|
35
|
+
...prev,
|
|
36
|
+
[field]: 0,
|
|
37
|
+
}));
|
|
38
|
+
} else if (!isNaN(val)) {
|
|
39
|
+
val = val >= 0 ? val : 0;
|
|
40
|
+
setCharges(prev => ({
|
|
41
|
+
...prev,
|
|
42
|
+
[field]: val,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const onChange = (val: string) => {
|
|
48
|
+
setCharges((charge: ChargesType) => ({
|
|
49
|
+
...charge,
|
|
50
|
+
base_charge_type: +val,
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const baseChargeOptions = props?.staticData?.base_charges?.map((x: any) => {
|
|
55
|
+
return {
|
|
56
|
+
label: x?.type,
|
|
57
|
+
value: x?.id,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<MainContainer>
|
|
63
|
+
<Title>Base Charge</Title>
|
|
64
|
+
<Wrapper>
|
|
65
|
+
<FieldRow>
|
|
66
|
+
<Label style={{ width: '90px' }}>Base Charge</Label>
|
|
67
|
+
<div style={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
|
|
68
|
+
<AntSelect
|
|
69
|
+
onChange={onChange}
|
|
70
|
+
options={baseChargeOptions || []}
|
|
71
|
+
placeholder="Base charge type"
|
|
72
|
+
defaultValue={baseChargeOptions?.filter(
|
|
73
|
+
(x: any) => x?.value === chargesState?.base_charge_type
|
|
74
|
+
)}
|
|
75
|
+
style={{ width: 100 }}
|
|
76
|
+
/>
|
|
77
|
+
<CurrencyWrapper>{baseUrlSymbol}</CurrencyWrapper>
|
|
78
|
+
<Input
|
|
79
|
+
min={0}
|
|
80
|
+
max={10000}
|
|
81
|
+
type="number"
|
|
82
|
+
placeholder="0.00"
|
|
83
|
+
onWheel={(e: any) => e.target.blur()}
|
|
84
|
+
value={props?.inputValue['base_charge'] ?? ''}
|
|
85
|
+
onChange={(e: any) => handleChange('base_charge', e.target.value)}
|
|
86
|
+
onKeyDown={handleKeyDownDebrief}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
</FieldRow>
|
|
90
|
+
</Wrapper>
|
|
91
|
+
</MainContainer>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const Wrapper = styled.div`
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
const CurrencyWrapper = styled.div`
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
color: #999;
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
export default BaseCharges;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
CurrencySymbol,
|
|
5
|
+
FieldRow,
|
|
6
|
+
Input,
|
|
7
|
+
Label,
|
|
8
|
+
MainContainer,
|
|
9
|
+
Title,
|
|
10
|
+
} from '../../styles';
|
|
11
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
12
|
+
import { useChargesState } from '../../../../../store';
|
|
13
|
+
|
|
14
|
+
const fields = [
|
|
15
|
+
{ label: 'Repackage', value: 're_package' },
|
|
16
|
+
{ label: 'Disassemble', value: 'disassemble' },
|
|
17
|
+
{ label: 'QC', value: 'collection_qc' },
|
|
18
|
+
{ label: 'Return to Client', value: 'return_to_client' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
interface IProps {
|
|
22
|
+
inputValue: Record<string, string>;
|
|
23
|
+
setInputValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function CollectionAddOns(props: IProps) {
|
|
27
|
+
const [, setCharges] = useChargesState();
|
|
28
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
29
|
+
|
|
30
|
+
const handleChange = (field: string, value: string) => {
|
|
31
|
+
props?.setInputValue((prev: any) => ({
|
|
32
|
+
...prev,
|
|
33
|
+
[field]: value,
|
|
34
|
+
}));
|
|
35
|
+
let val = parseFloat(value);
|
|
36
|
+
if (isNaN(val)) {
|
|
37
|
+
setCharges(prev => ({
|
|
38
|
+
...prev,
|
|
39
|
+
[field]: 0,
|
|
40
|
+
}));
|
|
41
|
+
} else {
|
|
42
|
+
val = val >= 0 ? val : 0;
|
|
43
|
+
setCharges(prev => ({
|
|
44
|
+
...prev,
|
|
45
|
+
[field]: val,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<MainContainer>
|
|
52
|
+
<Title>Collection Add-Ons</Title>
|
|
53
|
+
<Container>
|
|
54
|
+
{fields.map((item: any) => (
|
|
55
|
+
<FieldRow key={item.value}>
|
|
56
|
+
<Label>{item.label}</Label>
|
|
57
|
+
<div style={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
|
|
58
|
+
<CurrencySymbol>{baseUrlSymbol}</CurrencySymbol>
|
|
59
|
+
<Input
|
|
60
|
+
min={0}
|
|
61
|
+
max={10000}
|
|
62
|
+
type="number"
|
|
63
|
+
placeholder="0.00"
|
|
64
|
+
onWheel={(e: any) => e.target.blur()}
|
|
65
|
+
value={props?.inputValue[item.value] ?? ''}
|
|
66
|
+
onChange={(e: any) => handleChange(item.value, e.target.value)}
|
|
67
|
+
onKeyDown={handleKeyDownDebrief}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</FieldRow>
|
|
71
|
+
))}
|
|
72
|
+
</Container>
|
|
73
|
+
</MainContainer>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default CollectionAddOns;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
CurrencySymbol,
|
|
5
|
+
FieldRow,
|
|
6
|
+
Input,
|
|
7
|
+
Label,
|
|
8
|
+
MainContainer,
|
|
9
|
+
Title,
|
|
10
|
+
} from '../../styles';
|
|
11
|
+
|
|
12
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
13
|
+
import { useChargesState } from '../../../../../store';
|
|
14
|
+
|
|
15
|
+
const fields = ['ROC', 'Unpack', 'Packaging Disposal', 'Assembly', 'QC'];
|
|
16
|
+
|
|
17
|
+
interface IProps {
|
|
18
|
+
inputValue: Record<string, string>;
|
|
19
|
+
setInputValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function DeliveryAddOns(props: IProps) {
|
|
23
|
+
const [, setCharges] = useChargesState();
|
|
24
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
25
|
+
|
|
26
|
+
const fieldsInLabelValueFormat = fields.map(field => ({
|
|
27
|
+
label: field,
|
|
28
|
+
value: field.toLowerCase().replace(/ /g, '_'), // You can adjust this to your preference
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
const handleChange = (field: string, value: string) => {
|
|
32
|
+
props?.setInputValue((prev: any) => ({
|
|
33
|
+
...prev,
|
|
34
|
+
[field]: value,
|
|
35
|
+
}));
|
|
36
|
+
let val = parseFloat(value);
|
|
37
|
+
if (isNaN(val)) {
|
|
38
|
+
setCharges(prev => ({
|
|
39
|
+
...prev,
|
|
40
|
+
[field]: 0,
|
|
41
|
+
}));
|
|
42
|
+
} else {
|
|
43
|
+
val = val >= 0 ? val : 0;
|
|
44
|
+
setCharges(prev => ({
|
|
45
|
+
...prev,
|
|
46
|
+
[field]: val,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<MainContainer>
|
|
53
|
+
<Title>Delivery Add-Ons</Title>
|
|
54
|
+
<Container>
|
|
55
|
+
{fieldsInLabelValueFormat.map((item: any) => (
|
|
56
|
+
<FieldRow key={item.value}>
|
|
57
|
+
<Label>{item.label}</Label>
|
|
58
|
+
<div style={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
|
|
59
|
+
<CurrencySymbol>{baseUrlSymbol}</CurrencySymbol>
|
|
60
|
+
<Input
|
|
61
|
+
min={0}
|
|
62
|
+
max={10000}
|
|
63
|
+
type="number"
|
|
64
|
+
placeholder="0.00"
|
|
65
|
+
onWheel={(e: any) => e.target.blur()}
|
|
66
|
+
value={props?.inputValue[item.value] ?? ''}
|
|
67
|
+
onKeyDown={handleKeyDownDebrief}
|
|
68
|
+
onChange={(e: any) => handleChange(item.value, e.target.value)}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</FieldRow>
|
|
72
|
+
))}
|
|
73
|
+
</Container>
|
|
74
|
+
</MainContainer>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default DeliveryAddOns;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
CurrencySymbol,
|
|
5
|
+
FieldRow,
|
|
6
|
+
Input,
|
|
7
|
+
Label,
|
|
8
|
+
MainContainer,
|
|
9
|
+
Title,
|
|
10
|
+
} from '../../styles';
|
|
11
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
12
|
+
import { useChargesState } from '../../../../../store';
|
|
13
|
+
|
|
14
|
+
const fields = [
|
|
15
|
+
{ label: 'Disposal & Recycling', value: 'disposal_recycling' },
|
|
16
|
+
{ label: 'Disposal Only', value: 'disposal' },
|
|
17
|
+
{ label: 'Recycle Only', value: 'recycle' },
|
|
18
|
+
{ label: 'Admin', value: 'admin' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
interface IProps {
|
|
22
|
+
inputValue: Record<string, string>;
|
|
23
|
+
setInputValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function DisposalCharge(props: IProps) {
|
|
27
|
+
const [, setCharges] = useChargesState();
|
|
28
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
29
|
+
|
|
30
|
+
const handleChange = (field: string, value: string) => {
|
|
31
|
+
props?.setInputValue((prev: any) => ({
|
|
32
|
+
...prev,
|
|
33
|
+
[field]: value,
|
|
34
|
+
}));
|
|
35
|
+
let val = parseFloat(value);
|
|
36
|
+
if (isNaN(val)) {
|
|
37
|
+
setCharges(prev => ({
|
|
38
|
+
...prev,
|
|
39
|
+
[field]: 0,
|
|
40
|
+
}));
|
|
41
|
+
} else {
|
|
42
|
+
val = val >= 0 ? val : 0;
|
|
43
|
+
setCharges(prev => ({
|
|
44
|
+
...prev,
|
|
45
|
+
[field]: val,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<MainContainer>
|
|
52
|
+
<Title>Disposal Charges</Title>
|
|
53
|
+
<Container>
|
|
54
|
+
{fields.map((item: any) => (
|
|
55
|
+
<FieldRow key={item.value}>
|
|
56
|
+
<Label>{item.label}</Label>
|
|
57
|
+
<div style={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
|
|
58
|
+
<CurrencySymbol>{baseUrlSymbol}</CurrencySymbol>
|
|
59
|
+
<Input
|
|
60
|
+
min={0}
|
|
61
|
+
max={10000}
|
|
62
|
+
type="number"
|
|
63
|
+
placeholder="0.00"
|
|
64
|
+
onWheel={(e: any) => e.target.blur()}
|
|
65
|
+
value={props?.inputValue[item.value] ?? ''}
|
|
66
|
+
onChange={(e: any) => handleChange(item.value, e.target.value)}
|
|
67
|
+
onKeyDown={handleKeyDownDebrief}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</FieldRow>
|
|
71
|
+
))}
|
|
72
|
+
</Container>
|
|
73
|
+
</MainContainer>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default DisposalCharge;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
FieldRow,
|
|
5
|
+
Input,
|
|
6
|
+
Label,
|
|
7
|
+
MainContainer,
|
|
8
|
+
Title,
|
|
9
|
+
} from '../../styles';
|
|
10
|
+
// import { ChargesType } from '../../../../types';
|
|
11
|
+
|
|
12
|
+
import { getBaseUrlSymbol, handleKeyDownDebrief } from '../../../../../utils';
|
|
13
|
+
import {
|
|
14
|
+
useChargesState,
|
|
15
|
+
useOrderDetails,
|
|
16
|
+
useOrderStaticData,
|
|
17
|
+
} from '../../../../../store';
|
|
18
|
+
import { CurrencySymbol } from '../../styles';
|
|
19
|
+
import styled from 'styled-components';
|
|
20
|
+
|
|
21
|
+
const fields = [
|
|
22
|
+
{ label: 'Weight', value: 'weight' },
|
|
23
|
+
{ label: 'Drop Time', value: 'drop_time' },
|
|
24
|
+
{ label: 'Timed Services', value: 'timed_service' },
|
|
25
|
+
{ label: 'Wait Time', value: 'wait_time' },
|
|
26
|
+
{ label: 'Extra Floor', value: 'extra_floor' },
|
|
27
|
+
{ label: 'Bulk Items', value: 'bulky_items' },
|
|
28
|
+
{ label: 'Relabel (Pre-del)', value: 're_label' },
|
|
29
|
+
{ label: 'Extra CBM', value: 'extra_cube' },
|
|
30
|
+
{ label: 'Additional Box', value: 'additional_box' },
|
|
31
|
+
{ label: 'Additional Item', value: 'additional_item' },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
interface IProps {
|
|
35
|
+
inputValue: Record<string, string>;
|
|
36
|
+
setInputValue: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function OrderCharges(props: IProps) {
|
|
40
|
+
const [, setCharges] = useChargesState();
|
|
41
|
+
const [orderDetails] = useOrderDetails();
|
|
42
|
+
const [orderStaticData] = useOrderStaticData();
|
|
43
|
+
const weightVal = orderDetails?.weight;
|
|
44
|
+
const dropTime = orderDetails?.drop_time;
|
|
45
|
+
const cbm = orderDetails?.cube;
|
|
46
|
+
const timesServiceId = orderDetails?.order_services_detail?.timed_service_id;
|
|
47
|
+
const selectedTimedService = orderStaticData?.order_timed_services?.find(
|
|
48
|
+
(x: any) => x?.id === timesServiceId
|
|
49
|
+
);
|
|
50
|
+
const showSelectedTimedService =
|
|
51
|
+
selectedTimedService !== null && selectedTimedService !== undefined;
|
|
52
|
+
const showCbm = cbm !== undefined && cbm !== null && cbm > 0;
|
|
53
|
+
const showDropTime = dropTime !== undefined && dropTime !== null;
|
|
54
|
+
const showWeight = weightVal !== null && weightVal > 0;
|
|
55
|
+
const baseUrlSymbol = getBaseUrlSymbol();
|
|
56
|
+
|
|
57
|
+
const handleChange = (field: string, value: string) => {
|
|
58
|
+
props?.setInputValue((prev: any) => ({
|
|
59
|
+
...prev,
|
|
60
|
+
[field]: value,
|
|
61
|
+
}));
|
|
62
|
+
let val = parseFloat(value);
|
|
63
|
+
if (value === '') {
|
|
64
|
+
setCharges(prev => ({
|
|
65
|
+
...prev,
|
|
66
|
+
[field]: 0,
|
|
67
|
+
}));
|
|
68
|
+
} else if (!isNaN(val)) {
|
|
69
|
+
val = val >= 0 ? val : 0;
|
|
70
|
+
setCharges(prev => ({
|
|
71
|
+
...prev,
|
|
72
|
+
[field]: val,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<MainContainer>
|
|
79
|
+
<Title>Order Charges</Title>
|
|
80
|
+
<Container>
|
|
81
|
+
{fields?.map(item => (
|
|
82
|
+
<FieldRow key={item.value}>
|
|
83
|
+
<Label style={{ minWidth: '100px' }}>{item.label}</Label>
|
|
84
|
+
{showWeight && item?.value === 'weight' && (
|
|
85
|
+
<OrderValue>{weightVal} Kg</OrderValue>
|
|
86
|
+
)}
|
|
87
|
+
{showDropTime && item?.value === 'drop_time' && (
|
|
88
|
+
<OrderValue>{dropTime} mins</OrderValue>
|
|
89
|
+
)}
|
|
90
|
+
{showCbm && item?.value === 'extra_cube' && (
|
|
91
|
+
<OrderValue>
|
|
92
|
+
{cbm} (m<sup>3</sup>)
|
|
93
|
+
</OrderValue>
|
|
94
|
+
)}
|
|
95
|
+
{showSelectedTimedService && item?.value === 'timed_service' && (
|
|
96
|
+
<OrderValue>
|
|
97
|
+
{selectedTimedService?.type?.replaceAll('_', '')}
|
|
98
|
+
</OrderValue>
|
|
99
|
+
)}
|
|
100
|
+
<div style={{ display: 'flex', gap: '3px', alignItems: 'center' }}>
|
|
101
|
+
<CurrencySymbol>{baseUrlSymbol}</CurrencySymbol>
|
|
102
|
+
<Input
|
|
103
|
+
min={0}
|
|
104
|
+
max={10000}
|
|
105
|
+
type="number"
|
|
106
|
+
placeholder="0.00"
|
|
107
|
+
onWheel={(e: any) => e.target.blur()}
|
|
108
|
+
value={props?.inputValue[item.value] ?? ''}
|
|
109
|
+
onChange={(e: any) => handleChange(item.value, e.target.value)}
|
|
110
|
+
onKeyDown={handleKeyDownDebrief}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</FieldRow>
|
|
114
|
+
))}
|
|
115
|
+
</Container>
|
|
116
|
+
</MainContainer>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const OrderValue = styled.span`
|
|
121
|
+
color: #6396e5;
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
export default OrderCharges;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import {
|
|
4
|
+
dropdownStyles,
|
|
5
|
+
Label,
|
|
6
|
+
SelectDropdown,
|
|
7
|
+
} from '@bjsdistribution/dms-component-library';
|
|
8
|
+
import {
|
|
9
|
+
useEscalationCategory,
|
|
10
|
+
useFailureReason,
|
|
11
|
+
useOrderStaticData,
|
|
12
|
+
} from '../../../../store';
|
|
13
|
+
|
|
14
|
+
function EscalationCategory() {
|
|
15
|
+
const [orderStaticData] = useOrderStaticData();
|
|
16
|
+
const [escalationCategory, setEscalationCategory] = useEscalationCategory();
|
|
17
|
+
const [failureReason] = useFailureReason();
|
|
18
|
+
|
|
19
|
+
const faultNonFaultReasons = orderStaticData?.fault_non_fault_reasons;
|
|
20
|
+
const escalationTypes = orderStaticData?.escalation_types;
|
|
21
|
+
|
|
22
|
+
const escalationCategoryOptions = orderStaticData?.escalation_category?.map(
|
|
23
|
+
(category: any) => ({
|
|
24
|
+
label: category?.type,
|
|
25
|
+
value: category?.id,
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const escTypeId = faultNonFaultReasons?.find(
|
|
31
|
+
(x: any) => x?.order_reason_id === failureReason?.id
|
|
32
|
+
)?.escalation_type_id;
|
|
33
|
+
const escCategoryId = escalationTypes?.find((x: any) => x?.id === escTypeId)
|
|
34
|
+
?.escalation_category_id;
|
|
35
|
+
const selectedOption = escalationCategoryOptions?.find(
|
|
36
|
+
(option: any) => option?.value === escCategoryId
|
|
37
|
+
);
|
|
38
|
+
setEscalationCategory(selectedOption);
|
|
39
|
+
}, [failureReason]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Container>
|
|
43
|
+
<Label label="Escalation Category" />
|
|
44
|
+
<SelectDropdown
|
|
45
|
+
options={escalationCategoryOptions || []}
|
|
46
|
+
styles={{
|
|
47
|
+
...dropdownStyles,
|
|
48
|
+
control: (styles, state) => ({
|
|
49
|
+
...styles,
|
|
50
|
+
border: '1px solid #D0D5DD',
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
borderRadius: `${
|
|
53
|
+
state.selectProps.menuIsOpen ? '0px 0px 6px 6px' : '6px'
|
|
54
|
+
}`,
|
|
55
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
56
|
+
minHeight: '40px',
|
|
57
|
+
'&:hover': {
|
|
58
|
+
borderColor: '#D0D5DD',
|
|
59
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
menu: styles => ({
|
|
63
|
+
...styles,
|
|
64
|
+
marginBottom: '0px',
|
|
65
|
+
borderRadius: '6px 6px 0px 0px',
|
|
66
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
67
|
+
border: '1px solid #D0D5DD',
|
|
68
|
+
borderBottom: '0px',
|
|
69
|
+
}),
|
|
70
|
+
dropdownIndicator: (styles, state) => ({
|
|
71
|
+
...styles,
|
|
72
|
+
transition: 'all 0.3s ease-in-out',
|
|
73
|
+
transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'null',
|
|
74
|
+
}),
|
|
75
|
+
}}
|
|
76
|
+
placeholder="Select Category"
|
|
77
|
+
menuPlacement="top"
|
|
78
|
+
value={escalationCategory}
|
|
79
|
+
onChange={selectedOption => setEscalationCategory(selectedOption)}
|
|
80
|
+
/>
|
|
81
|
+
</Container>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const Container = styled.div`
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 8px;
|
|
89
|
+
flex: 1;
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
export default EscalationCategory;
|