diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index 8c58096..921c805 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -93,7 +93,7 @@ type FieldType = { // }, // ]; -import { DownOutlined, UserOutlined, QuestionCircleOutlined, BellOutlined, KeyOutlined, LogoutOutlined, GiftOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined, } from "@ant-design/icons"; +import { DownOutlined, UserOutlined, QuestionCircleOutlined, BellOutlined, KeyOutlined, LogoutOutlined, GiftOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined,TableOutlined } from "@ant-design/icons"; import { useContext, useEffect, useState } from "react"; import { put, get, @@ -116,8 +116,43 @@ import ContactPeople from '../../components/ContactPeople/ContactPeople.tsx' import inv from '../../static/inv.png' import MyOrder from '../../components/myOrder/MyOrder.tsx' import NoticeModal from '../../components/NoticeModal/NoticeModal.tsx'; +import type { + TableColumnsType, +} from 'antd'; // import HeadCouponModal from '../../components/CouponModal/HeadCouponModal.tsx' export default function Head() { + const [packList, setPackList] = useState([]) //服务包列表 + const [packPage, setPackPage] = useState(1) //服务包分页 + const [packTotal, setPackTotal] = useState(0) //服务包总数 + // 获取我得服务包信息 + const getPickList = () => { + + get({ + messageApi, + url: `/api/proj/servicepkg/packageorder/listpage/self`, + config: { + params: { + page: packPage, + rows: 10, + } + }, + onBefore() { + + }, + onSuccess({ data }) { + + setPackList(data.rows) + setPackTotal(data.total) + + }, + onFinally() { + + } + }) + } + useEffect(() => { + getPickList(); + }, [packPage]); const [page, setPage] = useState(1) //邀请码使用人数分页 const [total, setTotal] = useState(0) //邀请码使用人数总量 const [icListLoading, setIcListLoading] = useState(false) @@ -584,6 +619,8 @@ export default function Head() { } // 联系人弹窗 const [contactModal, setContactModal] = useState(false) + // 套餐包弹窗 + const [packageModal, setPackageModal] = useState(false) const [concatPeopleInfo, setConcatPeopleInfo] = useState({ applyConcatId: '', applyContactCsaNo: '', @@ -592,6 +629,62 @@ export default function Head() { applyContactPhone: '', applyContactCompany: '' }) + const packColumns: TableColumnsType = [ + { + title: '序号', + dataIndex: 'index', + key: 'packageOrderId', + align: 'center', + render: (_text, _record, index) => (page - 1) * 10 + index + 1, // 显示序号,从1开始 + + }, + { + title: '套餐名称', + dataIndex: 'packageName', + key: 'packageOrderId', + // 居中显示 + align: 'center', + }, + // packageType + { + title: '套餐类型', + dataIndex: 'packageType', + key: 'packageOrderId', + // 居中显示 + align: 'center', + render: (text) => { + return
{text=="ALL"?'全托管':'写材料'}
+ } + }, + { + title: '价格', + dataIndex: 'packageTotalMoney', + key: 'packageOrderId', + // 居中显示 + align: 'center', + render: (text) => { + return
{text/100}元
+ } + }, + { + title: '当前剩余次数', + dataIndex: 'packageTotalSurplusCount', + align: 'center', + key: 'packageOrderId', + render: (text: number) => { + return
{text}
+ } + }, + { + title: '下单时间', + align: 'center', + dataIndex: 'gmtCreate', + key: 'packageOrderId', + // render: (text: string) => { + // return
{text}
+ // } + }, + ]; // 优惠券弹窗 // const [couponModal, setCouponModal] = useState(false) // const [belongArray,setBelongArray] = useState([]) @@ -747,6 +840,20 @@ export default function Head() { }) } }, + { + key: 'package', + label: ( +
+ + 套餐包 +
+ ), + onClick: () => { + // setCouponModal(true) + setPackageModal(true) + setPackPage(1); + } + }, { key: 'logout', @@ -844,6 +951,7 @@ export default function Head() { { @@ -925,6 +1034,7 @@ export default function Head() { }} /> { setContactModal(false) }} setConcatPeopleInfo={setConcatPeopleInfo} concatPeopleInfo={concatPeopleInfo} setConcatValue={setConcatValue}> + { + setPackageModal(false) + + }}> + { + setPackPage(page); + // getPickList(page) + // console.log(page); + + + } + }} + rowKey="packageOrderId" + /> + ({ messageApi, - url: `/api/proj/servicepkg/packageorder/listpage/${pathParams.projChargeType}/self`, + url: `/api/proj/servicepkg/packageorder/listpage/self`, config: { params: { page: page, rows: 5, - + keYong : "keYong", + packageType: pathParams.projChargeType, } }, onBefore() { @@ -670,7 +671,7 @@ export default function ProjNew() { {/* 服务包 */}
@@ -713,23 +714,24 @@ export default function ProjNew() { /> -
{ - if (packList.length > 0) { - setPackModal(true) - setPage(1) - setSelectedRowKeys([]) - // #1F79FF - } else { - messageApi.error('无可用套餐包') - } +
{ + if (packList.length > 0) { + setPackModal(true) + setPage(1) + setSelectedRowKeys([]) + // #1F79FF + } else { + messageApi.error('无可用套餐包') + } - }}>选择
+ }}>选择
{ // setPackageInfoId('') setPackageOrderId('') @@ -763,10 +765,11 @@ export default function ProjNew() { -
{ +
{ if (hasCoupon) { setCouponModal(true) // #1F79FF @@ -840,7 +843,7 @@ export default function ProjNew() { name="belongPeople" rules={[{ required: true, message: '请选择/创建知识产权所属者' }]} > - +