- {item.authorName}
+ 产权所属者 : {item.authorName?item.authorName:'无'}
退款凭证
diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx
index 29ffa8a..871bbc7 100644
--- a/src/route/index/Index.tsx
+++ b/src/route/index/Index.tsx
@@ -3,7 +3,10 @@ import './index.css';
import { MouseEvent, Reducer, useEffect, useReducer, useState } from "react";
import { useSelector, useDispatch } from 'react-redux'
import { useNavigate, useSearchParams, Outlet } from "react-router-dom";
-import { Modal } from 'antd';
+import {
+ Modal,
+ // Row
+} from 'antd';
import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWithTopButton.ts";
import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx";
import RefunModal from '../../components/RefunModal/RefunModal.tsx'
@@ -17,8 +20,10 @@ import ContractModal from '../../components/ContractModal/ContractModal.tsx'
import {
MenuProps, Select,
Button,
- Pagination,
- Empty
+ // Pagination,
+ // Empty
+ Table,
+ Spin
} from 'antd';
import {
IndexListContext,
@@ -29,14 +34,17 @@ import {
} from "../../context/IndexListContext.ts";
// import { getMenuActive } from '../../util/cache.ts'
import {
- MenuFoldOutlined,
+ // MenuFoldOutlined,
ClearOutlined,
- CloseOutlined
+ CloseOutlined,
+ CloseCircleOutlined
} from '@ant-design/icons';
import { useLocation } from 'react-router-dom';
-import { get,
+import {
+ get,
// downloadUrl,
- post, getCouponUrl } from '../../util/AjaxUtils.ts'
+ post, getCouponUrl
+} from '../../util/AjaxUtils.ts'
import { setMenuActive } from '../../util/cache.ts'
import gpsImg from '../../static/right/gps.png'
import backImg from '../../static/right/back.png'
@@ -45,13 +53,61 @@ import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx'
import {
Input,
// Breadcrumb,
+ Empty,
message
} from 'antd';
+import type { TableColumnsType } from 'antd';
const { Search } = Input;
-
+interface DataType {
+ key: React.Key;
+ name: string;
+ type: string;
+ idCardType: string;
+ idCardNo: string;
+ projOwnerId: string
+}
export default function Index() {
+ const columns: TableColumnsType
= [
+ {
+ title: '序号',
+ dataIndex: 'index',
+ align: 'center',
+ width: 80,
+ render: (_text, _record, index) => (ownerPage - 1) * 10 + index + 1, // 显示序号,从1开始
+ },
+ {
+ title: '名称',
+ dataIndex: 'name',
+ align: 'center',
+ // width:100,
+ ellipsis: {
+ showTitle: true,
+ },
+ },
+ {
+ title: '类型',
+ dataIndex: 'type',
+ align: 'center',
+ width: 130,
+ render: (text: string) => <>{text == 'PERSONAL' ? '个人' : text == 'ORGANIZATION' ? '企业' : '未知类型'}>,
+ },
+ {
+ title: '证件类型',
+ dataIndex: 'idCardType',
+ align: 'center',
+
+ render: (text: string) => <>{text == 'ID_CARD' ? '身份证' : text == 'BUSINESS_LICENSE' ? '营业执照' : '未知类型'}>,
+ },
+ {
+ title: '证件号',
+ dataIndex: 'idCardNo',
+ align: 'center',
+
+ width: 300
+ },
+ ];
// 是否可以点击所属者 (当点击了退款选项,所属者列表跟他不产生联系 不给他点)
// const [clickBelongpeople, setClickBelongpeople] = useState(true)
// 补正搜索条件标签数组
@@ -141,12 +197,12 @@ export default function Index() {
const dispath = useDispatch()
//redux的belongArray
const redxuState: any = useSelector(state => state)
- const belongArray = redxuState.belongArray
+ // const belongArray = redxuState.belongArray
- const belongArrayList = belongArray.map((item:any) => ({
- value: item.projOwnerId ,
- label: item.name
- }));
+ // const belongArrayList = belongArray.map((item:any) => ({
+ // value: item.projOwnerId ,
+ // label: item.name
+ // }));
// 优惠券弹窗
const couponModal = redxuState.couponModal
@@ -157,28 +213,50 @@ export default function Index() {
// 项目状态 查看还是编辑
// const projStatus = redxuState.projStatus
const projStatus = sessionStorage.getItem('projStatus')
- // 获取所属者表格储存至redux 更新表格
- const getProjOwnerList = () => {
+ const [loading, setLoading] = useState(false) //表格加载
+ const [selectBelongPeople, setSelectBelongPeople] = useState(false) //有项目的所属者弹窗
+ const [ownerPage, setOwnerPage] = useState(1) //有项目的所属者表格页码
+ const [ownerTotal, setOwnerToatl] = useState(0) //有项目的所属者表格总数居
+ const [ownerKeyWords, setOwnerKeyWords] = useState('') //在有项目的所属者表格搜索时的关键字
+ const [ownerList, setOwnerList] = useState([])
+ // 获取所属者表格储存至redux 更新表格 (已弃用)
+ // 获取有项目所属者表格
+ const getProjOwnerList = (page: number, keywords: string) => {
get({
messageApi,
- url: `/api/proj-owner/list/self`,
- onBefore() {
-
+ url: `/api/proj-owner/listpage/self`,
+ // 参数
+ config: {
+ params: {
+ page: page,
+ rows: 10,
+ keywords: keywords
+ }
},
- onSuccess(data: any) {
+ onBefore() {
+ setLoading(true)
+ },
+ onSuccess({ data }: any) {
// console.log('所属者表格', data.data);
// setBelongPeopleArray(data.data)
// 存redux的belongArray
- dispath({
- type: 'uparray',
- val: data.data
- })
+ // dispath({
+ // type: 'uparray',
+ // val: data.data
+ // })
+ setOwnerList(data.rows)
+ // setOwnerList([])
+ setOwnerToatl(data.total)
+ // console.log(data);
+
},
onFinally() {
-
+ setLoading(false)
}
})
}
+ // 表格被选的项
+ const [selectedRowKeys, setselectedRowKeys] = useState([])
// 更新数据
// const upBelongArray = () => {
@@ -211,7 +289,11 @@ export default function Index() {
const [chargeAdditionals, setchargeAdditionals] = useState(null)
const [tagDataId, settagDataId] = useState(null)
const [payStatus, setpayStatus] = useState(null)
- const [authorId, setauthorId] = useState(null)
+
+ const [nowauthorId, setNowauthorId] = useState('') //临时id
+ const [authorId, setauthorId] = useState('') //所属者id
+ const [nowauthorName, setNowauthorName] = useState('') //临时名称
+ const [authorName, setauthorName] = useState('') //所属者名称
const [projRemindId, setprojRemindId] = useState(null)
//退款状态
const [applyStatus, setapplyStatus] = useState(null)
@@ -233,25 +315,25 @@ export default function Index() {
// const indexListContext = useContext(IndexListContext);
// 所属者信息
// const [belongPeopleArray, setBelongPeopleArray] = useState([])
- const [currentPage, setCurrentPage] = useState(1);
- const itemsPerPage = 5;
+ // const [currentPage, setCurrentPage] = useState(1);
+ // const itemsPerPage = 5;
// 计算总页数
- const totalItems = belongArray.length;
- const totalPages = Math.ceil(totalItems / itemsPerPage);
+ // const totalItems = belongArray.length;
+ // const totalPages = Math.ceil(totalItems / itemsPerPage);
// 计算当前页数据的起始和结束索引
- const startIndex = (currentPage - 1) * itemsPerPage;
- const endIndex = Math.min(startIndex + itemsPerPage, totalItems);
+ // const startIndex = (currentPage - 1) * itemsPerPage;
+ // const endIndex = Math.min(startIndex + itemsPerPage, totalItems);
// 提取当前页的数据
- const currentPageData = belongArray.slice(startIndex, endIndex);
+ // const currentPageData = belongArray.slice(startIndex, endIndex);
// 处理页码切换
- const handlePageChange = (page: number) => {
- if (page >= 1 && page <= totalPages) {
- setCurrentPage(page);
- }
- };
+ // const handlePageChange = (page: number) => {
+ // if (page >= 1 && page <= totalPages) {
+ // setCurrentPage(page);
+ // }
+ // };
const nav = useNavigate();
// // home页初始化搜索条件
const init = () => {
@@ -263,15 +345,22 @@ export default function Index() {
setpayStatus(null)
setprojRemindId(null)
nav('/home')
- setauthorId(null)
+ setauthorId('')
+ setauthorName('')
+ setNowauthorId('')
+ setNowauthorName('')
+ setselectedRowKeys([]);
}
// 退款页初搜索条件始化
const refunInit = () => {
setnewRefunValue('')
setrefunKeywords('')
setapplyStatus(null)
- setauthorId(null)
-
+ setauthorId('')
+ setauthorName('')
+ setNowauthorId('')
+ setNowauthorName('')
+ setselectedRowKeys([]);
// 刷新当前页面
}
@@ -283,7 +372,11 @@ export default function Index() {
setcorrectionType(null)
setcorrectionApplyStatus(null)
setTagCor(null)
- setauthorId(null)
+ setauthorId('')
+ setauthorName('')
+ setNowauthorId('')
+ setNowauthorName('')
+ setselectedRowKeys([]);
}
@@ -343,6 +436,8 @@ export default function Index() {
],
handleListItem(_e, _index, item: IMenuListItem) {
+ // setauthorId('')
+ // setauthorName('')
projMenu.list.forEach(item => item.active = false);
sellMenu.list.forEach(item => item.active = false);
buyMenu.list.forEach(item => item.active = false);
@@ -885,12 +980,12 @@ export default function Index() {
})
}
- getProjOwnerList()
+ // getProjOwnerList()
getCorTag()
getTag()
getremindTag()
- console.log(belongArray);
-
+ // console.log(belongArray);
+
}, []);
useEffect(() => {
if (location.pathname.includes('/home')) {
@@ -1082,7 +1177,7 @@ export default function Index() {
// enableBelongpeople = {()=>{setClickBelongpeople(true)}}
/>
-
+ {/*
产权所属者
@@ -1092,78 +1187,17 @@ export default function Index() {
currentPageData.map((item: any) => {
return (
{
- // const isHome = getMenuActive() == 'ALL' || getMenuActive() == 'PROCESSING' || getMenuActive() == 'COMPLETE'
+
if (authorId == item.projOwnerId) {
setauthorId(null)
- // if (isHome) {
-
- // nav('/home', {
- // state: {
- // keyword: keywords,
- // type: type,
- // chargeAdditionals: chargeAdditionals,
- // tagDataId: tagDataId,
- // authorId: '',
- // payStatus: payStatus
-
- // }
- // })
- // }
- // if (getMenuActive() == 'REFUN') {
- // nav('/refun', {
- // state: {
- // state: {
- // keywords: refunKeywords,
- // applyStatus: applyStatus,
- // authorId: '',
- // }
-
- // }
- // })
- // }
-
+
} else {
setauthorId(item.projOwnerId)
- // if (isHome) {
- // nav('/home', {
- // state: {
- // keyword: keywords,
- // type: type,
- // chargeAdditionals: chargeAdditionals,
- // tagDataId: tagDataId,
- // authorId: item.projOwnerId,
- // payStatus: payStatus
-
- // }
- // })
- // }
- // if (getMenuActive() == 'REFUN') {
- // nav('/refun', {
- // state: {
- // state: {
- // keywords: refunKeywords,
- // applyStatus: applyStatus,
- // authorId: item.projOwnerId,
- // }
-
- // }
- // })
- // }
-
+
}
- // alert(getMenuActive())
-
-
- // const menuName = (getMenuActive())
- // // const menuTrue = menuName == 'ALL' || 'PROCESSING' || 'COMPLETE'
- // if(menuName == 'ALL' || 'PROCESSING' ||'COMPLETE' ){
- // alert(1)
- // }else{
- // alert(2)
- // }
-
+
}}
style={{ background: authorId == item.projOwnerId ? '#FF9F08' : '', color: authorId == item.projOwnerId ? '#FFF' : '' }}
title={item.name} // 添加 title 属性以显示完整文本
@@ -1174,25 +1208,7 @@ export default function Index() {
})
}
- {/* 分页控件 */}
- {/*
-
-
-
-
*/}
+
-
+
+ /> */}
+
+
+
{
+ // setauthorName('哈哈哈哈哈哈哈哈哈哈嘎嘎嘎嘎嘎嘎')
+ setOwnerPage(1)
+ getProjOwnerList(1, '')
+ setSelectBelongPeople(true)
+ // nav('/home', {
+ // state: {
+ // keyword: keywords,
+ // type: type,
+ // chargeAdditionals: chargeAdditionals,
+ // tagDataId: tagDataId,
+ // authorId: '1',
+ // payStatus: payStatus,
+ // projRemindId: projRemindId,
+ // // tagNot
+ // }
+ // })
+ }}
+
+ >
+
+
+
{
+ setauthorName('')
+ setauthorId('')
+ setNowauthorId('')
+ setNowauthorName('')
+ setselectedRowKeys([]);
+ nav('/home', {
+ state: {
+ keyword: keywords,
+ type: type,
+ chargeAdditionals: chargeAdditionals,
+ tagDataId: tagDataId,
+ authorId: '',
+ payStatus: payStatus,
+ projRemindId: projRemindId,
+ // tagNot
+ }
+ })
+ }}
+ />
+