Quellcode durchsuchen

bug fix

tags/Baseline_30082024_FRONTEND_UAT
Mac\David vor 1 Jahr
Ursprung
Commit
548eaac8ff
4 geänderte Dateien mit 65 neuen und 48 gelöschten Zeilen
  1. +1
    -0
      src/app/api/resourcesummary/index.ts
  2. +12
    -4
      src/components/ProjectCashFlow/ProjectCashFlow.tsx
  3. +51
    -44
      src/components/ProjectResourceSummary/ProjectResourceSummary.tsx
  4. +1
    -0
      src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx

+ 1
- 0
src/app/api/resourcesummary/index.ts Datei anzeigen

@@ -10,6 +10,7 @@ export interface ResourceSummaryResult {
customerCode: string;
customerName: string;
customerCodeAndName: string;
subsidiaryCodeAndName: string;
}

export const preloadProjects = () => {


+ 12
- 4
src/components/ProjectCashFlow/ProjectCashFlow.tsx Datei anzeigen

@@ -97,8 +97,8 @@ const ProjectCashFlow: React.FC = () => {
cumulativeIncome.push(cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome)
}
for (var i = 0; i < cashFlowMonthlyChartData[0].expenditureList.length; i++) {
if (rightMax < cashFlowMonthlyChartData[0].incomeList[i].income || rightMax < cashFlowMonthlyChartData[0].expenditureList[i].expenditure){
rightMax = Math.max(cashFlowMonthlyChartData[0].incomeList[i].income,cashFlowMonthlyChartData[0].expenditureList[i].expenditure)
if (rightMax < cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome || rightMax < cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure){
rightMax = Math.max(cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome,cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
}
monthlyExpenditure.push(cashFlowMonthlyChartData[0].expenditureList[i].expenditure)
cumulativeExpenditure.push(cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
@@ -141,11 +141,12 @@ const ProjectCashFlow: React.FC = () => {
}
monthlyAnticipateIncome.push(cashFlowAnticipateData[0].anticipateIncomeList[i].anticipateIncome)
}
setMonthlyAnticipateIncomeList(monthlyAnticipateIncome)
} else {
setMonthlyAnticipateIncomeList([0,0,0,0,0,0,0,0,0,0,0,0])
setMonthlyAnticipateExpenditureList([0,0,0,0,0,0,0,0,0,0,0,0])
}
setMonthlyAnticipateIncomeList(monthlyAnticipateIncome)
console.log(cashFlowAnticipateData)
if(cashFlowAnticipateData.length !== 0){
if (cashFlowAnticipateData[0].anticipateExpenditureList.length !== 0) {
@@ -175,7 +176,7 @@ const ProjectCashFlow: React.FC = () => {
}
setMonthlyAnticipateExpenditureList(result)
for (var i = 0; i < monthlyAnticipateIncome.length; i++) {
if (anticipateLeftMax < monthlyAnticipateIncome[i] || result[i]){
if (anticipateLeftMax < monthlyAnticipateIncome[i] || anticipateLeftMax < result[i]){
anticipateLeftMax = Math.max(monthlyAnticipateIncome[i],result[i])
}
setMonthlyAnticipateLeftMax(anticipateLeftMax)
@@ -432,6 +433,13 @@ const ProjectCashFlow: React.FC = () => {
};

const anticipateOptions: ApexOptions = {
tooltip: {
y: {
formatter: function(val) {
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}
}
},
chart: {
height: 350,
type: "line",


+ 51
- 44
src/components/ProjectResourceSummary/ProjectResourceSummary.tsx Datei anzeigen

@@ -135,6 +135,10 @@ const ProjectResourceSummary: React.FC = () => {
subStageList.push(subStageResult[i].plannedResources)
subStageList.push(subStageResult[i].actualResourcesSpent)
}
if (i === subStageResult.length-1) {
subStageSecondLayerList.push(subStageList)
subStageFullList.push(subStageSecondLayerList)
}
}
console.log(subStageFullList)
@@ -157,6 +161,9 @@ const ProjectResourceSummary: React.FC = () => {
mainStageList.push(mainStageResult[i].plannedResources)
mainStageList.push(mainStageResult[i].actualResourcesSpent)
}
if (i === mainStageResult.length - 1) {
mainStageFullList.push(createData(mainStageList,subStageFullList[arrayNumber]))
}
}
setRows(mainStageFullList)
}
@@ -238,20 +245,20 @@ const ProjectResourceSummary: React.FC = () => {
</IconButton>
)}
</TableCell>
<TableCell style={{fontSize:10}}>{row.stage}</TableCell>
<TableCell style={{fontSize:10}}>{row.taskCount}</TableCell>
<TableCell style={{fontSize:10}}>{row.g1Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g1Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g2Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g2Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g3Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g3Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g4Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g4Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g5Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.g5Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.totalPlanned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:10}}>{row.totalActual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.stage}</TableCell>
<TableCell style={{fontSize:13}}>{row.taskCount}</TableCell>
<TableCell style={{fontSize:13}}>{row.g1Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g1Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g2Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g2Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g3Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g3Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g4Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g4Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g5Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.g5Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.totalPlanned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}}>{row.totalActual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
{row.task.map((taskRow:any) => (
<TableRow key={taskRow[0]} style={{backgroundColor:"#f0f3f7"}}>
@@ -274,7 +281,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[0]}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[0]}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -287,7 +294,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[1]}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[1]}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -300,7 +307,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[4].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[4].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -313,7 +320,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[5].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[5].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -326,7 +333,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[6].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[6].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -339,7 +346,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[7].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[7].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -352,7 +359,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[8].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[8].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -365,7 +372,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[9].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[9].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -378,7 +385,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[10].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[10].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -391,7 +398,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[11].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[11].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -404,7 +411,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[12].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[12].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -417,7 +424,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[13].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[13].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -430,7 +437,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[2].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[2].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -443,7 +450,7 @@ const ProjectResourceSummary: React.FC = () => {
<Table size="small" aria-label="tasks">
<TableBody>
<TableRow>
<TableCell style={{fontSize:10}} colSpan={1}>{taskRow[3].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
<TableCell style={{fontSize:13}} colSpan={1}>{taskRow[3].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</TableCell>
</TableRow>
</TableBody>
</Table>
@@ -666,11 +673,11 @@ const columns2 = [
</div>
</div>
{/* <div style={{display:"inline-block",width:"99%",marginLeft:10}}>
<CustomDatagrid rows={projectResourcesRows} columns={columns2} columnWidth={200} dataGridHeight={480} pageSize={100} columnGroupingModel={columnGroupingModel} sx={{fontSize:10}}/>
<CustomDatagrid rows={projectResourcesRows} columns={columns2} columnWidth={200} dataGridHeight={480} pageSize={100} columnGroupingModel={columnGroupingModel} sx={{fontSize:13}}/>
</div> */}
{/* <div style={{display:"inline-block",width:"99%",marginLeft:10, marginRight:10, marginTop:10}}> */}
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="simple table">
<Table sx={{ minWidth: 650, maxWidth:1080}} aria-label="simple table">
<TableHead>
<TableRow>
<TableCell align="center" colSpan={3}>
@@ -697,20 +704,20 @@ const columns2 = [
</TableRow>
<TableRow>
<TableCell style={{width:"5%"}}/>
<TableCell style={{fontSize:10, width:"20%"}}>Stage</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Task Count</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:10, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, minWidth:300}}>Stage</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Task Count</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Planned</TableCell>
<TableCell style={{fontSize:13, width:"5%"}}>Actual</TableCell>
</TableRow>
</TableHead>
<TableBody>


+ 1
- 0
src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx Datei anzeigen

@@ -58,6 +58,7 @@ const ProjectResourceSummarySearch: React.FC<Props> = ({ projects }) => {
{ name: "projectCode", label: t("Project Code") },
{ name: "projectName", label: t("Project Name") },
{ name: "customerCodeAndName", label: t("Client Code And Name") },
{ name: "subsidiaryCodeAndName", label: t("Subsidiary Code And Name")}
],
[onTaskClick, t],
// [t],


Laden…
Abbrechen
Speichern