FPSMS-frontend
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

43 строки
1.3 KiB

  1. import { fetchPrinterCombo } from "@/app/api/settings/printer";
  2. import { fetchEscalationCombo } from "@/app/api/user";
  3. import { SearchParams } from "@/app/utils/fetchUtil";
  4. import { TypeEnum } from "@/app/utils/typeEnum";
  5. import CreateProductMaterial from "@/components/CreateItem";
  6. import PoDetail from "@/components/PoDetail";
  7. import { I18nProvider, getServerI18n } from "@/i18n";
  8. import { Typography } from "@mui/material";
  9. import isString from "lodash/isString";
  10. import { notFound } from "next/navigation";
  11. import { Suspense } from "react";
  12. type Props = {} & SearchParams;
  13. const PoEdit: React.FC<Props> = async ({ searchParams }) => {
  14. const type = "purchaseOrder";
  15. const { t } = await getServerI18n(type);
  16. //console.log(searchParams["id"]);
  17. const id = isString(searchParams["id"])
  18. ? parseInt(searchParams["id"])
  19. : undefined;
  20. //console.log(id);
  21. if (!id) {
  22. notFound();
  23. }
  24. fetchEscalationCombo()
  25. fetchPrinterCombo()
  26. return (
  27. <>
  28. {/* <Typography variant="h4">{t("Create Material")}</Typography> */}
  29. <I18nProvider namespaces={[type, "navigation", "common", "dashboard", "home"]}>
  30. <Suspense fallback={<PoDetail.Loading />}>
  31. <PoDetail id={id} />
  32. </Suspense>
  33. </I18nProvider>
  34. </>
  35. );
  36. };
  37. export default PoEdit;