._.
This commit is contained in:
parent
1edb99991d
commit
709d72523d
@ -127,7 +127,7 @@ const DeliveryOrderDetails = () => {
|
|||||||
accessory_name:
|
accessory_name:
|
||||||
accessory.accessory_name +
|
accessory.accessory_name +
|
||||||
Math.round(
|
Math.round(
|
||||||
(accessory.accessory_volume * accessory.count) / 100
|
(accessory.accessory_volume / 100) * totalOrder.count_robots
|
||||||
) +
|
) +
|
||||||
"шт.",
|
"шт.",
|
||||||
};
|
};
|
||||||
@ -139,7 +139,7 @@ const DeliveryOrderDetails = () => {
|
|||||||
accessory.accessory_name +
|
accessory.accessory_name +
|
||||||
": " +
|
": " +
|
||||||
Math.round(
|
Math.round(
|
||||||
(accessory.accessory_volume * accessory.count) / 100
|
(accessory.accessory_volume / 100) * totalOrder.count_robots
|
||||||
) +
|
) +
|
||||||
"шт.",
|
"шт.",
|
||||||
...coords,
|
...coords,
|
||||||
@ -194,19 +194,19 @@ const DeliveryOrderDetails = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const calculateRecommendedDepartureTime = () => {
|
const calculateRecommendedDepartureTime = () => {
|
||||||
if (!totalOrder || !orderDuration || !accessoryPeriod) return null;
|
if (!totalOrder || !orderDuration || !accessoryPeriod) return null;
|
||||||
|
|
||||||
const periodInMilliseconds = (accessoryPeriod + 1) * 24 * 60 * 60 * 1000;
|
const periodInMilliseconds = (accessoryPeriod + 1) * 24 * 60 * 60 * 1000;
|
||||||
const orderDurationInMilliseconds = orderDuration * 60 * 1000;
|
const orderDurationInMilliseconds = orderDuration * 60 * 1000;
|
||||||
const deadlineDate = new Date(totalOrder.deadline);
|
const deadlineDate = new Date(totalOrder.deadline);
|
||||||
|
|
||||||
const recommendedDepartureTime = new Date(
|
const recommendedDepartureTime = new Date(
|
||||||
deadlineDate - periodInMilliseconds - orderDurationInMilliseconds
|
deadlineDate - periodInMilliseconds - orderDurationInMilliseconds
|
||||||
);
|
);
|
||||||
|
|
||||||
return recommendedDepartureTime.toLocaleDateString("ru-RU");
|
return recommendedDepartureTime.toLocaleDateString("ru-RU");
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
navigate("/");
|
navigate("/");
|
||||||
@ -258,9 +258,7 @@ const DeliveryOrderDetails = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>{calculateRecommendedDepartureTime()}</td>
|
||||||
{calculateRecommendedDepartureTime()}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user