/* * @Author: code4eat awesomedema@gmail.com * @Date: 2022-12-14 14:14:32 * @LastEditors: code4eat awesomedema@gmail.com * @LastEditTime: 2023-07-31 09:57:32 * @FilePath: /BudgetManaSystem/src/pages/Home/index.tsx * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import BMSPagecontainer from '@/components/BMSPageContainer'; import { useModel } from '@umijs/max'; import React, { useEffect, useState } from 'react'; import { history } from 'umi'; import { Image,Modal } from 'antd'; import img1 from '../../../static/wenzichatu1.png'; import img2 from '../../../static/wenzichatu2.png'; import img3 from '../../../static/wenzichatu3.png'; import img4 from '../../../static/wenzichatu4.png'; import img5 from '../../../static/wenzichatu5.png'; import img6 from '../../../static/wenzichatu6.png'; import img7 from '../../../static/wenzichatu7.png'; import './style.less'; import { getComputeDate, getIndexData, getReportPath } from './service'; import { createFromIconfontCN } from '@ant-design/icons'; import { useAccess } from '@umijs/max'; const IconFont = createFromIconfontCN({ scriptUrl: '//at.alicdn.com/t/c/font_3878861_an6cq2h7omc.js', }); const HomePage: React.FC = () => { const [tabList, set_tabList] = useState([ { name: '月度结转', status: 0 }, { name: '设置信息', status: 0 }, { name: '绩效数据', status: 0 }, { name: '薪酬预算', status: 0 }, { name: '一次分配', status: 0 }, { name: '二次分配', status: 0 }, { name: '报表查询', status: 0 } ]); const [currentActivedTabIndex, set_currentActivedTabIndex] = useState(0); const [currentComputeDate, set_currentComputeDate] = useState(''); const imgList = [ img1, img2, img3, img4, img5, img6, img7 ]; const access = useAccess(); const tabClickHandle = (index: number) => { set_currentActivedTabIndex(index); } const getIndexPageData = async (date: string) => { const respArr = await getIndexData(date); const current = respArr.filter(item => item.status == 1); const completed = respArr.filter(item => item.status == 2); const completedNames = completed.map(item => item.name); if (current.length > 0) { const _tabList = tabList.map(a => { if (a.name == current[0].name) { return { ...a, status: 1 } } else if (completedNames.includes(a.name)) { return { ...a, status: 2 } } else { return a } }); set_tabList([..._tabList as any]); } } const getCurrentComputeDate = async () => { const resp = await getComputeDate(); set_currentComputeDate(resp); } const goPageHandle = async (num: number) => { let flag = true; if (num == 1) { let path = '/budgetMana/monthlySet'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 2) { let path = '/budgetMana/monthlyInfoCheck'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 3) { let path = '/budgetMana/monthlyDataCheck'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 4) { let path = '/budgetMana/personnelSalaryBudget'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 5) { let path = '/budgetMana/oneBatch'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 6) { let path = '/secondaryDistribute/employeeInfoCheck'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 7) { let path = '/secondaryDistribute/secondaryDitriComputed'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 8) { let path = '/secondaryDistribute/secondaryDitriCheck'; if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 9) { let path = '/undefined'; const resp = await getReportPath({pageSize:500,current:1}); if(resp){ const result = resp.list.filter((a:any)=>a.code == '1663015052728475648'); if(result.length>0)path = result[0].value } if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 10) { let path = '/undefined'; const resp = await getReportPath({pageSize:500,current:1}); if(resp){ const result = resp.list.filter((a:any)=>a.code == '1663015712702210048'); if(result.length>0)path = result[0].value } if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 11) { let path = '/undefined'; const resp = await getReportPath({pageSize:500,current:1}); if(resp){ const result = resp.list.filter((a:any)=>a.code == '1663015814632185856'); if(result.length>0)path = result[0].value } if(access.canIReadThisPage(path)){ history.push(path); }else{ flag = false } } if (num == 12) { //history.push('/secondaryDistribute/secondaryDitriCheck'); } if(!flag){ Modal.error({ title:'抱歉,暂无访问权限!' }) } } useEffect(() => { if (currentComputeDate) { getIndexPageData(currentComputeDate); } }, [currentComputeDate]) useEffect(() => { getCurrentComputeDate(); }, []); return (
{ tabList.map((item, index) => { return (
tabClickHandle(index)}>
{index + 1} {item.status == 1 && }
{item.name}
{(index != 6) &&
...
}
) }) }
{ currentActivedTabIndex == 0 && (
{ goPageHandle(1) }}>
月度结转 {/* {goPageHandle(1)}}>进入功能 */}
明确当前核算年月并可结转进入下一个周期的核算或者回退到上一个周期进程开账重算
) } { currentActivedTabIndex == 1 && (
{ goPageHandle(2) }}>
设置信息 {/* {goPageHandle(2)}}>进入功能 */}
根据设置生成各核算单元当月的人员、科室、收费项目信息,可快捷进入设置界面调整并重新生成,操作人员需确认各单元的设置信息都正确方可进入下一步核算操作
) } { currentActivedTabIndex == 2 && (
{ goPageHandle(3) }}>
绩效数据 {/* {goPageHandle(3)}}>进入功能 */}
自动获取及手动填报当月绩效核算所需的数据,操作人员需确认核算所需的数据都已添加完成方可进入下一步核算操作
) } { currentActivedTabIndex == 3 && (
{ goPageHandle(4) }}>
薪酬预算 {/* {goPageHandle(4)}}>进入功能 */}
进行人事薪酬预算得到全院人事成本、各职系人事成本占比及各职系参与考核奖金信息,需保存预算数据方可进入下一步
) } { currentActivedTabIndex == 4 && (
{ goPageHandle(5) }}>
一次分配 {/* {goPageHandle(5)}}>进入功能 */}
通过计算得到各职系所有核算单元的工作量绩效、运营绩效、管理绩效信息,需审核确认方可进入下一步各核算单元的二次分配操作
) } { currentActivedTabIndex == 5 && (
{ goPageHandle(6) }}>
二次分配数据核定
各核算单元的绩效专员添加及提交各自负责核算单元二次分配所需的数据
{ goPageHandle(7) }}>
二次分配计算
计算得到各负责单元的二次分配奖金数据,确认所有人员分配无误后提交至绩效组人员审核
{ goPageHandle(8) }}>
二次分配审核
绩效组成员查看各核算单元的二次分配情况,并进行审核确认
) } { currentActivedTabIndex == 6 && (
{ goPageHandle(9) }}>
一次分配报表
可查询历史一次分配报表记录及各职系一次分配的详细报表信息
{ goPageHandle(10) }}>
二次分配报表
可查询历史二次分配报表记录及各核算单元二次分配的详细报表信息
{ goPageHandle(11) }}>
个人奖金报表
可查询员工个人的完整奖金明细数据,包括历次核算的奖金记录信息
) }
); }; export default HomePage;