This commit is contained in:
xixi 2024-08-23 12:00:55 +08:00
parent 2626762941
commit f4f1f52e57

View File

@ -1,5 +1,5 @@
import './refun.css';
import { useState, useEffect } from 'react';
import { useState, useEffect, } from 'react';
import {
Table,
// Pagination,
@ -8,6 +8,7 @@ import {
import { useSelector, useDispatch } from 'react-redux'
import { get, put, downloadUrl } from '../../util/AjaxUtils'
import type { TableProps } from 'antd';
import {getMenuActive} from '../../util/cache'
interface DataType {
projName: string;
projPayment: string;
@ -32,10 +33,12 @@ export default function Refun() {
const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗
const [projRefundApplyId, setprojRefundApplyId] = useState('') //要撤销的id
const { state } = useLocation()
const type = state? state.type:getMenuActive()
// setMenuActive(type)
// {state.type}
const columns: TableProps<DataType>['columns'] =
// 撤销状态
state.type == 'CANCELED' ? [
type == 'CANCELED' ? [
{
title: '序号',
dataIndex: 'index',
@ -121,7 +124,7 @@ export default function Refun() {
},
]
: state.type == 'PENDING' ?
: type == 'PENDING' ?
// PENDING待审核状态
[
{
@ -335,7 +338,7 @@ export default function Refun() {
params: {
page: page,
rows: 10,
applyStatus: state.type
applyStatus: type
}
},
onBefore() {
@ -379,7 +382,7 @@ export default function Refun() {
params: {
page: page,
rows: 10,
applyStatus: state.type
applyStatus: type
}
},
onSuccess(data: any) {
@ -415,7 +418,9 @@ export default function Refun() {
// getData(1)
setPage(1)
getData(1)
}, [state.type])
console.log(type);
}, [type])
return (
<div>