This commit is contained in:
Андрей Дувакин 2024-10-08 08:26:34 +05:00
parent e0e79b9337
commit 19aa7fdf4d
3 changed files with 18 additions and 9 deletions

View File

@ -34,6 +34,7 @@ const DeliveryOrderDetails = () => {
const [totalCost, setTotalCost] = useState(0);
const [truckCount, setTruckCount] = useState(0);
const [truckName, setTruckName] = useState("");
const [truckCapacity, setTruckCapacity] = useState("");
const [totalOrder, setTotalOrder] = useState(null);
const [deliveryOrder, setDeliveryOrder] = useState(null);
const navigate = useNavigate();
@ -73,6 +74,7 @@ const DeliveryOrderDetails = () => {
setTotalCost(Math.round(deliveryOrderDetails.price));
setTruckCount(deliveryOrderDetails.count_trucks);
setTruckName(deliveryOrderDetails.truck_name);
setTruckCapacity(deliveryOrderDetails.truck_capacity);
const accessories = await getDeliveryAccessories(deliveryOrderId);
setDeliveryAccessories(accessories);
@ -164,7 +166,11 @@ const DeliveryOrderDetails = () => {
<tbody>
<tr>
<td>{totalCost} руб.</td>
<td>{truckName}</td>
<td>
{truckName}
<br />
Грузоподъемность: {truckCapacity}кг
</td>
<td>{truckCount}</td>
</tr>
</tbody>
@ -177,8 +183,8 @@ const DeliveryOrderDetails = () => {
<tr>
<th scope="col">Город</th>
<th scope="col">Комплектующее</th>
<th scope="col">Количество</th>
<th scope="col">Объем</th>
<th scope="col">Количество, шт.</th>
<th scope="col">Объем, м^3</th>
</tr>
</thead>
<tbody>
@ -186,8 +192,12 @@ const DeliveryOrderDetails = () => {
<tr key={accessory.id}>
<td>{accessory.city_name}</td>
<td>{accessory.accessory_name}</td>
<td>{(accessory.count)}</td>
<td>{accessory.volume}</td>
<td>{accessory.count}</td>
<td>
{Math.round(
(accessory.accessory_volume * accessory.count) / 100
)}
</td>
</tr>
))}
<tr>

View File

@ -126,8 +126,7 @@ const Home = () => {
<strong>Количество роботов:</strong> {order.count_robots}
</p>
<p>
<strong>Количество этапов:</strong>{" "}
{deliveryOrdersCount || 0}
<strong>Количество этапов:</strong> {deliveryOrdersCount || 0}
</p>
<DeliveryOrdersList

View File

@ -107,13 +107,13 @@ const Trucks = () => {
/>
</div>
<div className="form-group">
<label htmlFor="truckCapacity">Грузоподъемность, тонны</label>
<label htmlFor="truckCapacity">Грузоподъемность, кг</label>
<input
type="number"
className="form-control"
id="truckCapacity"
name="capacity"
placeholder="Введите грузоподъемность в тоннах"
placeholder="Введите грузоподъемность в килограммах"
value={newTruck.capacity}
onChange={handleInputChange}
min={1}