12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790 |
- /*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2022-12-16 09:42:52
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-07 19:16:36
- * @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',
- align: 'center'
- },
- {
- title: '核算单元名称',
- dataIndex: 'unitName',
- key: 'unitName',
- align: 'center'
- },
- {
- title: '科室',
- dataIndex: 'deptName',
- key: 'deptName',
- align: 'center'
- },
- {
- title: '工号',
- dataIndex: 'empNo',
- key: 'empNo',
- align: 'center'
- },
- {
- title: '姓名',
- dataIndex: 'empName',
- key: 'empName',
- align: 'center'
- },
- {
- title: '工资类型',
- dataIndex: 'salaryType',
- key: 'salaryType',
- align: 'center'
- },
- ]
- const tableColumnTwo = [
- {
- title: '职类',
- dataIndex: 'unitTypeName',
- key: 'unitTypeName',
- align: 'center'
- },
- {
- title: '核算单元名称',
- dataIndex: 'unitName',
- key: 'unitName',
- align: 'center'
- },
- {
- title: '科室',
- dataIndex: 'deptName',
- key: 'deptName',
- align: 'center'
- },
- {
- title: '项目名称',
- dataIndex: 'assessmentName',
- key: 'assessmentName',
- align: 'center'
- },
- {
- title: '分配方式',
- dataIndex: 'distributionType',
- key: 'distributionType',
- align: 'center',
- render: (record: any) => {
- if (record == 1) return '占比'
- if (record == 2) return '绝对数'
- if (record == 3) return '自动计算'
- }
- },
- {
- title: '数值',
- dataIndex: 'value',
- key: 'value',
- align: 'center'
- },
- {
- title: '工号',
- dataIndex: 'targetValue',
- key: 'targetValue',
- align: 'center'
- },
- {
- title: '姓名',
- dataIndex: 'targetValueName',
- key: 'targetValueName',
- align: 'center'
- },
- {
- title: '说明',
- dataIndex: 'description',
- key: 'description',
- align: 'center'
- }
- ];
- const tableColumnThree = [
- {
- title: '项目名称',
- dataIndex: 'itemName',
- key: 'itemName',
- align: 'center'
- },
- {
- title: '类型',
- dataIndex: 'itemTypeName',
- key: 'itemTypeName',
- align: 'center',
- },
- {
- title: '点值',
- dataIndex: 'orderPointValue',
- key: 'orderPointValue',
- align: 'center'
- },
- ];
- const tableColumnFive = [
- {
- title: '年度',
- dataIndex: 'year',
- key: 'year',
- align: 'center'
- },
- {
- title: '月份',
- dataIndex: 'month',
- key: 'month',
- align: 'center'
- },
- {
- title: '项目名称',
- dataIndex: 'itemName',
- key: 'itemName',
- align: 'center'
- },
- {
- title: '项目类型',
- dataIndex: 'itemTypeName',
- key: 'itemTypeName',
- align: 'center'
- },
- {
- title: '金额',
- dataIndex: 'cost',
- key: 'cost',
- align: 'center'
- },
- // {
- // title: '操作人',
- // dataIndex: 'unitType',
- // key: 'unitType',
- // align: 'center'
- // },
- // {
- // title: '操作时间',
- // dataIndex: 'unitType',
- // key: 'unitType',
- // align: 'center'
- // },
- ]
- 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.groupCode });
- 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',
- align: 'center',
- width: 120,
- fixed: 'left',
- }, ...columns,
- {
- title: '总得分',
- dataIndex: 'totalScore',
- key: 'totalScore',
- align: 'center',
- 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}`,
- 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}`,
- 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
- 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 />
- </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){
- setInterval(()=>{
- getCalcStatus();
- },60000)
- }
- },[loading])
- useEffect(() => {
- set_tableDataFilterParams({
- ...tableDataFilterParams,
- groupId: currentSelectedManaGroup?.groupCode,
- });
- }, [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',
- align: 'center',
- 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',
- align: 'center',
- 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',
- align: 'center',
- 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',
- align: 'center'
- }
- ]} 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,
- align: 'center',
- 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;
|