This commit is contained in:
xixi 2024-08-26 18:03:35 +08:00
parent 897ed5c58d
commit 242edb91e7
9 changed files with 927 additions and 81 deletions

View File

@ -0,0 +1,304 @@
import React from 'react'
import { useEffect, useState } from 'react'
// import './RefunModal.css'
import { Form, Select, Button, Upload, message, Input } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { uploadImageUrl, DevUserId, get, post } from "../../util/AjaxUtils.ts";
import { getMenuActive } from '../../util/cache.ts'
import { useDispatch } from 'react-redux'
const { TextArea } = Input;
export default function CorrectionModal(props: any) {
const [messageApi, contextHolder] = message.useMessage();
// 上传附件
const [correctionArray, setCorrectionArray] = useState<string[]>([]);
// const [selectedReason, setSelectedReason] = useState(''); //选择原因
// const handleReasonChange = (value: any) => {
// setSelectedReason(value);
// };
// 获取当前选择类型
const type = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
const dispath = useDispatch()
const [correctionDataArray, setCorrectionDataArray] = useState<any[]>([]) //未退款项目
const [isDisabled,setIsDisabled] = useState(false) //提交按钮是否禁用
// 提交表单
const onFinish = (values: any) => {
// console.log('Form values:', values);
// console.log(refunArray);
post<any>({
messageApi,
url: `/api/proj/correction/apply/save`,
body: {
projId: values.title,
correctionReason: values.other,
correctionVoucher: correctionArray.join(','),
correctionType:values.correctionType
},
onBefore() {
setIsDisabled(true)
},
onSuccess() {
messageApi.success('提交成功')
setIsDisabled(true)
setTimeout(() => {
props.closeModal()
}, 500)
if (type === 'PENDING') {
getData()
}
},
onFinally() {
setIsDisabled(false)
}
})
};
const getData = () => {
get({
messageApi,
url: `/api/proj/correction/apply/listpage`,
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: 1,
rows: 20,
applyStatus: type
}
},
onSuccess(data: any) {
// console.log('更新');
dispath({
type: 'upCorrectionArray',
val: data.data.rows
})
dispath({
type: 'upCorrectionTotal',
val: data.data.total
})
}
})
}
// 获取未补正项目
const getCorrectionData = () => {
get({
messageApi,
url: `/api/proj/correction/apply/list-proj-unapply/self`,
// config: {
// params: {
// }
// },
onBefore() {
},
onSuccess(data: any) {
// console.log(data);
const newArray = (data.data).map((item: { projId: any; projName: any; }) => ({
value: item.projId,
label: item.projName
}))
setCorrectionDataArray(newArray)
},
onFinally() {
},
})
}
useEffect(() => {
getCorrectionData()
// console.log(type);
}, [])
return (
<div className='refunModal'>
{contextHolder}
<Form
name="Form"
onFinish={onFinish}
initialValues={{ softWare: '' }}
style={{ maxWidth: 600 }}
>
<div className='refunModal-item'>
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="title"
// label="退款软著"
rules={[{ required: true, message: '请选择一个软著!' }]}
>
<Select
showSearch
placeholder="选择需要退款的软著"
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
options={correctionDataArray}
style={{
width: 405,
height: 46,
}}
/>
</Form.Item>
</div>
<div className='refunModal-item'>
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="correctionType"
// label="退款软著"
rules={[{ required: true, message: '请选择类型' }]}
>
<Select
placeholder="选择类型"
options={[
{ value: 'MANUAL', label: '操作手册' },
{ value: 'CODE', label: '代码' },
]}
style={{
width: 405,
height: 46,
}}
/>
</Form.Item>
</div>
{/* <div className='refunModal-item'>
<div className='refunModal-title'>
退<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="reason"
// label="退款软著"
rules={[{ required: true, message: '请选择退款原因' }]}
>
<Select
placeholder="选择退款原因"
options={[
{ value: '没钱', label: '没钱' },
{ value: '不想买', label: '不想买' },
{ value: '其他', label: '其他' },
]}
style={{
width: 405,
height: 46,
}}
onChange={handleReasonChange}
/>
</Form.Item>
</div> */}
{/* {selectedReason === '' && (
<div className='refunModal-item'>
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="other"
rules={[{ required: true, message: '请输入退款原因' }]}
>
<TextArea
placeholder="其他退款原因"
style={{ height: 120, resize: 'none', width: 405 }}
/>
</Form.Item>
</div>
)} */}
<div className='refunModal-item'>
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="other"
rules={[{ required: true, message: '请输入退款原因' }]}
>
<TextArea
placeholder="输入退款原因"
style={{ height: 120, resize: 'none', width: 405 }}
/>
</Form.Item>
</div>
{/* <div className='refunModal-item' >
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<Form.Item
name="other"
// label="退款软著"
rules={[{ required: true, message: '请输入退款原因' }]}
>
<TextArea
// showCount
// maxLength={100}
placeholder="其他退款原因"
style={{ height: 120, resize: 'none', width: 405, }}
/>
</Form.Item>
</div> */}
<div className='refunModal-item'>
<div className='refunModal-title'>
<span className='refunModal-red'>*</span>
</div>
<div style={{ width: 405, }}>
<Form.Item
name="img"
// label="退款软著"
valuePropName="fileList"
getValueFromEvent={(e: any) => {
if (e.file.status === 'done') {
correctionArray.push(e.file.response.data.fileId);
setCorrectionArray(correctionArray);
}
if (e.file.status === 'removed') {
const idArray = correctionArray.filter(item => item != e.file.response.data.fileId);
setCorrectionArray(idArray);
}
return e.fileList;
}}
rules={[{ required: true, message: '请上传凭证' }]}
>
<Upload
name="image"
action={uploadImageUrl()}
headers={{ 'X-USER-ID': DevUserId }}
beforeUpload={(file) => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('只能上传 JPG/PNG 格式文件!');
return Upload.LIST_IGNORE; // 不允许上传非
}
return isJpgOrPng;
}}
// listType="picture-card"
>
<Button icon={<UploadOutlined />} style={{ marginTop: 2 }}></Button>
</Upload>
</Form.Item>
</div>
</div>
<Form.Item>
<div className='refunModal-btn'>
<Button type="primary" htmlType="submit" style={{
width: 273,
height: 52
}}
disabled={isDisabled}
>
</Button>
</div>
</Form.Item>
</Form>
</div>
)
}

