feat(FE-181-179-220): Slicing UI, Client Side Validation and API Integration for Delivery Order

This commit is contained in:
randy-ar
2025-11-20 00:57:07 +07:00
parent 429f2b9109
commit b33e7a1919
24 changed files with 1358 additions and 191 deletions
@@ -56,15 +56,28 @@ const RowsOptionsMenu = ({
<Icon icon='mdi:eye-outline' width={16} height={16} />
Detail
</Button>
<Button
href={`/marketing/sales-orders/detail/edit/?salesOrderId=${props.row.original.id}`}
variant='ghost'
color='warning'
className='justify-start text-sm'
>
<Icon icon='mdi:pencil-outline' width={16} height={16} />
Edit
</Button>
{props.row.original.latest_approval.step_number != 1 && (
<Button
href={`/marketing/sales-orders/detail/edit/delivery?salesOrderId=${props.row.original.id}`}
variant='ghost'
color='success'
className='justify-start text-sm'
>
<Icon icon='mdi:truck' width={16} height={16} />
Deliver
</Button>
)}
{props.row.original.latest_approval.step_number != 3 && (
<Button
href={`/marketing/sales-orders/detail/edit?salesOrderId=${props.row.original.id}`}
variant='ghost'
color='warning'
className='justify-start text-sm'
>
<Icon icon='mdi:pencil-outline' width={16} height={16} />
Edit
</Button>
)}
<Button
onClick={deleteClickHandler}
variant='ghost'
@@ -160,7 +173,7 @@ const SalesOrderTable = () => {
);
const disableApprove = !hasApprovable || hasRejectable;
const disableReject = !hasRejectable || hasApprovable;
// const disableReject = !hasRejectable || hasApprovable;
const idsToProcess =
approveAction === 'APPROVED'
@@ -224,7 +237,7 @@ const SalesOrderTable = () => {
const getRowCanSelect = (row: Row<Marketing>): boolean => {
const step = row.original.latest_approval?.step_number;
return step === 1 || step === 2;
return step === 1;
};
return (
@@ -258,7 +271,7 @@ const SalesOrderTable = () => {
Approve
</Button>
<Button
{/* <Button
color='error'
onClick={rejectClickHandler}
className='justify-start text-sm'
@@ -266,7 +279,7 @@ const SalesOrderTable = () => {
>
<Icon icon='material-symbols:close' width={24} height={24} />
Reject
</Button>
</Button> */}
</div>
</div>
<Table