Compare commits

...

3 Commits

Author SHA1 Message Date
9b74be078f version changed to 02.62 2026-02-02 11:03:09 +03:30
5fd55c4b10 fix: filter error 2026-02-02 11:03:01 +03:30
6b5276ce36 add: new tagging key 2026-02-02 08:40:06 +03:30
3 changed files with 26 additions and 23 deletions

View File

@@ -62,14 +62,14 @@ export default function Tagging() {
item?.species_code === 1 item?.species_code === 1
? "گاو" ? "گاو"
: item?.species_code === 2 : item?.species_code === 2
? "گاومیش" ? "گاومیش"
: item?.species_code === 3 : item?.species_code === 3
? "شتر" ? "شتر"
: item?.species_code === 4 : item?.species_code === 4
? "گوسفند" ? "گوسفند"
: item?.species_code === 5 : item?.species_code === 5
? "بز" ? "بز"
: "نامشخص", : "نامشخص",
item?.serial_from || "-", item?.serial_from || "-",
item?.serial_to || "-", item?.serial_to || "-",
item?.total_distributed_tags || 0, item?.total_distributed_tags || 0,
@@ -167,6 +167,7 @@ export default function Tagging() {
columns={[ columns={[
"تعداد گروه پلاک", "تعداد گروه پلاک",
"پلاک‌های تولیدشده", "پلاک‌های تولیدشده",
"گروه پلاک های دارای توزیع",
"پلاک توزیع شده", "پلاک توزیع شده",
"پلاک باقی‌مانده", "پلاک باقی‌مانده",
"جزئیات گونه ها", "جزئیات گونه ها",
@@ -176,6 +177,8 @@ export default function Tagging() {
tagDashboardData?.batch_count?.toLocaleString() || 0, tagDashboardData?.batch_count?.toLocaleString() || 0,
tagDashboardData?.tag_count_created_by_batch?.toLocaleString() || tagDashboardData?.tag_count_created_by_batch?.toLocaleString() ||
0, 0,
tagDashboardData?.has_distributed_batches_number?.toLocaleString() ||
0,
tagDashboardData?.total_distributed_tags?.toLocaleString() || 0, tagDashboardData?.total_distributed_tags?.toLocaleString() || 0,
tagDashboardData?.total_remaining_tags?.toLocaleString() || 0, tagDashboardData?.total_remaining_tags?.toLocaleString() || 0,
<TableButton <TableButton

View File

@@ -42,7 +42,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
? item?.distribution_type === "random" ? item?.distribution_type === "random"
? "random" ? "random"
: "group" : "group"
: "group" : "group",
); );
const [batches, setBatches] = useState<BatchItem[]>([]); const [batches, setBatches] = useState<BatchItem[]>([]);
@@ -116,25 +116,25 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
showToast( showToast(
isEdit ? "ویرایش با موفقیت انجام شد" : "ثبت با موفقیت انجام شد", isEdit ? "ویرایش با موفقیت انجام شد" : "ثبت با موفقیت انجام شد",
"success" "success",
); );
getData(); getData();
closeModal(); closeModal();
} catch (error: any) { } catch (error: any) {
showToast( showToast(
error?.response?.data?.message || "خطا در ثبت اطلاعات!", error?.response?.data?.message || "خطا در ثبت اطلاعات!",
"error" "error",
); );
} }
}; };
const speciesOptions = () => { const speciesOptions = () => {
return speciesData?.results?.map((opt: any) => { return (
return { speciesData?.results?.map((opt: any) => ({
key: opt?.value, key: opt?.value,
value: opt?.name, value: opt?.name,
}; })) ?? []
}); );
}; };
return ( return (
@@ -195,14 +195,14 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
items?.map((r: any) => { items?.map((r: any) => {
const existing = batches.find( const existing = batches.find(
(b) => (b) =>
b.batch_identity === r.key1 && b.species_code === r.key2 b.batch_identity === r.key1 && b.species_code === r.key2,
); );
return { return {
batch_identity: r.key1, batch_identity: r.key1,
species_code: r.key2, species_code: r.key2,
count: existing?.count ?? "", count: existing?.count ?? "",
}; };
}) || [] }) || [],
); );
}} }}
onChangeValue={(labels) => { onChangeValue={(labels) => {
@@ -210,7 +210,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
prev.map((item, index) => ({ prev.map((item, index) => ({
...item, ...item,
label: labels[index], label: labels[index],
})) })),
); );
}} }}
/> />
@@ -229,7 +229,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
species_code: k as number, species_code: k as number,
count: prev?.count ?? "", count: prev?.count ?? "",
}; };
}) }),
); );
}} }}
title="گونه" title="گونه"
@@ -245,12 +245,12 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
distributionType === "group" distributionType === "group"
? `تعداد ${ ? `تعداد ${
speciesOptions().find( speciesOptions().find(
(s: any) => s.key === batch.species_code (s: any) => s.key === batch.species_code,
)?.value )?.value
} (${batch.label}) ` } (${batch.label}) `
: `تعداد ${ : `تعداد ${
speciesOptions().find( speciesOptions().find(
(s: any) => s.key === batch.species_code (s: any) => s.key === batch.species_code,
)?.value )?.value
}` }`
} }
@@ -271,7 +271,7 @@ export const SubmitTagDistribution = ({ item, getData }: any) => {
b.count === "" || b.count === "" ||
b.count === undefined || b.count === undefined ||
b.count === null || b.count === null ||
Number(b.count) <= 0 Number(b.count) <= 0,
) )
} }
type="submit" type="submit"

View File

@@ -1 +1 @@
02.61 02.62