View File

@ -20,6 +20,7 @@ export default function RefunModal(props: any) {
const type = getMenuActive() const type = getMenuActive()
const dispath = useDispatch() const dispath = useDispatch()
const [refunDataArray, setRefunDataArray] = useState<any[]>([]) //未退款项目 const [refunDataArray, setRefunDataArray] = useState<any[]>([]) //未退款项目
const [isDisabled,setIsDisabled] = useState(false) //提交按钮是否禁用
// 提交表单 // 提交表单
const onFinish = (values: any) => { const onFinish = (values: any) => {
// console.log('Form values:', values); // console.log('Form values:', values);
@ -36,14 +37,14 @@ export default function RefunModal(props: any) {
refundVoucher: refunArray.join(',') refundVoucher: refunArray.join(',')
}, },
onBefore() { onBefore() {
setIsDisabled(true)
}, },
onSuccess() { onSuccess() {
messageApi.success('提交成功') messageApi.success('提交成功')
setIsDisabled(true)
setTimeout(() => { setTimeout(() => {
props.closeModal() props.closeModal()
}, 1000) }, 500)
if ( type === 'PENDING') { if ( type === 'PENDING') {
getData() getData()
@ -51,7 +52,7 @@ export default function RefunModal(props: any) {
}, },
onFinally() { onFinally() {
setIsDisabled(false)
} }
}) })
}; };
@ -266,7 +267,9 @@ export default function RefunModal(props: any) {
<Button type="primary" htmlType="submit" style={{ <Button type="primary" htmlType="submit" style={{
width: 273, width: 273,
height: 52 height: 52
}}> }}
disabled={isDisabled}
>
</Button> </Button>
</div> </div>

View File

@ -3,6 +3,7 @@ import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWi
import objImg from '../../static/left/obj.png' import objImg from '../../static/left/obj.png'
import newImg from '../../static/left/new.png' import newImg from '../../static/left/new.png'
import refunimg from '../../static/refun.png' import refunimg from '../../static/refun.png'
import correctionImg from '../../static/correction.png'
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { import {
RightOutlined RightOutlined
@ -47,8 +48,16 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
if (props.button.name == '退款') { if (props.button.name == '退款') {
// props.disableBelongpeople() // props.disableBelongpeople()
navugate('/refun', { navugate('/refun', {
state:{ state: {
type:item.id type: item.id
}
})
}
if (props.button.name == '补正') {
// props.disableBelongpeople()
navugate('/correction', {
state: {
type: item.id == 'Correction-PENDING' ? 'PENDING' : item.id == 'Correction-APPROVED' ? 'APPROVED' : item.id == 'Correction-REJECTED' ? 'REJECTED' : item.id == 'Correction-CANCELED' ? 'CANCELED' : ''
} }
}) })
} }
@ -66,8 +75,9 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
{/* button 是三个黄色按钮 */} {/* button 是三个黄色按钮 */}
<div className='top'> <div className='top'>
<div className='top-lift'> <div className='top-lift'>
<img src={objImg} alt="" style={{display:props.button.name=='项目'?'block':'none'}}/> <img src={objImg} alt="" style={{ display: props.button.name == '项目' ? 'block' : 'none' }} />
<img src={refunimg} alt="" style={{display:props.button.name=='退款'?'block':'none',width:16}}/> <img src={refunimg} alt="" style={{ display: props.button.name == '退款' ? 'block' : 'none', width: 16 }} />
<img src={correctionImg} alt="" style={{ display: props.button.name == '补正' ? 'block' : 'none', width: 16 }} />
<div> {props.button.name}</div> <div> {props.button.name}</div>
</div> </div>
@ -77,11 +87,33 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
// props.list.forEach(item => item.active = false); // props.list.forEach(item => item.active = false);
// console.log(props.list); // console.log(props.list);
// setMenuActive('ALL') // setMenuActive('ALL')
if (props.button.name == '项目') {
// setMenuActive('ALL')
}
if (props.button.name == '退款' ){
setMenuActive('PENDING')
navugate('/refun', {
state: {
type: 'PENDING'
}
})
}
if (props.button.name == '补正' ){
setMenuActive('Correction-PENDING')
navugate('/correction', {
state: {
type: 'PENDING'
}
})
}
}}> }}>
{/* refunimg */} {/* refunimg */}
<img src={newImg} alt="" /> <img src={newImg} alt="" />
<div style={{display:props.button.name == '项目'?'block':'none'}}></div> <div style={{ display: props.button.name == '项目' ? 'block' : 'none' }}></div>
<div style={{display:props.button.name == '退款'?'block':'none'}}></div> <div style={{ display: props.button.name == '退款' ? 'block' : 'none' }}></div>
<div style={{ display: props.button.name == '补正' ? 'block' : 'none' }}></div>
</div> </div>
</div> </div>
{/* <button className="btn btn-orange top-button" {/* <button className="btn btn-orange top-button"

View File

@ -0,0 +1,474 @@
import React from 'react'
import { useState, useEffect, } from 'react';
import {
Table,
// Pagination,
Modal, Tag, message, Spin
} from 'antd';
import { useSelector, useDispatch } from 'react-redux'
import {
get,
put, downloadUrl
} from '../../util/AjaxUtils'
import type { TableProps } from 'antd';
import { getMenuActive } from '../../util/cache'
import { useNavigate } from "react-router-dom";
interface DataType {
projName: string;
type: string; //类型
correctionType: string; //补正类型
correctionReason: string;
gmtCreate: string; //补正时间
gmtReview: string;//审核时间
reviewReason: string;//审核意见
projId: string;
applyStatus: string;//审核状态
correctionVoucherFileKVs: any //补正凭证
projCorrectionApplyId: string
}
import revokeImg from '../../static/revoke.png'
import { useLocation } from 'react-router-dom'
export default function Correction() {
const height = window.innerHeight - 180;
const [messageApi, contextHolder] = message.useMessage();
const nav = useNavigate();
const { state } = useLocation()
const MenuActive = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
const type = state ? state.type : MenuActive
const [isLoading, setIsLoading] = useState(false)
const [page, setPage] = useState(1) // 分页
const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗
const columns: TableProps<DataType>['columns'] =
// 撤销状态
type == 'CANCELED' ? [
{
title: '序号',
dataIndex: 'index',
align: 'center',
width: 80,
render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
},
{
title: '系统名称',
dataIndex: 'projName',
align: 'center',
key: 'projName',
render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
render: (text) => <div >{text=='CORRECTION1'?'一次补正':text=='CORRECTION2'?'二次补正':''}</div>,
},
{
title: '补正类型',
dataIndex: 'correctionType',
key: 'correctionType',
align: 'center',
render: (text) => <div >{text=='CODE'?'代码':text=='MANUAL'?'操作手册':''}</div>,
},
{
title: '补正原因',
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: '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: 100,
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>
))
),
},
]
: type == 'PENDING' ?
// PENDING待审核状态
[
{
title: '序号',
dataIndex: 'index',
align: 'center',
width: 80,
render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号从1开始
},
{
title: '系统名称',
dataIndex: 'projName',
align: 'center',
key: 'projName',
render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
render: (text) => <div >{text=='CORRECTION1'?'一次补正':text=='CORRECTION2'?'二次补正':''}</div>,
},
{
title: '补正类型',
dataIndex: 'correctionType',
key: 'correctionType',
align: 'center',
render: (text) => <div >{text=='CODE'?'代码':text=='MANUAL'?'操作手册':''}</div>,
},
{
title: '补正原因',
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: '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: 100,
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: 100,
render: (_, record) => (
// {record.name}
<div className='refunBtn' onClick={() => {
// console.log(record.projRefundApplyId);
setRevokeModal(true)
setprojCorrectionApplyId(record.projCorrectionApplyId)
}}> </div>
),
},
] :
// 已通过 和未通过 状态
[
{
title: '序号',
dataIndex: 'index',
align: 'center',
width: 80,
render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号从1开始
},
{
title: '系统名称',
dataIndex: 'projName',
align: 'center',
key: 'projName',
render: (text) => <div className='ellipsis-text' title={text}>{text}</div>,
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
render: (text) => <div >{text=='CORRECTION1'?'一次补正':text=='CORRECTION2'?'二次补正':''}</div>,
},
{
title: '补正类型',
dataIndex: 'correctionType',
key: 'correctionType',
align: 'center',
render: (text) => <div >{text=='CODE'?'代码':text=='MANUAL'?'操作手册':''}</div>,
},
{
title: '补正原因',
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,
},
{
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: 100,
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>
))
),
},
];
const dispath = useDispatch()
const redxuState: any = useSelector(state => state)
const correctionArray = redxuState.correctionArray
const total = redxuState.correctionTotal
const [projCorrectionApplyId, setprojCorrectionApplyId] = useState('') //要撤销的id
const getData = (page: number) => {
get({
messageApi,
url: `/api/proj/correction/apply/listpage`,
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: page,
rows: 20,
applyStatus: type
}
},
onBefore() {
setIsLoading(true)
},
onSuccess(data: any) {
console.log('呵呵', data.data.rows);
// 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)
},
})
}
// 撤销补正
const projRefund = () => {
put<any>({
messageApi,
url: `/api/proj/correction/apply/cancel/self/${projCorrectionApplyId}`,
onBefore() {
},
onSuccess() {
setRevokeModal(false)
messageApi.success('已撤销');
get({
messageApi,
url: `/api/proj/correction/apply/listpage`,
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: page,
rows: 20,
applyStatus: type
}
},
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()
}
})
}
useEffect(() => {
if (!state) {
nav('/home')
}
}, [state])
useEffect(() => {
// getData(1)
setPage(1)
getData(1)
console.log(type);
// console.log('嘻嘻',correctionArray);
}, [type])
return (
<div>
{contextHolder}
<div className='refun' style={{ height: `${height}px`, overflow: 'auto' }}>
{/* {state.type} */}
<Spin tip="加载中..." spinning={isLoading}>
<Table columns={columns}
dataSource={correctionArray}
style={{
// height: height - 80,
// height: 620,
// background: 'skyblue'
}}
// pagination={false} // 不显示分页
pagination={
{
pageSize: 20,
total: total,
onChange: (currentPage) => {
setPage(currentPage);
getData(currentPage)
},
showSizeChanger: false,
current: page
}
}
scroll={{ y: height - 150 }}
rowKey="projId"
/>
</Spin>
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 15, width: '100%' }}>
{/* <Pagination defaultCurrent={page} total={total} pageSize={10} showSizeChanger={false} onChange={(page) => {
setPage(page)
getData(page)
}} /> */}
</div>
</div>
<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>
)
}

