index.tsx 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2022-12-14 14:14:32
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2023-03-02 10:51:20
  6. * @FilePath: /BudgetManaSystem/src/pages/Home/index.tsx
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. import BMSPagecontainer from '@/components/BMSPageContainer';
  10. import { useModel } from '@umijs/max';
  11. import React, { useEffect, useState } from 'react';
  12. import { history } from 'umi';
  13. import { Image } from 'antd';
  14. import img1 from '../../../static/wenzichatu1.png';
  15. import img2 from '../../../static/wenzichatu2.png';
  16. import img3 from '../../../static/wenzichatu3.png';
  17. import img4 from '../../../static/wenzichatu4.png';
  18. import img5 from '../../../static/wenzichatu5.png';
  19. import img6 from '../../../static/wenzichatu6.png';
  20. import img7 from '../../../static/wenzichatu7.png';
  21. import './style.less';
  22. import { getComputeDate, getIndexData } from './service';
  23. import { createFromIconfontCN } from '@ant-design/icons';
  24. const IconFont = createFromIconfontCN({
  25. scriptUrl: '//at.alicdn.com/t/c/font_3878861_an6cq2h7omc.js',
  26. });
  27. const HomePage: React.FC = () => {
  28. const [tabList, set_tabList] = useState([
  29. {
  30. name: '月度结转',
  31. status: 0
  32. },
  33. {
  34. name: '设置信息',
  35. status: 0
  36. },
  37. {
  38. name: '绩效数据',
  39. status: 0
  40. },
  41. {
  42. name: '薪酬预算',
  43. status: 0
  44. },
  45. {
  46. name: '一次分配',
  47. status: 0
  48. },
  49. {
  50. name: '二次分配',
  51. status: 0
  52. },
  53. {
  54. name: '报表查询',
  55. status: 0
  56. }
  57. ]);
  58. const [currentActivedTabIndex, set_currentActivedTabIndex] = useState(0);
  59. const [currentComputeDate, set_currentComputeDate] = useState('');
  60. const imgList = [
  61. img1, img2, img3, img4, img5, img6, img7
  62. ]
  63. const tabClickHandle = (index: number) => {
  64. set_currentActivedTabIndex(index);
  65. }
  66. const getIndexPageData = async (date: string) => {
  67. const respArr = await getIndexData(date);
  68. const current = respArr.filter(item => item.status == 1);
  69. const completed = respArr.filter(item => item.status == 2);
  70. const completedNames = completed.map(item => item.name);
  71. if (current.length > 0) {
  72. const _tabList = tabList.map(a => {
  73. if (a.name == current[0].name) {
  74. return {
  75. ...a,
  76. status: 1
  77. }
  78. } else if (completedNames.includes(a.name)) {
  79. return {
  80. ...a,
  81. status: 2
  82. }
  83. } else {
  84. return a
  85. }
  86. });
  87. set_tabList([..._tabList as any]);
  88. }
  89. }
  90. const getCurrentComputeDate = async () => {
  91. const resp = await getComputeDate();
  92. set_currentComputeDate(resp);
  93. }
  94. const goPageHandle = (num: number) => {
  95. if (num == 1) {
  96. history.push('/budgetMana/monthlySet');
  97. }
  98. if (num == 2) {
  99. history.push('/budgetMana/monthlyInfoCheck');
  100. }
  101. if (num == 3) {
  102. history.push('/budgetMana/monthlyDataCheck');
  103. }
  104. if (num == 4) {
  105. history.push('/budgetMana/personnelSalaryBudget');
  106. }
  107. if (num == 5) {
  108. history.push('/budgetMana/oneBatch');
  109. }
  110. }
  111. useEffect(() => {
  112. if (currentComputeDate) {
  113. getIndexPageData(currentComputeDate);
  114. }
  115. }, [currentComputeDate])
  116. useEffect(() => {
  117. getCurrentComputeDate();
  118. }, []);
  119. return (
  120. <BMSPagecontainer className='HomePage' title={`核算年月:${currentComputeDate}`} ghost>
  121. <div className='tabWrap'>
  122. {
  123. tabList.map((item, index) => {
  124. return (
  125. <React.Fragment key={index}>
  126. <div className={currentActivedTabIndex == index ? 'tab on' : 'tab'} key={index} onMouseEnter={() => tabClickHandle(index)}>
  127. <div className={item.status == 2 || item.status == 1 ? 'index active' : 'index'}>
  128. {index + 1}
  129. {item.status == 1 && <span className='point'></span>}
  130. </div>
  131. <span className='name'>{item.name}</span>
  132. </div>
  133. {(index != 6) && <div className='point'>...</div>}
  134. </React.Fragment>
  135. )
  136. })
  137. }
  138. </div>
  139. <div className='tabRelaContent'>
  140. {
  141. currentActivedTabIndex == 0 && (
  142. <div className={'step active'} onClick={() => { goPageHandle(1) }}>
  143. <div className="title" >
  144. 月度结转
  145. <IconFont type='icon-jinru' />
  146. {/* <span onClick={()=>{goPageHandle(1)}}>进入功能</span> */}
  147. </div>
  148. <div className='detail'>明确当前核算年月并可结转进入下一个周期的核算或者回退到上一个周期进程开账重算</div>
  149. </div>
  150. )
  151. }
  152. {
  153. currentActivedTabIndex == 1 && (
  154. <div className={'step active'} onClick={() => { goPageHandle(2) }}>
  155. <div className={tabList[1].status == 0 ? 'title' : 'title active'} >
  156. 设置信息
  157. <IconFont type='icon-jinru' />
  158. {/* <span onClick={()=>{goPageHandle(2)}}>进入功能</span> */}
  159. </div>
  160. <div className='detail'>根据设置生成各核算单元当月的人员、科室、收费项目信息,可快捷进入设置界面调整并重新生成,操作人员需确认各单元的设置信息都正确方可进入下一步核算操作</div>
  161. </div>
  162. )
  163. }
  164. {
  165. currentActivedTabIndex == 2 && (
  166. <div className={'step active'} onClick={() => { goPageHandle(3) }}>
  167. <div className={tabList[2].status == 0 ? 'title' : 'title active'} >
  168. 绩效数据
  169. <IconFont type='icon-jinru' />
  170. {/* <span onClick={()=>{goPageHandle(3)}}>进入功能</span> */}
  171. </div>
  172. <div className='detail'>自动获取及手动填报当月绩效核算所需的数据,操作人员需确认核算所需的数据都已添加完成方可进入下一步核算操作</div>
  173. </div>
  174. )
  175. }
  176. {
  177. currentActivedTabIndex == 3 && (
  178. <div className={'step active'} onClick={() => { goPageHandle(4) }}>
  179. <div className={tabList[3].status == 0 ? 'title' : 'title active'} >
  180. 薪酬预算
  181. <IconFont type='icon-jinru' />
  182. {/* <span onClick={()=>{goPageHandle(4)}}>进入功能</span> */}
  183. </div>
  184. <div className='detail'>进行人事薪酬预算得到全院人事成本、各职系人事成本占比及各职系参与考核奖金信息,需保存预算数据方可进入下一步</div>
  185. </div>
  186. )
  187. }
  188. {
  189. currentActivedTabIndex == 4 && (
  190. <div className={'step active'} onClick={() => { goPageHandle(5) }}>
  191. <div className={tabList[4].status == 0 ? 'title' : 'title active'} >
  192. 一次分配
  193. <IconFont type='icon-jinru' />
  194. {/* <span onClick={()=>{goPageHandle(5)}}>进入功能</span> */}
  195. </div>
  196. <div className='detail'>通过计算得到各职系所有核算单元的工作量绩效、运营绩效、管理绩效信息,需审核确认方可进入下一步各核算单元的二次分配操作</div>
  197. </div>
  198. )
  199. }
  200. {
  201. currentActivedTabIndex == 5 && (
  202. <div className={'multiStep active'}>
  203. <div className='block'>
  204. <div className='title'>
  205. 二次分配数据核定
  206. <IconFont type='icon-jinru' />
  207. </div>
  208. <div className='detail'>各核算单元的绩效专员添加及提交各自负责核算单元二次分配所需的数据</div>
  209. </div>
  210. <div className='block'>
  211. <div className='title'>
  212. 二次分配计算
  213. <IconFont type='icon-jinru' />
  214. </div>
  215. <div className='detail'>计算得到各负责单元的二次分配奖金数据,确认所有人员分配无误后提交至绩效组人员审核</div>
  216. </div>
  217. <div className='block'>
  218. <div className='title'>
  219. 二次分配审核
  220. <IconFont type='icon-jinru' />
  221. </div>
  222. <div className='detail'>绩效组成员查看各核算单元的二次分配情况,并进行审核确认</div>
  223. </div>
  224. </div>
  225. )
  226. }
  227. {
  228. currentActivedTabIndex == 6 && (
  229. <div className={'multiStep active'}>
  230. <div className='block'>
  231. <div className='title'>
  232. 一次分配报表
  233. <IconFont type='icon-jinru' />
  234. </div>
  235. <div className='detail'>可查询历史一次分配报表记录及各职系一次分配的详细报表信息</div>
  236. </div>
  237. <div className='block'>
  238. <div className='title'>
  239. 二次分配报表
  240. <IconFont type='icon-jinru' />
  241. </div>
  242. <div className='detail'>可查询历史二次分配报表记录及各核算单元二次分配的详细报表信息</div>
  243. </div>
  244. <div className='block'>
  245. <div className='title'>
  246. 个人奖金报表
  247. <IconFont type='icon-jinru' />
  248. </div>
  249. <div className='detail'>可查询员工个人的完整奖金明细数据,包括历次核算的奖金记录信息</div>
  250. </div>
  251. </div>
  252. )
  253. }
  254. </div>
  255. <div className='map'>
  256. <Image
  257. // width={'50vw'}
  258. // height={'25vw'}
  259. width={'850px'}
  260. height={'425px'}
  261. preview={false}
  262. src={imgList[currentActivedTabIndex]}
  263. />
  264. </div>
  265. </BMSPagecontainer>
  266. );
  267. };
  268. export default HomePage;