index.tsx 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2022-12-16 09:42:52
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2023-09-26 10:03:20
  6. * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/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 { useEffect, useRef, useState } from 'react';
  11. import './style.less';
  12. import { Tree, TreeProps, Tabs, Input, Modal, Transfer, Divider, Select, Popconfirm, message, Button, Skeleton, Popover, Tooltip, InputNumber } from 'antd';
  13. import { DataNode } from 'antd/es/tree';
  14. import expandedIcon from '../../../../static/treenode_open.png';
  15. import closeIcon from '../../../../static/treenode_collapse.png';
  16. import { BMSTable } from '@/components/BMSTable';
  17. import { ActionType, ModalForm, ProColumns, ProColumnType, ProForm, ProFormDependency, ProFormDigit, ProFormInstance, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect } from '@ant-design/pro-components';
  18. import { createFromIconfontCN } from '@ant-design/icons';
  19. import { addTableData, checkMonthlyReq, delTableDataRequest, downloadTemplateReq, editCheckProject, editManaIndexTableData, editTableData, editTableSalaryRequest, editUnitCostTableData, generateCheckProjectTableData, generateUnitCostTableData, getCheckItemCalcStatus, getCheckProjectTableData, getCostData, getDepLists, getEmps, getHesuanUnits, getIncomeData, getManaIndexGroup, getManaIndexTableData, getManaIndicatorJiangchengCoefficient, getNoCheckTableData, getPageCheckStatus, getProjects, getSalaryInfoTableData, getUnitCostTableData, importMonthlyperformanceRelaFiles } from './service';
  20. import editIcon from '../../../../static/editIcon.png';
  21. import conformIcon from '../../../../static/confirmIcon.png';
  22. import { getComputeDate } from '@/pages/Home/service';
  23. import BMSModalForm from '@/components/BMSModalForm';
  24. import { DefaultOptionType } from 'antd/es/select';
  25. import { getTreeData, getTreeDataRespType } from '../monthlyInfoCheck/service';
  26. import DirectoryTree from 'antd/es/tree/DirectoryTree';
  27. import BMSUpload from '@/components/BMSUpload';
  28. import FormItem from 'antd/es/form/FormItem';
  29. import { getDeepestTreeData, searchLeaves } from '@/utils/tooljs';
  30. import '../../../utils/zhongtaiA'
  31. import { formatMoneyNumber } from '@/utils/format';
  32. import { getJiezhuanStatus } from '../monthlySet/service';
  33. import { useAccess } from '@umijs/max';
  34. const IconFont = createFromIconfontCN({
  35. scriptUrl: '',
  36. });
  37. export type TableListItem = {
  38. key: number;
  39. name: string;
  40. };
  41. const tabData = [
  42. {
  43. label: `固定工资`,
  44. key: 'kpi_salary',
  45. },
  46. {
  47. label: `单元成本数据`,
  48. key: 'kpi_unit_cost',
  49. },
  50. {
  51. label: `非考核项目`,
  52. key: 'kpi_non_assessment',
  53. },
  54. {
  55. label: `考核项目`,
  56. key: 'kpi_assessment',
  57. },
  58. {
  59. label: `管理指标`,
  60. key: 'kpi_manage_indicator',
  61. },
  62. {
  63. label: `收入数据`,
  64. key: 'kpi_income',
  65. },
  66. {
  67. label: `成本数据`,
  68. key: 'kpi_cost',
  69. },
  70. ]
  71. const MonthlyDataCheck: React.FC = () => {
  72. const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
  73. const [ifShowTip, set_ifShowTip] = useState(false);
  74. const [unitSearchKeywords, set_unitSearchKeywords] = useState<string | undefined>(undefined); //核算单元搜素关键词
  75. const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
  76. const [searchValue, setSearchValue] = useState('');
  77. const [autoExpandParent, setAutoExpandParent] = useState(true);
  78. const [auditType, set_auditType] = useState('0');
  79. const [tableColumn, set_tableColumn] = useState<ProColumns & { [key: string]: any }[]>([]);
  80. const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
  81. const [currentSelectedTabKey, set_currentSelectedTabKey] = useState<string>('');
  82. const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(undefined);
  83. const [editTableCellId, set_editTableCellId] = useState<number | undefined>(undefined);
  84. const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
  85. const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>(undefined);
  86. const [editModalVisible, set_editModalVisible] = useState(false);
  87. const [loading, set_loading] = useState(false);
  88. const [currentEditRecord, set_currentEditRecord] = useState<undefined | any>(undefined);
  89. const [inputSalaryNum, set_inputSalaryNum] = useState<undefined | number>(undefined); //固定工资金额
  90. const [checkItemvalNum, set_checkItemvalNum] = useState(0); //考核项目数值
  91. const [isTableEdit, set_isTableEdit] = useState(false);
  92. const [totalNum, set_totalNum] = useState(0); //收入和成本数据的总和数值
  93. const [tableH, set_tableH] = useState(0);
  94. const access = useAccess();
  95. const [tabs, set_tabs] = useState<any[]>([]);
  96. const [ifBanAllAction, set_ifBanAllAction] = useState(true); //是否掩藏所有操作
  97. const [computeMethod, set_computeMethod] = useState('1'); //1按考核分级 2按总分
  98. const [unitCostComputeData, set_unitCostComputeData] = useState({ unitCostTotal: 0, unitCostCtrlTotal: 0 })
  99. const [manaIndexGroups, set_manaIndexGroups] = useState<{
  100. depiction: any; id: number, groupCode: string, groupName: string, hospId: number
  101. }[]>([]); //管理指标分组
  102. const [currentSelectedManaGroup, set_currentSelectedManaGroup] = useState<{ id: number, groupCode: string, groupName: string, hospId: number }>();
  103. const formRef = useRef<ProFormInstance>();
  104. const tableRef = useRef<ActionType>();
  105. const tableColumnOne: ProColumns[] = [
  106. {
  107. title: '职类',
  108. dataIndex: 'unitTypeName',
  109. key: 'unitTypeName',
  110. },
  111. {
  112. title: '核算单元名称',
  113. dataIndex: 'unitName',
  114. key: 'unitName',
  115. },
  116. {
  117. title: '科室',
  118. dataIndex: 'deptName',
  119. key: 'deptName',
  120. },
  121. {
  122. title: '工号',
  123. dataIndex: 'empNo',
  124. key: 'empNo',
  125. },
  126. {
  127. title: '姓名',
  128. dataIndex: 'empName',
  129. key: 'empName',
  130. },
  131. {
  132. title: '工资类型',
  133. dataIndex: 'salaryType',
  134. key: 'salaryType',
  135. },
  136. ]
  137. const tableColumnTwo = [
  138. {
  139. title: '职类',
  140. dataIndex: 'unitTypeName',
  141. key: 'unitTypeName',
  142. },
  143. {
  144. title: '核算单元名称',
  145. dataIndex: 'unitName',
  146. key: 'unitName',
  147. },
  148. {
  149. title: '科室',
  150. dataIndex: 'deptName',
  151. key: 'deptName',
  152. },
  153. {
  154. title: '项目名称',
  155. dataIndex: 'assessmentName',
  156. key: 'assessmentName',
  157. },
  158. {
  159. title: '分配方式',
  160. dataIndex: 'distributionType',
  161. key: 'distributionType',
  162. render: (record: any) => {
  163. if (record == 1) return '占比'
  164. if (record == 2) return '绝对数'
  165. if (record == 3) return '自动计算'
  166. }
  167. },
  168. {
  169. title: '数值',
  170. dataIndex: 'value',
  171. key: 'value',
  172. },
  173. {
  174. title: '工号',
  175. dataIndex: 'targetValue',
  176. key: 'targetValue',
  177. },
  178. {
  179. title: '姓名',
  180. dataIndex: 'targetValueName',
  181. key: 'targetValueName',
  182. },
  183. {
  184. title: '说明',
  185. dataIndex: 'description',
  186. key: 'description',
  187. }
  188. ];
  189. const tableColumnThree = [
  190. {
  191. title: '项目名称',
  192. dataIndex: 'itemName',
  193. key: 'itemName',
  194. },
  195. {
  196. title: '类型',
  197. dataIndex: 'itemTypeName',
  198. key: 'itemTypeName',
  199. },
  200. {
  201. title: '点值',
  202. dataIndex: 'orderPointValue',
  203. key: 'orderPointValue',
  204. },
  205. ];
  206. const tableColumnFive = [
  207. {
  208. title: '年度',
  209. dataIndex: 'year',
  210. key: 'year',
  211. },
  212. {
  213. title: '月份',
  214. dataIndex: 'month',
  215. key: 'month',
  216. },
  217. {
  218. title: '项目名称',
  219. dataIndex: 'itemName',
  220. key: 'itemName',
  221. },
  222. {
  223. title: '项目类型',
  224. dataIndex: 'itemTypeName',
  225. key: 'itemTypeName',
  226. },
  227. {
  228. title: '金额',
  229. dataIndex: 'cost',
  230. key: 'cost',
  231. },
  232. // {
  233. // title: '操作人',
  234. // dataIndex: 'unitType',
  235. // key: 'unitType',
  236. // align: 'center'
  237. // },
  238. // {
  239. // title: '操作时间',
  240. // dataIndex: 'unitType',
  241. // key: 'unitType',
  242. // align: 'center'
  243. // },
  244. ]
  245. const tableColumnSeven = [
  246. {
  247. title: '项目名称',
  248. dataIndex: 'name',
  249. },
  250. {
  251. title: '项目类型',
  252. dataIndex: 'costType',
  253. },
  254. {
  255. title: '金额',
  256. dataIndex: 'amount',
  257. width: 200,
  258. render: (text: any, record: any) => {
  259. if (ifBanAllAction) return formatMoneyNumber(text);
  260. return (
  261. <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'flex-start', alignItems: 'center' }}>
  262. <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center' }}>
  263. {
  264. (currentEditRecord ? currentEditRecord.id : -1) == record.id ? <InputNumber size='small' defaultValue={record.amount} placeholder='请输入' onChange={(value) => { set_currentEditRecord({ ...currentEditRecord, amount: value }) }} style={{ width: '80px' }} /> : <span>{formatMoneyNumber(text)}</span>
  265. }
  266. </div>
  267. {(auditType == '0' && record.summaryFlag == 0) && <img onClick={() => editHandleTwo(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={(currentEditRecord ? currentEditRecord.id : -1) == record.id ? conformIcon : editIcon} alt="" />}
  268. </div>
  269. )
  270. }
  271. },
  272. {
  273. title: '汇总',
  274. dataIndex: 'summaryFlag',
  275. render: (num: any, record: any) => {
  276. return record.summaryFlag == 0 ? '否' : '是'
  277. }
  278. },
  279. {
  280. title: '统计',
  281. dataIndex: 'statFlag',
  282. render: (num: any, record: any) => {
  283. return num == 0 ? '否' : '是'
  284. }
  285. },
  286. {
  287. title: '可控',
  288. dataIndex: 'ctrlFlag',
  289. render: (num: any, record: any) => {
  290. return num == 0 ? '否' : '是'
  291. }
  292. }
  293. ]
  294. let inervalhander = undefined;
  295. const getCurrentComputeDate = async () => {
  296. const resp = await getComputeDate();
  297. set_currentComputeDate(resp);
  298. }
  299. const onSelectHandle: TreeProps['onSelect'] = (selectedKeys, info) => {
  300. const { node } = info;
  301. if (!node.children) {
  302. set_currentSelectedTreeNode(node);
  303. }
  304. };
  305. const onExpand = (newExpandedKeys: React.Key[]) => {
  306. setExpandedKeys(newExpandedKeys);
  307. setAutoExpandParent(false);
  308. };
  309. //编辑单元成本金额
  310. const editHandleTwo = async (record: any) => {
  311. const { id, deptCode, salaryType, unitCode, userId } = record;
  312. if (currentEditRecord && id == currentEditRecord.id) {
  313. const resp = await editUnitCostTableData({
  314. amount: currentEditRecord.amount,
  315. id
  316. });
  317. if (resp) {
  318. tableRef.current?.reload();
  319. }
  320. set_currentEditRecord(undefined);
  321. } else {
  322. set_currentEditRecord(record);
  323. }
  324. }
  325. //固定金额编辑金额
  326. const editHandle = async (record: any, curTabKey: string) => {
  327. const { id, deptCode, salaryType, unitCode, userId } = record;
  328. if (id == editTableCellId) {
  329. //保存
  330. //console.log({currentEditRecord,curTabKey });
  331. if (inputSalaryNum != undefined) {
  332. if (curTabKey == 'kpi_salary') {
  333. const resp = await editTableSalaryRequest({
  334. computeDate: currentComputeDate as string,
  335. unitCode,
  336. deptCode, salaryType,
  337. salary: inputSalaryNum,
  338. userId: `${userId}`,
  339. id
  340. });
  341. if (resp) {
  342. tableRef.current?.reload();
  343. }
  344. }
  345. }
  346. set_editTableCellId(undefined);
  347. } else {
  348. //编辑
  349. set_editTableCellId(id);
  350. }
  351. }
  352. //考核项目编辑数值
  353. const editCheckItemValHandle = async (record: any) => {
  354. const { id, itemCode, itemName, itemType, orderPointValue, executePointValue, hospId, unitCode } = record;
  355. if (id == editTableCellId) {
  356. //保存
  357. if (checkItemvalNum) {
  358. const resp = await editCheckProject({
  359. computeDate: currentComputeDate as string,
  360. itemCode,
  361. itemName,
  362. itemType,
  363. orderPointValue,
  364. value: checkItemvalNum,
  365. executePointValue,
  366. hospId,
  367. unitCode,
  368. id
  369. });
  370. if (resp) {
  371. tableRef.current?.reload();
  372. }
  373. }
  374. set_editTableCellId(undefined);
  375. } else {
  376. //编辑
  377. set_editTableCellId(id);
  378. }
  379. }
  380. const tableDataAddHandle = () => {
  381. set_editModalVisible(true);
  382. }
  383. //表格行编辑
  384. const tableEditActHandle = (record: any) => {
  385. //console.log({'edit':record});
  386. set_isTableEdit(true);
  387. set_currentEditRecord(record);
  388. set_editModalVisible(true);
  389. }
  390. const getJiezhuanStatusHandle = async () => {
  391. const resp = await getJiezhuanStatus(currentComputeDate as string);
  392. if (resp == 2) {
  393. set_ifBanAllAction(true);
  394. } else {
  395. set_ifBanAllAction(false);
  396. }
  397. }
  398. //管理指标row编辑
  399. const EditManaIndexTableRow = ({ record }: { record: any }) => {
  400. const { value, columns, unitName, id, unitCode, totalScore, computeDate, groupId } = record;
  401. return (
  402. <ModalForm
  403. title={`编辑${unitName}实际值`}
  404. width={500}
  405. // layout='inline'
  406. trigger={
  407. <a key={'1'} style={{ textAlign: 'center', width: '100%' }}>编辑</a>
  408. }
  409. initialValues={record}
  410. onFinish={async (values) => {
  411. const editResult = value.map((a: any) => {
  412. return {
  413. ...a,
  414. value: values[`value${a.code}`]
  415. }
  416. })
  417. const data = {
  418. id,
  419. unitCode,
  420. unitName,
  421. totalScore,
  422. computeDate,
  423. groupId,
  424. value: editResult
  425. }
  426. const resp = await editManaIndexTableData(data);
  427. if (resp) {
  428. tableRef.current?.reload();
  429. }
  430. return true
  431. }}
  432. >
  433. {
  434. columns.map((item: any, index: any) => {
  435. //const findTitle = columns.filter((a: any) => a.key == item.code);
  436. return (
  437. <ProFormDigit key={index} label={`${item.dataIndex}`} name={`value${item.key}`} />
  438. )
  439. })
  440. }
  441. </ModalForm>
  442. )
  443. }
  444. const onTabChange = (activeKey: string) => {
  445. set_currentSelectedTabKey(activeKey);
  446. }
  447. //获取核算单元树结构
  448. const getCheckUnitTreeDataFunc = async (computeDate: string) => {
  449. const resp = await getTreeData(computeDate);
  450. if (resp) {
  451. set_treeData(resp);
  452. }
  453. }
  454. const getCalcStatus = async () => {
  455. const resp = await getCheckItemCalcStatus(currentComputeDate as string, 'ASSESSMENT');
  456. if (resp) {
  457. if (resp.calculating) {
  458. //继续计算
  459. set_loading(true);
  460. return false
  461. } else {
  462. //计算已完成
  463. set_loading(false);
  464. return true
  465. }
  466. } else {
  467. tableRef.current?.reload();
  468. return true
  469. }
  470. }
  471. const func = (str: string) => str && str.replace(/(?:\.0*|(\.\d+?)0+)$/, '$1') + '%';
  472. const getTableData = async (type: string, params: any, sort: any, filter: any) => {
  473. if (currentComputeDate) {
  474. if (type == 'kpi_salary') {
  475. const resp = await getSalaryInfoTableData({
  476. computeDate: currentComputeDate,
  477. ...params
  478. });
  479. if (resp) {
  480. return {
  481. data: resp.list,
  482. total: resp.totalCount,
  483. pageSize: resp.pageSize,
  484. totalPage: resp.totalPage,
  485. success: true
  486. }
  487. }
  488. }
  489. if (type == 'kpi_non_assessment') {
  490. const resp = await getNoCheckTableData({
  491. computeDate: currentComputeDate,
  492. ...params
  493. });
  494. if (resp) {
  495. return {
  496. data: resp.list,
  497. total: resp.totalCount,
  498. pageSize: resp.pageSize,
  499. totalPage: resp.totalPage,
  500. success: true
  501. }
  502. }
  503. }
  504. if (type == 'kpi_assessment') {
  505. if (!loading) {
  506. //计算完和未计算
  507. const resp = await getCheckProjectTableData({
  508. computeDate: currentComputeDate,
  509. unitCode: currentSelectedTreeNode.code,
  510. ...params
  511. });
  512. if (resp) {
  513. return {
  514. data: resp.list,
  515. success: true,
  516. total: resp.totalCount,
  517. pageSize: resp.pageSize,
  518. totalPage: resp.totalPage,
  519. }
  520. }
  521. }
  522. }
  523. if (type == 'kpi_manage_indicator') {
  524. if (currentSelectedManaGroup) {
  525. const resp = await getManaIndexTableData({ ...params, computeDate: currentComputeDate, groupId: currentSelectedManaGroup.id });
  526. if (resp) {
  527. const columns = resp.title.map((item: any, titleIndex: number) => {
  528. return (item.children ? {
  529. title: () => {
  530. return <div>{item.name} <span style={{ fontSize: 14, fontFamily: 'SourceHanSansCN-Medium, SourceHanSansCN', fontWeight: 500, color: item.arrow == 'up' ? '#00BF8F' : '#FF4060' }}>{item.arrow == 'up' ? '↑' : '↓'}</span></div>
  531. },
  532. key: item.code,
  533. dataIndex: item.name,
  534. children: item.children.map((a: any, aindex: number) => {
  535. return {
  536. title: a.name,
  537. dataIndex: `${a.code}${item.code}`,
  538. key: `${a.code}${item.code}`,
  539. width: 100,
  540. align: 'center',
  541. renderText(num: any, record: any, index: any, action: any) {
  542. //console.log({record,a,titleIndex})
  543. return (item.dataType == 1 || a.name == '得分') ? a.name == '得分' ? <span style={{ color: record[`veto${titleIndex + 1}`] ? '#FF8C19' : '#17181A' }}>{num}</span> : num : num ? func((num * 100).toFixed(2)) : '-'
  544. },
  545. }
  546. })
  547. } : {
  548. title: item.name,
  549. dataIndex: item.code,
  550. key: item.code,
  551. width: 100,
  552. align: 'center',
  553. renderText(num: any, record: any, index: any, action: any) {
  554. return (item.dataType == 1) ? num : num ? func((num * 100).toFixed(2) + '%') : '-'
  555. },
  556. })
  557. });
  558. set_tableColumn([{
  559. title: '核算单元',
  560. dataIndex: 'unitName',
  561. key: 'unitName',
  562. width: 120,
  563. fixed: 'left',
  564. }, ...columns,
  565. {
  566. title: '总得分',
  567. dataIndex: 'totalScore',
  568. key: 'totalScore',
  569. width: 100,
  570. fixed: 'right',
  571. },
  572. {
  573. title: '分级',
  574. dataIndex: 'level',
  575. key: 'level',
  576. width: 100,
  577. fixed: 'right',
  578. hideInTable: computeMethod == '2' ? true : false
  579. },
  580. {
  581. title: '系数',
  582. dataIndex: 'kpi',
  583. key: 'kpi',
  584. width: 100,
  585. fixed: 'right',
  586. },
  587. ]);
  588. const data = resp.managerData.map((item: any) => {
  589. let rowData: { [key: string]: any } = {};
  590. for (let index = 0; index < item.value.length; index++) {
  591. for (const key in item.value[index]) {
  592. if (key == 'veto') {
  593. //${key}${item.value[index].code}-${index} 中的index用于指定是该列的哪一格
  594. rowData[`${key}${item.value[index].code}`] = item.value[index][`${key}`]
  595. } else {
  596. rowData[`${key}${item.value[index].code}`] = item.value[index][`${key}`]
  597. }
  598. }
  599. }
  600. return { ...item, ...rowData, id: item.id, columns }
  601. });
  602. return {
  603. data: data,
  604. success: true,
  605. total: resp.totalCount,
  606. pageSize: resp.pageSize,
  607. totalPage: resp.totalPage,
  608. }
  609. }
  610. }
  611. }
  612. if (type == 'kpi_income') {
  613. const resp = await getIncomeData({
  614. computeDate: currentComputeDate,
  615. ...params
  616. });
  617. if (resp) {
  618. set_totalNum(resp.sum);
  619. return {
  620. data: resp.pageList.list,
  621. success: true,
  622. total: resp.pageList.totalCount,
  623. pageSize: resp.pageList.pageSize,
  624. totalPage: resp.pageList.totalPage,
  625. }
  626. }
  627. }
  628. if (type == 'kpi_cost') {
  629. const resp = await getCostData({
  630. computeDate: currentComputeDate,
  631. ...params
  632. });
  633. if (resp) {
  634. set_totalNum(resp.sum);
  635. return {
  636. data: resp.pageList.list,
  637. success: true,
  638. total: resp.pageList.totalCount,
  639. pageSize: resp.pageList.pageSize,
  640. totalPage: resp.pageList.totalPage,
  641. }
  642. }
  643. }
  644. if (type == 'kpi_unit_cost' && currentSelectedTreeNode) {
  645. const resp = await getUnitCostTableData({
  646. unitCode: currentSelectedTreeNode.code,
  647. ...params
  648. });
  649. let unitCostTotal = 0;
  650. let unitCostCtrlTotal = 0;
  651. const traverseTree = (node: any) => {
  652. if (node == null) return;
  653. if (!node.summaryFlag) {
  654. //summaryFlag 汇总
  655. unitCostTotal = unitCostTotal + node.amount
  656. if (node.ctrlFlag) {
  657. unitCostCtrlTotal = unitCostCtrlTotal + node.amount
  658. }
  659. }
  660. if (node.children) {
  661. node.children.forEach(traverseTree);
  662. }
  663. }
  664. resp.forEach((a: any) => {
  665. traverseTree(a);
  666. });
  667. set_unitCostComputeData({
  668. unitCostTotal, unitCostCtrlTotal
  669. })
  670. if (resp) {
  671. return {
  672. data: resp,
  673. success: true,
  674. total: 0,
  675. pageSize: 10,
  676. totalPage: 0,
  677. }
  678. }
  679. }
  680. }
  681. return []
  682. }
  683. const tableDataSearchHandle = (paramName: string) => {
  684. set_tableDataFilterParams({
  685. ...tableDataFilterParams,
  686. [`${paramName}`]: tableDataSearchKeywords
  687. })
  688. }
  689. //表格删除确认
  690. const delActionHandle = async (record: any, index: number) => {
  691. const { id } = record;
  692. const resp = await delTableDataRequest({
  693. computeDate: currentComputeDate as string,
  694. id,
  695. index
  696. });
  697. if (resp) {
  698. tableRef.current?.reload();
  699. message.success('删除成功!')
  700. }
  701. };
  702. const dataList: any[] = [];
  703. const generateList = (data: getTreeDataRespType[]) => {
  704. for (let i = 0; i < data.length; i++) {
  705. const node = data[i];
  706. const { code, name } = node;
  707. dataList.push({ code: code, name: name });
  708. if (node.child) {
  709. generateList(node.child);
  710. }
  711. }
  712. };
  713. generateList(treeData as any);
  714. const getParentKey = (key: React.Key, tree: any[]): React.Key => {
  715. let parentKey: React.Key;
  716. for (let i = 0; i < tree.length; i++) {
  717. const node = tree[i];
  718. if (node.child) {
  719. if (node.child.some((item: { code: React.Key; }) => item.code === key)) {
  720. parentKey = node.code;
  721. } else if (getParentKey(key, node.child)) {
  722. parentKey = getParentKey(key, node.child);
  723. }
  724. }
  725. }
  726. return parentKey!;
  727. };
  728. //考核项目树结构搜索
  729. const onTreeSearchKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {
  730. const { value } = e.target;
  731. const newExpandedKeys = dataList
  732. .map((item) => {
  733. if (item.name.indexOf(value) > -1) {
  734. return getParentKey(item.code, treeData);
  735. }
  736. return null;
  737. });
  738. const b = newExpandedKeys.filter((item, i, self) => item && self.indexOf(item) === i);
  739. setExpandedKeys(newExpandedKeys as React.Key[]);
  740. setSearchValue(value);
  741. setAutoExpandParent(true);
  742. }
  743. //获取数据
  744. const confirmGenerateHandle: any = async (code: string, others?: any) => {
  745. if (code == 'kpi_assessment') {
  746. const resp = await generateCheckProjectTableData({
  747. computeDate: currentComputeDate as string,
  748. unitCode: others ? currentSelectedTreeNode.code : ''
  749. });
  750. set_loading(false);
  751. if (resp) {
  752. tableRef.current?.reload();
  753. }
  754. return Promise.resolve(true);
  755. }
  756. if (code == 'kpi_cost') {
  757. const resp = await generateUnitCostTableData(
  758. currentComputeDate as string,
  759. currentSelectedTreeNode.code
  760. );
  761. set_loading(false);
  762. if (resp) {
  763. tableRef.current?.reload();
  764. }
  765. return Promise.resolve(true);
  766. }
  767. }
  768. const generateFunc = (code: string, others?: any) => {
  769. /**
  770. * index 获取的表格类型下标
  771. */
  772. if ((code == 'kpi_assessment' || code == 'kpi_cost') && !loading) {
  773. Modal.confirm({
  774. title: '注意',
  775. cancelText: '',
  776. okText: '确定',
  777. closable: true,
  778. content: others ? '获取单个操作会覆盖上次获取的该核算单元的数据,确定要继续操作?' : `${code == 'kpi_cost' ? '获取' : '获取所有'}操作会覆盖所有已获取的数据,确定要继续操作?`,
  779. onOk: () => { set_loading(true); confirmGenerateHandle(code, others) }
  780. })
  781. }
  782. }
  783. const onVisibleChangeHandle = (bool: boolean) => {
  784. set_editModalVisible(bool);
  785. if (!bool) {
  786. set_isTableEdit(false);
  787. }
  788. }
  789. const onManaIndexGroupClick = (manaIndexGroup: any) => {
  790. set_currentSelectedManaGroup(manaIndexGroup);
  791. }
  792. const tableFormCommit = async (formData: any, type: 'edit' | 'add') => {
  793. if (type == 'edit') {
  794. //编辑
  795. const body = {
  796. id: currentEditRecord.id,
  797. computeDate: currentComputeDate as string,
  798. unitCode: formData.unitCode,
  799. deptCode: formData.deptCode,
  800. nonAssessmentCode: typeof formData.assessmentCode == 'number' ? formData.assessmentCode : formData.assessmentCode.value,
  801. targetValue: `${formData.userId ? formData.userId : ''}`,
  802. value: `${formData.value}`,
  803. description: formData.description
  804. }
  805. const resp = await editTableData(body);
  806. if (resp) {
  807. tableRef.current?.reload();
  808. }
  809. set_isTableEdit(false);
  810. } else if (type == 'add') {
  811. //新增
  812. const body = {
  813. computeDate: currentComputeDate as string,
  814. unitCode: formData.unitCode,
  815. deptCode: formData.deptCode,
  816. nonAssessmentCode: formData.assessmentCode.value,
  817. targetValue: `${formData.userId ? formData.userId : ''}`,
  818. value: `${formData.value}`,
  819. description: formData.description
  820. }
  821. const resp = await addTableData(body);
  822. if (resp) {
  823. tableRef.current?.reload();
  824. }
  825. }
  826. // set_editModalVisible(false);
  827. set_currentEditRecord(undefined);
  828. return true;
  829. }
  830. //获取管理指标分组
  831. const getManaIndiGroupRequest = async () => {
  832. const resp = await getManaIndexGroup();
  833. if (resp) {
  834. set_manaIndexGroups(resp);
  835. if (resp.length > 0) {
  836. set_currentSelectedManaGroup(resp[0])
  837. }
  838. }
  839. }
  840. const importData = (code: string, name: string) => {
  841. if (ifBanAllAction) return;
  842. return (
  843. <ModalForm
  844. width={360}
  845. title={`导入${name}数据`}
  846. trigger={
  847. <span key="3">导入</span>
  848. }
  849. submitter={{
  850. render: (props, defaultDoms) => {
  851. const needBtn = defaultDoms.filter((b) => {
  852. return b.key != 'rest'
  853. })
  854. return [
  855. // <Button
  856. // key="ok"
  857. // onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
  858. // >
  859. // 下载模板
  860. // </Button>,
  861. ...needBtn,
  862. ];
  863. },
  864. }}
  865. onFinish={async (values) => {
  866. // console.log({values});
  867. const { importFile: { fileList } } = values;
  868. let formData = new FormData();
  869. if (code == 'kpi_unit_cost') {
  870. formData.append('file', fileList[0].originFileObj);
  871. formData.append('computeDate', currentComputeDate as string);
  872. formData.append('unitCode', currentSelectedTreeNode.code);
  873. } else {
  874. formData.append('file', fileList[0].originFileObj);
  875. formData.append('computeDate', currentComputeDate as string);
  876. formData.append('groupId', currentSelectedManaGroup?.id as any);
  877. }
  878. const resp = await importMonthlyperformanceRelaFiles(code, formData);
  879. if (resp) {
  880. tableRef.current?.reload();
  881. return true;
  882. }
  883. }}
  884. >
  885. <FormItem name={'importFile'}>
  886. <BMSUpload downloadTemplateFile={auditType == '0' ? () => code == 'kpi_assessment' || code == 'kpi_unit_cost' ? downloadTemplate(code, code == 'kpi_unit_cost' ? currentSelectedTreeNode.code : currentSelectedManaGroup?.id) : downloadTemplate(code) : () => { }} />
  887. </FormItem>
  888. </ModalForm>
  889. )
  890. }
  891. const checkHandle = async (type: string) => {
  892. const resp = await checkMonthlyReq(
  893. currentComputeDate as string,
  894. type == '0' ? '1' : '0', //审核类型 1审核 0取消审核
  895. );
  896. if (resp) {
  897. if (type == '0') {
  898. message.success('审核提交成功!');
  899. set_auditType('1');
  900. }
  901. if (type == '1') {
  902. message.success('取消审核提交成功!');
  903. set_auditType('0');
  904. }
  905. }
  906. }
  907. const pageCheckStatusFunc = async (time: string) => {
  908. const resp = await getPageCheckStatus(time);
  909. if (resp) {
  910. set_auditType(`${resp}`); //0 未审核 1 已审核
  911. }
  912. }
  913. const downloadTemplate = async (code: string, id?: number) => {
  914. await downloadTemplateReq(code, id);
  915. // if(index == 4){
  916. // //管理指标
  917. // await downloadTemplateReq(index,currentSelectedManaGroup?.groupCode);
  918. // }else{
  919. // }
  920. }
  921. const getComputeMethod = async () => {
  922. const resp = await getManaIndicatorJiangchengCoefficient();
  923. if (resp) {
  924. const need = resp.list.filter((a: any) => (a.code == '1670618922728169472'));
  925. if (need.length > 0) {
  926. set_computeMethod(need[0].value);
  927. }
  928. }
  929. }
  930. const handleResize = (e: any) => {
  931. const wH = e.target.innerHeight;
  932. const tableHeight = wH - 320;
  933. set_tableH(tableHeight);
  934. }
  935. function doResize() {
  936. setTimeout(() => {
  937. const ev: any = new Event('resize');
  938. window.dispatchEvent(ev);
  939. }, 0)
  940. }
  941. useEffect(() => {
  942. if (loading) {
  943. inervalhander = setInterval(() => {
  944. getCalcStatus();
  945. }, 60000)
  946. }
  947. }, [loading])
  948. useEffect(() => {
  949. set_tableDataFilterParams({
  950. ...tableDataFilterParams,
  951. id: currentSelectedManaGroup?.id,
  952. });
  953. }, [currentSelectedManaGroup]);
  954. useEffect(() => {
  955. tableRef.current?.reloadAndRest && tableRef.current?.reloadAndRest();
  956. }, [currentSelectedTreeNode]);
  957. useEffect(() => {
  958. //清空表格筛选项
  959. set_tableDataFilterParams(undefined);
  960. set_currentSelectedTreeNode(undefined);
  961. if (currentSelectedTabKey == 'kpi_salary') {
  962. set_tableColumn(tableColumnOne as ProColumns[]);
  963. }
  964. if (currentSelectedTabKey == 'kpi_non_assessment') {
  965. set_tableColumn(tableColumnTwo as ProColumns[]);
  966. }
  967. if (currentSelectedTabKey == 'kpi_assessment') {
  968. if (currentComputeDate) {
  969. getCheckUnitTreeDataFunc(currentComputeDate as string);
  970. }
  971. set_tableColumn(tableColumnThree as ProColumns[]);
  972. }
  973. if (currentSelectedTabKey == 'kpi_manage_indicator') {
  974. getManaIndiGroupRequest(); //获取分组
  975. }
  976. if (currentSelectedTabKey == 'kpi_income') {
  977. set_tableColumn(tableColumnFive as ProColumns[]);
  978. }
  979. if (currentSelectedTabKey == 'kpi_cost') {
  980. set_tableColumn(tableColumnFive as ProColumns[]);
  981. }
  982. if (currentSelectedTabKey == 'kpi_unit_cost') {
  983. if (currentComputeDate) {
  984. getCheckUnitTreeDataFunc(currentComputeDate as string);
  985. }
  986. set_tableColumn(tableColumnSeven as ProColumns[]);
  987. }
  988. }, [currentSelectedTabKey]);
  989. useEffect(() => {
  990. if (currentSelectedTabKey == 'kpi_cost') {
  991. // if (currentComputeDate) {
  992. // getCheckUnitTreeDataFunc(currentComputeDate as string);
  993. // }
  994. set_tableColumn(tableColumnSeven as ProColumns[]);
  995. }
  996. }, [currentEditRecord, auditType])
  997. useEffect(() => {
  998. //初始化左侧树结构数据后
  999. if (treeData?.length > 0) {
  1000. if (treeData[0].child && treeData[0].child.length > 0) {
  1001. const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
  1002. set_currentSelectedTreeNode(node);
  1003. setExpandedKeys([nodeParent.code]);
  1004. }
  1005. }
  1006. }, [treeData]);
  1007. useEffect(() => {
  1008. if (currentComputeDate) {
  1009. pageCheckStatusFunc(currentComputeDate); //获取页面查核状态
  1010. getCalcStatus();
  1011. getJiezhuanStatusHandle();
  1012. }
  1013. }, [currentComputeDate]);
  1014. useEffect(() => {
  1015. getCurrentComputeDate();
  1016. set_tableColumn(tableColumnOne as ProColumns[]);
  1017. getComputeMethod();
  1018. const tabs = access.whatCanIDoInThisPage(location.pathname.replace('/budgetManaSystem', ''));
  1019. const tabsNameArr = tabs.map((a: any) => a.code);
  1020. const needShowTabs = tabData.filter(a => tabsNameArr.includes(a.key));
  1021. set_tabs(needShowTabs);
  1022. needShowTabs.length > 0 && set_currentSelectedTabKey(needShowTabs[0].key);
  1023. window.addEventListener('resize', (e) => handleResize(e)) //监听窗口大小改变
  1024. doResize();
  1025. return () => {
  1026. window.removeEventListener('resize', (e) => handleResize(e));
  1027. }
  1028. }, [])
  1029. return (
  1030. <div className='MonthlyDataCheck'>
  1031. {
  1032. true && (
  1033. <BMSModalForm formRef={formRef} open={editModalVisible} initialValues={isTableEdit ? { ...currentEditRecord } : { unitCode: 'A010101' }} title={isTableEdit ? '编辑' : '新增'}
  1034. size="middle" width={737} onOpenChange={onVisibleChangeHandle}
  1035. modalProps={{
  1036. destroyOnClose: true
  1037. }}
  1038. onFinish={(val: any) => tableFormCommit(val, isTableEdit ? 'edit' : 'add')}
  1039. >
  1040. {
  1041. currentSelectedTabKey == 'kpi_salary' && (
  1042. <>
  1043. <ProFormText width="md" name="itemName" label="项目名" disabled />
  1044. <ProFormText width="md" name="itemTypeName" label="类型" disabled />
  1045. <ProFormDigit width="md" label="点值" name="pointValue" min={0} />
  1046. <ProFormText width="md" name="createUser" label="操作人" disabled />
  1047. </>
  1048. )
  1049. }
  1050. {
  1051. currentSelectedTabKey == 'kpi_non_assessment' && (
  1052. <>
  1053. <ProForm.Group >
  1054. <ProFormTreeSelect
  1055. name="unitCode"
  1056. label="核算单元"
  1057. placeholder="请选择"
  1058. colProps={{ span: 12 }}
  1059. rules={[{ required: true }]}
  1060. request={async () => {
  1061. const resp = await getHesuanUnits(currentComputeDate as string);
  1062. if (resp) {
  1063. return resp
  1064. }
  1065. return []
  1066. }}
  1067. fieldProps={{
  1068. showSearch: true,
  1069. treeDefaultExpandedKeys: ['A010101'],
  1070. filterTreeNode(inputValue, treeNode) {
  1071. const match = `${treeNode.name}`.indexOf(inputValue) != -1;
  1072. if (match && !treeNode.isLeaf && !treeNode.children) {
  1073. // Do some loading logic
  1074. }
  1075. return match;
  1076. },
  1077. fieldNames: {
  1078. label: 'name',
  1079. value: 'code',
  1080. children: 'child'
  1081. },
  1082. treeExpandAction: false,
  1083. switcherIcon: (props: any) => {
  1084. const { expanded } = props;
  1085. return !expanded ? <img style={{ width: 20, height: 20, position: 'relative', top: 2 }} src={expandedIcon} /> : <img style={{ width: 20, height: 20, position: 'relative', top: 2 }} src={closeIcon} />
  1086. },
  1087. onChange: (value) => {
  1088. formRef.current?.setFieldValue('deptCode', '');
  1089. }
  1090. }}
  1091. />
  1092. <ProFormDependency name={['unitCode']}>
  1093. {
  1094. ({ unitCode }) => {
  1095. // console.log({deptCode});
  1096. return (
  1097. <ProFormSelect
  1098. name="deptCode"
  1099. label="科室名称"
  1100. colProps={{ span: 12 }}
  1101. placeholder="请选择"
  1102. // rules={[{ required: true }]}
  1103. params={unitCode}
  1104. request={async () => {
  1105. if (unitCode) {
  1106. const resp = await getDepLists(unitCode);
  1107. if (resp) {
  1108. return resp.list.map((a: any) => ({
  1109. label: a.deptName, value: a.deptCode, d: a
  1110. }))
  1111. }
  1112. }
  1113. return []
  1114. }}
  1115. fieldProps={{
  1116. showSearch: true,
  1117. onChange: (value) => {
  1118. formRef.current?.setFieldValue('targetValue', '');
  1119. }
  1120. }}
  1121. />
  1122. )
  1123. }
  1124. }
  1125. </ProFormDependency>
  1126. </ProForm.Group>
  1127. <ProForm.Group>
  1128. <ProFormSelect
  1129. name="assessmentCode"
  1130. label="项目名称"
  1131. placeholder="请选择"
  1132. colProps={{ span: 12 }}
  1133. rules={[{ required: true }]}
  1134. request={async () => {
  1135. const resp = await getProjects();
  1136. if (resp) {
  1137. return resp.map((a: any) => ({
  1138. label: a.name, value: a.code, d: a
  1139. }))
  1140. }
  1141. return []
  1142. }}
  1143. fieldProps={{
  1144. labelInValue: true,
  1145. onChange: (value) => {
  1146. const { d: { distributionTypeName } } = value;
  1147. formRef.current?.setFieldValue('distributionTypeName', distributionTypeName);
  1148. }
  1149. }}
  1150. />
  1151. <ProFormDependency name={['assessmentCode']}>
  1152. {
  1153. ({ assessmentCode }) => {
  1154. return (
  1155. <ProFormText disabled name="distributionTypeName" label="分配方式" colProps={{ span: 12 }} />
  1156. )
  1157. }
  1158. }
  1159. </ProFormDependency>
  1160. </ProForm.Group>
  1161. <ProForm.Group>
  1162. <ProFormDigit label="数值" name="value" colProps={{ span: 12 }} min={-1000000000000000} />
  1163. <ProFormDependency name={['unitCode', 'distributionTypeName']}>
  1164. {
  1165. ({ unitCode, distributionTypeName }) => {
  1166. return (
  1167. <ProFormSelect
  1168. name="userId"
  1169. label="人员姓名"
  1170. colProps={{ span: 12 }}
  1171. placeholder="请选择"
  1172. rules={[{ required: distributionTypeName != '占比' ? true : false }]}
  1173. params={unitCode}
  1174. fieldProps={{
  1175. showSearch: true,
  1176. }}
  1177. request={async () => {
  1178. if (unitCode) {
  1179. const resp = await getEmps(unitCode);
  1180. if (resp) {
  1181. return resp.map((a: any) => ({
  1182. label:`${a.name}-${a.userId}`, value: a.userId, d: a
  1183. }))
  1184. }
  1185. }
  1186. return []
  1187. }}
  1188. />
  1189. )
  1190. }
  1191. }
  1192. </ProFormDependency>
  1193. </ProForm.Group>
  1194. <ProForm.Group >
  1195. <ProFormTextArea
  1196. name="description"
  1197. label="说明"
  1198. colProps={{ span: 24 }}
  1199. placeholder="请输入"
  1200. />
  1201. </ProForm.Group>
  1202. </>
  1203. )
  1204. }
  1205. </BMSModalForm>
  1206. )
  1207. }
  1208. <>
  1209. {
  1210. (
  1211. <div className='rightContent'>
  1212. <BMSPagecontainer title={`核算年月:${currentComputeDate}`} ghost>
  1213. {
  1214. !ifBanAllAction && <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
  1215. }
  1216. {/* <div className='midLine'>
  1217. <span>点击检查</span>
  1218. 是否有未对照的人员信息、未对照的科室信息及未设置的收费项目信息
  1219. </div> */}
  1220. {
  1221. tabs.length > 0 && <Tabs
  1222. defaultActiveKey={tabs[0].key}
  1223. onChange={onTabChange}
  1224. items={tabs}
  1225. />
  1226. }
  1227. {
  1228. currentSelectedTabKey == 'kpi_salary' && (
  1229. <div className='tabContent'>
  1230. <div className='tableToolbar'>
  1231. <div className='filter'>
  1232. <div className='search'>
  1233. <span>核算单元名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1234. set_tableDataSearchKeywords(e.target.value);
  1235. if (e.target.value.length == 0) {
  1236. set_tableDataFilterParams({
  1237. ...tableDataFilterParams,
  1238. deptName: ''
  1239. });
  1240. }
  1241. }} suffix={
  1242. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('deptName')} />
  1243. } />
  1244. </div>
  1245. </div>
  1246. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
  1247. <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
  1248. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1249. onMouseLeave={() => set_ifShowTip(false)}
  1250. >
  1251. {/* <span key="1">调整</span> */}
  1252. {/* <span key="2" onClick={() => generateFunc()}>获取</span> */}
  1253. {importData('kpi_salary', '固定工资')}
  1254. </div>
  1255. </Popover>
  1256. </div>
  1257. {currentComputeDate && <BMSTable actionRef={tableRef} params={tableDataFilterParams} rowKey='id'
  1258. columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
  1259. title: '金额',
  1260. dataIndex: 'salary',
  1261. key: 'salary',
  1262. align: 'center',
  1263. width: '10%',
  1264. render: (text: any, record: any) => {
  1265. if (ifBanAllAction) return formatMoneyNumber(text);
  1266. return (
  1267. <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
  1268. <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
  1269. {
  1270. editTableCellId == record.id ? <Input size='small' defaultValue={record.salary} placeholder='请输入' onChange={(e) => { set_inputSalaryNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{formatMoneyNumber(text)}</span>
  1271. }
  1272. </div>
  1273. {auditType == '0' && <img onClick={() => editHandle(record, '1')} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />}
  1274. </div>
  1275. )
  1276. }
  1277. },
  1278. {
  1279. title: '操作',
  1280. key: 'option',
  1281. valueType: 'option',
  1282. render: (_: any, record) => [
  1283. <Popconfirm
  1284. key={'del'}
  1285. title="是否确认删除?"
  1286. onConfirm={() => delActionHandle(record, 1)}
  1287. // onCancel={()=>{}}
  1288. okText="是"
  1289. cancelText="否"
  1290. >
  1291. <a >删除</a>
  1292. </Popconfirm>
  1293. ],
  1294. },] : [
  1295. ...tableColumn, {
  1296. title: '金额',
  1297. dataIndex: 'salary',
  1298. key: 'salary',
  1299. width: '10%',
  1300. // shouldCellUpdate:(record:any, prevRecord:any) => true,
  1301. render: (text: any, record: any) => {
  1302. if (ifBanAllAction) return formatMoneyNumber(text);
  1303. return (
  1304. <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
  1305. <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
  1306. {
  1307. editTableCellId == record.id ? <Input size='small' defaultValue={record.salary} placeholder='请输入' onChange={(e) => { set_inputSalaryNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{formatMoneyNumber(text)}</span>
  1308. }
  1309. </div>
  1310. {auditType == '0' && <img onClick={() => editHandle(record, '1')} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />}
  1311. </div>
  1312. )
  1313. }
  1314. },
  1315. ]} request={(params, sort, filter) => getTableData('kpi_salary', params, sort, filter)} />}
  1316. </div>
  1317. )
  1318. }
  1319. {
  1320. currentSelectedTabKey == 'kpi_non_assessment' && (
  1321. <div className='tabContent'>
  1322. <div className='tableToolbar'>
  1323. <div className='filter'>
  1324. <div className='search'>
  1325. <span>核算单元名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1326. set_tableDataSearchKeywords(e.target.value);
  1327. if (e.target.value.length == 0) {
  1328. set_tableDataFilterParams({
  1329. ...tableDataFilterParams,
  1330. deptName: ''
  1331. });
  1332. }
  1333. }} suffix={
  1334. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('deptName')} />
  1335. } />
  1336. </div>
  1337. </div>
  1338. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
  1339. <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
  1340. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1341. onMouseLeave={() => set_ifShowTip(false)}
  1342. >
  1343. {/* <span key="1" onClick={() => generateFunc(2)} >获取</span>
  1344. <span key="2" >导入</span> */}
  1345. {importData('kpi_non_assessment', '非考核项目')}
  1346. {!ifBanAllAction && <span key="3" onClick={auditType == '0' ? () => tableDataAddHandle() : () => { }}>添加</span>}
  1347. </div>
  1348. </Popover>
  1349. </div>
  1350. {currentComputeDate && <BMSTable scroll={{ x: 120 * 10, y: 500 }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams}
  1351. columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
  1352. title: '操作',
  1353. fixed: 'right',
  1354. key: 'option',
  1355. width: 130,
  1356. valueType: 'option',
  1357. render: (_: any, record: any) => [
  1358. <a key={'edit'} onClick={() => tableEditActHandle(record)}>编辑</a>,
  1359. <Divider type='vertical' key='line' />,
  1360. <Popconfirm
  1361. key={'del'}
  1362. title="是否确认删除?"
  1363. onConfirm={() => delActionHandle(record, 2)}
  1364. // onCancel={()=>{}}
  1365. okText="是"
  1366. cancelText="否"
  1367. >
  1368. <a >删除</a>
  1369. </Popconfirm>
  1370. ],
  1371. }] : [...tableColumn]} request={(params, sort, filter) => getTableData('kpi_non_assessment', params, sort, filter)} />}
  1372. </div>
  1373. )
  1374. }
  1375. {
  1376. currentSelectedTabKey == 'kpi_assessment' && (
  1377. <div className='tabContent'>
  1378. <div className='tabContentInner'>
  1379. <div className='leftTree'>
  1380. <div className='search'>
  1381. <Input className='searchInput' allowClear onChange={onTreeSearchKeyChange} placeholder="请输入名称" suffix={
  1382. <IconFont type="iconsousuo" />
  1383. } />
  1384. </div>
  1385. <div className='treeWrap'>
  1386. {
  1387. treeData && treeData.length > 0 && currentSelectedTreeNode && (
  1388. <DirectoryTree
  1389. fieldNames={{ title: 'name', key: 'code', children: 'child' }}
  1390. rootStyle={{ height: '100%', paddingBottom: 50, overflowY: 'scroll', overflowX: 'hidden' }}
  1391. onSelect={onSelectHandle}
  1392. onExpand={onExpand}
  1393. expandedKeys={expandedKeys}
  1394. autoExpandParent={autoExpandParent}
  1395. selectedKeys={[currentSelectedTreeNode.code]}
  1396. blockNode={true}
  1397. icon={() => null}
  1398. titleRender={
  1399. (nodeData: any) => {
  1400. const strTitle = nodeData.name as string;
  1401. const index = strTitle.indexOf(searchValue);
  1402. const beforeStr = strTitle.substring(0, index);
  1403. const afterStr = strTitle.slice(index + searchValue.length);
  1404. const title =
  1405. index > -1 ? (
  1406. <span>
  1407. {beforeStr}
  1408. <span className="site-tree-search-value" style={{ color: 'red', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{searchValue}</span>
  1409. {afterStr}
  1410. </span>
  1411. ) : (
  1412. <span className='strTitle'>{strTitle}</span>
  1413. );
  1414. return <div style={{
  1415. display: 'flex', flexDirection: 'row',
  1416. width: '100%',
  1417. justifyContent: 'flex-start', alignItems: 'center', height: 32,
  1418. borderRadius: '4px',
  1419. overflow: 'hidden',
  1420. color: '#17181A',
  1421. textOverflow: 'ellipsis',
  1422. whiteSpace: 'nowrap'
  1423. }}>{title}</div>
  1424. }
  1425. }
  1426. defaultSelectedKeys={[treeData[0].child[0].code]}
  1427. treeData={treeData as unknown as DataNode[]}
  1428. // treeData={treeDataNew}
  1429. switcherIcon={(props: any) => {
  1430. const { expanded } = props;
  1431. return !expanded ? <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={expandedIcon} /> : <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={closeIcon} />
  1432. }}
  1433. />
  1434. )
  1435. }
  1436. </div>
  1437. </div>
  1438. <div className='rightTable'>
  1439. <div className='tableToolbar'>
  1440. <div className='filter'>
  1441. {/* <div className='search' style={{ marginRight: 24 }}>
  1442. <span>类型:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1443. set_tableDataSearchKeywords(e.target.value);
  1444. if (e.target.value.length == 0) {
  1445. set_tableDataFilterParams({
  1446. ...tableDataFilterParams,
  1447. itemType: ''
  1448. });
  1449. }
  1450. }} suffix={
  1451. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemType')} />
  1452. } />
  1453. </div> */}
  1454. <div className='search'>
  1455. <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1456. set_tableDataSearchKeywords(e.target.value);
  1457. if (e.target.value.length == 0) {
  1458. set_tableDataFilterParams({
  1459. ...tableDataFilterParams,
  1460. itemName: ''
  1461. });
  1462. }
  1463. }} suffix={
  1464. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
  1465. } />
  1466. </div>
  1467. </div>
  1468. {
  1469. !ifBanAllAction && (
  1470. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
  1471. <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
  1472. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1473. onMouseLeave={() => set_ifShowTip(false)}
  1474. >
  1475. <span key="1" onClick={auditType == '0' ? () => generateFunc('kpi_assessment', true) : () => { }}>获取单个</span>
  1476. <span key="2" onClick={auditType == '0' ? () => generateFunc('kpi_assessment') : () => { }}>获取所有</span>
  1477. </div>
  1478. </Popover>
  1479. )
  1480. }
  1481. </div>
  1482. {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }} rowKey='id' params={tableDataFilterParams} columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn, {
  1483. title: '数值',
  1484. dataIndex: 'value',
  1485. key: 'value',
  1486. render: (text: any, record: any) => {
  1487. return (
  1488. <div key={'editCheckitem'} style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'flex-start', alignItems: 'center' }}>
  1489. <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
  1490. {
  1491. editTableCellId == record.id ? <Input size='small' defaultValue={record.value} placeholder='请输入' onChange={(e) => { set_checkItemvalNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{text}</span>
  1492. }
  1493. </div>
  1494. <img onClick={() => editCheckItemValHandle(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />
  1495. </div>
  1496. )
  1497. }
  1498. },
  1499. {
  1500. title: '操作',
  1501. key: 'option',
  1502. valueType: 'option',
  1503. render: (_: any, record: any) => [
  1504. <Popconfirm
  1505. key={'del'}
  1506. title="是否确认删除?"
  1507. onConfirm={() => delActionHandle(record, 3)}
  1508. // onCancel={()=>{}}
  1509. okText="是"
  1510. cancelText="否"
  1511. >
  1512. <a >删除</a>
  1513. </Popconfirm>
  1514. ],
  1515. }] : [
  1516. ...tableColumn, {
  1517. title: '数值',
  1518. dataIndex: 'value',
  1519. key: 'value',
  1520. }
  1521. ]} request={(params, sort, filter) => getTableData('kpi_assessment', params, sort, filter)} />}
  1522. </div>
  1523. </div>
  1524. </div>
  1525. )
  1526. }
  1527. {
  1528. currentSelectedTabKey == 'kpi_manage_indicator' && (
  1529. <div className='tabContent'>
  1530. <div className='tableToolbar'>
  1531. <div className='filter'>
  1532. <div className='tabs'>
  1533. {
  1534. manaIndexGroups.map((item, index) => {
  1535. return (
  1536. <Tooltip placement="top" title={item.depiction ? item.depiction : item.groupName}>
  1537. <div key={index} className={currentSelectedManaGroup?.id == item.id ? 'tab on' : 'tab'} onClick={() => onManaIndexGroupClick(item)}>{item.groupName}</div>
  1538. </Tooltip>
  1539. )
  1540. })
  1541. }
  1542. </div>
  1543. <div className='search'>
  1544. {/* <span>核算单元名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1545. set_tableDataSearchKeywords(e.target.value);
  1546. if (e.target.value.length == 0) {
  1547. set_tableDataFilterParams({
  1548. ...tableDataFilterParams,
  1549. unitName: ''
  1550. });
  1551. }
  1552. }} suffix={
  1553. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle()} />
  1554. } /> */}
  1555. </div>
  1556. </div>
  1557. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
  1558. <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
  1559. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1560. onMouseLeave={() => set_ifShowTip(false)}
  1561. >
  1562. {/* <span key="1">获取</span> */}
  1563. {importData('kpi_manage_indicator', '管理指标')}
  1564. </div>
  1565. </Popover>
  1566. </div>
  1567. {currentComputeDate && tableColumn && <BMSTable className='BMS-ManaIndextable' rowClassName={() => 'BMS-ManaIndextable-row'} bordered actionRef={tableRef} scroll={{ x: (100 * (tableColumn.length - 2)) + 120 + 300, y: tableH }} rowKey='unitCode' columns={(auditType == '0' && !ifBanAllAction) ? [...tableColumn,
  1568. {
  1569. title: '操作',
  1570. key: 'option',
  1571. valueType: 'option',
  1572. width: 100,
  1573. fixed: 'right',
  1574. render: (_: any, record: any) => [
  1575. <EditManaIndexTableRow record={record} key={'edit'} />
  1576. ],
  1577. }] : [...tableColumn]} pagination={false} params={tableDataFilterParams} request={(params, sort, filter) => getTableData('kpi_manage_indicator', params, sort, filter)} />}
  1578. </div>
  1579. )
  1580. }
  1581. {
  1582. currentSelectedTabKey == 'kpi_income' && (
  1583. <div className='tabContent' >
  1584. <div className='tableToolbar'>
  1585. <div className='filter'>
  1586. <div className='search'>
  1587. <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1588. set_tableDataSearchKeywords(e.target.value);
  1589. if (e.target.value.length == 0) {
  1590. set_tableDataFilterParams({
  1591. ...tableDataFilterParams,
  1592. itemName: ''
  1593. });
  1594. }
  1595. }} suffix={
  1596. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
  1597. } />
  1598. </div>
  1599. </div>
  1600. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
  1601. <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
  1602. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1603. onMouseLeave={() => set_ifShowTip(false)}
  1604. >
  1605. {/* <span key="1">获取</span> */}
  1606. {importData('kpi_income', '收入')}
  1607. </div>
  1608. </Popover>
  1609. </div>
  1610. {currentComputeDate && <BMSTable actionRef={tableRef} rowKey='id' params={tableDataFilterParams} columns={tableColumn} request={(params, sort, filter) => getTableData('kpi_income', params, sort, filter)} />}
  1611. <div className='totalCount'>合计:{totalNum}</div>
  1612. </div>
  1613. )
  1614. }
  1615. {
  1616. currentSelectedTabKey == 'kpi_cost' && (
  1617. <div className='tabContent'>
  1618. <div className='tableToolbar'>
  1619. <div className='filter'>
  1620. <div className='search'>
  1621. <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1622. set_tableDataSearchKeywords(e.target.value);
  1623. if (e.target.value.length == 0) {
  1624. set_tableDataFilterParams({
  1625. ...tableDataFilterParams,
  1626. itemName: ''
  1627. });
  1628. }
  1629. }} suffix={
  1630. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
  1631. } />
  1632. </div>
  1633. </div>
  1634. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
  1635. <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
  1636. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1637. onMouseLeave={() => set_ifShowTip(false)}
  1638. >
  1639. {/* <span key="1">获取</span> */}
  1640. {importData('kpi_cost', '成本')}
  1641. </div>
  1642. </Popover>
  1643. </div>
  1644. {currentComputeDate && <BMSTable actionRef={tableRef} rowKey='id' params={tableDataFilterParams} columns={tableColumn} request={(params, sort, filter) => getTableData('kpi_cost', params, sort, filter)} />}
  1645. <div className='totalCount'>合计:{totalNum}</div>
  1646. </div>
  1647. )
  1648. }
  1649. {
  1650. currentSelectedTabKey == 'kpi_unit_cost' && (
  1651. <div className='tabContent'>
  1652. <div className='tabContentInner'>
  1653. <div className='leftTree'>
  1654. <div className='search'>
  1655. <Input className='searchInput' allowClear onChange={onTreeSearchKeyChange} placeholder="请输入名称" suffix={
  1656. <IconFont type="iconsousuo" />
  1657. } />
  1658. </div>
  1659. <div className='treeWrap'>
  1660. {
  1661. treeData && treeData.length > 0 && currentSelectedTreeNode && (
  1662. <DirectoryTree
  1663. fieldNames={{ title: 'name', key: 'code', children: 'child' }}
  1664. rootStyle={{ height: '100%', paddingBottom: 50, overflowY: 'scroll', overflowX: 'hidden' }}
  1665. onSelect={onSelectHandle}
  1666. onExpand={onExpand}
  1667. expandedKeys={expandedKeys}
  1668. autoExpandParent={autoExpandParent}
  1669. selectedKeys={[currentSelectedTreeNode.code]}
  1670. blockNode={true}
  1671. icon={() => null}
  1672. titleRender={
  1673. (nodeData: any) => {
  1674. const strTitle = nodeData.name as string;
  1675. const index = strTitle.indexOf(searchValue);
  1676. const beforeStr = strTitle.substring(0, index);
  1677. const afterStr = strTitle.slice(index + searchValue.length);
  1678. const title =
  1679. index > -1 ? (
  1680. <span>
  1681. {beforeStr}
  1682. <span className="site-tree-search-value" style={{ color: 'red', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{searchValue}</span>
  1683. {afterStr}
  1684. </span>
  1685. ) : (
  1686. <span className='strTitle'>{strTitle}</span>
  1687. );
  1688. return <div style={{
  1689. display: 'flex', flexDirection: 'row',
  1690. width: '100%',
  1691. justifyContent: 'flex-start', alignItems: 'center', height: 32,
  1692. borderRadius: '4px',
  1693. overflow: 'hidden',
  1694. color: '#17181A',
  1695. textOverflow: 'ellipsis',
  1696. whiteSpace: 'nowrap'
  1697. }}>{title}</div>
  1698. }
  1699. }
  1700. defaultSelectedKeys={[treeData[0].child[0].code]}
  1701. treeData={treeData as unknown as DataNode[]}
  1702. // treeData={treeDataNew}
  1703. switcherIcon={(props: any) => {
  1704. const { expanded } = props;
  1705. return !expanded ? <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={expandedIcon} /> : <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={closeIcon} />
  1706. }}
  1707. />
  1708. )
  1709. }
  1710. </div>
  1711. </div>
  1712. <div className='rightTable'>
  1713. <div className='tableToolbar'>
  1714. <div className='filter'>
  1715. {/* <div className='search' style={{ marginRight: 24 }}>
  1716. <span>类型:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1717. set_tableDataSearchKeywords(e.target.value);
  1718. if (e.target.value.length == 0) {
  1719. set_tableDataFilterParams({
  1720. ...tableDataFilterParams,
  1721. itemType: ''
  1722. });
  1723. }
  1724. }} suffix={
  1725. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemType')} />
  1726. } />
  1727. </div> */}
  1728. <div className='search'>
  1729. <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
  1730. set_tableDataSearchKeywords(e.target.value);
  1731. if (e.target.value.length == 0) {
  1732. set_tableDataFilterParams({
  1733. ...tableDataFilterParams,
  1734. itemName: ''
  1735. });
  1736. }
  1737. }} suffix={
  1738. <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
  1739. } />
  1740. </div>
  1741. </div>
  1742. <>
  1743. {/* <span className='compelted'>已分配总额: <i>{pageData.completedTotal}</i></span>
  1744. <span className='left'>剩余分配总额: <i>{pageData.leftTotal}</i></span> */}
  1745. <div className='count'><span className='compelted' style={{ display: 'inline-block', marginRight: 20 }}>总成本:<i>{formatMoneyNumber(Number(unitCostComputeData.unitCostTotal.toFixed(2)))}</i></span><span className='left'>可控成本:<i>{formatMoneyNumber(Number(unitCostComputeData.unitCostCtrlTotal.toFixed(2)))}</i></span></div>
  1746. {
  1747. !ifBanAllAction && (
  1748. <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
  1749. <div className={auditType == '1' || loading ? 'btnGroup disabled' : 'btnGroup'}
  1750. onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
  1751. onMouseLeave={() => set_ifShowTip(false)}
  1752. >
  1753. <span key="1" onClick={auditType == '0' ? () => generateFunc('kpi_unit_cost', false) : () => { }}>获取</span>
  1754. <>{importData('kpi_unit_cost', '单元成本')}</>
  1755. </div>
  1756. </Popover>
  1757. )
  1758. }
  1759. </>
  1760. </div>
  1761. {currentComputeDate && <BMSTable actionRef={tableRef} scroll={{ y: 666 }} loading={{ spinning: loading, tip: '正在获取数据...' }} rowKey='id' params={tableDataFilterParams} columns={[...tableColumn]} pagination={false} request={(params, sort, filter) => getTableData('kpi_unit_cost', params, sort, filter)} />}
  1762. </div>
  1763. </div>
  1764. </div>
  1765. )
  1766. }
  1767. </BMSPagecontainer>
  1768. </div>
  1769. )
  1770. }
  1771. </>
  1772. </div>
  1773. );
  1774. };
  1775. export default MonthlyDataCheck;