Преглед на файлове

Minor update

tags/Baseline_180220205_Frontend
MSI\2Fi преди 11 месеца
родител
ревизия
7e3a6166b6
променени са 6 файла, в които са добавени 26 реда и са изтрити 10 реда
  1. +1
    -1
      src/components/EditStaff/EditStaff.tsx
  2. +8
    -2
      src/components/EditStaff/EditStaffWrapper.tsx
  3. +10
    -1
      src/components/EditStaff/ProjectHistory.tsx
  4. +2
    -2
      src/components/ExpenseSearch/CreateExpenseModal.tsx
  5. +1
    -1
      src/components/ExpenseSearch/ExpenseSearch.tsx
  6. +4
    -3
      src/components/InvoiceSearch/InvoiceSearchWrapper.tsx

+ 1
- 1
src/components/EditStaff/EditStaff.tsx Целия файл

@@ -38,7 +38,7 @@ interface formProps {
Staff: IndividualStaff
combos: comboItem;
SalaryEffectiveInfo: SalaryEffectiveInfo[];
InvolvedProject?: projects[]
InvolvedProject: projects[]
InfoHistory: InfoHistory
}



+ 8
- 2
src/components/EditStaff/EditStaffWrapper.tsx Целия файл

@@ -54,7 +54,7 @@ const EditStaffWrapper: React.FC<Props> & SubComponents = async ({
fetchSkillCombo(),
fetchSalaryCombo(),
fetchStaffSalaryEffectiveInfo(id),
fetchStaffInvolvedProjects(id),
fetchStaffInvolvedProjects(id)??[],
fetchGradesLog(id),
fetchPositionLog(id),
fetchTeamLog(id),
@@ -79,7 +79,13 @@ const EditStaffWrapper: React.FC<Props> & SubComponents = async ({
Staff.data.joinDate = Staff.data.joinDate && dateArrayToString(Staff.data.joinDate) as string
Staff.data.departDate = Staff.data.departDate && dateArrayToString(Staff.data.departDate) as string

return <EditStaff Staff={Staff.data} combos={combos} SalaryEffectiveInfo={SalaryEffectiveInfo} InvolvedProject={InvolvedProject} InfoHistory={InfoHistory}/>;
return <EditStaff
Staff={Staff.data}
combos={combos}
SalaryEffectiveInfo={SalaryEffectiveInfo}
InvolvedProject={InvolvedProject}
InfoHistory={InfoHistory}
/>;
};

EditStaffWrapper.Loading = EditStaffLoading;


+ 10
- 1
src/components/EditStaff/ProjectHistory.tsx Целия файл

@@ -1,5 +1,5 @@
import { projects } from "@/app/api/staff";
import { Box, Card, CardContent, Grid, Stack, SxProps } from "@mui/material";
import { Box, Card, CardContent, Divider, Grid, Stack, SxProps, Typography } from "@mui/material";
import StyledDataGrid from "../StyledDataGrid";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
@@ -43,7 +43,12 @@ const ProjectHistory: React.FC<Props> = async ({ InvolvedProject }) => {
<CardContent component={Stack} spacing={4}>
<Box>
<Grid container spacing={2} columns={{ xs: 6, sm: 12 }}>
<Grid item xs={6}>
<Typography variant="h5">
{t("On-going Projects")}:
</Typography>
<Divider sx={{ paddingBlockStart: 2 }}/>
<StyledDataGrid
sx={_sx}
rows={InvolvedProject?.filter(item => item.status === "On-going") ?? []}
@@ -51,6 +56,10 @@ const ProjectHistory: React.FC<Props> = async ({ InvolvedProject }) => {
/>
</Grid>
<Grid item xs={6}>
<Typography variant="h5">
{t("Completed Projects")}:
</Typography>
<Divider sx={{ paddingBlockStart: 2 }}/>
<StyledDataGrid
sx={_sx}
rows={InvolvedProject?.filter(item => item.status === "Completed") ?? []}


+ 2
- 2
src/components/ExpenseSearch/CreateExpenseModal.tsx Целия файл

@@ -71,14 +71,14 @@ const CreateExpenseModal: React.FC<Props> = ({ isOpen, onClose, projects }) => {
item.remarks && item.remarks.length > 0 ? item.remarks : undefined,
};
});
console.log(postData);
// console.log(postData);
submitDialog(async () => {
const response = await saveProjectExpense(postData)
console.log(response)
if (response) {
onClose()
successDialog(t("Submit Success"), t).then(() => {
router.replace("/expense");
window.location.reload()
})
}
}, t)


+ 1
- 1
src/components/ExpenseSearch/ExpenseSearch.tsx Целия файл

@@ -149,7 +149,7 @@ const ExpenseSearch: React.FC<Props> = ({ expenses, projects }) => {
// setDialogOpen(false);
// console.log(selectedRow[0])
selectedRow[0].issueDate = dayjs(selectedRow[0].issuedDate).format(INPUT_DATE_FORMAT)
console.log(selectedRow[0])
// console.log(selectedRow[0])
await updateProjectExpense(selectedRow[0])
setDialogOpen(false);
successDialog(t("Update Success"), t).then(() => {


+ 4
- 3
src/components/InvoiceSearch/InvoiceSearchWrapper.tsx Целия файл

@@ -27,9 +27,10 @@ const InvoiceSearchWrapper: React.FC & SubComponents = async () => {
let filteredInvoice = invoices
if (teamId) {
filteredInvoice = invoices.filter(i => i.teamId === teamId)
} else {
filteredInvoice = []
}
}
// else {
// filteredInvoice = []
// }

const convertedInvoices = filteredInvoice.map((invoice)=>{
return{


Зареждане…
Отказ
Запис