退款补正样式更改

This commit is contained in:
xixi 2024-09-04 15:52:35 +08:00
parent 01ea979f11
commit ec4565dd04
8 changed files with 614 additions and 209 deletions

View File

@ -1,14 +1,70 @@
// import React from 'react'
import { useEffect, useState } from 'react'
// import './RefunModal.css'
import { Form, Select, Button, Upload, message, Input } from 'antd';
import { Form, Select, Button, Upload, message, Input, Modal, Table,Empty } from 'antd';
import type { TableColumnsType } from 'antd';
const { Search } = Input;
import { UploadOutlined } from '@ant-design/icons';
import { uploadImageUrl, DevUserId, get, post } from "../../util/AjaxUtils.ts";
import { getMenuActive } from '../../util/cache.ts'
// import { getMenuActive } from '../../util/cache.ts'
import { useDispatch } from 'react-redux'
const { TextArea } = Input;
interface DataType {
key: React.Key;
projName: string;
projContext: string;
gmtCreate: string;
projId: string
}
export default function CorrectionModal(props: any) {
const columns: TableColumnsType<DataType> = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
width: 80,
render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
},
{
title: '项目名称',
dataIndex: 'projName',
align: 'center',
render: (text: string) => <>{text}</>,
},
{
title: '编号',
dataIndex: 'projContext',
align: 'center',
},
{
title: '创建时间',
dataIndex: 'gmtCreate',
align: 'center',
},
];
const [messageApi, contextHolder] = message.useMessage();
// 选择项目得临时name
const [newprojName, setnewprojName] = useState('')
// 选择项目得name
const [projName, setProjName] = useState('')
// 选择得项目临时id
const [newprojId, setnewProjId] = useState('')
// 选择 项目的id
const [projId, setProjId] = useState('')
//默认选择得项目
const [selectedRowKeys, setselectedRowKeys] = useState<string[]>([])
// 分页
const [page, setPage] = useState(1)
const [total, setTotal] = useState(0)
// 搜索关键字
const [keywords, setKeywords] = useState('')
// 选择项目弹窗
const [projModal, setProjModal] = useState(false)
// 上传附件
const [correctionArray, setCorrectionArray] = useState<string[]>([]);
// const [selectedReason, setSelectedReason] = useState(''); //选择原因
@ -17,10 +73,20 @@ export default function CorrectionModal(props: any) {
// setSelectedReason(value);
// };
// 获取当前选择类型
const type = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
// 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 [correctionDataArray, setCorrectionDataArray] = useState<any[]>([]) //未补正项目
const [isDisabled, setIsDisabled] = useState(false) //提交按钮是否禁用
const [form] = Form.useForm<any>();
// 关键字搜索
const handleSearch = (value: string) => {
setKeywords(value)
}
const handleChange = (e: any) => {
if (e.target.value == '') {
setKeywords('')
}
}
// 提交表单
const onFinish = (values: any) => {
// console.log('Form values:', values);
@ -32,10 +98,10 @@ export default function CorrectionModal(props: any) {
messageApi,
url: `/api/proj/correction/apply/save`,
body: {
projId: values.title,
projId: projId,
correctionReason: values.other,
correctionVoucher: correctionArray.join(','),
correctionType:values.correctionType
correctionType: values.correctionType
},
onBefore() {
setIsDisabled(true)
@ -45,12 +111,12 @@ export default function CorrectionModal(props: any) {
setIsDisabled(true)
setTimeout(() => {
props.closeModal()
}, 500)
if (type === 'PENDING') {
getData()
}
}, 500)
getData()
},
onFinally() {
@ -62,12 +128,11 @@ export default function CorrectionModal(props: any) {
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
applyStatus: ''
}
},
onSuccess(data: any) {
@ -88,23 +153,26 @@ export default function CorrectionModal(props: any) {
const getCorrectionData = () => {
get({
messageApi,
url: `/api/proj/correction/apply/list-proj-unapply/self`,
// config: {
// params: {
// }
// },
url: `/api/proj/correction/apply/listpage-proj-unapply/self`,
config: {
params: {
page: 1,
rows: 20,
keywords
}
},
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)
console.log(data);
// const newArray = (data.data).map((item: { projId: any; projName: any; }) => ({
// value: item.projId,
// label: item.projName
// }))
setCorrectionDataArray(data.data.rows)
setTotal(data.data.total)
},
onFinally() {
@ -115,14 +183,15 @@ export default function CorrectionModal(props: any) {
}
useEffect(() => {
getCorrectionData()
// console.log(type);
}, [])
}, [page, keywords])
return (
<div className='refunModal'>
{contextHolder}
<Form
name="Form"
form={form}
onFinish={onFinish}
initialValues={{ softWare: '' }}
style={{ maxWidth: 600 }}
@ -131,24 +200,33 @@ export default function CorrectionModal(props: any) {
<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={{
<div className='refunInput'>
<Form.Item
name="title"
rules={[{ required: true, message: '请选择一个软著!' }]}
>
<Input style={{
width: 405,
height: 46,
background: '#FFF',
color: 'black'
}}
/>
</Form.Item>
placeholder="选择需要补正的软著"
disabled
>
</Input>
</Form.Item>
<div className='refunInput-button' onClick={() => {
setProjModal(true)
setKeywords('')
setPage(1)
getCorrectionData()
}}>
</div>
</div>
</div>
<div className='refunModal-item'>
<div className='refunModal-title'>
@ -157,13 +235,14 @@ export default function CorrectionModal(props: any) {
<Form.Item
name="correctionType"
// label="退款软著"
rules={[{ required: true, message: '请选择' }]}
rules={[{ required: true, message: '请选择补正种类' }]}
>
<Select
placeholder="选择类型"
options={[
{ value: 'MANUAL', label: '操作手册' },
{ value: 'CODE', label: '代码' },
{ value: 'ALL', label: '操作手册+代码' },
]}
style={{
width: 405,
@ -218,10 +297,10 @@ export default function CorrectionModal(props: any) {
</div>
<Form.Item
name="other"
rules={[{ required: true, message: '请输入退款原因' }]}
rules={[{ required: true, message: '请输入补正原因' }]}
>
<TextArea
placeholder="输入退款原因"
placeholder="输入补正原因"
style={{ height: 120, resize: 'none', width: 405 }}
/>
</Form.Item>
@ -263,7 +342,7 @@ export default function CorrectionModal(props: any) {
}
return e.fileList;
}}
rules={[{ required: true, message: '请上传凭证' }]}
rules={[{ required: true, message: '请上传补正通知书' }]}
>
<Upload
name="image"
@ -280,7 +359,7 @@ export default function CorrectionModal(props: any) {
// listType="picture-card"
>
<Button icon={<UploadOutlined />} style={{ marginTop: 2 }}></Button>
<Button icon={<UploadOutlined />} style={{ marginTop: 2 }}></Button>
</Upload>
</Form.Item>
</div>
@ -292,13 +371,99 @@ export default function CorrectionModal(props: any) {
width: 273,
height: 52
}}
disabled={isDisabled}
disabled={isDisabled}
>
</Button>
</div>
</Form.Item>
</Form>
<Modal title="选择补正项目"
destroyOnClose
okText="确认"
cancelText="取消"
open={projModal}
onOk={
() => {
if (newprojId) {
setProjName(newprojName)
setProjId(newprojId)
setProjModal(false)
setselectedRowKeys([newprojId])
form.setFieldsValue({
title: newprojName
});
} else {
messageApi.open({
type: 'error',
content: '请选择要退款项目'
})
}
}
}
width={1220}
onCancel={() => {
setselectedRowKeys([projId])
setnewProjId(projId)
setnewprojName(projName)
setProjModal(false)
}}>
<Search placeholder="输入项目名称"
onSearch={handleSearch}
onChange={handleChange}
style={{
width: '200px',
height: '31px',
marginBottom: 15
}}
allowClear
/>
<Table
rowSelection={{
selectedRowKeys: selectedRowKeys,
type: 'radio',
// ...rowSelection,
onChange: (_selectedRowKeys: React.Key[], selectedRows: DataType[]) => {
console.log('selectedRows: ', selectedRows);
setselectedRowKeys([selectedRows[0].projId])
setnewProjId(selectedRows[0].projId)
setnewprojName(selectedRows[0].projName)
},
}}
columns={columns}
dataSource={correctionDataArray}
rowKey={'projId'}
pagination={
{
pageSize: 20,
total: total,
onChange: (currentPage) => {
setPage(currentPage);
},
showSizeChanger: false,
current: page
}
}
locale={{
emptyText: <Empty
description="暂无数据"
/>,
}}
scroll={{ y: 500 }}
/>
</Modal>
</div>
)
}

View File

@ -27,4 +27,21 @@
display: flex;
justify-content: center;
margin-top: 20px;
}
.refunInput{
position: relative;
}
.refunInput-button{
/* height: 100%; */
width: 50px;
display: flex;
align-items: center;
justify-content: center;
/* background-color: #F04C4C; */
color: rgb(18, 128, 255);
position: absolute;
top:13px;
right: 20px;
cursor: pointer;
}

View File

@ -1,13 +1,53 @@
import { useEffect, useState } from 'react'
import { useState, useEffect } from 'react'
import './RefunModal.css'
import { Form, Select, Button, Upload, message, Input } from 'antd';
import { Form, Button, Upload, message, Input, Modal, Table, Empty } from 'antd';
import type { TableColumnsType } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { uploadImageUrl, DevUserId, get, post } from "../../util/AjaxUtils.ts";
import { getMenuActive } from '../../util/cache.ts'
// import { getMenuActive } from '../../util/cache.ts'
import { useDispatch } from 'react-redux'
const { Search } = Input;
const { TextArea } = Input;
interface DataType {
key: React.Key;
projName: string;
projContext: string;
gmtCreate: string;
projId: string
}
export default function RefunModal(props: any) {
const columns: TableColumnsType<DataType> = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
width: 80,
render: (_text, _record, index) => (page - 1) * 20 + index + 1, // 显示序号从1开始
},
{
title: '项目名称',
dataIndex: 'projName',
align: 'center',
render: (text: string) => <>{text}</>,
},
{
title: '编号',
dataIndex: 'projContext',
align: 'center',
},
{
title: '创建时间',
dataIndex: 'gmtCreate',
align: 'center',
},
];
const [messageApi, contextHolder] = message.useMessage();
// 上传附件
const [refunArray, setRefunArray] = useState<string[]>([]);
@ -17,22 +57,46 @@ export default function RefunModal(props: any) {
// setSelectedReason(value);
// };
// 获取当前选择类型
const type = getMenuActive()
// const type = getMenuActive()
const dispath = useDispatch()
const [refunDataArray, setRefunDataArray] = useState<any[]>([]) //未退款项目
const [isDisabled,setIsDisabled] = useState(false) //提交按钮是否禁用
// 选择项目得临时name
const [newprojName, setnewprojName] = useState('')
// 选择项目得name
const [projName, setProjName] = useState('')
// 选择得项目临时id
const [newprojId, setnewProjId] = useState('')
// 选择 项目的id
const [projId, setProjId] = useState('')
//默认选择得项目
const [selectedRowKeys, setselectedRowKeys] = useState<string[]>([])
// 分页
const [page, setPage] = useState(1)
const [total, setTotal] = useState(0)
// 搜索关键字
const [keywords, setKeywords] = useState('')
const [refunDataArray, setRefunDataArray] = useState<any[]>([]) //未退款项目数组
// 选择项目弹窗
const [projModal, setProjModal] = useState(false)
const [isDisabled, setIsDisabled] = useState(false) //提交按钮是否禁用
const [form] = Form.useForm<any>();
// 关键字搜索
const handleSearch = (value: string) => {
setKeywords(value)
}
const handleChange = (e: any) => {
if (e.target.value == '') {
setKeywords('')
}
}
// 提交表单
const onFinish = (values: any) => {
// console.log('Form values:', values);
// console.log(refunArray);
post<any>({
messageApi,
url: `/api/proj/refund/apply/save`,
body: {
projId: values.title,
projId: projId,
refundReason: values.other,
refundVoucher: refunArray.join(',')
},
@ -45,10 +109,8 @@ export default function RefunModal(props: any) {
setTimeout(() => {
props.closeModal()
}, 500)
if ( type === 'PENDING') {
getData()
}
getData()
},
onFinally() {
@ -60,17 +122,14 @@ export default function RefunModal(props: any) {
get({
messageApi,
url: `/api/proj/refund/apply/listpage`,
// url: `/api/proj/refund/apply/listpage?applyStatus=${state.type}`,
config: {
params: {
page: 1,
rows: 20,
applyStatus: type
applyStatus: ''
}
},
onSuccess(data: any) {
// console.log('更新');
dispath({
type: 'upRefunArray',
val: data.data.rows
@ -86,24 +145,21 @@ export default function RefunModal(props: any) {
const getRefunData = () => {
get({
messageApi,
url: `/api/proj/refund/apply/list-proj-unapply/self`,
// config: {
// params: {
// }
// },
url: `/api/proj/refund/apply/listpage-proj-unapply/self`,
config: {
params: {
page: 1,
rows: 20,
keywords
}
},
onBefore() {
},
onSuccess(data: any) {
// console.log(data);
const newArray = (data.data).map((item: { projId: any; projName: any; }) => ({
value: item.projId,
label: item.projName
}))
setRefunDataArray(newArray)
setRefunDataArray(data.data.rows)
setTotal(data.data.total)
},
onFinally() {
@ -113,14 +169,13 @@ export default function RefunModal(props: any) {
}
useEffect(() => {
getRefunData()
// console.log(type);
}, [])
}, [page, keywords])
return (
<div className='refunModal'>
{contextHolder}
<Form
name="Form"
form={form}
onFinish={onFinish}
initialValues={{ softWare: '' }}
style={{ maxWidth: 600 }}
@ -129,65 +184,35 @@ export default function RefunModal(props: any) {
<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={refunDataArray}
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>
<div className='refunInput'>
<Form.Item
name="other"
rules={[{ required: true, message: '请输入退款原因' }]}
name="title"
rules={[{ required: true, message: '请选择一个软著!' }]}
>
<TextArea
placeholder="其他退款原因"
style={{ height: 120, resize: 'none', width: 405 }}
/>
<Input style={{
width: 405,
height: 46,
background: '#FFF',
color: 'black'
}}
placeholder="选择需要退款的软著"
disabled
>
</Input>
</Form.Item>
<div className='refunInput-button' onClick={() => {
setProjModal(true)
setKeywords('')
setPage(1)
getRefunData()
}}>
</div>
</div>
)} */}
</div>
<div className='refunModal-item'>
<div className='refunModal-title'>
退<span className='refunModal-red'>*</span>
@ -202,23 +227,6 @@ export default function RefunModal(props: any) {
/>
</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>
@ -239,7 +247,7 @@ export default function RefunModal(props: any) {
}
return e.fileList;
}}
rules={[{ required: true, message: '请上传凭证' }]}
rules={[{ required: true, message: '请上传补正通知书' }]}
>
<Upload
name="image"
@ -256,7 +264,7 @@ export default function RefunModal(props: any) {
// listType="picture-card"
>
<Button icon={<UploadOutlined />} style={{ marginTop: 2 }}></Button>
<Button icon={<UploadOutlined />} style={{ marginTop: 2 }}></Button>
</Upload>
</Form.Item>
</div>
@ -268,13 +276,100 @@ export default function RefunModal(props: any) {
width: 273,
height: 52
}}
disabled={isDisabled}
disabled={isDisabled}
>
</Button>
</div>
</Form.Item>
</Form>
<Modal title="选择退款项目"
destroyOnClose
okText="确认"
cancelText="取消"
open={projModal}
onOk={
() => {
if (newprojId) {
setProjName(newprojName)
setProjId(newprojId)
setProjModal(false)
setselectedRowKeys([newprojId])
form.setFieldsValue({
title: newprojName
});
} else {
messageApi.open({
type: 'error',
content: '请选择要退款项目'
})
}
}
}
width={1220}
onCancel={() => {
setselectedRowKeys([projId])
setnewProjId(projId)
setnewprojName(projName)
setProjModal(false)
}}>
<Search placeholder="输入项目名称"
onSearch={handleSearch}
onChange={handleChange}
style={{
width: '200px',
height: '31px',
marginBottom: 15
}}
allowClear
/>
<Table
rowSelection={{
selectedRowKeys: selectedRowKeys,
type: 'radio',
// ...rowSelection,
onChange: (_selectedRowKeys: React.Key[], selectedRows: DataType[]) => {
console.log('selectedRows: ', selectedRows);
setselectedRowKeys([selectedRows[0].projId])
setnewProjId(selectedRows[0].projId)
setnewprojName(selectedRows[0].projName)
},
}}
columns={columns}
dataSource={refunDataArray}
rowKey={'projId'}
pagination={
{
pageSize: 20,
total: total,
onChange: (currentPage) => {
setPage(currentPage);
},
showSizeChanger: false,
current: page
}
}
locale={{
emptyText: <Empty
description="暂无数据"
/>,
}}
scroll={{ y: 500 }}
/>
</Modal>
</div>
)
}

View File

@ -64,7 +64,11 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
// props.disableBelongpeople()
navugate('/correction', {
state: {
type: item.id
keywords: props.correctionKeywords,
correctionNumType:props.correctionNumType,
correctionType:props.correctionType,
applyStatus: props.correctionApplyStatus,
authorId: props.authorId
}
})
}

View File

@ -27,6 +27,10 @@ export interface IMenuWithTopButton {
refunKeywords?:string
applyStatus?:string
payStatus?:string
correctionKeywords?:string
correctionNumType?:string
correctionType?:string
correctionApplyStatus?:string
// disableBelongpeople?:any
// enableBelongpeople?:any
}

View File

@ -2,12 +2,12 @@ import { useState, useEffect, } from 'react';
import {
Table,
// Pagination,
Modal, Tag, message, Spin, Select, Button, Empty
Modal, Tag, message, Spin, Empty
} from 'antd';
import {
// MenuFoldOutlined,
ClearOutlined
} from '@ant-design/icons';
// import {
// // MenuFoldOutlined,
// ClearOutlined
// } from '@ant-design/icons';
import { useSelector, useDispatch } from 'react-redux'
import {
get,
@ -15,6 +15,7 @@ import {
Axios
} from '../../util/AjaxUtils'
import type { TableProps } from 'antd';
import { useLocation } from 'react-router-dom';
// import { getMenuActive } from '../../util/cache'
// import { useNavigate } from "react-router-dom";
interface DataType {
@ -36,22 +37,27 @@ export default function Correction() {
const height = window.innerHeight - 180;
const [messageApi, contextHolder] = message.useMessage();
// const nav = useNavigate();
// const { state } = useLocation()
const { state } = useLocation()
// const MenuActive = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
const [type, setType] = useState<string | null>(null)
// const [type, setType] = useState<string | null>(null)
const [isLoading, setIsLoading] = useState(false)
const [page, setPage] = useState(1) // 分页
const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗
const [numtype, setnumtype] = useState<string | null>(null) //类型 一次 二次
const [correctionType, setcorrectionType] = useState<string | null>(null) //补正种类
const init = () => {
setnumtype(null)
setcorrectionType(null)
setType(null)
}
// 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 : ''
const authorId = state ? state.authorId : ''
const correctionNumType = state ? state.correctionNumType : ''
const correctionType = state ? state.correctionType : ''
const columns: TableProps<DataType>['columns'] =
// 撤销状态
type == 'CANCELED' ? [
applyStatus == 'CANCELED' ? [
{
title: '序号',
dataIndex: 'index',
@ -128,7 +134,7 @@ export default function Correction() {
},
]
: type == 'PENDING' ?
: applyStatus == 'PENDING' ?
// PENDING待审核状态
[
{
@ -219,7 +225,7 @@ export default function Correction() {
},
]
// 未通过 状态
: type == 'REJECTED' ?
: applyStatus == 'REJECTED' ?
[
{
title: '序号',
@ -270,6 +276,9 @@ export default function Correction() {
key: 'gmtReview',
align: 'center',
width: 200,
render: (text) => <div>
{text ? text : '—'}
</div>
},
{
title: '审核状态',
@ -312,7 +321,7 @@ export default function Correction() {
]
//已通过状态
: type == 'APPROVED' ?
: applyStatus == 'APPROVED' ?
[
{
title: '序号',
@ -363,6 +372,9 @@ export default function Correction() {
key: 'gmtReview',
align: 'center',
width: 200,
render: (text) => <div>
{text ? text : '—'}
</div>
},
{
title: '审核状态',
@ -485,6 +497,9 @@ export default function Correction() {
key: 'gmtReview',
align: 'center',
width: 200,
render: (text) => <div>
{text ? text : '—'}
</div>
},
{
title: '审核状态',
@ -562,6 +577,8 @@ export default function Correction() {
const correctionArray = redxuState.correctionArray
const total = redxuState.correctionTotal
const [projCorrectionApplyId, setprojCorrectionApplyId] = useState('') //要撤销的id
// const correctionType = state?state.correctionType:''
const getData = (page: number) => {
get({
messageApi,
@ -571,9 +588,11 @@ export default function Correction() {
params: {
page: page,
rows: 20,
applyStatus: type,
type: numtype,
correctionType: correctionType
projName: keyWords,
applyStatus: applyStatus,
type: correctionNumType,
correctionType: correctionType,
authorId: authorId
}
},
onBefore() {
@ -617,7 +636,11 @@ export default function Correction() {
params: {
page: page,
rows: 20,
applyStatus: type
projName: keyWords,
applyStatus: applyStatus,
type: correctionNumType,
correctionType: correctionType,
authorId: authorId
}
},
onSuccess(data: any) {
@ -654,12 +677,12 @@ export default function Correction() {
// console.log(type);
// console.log('嘻嘻',correctionArray);
}, [type, numtype, correctionType])
}, [keyWords, applyStatus, authorId, correctionNumType, correctionType])
return (
<div>
{contextHolder}
<div className='refun' style={{ height: `${height}px`, overflow: 'auto' }}>
<div style={{ marginBottom: 10 }}>
{/* <div style={{ marginBottom: 10 }}>
<Select
value={numtype}
style={{ height: '31px', width: '150px' }}
@ -717,7 +740,7 @@ export default function Correction() {
icon={<ClearOutlined />}>
</Button>
</div>
</div> */}
{/* {state.type} */}
<Spin tip="加载中..." spinning={isLoading}>
<Table columns={columns}
@ -747,7 +770,7 @@ export default function Correction() {
description="暂无数据"
/>,
}}
scroll={{ y: height - 190 }}
scroll={{ y: height - 160 }}
rowKey="projCorrectionApplyId"
/>
</Spin>

View File

@ -246,6 +246,9 @@ export default function Refun() {
key: 'gmtReview',
align: 'center',
width: 200,
render: (text) => <div>
{text ? text : '—'}
</div>
},
{
title: '审核状态',
@ -327,7 +330,7 @@ export default function Refun() {
align: 'center',
width: 200,
render: (text) => <div>
{text?text:'—'}
{text ? text : '—'}
</div>
},
{
@ -401,7 +404,7 @@ export default function Refun() {
const redxuState: any = useSelector(state => state)
const refunArray = redxuState.refunArray
const total = redxuState.refunTotal
const getData = (page: number) => {
get({
messageApi,
@ -535,7 +538,7 @@ export default function Refun() {
description="暂无数据"
/>,
}}
scroll={{ y: height - 150 }}
scroll={{ y: height - 160 }}
rowKey="projRefundApplyId"
/>
</Spin>

View File

@ -142,12 +142,23 @@ export default function Index() {
const [tagDataId, settagDataId] = useState<string | null>(null)
const [payStatus, setpayStatus] = useState<string | null>(null)
const [authorId, setauthorId] = useState('')
//退款状态
const [applyStatus, setapplyStatus] = useState<string | null>(null)
// 退款关键字
const [refunKeywords, setrefunKeywords] = useState('')
// 退款临时关键字
const [newRefunValue, setnewRefunValue] = useState('')
//补正搜索相关
// 补正关键字
const [correctionKeywords, setcorrectionKeywords] = useState('')
// 补正临时关键字
const [newCorrectionValue, setnewCorrectionValue] = useState('')
// 补正类型
const [correctionNumType, setcorrectionNumType] = useState<string | null>(null)
// 补正种类
const [correctionType, setcorrectionType] = useState<string | null>(null)
// 补正状态
const [correctionApplyStatus, setcorrectionApplyStatus] = useState<string | null>(null)
// const indexListContext = useContext(IndexListContext);
// 所属者信息
// const [belongPeopleArray, setBelongPeopleArray] = useState<any[]>([])
@ -180,12 +191,20 @@ export default function Index() {
settagDataId(null)
setpayStatus(null)
}
// refun页初始化
// 退款页初搜索条件始化
const refunInit = () => {
setnewRefunValue('')
setrefunKeywords('')
setapplyStatus(null)
}
// 补正页面搜索条件初始化
const correctionInit = () => {
setnewCorrectionValue('')
setcorrectionKeywords('')
setcorrectionNumType(null)
setcorrectionType(null)
setcorrectionApplyStatus(null)
}
const nav = useNavigate();
const [searchParams] = useSearchParams();
@ -660,8 +679,19 @@ export default function Index() {
}
})
}
if (location.pathname.includes('/correction')) {
nav('/correction', {
state: {
keywords: correctionKeywords,
correctionNumType: correctionNumType,
correctionType: correctionType,
applyStatus: correctionApplyStatus,
authorId: authorId
}
})
}
}, [type, chargeAdditionals, keywords, tagDataId,payStatus, authorId, refunKeywords, applyStatus]);
}, [type, chargeAdditionals, keywords, tagDataId, payStatus, authorId, refunKeywords, applyStatus, correctionKeywords, correctionNumType, correctionType, correctionApplyStatus]);
// const [menuName,setMenuName] = useState<string | null>('')
// useEffect(()=>{
@ -728,6 +758,36 @@ export default function Index() {
})
}
}
// 补正关键字搜索
const correctionhandleSearch = (value: string) => {
// console.log(value);
setcorrectionKeywords(value)
nav('/correction', {
state: {
keywords: value,
correctionNumType: correctionNumType,
correctionType: correctionType,
applyStatus: correctionApplyStatus,
authorId: authorId
}
})
}
const correctionhandleChange = (e: any) => {
setnewCorrectionValue(e.target.value)
// console.log(e.target.value);
if (e.target.value == '') {
setcorrectionKeywords('')
nav('/correction', {
state: {
keywords: '',
correctionNumType: correctionNumType,
correctionType: correctionType,
applyStatus: correctionApplyStatus,
authorId: authorId
}
})
}
}
return (
<>
{/* <Breadcrumb
@ -750,13 +810,21 @@ export default function Index() {
list={projMenu.list}
handleListItem={projMenu.handleListItem}
keywords={keywords}
refunKeywords={refunKeywords}
applyStatus={applyStatus ? applyStatus : ''}
type={type ? type : ""}
chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""}
tagDataId={tagDataId ? tagDataId : ""}
authorId={authorId ? authorId : ""}
payStatus={payStatus?payStatus:''}
payStatus={payStatus ? payStatus : ''}
// 退款
refunKeywords={refunKeywords}
applyStatus={applyStatus ? applyStatus : ''}
type={type ? type : ""}
// 补正
correctionKeywords={correctionKeywords ? correctionKeywords : ''}
correctionNumType={correctionNumType ? correctionNumType : ''}
correctionType={correctionType ? correctionType : ''}
correctionApplyStatus={correctionApplyStatus ? correctionApplyStatus : ''}
// enableBelongpeople = {()=>{setClickBelongpeople(true)}}
/>
@ -1105,7 +1173,10 @@ export default function Index() {
}} ></div>
<Button type="primary" onClick={() => {
setRefunModal(true)
}}>
refunInit()
}}
style={{ background: '#FF9F08' }}
>
退
</Button>
<Search placeholder="输入项目名称"
@ -1163,13 +1234,16 @@ export default function Index() {
}} ></div>
<Button type="primary" onClick={() => {
setCorrectionModal(true)
}}>
correctionInit()
}}
style={{ background: '#FF9F08' }}
>
</Button>
<Search placeholder="输入项目名称"
value={newRefunValue}
onSearch={refunhandleSearch}
onChange={refunhandleChange}
value={newCorrectionValue}
onSearch={correctionhandleSearch}
onChange={correctionhandleChange}
style={{
width: '200px',
height: '31px',
@ -1178,11 +1252,20 @@ export default function Index() {
allowClear
/>
<Select
// value={numtype}
value={correctionNumType}
style={{ height: '31px', width: '150px', marginLeft: 10 }}
onChange={(value: string) => {
// setnumtype(value)
setcorrectionNumType(value)
nav('/correction', {
state: {
keywords: correctionKeywords,
correctionNumType: value,
correctionType: correctionType,
applyStatus: correctionApplyStatus,
authorId: authorId
}
})
}}
options={[
// { value: '', label: '全部项目' },
@ -1195,9 +1278,18 @@ export default function Index() {
/>
<Select
style={{ height: '31px', width: '150px', marginLeft: 10 }}
// value={correctionType}
value={correctionType}
onChange={(value: string) => {
// setcorrectionType(value)
setcorrectionType(value)
nav('/correction', {
state: {
keywords: correctionKeywords,
correctionNumType: correctionNumType,
correctionType: value,
applyStatus: correctionApplyStatus,
authorId: authorId
}
})
}}
allowClear
options={[
@ -1211,13 +1303,15 @@ export default function Index() {
placeholder={'选择补正种类'}
/>
<Select
value={applyStatus}
value={correctionApplyStatus}
style={{ height: '31px', width: '150px', marginLeft: 10 }}
onChange={(value: string) => {
setapplyStatus(value)
nav('/refun', {
setcorrectionApplyStatus(value)
nav('/correction', {
state: {
keywords: refunKeywords,
keywords: correctionKeywords,
correctionNumType: correctionNumType,
correctionType: correctionType,
applyStatus: value,
authorId: authorId
}
@ -1235,7 +1329,7 @@ export default function Index() {
allowClear
/>
<Button onClick={() => {
refunInit()
correctionInit()
}} style={{ marginLeft: 10, height: 31 }}
// type="primary"
icon={<ClearOutlined />}>