1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786 |
- /*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2022-12-16 09:42:52
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-31 12:41:30
- * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
- import BMSPagecontainer from '@/components/BMSPageContainer';
- import { useEffect, useRef, useState } from 'react';
- import './style.less';
- import { Tree, TreeProps, Tabs, Input, Modal, Transfer, Divider, Select, Popconfirm, message, Button, Skeleton, Popover } from 'antd';
- import { DataNode } from 'antd/es/tree';
- import expandedIcon from '../../../../static/treenode_open.png';
- import closeIcon from '../../../../static/treenode_collapse.png';
- import { BMSTable } from '@/components/BMSTable';
- import { ActionType, ModalForm, ProColumns, ProColumnType, ProForm, ProFormDependency, ProFormDigit, ProFormInstance, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-components';
- import { createFromIconfontCN } from '@ant-design/icons';
- import { addTableData, checkMonthlyReq, delTableDataRequest, downloadTemplateReq, editCheckProject, editManaIndexTableData, editTableData, editTableSalaryRequest, generateCheckProjectTableData, getCheckItemCalcStatus, getCheckProjectTableData, getCostData, getDepLists, getEmps, getHesuanUnits, getIncomeData, getManaIndexGroup, getManaIndexTableData, getNoCheckTableData, getPageCheckStatus, getProjects, getSalaryInfoTableData, importMonthlyperformanceRelaFiles } from './service';
- import { TransferDirection } from 'antd/es/transfer';
- import editIcon from '../../../../static/editIcon.png';
- import conformIcon from '../../../../static/confirmIcon.png';
- import { getComputeDate } from '@/pages/Home/service';
- import BMSModalForm from '@/components/BMSModalForm';
- import { DefaultOptionType } from 'antd/es/select';
- import { getTreeData, getTreeDataRespType } from '../monthlyInfoCheck/service';
- import DirectoryTree from 'antd/es/tree/DirectoryTree';
- import BMSUpload from '@/components/BMSUpload';
- import FormItem from 'antd/es/form/FormItem';
- import { getDeepestTreeData } from '@/utils/tooljs';
- const IconFont = createFromIconfontCN({
- scriptUrl: '//at.alicdn.com/t/c/font_1927152_4nm5kxbv4m3.js',
- });
- export type TableListItem = {
- key: number;
- name: string;
- };
- const MonthlyDataCheck: React.FC = () => {
- const [treeData, set_treeData] = useState<getTreeDataRespType[]>([]);
- const [ifShowTip, set_ifShowTip] = useState(false);
- const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);
- const [searchValue, setSearchValue] = useState('');
- const [autoExpandParent, setAutoExpandParent] = useState(true);
- const [auditType, set_auditType] = useState('0');
- const [tableColumn, set_tableColumn] = useState<ProColumns & { [key: string]: any }[]>([]);
- const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<any | undefined>();
- const [currentSelectedTabKey, set_currentSelectedTabKey] = useState<string>('1');
- const [currentComputeDate, set_currentComputeDate] = useState<string | undefined>(undefined);
- const [editTableCellId, set_editTableCellId] = useState<number | undefined>(undefined);
- const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
- const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>(undefined);
- const [editModalVisible, set_editModalVisible] = useState(false);
- const [loading, set_loading] = useState(false);
- const [currentEditRecord, set_currentEditRecord] = useState<undefined | any>(undefined);
- const [inputSalaryNum, set_inputSalaryNum] = useState(0); //固定工资金额
- const [checkItemvalNum, set_checkItemvalNum] = useState(0); //考核项目数值
- const [isTableEdit, set_isTableEdit] = useState(false);
- const [totalNum, set_totalNum] = useState(0); //收入和成本数据的总和数值
- const [tableH,set_tableH] = useState(0);
- const [manaIndexGroups, set_manaIndexGroups] = useState<{ id: number, groupCode: string, groupName: string, hospId: number }[]>([]); //管理指标分组
- const [currentSelectedManaGroup, set_currentSelectedManaGroup] = useState<{ id: number, groupCode: string, groupName: string, hospId: number }>();
- const formRef = useRef<ProFormInstance>();
- const tableRef = useRef<ActionType>();
- const tableColumnOne = [
- {
- title: '职类',
- dataIndex: 'unitTypeName',
- key: 'unitTypeName',
-
- },
- {
- title: '核算单元名称',
- dataIndex: 'unitName',
- key: 'unitName',
-
- },
- {
- title: '科室',
- dataIndex: 'deptName',
- key: 'deptName',
-
- },
- {
- title: '工号',
- dataIndex: 'empNo',
- key: 'empNo',
-
- },
- {
- title: '姓名',
- dataIndex: 'empName',
- key: 'empName',
-
- },
- {
- title: '工资类型',
- dataIndex: 'salaryType',
- key: 'salaryType',
-
- },
- ]
- const tableColumnTwo = [
- {
- title: '职类',
- dataIndex: 'unitTypeName',
- key: 'unitTypeName',
-
- },
- {
- title: '核算单元名称',
- dataIndex: 'unitName',
- key: 'unitName',
-
- },
- {
- title: '科室',
- dataIndex: 'deptName',
- key: 'deptName',
-
- },
- {
- title: '项目名称',
- dataIndex: 'assessmentName',
- key: 'assessmentName',
-
- },
- {
- title: '分配方式',
- dataIndex: 'distributionType',
- key: 'distributionType',
-
- render: (record: any) => {
- if (record == 1) return '占比'
- if (record == 2) return '绝对数'
- if (record == 3) return '自动计算'
- }
- },
- {
- title: '数值',
- dataIndex: 'value',
- key: 'value',
-
- },
- {
- title: '工号',
- dataIndex: 'targetValue',
- key: 'targetValue',
-
- },
- {
- title: '姓名',
- dataIndex: 'targetValueName',
- key: 'targetValueName',
-
- },
- {
- title: '说明',
- dataIndex: 'description',
- key: 'description',
-
- }
- ];
- const tableColumnThree = [
- {
- title: '项目名称',
- dataIndex: 'itemName',
- key: 'itemName',
-
- },
- {
- title: '类型',
- dataIndex: 'itemTypeName',
- key: 'itemTypeName',
-
- },
- {
- title: '点值',
- dataIndex: 'orderPointValue',
- key: 'orderPointValue',
-
- },
- ];
- const tableColumnFive = [
- {
- title: '年度',
- dataIndex: 'year',
- key: 'year',
-
- },
- {
- title: '月份',
- dataIndex: 'month',
- key: 'month',
-
- },
- {
- title: '项目名称',
- dataIndex: 'itemName',
- key: 'itemName',
-
- },
- {
- title: '项目类型',
- dataIndex: 'itemTypeName',
- key: 'itemTypeName',
-
- },
- {
- title: '金额',
- dataIndex: 'cost',
- key: 'cost',
-
- },
- // {
- // title: '操作人',
- // dataIndex: 'unitType',
- // key: 'unitType',
- // align: 'center'
- // },
- // {
- // title: '操作时间',
- // dataIndex: 'unitType',
- // key: 'unitType',
- // align: 'center'
- // },
- ]
- let inervalhander = undefined;
- const getCurrentComputeDate = async () => {
- const resp = await getComputeDate();
- set_currentComputeDate(resp);
- }
- const onSelectHandle: TreeProps['onSelect'] = (selectedKeys, info) => {
- const { node } = info;
- //set_tableDataFilterParams({...tableDataFilterParams,current:1})
- set_currentSelectedTreeNode(node);
- };
- const onExpand = (newExpandedKeys: React.Key[]) => {
- setExpandedKeys(newExpandedKeys);
- setAutoExpandParent(false);
- };
- //固定金额编辑金额
- const editHandle = async (record: any) => {
- const { id, deptCode, salaryType, unitCode, userId } = record;
- if (id == editTableCellId) {
- //保存
- // console.log({ inputSalaryNum,currentSelectedTreeNode });
- if (inputSalaryNum) {
- const resp = await editTableSalaryRequest({
- computeDate: currentComputeDate as string,
- unitCode,
- deptCode, salaryType,
- salary: inputSalaryNum,
- userId: `${userId}`,
- id
- });
- if (resp) {
- tableRef.current?.reload();
- }
- }
- set_editTableCellId(undefined);
- } else {
- //编辑
- set_editTableCellId(id);
- }
- }
- //考核项目编辑数值
- const editCheckItemValHandle = async (record: any) => {
- const { id, itemCode, itemName, itemType, orderPointValue, executePointValue, hospId, unitCode } = record;
- if (id == editTableCellId) {
- //保存
- if (checkItemvalNum) {
- const resp = await editCheckProject({
- computeDate: currentComputeDate as string,
- itemCode,
- itemName,
- itemType,
- orderPointValue,
- value: checkItemvalNum,
- executePointValue,
- hospId,
- unitCode,
- id
- });
- if (resp) {
- tableRef.current?.reload();
- }
- }
- set_editTableCellId(undefined);
- } else {
- //编辑
- set_editTableCellId(id);
- }
- }
- const checkProjectEditHandle = (record: any) => {
- // console.log({record});
- const { props: { record: _record } } = record;
- set_currentEditRecord(_record);
- set_editModalVisible(true);
- }
- const tableDataAddHandle = () => {
- set_editModalVisible(true);
- }
- //表格行编辑
- const tableEditActHandle = (record: any) => {
- //console.log({'edit':record});
- set_isTableEdit(true);
- set_currentEditRecord(record);
- set_editModalVisible(true);
- }
- //管理指标row编辑
- const EditManaIndexTableRow = ({ record }: { record: any }) => {
- const { value, columns, unitName, id, unitCode, totalScore, computeDate, groupId } = record;
- return (
- <ModalForm
- title={`编辑${unitName}实际值`}
- width={500}
- // layout='inline'
- trigger={
- <a key={'1'} style={{ textAlign: 'center', width: '100%' }}>编辑</a>
- }
- initialValues={record}
- onFinish={async (values) => {
- const editResult = value.map((a: any) => {
- return {
- ...a,
- value: values[`value${a.code}`]
- }
- })
- const data = {
- id,
- unitCode,
- unitName,
- totalScore,
- computeDate,
- groupId,
- value: editResult
- }
- const resp = await editManaIndexTableData(data);
- if (resp) {
- tableRef.current?.reload();
- }
- return true
- }}
- >
- {
- value.map((item: any, index: any) => {
- const findTitle = columns.filter((a: any) => a.key == item.code);
- return (
- findTitle.length > 0 ? <ProFormDigit key={index} label={`${findTitle[0].dataIndex}`} name={`value${item.code}`} min={1} max={10} /> : null
- )
- })
- }
- </ModalForm>
- )
- }
- const onTabChange = (activeKey: string) => {
- set_currentSelectedTabKey(activeKey);
- }
- //获取核算单元树结构
- const getCheckUnitTreeDataFunc = async (computeDate: string) => {
- const resp = await getTreeData(computeDate);
- if (resp) {
- set_treeData(resp);
- }
- }
- const getCalcStatus =async () => {
- const resp = await getCheckItemCalcStatus(currentComputeDate as string,'ASSESSMENT');
- if(resp){
- if(resp.calculating){
- //继续计算
- set_loading(true);
- return false
- }else{
- //计算已完成
- set_loading(false);
- return true
- }
- }else{
- tableRef.current?.reload();
- return true
- }
- }
- const getTableData = async (type: '1' | '2' | '3' | '4' | '5' | '6', params: any, sort: any, filter: any) => {
- if (currentComputeDate) {
- if (type == '1') {
- const resp = await getSalaryInfoTableData({
- computeDate: currentComputeDate,
- ...params
- });
- if (resp) {
- return {
- data: resp.list,
- total: resp.totalCount,
- pageSize: resp.pageSize,
- totalPage: resp.totalPage,
- success: true
- }
- }
- }
- if (type == '2') {
- const resp = await getNoCheckTableData({
- computeDate: currentComputeDate,
- ...params
- });
- if (resp) {
- return {
- data: resp.list,
- total: resp.totalCount,
- pageSize: resp.pageSize,
- totalPage: resp.totalPage,
- success: true
- }
- }
- }
- if (type == '3') {
-
- if(!loading){
- //计算完和未计算
- const resp = await getCheckProjectTableData({
- computeDate: currentComputeDate,
- unitCode: currentSelectedTreeNode.code,
- ...params
- });
- if (resp) {
- return {
- data: resp.list,
- success: true,
- total: resp.totalCount,
- pageSize: resp.pageSize,
- totalPage: resp.totalPage,
- }
- }
- }
- }
- if (type == '4') {
- if (currentSelectedManaGroup) {
- const resp = await getManaIndexTableData({ ...params, computeDate: currentComputeDate, groupId: currentSelectedManaGroup.id });
- if (resp) {
- const columns = resp.title.map((item: any) => (item.children ? {
- title: () => {
- 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>
- },
- key: item.code,
- dataIndex: item.name,
- children: item.children.map((a: any) => {
- return {
- title: a.name,
- dataIndex: `${a.code}${item.code}`,
- key: `${a.code}${item.code}`,
- width: 100,
- align: 'center',
- }
- })
- } : {
- title: item.name,
- dataIndex: item.code,
- key: item.code,
- width: 100,
- align: 'center',
- }));
- set_tableColumn([{
- title: '核算单元',
- dataIndex: 'unitName',
- key: 'unitName',
-
- width: 120,
- fixed: 'left',
- }, ...columns,
- {
- title: '总得分',
- dataIndex: 'totalScore',
- key: 'totalScore',
-
- width: 100,
- fixed: 'right',
- },
- ]);
- const data = resp.managerData.map((item: any) => {
- let rowData: { [key: string]: any } = {};
- for (let index = 0; index < item.value.length; index++) {
- for (const key in item.value[index]) {
- if (key != 'code') {
- rowData[`${key}${item.value[index].code}`] = item.value[index][`${key}`]
- }
- }
- }
- return { ...item, ...rowData, id: item.id, columns }
- });
- return {
- data: data,
- success: true,
- total: resp.totalCount,
- pageSize: resp.pageSize,
- totalPage: resp.totalPage,
- }
- }
- }
- }
- if (type == '5') {
- const resp = await getIncomeData({
- computeDate: currentComputeDate,
- ...params
- });
- if (resp) {
- set_totalNum(resp.sum);
- return {
- data: resp.pageList.list,
- success: true,
- total: resp.pageList.totalCount,
- pageSize: resp.pageList.pageSize,
- totalPage: resp.pageList.totalPage,
- }
- }
- }
- if (type == '6') {
- const resp = await getCostData({
- computeDate: currentComputeDate,
- ...params
- });
- if (resp) {
- set_totalNum(resp.sum);
- return {
- data: resp.pageList.list,
- success: true,
- total: resp.pageList.totalCount,
- pageSize: resp.pageList.pageSize,
- totalPage: resp.pageList.totalPage,
- }
- }
- }
- }
- return []
- }
- const tableDataSearchHandle = (paramName: string) => {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- [`${paramName}`]: tableDataSearchKeywords
- })
- }
- //表格删除确认
- const delActionHandle = async (record: any, index: number) => {
- const { id } = record;
- const resp = await delTableDataRequest({
- computeDate: currentComputeDate as string,
- id,
- index
- });
- if (resp) {
- tableRef.current?.reload();
- message.success('删除成功!')
- }
- };
- interface RecordType {
- key: string;
- title: string;
- description: string;
- }
- const mockData: RecordType[] = Array.from({ length: 20 }).map((_, i) => ({
- key: i.toString(),
- title: `content${i + 1}`,
- description: `description of content${i + 1}`,
- }));
- const initialTargetKeys = mockData.filter((item) => Number(item.key) > 10).map((item) => item.key);
- const TransferNode = () => {
- const [targetKeys, setTargetKeys] = useState(initialTargetKeys);
- const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
- const onChange = (nextTargetKeys: string[], direction: TransferDirection, moveKeys: string[]) => {
- console.log('targetKeys:', nextTargetKeys);
- console.log('direction:', direction);
- console.log('moveKeys:', moveKeys);
- setTargetKeys(nextTargetKeys);
- };
- const onSelectChange = (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => {
- console.log('sourceSelectedKeys:', sourceSelectedKeys);
- console.log('targetSelectedKeys:', targetSelectedKeys);
- setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
- };
- return (
- <Transfer
- dataSource={mockData}
- titles={['未添加人员', '已添加人员']}
- targetKeys={targetKeys}
- selectedKeys={selectedKeys}
- onChange={onChange}
- listStyle={{
- width: '45%'
- }}
- onSelectChange={onSelectChange}
- render={(item) => item.title}
- />
- )
- }
- const dataList: any[] = [];
- const generateList = (data: getTreeDataRespType[]) => {
- for (let i = 0; i < data.length; i++) {
- const node = data[i];
- const { code, name } = node;
- dataList.push({ code: code, name: name });
- if (node.child) {
- generateList(node.child);
- }
- }
- };
- generateList(treeData as any);
- const getParentKey = (key: React.Key, tree: any[]): React.Key => {
- let parentKey: React.Key;
- for (let i = 0; i < tree.length; i++) {
- const node = tree[i];
- if (node.child) {
- if (node.child.some((item: { code: React.Key; }) => item.code === key)) {
- parentKey = node.code;
- } else if (getParentKey(key, node.child)) {
- parentKey = getParentKey(key, node.child);
- }
- }
- }
- return parentKey!;
- };
- //考核项目树结构搜索
- const onTreeSearchKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- const { value } = e.target;
- const newExpandedKeys = dataList
- .map((item) => {
- if (item.name.indexOf(value) > -1) {
- return getParentKey(item.code, treeData);
- }
- return null;
- });
- const b = newExpandedKeys.filter((item, i, self) => item && self.indexOf(item) === i);
- setExpandedKeys(newExpandedKeys as React.Key[]);
- setSearchValue(value);
- setAutoExpandParent(true);
- }
- //获取数据
- const confirmGenerateHandle: any = async (index: number, others?: any) => {
- if (index == 3) {
- const resp = await generateCheckProjectTableData({
- computeDate: currentComputeDate as string,
- unitCode: others ? currentSelectedTreeNode.code : ''
- });
- set_loading(false);
- if (resp) {
- tableRef.current?.reload();
- }
- return Promise.resolve(true);
-
- }
- }
- const generateFunc = (index: number, others?: any) => {
- /**
- * index 获取的表格类型下标
- */
- if (index == 3&&!loading) {
- Modal.confirm({
- title: '注意',
- cancelText: '',
- closable: true,
- content: others ? '获取单个操作会覆盖上次获取的该核算单元的数据,确定要继续操作?' : '获取所有操作会覆盖所有已获取的数据,确定要继续操作?',
- onOk: () => { set_loading(true);confirmGenerateHandle(index,others) }
- })
- }
- }
- const onVisibleChangeHandle = (bool: boolean) => {
- set_editModalVisible(bool);
- if (!bool) {
- set_isTableEdit(false);
- }
- }
- const onManaIndexGroupClick = (manaIndexGroup: any) => {
- set_currentSelectedManaGroup(manaIndexGroup);
- }
- const tableFormCommit = async (formData: any, type: 'edit' | 'add') => {
- if (type == 'edit') {
- //编辑
- const body = {
- id: currentEditRecord.id,
- computeDate: currentComputeDate as string,
- unitCode: formData.unitCode,
- deptCode: formData.deptCode,
- nonAssessmentCode: typeof formData.assessmentCode == 'number' ? formData.assessmentCode : formData.assessmentCode.value,
- targetValue: `${formData.userId?formData.userId:''}`,
- value: `${formData.value}`,
- description: formData.description
- }
- const resp = await editTableData(body);
- if (resp) {
- tableRef.current?.reload();
- }
- set_isTableEdit(false);
- } else if (type == 'add') {
- //新增
- const body = {
- computeDate: currentComputeDate as string,
- unitCode: formData.unitCode,
- deptCode: formData.deptCode,
- nonAssessmentCode: formData.assessmentCode.value,
- targetValue: `${formData.userId?formData.userId:''}`,
- value: `${formData.value}`,
- description: formData.description
- }
- const resp = await addTableData(body);
- if (resp) {
- tableRef.current?.reload();
- }
- }
- // set_editModalVisible(false);
- set_currentEditRecord(undefined);
- return true;
- }
- //获取管理指标分组
- const getManaIndiGroupRequest = async () => {
- const resp = await getManaIndexGroup();
- if (resp) {
- set_manaIndexGroups(resp);
- if (resp.length > 0) {
- // const titleResp = await getManaIndexTableData({ computeDate: currentComputeDate as string, groupId: resp[0].groupCode });
- // if (titleResp) {
- // const columns = titleResp.title.map((item: any) => (item.children ? {
- // title: () => {
- // return <div>{item.name} <span style={{ fontSize: 14, fontFamily: 'SourceHanSansCN-Medium, SourceHanSansCN', fontWeight: 500, color: item.arrow == 'up' ? '#00BF8F' : '#FF4060' }}>↓</span></div>
- // },
- // key: item.code,
- // dataIndex: item.name,
- // children: item.children.map((a: any) => {
- // return {
- // title: a.name,
- // dataIndex: `${a.code}${item.code}`,
- // key: `${a.code}${item.code}`,
- // width: 100,
- // align: 'center',
- // }
- // })
- // } : {
- // title: item.name,
- // dataIndex: item.code,
- // key: item.code,
- // width: 100,
- // align: 'center',
- // }));
- // set_tableColumn([{
- // title: '核算单元',
- // dataIndex: 'unitName',
- // key: 'unitName',
- // align: 'center',
- // width: 120,
- // fixed: 'left',
- // }, ...columns,
- // {
- // title: '总得分',
- // dataIndex: 'totalScore',
- // key: 'totalScore',
- // align: 'center',
- // width: 100,
- // fixed:'right',
- // },
- // {
- // title: '操作',
- // key: 'option',
- // valueType: 'option',
- // width: 100,
- // align: 'center',
- // fixed: 'right',
- // render: (_: any, record: any) => [
- // <EditManaIndexTableRow record={record} key={'edit'} />
- // ],
- // }]);
- // }
- set_currentSelectedManaGroup(resp[0])
- }
- }
- }
- const importData = (index: number, name: string) => {
- return (
- <ModalForm
- width={360}
- title={`导入${name}数据`}
- trigger={
- <span key="3">导入</span>
- }
- submitter={{
- render: (props, defaultDoms) => {
- const needBtn = defaultDoms.filter((b) => {
- return b.key != 'rest'
- })
- return [
- // <Button
- // key="ok"
- // onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
- // >
- // 下载模板
- // </Button>,
- ...needBtn,
- ];
- },
- }}
- onFinish={async (values) => {
- // console.log({values});
- const { importFile: { fileList } } = values;
- let formData = new FormData();
- formData.append('file', fileList[0].originFileObj);
- formData.append('computeDate', currentComputeDate as string);
- const resp = await importMonthlyperformanceRelaFiles(index, formData);
- if (resp) {
- tableRef.current?.reload();
- return true;
- }
- }}
- >
- <FormItem name={'importFile'}>
- <BMSUpload downloadTemplateFile={auditType == '0' ? () => downloadTemplate(index) : () => { }} />
- </FormItem>
- </ModalForm>
- )
- }
- const checkHandle = async (type: string) => {
- const resp = await checkMonthlyReq(
- currentComputeDate as string,
- type == '0' ? '1' : '0', //审核类型 1审核 0取消审核
- );
- if (resp) {
- if (type == '0') {
- message.success('审核提交成功!');
- set_auditType('1');
- }
- if (type == '1') {
- message.success('取消审核提交成功!');
- set_auditType('0');
- }
- }
- }
- const pageCheckStatusFunc = async (time: string) => {
- const resp = await getPageCheckStatus(time);
- if (resp) {
- set_auditType(`${resp}`); //0 未审核 1 已审核
- }
- }
- const downloadTemplate = async (index: number, id?: number) => {
- await downloadTemplateReq(index, id);
- }
-
- const handleResize = (e:any)=>{
- const wH = e.target.innerHeight;
- const tableHeight = wH - 320;
- set_tableH(tableHeight);
- }
- function doResize(){
- setTimeout(() => {
- const ev: any = new Event('resize');
- window.dispatchEvent(ev);
- },0)
- }
- useEffect(()=>{
- if(loading){
- inervalhander = setInterval(()=>{
- getCalcStatus();
- },60000)
- }
- },[loading])
- useEffect(() => {
- console.log({currentSelectedManaGroup});
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- id: currentSelectedManaGroup?.id,
- });
- }, [currentSelectedManaGroup]);
- useEffect(() => {
- tableRef.current?.reloadAndRest && tableRef.current?.reloadAndRest();
- }, [currentSelectedTreeNode]);
- useEffect(() => {
- //清空表格筛选项
- set_tableDataFilterParams(undefined);
- set_currentSelectedTreeNode(undefined);
- if (currentSelectedTabKey == '1') {
- set_tableColumn(tableColumnOne as ProColumns[]);
- }
- if (currentSelectedTabKey == '2') {
- set_tableColumn(tableColumnTwo as ProColumns[]);
- }
- if (currentSelectedTabKey == '3') {
- if (currentComputeDate) {
- getCheckUnitTreeDataFunc(currentComputeDate as string);
- }
- set_tableColumn(tableColumnThree as ProColumns[]);
- }
- if (currentSelectedTabKey == '4') {
- getManaIndiGroupRequest(); //获取分组
- }
- if (currentSelectedTabKey == '5') {
- set_tableColumn(tableColumnFive as ProColumns[]);
- }
- if (currentSelectedTabKey == '6') {
- set_tableColumn(tableColumnFive as ProColumns[]);
- }
- }, [currentSelectedTabKey]);
- useEffect(() => {
- //初始化左侧树结构数据后
- if (treeData?.length > 0) {
- if (treeData[0].child && treeData[0].child.length > 0) {
- const [node, nodeParent] = getDeepestTreeData(treeData[0], 'child');
- set_currentSelectedTreeNode(node);
- setExpandedKeys([nodeParent.code]);
- }
- }
- }, [treeData]);
- useEffect(() => {
- if (currentComputeDate) {
- pageCheckStatusFunc(currentComputeDate); //获取页面查核状态
- getCalcStatus();
- }
- }, [currentComputeDate]);
- useEffect(() => {
- getCurrentComputeDate();
- set_tableColumn(tableColumnOne as ProColumns[]);
- window.addEventListener('resize',(e)=>handleResize(e)) //监听窗口大小改变
- doResize();
- return ()=>{
- window.removeEventListener('resize',(e)=>handleResize(e));
- }
- }, [])
- return (
- <div className='MonthlyDataCheck'>
- {
- true && (
- <BMSModalForm formRef={formRef} visible={editModalVisible} initialValues={isTableEdit ? { ...currentEditRecord } : {}} title={isTableEdit ? '编辑' : '新增'}
- size="middle" width={737} onVisibleChange={onVisibleChangeHandle}
- modalProps={{
- destroyOnClose: true
- }}
- onFinish={(val: any) => tableFormCommit(val, isTableEdit ? 'edit' : 'add')}
- >
- {
- currentSelectedTabKey == '1' && (
- <>
- <ProFormText width="md" name="itemName" label="项目名" disabled />
- <ProFormText width="md" name="itemTypeName" label="类型" disabled />
- <ProFormDigit width="md" label="点值" name="pointValue" min={0} />
- <ProFormText width="md" name="createUser" label="操作人" disabled />
- </>
- )
- }
- {
- currentSelectedTabKey == '2' && (
- <>
- <ProForm.Group >
- <ProFormSelect
- name="deptCode"
- label="科室名称"
- placeholder="请选择"
- colProps={{ span: 12 }}
- rules={[{ required: true }]}
- request={async () => {
- const resp = await getDepLists();
- if (resp) {
- return resp.map((a: any) => ({
- label: a.deptName, value: a.deptCode, d: a
- }))
- }
- return []
- }}
- fieldProps={{
- showSearch: true,
- onChange: (value) => {
- formRef.current?.setFieldValue('unitCode', '');
- }
- }}
- />
- <ProFormDependency name={['deptCode']}>
- {
- ({ deptCode }) => {
- // console.log({deptCode});
- return (
- <ProFormSelect
- disabled={deptCode ? false : true}
- name="unitCode"
- label="核算单元"
- colProps={{ span: 12 }}
- placeholder="请选择"
- rules={[{ required: true }]}
- params={deptCode}
- request={async () => {
- if (deptCode) {
- const resp = await getHesuanUnits(deptCode);
- if (resp) {
- return resp.map((a: any) => ({
- label: a.unitName, value: a.unitCode, d: a
- }))
- }
- }
- return []
- }}
- fieldProps={{
- showSearch: true,
- onChange: (value) => {
- formRef.current?.setFieldValue('targetValue', '');
- }
- }}
- />
- )
- }
- }
- </ProFormDependency>
- </ProForm.Group>
- <ProForm.Group>
- <ProFormSelect
- name="assessmentCode"
- label="项目名称"
- placeholder="请选择"
- colProps={{ span: 12 }}
- rules={[{ required: true }]}
- request={async () => {
- const resp = await getProjects();
- if (resp) {
- return resp.map((a: any) => ({
- label: a.name, value: a.code, d: a
- }))
- }
- return []
- }}
- fieldProps={{
- labelInValue: true,
- onChange: (value) => {
- const { d: { distributionTypeName } } = value;
- formRef.current?.setFieldValue('distributionTypeName', distributionTypeName);
- }
- }}
- />
- <ProFormDependency name={['assessmentCode']}>
- {
- ({ assessmentCode }) => {
- return (
- <ProFormText disabled name="distributionTypeName" label="分配方式" colProps={{ span: 12 }} />
- )
- }
- }
- </ProFormDependency>
- </ProForm.Group>
- <ProForm.Group>
- <ProFormDigit label="数值" name="value" colProps={{ span: 12 }} min={-1000000000000000} />
- <ProFormDependency name={['unitCode', 'distributionTypeName']}>
- {
- ({ unitCode, distributionTypeName }) => {
- return (
- <ProFormSelect
- name="userId"
- label="人员姓名"
- colProps={{ span: 12 }}
- placeholder="请选择"
- rules={[{ required: distributionTypeName != '占比' ? true : false }]}
- params={unitCode}
- fieldProps={{
- showSearch: true,
- }}
- request={async () => {
- if (unitCode) {
- const resp = await getEmps(unitCode);
- if (resp) {
- return resp.map((a: any) => ({
- label: a.name, value: a.userId, d: a
- }))
- }
- }
- return []
- }}
- />
- )
- }
- }
- </ProFormDependency>
- </ProForm.Group>
- <ProForm.Group >
- <ProFormTextArea
- name="description"
- label="说明"
- colProps={{ span: 24 }}
- placeholder="请输入"
- />
- </ProForm.Group>
- </>
- )
- }
- </BMSModalForm>
- )
- }
- <>
- {
- (
- <div className='rightContent'>
- <BMSPagecontainer title={`核算年月:${currentComputeDate}`} ghost>
- <div className='checkBtn' onClick={() => checkHandle(`${auditType}`)}>{auditType == '0' ? '审核' : '取消审核'}</div>
- {/* <div className='midLine'>
- <span>点击检查</span>
- 是否有未对照的人员信息、未对照的科室信息及未设置的收费项目信息
- </div> */}
- <Tabs
- defaultActiveKey="1"
- onChange={onTabChange}
- items={[
- {
- label: `固定工资`,
- key: '1',
- },
- {
- label: `非考核项目`,
- key: '2',
- },
- {
- label: `考核项目`,
- key: '3',
- },
- {
- label: `管理指标`,
- key: '4',
- },
- {
- label: `收入数据`,
- key: '5',
- },
- {
- label: `成本数据`,
- key: '6',
- },
- ]}
- />
- {
- currentSelectedTabKey == '1' && (
- <div className='tabContent'>
- <div className='tableToolbar'>
- <div className='filter'>
- <div className='search'>
- <span>科室名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- deptName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('deptName')} />
- } />
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
- <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- {/* <span key="1">调整</span> */}
- {/* <span key="2" onClick={() => generateFunc()}>获取</span> */}
- {importData(1, '固定工资')}
- </div>
- </Popover>
- </div>
- {currentComputeDate && <BMSTable actionRef={tableRef} params={tableDataFilterParams} rowKey='id'
- columns={auditType == '0' ? [...tableColumn, {
- title: '金额',
- dataIndex: 'salary',
- key: 'salary',
- align: 'center',
- width: '10%',
- render: (text: any, record: any) => {
- return (
- <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
- <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
- {
- editTableCellId == record.id ? <Input size='small' defaultValue={record.salary} placeholder='请输入' onChange={(e) => { set_inputSalaryNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{text}</span>
- }
- </div>
- {auditType == '0' && <img onClick={() => editHandle(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />}
- </div>
- )
- }
- },
- {
- title: '操作',
- key: 'option',
- valueType: 'option',
- render: (_: any, record) => [
- <Popconfirm
- key={'del'}
- title="是否确认删除?"
- onConfirm={() => delActionHandle(record, 1)}
- // onCancel={()=>{}}
- okText="是"
- cancelText="否"
- >
- <a >删除</a>
- </Popconfirm>
- ],
- },] : [
- ...tableColumn, {
- title: '金额',
- dataIndex: 'salary',
- key: 'salary',
-
- width: '10%',
- // shouldCellUpdate:(record:any, prevRecord:any) => true,
- render: (text: any, record: any) => {
- return (
- <div style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
- <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
- {
- editTableCellId == record.id ? <Input size='small' defaultValue={record.salary} placeholder='请输入' onChange={(e) => { set_inputSalaryNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{text}</span>
- }
- </div>
- {auditType == '0' && <img onClick={() => editHandle(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />}
- </div>
- )
- }
- },
- ]} request={(params, sort, filter) => getTableData('1', params, sort, filter)} />}
- </div>
- )
- }
- {
- currentSelectedTabKey == '2' && (
- <div className='tabContent'>
- <div className='tableToolbar'>
- <div className='filter'>
- <div className='search'>
- <span>科室名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- deptName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('deptName')} />
- } />
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
- <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- {/* <span key="1" onClick={() => generateFunc(2)} >获取</span>
- <span key="2" >导入</span> */}
- {importData(2, '非考核项目')}
- <span key="3" onClick={auditType == '0' ? () => tableDataAddHandle() : () => { }}>添加</span>
- </div>
- </Popover>
- </div>
- {currentComputeDate && <BMSTable scroll={{ x: 120 * 10, y: 500 }} actionRef={tableRef} rowKey='id' params={tableDataFilterParams}
- columns={auditType == '0' ? [...tableColumn, {
- title: '操作',
- fixed: 'right',
- key: 'option',
-
- width: 130,
- valueType: 'option',
- render: (_: any, record: any) => [
- <a key={'edit'} onClick={() => tableEditActHandle(record)}>编辑</a>,
- <Divider type='vertical' key='line' />,
- <Popconfirm
- key={'del'}
- title="是否确认删除?"
- onConfirm={() => delActionHandle(record, 2)}
- // onCancel={()=>{}}
- okText="是"
- cancelText="否"
- >
- <a >删除</a>
- </Popconfirm>
- ],
- }] : [...tableColumn]} request={(params, sort, filter) => getTableData('2', params, sort, filter)} />}
- </div>
- )
- }
- {
- currentSelectedTabKey == '3' && (
- <div className='tabContent'>
- <div className='tabContentInner'>
- <div className='leftTree'>
- <div className='search'>
- <Input className='searchInput' allowClear onChange={onTreeSearchKeyChange} placeholder="请输入名称" suffix={
- <IconFont type="iconsousuo" />
- } />
- </div>
- <div className='treeWrap'>
- {
- treeData && treeData.length > 0 && currentSelectedTreeNode && (
- <DirectoryTree
- fieldNames={{ title: 'name', key: 'code', children: 'child' }}
- rootStyle={{ height: '100%', paddingBottom: 50, overflowY: 'scroll', overflowX: 'hidden' }}
- onSelect={onSelectHandle}
- onExpand={onExpand}
- expandedKeys={expandedKeys}
- autoExpandParent={autoExpandParent}
- selectedKeys={[currentSelectedTreeNode.code]}
- blockNode={true}
- icon={() => null}
- titleRender={
- (nodeData: any) => {
- const strTitle = nodeData.name as string;
- const index = strTitle.indexOf(searchValue);
- const beforeStr = strTitle.substring(0, index);
- const afterStr = strTitle.slice(index + searchValue.length);
- const title =
- index > -1 ? (
- <span>
- {beforeStr}
- <span className="site-tree-search-value" style={{ color: 'red', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{searchValue}</span>
- {afterStr}
- </span>
- ) : (
- <span className='strTitle'>{strTitle}</span>
- );
- return <div style={{
- display: 'flex', flexDirection: 'row',
- width: '100%',
- justifyContent: 'flex-start', alignItems: 'center', height: 32,
- borderRadius: '4px',
- overflow: 'hidden',
- color: '#17181A',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap'
- }}>{title}</div>
- }
- }
- defaultSelectedKeys={[treeData[0].child[0].code]}
- treeData={treeData as unknown as DataNode[]}
- // treeData={treeDataNew}
- switcherIcon={(props: any) => {
- const { expanded } = props;
- 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} />
- }}
- />
- )
- }
- </div>
- </div>
- <div className='rightTable'>
- <div className='tableToolbar'>
- <div className='filter'>
- {/* <div className='search' style={{ marginRight: 24 }}>
- <span>类型:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- itemType: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemType')} />
- } />
- </div> */}
- <div className='search'>
- <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- itemName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
- } />
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} >
- <div className={auditType == '1'||loading ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- <span key="1" onClick={auditType == '0'? () => generateFunc(3, true) : () => { }}>获取单个</span>
- <span key="2" onClick={auditType == '0'? () => generateFunc(3) : () => { }}>获取所有</span>
- </div>
- </Popover>
- </div>
- {currentComputeDate && <BMSTable actionRef={tableRef} loading={{ spinning: loading, tip: '正在计算数据...' }} rowKey='id' params={tableDataFilterParams} columns={auditType == '0' ? [...tableColumn, {
- title: '数值',
- dataIndex: 'value',
- key: 'value',
-
- render: (text: any, record: any) => {
- return (
- <div key={'editCheckitem'} style={{ display: 'flex', flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
- <div style={{ width: '80px', height: 16, display: 'flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
- {
- editTableCellId == record.id ? <Input size='small' defaultValue={record.value} placeholder='请输入' onChange={(e) => { set_checkItemvalNum(Number(e.target.value)) }} style={{ width: '80px' }} /> : <span>{text}</span>
- }
- </div>
- <img onClick={() => editCheckItemValHandle(record)} style={{ width: 16, height: 16, cursor: 'pointer', marginLeft: 8 }} src={editTableCellId == record.id ? conformIcon : editIcon} alt="" />
- </div>
- )
- }
- },
- {
- title: '操作',
- key: 'option',
- valueType: 'option',
- render: (_: any, record: any) => [
- <Popconfirm
- key={'del'}
- title="是否确认删除?"
- onConfirm={() => delActionHandle(record, 3)}
- // onCancel={()=>{}}
- okText="是"
- cancelText="否"
- >
- <a >删除</a>
- </Popconfirm>
- ],
- }] : [
- ...tableColumn, {
- title: '数值',
- dataIndex: 'value',
- key: 'value',
-
- }
- ]} request={(params, sort, filter) => getTableData('3', params, sort, filter)} />}
- </div>
- </div>
- </div>
- )
- }
- {
- currentSelectedTabKey == '4' && (
- <div className='tabContent'>
- <div className='tableToolbar'>
- <div className='filter'>
- <div className='tabs'>
- {
- manaIndexGroups.map((item, index) => {
- return (
- <div key={index} className={currentSelectedManaGroup?.id == item.id ? 'tab on' : 'tab'} onClick={() => onManaIndexGroupClick(item)}>{item.groupName}</div>
- )
- })
- }
- </div>
- <div className='search'>
- {/* <span>核算单元名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- unitName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle()} />
- } /> */}
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
- <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- {/* <span key="1">获取</span> */}
- {importData(4, '管理指标')}
- </div>
- </Popover>
- </div>
- {currentComputeDate && tableColumn && <BMSTable className='BMS-ManaIndextable' rowClassName={() => 'BMS-ManaIndextable-row'} bordered actionRef={tableRef} scroll={{ x: (100 * (tableColumn.length - 2)) + 120 + 100,y:tableH}} rowKey='unitCode' columns={auditType == '0' ? [...tableColumn,
- {
- title: '操作',
- key: 'option',
- valueType: 'option',
- width: 100,
-
- fixed: 'right',
- render: (_: any, record: any) => [
- <EditManaIndexTableRow record={record} key={'edit'} />
- ],
- }] : [...tableColumn]} pagination={false} params={tableDataFilterParams} request={(params, sort, filter) => getTableData('4', params, sort, filter)} />}
- </div>
- )
- }
- {
- currentSelectedTabKey == '5' && (
- <div className='tabContent' >
- <div className='tableToolbar'>
- <div className='filter'>
- <div className='search'>
- <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- itemName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
- } />
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
- <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- {/* <span key="1">获取</span> */}
- {importData(5, '收入')}
- </div>
- </Popover>
- </div>
- {currentComputeDate && <BMSTable actionRef={tableRef} rowKey='id' params={tableDataFilterParams} columns={tableColumn} request={(params, sort, filter) => getTableData('5', params, sort, filter)} />}
- <div className='totalCount'>合计:{totalNum}</div>
- </div>
- )
- }
- {
- currentSelectedTabKey == '6' && (
- <div className='tabContent'>
- <div className='tableToolbar'>
- <div className='filter'>
- <div className='search'>
- <span>项目名称:</span><Input className='searchInput' allowClear placeholder="请输入" onChange={(e) => {
- set_tableDataSearchKeywords(e.target.value);
- if (e.target.value.length == 0) {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- itemName: ''
- });
- }
- }} suffix={
- <IconFont type="iconsousuo" onClick={() => tableDataSearchHandle('itemName')} />
- } />
- </div>
- </div>
- <Popover open={ifShowTip} content={'当前处于审核中,无法操作!'} placement='topRight'>
- <div className={auditType == '1' ? 'btnGroup disabled' : 'btnGroup'}
- onMouseEnter={() => auditType == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
- onMouseLeave={() => set_ifShowTip(false)}
- >
- {/* <span key="1">获取</span> */}
- {importData(6, '成本')}
- </div>
- </Popover>
- </div>
- {currentComputeDate && <BMSTable actionRef={tableRef} rowKey='id' params={tableDataFilterParams} columns={tableColumn} request={(params, sort, filter) => getTableData('6', params, sort, filter)} />}
- <div className='totalCount'>合计:{totalNum}</div>
- </div>
- )
- }
- </BMSPagecontainer>
- </div>
- )
- }
- </>
- </div>
- );
- };
- export default MonthlyDataCheck;
|