Compare commits
3 Commits
e465843eb9
...
9b74be078f
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b74be078f | |||
| 5fd55c4b10 | |||
| 6b5276ce36 |
@@ -62,14 +62,14 @@ export default function Tagging() {
|
||||
item?.species_code === 1
|
||||
? "گاو"
|
||||
: item?.species_code === 2
|
||||
? "گاومیش"
|
||||
: item?.species_code === 3
|
||||
? "شتر"
|
||||
: item?.species_code === 4
|
||||
? "گوسفند"
|
||||
: item?.species_code === 5
|
||||
? "بز"
|
||||
: "نامشخص",
|
||||
? "گاومیش"
|
||||
: item?.species_code === 3
|
||||
? "شتر"
|
||||
: item?.species_code === 4
|
||||
? "گوسفند"
|
||||
: item?.species_code === 5
|
||||
? "بز"
|
||||
: "نامشخص",
|
||||
item?.serial_from || "-",
|
||||
item?.serial_to || "-",
|
||||
item?.total_distributed_tags || 0,
|
||||
@@ -167,6 +167,7 @@ export default function Tagging() {
|
||||
columns={[
|
||||
"تعداد گروه پلاک",
|
||||
"پلاکهای تولیدشده",
|
||||
"گروه پلاک های دارای توزیع",
|
||||
"پلاک توزیع شده",
|
||||
"پلاک باقیمانده",
|
||||
"جزئیات گونه ها",
|
||||
@@ -176,6 +177,8 @@ export default function Tagging() {
|
||||
tagDashboardData?.batch_count?.toLocaleString() || 0,
|
||||
tagDashboardData?.tag_count_created_by_batch?.toLocaleString() ||
|
||||
0,
|
||||
tagDashboardData?.has_distributed_batches_number?.toLocaleString() ||
|
||||
0,
|
||||
tagDashboardData?.total_distributed_tags?.toLocaleString() || 0,
|
||||
tagDashboardData?.total_remaining_tags?.toLocaleString() || 0,
|
||||
<TableButton
|
||||
|
||||
@@ -42,7 +42,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
? item?.distribution_type === "random"
|
||||
? "random"
|
||||
: "group"
|
||||
: "group"
|
||||
: "group",
|
||||
);
|
||||
const [batches, setBatches] = useState<BatchItem[]>([]);
|
||||
|
||||
@@ -116,25 +116,25 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
|
||||
showToast(
|
||||
isEdit ? "ویرایش با موفقیت انجام شد" : "ثبت با موفقیت انجام شد",
|
||||
"success"
|
||||
"success",
|
||||
);
|
||||
getData();
|
||||
closeModal();
|
||||
} catch (error: any) {
|
||||
showToast(
|
||||
error?.response?.data?.message || "خطا در ثبت اطلاعات!",
|
||||
"error"
|
||||
"error",
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const speciesOptions = () => {
|
||||
return speciesData?.results?.map((opt: any) => {
|
||||
return {
|
||||
return (
|
||||
speciesData?.results?.map((opt: any) => ({
|
||||
key: opt?.value,
|
||||
value: opt?.name,
|
||||
};
|
||||
});
|
||||
})) ?? []
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -195,14 +195,14 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
items?.map((r: any) => {
|
||||
const existing = batches.find(
|
||||
(b) =>
|
||||
b.batch_identity === r.key1 && b.species_code === r.key2
|
||||
b.batch_identity === r.key1 && b.species_code === r.key2,
|
||||
);
|
||||
return {
|
||||
batch_identity: r.key1,
|
||||
species_code: r.key2,
|
||||
count: existing?.count ?? "",
|
||||
};
|
||||
}) || []
|
||||
}) || [],
|
||||
);
|
||||
}}
|
||||
onChangeValue={(labels) => {
|
||||
@@ -210,7 +210,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
prev.map((item, index) => ({
|
||||
...item,
|
||||
label: labels[index],
|
||||
}))
|
||||
})),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
@@ -229,7 +229,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
species_code: k as number,
|
||||
count: prev?.count ?? "",
|
||||
};
|
||||
})
|
||||
}),
|
||||
);
|
||||
}}
|
||||
title="گونه"
|
||||
@@ -245,12 +245,12 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
distributionType === "group"
|
||||
? `تعداد ${
|
||||
speciesOptions().find(
|
||||
(s: any) => s.key === batch.species_code
|
||||
(s: any) => s.key === batch.species_code,
|
||||
)?.value
|
||||
} (${batch.label}) `
|
||||
: `تعداد ${
|
||||
speciesOptions().find(
|
||||
(s: any) => s.key === batch.species_code
|
||||
(s: any) => s.key === batch.species_code,
|
||||
)?.value
|
||||
}`
|
||||
}
|
||||
@@ -271,7 +271,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
|
||||
b.count === "" ||
|
||||
b.count === undefined ||
|
||||
b.count === null ||
|
||||
Number(b.count) <= 0
|
||||
Number(b.count) <= 0,
|
||||
)
|
||||
}
|
||||
type="submit"
|
||||
|
||||
@@ -1 +1 @@
|
||||
02.61
|
||||
02.62
|
||||
|
||||
Reference in New Issue
Block a user