提交 b855706d 作者: ZhangLingKun

Merge remote-tracking branch 'origin/develop' into develop

import { InterFunction, InterListFunction } from '~/api/interface';
import { InterFunction, InterItemFunction, InterListFunction } from '~/api/interface';
// web 租赁订单-分页-列表
export type listOfRentalOrdersType = InterListFunction<
{
......@@ -403,6 +403,27 @@ export type refundOrderType = InterFunction<
},
NonNullable<unknown>
>;
//服务-订单
export type serviceOrderType = InterItemFunction<
{ startTime?: string; endTime?: string; orderStatus?: number; orderNameOrNo?: string },
{
id: number;
orderName: string;
orderNo: string;
orderStatus: number;
images: string[];
orderAmt: number;
phoneNum: string;
uid: string;
createdTime: string;
userName: string;
}[]
>;
// 服务-订单字典
export type serviceOrderStatusType = InterFunction<
any,
{ flyerPort: string; orderStatus: number; managePort: string; userPort: string }[]
>;
// 商城订单-订单状态-字典
export type orderListStatus = InterFunction<
NonNullable<unknown>,
......
......@@ -13,6 +13,8 @@ import {
refundOrderType,
renterTakeOrderType,
sendOrderWareType,
serviceOrderStatusType,
serviceOrderType,
} from '~/api/interface/orderManageType';
export class OrderManageAPI {
......@@ -66,4 +68,10 @@ export class OrderManageAPI {
// v1.0.0订单管理-分页查询(改版后)
static listPageManagerVerOne: listPageManagerVerOne = (params) =>
axios.post('/oms/pmorderVerOne/listPageManagerVerOne', params);
// 服务-订单
static getServiceOrderList: serviceOrderType = (data) =>
axios.post('/oms/serviceOrderTask/queryOrderTaskList', data);
// 服务-订单字典
static getServiceStatusList: serviceOrderStatusType = () =>
axios.post('/oms/serviceOrderTask/getServiceOrderStatus');
}
......@@ -450,7 +450,7 @@ const AddOrEditSkuModal: React.FC<ModalProps & selfProps> = ({
name='goodsSpecName'
rules={[{ required: true, message: '请输入规格名称' }]}
>
<Input placeholder='请输入规格名称' />
<Input placeholder='请输入规格名称' maxLength={30} />
</Form.Item>
{currentDesc != 2 && (
<Form.Item label='规格来源' name='flag'>
......
......@@ -286,6 +286,7 @@ const BaseInfo: React.FC<selfProps> = forwardRef(
placeholder='请选择所属目录'
style={{ width: '400px' }}
onChange={directorySelectChange}
disabled={!!goodsDetail}
>
{directoryList.map((v) => (
<Select.Option value={v.id} key={v.id}>
......
......@@ -97,6 +97,7 @@ const GoodsList = () => {
},
];
const [tableData, setTableData] = useState<goodsType>([]);
const [loading, setLoading] = useState<boolean>(false);
//分页
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
......@@ -128,12 +129,14 @@ const GoodsList = () => {
};
//商品列表
const getGoodsList = (query?: goodsSearchParameters) => {
setLoading(true);
GoodsAPI.getGoodsList({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
goodsType: 0,
...query,
}).then(({ result }) => {
setLoading(false);
setTableData(result.list || []);
pagination.totalCount = result.totalCount;
setPagination(pagination);
......@@ -251,6 +254,7 @@ const GoodsList = () => {
selectedRowKeys,
onChange: onSelectChange,
}}
loading={loading}
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
......
......@@ -9,6 +9,7 @@ import { InterDataType, InterReqType, PaginationProps } from '~/api/interface';
import { addProductType, productListType } from '~/api/interface/produceManageType';
import { categoryListType, directoryListType } from '~/api/interface/categoryManage';
import { MakeListType } from '~/api/interface/makeManage';
import { PlusOutlined } from '@ant-design/icons';
//产品列表返回类型
type produceListType = InterDataType<productListType>['list'];
......@@ -218,8 +219,8 @@ function ProduceManage() {
<div className='header-view'>
<Form name='basic' layout='inline' onFinish={onFinish}>
<Form.Item>
<Button type='primary' onClick={handleAdd}>
新增
<Button type='primary' onClick={handleAdd} icon={<PlusOutlined />}>
新增产品
</Button>
</Form.Item>
<Form.Item name='productName' label='产品名称'>
......
......@@ -96,6 +96,7 @@ const RentList = () => {
},
];
const [tableData, setTableData] = useState<goodsType>([]);
const [loading, setLoading] = useState<boolean>(false);
//分页
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
......@@ -127,12 +128,14 @@ const RentList = () => {
};
//商品列表
const getGoodsList = (query?: goodsSearchParameters) => {
setLoading(true);
GoodsAPI.getGoodsList({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
goodsType: 1,
...query,
}).then(({ result }) => {
setLoading(false);
setTableData(result.list || []);
pagination.totalCount = result.totalCount;
setPagination(pagination);
......@@ -250,6 +253,7 @@ const RentList = () => {
selectedRowKeys,
onChange: onSelectChange,
}}
loading={loading}
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
......
import { useState } from 'react';
import { useEffect, useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { Button, Image, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { useNavigate } from 'react-router-dom';
import qs from 'query-string';
import { OrderManageAPI } from '~/api';
import { InterDataType, InterReqType, PaginationProps } from '~/api/interface';
import { serviceOrderStatusType, serviceOrderType } from '~/api/interface/orderManageType';
import { filterObjAttr } from '~/utils';
// 表格数据类型
type TableType = any;
type TableType = InterDataType<serviceOrderType>['list'];
//服务-订单请求参数类型
type serviceOrderTypeParameters = Omit<InterReqType<serviceOrderType>, 'pageSize' | 'pageNo'>;
//字典返回类型
type serviceStatusType = InterDataType<serviceOrderStatusType>;
// 订单状态搜索列表
const statusCodeButtonList = [
{ value: -1, label: '全部订单' },
{ value: 0, label: '沟通意向' },
{ value: 1, label: '签约付款' },
{ value: 2, label: '待发货' },
{ value: 3, label: '待收货' },
{ value: 4, label: '已完成' },
{ value: 5, label: '已关闭' },
{ value: 0, label: '待付款' },
{ value: 1, label: '待验收' },
{ value: 2, label: '已完成' },
{ value: 3, label: '已取消' },
];
function ServiceOrderView() {
......@@ -25,123 +31,178 @@ function ServiceOrderView() {
// 当前选择的是第几个按钮
const [statusCodeButtonIndex, setStatusCodeButtonIndex] = useState<number>(0);
// 表格分页配置
const [pagination] = useState({
total: 0,
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
totalCount: 0,
pageSize: 10,
current: 1,
totalPage: 0,
pageNo: 1,
});
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 订单状态筛选
const statusChangeEvent = (i: number) => {
console.log('订单状态筛选 --->', i);
setStatusCodeButtonIndex(i);
};
// 跳转订单详情
const handleDetail = (record: TableType[0]) => {
console.log('跳转订单详情 --->', record.id);
navigate(`/orderManage/serviceOrder/detail?${qs.stringify({ id: record.id })}`);
};
const [tableData, setTableData] = useState<TableType>([]);
//服务订单-字典
const [serviceStatusList, setServiceStatusList] = useState<serviceStatusType>([]);
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '商品',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
width: 250,
render: (_text, record) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
{/*<Image src={record.images[0]} style={{ width: 48, height: 48 }} />*/}
<div style={{ marginLeft: 10, textAlign: 'left', lineHeight: '16px' }}>
<div style={{ color: '#1677ff' }}>{record.orderName}</div>
<div>订单编号:{record.orderNo}</div>
<div>创建时间:{record.createdTime}</div>
</div>
</div>
),
},
{
title: '单价(元)',
dataIndex: 'userName',
dataIndex: 'orderAmt',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => `¥${text.toLocaleString()}`,
},
{
title: '数量',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '买家',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
width: '130px',
render: (_text, record) => (
<>
<div>{record.uid}</div>
<div>
{record.userName}({record.phoneNum})
</div>
</>
),
},
{
title: '订单状态',
dataIndex: 'userName',
dataIndex: 'orderStatus',
align: 'center',
render: (_text, _record) => `--`,
render: (text) => serviceStatusList.find((v) => v.orderStatus === text)?.managePort || '',
},
{
title: '实收款',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '相关运营',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '推荐人',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单交期',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '备注',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
render: (_text, record) => (
<>
<Button type={'link'} onClick={() => handleDetail(record)}>
详情
</Button>
</>
),
},
// {
// title: '操作',
// align: 'center',
// fixed: 'right',
// render: (_text, record) => (
// <>
// <Button type={'link'} onClick={() => handleDetail(record)}>
// 详情
// </Button>
// </>
// ),
// },
];
//筛选数据
const [query, setQuery] = useState<serviceOrderTypeParameters>();
// 订单状态筛选
const statusChangeEvent = (i: number) => {
setStatusCodeButtonIndex(i);
pagination.pageNo = 1;
setQuery({
...query,
orderStatus: statusCodeButtonList[i].value === -1 ? undefined : statusCodeButtonList[i].value,
});
getServiceOrderList({
...query,
orderStatus: statusCodeButtonList[i].value === -1 ? undefined : statusCodeButtonList[i].value,
});
};
// 跳转订单详情
const handleDetail = (record: TableType[0]) => {
navigate(`/orderManage/serviceOrder/detail?${qs.stringify({ id: record.id })}`);
};
//服务订单列表
const getServiceOrderList = (query?: serviceOrderTypeParameters) => {
OrderManageAPI.getServiceOrderList({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
...query,
}).then(({ result }) => {
setTableData(result.list || []);
pagination.totalCount = result.totalCount;
setPagination(pagination);
});
};
//服务-订单字典
const getServiceStatusList = () => {
OrderManageAPI.getServiceStatusList().then(({ result }) => {
setServiceStatusList(result);
});
};
//分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
pagination.pageSize = pageSize;
getServiceOrderList(query);
};
//筛选
const searchSuccess = (value: any) => {
setQuery(filterObjAttr(value, ['time']));
pagination.pageNo = 1;
getServiceOrderList(filterObjAttr(value, ['time']));
};
useEffect(() => {
getServiceStatusList();
getServiceOrderList();
}, []);
return (
<>
<SearchBox
search={[
{
label: '订单编号',
name: 'keyword',
name: 'orderNameOrNo',
type: 'input',
placeholder: '请输入订单编号',
},
{
label: '买家账号',
name: 'keyword2',
type: 'input',
placeholder: '请输入用户账号',
},
{
label: '相关销售',
name: 'saleId',
type: 'Select',
placeholder: '请选择相关销售',
options: [],
},
// {
// label: '买家账号',
// name: 'keyword2',
// type: 'input',
// placeholder: '请输入用户账号',
// },
// {
// label: '相关销售',
// name: 'saleId',
// type: 'Select',
// placeholder: '请选择相关销售',
// options: [],
// },
{
label: '时间',
name: 'time',
......@@ -149,7 +210,7 @@ function ServiceOrderView() {
placeholder: '请选择创建时间',
},
]}
searchData={(e: any) => console.log('提交数据 --->', e)}
searchData={searchSuccess}
sufFixBtn={
<>
{statusCodeButtonList?.map((i, j) => {
......@@ -174,13 +235,12 @@ function ServiceOrderView() {
rowKey='id'
scroll={{ x: 1200 }}
pagination={{
total: pagination.total,
total: pagination.totalCount,
pageSize: pagination.pageSize,
current: pagination.current,
current: pagination.pageNo,
showSizeChanger: true,
showQuickJumper: true,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
......
......@@ -236,35 +236,35 @@ export const routerList: Array<RouteObjectType> = [
title: '课程管理',
},
},
{
path: '/mallManage/serviceList',
element: withLoadingComponent(<ServiceListView />),
meta: {
id: 10110,
icon: <SmileOutlined />,
title: '服务管理',
},
},
{
path: '/mallManage/serviceDetail',
element: withLoadingComponent(<ServiceDetailView />),
meta: {
id: 10120,
icon: <SmileOutlined />,
title: '服务详情',
hidden: true,
},
},
{
path: '/mallManage/serviceIntroduce',
element: withLoadingComponent(<ServiceIntroduceView />),
meta: {
id: 10120,
icon: <SmileOutlined />,
title: '服务介绍',
hidden: true,
},
},
// {
// path: '/mallManage/serviceList',
// element: withLoadingComponent(<ServiceListView />),
// meta: {
// id: 10110,
// icon: <SmileOutlined />,
// title: '服务管理',
// },
// },
// {
// path: '/mallManage/serviceDetail',
// element: withLoadingComponent(<ServiceDetailView />),
// meta: {
// id: 10120,
// icon: <SmileOutlined />,
// title: '服务详情',
// hidden: true,
// },
// },
// {
// path: '/mallManage/serviceIntroduce',
// element: withLoadingComponent(<ServiceIntroduceView />),
// meta: {
// id: 10120,
// icon: <SmileOutlined />,
// title: '服务介绍',
// hidden: true,
// },
// },
{
path: '/mallManage/rentGoods',
element: withLoadingComponent(<RentListView />),
......@@ -509,173 +509,173 @@ export const routerList: Array<RouteObjectType> = [
},
],
},
{
path: '/pointManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 25000,
icon: <AccountBookOutlined />,
title: '积分管理',
},
children: [
{
path: '/pointManage/pointList',
element: withLoadingComponent(<PointList />),
meta: {
id: 25100,
title: '积分列表',
icon: <MacCommandOutlined />,
},
},
{
path: '/pointManage/pointList/detail',
element: withLoadingComponent(
<PointDetail
location={{
search: '',
}}
/>,
),
meta: {
id: 25100,
title: '个人积分明细',
icon: <MacCommandOutlined />,
hidden: true,
},
},
{
path: '/pointManage/pointRule',
element: withLoadingComponent(<PointRules />),
meta: {
id: 25200,
title: '兑换规则',
icon: <MacCommandOutlined />,
},
},
{
path: '/pointManage/pointList/list',
element: withLoadingComponent(
<PointDetailList
location={{
search: '',
}}
/>,
),
meta: {
id: 25100,
title: '积分明细',
icon: <MacCommandOutlined />,
hidden: true,
},
},
{
path: '/pointManage/divideOrder',
element: withLoadingComponent(<DivideOrder />),
meta: {
id: 25300,
title: '订单分成',
icon: <MacCommandOutlined />,
},
},
{
path: '/pointManage/divideRules',
element: withLoadingComponent(<DivideRules />),
meta: {
id: 25400,
title: '分成规则',
icon: <MacCommandOutlined />,
hidden: true,
},
},
],
},
{
path: '/couponManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 26000,
icon: <PayCircleOutlined />,
title: '优惠券管理',
},
children: [
{
path: '/couponManage/couponList',
element: withLoadingComponent(<CouponList />),
meta: {
id: 26100,
title: '活动优惠券',
icon: <PayCircleOutlined />,
},
},
{
path: '/couponManage/couponList/detail',
element: withLoadingComponent(
<CouponDetail
location={{
search: '',
}}
/>,
),
meta: {
id: 26100,
title: '活动优惠券操作',
icon: <PayCircleOutlined />,
hidden: true,
},
},
{
path: '/couponManage/splitCouponList',
element: withLoadingComponent(<SplitCouponList />),
meta: {
id: 26200,
title: '裂变优惠券',
icon: <PayCircleOutlined />,
},
},
{
path: '/couponManage/addOrEditOrDetail',
element: withLoadingComponent(<SplitCouponOperate />),
meta: {
id: 26200,
title: '裂变优惠券操作',
icon: <PayCircleOutlined />,
hidden: true,
},
},
{
path: '/couponManage/couponDetailed',
element: withLoadingComponent(<CouponDetailed />),
meta: {
id: 26300,
title: '优惠券明细',
icon: <PayCircleOutlined />,
},
},
],
},
{
path: '/activityManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 19000,
icon: <GiftOutlined />,
title: '活动管理',
},
children: [
{
path: '/activityManage/activityList',
element: withLoadingComponent(<ActivityList />),
meta: {
id: 19100,
title: '活动列表',
icon: <GiftOutlined />,
},
},
],
},
// {
// path: '/pointManage',
// element: <LayoutView />,
// errorElement: <ErrorPage />,
// meta: {
// id: 25000,
// icon: <AccountBookOutlined />,
// title: '积分管理',
// },
// children: [
// {
// path: '/pointManage/pointList',
// element: withLoadingComponent(<PointList />),
// meta: {
// id: 25100,
// title: '积分列表',
// icon: <MacCommandOutlined />,
// },
// },
// {
// path: '/pointManage/pointList/detail',
// element: withLoadingComponent(
// <PointDetail
// location={{
// search: '',
// }}
// />,
// ),
// meta: {
// id: 25100,
// title: '个人积分明细',
// icon: <MacCommandOutlined />,
// hidden: true,
// },
// },
// {
// path: '/pointManage/pointRule',
// element: withLoadingComponent(<PointRules />),
// meta: {
// id: 25200,
// title: '兑换规则',
// icon: <MacCommandOutlined />,
// },
// },
// {
// path: '/pointManage/pointList/list',
// element: withLoadingComponent(
// <PointDetailList
// location={{
// search: '',
// }}
// />,
// ),
// meta: {
// id: 25100,
// title: '积分明细',
// icon: <MacCommandOutlined />,
// hidden: true,
// },
// },
// {
// path: '/pointManage/divideOrder',
// element: withLoadingComponent(<DivideOrder />),
// meta: {
// id: 25300,
// title: '订单分成',
// icon: <MacCommandOutlined />,
// },
// },
// {
// path: '/pointManage/divideRules',
// element: withLoadingComponent(<DivideRules />),
// meta: {
// id: 25400,
// title: '分成规则',
// icon: <MacCommandOutlined />,
// hidden: true,
// },
// },
// ],
// },
// {
// path: '/couponManage',
// element: <LayoutView />,
// errorElement: <ErrorPage />,
// meta: {
// id: 26000,
// icon: <PayCircleOutlined />,
// title: '优惠券管理',
// },
// children: [
// {
// path: '/couponManage/couponList',
// element: withLoadingComponent(<CouponList />),
// meta: {
// id: 26100,
// title: '活动优惠券',
// icon: <PayCircleOutlined />,
// },
// },
// {
// path: '/couponManage/couponList/detail',
// element: withLoadingComponent(
// <CouponDetail
// location={{
// search: '',
// }}
// />,
// ),
// meta: {
// id: 26100,
// title: '活动优惠券操作',
// icon: <PayCircleOutlined />,
// hidden: true,
// },
// },
// {
// path: '/couponManage/splitCouponList',
// element: withLoadingComponent(<SplitCouponList />),
// meta: {
// id: 26200,
// title: '裂变优惠券',
// icon: <PayCircleOutlined />,
// },
// },
// {
// path: '/couponManage/addOrEditOrDetail',
// element: withLoadingComponent(<SplitCouponOperate />),
// meta: {
// id: 26200,
// title: '裂变优惠券操作',
// icon: <PayCircleOutlined />,
// hidden: true,
// },
// },
// {
// path: '/couponManage/couponDetailed',
// element: withLoadingComponent(<CouponDetailed />),
// meta: {
// id: 26300,
// title: '优惠券明细',
// icon: <PayCircleOutlined />,
// },
// },
// ],
// },
// {
// path: '/activityManage',
// element: <LayoutView />,
// errorElement: <ErrorPage />,
// meta: {
// id: 19000,
// icon: <GiftOutlined />,
// title: '活动管理',
// },
// children: [
// {
// path: '/activityManage/activityList',
// element: withLoadingComponent(<ActivityList />),
// meta: {
// id: 19100,
// title: '活动列表',
// icon: <GiftOutlined />,
// },
// },
// ],
// },
{
path: '/systemManage',
element: <LayoutView />,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论