@@ -46,7 +46,7 @@ export interface ProjectPotentialDelayReportRequest { | |||||
// - Monthly Work Hours Report | // - Monthly Work Hours Report | ||||
export interface MonthlyWorkHoursReportFilter { | export interface MonthlyWorkHoursReportFilter { | ||||
staff: string[]; | staff: string[]; | ||||
date: any; | |||||
date: string; | |||||
} | } | ||||
export interface MonthlyWorkHoursReportRequest { | export interface MonthlyWorkHoursReportRequest { | ||||
@@ -20,17 +20,17 @@ export interface CreateStaffInputs { | |||||
companyId: number; | companyId: number; | ||||
salaryId: number; | salaryId: number; | ||||
skillSetId?: number[]; | skillSetId?: number[]; | ||||
joinDate: string; | |||||
joinDate?: string; | |||||
currentPositionId: number; | currentPositionId: number; | ||||
joinPositionId: number; | |||||
joinPositionId?: number; | |||||
gradeId?: number; | gradeId?: number; | ||||
teamId?: number | teamId?: number | ||||
departmentId: number; | |||||
departmentId?: number; | |||||
phone1: string; | phone1: string; | ||||
phone2?: string; | phone2?: string; | ||||
email: string; | email: string; | ||||
emergContactName: string; | |||||
emergContactPhone: string; | |||||
emergContactName?: string; | |||||
emergContactPhone?: string; | |||||
employType: string; | employType: string; | ||||
departDate?: string; | departDate?: string; | ||||
departReason?: string; | departReason?: string; | ||||
@@ -63,7 +63,7 @@ const Profile: React.FC<Props> = ({ avatarImageSrc, profileName }) => { | |||||
{profileName} | {profileName} | ||||
</Typography> | </Typography> | ||||
<Divider /> | <Divider /> | ||||
<MenuItem onClick={() => { router.replace("/settings/changepassword") }}>{t("Change Password")}</MenuItem> | |||||
<MenuItem onClick={() => { router.replace("/changepassword") }}>{t("Change Password")}</MenuItem> | |||||
{language === "zh" && <MenuItem onClick={() => { onLangClick("en") }}>{t("Change To English Version")}</MenuItem>} | {language === "zh" && <MenuItem onClick={() => { onLangClick("en") }}>{t("Change To English Version")}</MenuItem>} | ||||
{language === "en" && <MenuItem onClick={() => { onLangClick("zh") }}>{t("Change To Chinese Version")}</MenuItem>} | {language === "en" && <MenuItem onClick={() => { onLangClick("zh") }}>{t("Change To Chinese Version")}</MenuItem>} | ||||
<MenuItem onClick={() => signOut()}>{t("Sign out")}</MenuItem> | <MenuItem onClick={() => signOut()}>{t("Sign out")}</MenuItem> | ||||
@@ -49,11 +49,17 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ staffs }) => { | |||||
formType={"download"} | formType={"download"} | ||||
criteria={searchCriteria} | criteria={searchCriteria} | ||||
onSearch={async (query: any) => { | onSearch={async (query: any) => { | ||||
console.log(query); | |||||
const index = staffCombo.findIndex((staff) => staff === query.staff); | const index = staffCombo.findIndex((staff) => staff === query.staff); | ||||
const response = await fetchMonthlyWorkHoursReport({ | |||||
let postData = { | |||||
id: staffs[index].id, | id: staffs[index].id, | ||||
yearMonth: query.date, | |||||
}); | |||||
yearMonth: dayjs().format("YYYY-MM").toString(), | |||||
}; | |||||
console.log(query.date.length > 0) | |||||
if (query.date.length > 0) { | |||||
postData.yearMonth = query.date | |||||
} | |||||
const response = await fetchMonthlyWorkHoursReport(postData); | |||||
if (response) { | if (response) { | ||||
downloadFile( | downloadFile( | ||||
new Uint8Array(response.blobValue), | new Uint8Array(response.blobValue), | ||||