View File

@ -77,13 +77,7 @@ export default function Refun() {
align: 'center', align: 'center',
width: 200, width: 200,
}, },
// {
// title: '审核时间',
// dataIndex: 'gmtReview',
// key: 'gmtReview',
// align: 'center',
// width: 200,
// },
{ {
title: '审核状态', title: '审核状态',
dataIndex: 'applyStatus', dataIndex: 'applyStatus',
@ -94,14 +88,7 @@ export default function Refun() {
color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''} color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
>{text == "APPROVED" ? '已通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>, >{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}</div>,
// },
{ {
title: '退款凭证', title: '退款凭证',
dataIndex: 'refundVoucherFileKVs', dataIndex: 'refundVoucherFileKVs',
@ -109,15 +96,13 @@ export default function Refun() {
// width: 100, // width: 100,
align: 'center', align: 'center',
render: (_, record) => ( render: (_, record) => (
// {record.name}
// <div className='refunBtn' onClick={() => {
// // console.log(record.img);
// }}> 预览</div>
(record.refundVoucherFileKVs).map((item: any, index: number) => ( (record.refundVoucherFileKVs).map((item: any, index: number) => (
<div style={{ cursor: 'pointer', color: 'var(--color-blue)' }} key={index} onClick={() => { <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
window.open(downloadUrl(item.key, false), '_blank') className='ellipsis-text' title={item.value}
}}>{item.value}</div> key={index} onClick={() => {
window.open(downloadUrl(item.key, false), '_blank')
}}>{item.value}</div>
)) ))
@ -165,13 +150,6 @@ export default function Refun() {
align: 'center', align: 'center',
width: 200, width: 200,
}, },
// {
// title: '审核时间',
// dataIndex: 'gmtReview',
// key: 'gmtReview',
// align: 'center',
// width: 200,
// },
{ {
title: '审核状态', title: '审核状态',
dataIndex: 'applyStatus', dataIndex: 'applyStatus',
@ -182,14 +160,6 @@ export default function Refun() {
color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''} color={text == "APPROVED" ? '#87d068' : text == "REJECTED" ? '#f50' : text == "PENDING" ? '#2db7f5' : text == "CANCELED" ? '#108ee9' : ''}
>{text == "APPROVED" ? '通过' : text == "REJECTED" ? '未通过' : text == "PENDING" ? '待审核' : text == "CANCELED" ? '已取消' : '未知'}</Tag>, >{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}</div>,
// },
{ {
title: '退款凭证', title: '退款凭证',
dataIndex: 'refundVoucherFileKVs', dataIndex: 'refundVoucherFileKVs',
@ -203,9 +173,11 @@ export default function Refun() {
// }}> 预览</div> // }}> 预览</div>
(record.refundVoucherFileKVs).map((item: any, index: number) => ( (record.refundVoucherFileKVs).map((item: any, index: number) => (
<div style={{ cursor: 'pointer', color: 'var(--color-blue)' }} key={index} onClick={() => { <div style={{ cursor: 'pointer', color: 'var(--color-blue)' }}
window.open(downloadUrl(item.key, false), '_blank') className='ellipsis-text' title={item.value}
}}>{item.value}</div> key={index} onClick={() => {
window.open(downloadUrl(item.key, false), '_blank')
}}>{item.value}</div>
)) ))
@ -289,7 +261,7 @@ export default function Refun() {
key: 'reviewReason', key: 'reviewReason',
align: 'center', align: 'center',
// width: 150, // width: 150,
render: (text) => <div className='ellipsis-text' title={text}>{text?text:'—'}</div>, render: (text) => <div className='ellipsis-text' title={text}>{text ? text : '—'}</div>,
}, },
{ {
title: '退款凭证', title: '退款凭证',
@ -298,13 +270,10 @@ export default function Refun() {
// width: 100, // width: 100,
align: 'center', align: 'center',
render: (_, record) => ( render: (_, record) => (
// {record.name}
// <div className='refunBtn' onClick={() => {
// // console.log(record.img);
// }}> 预览</div>
(record.refundVoucherFileKVs).map((item: any, index: number) => ( (record.refundVoucherFileKVs).map((item: any, index: number) => (
<div style={{ cursor: 'pointer', color: 'var(--color-blue)' }} key={index} onClick={() => { <div className='ellipsis-text' title={item.value} style={{ cursor: 'pointer', color: 'var(--color-blue)' }} key={index} onClick={() => {
window.open(downloadUrl(item.key, false), '_blank') window.open(downloadUrl(item.key, false), '_blank')
}}>{item.value}</div> }}>{item.value}</div>
@ -312,20 +281,6 @@ export default function Refun() {
), ),
}, },
// {
// title: '操作',
// align: 'center',
// width: 100,
// render: (_, record) => (
// // {record.name}
// <div className='refunBtn' onClick={() => {
// console.log(record.projRefundApplyId);
// setRevokeModal(true)
// setprojRefundApplyId(record.projRefundApplyId)
// }}> 撤销</div>
// ),
// },
]; ];
const dispath = useDispatch() const dispath = useDispatch()
const redxuState: any = useSelector(state => state) const redxuState: any = useSelector(state => state)
@ -392,7 +347,7 @@ export default function Refun() {
// setData(data.data.rows) // setData(data.data.rows)
// setTotal(data.data.total) // setTotal(data.data.total)
if (data.data.rows.length == 0 && page > 1 ) { if (data.data.rows.length == 0 && page > 1) {
getData(page - 1) getData(page - 1)
} else { } else {
dispath({ dispath({

View File

@ -7,6 +7,7 @@ import { Modal } from 'antd';
import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWithTopButton.ts"; import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWithTopButton.ts";
import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx"; import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx";
import RefunModal from '../../components/RefunModal/RefunModal.tsx' import RefunModal from '../../components/RefunModal/RefunModal.tsx'
import CorrectionModal from '../../components/CorrectionModal/CorrectionModal.tsx'
// import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' // import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx'
// import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; // import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx";
// import ListProj from "../../components/list/ListProj.tsx"; // import ListProj from "../../components/list/ListProj.tsx";
@ -45,7 +46,7 @@ const { Search } = Input;
export default function Index() { export default function Index() {
// 是否可以点击所属者 (当点击了退款选项,所属者列表跟他不产生联系 不给他点) // 是否可以点击所属者 (当点击了退款选项,所属者列表跟他不产生联系 不给他点)
const [clickBelongpeople,setClickBelongpeople] = useState(true) const [clickBelongpeople, setClickBelongpeople] = useState(true)
// 选项数组 // 选项数组
const [tagArray, setTagArray] = useState([]) const [tagArray, setTagArray] = useState([])
// 获取标签 // 获取标签
@ -208,6 +209,8 @@ export default function Index() {
sellMenu.list.forEach(item => item.active = false); sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false); buyMenu.list.forEach(item => item.active = false);
refundMenu.list.forEach(item => item.active = false); refundMenu.list.forEach(item => item.active = false);
correctionMenu.list.forEach(item => item.active = false);
item.active = true; item.active = true;
setProjMenu({ setProjMenu({
...projMenu ...projMenu
@ -241,6 +244,7 @@ export default function Index() {
sellMenu.list.forEach(item => item.active = false); sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false); buyMenu.list.forEach(item => item.active = false);
refundMenu.list.forEach(item => item.active = false); refundMenu.list.forEach(item => item.active = false);
correctionMenu.list.forEach(item => item.active = false);
item.active = true; item.active = true;
setRefundMenu({ setRefundMenu({
@ -255,6 +259,41 @@ export default function Index() {
}, },
}); });
// 补正弹窗
const [correctionModal, setCorrectionModal] = useState(false)
const [correctionMenu, setCorrectionMenu] = useState<IMenuWithTopButton>({
button: {
name: '补正',
handle() {
// nav('/proj-create')
setCorrectionModal(true)
}
},
list: [
{ id: 'Correction-PENDING', name: '待审核', },
{ id: 'Correction-APPROVED', name: '已通过' },
{ id: 'Correction-REJECTED', name: '未通过' },
{ id: 'Correction-CANCELED', name: '已取消' }
],
handleListItem(_e, _index, item: IMenuListItem) {
projMenu.list.forEach(item => item.active = false);
sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false);
refundMenu.list.forEach(item => item.active = false);
correctionMenu.list.forEach(item => item.active = false);
item.active = true;
setCorrectionMenu({
...correctionMenu
})
dispatch({
type: IndexListDataType.PROJ,
value: item.id,
// keywords: ''
})
},
})
// const [agentMenu, setAgentMenu] = useState<IMenuWithTopButton>({ // const [agentMenu, setAgentMenu] = useState<IMenuWithTopButton>({
// button: { // button: {
// name: '代理服务', // name: '代理服务',
@ -303,7 +342,8 @@ export default function Index() {
projMenu.list.forEach(item => item.active = false); projMenu.list.forEach(item => item.active = false);
sellMenu.list.forEach(item => item.active = false); sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false); buyMenu.list.forEach(item => item.active = false);
refundMenu.list.forEach(item => item.active = false);
correctionMenu.list.forEach(item => item.active = false);
item.active = true; item.active = true;
setSellMenu({ setSellMenu({
...sellMenu ...sellMenu
@ -334,6 +374,8 @@ export default function Index() {
projMenu.list.forEach(item => item.active = false); projMenu.list.forEach(item => item.active = false);
sellMenu.list.forEach(item => item.active = false); sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false); buyMenu.list.forEach(item => item.active = false);
refundMenu.list.forEach(item => item.active = false);
correctionMenu.list.forEach(item => item.active = false);
item.active = true; item.active = true;
setBuyMenu({ setBuyMenu({
...buyMenu ...buyMenu
@ -506,6 +548,12 @@ export default function Index() {
setClickBelongpeople(false) setClickBelongpeople(false)
// setNewname(location.pathname) // setNewname(location.pathname)
// setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '软件功能特点' }]) // setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '软件功能特点' }])
}else if (location.pathname.includes('/correction')) {
setShowSearchBox(false)
setNow('首页')
setClickBelongpeople(false)
// setNewname(location.pathname)
// setPathArray([{ title: <Link to={'/home'}>首页</Link> }, { title: <Link to={'/proj-create'}>创建项目</Link> }, { title: <a onClick={() => { nav(-1) }}>编辑项目</a> }, { title: '软件功能特点' }])
} }
}, [location.pathname]) }, [location.pathname])
useEffect(() => { useEffect(() => {
@ -642,7 +690,7 @@ export default function Index() {
chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""} chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""}
tagDataId={tagDataId ? tagDataId : ""} tagDataId={tagDataId ? tagDataId : ""}
authorId={authorId ? authorId : ""} authorId={authorId ? authorId : ""}
// enableBelongpeople = {()=>{setClickBelongpeople(true)}} // enableBelongpeople = {()=>{setClickBelongpeople(true)}}
/> />
<div className='belongPeopleMenu'> <div className='belongPeopleMenu'>
<div className='belongPeopleMenu-title'> <div className='belongPeopleMenu-title'>
@ -654,7 +702,7 @@ export default function Index() {
currentPageData.map((item: any) => { currentPageData.map((item: any) => {
return ( return (
<div className='belongpeopleName' key={item.projOwnerId} onClick={() => { <div className='belongpeopleName' key={item.projOwnerId} onClick={() => {
if(clickBelongpeople){ if (clickBelongpeople) {
if (authorId == item.projOwnerId) { if (authorId == item.projOwnerId) {
setauthorId('') setauthorId('')
nav('/home', { nav('/home', {
@ -758,13 +806,18 @@ export default function Index() {
button={refundMenu.button} button={refundMenu.button}
list={refundMenu.list} list={refundMenu.list}
handleListItem={refundMenu.handleListItem} handleListItem={refundMenu.handleListItem}
// disableBelongpeople = {()=>{setClickBelongpeople(false)}} // disableBelongpeople = {()=>{setClickBelongpeople(false)}}
// keywords={keywords} // keywords={keywords}
// type={type ? type : ""} // type={type ? type : ""}
// chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""} // chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""}
// tagDataId={tagDataId ? tagDataId : ""} // tagDataId={tagDataId ? tagDataId : ""}
// authorId={authorId ? authorId : ""} // authorId={authorId ? authorId : ""}
/> />
<MenuWithTopButton
button={correctionMenu.button}
list={correctionMenu.list}
handleListItem={correctionMenu.handleListItem}
/>
</div> </div>
</div> </div>
<div className="right"> <div className="right">
@ -987,6 +1040,19 @@ export default function Index() {
> >
<RefunModal closeModal={() => { setRefunModal(false) }}></RefunModal> <RefunModal closeModal={() => { setRefunModal(false) }}></RefunModal>
</Modal> </Modal>
<Modal
title="申请补正"
destroyOnClose={true}
open={correctionModal}
footer={null}
onCancel={() => {
setCorrectionModal(false)
}}
okButtonProps={{ style: { background: 'red', color: 'white' } }}
width={592}
>
<CorrectionModal closeModal={() => { setCorrectionModal(false) }}></CorrectionModal>
</Modal>
</> </>
) )
} }

View File

@ -5,7 +5,7 @@ import TransactionOrder from '../route/TransactionOrder/TransactionOrder.tsx'
import CopyrightGgoods from '../route/CopyrightGgoods/CopyrightGgoods.tsx' import CopyrightGgoods from '../route/CopyrightGgoods/CopyrightGgoods.tsx'
import TradingGoods from '../route/TradingGoods/TradingGoods.tsx' import TradingGoods from '../route/TradingGoods/TradingGoods.tsx'
import Refun from '../route/Refun/Refun.tsx' import Refun from '../route/Refun/Refun.tsx'
import Correction from '../route/Correction/Correction.tsx'
import Index from "../route/index/Index.tsx"; import Index from "../route/index/Index.tsx";
// import Search from "../route/SearchList/SearchList.tsx"; // import Search from "../route/SearchList/SearchList.tsx";
import ProjCreate from "./proj/ProjCreate.tsx"; import ProjCreate from "./proj/ProjCreate.tsx";
@ -227,6 +227,10 @@ export const router = createHashRouter(
path:'/refun', path:'/refun',
element:<Refun/> element:<Refun/>
}, },
{
path:'/correction',
element:<Correction/>
},
{ {
path: '/proj-create', path: '/proj-create',
element: <ProjCreate /> element: <ProjCreate />

BIN
src/static/correction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -10,7 +10,9 @@ const baseState = {
// }, // },
belongArray: [], belongArray: [],
refunArray:[], refunArray:[],
refunTotal:0 correctionArray:[],
refunTotal:0,
correctionTotal:0
} }
// 创建仓库 // 创建仓库
@ -34,6 +36,12 @@ const reducer = (state = baseState, action: any) => {
if (action.type == 'upRefunTotal') { if (action.type == 'upRefunTotal') {
nstate.refunTotal = action.val nstate.refunTotal = action.val
} }
if (action.type == 'upCorrectionArray') {
nstate.correctionArray = action.val
}
if (action.type == 'upCorrectionTotal') {
nstate.correctionTotal = action.val
}
return nstate return nstate
} }
const store = createStore(reducer) const store = createStore(reducer)