Добавлены новые зависимости для компонента dropdown-menu и обновлены соответствующие импорты. Изменены заголовки и логика отображения статистики в компонентах FulfillmentDetailedSuppliesTab и FulfillmentSuppliesTab для улучшения восприятия данных. Упрощена логика расчета эффективности в компоненте SuppliesConsumablesTab, удалены неиспользуемые поля.
This commit is contained in:
@ -371,12 +371,8 @@ export function SuppliesConsumablesTab() {
|
||||
return consumable.actualQty * consumable.unitPrice;
|
||||
};
|
||||
|
||||
const getEfficiencyBadge = (
|
||||
planned: number,
|
||||
actual: number,
|
||||
defect: number
|
||||
) => {
|
||||
const efficiency = ((actual - defect) / planned) * 100;
|
||||
const getEfficiencyBadge = (planned: number, actual: number) => {
|
||||
const efficiency = (actual / planned) * 100;
|
||||
if (efficiency >= 95) {
|
||||
return (
|
||||
<Badge className="bg-green-500/20 text-green-300 border-green-500/30 border">
|
||||
@ -455,15 +451,15 @@ export function SuppliesConsumablesTab() {
|
||||
|
||||
<Card className="bg-white/10 backdrop-blur border-white/20 p-4">
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className="p-2 bg-red-500/20 rounded-lg">
|
||||
<AlertTriangle className="h-5 w-5 text-red-400" />
|
||||
<div className="p-2 bg-blue-500/20 rounded-lg">
|
||||
<Calendar className="h-5 w-5 text-blue-400" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-white/60 text-xs">С браком</p>
|
||||
<p className="text-white/60 text-xs">Завершено</p>
|
||||
<p className="text-xl font-bold text-white">
|
||||
{
|
||||
mockConsumableSupplies.filter(
|
||||
(supply) => supply.defectTotal > 0
|
||||
(supply) => supply.status === "completed"
|
||||
).length
|
||||
}
|
||||
</p>
|
||||
@ -487,7 +483,6 @@ export function SuppliesConsumablesTab() {
|
||||
</th>
|
||||
<th className="text-left p-4 text-white font-semibold">План</th>
|
||||
<th className="text-left p-4 text-white font-semibold">Факт</th>
|
||||
<th className="text-left p-4 text-white font-semibold">Брак</th>
|
||||
<th className="text-left p-4 text-white font-semibold">
|
||||
Цена расходников
|
||||
</th>
|
||||
@ -543,17 +538,6 @@ export function SuppliesConsumablesTab() {
|
||||
{supply.actualTotal}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span
|
||||
className={`font-semibold ${
|
||||
supply.defectTotal > 0
|
||||
? "text-red-400"
|
||||
: "text-white"
|
||||
}`}
|
||||
>
|
||||
{supply.defectTotal}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span className="text-green-400 font-semibold">
|
||||
{formatCurrency(supply.totalConsumablesPrice)}
|
||||
@ -646,19 +630,6 @@ export function SuppliesConsumablesTab() {
|
||||
)}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span className="text-white/80">
|
||||
{route.suppliers.reduce(
|
||||
(sum, s) =>
|
||||
sum +
|
||||
s.consumables.reduce(
|
||||
(cSum, c) => cSum + c.defectQty,
|
||||
0
|
||||
),
|
||||
0
|
||||
)}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span className="text-green-400 font-medium">
|
||||
{formatCurrency(route.totalConsumablesPrice)}
|
||||
@ -741,14 +712,6 @@ export function SuppliesConsumablesTab() {
|
||||
)}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span className="text-white/80">
|
||||
{supplier.consumables.reduce(
|
||||
(sum, c) => sum + c.defectQty,
|
||||
0
|
||||
)}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span className="text-green-400 font-medium">
|
||||
{formatCurrency(
|
||||
@ -832,17 +795,6 @@ export function SuppliesConsumablesTab() {
|
||||
{consumable.actualQty}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<span
|
||||
className={`font-semibold ${
|
||||
consumable.defectQty > 0
|
||||
? "text-red-400"
|
||||
: "text-white"
|
||||
}`}
|
||||
>
|
||||
{consumable.defectQty}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4">
|
||||
<div className="text-white">
|
||||
<div className="font-medium">
|
||||
@ -863,8 +815,7 @@ export function SuppliesConsumablesTab() {
|
||||
<td className="p-4">
|
||||
{getEfficiencyBadge(
|
||||
consumable.plannedQty,
|
||||
consumable.actualQty,
|
||||
consumable.defectQty
|
||||
consumable.actualQty
|
||||
)}
|
||||
</td>
|
||||
<td className="p-4">
|
||||
@ -883,7 +834,7 @@ export function SuppliesConsumablesTab() {
|
||||
{isConsumableExpanded && (
|
||||
<tr>
|
||||
<td
|
||||
colSpan={10}
|
||||
colSpan={9}
|
||||
className="p-0"
|
||||
>
|
||||
<div className="bg-white/5 border-t border-white/10">
|
||||
|
Reference in New Issue
Block a user