FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PoDetailWrapper.tsx 1.4 KiB

4 maanden geleden
3 maanden geleden
4 maanden geleden
3 maanden geleden
4 maanden geleden
6 maanden geleden
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { fetchAllItems } from "@/app/api/settings/item";
  2. // import ItemsSearch from "./ItemsSearch";
  3. // import ItemsSearchLoading from "./ItemsSearchLoading";
  4. import { SearchParams } from "@/app/utils/fetchUtil";
  5. import { TypeEnum } from "@/app/utils/typeEnum";
  6. import { notFound } from "next/navigation";
  7. import { fetchPoWithStockInLines, PoResult } from "@/app/api/po";
  8. import PoDetailLoading from "./PoDetailLoading";
  9. import PoDetail from "./PoDetail";
  10. import { QcItemWithChecks } from "@/app/api/qc";
  11. import { fetchWarehouseList } from "@/app/api/warehouse";
  12. import { fetchQcItemCheck } from "@/app/api/qc/actions";
  13. import { fetchEscalationCombo } from "@/app/api/user";
  14. import { fetchPrinterCombo } from "@/app/api/settings/printer";
  15. interface SubComponents {
  16. Loading: typeof PoDetailLoading;
  17. }
  18. type Props = {
  19. id: number;
  20. };
  21. const PoDetailWrapper: React.FC<Props> & SubComponents = async ({ id }) => {
  22. const [
  23. poWithStockInLine,
  24. warehouse,
  25. printerCombo,
  26. ] = await Promise.all([
  27. fetchPoWithStockInLines(id),
  28. fetchWarehouseList(),
  29. fetchPrinterCombo(),
  30. ]);
  31. // const poWithStockInLine = await fetchPoWithStockInLines(id)
  32. console.log("%c pol:", "color:green", poWithStockInLine);
  33. return <PoDetail po={poWithStockInLine} warehouse={warehouse} printerCombo={printerCombo} />;
  34. };
  35. PoDetailWrapper.Loading = PoDetailLoading;
  36. export default PoDetailWrapper;