FPSMS-frontend
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

PutAwayReviewGrid.tsx 2.5 KiB

5 ay önce
5 ay önce
5 ay önce
5 ay önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. "use client";
  2. import {
  3. Paper,
  4. } from "@mui/material";
  5. import { useEffect, useMemo } from "react";
  6. import StyledDataGrid from "../StyledDataGrid";
  7. import { useTranslation } from "react-i18next";
  8. import { GridColDef } from "@mui/x-data-grid";
  9. import { PutAwayRecord } from ".";
  10. type Props = {
  11. putAwayHistory : PutAwayRecord[];
  12. };
  13. const PutAwayReviewGrid: React.FC<Props> = ({ putAwayHistory }) => {
  14. const { t } = useTranslation("putAway");
  15. const columns: GridColDef[] = useMemo(() => [
  16. {
  17. field: "index",
  18. headerName: t(""),
  19. flex: 0.5,
  20. renderCell: (params) => {
  21. return (<b>{params.id}.</b>);
  22. },
  23. disableColumnMenu: true,
  24. },
  25. {
  26. field: "poCode",
  27. headerName: t("PoCode/JoCode"),
  28. flex: 2,
  29. disableColumnMenu: true,
  30. renderCell: (params) => {
  31. return (<>{params.row.joCode ? params.row.joCode : params.row.poCode}</>);
  32. },
  33. },
  34. {
  35. field: "itemCode",
  36. headerName: t("itemCode"),
  37. flex: 1,
  38. disableColumnMenu: true,
  39. },
  40. {
  41. field: "itemName",
  42. headerName: t("itemName"),
  43. flex: 2,
  44. disableColumnMenu: true,
  45. },
  46. {
  47. field: "putQty",
  48. headerName: t("putawayQty"),
  49. flex: 1,
  50. headerAlign: 'right',
  51. align: 'right',
  52. disableColumnMenu: true,
  53. },
  54. {
  55. field: "uom",
  56. headerName: t("uom"),
  57. flex: 1.5,
  58. disableColumnMenu: true,
  59. },
  60. {
  61. field: "warehouseCode",
  62. headerName: t("warehouse"),
  63. flex: 2,
  64. disableColumnMenu: true,
  65. },
  66. ], []
  67. )
  68. return (<>
  69. <Paper>
  70. <StyledDataGrid
  71. columns={columns}
  72. rows={putAwayHistory}
  73. autoHeight
  74. sx={{
  75. '& .MuiDataGrid-columnHeaderTitle': {
  76. whiteSpace: 'nowrap',
  77. overflow: 'visible',
  78. textOverflow: 'clip',
  79. lineHeight: 'normal',
  80. paddingRight: '0px',
  81. },
  82. '& .MuiDataGrid-columnHeader': {
  83. padding: '0 4px 0 4px',
  84. },
  85. }}
  86. />
  87. </Paper>
  88. </>)
  89. }
  90. export default PutAwayReviewGrid;