浏览代码

[May Revert] Fix Thomas Feedback 157 & Email on 10/10/2025

main
cyril.tsui 2 个月前
父节点
当前提交
bafe481fb4
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. +4
    -3
      src/components/CreateProject/CreateProject.tsx
  2. +2
    -2
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 4
- 3
src/components/CreateProject/CreateProject.tsx 查看文件

@@ -533,6 +533,7 @@ const CreateProject: React.FC<Props> = ({
const expectedProjectFee = formProps.watch("expectedProjectFee"); const expectedProjectFee = formProps.watch("expectedProjectFee");
const ratePerManhour = formProps.watch("ratePerManhour"); const ratePerManhour = formProps.watch("ratePerManhour");
const totalManhour = formProps.watch("totalManhour"); const totalManhour = formProps.watch("totalManhour");
const subContractFee = formProps.watch("subContractFee");
const firstLoadedRef = useRef(false); const firstLoadedRef = useRef(false);
useEffect(() => { useEffect(() => {
if ( if (
@@ -542,12 +543,12 @@ const CreateProject: React.FC<Props> = ({
) { ) {
formProps.setValue( formProps.setValue(
"totalManhour", "totalManhour",
Math.ceil(expectedProjectFee / ratePerManhour),
Math.ceil((expectedProjectFee - (subContractFee ?? 0)) / ratePerManhour),
); );
} else { } else {
firstLoadedRef.current = true; firstLoadedRef.current = true;
} }
}, [expectedProjectFee, ratePerManhour]);
}, [expectedProjectFee, subContractFee, ratePerManhour]);


useEffect(() => { useEffect(() => {
if ( if (
@@ -557,7 +558,7 @@ const CreateProject: React.FC<Props> = ({
) { ) {
formProps.setValue( formProps.setValue(
"totalManhour", "totalManhour",
Math.ceil(expectedProjectFee / ratePerManhour),
Math.ceil((expectedProjectFee - (subContractFee ?? 0)) / ratePerManhour),
); );
} }
}, [totalManhour]); }, [totalManhour]);


+ 2
- 2
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx 查看文件

@@ -58,8 +58,8 @@ const GenFinancialStatusReport: React.FC<Props> & SubComponents = ({ projects, t
setLoading(true) setLoading(true)
let postData = { let postData = {
teamLeadId: -1, teamLeadId: -1,
startMonth: "1970-01-01",
endMonth: dayjs().format("YYYY-MM-DD").toString()
startMonth: "1970-01",
endMonth: dayjs().format("YYYY-MM").toString()
} }
if(query.targetDate){ if(query.targetDate){
postData.startMonth = query.targetDate postData.startMonth = query.targetDate


正在加载...
取消
保存