add update time
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||||
import { GET_RECEIPT_DAMAGE_ITEMS_LIST } from "@/core/utils/routes";
|
import { GET_RECEIPT_DAMAGE_ITEMS_LIST } from "@/core/utils/routes";
|
||||||
import { Box } from "@mui/material";
|
import { Box, Typography } from "@mui/material";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import Toolbar from "./Toolbar";
|
import Toolbar from "./Toolbar";
|
||||||
import RowActions from "./RowActions";
|
import RowActions from "./RowActions";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
|
||||||
const DamagesList = () => {
|
const DamagesList = () => {
|
||||||
const columns = useMemo(
|
const columns = useMemo(
|
||||||
@@ -49,6 +50,19 @@ const DamagesList = () => {
|
|||||||
size: 100,
|
size: 100,
|
||||||
Cell: ({ renderedCellValue }) => (renderedCellValue / 1).toLocaleString(),
|
Cell: ({ renderedCellValue }) => (renderedCellValue / 1).toLocaleString(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "update_time",
|
||||||
|
header: "تاریخ بروزرسانی",
|
||||||
|
id: "update_time",
|
||||||
|
enableColumnFilter: false,
|
||||||
|
datatype: "date",
|
||||||
|
filterMode: "equals",
|
||||||
|
Cell: ({ renderedCellValue }) => (
|
||||||
|
<Typography variant="body2">
|
||||||
|
{renderedCellValue ? moment(renderedCellValue).locale("fa").format("YYYY/MM/DD") : "-"}
|
||||||
|
</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "status",
|
accessorKey: "status",
|
||||||
header: "وضعیت",
|
header: "وضعیت",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { number, object } from "yup";
|
|||||||
import useDamageItemList from "@/lib/hooks/useDamageItemList";
|
import useDamageItemList from "@/lib/hooks/useDamageItemList";
|
||||||
import DamagePrice from "./DamagePrice";
|
import DamagePrice from "./DamagePrice";
|
||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
|
||||||
const schema = object({
|
const schema = object({
|
||||||
id: number().required("لطفا نوع خسارت را وارد کنید!!!"),
|
id: number().required("لطفا نوع خسارت را وارد کنید!!!"),
|
||||||
@@ -86,7 +87,7 @@ const DamageItem = ({ baseOnChange, baseDamageItems }) => {
|
|||||||
<Autocomplete
|
<Autocomplete
|
||||||
options={damageItemList || []}
|
options={damageItemList || []}
|
||||||
size={"small"}
|
size={"small"}
|
||||||
getOptionLabel={(option) => option.title}
|
getOptionLabel={(option) => `${option.title} - بروزرسانی: ${option.update_time ? moment(option.update_time).locale("fa").format("YYYY/MM/DD") : ""}` }
|
||||||
isOptionEqualToValue={(option, value) => option.id === value.id}
|
isOptionEqualToValue={(option, value) => option.id === value.id}
|
||||||
loading={loadingDamageItemList}
|
loading={loadingDamageItemList}
|
||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user