system-copyright-react/src/route/Correction/Correction.tsx

1280 lines
66 KiB
TypeScript
Raw Normal View History

2024-10-30 15:29:55 +08:00
import './Correction.css';
2024-08-26 18:03:35 +08:00
import { useState, useEffect, } from 'react';
import {
2024-10-30 15:29:55 +08:00
// Table,
Pagination,
Modal,
// Tag,
message, Spin,
Empty,
Dropdown
2024-08-26 18:03:35 +08:00
} from 'antd';
2024-09-04 15:52:35 +08:00
// import {
// // MenuFoldOutlined,
// ClearOutlined
// } from '@ant-design/icons';
2024-08-26 18:03:35 +08:00
import { useSelector, useDispatch } from 'react-redux'
import {
get,
2024-08-29 17:56:39 +08:00
put, downloadUrl,
2025-01-03 15:56:36 +08:00
Axios,
post
2024-08-26 18:03:35 +08:00
} from '../../util/AjaxUtils'
2024-10-30 15:29:55 +08:00
// import type { TableProps } from 'antd';
2024-09-04 15:52:35 +08:00
import { useLocation } from 'react-router-dom';
2024-09-03 17:51:42 +08:00
// import { getMenuActive } from '../../util/cache'
// import { useNavigate } from "react-router-dom";
2024-10-30 15:29:55 +08:00
// interface DataType {
// projName: string;
// type: string; //类型
// correctionType: string; //补正种类
// correctionReason: string;
// gmtCreate: string; //补正时间
// gmtReview: string;//审核时间
// reviewReason: string;//审核意见
// projId: string;
// applyStatus: string;//审核状态
// correctionVoucherFileKVs: any //补正凭证
// projCorrectionApplyId: string
// authorName: string;
// }
2024-08-26 18:03:35 +08:00
import revokeImg from '../../static/revoke.png'
2024-09-03 17:51:42 +08:00
// import { useLocation } from 'react-router-dom'
2024-10-30 15:29:55 +08:00
import logoImg from '../../static/projBox/logo.png'
import reason from '../../static/projBox/reson.png'
import green from '../../static/projBox/green.png'
import red from '../../static/projBox/red.png'
import blue from '../../static/projBox/blue.png'
import black from '../../static/projBox/black.png'
2025-05-07 14:25:17 +08:00
import numbg from '@theme/img/projBox/num.png'
import titleBg from '@theme/img/projBox/background.png'
import timeImg from '@theme/img/projBox/timeback.png'
2025-01-20 08:50:05 +08:00
import { useNavigate } from "react-router-dom";
2024-08-26 18:03:35 +08:00
export default function Correction() {
2025-01-03 17:00:42 +08:00
// 标签变量
2025-01-20 08:50:05 +08:00
const nav = useNavigate();
2025-01-03 17:00:42 +08:00
// const [tagDataIds, setTagDataIds] = useState<any[]>([])
2024-08-26 18:03:35 +08:00
const height = window.innerHeight - 180;
const [messageApi, contextHolder] = message.useMessage();
2024-09-03 17:51:42 +08:00
// const nav = useNavigate();
2024-09-04 15:52:35 +08:00
const { state } = useLocation()
2024-09-03 17:51:42 +08:00
// const MenuActive = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
2024-09-04 15:52:35 +08:00
// const [type, setType] = useState<string | null>(null)
2024-08-26 18:03:35 +08:00
const [isLoading, setIsLoading] = useState(false)
2025-01-20 08:50:05 +08:00
2024-08-26 18:03:35 +08:00
const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗
2024-09-04 15:52:35 +08:00
// const [numtype, setnumtype] = useState<string | null>(null) //类型 一次 二次
// const [correctionType, setcorrectionType] = useState<string | null>(null) //补正种类
// const init = () => {
// setnumtype(null)
// setcorrectionType(null)
// setType(null)
// }
const keyWords = state ? state.keywords : ''
const applyStatus = state ? state.applyStatus : ''
2025-01-03 15:56:36 +08:00
const tagCor = state ? state.tagCor : ''
2024-09-04 15:52:35 +08:00
const authorId = state ? state.authorId : ''
const correctionNumType = state ? state.correctionNumType : ''
const correctionType = state ? state.correctionType : ''
2025-01-03 17:33:18 +08:00
// const Ppage = state? state.page : 1
const [page, setPage] = useState(1) // 分页
2024-10-30 15:29:55 +08:00
// const columns: TableProps<DataType>['columns'] =
// // 撤销状态
// applyStatus == 'CANCELED' ? [
// {
// title: '序号',
// dataIndex: 'index',
// align: 'center',
// width: 80,
// fixed: 'left',
// render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
// },
// {
// title: '系统名称',
// dataIndex: 'projName',
// align: 'center',
// key: 'projName',
// fixed: 'left',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '产权所属者',
// dataIndex: 'authorName',
// align: 'center',
// key: 'authorName',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// width: 130,
// align: 'center',
// render: (text) => <div >{text == 'CORRECTION1' ? '一次补正' : text == 'CORRECTION2' ? '二次补正' : ''}</div>,
// },
// {
// title: '补正种类',
// dataIndex: 'correctionType',
// key: 'correctionType',
// align: 'center',
// width: 130,
// render: (text) => <div >{text == 'CODE' ? '代码' : text == 'MANUAL' ? '操作手册' : text == 'ALL' ? '全部补正' : ''}</div>,
// },
// {
// title: '补正原因',
// dataIndex: 'correctionReason',
// key: 'correctionReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '申请补正时间',
// dataIndex: 'gmtCreate',
// key: 'gmtCreate',
// align: 'center',
// width: 200,
// },
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// {
// title: '审核状态',
// dataIndex: 'applyStatus',
// key: 'applyStatus',
// align: 'center',
// width: 100,
// render: (text) => <Tag
// color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
// >{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>,
// },
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// {
// title: '补正凭证',
// dataIndex: 'correctionVoucherFileKVs',
// key: 'correctionVoucherFileKVs',
// width: 150,
// align: 'center',
// render: (_, record) => (
// (record.correctionVoucherFileKVs).map((item: any, index: number) => (
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
// className='ellipsis-text' title={item.value}
// key={index} onClick={() => {
// window.open(downloadUrl(item.key, false), '_blank')
// }}>{item.value}</div>
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// ))
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// ),
// },
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// ]
// : applyStatus == 'PENDING' ?
// // PENDING待审核状态
// [
// {
// title: '序号',
// dataIndex: 'index',
// align: 'center',
// width: 80,
// fixed: 'left',
// render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
// },
// {
// title: '系统名称',
// dataIndex: 'projName',
// align: 'center',
// key: 'projName',
// width: 150,
// fixed: 'left',
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '产权所属者',
// dataIndex: 'authorName',
// align: 'center',
// key: 'authorName',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// width: 130,
// render: (text) => <div >{text == 'CORRECTION1' ? '一次补正' : text == 'CORRECTION2' ? '二次补正' : ''}</div>,
// },
// {
// title: '补正种类',
// dataIndex: 'correctionType',
// key: 'correctionType',
// width: 130,
// align: 'center',
// render: (text) => <div >{text == 'CODE' ? '代码' : text == 'MANUAL' ? '操作手册' : text == 'ALL' ? '全部补正' : ''}</div>,
// },
// {
// title: '补正原因',
// dataIndex: 'correctionReason',
// key: 'correctionReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '申请补正时间',
// dataIndex: 'gmtCreate',
// key: 'gmtCreate',
// align: 'center',
// width: 200,
// },
// {
// title: '审核状态',
// dataIndex: 'applyStatus',
// key: 'applyStatus',
// align: 'center',
// width: 100,
// render: (text) => <Tag
// color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
// >{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>,
// },
// {
// title: '补正凭证',
// dataIndex: 'correctionVoucherFileKVs',
// key: 'correctionVoucherFileKVs',
// width: 150,
// align: 'center',
// render: (_, record) => (
// (record.correctionVoucherFileKVs).map((item: any, index: number) => (
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
// className='ellipsis-text' title={item.value}
// key={index} onClick={() => {
// window.open(downloadUrl(item.key, false), '_blank')
// }}>{item.value}</div>
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// ))
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
// ),
// },
// {
// title: '操作',
// align: 'center',
// fixed: 'right',
// width: 100,
// render: (_, record) => (
// // {record.name}
// <div className='refunBtn' onClick={() => {
// // console.log(record);
// setRevokeModal(true)
// setprojCorrectionApplyId(record.projCorrectionApplyId)
// }}> 撤销</div>
2024-09-13 16:45:01 +08:00
2024-10-30 15:29:55 +08:00
// ),
// },
// ]
// // 未通过 状态
// : applyStatus == 'REJECTED' ?
// [
// {
// title: '序号',
// dataIndex: 'index',
// align: 'center',
// width: 80,
// fixed: 'left',
// render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
// },
// {
// title: '系统名称',
// dataIndex: 'projName',
// align: 'center',
// key: 'projName',
// fixed: 'left',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '产权所属者',
// dataIndex: 'authorName',
// align: 'center',
// key: 'authorName',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
2024-08-27 18:29:20 +08:00
2024-10-30 15:29:55 +08:00
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// width: 130,
// align: 'center',
// render: (text) => <div >{text == 'CORRECTION1' ? '一次补正' : text == 'CORRECTION2' ? '二次补正' : ''}</div>,
// },
// {
// title: '补正种类',
// dataIndex: 'correctionType',
// key: 'correctionType',
// align: 'center',
// width: 130,
// render: (text) => <div >{text == 'CODE' ? '代码' : text == 'MANUAL' ? '操作手册' : text == 'ALL' ? '全部补正' : ''}</div>,
// },
// {
// title: '补正原因',
// dataIndex: 'correctionReason',
// key: 'correctionReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '申请补正时间',
// dataIndex: 'gmtCreate',
// key: 'gmtCreate',
// align: 'center',
// width: 200,
// },
// {
// title: '审核时间',
// dataIndex: 'gmtReview',
// key: 'gmtReview',
// align: 'center',
// width: 200,
// render: (text) => <div>
// {text ? text : '—'}
// </div>
// },
// {
// title: '审核状态',
// dataIndex: 'applyStatus',
// key: 'applyStatus',
// align: 'center',
// width: 100,
// render: (text) => <Tag
// color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
// >{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>,
// },
// {
// title: '审核意见',
// dataIndex: 'reviewReason',
// key: 'reviewReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text ? text : '—'}</div>,
// },
// {
// title: '补正凭证',
// dataIndex: 'correctionVoucherFileKVs',
// key: 'correctionVoucherFileKVs',
// width: 150,
// align: 'center',
// render: (_, record) => (
// (record.correctionVoucherFileKVs).map((item: any, index: number) => (
2024-09-13 16:45:01 +08:00
2024-10-30 15:29:55 +08:00
// <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
// className='ellipsis-text' title={item.value}
// key={index} onClick={() => {
// window.open(downloadUrl(item.key, false), '_blank')
// }}>{item.value}</div>
2024-09-03 17:51:42 +08:00
2024-10-30 15:29:55 +08:00
// ))
// ),
// },
// ]
// //已通过状态
// : applyStatus == 'APPROVED' ?
// [
// {
// title: '序号',
// dataIndex: 'index',
// align: 'center',
// fixed: 'left',
// width: 80,
// render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
// },
// {
// title: '系统名称',
// dataIndex: 'projName',
// align: 'center',
// key: 'projName',
// width: 150,
// fixed: 'left',
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '产权所属者',
// dataIndex: 'authorName',
// align: 'center',
// width: 150,
// key: 'authorName',
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// width: 130,
// align: 'center',
// render: (text) => <div >{text == 'CORRECTION1' ? '一次补正' : text == 'CORRECTION2' ? '二次补正' : ''}</div>,
// },
// {
// title: '补正种类',
// width: 130,
// dataIndex: 'correctionType',
// key: 'correctionType',
// align: 'center',
// render: (text) => <div >{text == 'CODE' ? '代码' : text == 'MANUAL' ? '操作手册' : text == 'ALL' ? '全部补正' : ''}</div>,
// },
// {
// title: '补正原因',
// width: 150,
// dataIndex: 'correctionReason',
// key: 'correctionReason',
// align: 'center',
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '申请补正时间',
// dataIndex: 'gmtCreate',
// key: 'gmtCreate',
// align: 'center',
// width: 200,
// },
// {
// title: '审核时间',
// dataIndex: 'gmtReview',
// key: 'gmtReview',
// align: 'center',
// width: 200,
// render: (text) => <div>
// {text ? text : '—'}
// </div>
// },
// {
// title: '审核状态',
// dataIndex: 'applyStatus',
// key: 'applyStatus',
// align: 'center',
// width: 100,
// render: (text) => <Tag
// color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
// >{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>,
// },
// {
// title: '审核意见',
// dataIndex: 'reviewReason',
// key: 'reviewReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text ? text : '—'}</div>,
// },
// {
// title: '补正凭证',
// dataIndex: 'correctionVoucherFileKVs',
// key: 'correctionVoucherFileKVs',
// width: 150,
// align: 'center',
// render: (_, record) => (
// (record.correctionVoucherFileKVs).map((item: any, index: number) => (
// <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
// className='ellipsis-text' title={item.value}
// key={index} onClick={() => {
// window.open(downloadUrl(item.key, false), '_blank')
// }}>{item.value}</div>
// ))
// ),
// },
// {
// title: '操作',
// align: 'center',
// width: 180,
// fixed: 'right',
// render: (_, record) => (
// // <div className='refunBtn' onClick={() => {
// // if (record.correctionType == 'CODE') {
// // window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${record.projId}`)
// // }
// // if (record.correctionType == 'MANUAL') {
// // window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${record.projId}`)
// // }
// // }}> 下载</div>
// <div style={{}}>
// <div className=''
// style={{ display: record.correctionType == 'CODE' || record.correctionType == 'ALL' ? 'block' : 'none' }}
// > 下载代码:
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${record.projId}`)
// }}
// >word</a>
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${record.projId}`)
// }}
// style={{ marginLeft: 5 }}
// >pdf</a>
// </div>
// <div className=''
// style={{
// display: record.correctionType == 'MANUAL' || record.correctionType == 'ALL' ? 'block' : 'none'
// }}
// onClick={() => {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${record.projId}`)
// }}> 下载手册:
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${record.projId}`)
// }}
// >word</a>
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${record.projId}`)
// }}
// style={{ marginLeft: 5 }}
// >pdf</a>
// </div>
// </div>
// ),
// }
// ] : [{
// title: '序号',
// dataIndex: 'index',
// align: 'center',
// width: 80,
// fixed: 'left',
// render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
// },
// {
// title: '系统名称',
// dataIndex: 'projName',
// align: 'center',
// key: 'projName',
// fixed: 'left',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '产权所属者',
// dataIndex: 'authorName',
// align: 'center',
// key: 'authorName',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '类型',
// dataIndex: 'type',
// width: 130,
// key: 'type',
// align: 'center',
// render: (text) => <div >{text == 'CORRECTION1' ? '一次补正' : text == 'CORRECTION2' ? '二次补正' : ''}</div>,
// },
// {
// title: '补正种类',
// dataIndex: 'correctionType',
// width: 130,
// key: 'correctionType',
// align: 'center',
// render: (text) => <div >{text == 'CODE' ? '代码' : text == 'MANUAL' ? '操作手册' : text == 'ALL' ? '全部补正' : ''}</div>,
// },
// {
// title: '补正原因',
// dataIndex: 'correctionReason',
// key: 'correctionReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
// },
// {
// title: '申请补正时间',
// dataIndex: 'gmtCreate',
// key: 'gmtCreate',
// align: 'center',
// width: 200,
// },
// {
// title: '审核时间',
// dataIndex: 'gmtReview',
// key: 'gmtReview',
// align: 'center',
// width: 200,
// render: (text) => <div>
// {text ? text : '—'}
// </div>
// },
// {
// title: '审核状态',
// dataIndex: 'applyStatus',
// key: 'applyStatus',
// align: 'center',
// width: 100,
// render: (text) => <Tag
// color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
// >{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>,
// },
// {
// title: '审核意见',
// dataIndex: 'reviewReason',
// key: 'reviewReason',
// align: 'center',
// width: 150,
// render: (text) => <div className='ellipsis-text' title={text}>{text ? text : '—'}</div>,
// },
// {
// title: '补正凭证',
// dataIndex: 'correctionVoucherFileKVs',
// key: 'correctionVoucherFileKVs',
// width: 150,
// align: 'center',
// render: (_, record) => (
// (record.correctionVoucherFileKVs).map((item: any, index: number) => (
// <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
// className='ellipsis-text' title={item.value}
// key={index} onClick={() => {
// window.open(downloadUrl(item.key, false), '_blank')
// }}>{item.value}</div>
// ))
// ),
// },
// {
// title: '操作',
// align: 'center',
// fixed: 'right',
// width: 180,
// render: (_, record) => (
// // {record.applyStatus}
// record.applyStatus == 'APPROVED' ? (
// <div style={{}}>
// <div className=''
// style={{ display: record.correctionType == 'CODE' || record.correctionType == 'ALL' ? 'block' : 'none' }}
// > 下载代码:
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${record.projId}`)
// }}
// >word</a>
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${record.projId}`)
// }}
// style={{ marginLeft: 5 }}
// >pdf</a>
// </div>
// <div className=''
// style={{
// display: record.correctionType == 'MANUAL' || record.correctionType == 'ALL' ? 'block' : 'none'
// }}
// onClick={() => {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${record.projId}`)
// }}> 下载手册:
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${record.projId}`)
// }}
// >word</a>
// <a href="/#"
// onClick={(e) => {
// e.preventDefault();
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${record.projId}`)
// }}
// style={{ marginLeft: 5 }}
// >pdf</a>
// </div>
// </div>
// ) : record.applyStatus == 'PENDING' ? (<div className='refunBtn' onClick={() => {
// // console.log(record);
// setRevokeModal(true)
// setprojCorrectionApplyId(record.projCorrectionApplyId)
// }}> 撤销</div>) : (<>—</>)
// ),
// }
// ]
2024-08-26 18:03:35 +08:00
const dispath = useDispatch()
const redxuState: any = useSelector(state => state)
const correctionArray = redxuState.correctionArray
2025-01-03 15:56:36 +08:00
// const [tagIdArray,setTagIdArray] = useState([])
2024-08-26 18:03:35 +08:00
const total = redxuState.correctionTotal
2024-09-11 16:45:19 +08:00
const newCorrection = redxuState.newCorrection
2024-08-26 18:03:35 +08:00
const [projCorrectionApplyId, setprojCorrectionApplyId] = useState('') //要撤销的id
2024-09-04 15:52:35 +08:00
// const correctionType = state?state.correctionType:''
2025-01-03 15:56:36 +08:00
// 补正标签数组
const [tagCorArray, setTagCorArray] = useState([])
// 获取补正标签
const getCorTag = () => {
get({
messageApi,
url: `/api/proj/correction/apply/tag/list-tag`,
onBefore() {
},
onSuccess(data: any) {
// console.log('标签信息', data);
const newarrty: any = (data.data).map((item: any) => ({
value: item.key,
label: item.value
}));
2025-01-03 16:16:10 +08:00
// console.log('标签信息', newarrty);
2025-01-03 15:56:36 +08:00
setTagCorArray(newarrty)
},
onFinally() {
}
})
}
2024-08-26 18:03:35 +08:00
const getData = (page: number) => {
2025-01-03 15:56:36 +08:00
const [part1, part2] = tagCor ? tagCor.split(':') : ['', ''];
2024-08-26 18:03:35 +08:00
get({
messageApi,
2024-09-06 17:26:09 +08:00
url: `/api/proj/correction/apply/listpage/self`,
2024-08-26 18:03:35 +08:00
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: page,
rows: 20,
2024-09-04 15:52:35 +08:00
projName: keyWords,
applyStatus: applyStatus,
type: correctionNumType,
correctionType: correctionType,
2025-01-03 15:56:36 +08:00
authorId: authorId,
tagDataId: part1,
tagNot: part2 == 'TAG_NOT' ? true : '',
2024-08-26 18:03:35 +08:00
}
},
onBefore() {
setIsLoading(true)
},
onSuccess(data: any) {
2024-08-27 11:35:08 +08:00
// console.log('呵呵', data.data.rows);
2024-08-26 18:03:35 +08:00
// setData(data.data.rows)
dispath({
type: 'upCorrectionArray',
val: data.data.rows
})
dispath({
type: 'upCorrectionTotal',
val: data.data.total
})
// setTotal(data.data.total)
},
onFinally() {
setIsLoading(false)
},
})
}
2025-01-03 15:56:36 +08:00
// 更新标签状态
// const upTag = (dataId: string, projCorrectionApplyId: string, projId: string) => {
// post<any>({
// messageApi,
// url: `/api/proj/correction/apply/tag/save-or-delete`,
// body: {
// dataId,
// projCorrectionApplyId,
// projId
// },
// onBefore() {
// },
// onSuccess(data) {
// console.log(data.data.data);
// // props.upData
// // props.updata()
// // setTagStatus(data.data.data)
// // 根据返回的状态更新 tagIdArray
// if (data.data.data === 'SAVE') {
// // setTagIdArray((prevArray: any) => [...prevArray, dataId]);
// } else if (data.data.data === 'DELETE') {
// // setTagIdArray((prevArray: any[]) => prevArray.filter(id => id !== dataId));
// }
// },
// onFinally() {
// }
// })
// }
2024-08-26 18:03:35 +08:00
// 撤销补正
const projRefund = () => {
put<any>({
messageApi,
url: `/api/proj/correction/apply/cancel/self/${projCorrectionApplyId}`,
onBefore() {
},
onSuccess() {
setRevokeModal(false)
messageApi.success('已撤销');
get({
messageApi,
2024-09-06 17:26:09 +08:00
url: `/api/proj/correction/apply/listpage/self`,
2024-08-26 18:03:35 +08:00
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: page,
rows: 20,
2024-09-04 15:52:35 +08:00
projName: keyWords,
applyStatus: applyStatus,
type: correctionNumType,
correctionType: correctionType,
authorId: authorId
2024-08-26 18:03:35 +08:00
}
},
onSuccess(data: any) {
// console.log(data.data.rows);
// setData(data.data.rows)
// setTotal(data.data.total)
if (data.data.rows.length == 0 && page > 1) {
getData(page - 1)
} else {
dispath({
type: 'upCorrectionArray',
val: data.data.rows
})
dispath({
type: 'upCorrectionTotal',
val: data.data.total
})
}
}
})
},
onFinally() {
// setIsProjIntroductionLoading(false)
// renderData()
}
})
}
2024-09-03 17:51:42 +08:00
2024-08-26 18:03:35 +08:00
useEffect(() => {
// getData(1)
2025-01-20 08:50:05 +08:00
2024-08-26 18:03:35 +08:00
getData(1)
2025-01-03 17:33:18 +08:00
setPage(1)
2025-01-03 15:56:36 +08:00
// console.log(tagCor);
2024-08-26 18:03:35 +08:00
// console.log('嘻嘻',correctionArray);
2025-01-03 15:56:36 +08:00
}, [keyWords, applyStatus, authorId, correctionNumType, correctionType, tagCor])
2024-10-30 15:29:55 +08:00
useEffect(() => {
// 获取id为refun的元素
const refun: any = document.getElementById('refun');
// 当更换页码时候滚动到最上面
refun.scrollTop = 0;
2024-10-30 15:37:00 +08:00
}, [correctionArray])
2024-09-11 16:45:19 +08:00
useEffect(() => {
// getData(1)
if (newCorrection) {
setPage(1)
getData(1)
dispath({
type: 'newCorrection',
val: false
})
}
}, [newCorrection])
2025-01-03 15:56:36 +08:00
useEffect(() => {
getCorTag()
// dispath({
// type: 'upCorrectionArray',
// val: updatedArray
// });
// getData(1)
}, [])
2024-08-26 18:03:35 +08:00
return (
<div>
{contextHolder}
2024-10-30 15:29:55 +08:00
<div className='refun' id='refun' style={{ height: `${height - 60}px`, overflow: 'auto' }}>
2024-08-26 18:03:35 +08:00
<Spin tip="加载中..." spinning={isLoading}>
2024-10-30 15:29:55 +08:00
{correctionArray.length == 0 ?
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', width: '100%', height: `${height - 60}px` }}>
<Empty description="暂无数据" />
</div>
: <>
2024-08-26 18:03:35 +08:00
2024-10-30 15:29:55 +08:00
{correctionArray.map((item: any, index: any) => {
2025-01-20 08:50:05 +08:00
// setBack(item.tagDataIds.includes(part1)?true:false)
2024-10-30 15:29:55 +08:00
const downCode = [
{
key: 'downword',
label: (
<div
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
onClick={() => {
2025-01-20 08:50:05 +08:00
// alert(item.correctionType);
// if (item.correctionType == 'ALL') {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/${item.projId}`)
// } else {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${item.projId}`)
// }
2024-10-30 15:29:55 +08:00
window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${item.projId}`)
}}
>
Word
</div>
),
},
{
key: 'downpdf',
label: (
<div
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
onClick={() => {
2025-01-20 08:50:05 +08:00
// if (item.correctionType == 'ALL') {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/pdf/${item.projId}`)
// } else {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${item.projId}`)
// }
2024-10-30 15:29:55 +08:00
window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${item.projId}`)
}}
>
PDF
</div>
),
},
]
const downManual = [
{
key: 'downword',
label: (
<div
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
onClick={() => {
2025-01-20 08:50:05 +08:00
// if (item.correctionType == 'ALL') {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/${item.projId}`)
// } else {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${item.projId}`)
// }
2024-10-30 15:29:55 +08:00
window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${item.projId}`)
2025-01-20 08:50:05 +08:00
2024-10-30 15:29:55 +08:00
}}
>
Word
</div>
),
},
{
key: 'downpdf',
label: (
<div
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
onClick={() => {
2025-01-20 08:50:05 +08:00
// if (item.correctionType == 'ALL') {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/pdf/${item.projId}`)
// } else {
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${item.projId}`)
// }
2024-10-30 15:29:55 +08:00
window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${item.projId}`)
}}
>
PDF
</div>
),
},
]
const voucherItems = item.correctionVoucherFileKVs.map((item: any) => ({
key: item.key,
label: (
<div
onClick={() => {
window.open(downloadUrl(item.key, false), '_blank')
}}
style={{ maxWidth: 200, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
title={item.value}
>
{item.value}
</div>
),
}));
return (
<div className='projBox' key={item.projCorrectionApplyId}>
2024-10-30 15:29:55 +08:00
{/* <div className='numImg'>
<div style={{ marginTop: 15 }}>{(page - 1) * 20 + index + 1}</div>
</div> */}
2025-05-07 14:25:17 +08:00
<div className='timeImg' style={{
backgroundImage: `url(${timeImg})`
}}>
2024-10-30 15:29:55 +08:00
<div> : {item.gmtCreate}</div>
</div>
<div className='projBoxTop'>
2025-05-07 14:25:17 +08:00
<div className='projName'
style={{
backgroundImage: `url(${titleBg})`
}}
onClick={() => {
nav(`/proj-edit/${item.projId}`);
sessionStorage.setItem('projName', item.projName);
sessionStorage.setItem('projStatus', item.generate.generateStatus == 'SUCCESS' ? '查看' : '编辑');
}} title={item.projName}>
2024-10-30 15:29:55 +08:00
{item.projName}
</div>
<div className='correctionType'>
<div className='corrTypeA'>
{item.type == 'CORRECTION1' ? '一次补正' : item.type == 'CORRECTION2' ? '二次补正' : ''}
</div>
<div className='corrTypeB'>
{item.correctionType == 'CODE' ? '代码' : item.correctionType == 'MANUAL' ? '操作手册' : item.correctionType == 'ALL' ? '全部补正' : ''}
</div>
</div>
2025-01-03 15:56:36 +08:00
<div style={{
display: 'flex',
}}>
{
tagCorArray.map((tagitem: any) => {
2025-01-20 08:50:05 +08:00
2025-01-03 15:56:36 +08:00
const [part1, part2] = tagitem.value.split(':');
2025-01-03 17:00:42 +08:00
// setTagDataIds(tagitem.tagDataIds)
2025-01-03 15:56:36 +08:00
if (part2 !== 'TAG_NOT') {
return (
<div key={tagitem.value} className='corrTypeC'
style={{
2025-05-07 14:25:17 +08:00
background: item.tagDataIds.includes(part1) ? 'var(--color-tagactive)' : '',
2025-01-03 15:56:36 +08:00
color: item.tagDataIds.includes(part1) ? '#ffffff' : '#5a5a5a',
2025-05-07 14:25:17 +08:00
border: item.tagDataIds.includes(part1) ? ' 1px solid var(--color-tagactive)' : ' 1px solid #5a5a5a',
2025-01-03 17:00:42 +08:00
// background: back?'#ff7b00':'',
2025-01-20 08:50:05 +08:00
2025-01-03 15:56:36 +08:00
}}
onClick={
2025-01-20 08:50:05 +08:00
(e: any) => {
2025-01-03 17:00:42 +08:00
// 获取点击的这个盒子的背景色
2025-01-20 08:50:05 +08:00
2025-01-03 15:56:36 +08:00
post<any>({
messageApi,
url: `/api/proj/correction/apply/tag/save-or-delete`,
body: {
dataId: part1,
projCorrectionApplyId: item.projCorrectionApplyId,
projId: item.projId
},
onBefore() {
},
onSuccess(data) {
2025-01-03 17:00:42 +08:00
2025-01-03 15:56:36 +08:00
if (data.data.data === 'SAVE') {
2025-01-20 08:50:05 +08:00
2025-05-07 14:25:17 +08:00
e.target.style.background = 'var(--color-tagactive)';
2025-01-03 17:00:42 +08:00
e.target.style.color = '#ffffff';
2025-05-07 14:25:17 +08:00
e.target.style.border = '1px solid var(--color-tagactive)';
2025-01-20 08:50:05 +08:00
2025-01-03 17:00:42 +08:00
2025-01-03 15:56:36 +08:00
} else if (data.data.data === 'DELETE') {
2025-01-20 08:50:05 +08:00
2025-01-03 17:00:42 +08:00
e.target.style.background = '';
e.target.style.color = '#5a5a5a';
e.target.style.border = '1px solid #5a5a5a';
2025-01-20 08:50:05 +08:00
2025-01-03 15:56:36 +08:00
}
},
onFinally() {
}
})
}
}
>
{tagitem.label}
</div>
)
}
})
}
</div>
2024-10-30 15:29:55 +08:00
</div>
<div className='projBoxBot'>
<div className='boxTopL'>
2025-05-07 14:25:17 +08:00
<div className='numImg' style={{
backgroundImage: `url(${numbg})`
}}
2025-01-03 15:56:36 +08:00
// style={{ fontSize: (page - 1) * 20 + index + 1 > 100 ? '12px' : '18px' }}
2024-10-30 15:37:00 +08:00
>
2024-10-30 15:29:55 +08:00
{(page - 1) * 20 + index + 1}
</div>
<div className='projlogo'>
<img src={logoImg} className='projlogo' alt="" />
</div>
<div className='projInfo'>
<div className='projPeople' title={item.authorName}>
2025-05-07 14:25:17 +08:00
: {item.authorName ? item.authorName : '无'}
2024-10-30 15:29:55 +08:00
</div>
<div className='projImg'>
<div> </div>
<Dropdown menu={{
items: voucherItems,
}} placement="bottomLeft" arrow>
<div className='lookImg'
>()
</div>
</Dropdown>
</div>
</div>
</div>
<div className='projReason'>
<div className='projReasonTop'>
<img src={reason} className='reasonImg' alt="" />
<div className='yellowTitle'></div>
</div>
2024-10-30 15:37:00 +08:00
<div className='projBoxText' title={item.correctionReason}>
2024-10-30 15:29:55 +08:00
{item.correctionReason}
</div>
</div>
<div className='projStatus'>
{/* <div>{item.isSubmitAudit}</div> */}
2024-10-30 15:29:55 +08:00
<div className='projStatusTop'>
<img className='projStatusImg' src={item.applyStatus == 'PENDING' ? blue : item.applyStatus == 'CANCELED' ? black : item.applyStatus == 'APPROVED' ? green : item.applyStatus == 'REJECTED' ? red : ''} alt="" />
{/* <div>{item.applyStatus}</div> */}
<div
style={{ color: item.applyStatus == 'PENDING' ? '#1890FF' : item.applyStatus == 'CANCELED' ? '#979797' : item.applyStatus == 'APPROVED' ? '#52C41A' : item.applyStatus == 'REJECTED' ? '#FF0000' : '#FF0000' }}
>{item.applyStatus == 'PENDING' ? '待审核' : item.applyStatus == 'CANCELED' ? '已撤销' : item.applyStatus == 'APPROVED' ? '已通过' : item.applyStatus == 'REJECTED' ? '未通过' : '未知状态'}</div>
<div style={{ display: item.gmtReview ? 'block' : 'none', fontWeight: 400, marginLeft: 5 }}>{item.gmtReview}</div>
</div>
<div className='projBoxText statusprojBoxText' style={{ display: item.reviewReason ? 'block' : 'none' }} title={item.reviewReason}>
: {item.reviewReason}
</div>
</div>
<div className='zwBox'>
</div>
<div className='projBtn'
style={{ background: 'white' }}
>
<div className='setProj' onClick={() => {
setRevokeModal(true)
setprojCorrectionApplyId(item.projCorrectionApplyId)
}}
style={{ display: item.applyStatus == 'PENDING' ? 'block' : 'none' }}
></div>
<div style={{ display: item.applyStatus == 'APPROVED' ? 'block' : 'none' }}>
<div className='correctDownBox'>
<div className='correctDownBtn' style={{ display: item.correctionType == 'CODE' || item.correctionType == 'ALL' ? 'block' : 'none' }}>
<Dropdown menu={{
items: downCode,
}} placement="bottomRight" arrow>
<span style={{ cursor: 'pointer' }}></span>
</Dropdown>
</div>
<div className='correctDownBtn' style={{ display: item.correctionType == 'MANUAL' || item.correctionType == 'ALL' ? 'block' : 'none' }}>
<Dropdown menu={{
items: downManual,
}} placement="bottomRight" arrow>
<span style={{ cursor: 'pointer' }}></span>
</Dropdown>
</div>
</div>
</div>
</div>
</div>
</div>
)
})}
</>}
2024-08-26 18:03:35 +08:00
</Spin>
2024-10-30 15:29:55 +08:00
</div>
<div className='pagination'>
2025-01-03 17:33:18 +08:00
<Pagination current={page} total={total} pageSize={20} showSizeChanger={false} onChange={(page) => {
2024-10-30 15:29:55 +08:00
setPage(page)
getData(page)
2024-10-30 15:37:00 +08:00
2024-10-30 15:29:55 +08:00
}} />
</div>
2024-08-26 18:03:35 +08:00
<Modal
title="确认撤销"
okText="撤销"
cancelText="取消"
destroyOnClose={true}
open={revokeModal}
onOk={() => {
setRevokeModal(false)
projRefund()
}}
onCancel={() => {
setRevokeModal(false)
}}
okButtonProps={{ style: { background: 'red', color: 'white' } }}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: `${height}px`,
}}>
<div style={{ width: 384, display: 'flex', height: 50, alignItems: 'center' }}>
<img src={revokeImg} alt="" style={{ width: 32, height: 32, marginLeft: 10 }} />
<div style={{ marginLeft: 10, fontSize: 18 }}>
</div>
</div>
</Modal>
</div>
)
}