index.tsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2022-12-14 14:14:32
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2023-07-31 09:57:32
  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,Modal } 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, getReportPath } from './service';
  23. import { createFromIconfontCN } from '@ant-design/icons';
  24. import { useAccess } from '@umijs/max';
  25. const IconFont = createFromIconfontCN({
  26. scriptUrl: '//at.alicdn.com/t/c/font_3878861_an6cq2h7omc.js',
  27. });
  28. const HomePage: React.FC = () => {
  29. const [tabList, set_tabList] = useState([
  30. {
  31. name: '月度结转',
  32. status: 0
  33. },
  34. {
  35. name: '设置信息',
  36. status: 0
  37. },
  38. {
  39. name: '绩效数据',
  40. status: 0
  41. },
  42. {
  43. name: '薪酬预算',
  44. status: 0
  45. },
  46. {
  47. name: '一次分配',
  48. status: 0
  49. },
  50. {
  51. name: '二次分配',
  52. status: 0
  53. },
  54. {
  55. name: '报表查询',
  56. status: 0
  57. }
  58. ]);
  59. const [currentActivedTabIndex, set_currentActivedTabIndex] = useState(0);
  60. const [currentComputeDate, set_currentComputeDate] = useState('');
  61. const imgList = [
  62. img1, img2, img3, img4, img5, img6, img7
  63. ];
  64. const access = useAccess();
  65. const tabClickHandle = (index: number) => {
  66. set_currentActivedTabIndex(index);
  67. }
  68. const getIndexPageData = async (date: string) => {
  69. const respArr = await getIndexData(date);
  70. const current = respArr.filter(item => item.status == 1);
  71. const completed = respArr.filter(item => item.status == 2);
  72. const completedNames = completed.map(item => item.name);
  73. if (current.length > 0) {
  74. const _tabList = tabList.map(a => {
  75. if (a.name == current[0].name) {
  76. return {
  77. ...a,
  78. status: 1
  79. }
  80. } else if (completedNames.includes(a.name)) {
  81. return {
  82. ...a,
  83. status: 2
  84. }
  85. } else {
  86. return a
  87. }
  88. });
  89. set_tabList([..._tabList as any]);
  90. }
  91. }
  92. const getCurrentComputeDate = async () => {
  93. const resp = await getComputeDate();
  94. set_currentComputeDate(resp);
  95. }
  96. const goPageHandle = async (num: number) => {
  97. let flag = true;
  98. if (num == 1) {
  99. let path = '/budgetMana/monthlySet';
  100. if(access.canIReadThisPage(path)){
  101. history.push(path);
  102. }else{
  103. flag = false
  104. }
  105. }
  106. if (num == 2) {
  107. let path = '/budgetMana/monthlyInfoCheck';
  108. if(access.canIReadThisPage(path)){
  109. history.push(path);
  110. }else{
  111. flag = false
  112. }
  113. }
  114. if (num == 3) {
  115. let path = '/budgetMana/monthlyDataCheck';
  116. if(access.canIReadThisPage(path)){
  117. history.push(path);
  118. }else{
  119. flag = false
  120. }
  121. }
  122. if (num == 4) {
  123. let path = '/budgetMana/personnelSalaryBudget';
  124. if(access.canIReadThisPage(path)){
  125. history.push(path);
  126. }else{
  127. flag = false
  128. }
  129. }
  130. if (num == 5) {
  131. let path = '/budgetMana/oneBatch';
  132. if(access.canIReadThisPage(path)){
  133. history.push(path);
  134. }else{
  135. flag = false
  136. }
  137. }
  138. if (num == 6) {
  139. let path = '/secondaryDistribute/employeeInfoCheck';
  140. if(access.canIReadThisPage(path)){
  141. history.push(path);
  142. }else{
  143. flag = false
  144. }
  145. }
  146. if (num == 7) {
  147. let path = '/secondaryDistribute/secondaryDitriComputed';
  148. if(access.canIReadThisPage(path)){
  149. history.push(path);
  150. }else{
  151. flag = false
  152. }
  153. }
  154. if (num == 8) {
  155. let path = '/secondaryDistribute/secondaryDitriCheck';
  156. if(access.canIReadThisPage(path)){
  157. history.push(path);
  158. }else{
  159. flag = false
  160. }
  161. }
  162. if (num == 9) {
  163. let path = '/undefined';
  164. const resp = await getReportPath({pageSize:500,current:1});
  165. if(resp){
  166. const result = resp.list.filter((a:any)=>a.code == '1663015052728475648');
  167. if(result.length>0)path = result[0].value
  168. }
  169. if(access.canIReadThisPage(path)){
  170. history.push(path);
  171. }else{
  172. flag = false
  173. }
  174. }
  175. if (num == 10) {
  176. let path = '/undefined';
  177. const resp = await getReportPath({pageSize:500,current:1});
  178. if(resp){
  179. const result = resp.list.filter((a:any)=>a.code == '1663015712702210048');
  180. if(result.length>0)path = result[0].value
  181. }
  182. if(access.canIReadThisPage(path)){
  183. history.push(path);
  184. }else{
  185. flag = false
  186. }
  187. }
  188. if (num == 11) {
  189. let path = '/undefined';
  190. const resp = await getReportPath({pageSize:500,current:1});
  191. if(resp){
  192. const result = resp.list.filter((a:any)=>a.code == '1663015814632185856');
  193. if(result.length>0)path = result[0].value
  194. }
  195. if(access.canIReadThisPage(path)){
  196. history.push(path);
  197. }else{
  198. flag = false
  199. }
  200. }
  201. if (num == 12) {
  202. //history.push('/secondaryDistribute/secondaryDitriCheck');
  203. }
  204. if(!flag){
  205. Modal.error({
  206. title:'抱歉,暂无访问权限!'
  207. })
  208. }
  209. }
  210. useEffect(() => {
  211. if (currentComputeDate) {
  212. getIndexPageData(currentComputeDate);
  213. }
  214. }, [currentComputeDate])
  215. useEffect(() => {
  216. getCurrentComputeDate();
  217. }, []);
  218. return (
  219. <BMSPagecontainer className='HomePage' title={`核算年月:${currentComputeDate}`} ghost>
  220. <div className='tabWrap'>
  221. {
  222. tabList.map((item, index) => {
  223. return (
  224. <React.Fragment key={index}>
  225. <div className={currentActivedTabIndex == index ? 'tab on' : 'tab'} key={index} onMouseEnter={() => tabClickHandle(index)}>
  226. <div className={item.status == 2 || item.status == 1 ? 'index active' : 'index'}>
  227. {index + 1}
  228. {item.status == 1 && <span className='point'></span>}
  229. </div>
  230. <span className='name'>{item.name}</span>
  231. </div>
  232. {(index != 6) && <div className='point'>...</div>}
  233. </React.Fragment>
  234. )
  235. })
  236. }
  237. </div>
  238. <div className='tabRelaContent'>
  239. {
  240. currentActivedTabIndex == 0 && (
  241. <div className={'step active'} onClick={() => { goPageHandle(1) }}>
  242. <div className="title" >
  243. 月度结转
  244. <IconFont type='icon-jinru' />
  245. {/* <span onClick={()=>{goPageHandle(1)}}>进入功能</span> */}
  246. </div>
  247. <div className='detail'>明确当前核算年月并可结转进入下一个周期的核算或者回退到上一个周期进程开账重算</div>
  248. </div>
  249. )
  250. }
  251. {
  252. currentActivedTabIndex == 1 && (
  253. <div className={'step active'} onClick={() => { goPageHandle(2) }}>
  254. <div className={tabList[1].status == 0 ? 'title' : 'title active'} >
  255. 设置信息
  256. <IconFont type='icon-jinru' />
  257. {/* <span onClick={()=>{goPageHandle(2)}}>进入功能</span> */}
  258. </div>
  259. <div className='detail'>根据设置生成各核算单元当月的人员、科室、收费项目信息,可快捷进入设置界面调整并重新生成,操作人员需确认各单元的设置信息都正确方可进入下一步核算操作</div>
  260. </div>
  261. )
  262. }
  263. {
  264. currentActivedTabIndex == 2 && (
  265. <div className={'step active'} onClick={() => { goPageHandle(3) }}>
  266. <div className={tabList[2].status == 0 ? 'title' : 'title active'} >
  267. 绩效数据
  268. <IconFont type='icon-jinru' />
  269. {/* <span onClick={()=>{goPageHandle(3)}}>进入功能</span> */}
  270. </div>
  271. <div className='detail'>自动获取及手动填报当月绩效核算所需的数据,操作人员需确认核算所需的数据都已添加完成方可进入下一步核算操作</div>
  272. </div>
  273. )
  274. }
  275. {
  276. currentActivedTabIndex == 3 && (
  277. <div className={'step active'} onClick={() => { goPageHandle(4) }}>
  278. <div className={tabList[3].status == 0 ? 'title' : 'title active'} >
  279. 薪酬预算
  280. <IconFont type='icon-jinru' />
  281. {/* <span onClick={()=>{goPageHandle(4)}}>进入功能</span> */}
  282. </div>
  283. <div className='detail'>进行人事薪酬预算得到全院人事成本、各职系人事成本占比及各职系参与考核奖金信息,需保存预算数据方可进入下一步</div>
  284. </div>
  285. )
  286. }
  287. {
  288. currentActivedTabIndex == 4 && (
  289. <div className={'step active'} onClick={() => { goPageHandle(5) }}>
  290. <div className={tabList[4].status == 0 ? 'title' : 'title active'} >
  291. 一次分配
  292. <IconFont type='icon-jinru' />
  293. {/* <span onClick={()=>{goPageHandle(5)}}>进入功能</span> */}
  294. </div>
  295. <div className='detail'>通过计算得到各职系所有核算单元的工作量绩效、运营绩效、管理绩效信息,需审核确认方可进入下一步各核算单元的二次分配操作</div>
  296. </div>
  297. )
  298. }
  299. {
  300. currentActivedTabIndex == 5 && (
  301. <div className={'multiStep active'}>
  302. <div className='block' onClick={() => { goPageHandle(6) }}>
  303. <div className='title'>
  304. 二次分配数据核定
  305. <IconFont type='icon-jinru' />
  306. </div>
  307. <div className='detail'>各核算单元的绩效专员添加及提交各自负责核算单元二次分配所需的数据</div>
  308. </div>
  309. <div className='block' onClick={() => { goPageHandle(7) }}>
  310. <div className='title'>
  311. 二次分配计算
  312. <IconFont type='icon-jinru' />
  313. </div>
  314. <div className='detail'>计算得到各负责单元的二次分配奖金数据,确认所有人员分配无误后提交至绩效组人员审核</div>
  315. </div>
  316. <div className='block' onClick={() => { goPageHandle(8) }}>
  317. <div className='title'>
  318. 二次分配审核
  319. <IconFont type='icon-jinru' />
  320. </div>
  321. <div className='detail'>绩效组成员查看各核算单元的二次分配情况,并进行审核确认</div>
  322. </div>
  323. </div>
  324. )
  325. }
  326. {
  327. currentActivedTabIndex == 6 && (
  328. <div className={'multiStep active'}>
  329. <div className='block' onClick={() => { goPageHandle(9) }}>
  330. <div className='title'>
  331. 一次分配报表
  332. <IconFont type='icon-jinru' />
  333. </div>
  334. <div className='detail'>可查询历史一次分配报表记录及各职系一次分配的详细报表信息</div>
  335. </div>
  336. <div className='block' onClick={() => { goPageHandle(10) }}>
  337. <div className='title'>
  338. 二次分配报表
  339. <IconFont type='icon-jinru' />
  340. </div>
  341. <div className='detail'>可查询历史二次分配报表记录及各核算单元二次分配的详细报表信息</div>
  342. </div>
  343. <div className='block' onClick={() => { goPageHandle(11) }}>
  344. <div className='title'>
  345. 个人奖金报表
  346. <IconFont type='icon-jinru' />
  347. </div>
  348. <div className='detail'>可查询员工个人的完整奖金明细数据,包括历次核算的奖金记录信息</div>
  349. </div>
  350. </div>
  351. )
  352. }
  353. </div>
  354. <div className='map'>
  355. <Image
  356. // width={'50vw'}
  357. // height={'25vw'}
  358. width={'850px'}
  359. height={'425px'}
  360. preview={false}
  361. src={imgList[currentActivedTabIndex]}
  362. />
  363. </div>
  364. </BMSPagecontainer>
  365. );
  366. };
  367. export default HomePage;