样单订单

dev-v2
Joe 7 months ago
parent ca50e33f8f
commit b9452f9e20

@ -70,7 +70,7 @@ export default [
{
name: '角色管理',
path: '/role-list',
icon: 'bell',
icon: 'setting',
access: 'roleQuery',
component: './RoleList',
},
@ -96,7 +96,7 @@ export default [
{
name: '需求审核',
path: '/requirement',
icon: 'verified',
icon: 'SafetyCertificate',
access: 'requirementQuery',
routes: [
{
@ -115,7 +115,7 @@ export default [
{
name: '采购员管理',
path: '/purchase-agent',
icon: 'verified',
icon: 'UserSwitch',
routes: [
{
path: 'list',
@ -190,7 +190,7 @@ export default [
{
name: '商品管理',
path: '/product',
icon: 'book',
icon: 'skin',
routes: [
{
name: '商品类目管理',
@ -280,28 +280,28 @@ export default [
{
name: '字典管理',
path: '/dictionary-list',
icon: 'message',
icon: 'read',
access: 'dictionaryQuery',
component: './Dictionary',
},
{
name: '操作指引',
path: '/operating-instructions',
icon: 'message',
icon: 'FileSearch',
access: 'operateInstructionQuery',
component: './OperatingInstructions',
},
{
name: '流行趋势',
path: '/fashion-trend',
icon: 'message',
icon: 'rise',
access: 'fashionTrendQuery',
component: './FashionTrend',
},
{
name: '创新服务',
path: '/innovative-service',
icon: 'message',
icon: 'solution',
access: 'innovativeServiceQuery',
component: './InnovativeService',
},
@ -324,6 +324,44 @@ export default [
}
]
},
{
name: '样单管理',
path: '/sample',
icon: 'ShoppingCart',
access: 'sampleQuery',
routes: [
{
path: '',
name: '样单管理',
component: './SampleList',
},
{
name: '详情',
path: 'detail/:id',
hideInMenu: true,
component: './SampleList/detail',
},
],
},
{
name: '订单管理',
path: '/order',
icon: 'ShoppingCart',
access: 'orderQuery',
routes: [
{
path: '',
name: '订单管理',
component: './OrderList',
},
{
name: '详情',
path: 'detail/:id',
hideInMenu: true,
component: './OrderList/detail',
},
],
},
{ path: '/' },
{ path: '*', layout: false, component: './404' },
];

@ -166,6 +166,28 @@ const Constants = {
pbcBannerType: {
1: '平台首页',
},
// 订单状态枚举
orderStateEnum: {
1: { text: '预订单', status: 'warning' },
2: { text: '已配货', status: 'processing' },
3: { text: '已取消', status: 'default' },
4: { text: '已完成', status: 'success' },
} as any,
// 样单状态枚举
sampleStateEnum: {
1: { text: '待出样', status: 'warning' },
2: { text: '已发货', status: 'processing' },
3: { text: '已取消', status: 'default' },
4: { text: '已完成', status: 'success' },
} as any,
// 订单类型枚举
orderTypeEnum: {
1: { text: '到店自取', status: 'default' },
2: { text: '快递邮寄', status: 'processing' },
} as any,
// 手机正则
PHONE_PATTERN: /^(?:(0\d{2,3}-)?\d{7,8}|1[3-9]\d{9})$/,
//邮箱正则

@ -0,0 +1,170 @@
import Constants from '@/constants';
import { orderDetailForAdminUsingGet } from '@/services/pop-b2b2c/pbcOrderController';
import { isNumeric } from '@/utils/utils';
import { ProCard } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { useParams } from '@umijs/max';
import { Button, Descriptions, Table, Tag, Timeline } from 'antd';
import React, { useEffect, useState } from 'react';
const Detail: React.FC<any> = () => {
const params = useParams();
const [info, setInfo] = useState<API.PbcOrder_>({});
const getInfo = () => {
if (params.id) {
orderDetailForAdminUsingGet({ orderId: parseInt(params.id) }).then((res) => {
if (res.retcode && res.data) {
setInfo(res.data);
}
});
}
};
const columns = [
{
title: '商品名',
dataIndex: 'pbcProductName',
key: 'pbcProductName',
render: (text: string, item: API.PbcOrderItem_) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
{item.pbcProductImage && (
<img
src={item.pbcProductImage}
alt={item.pbcProductName}
style={{ width: 60, height: 60, marginRight: 12, objectFit: 'cover' }}
/>
)}
<div>
<div style={{ fontWeight: 'bold' }}>{text}</div>
<div>: {item.pbcSkuColorName || '默认'}</div>
</div>
</div>
),
},
{
title: '单价',
dataIndex: 'pbcSkuPrice',
key: 'pbcSkuPrice',
render: (text: any) => typeof text === 'number' || (typeof text === 'string' && isNumeric(text)) ? `¥${text}` : text,
width: 100,
},
{
title: '数量',
dataIndex: 'pbcSkuCnt',
key: 'pbcSkuCnt',
width: 80,
},
{
title: '总金额',
key: 'totalPrice',
render: (_: any, item: API.PbcOrderItem_) => typeof item.pbcSkuPrice === 'number' || (typeof item.pbcSkuPrice === 'string' && isNumeric(item.pbcSkuPrice)) ? `¥${Number(item.pbcSkuPrice) * (item.pbcSkuCnt || 0)}` : item.pbcSkuPrice,
width: 100,
},
{
title: '实付金额',
key: 'actualPrice',
render: () => `-`,
width: 100,
},
];
useEffect(() => {
getInfo();
}, []);
return (
<PageContainer
header={{
title: '',
}}
footer={[
<Button
key="back"
onClick={() => {
history.back();
}}
>
</Button>,
]}
>
<ProCard style={{ marginBottom: 12 }}>
<Descriptions
bordered
title={
<>
<span style={{ marginRight: 20 }}></span>
<Tag color={Constants.orderStateEnum[String(info.pbcOrderState || 1)]?.status}>
{Constants.orderStateEnum[String(info.pbcOrderState || 1)]?.text}
</Tag>
</>
}
column={3}
>
<Descriptions.Item label="订单编号">{info.pbcOrderNo}</Descriptions.Item>
<Descriptions.Item label="订单类型">
{Constants.orderTypeEnum[info.pbcOrderType || 1]?.text}
</Descriptions.Item>
<Descriptions.Item label="下单时间">{info.pbcCreateAt}</Descriptions.Item>
<Descriptions.Item label="所属商户">{info.pbcBusinessName}</Descriptions.Item>
<Descriptions.Item label="商户联系人">{info.pbcBusinessContact}</Descriptions.Item>
<Descriptions.Item label="联系电话">{info.pbcBusinessContactMobile}</Descriptions.Item>
<Descriptions.Item label="收货人">{info.pbcOrderReceiverName}</Descriptions.Item>
<Descriptions.Item label="联系电话">{info.pbcOrderReceiverPhone}</Descriptions.Item>
<Descriptions.Item label="收货地址">
{`${info.pbcOrderReceiverProvince || ''}${info.pbcOrderReceiverCity || ''}${info.pbcOrderReceiverArea || ''}${info.pbcOrderReceiverStreet || ''}${info.pbcOrderReceiverAddress || ''}`}
</Descriptions.Item>
{info.pbcOrderType === 2 && (
<>
<Descriptions.Item label="快递公司">{info.pbcOrderExpressCompanyName}</Descriptions.Item>
<Descriptions.Item label="快递单号">{info.pbcOrderExpressNo}</Descriptions.Item>
</>
)}
</Descriptions>
</ProCard>
<ProCard title="商品信息" style={{ marginBottom: 12 }}>
<Table
dataSource={info.orderItemList || []}
columns={columns}
pagination={false}
rowKey={(item) => item.pbcId || Math.random().toString(36).slice(2)}
size="small"
bordered
/>
</ProCard>
<ProCard title="物流信息">
<Timeline
mode="left"
items={[
{
label: info.pbcCreateAt,
children: '订单创建',
show: true,
},
{
label: info.pbcDistributionCompletionTime,
children: '商品已发货',
show: info.pbcOrderState && info.pbcOrderState >= 2
},
{
label: info.pbcOrderCompletionTime,
children: '订单已完成',
show: info.pbcOrderState === 4
},
{
label: info.pbcOrderCancelTime,
children: '订单已取消',
show: info.pbcOrderState === 3
},
].filter(item => item.show)}
/>
</ProCard>
</PageContainer>
);
};
export default Detail;

@ -0,0 +1,14 @@
.ant-list-item-action {
overflow: auto;
}
.ant-list-item-action li {
float: right;
}
.ant-pro-list-row-title {
cursor: unset;
}
.ant-pro-list-row-title:hover {
color: unset;
}

@ -0,0 +1,300 @@
import Constants from '@/constants';
import {
getOrderPageForAdminUsingPost,
exportOrderPageForAdminUsingPost,
deliverGoodForOrderAdminUsingGet,
confirmReceiveForOrderAdminUsingGet
} from '@/services/pop-b2b2c/pbcOrderController';
import { isNumeric } from '@/utils/utils';
import { ActionType, ProFormInstance, ProList } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, history, useAccess } from '@umijs/max';
import { Button, message, Tag, Table } from 'antd';
import React, { useRef, useState } from 'react';
import './index.less';
/**
*
* @param param0
*/
const fetchData = async (params: any) => {
const msg = await getOrderPageForAdminUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
success: msg.retcode,
} as any;
};
const handleExport = async (values?: API.PbcOrder_) => {
const hide = message.loading('正在处理', 0);
try {
await exportOrderPageForAdminUsingPost(
{ ...values },
{
responseType: 'blob',
getResponse: true,
parseResponse: false,
data: { ...values, fileName: '导出' },
},
);
hide();
return false;
} catch (error) {
console.log(error);
hide();
message.error('处理失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const access: any = useAccess();
const ref = useRef<ProFormInstance<API.PbcOrder_>>();
const [tabActiveKey, setTabActiveKey] = useState<string>('0'); // 默认显示全部样单
return (
<PageContainer
header={{
title: '',
breadcrumb: {},
}}
tabActiveKey={tabActiveKey}
onTabChange={(key) => setTabActiveKey(key)}
tabList={[
{
tab: "全部",
key: "0"
},
{
tab: "预订单",
key: "1"
},
{
tab: "已配货",
key: "2"
},
{
tab: "已完成",
key: "4"
},
{
tab: "已取消",
key: "3"
},
]}
>
<ProList<API.PbcOrder_>
rowKey="pbcId"
actionRef={actionRef}
formRef={ref}
itemLayout='vertical'
request={(param: any) => {
const queryParam = {
...param,
pbcOrderState: tabActiveKey !== '0' ? parseInt(tabActiveKey) : undefined
};
return fetchData(queryParam);
}}
pagination={{
defaultPageSize: 10,
showSizeChanger: true,
}}
search={{
labelWidth: 'auto',
span: 6,
}}
params={{ pbcOrderState: tabActiveKey !== '0' ? parseInt(tabActiveKey) : undefined }}
dateFormatter="string"
toolBarRender={() => [
<Access key="export" accessible={access.orderExport}>
<Button
type="primary"
onClick={() => {
const params = ref.current?.getFieldsValue();
handleExport(params);
}}
>
</Button>
</Access>,
]}
metas={{
pbcOrderNo: {
title: '订单编号',
},
productName: {
title: '商品名称',
},
pbcOrderReceiverName: {
title: '买家姓名',
},
pbcOrderReceiverPhone: {
title: '买家手机号',
},
pbcBusinessName: {
title: '所属商户',
},
pbcUpdateAt: {
search: {
transform: (value) => {
return {
expectedStartTime: value[0],
expectedEndTime: value[1] + ' 23:59:59',
};
},
},
valueType: 'dateRange',
title: '期望交货时间',
},
pbcCreateAt: {
search: {
transform: (value) => {
return {
startTime: value[0],
endTime: value[1] + ' 23:59:59',
};
},
},
valueType: 'dateRange',
title: '下单时间',
},
title: {
search: false,
render: (_, record) => (
<div style={{ display: 'flex', alignItems: 'center', width: '100%', fontSize: 14 }}>
<div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Tag color={Constants.orderStateEnum[String(record.pbcOrderState || 1)]?.status} style={{ marginRight: '8px' }}>
{Constants.orderStateEnum[String(record.pbcOrderState || 1)]?.text}
</Tag>
<Tag style={{ marginRight: '8px' }}>{Constants.orderTypeEnum[record.pbcOrderType || 1]?.text}</Tag>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderNo}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderReceiverName}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderReceiverPhone}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcExpectedDeliveryDate || '无'}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcCreateAt}</span>
<span style={{ marginLeft: 'auto' }}>: {record.pbcBusinessName}</span>
</div>
</div>
),
},
content: {
search: false,
render: (_, record) => {
const columns1 = [
{
title: '商品名',
dataIndex: 'pbcProductName',
key: 'pbcProductName',
render: (text: string, item: API.PbcOrderItem_) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
{item.pbcProductImage && (
<img
src={item.pbcProductImage}
alt={item.pbcProductName}
style={{ width: 60, height: 60, marginRight: 12, objectFit: 'cover' }}
/>
)}
<div>
<div style={{ fontWeight: 'bold' }}>{text}</div>
<div>: {item.pbcSkuColorName || '默认'}</div>
</div>
</div>
),
},
{
title: '单价',
dataIndex: 'pbcSkuPrice',
key: 'pbcSkuPrice',
render: (text: any) => typeof text === 'number' || (typeof text === 'string' && isNumeric(text)) ? `¥${text}` : text,
width: 100,
},
{
title: '数量',
dataIndex: 'pbcSkuCnt',
key: 'pbcSkuCnt',
width: 80,
},
{
title: '总金额',
key: 'totalPrice',
render: (_: any, item: API.PbcOrderItem_) => typeof item.pbcSkuPrice === 'number' || (typeof item.pbcSkuPrice === 'string' && isNumeric(item.pbcSkuPrice)) ? `¥${Number(item.pbcSkuPrice) * (item.pbcSkuCnt || 0)}` : item.pbcSkuPrice,
width: 100,
},
{
title: '实付金额',
key: 'actualPrice',
render: () => `-`,
width: 100,
},
];
return (
<Table
dataSource={record.orderItemList || []}
columns={columns1}
pagination={false}
rowKey={(item) => item.pbcId || Math.random().toString(36).slice(2)}
size="small"
bordered
/>
);
},
},
actions: {
render: (_, record) => [
<Button key="detail" onClick={() => history.push(`/order/detail/${record.pbcId}`)}></Button>,
<Access key="manage" accessible={access.orderManage}>
{record.pbcOrderState === 1 && (
<Button
type="primary"
onClick={() => {
deliverGoodForOrderAdminUsingGet({ orderId: record.pbcId || 0 }).then(
(res) => {
if (res.retcode) {
message.success('已配货完成');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
)}
{record.pbcOrderState === 2 && (
<Button
type="primary"
onClick={() => {
confirmReceiveForOrderAdminUsingGet({ orderId: record.pbcId || 0 }).then(
(res) => {
if (res.retcode) {
message.success('已完成交易');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
)}
</Access>
],
},
}}
headerTitle=""
/>
</PageContainer>
);
};
export default TableList;

@ -0,0 +1,170 @@
import Constants from '@/constants';
import { orderDetailForAdminUsingGet } from '@/services/pop-b2b2c/pbcOrderController';
import { isNumeric } from '@/utils/utils';
import { ProCard } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { useParams } from '@umijs/max';
import { Button, Descriptions, Table, Tag, Timeline } from 'antd';
import React, { useEffect, useState } from 'react';
const Detail: React.FC<any> = () => {
const params = useParams();
const [info, setInfo] = useState<API.PbcOrder_>({});
const getInfo = () => {
if (params.id) {
orderDetailForAdminUsingGet({ orderId: parseInt(params.id) }).then((res) => {
if (res.retcode && res.data) {
setInfo(res.data);
}
});
}
};
const columns = [
{
title: '商品名',
dataIndex: 'pbcProductName',
key: 'pbcProductName',
render: (text: string, item: API.PbcOrderItem_) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
{item.pbcProductImage && (
<img
src={item.pbcProductImage}
alt={item.pbcProductName}
style={{ width: 60, height: 60, marginRight: 12, objectFit: 'cover' }}
/>
)}
<div>
<div style={{ fontWeight: 'bold' }}>{text}</div>
<div>: {item.pbcSkuColorName || '默认'}</div>
</div>
</div>
),
},
{
title: '单价',
dataIndex: 'pbcSkuPrice',
key: 'pbcSkuPrice',
render: (text: any) => typeof text === 'number' || (typeof text === 'string' && isNumeric(text)) ? `¥${text}` : text,
width: 100,
},
{
title: '数量',
dataIndex: 'pbcSkuCnt',
key: 'pbcSkuCnt',
width: 80,
},
{
title: '总金额',
key: 'totalPrice',
render: (_: any, item: API.PbcOrderItem_) => typeof item.pbcSkuPrice === 'number' || (typeof item.pbcSkuPrice === 'string' && isNumeric(item.pbcSkuPrice)) ? `¥${Number(item.pbcSkuPrice) * (item.pbcSkuCnt || 0)}` : item.pbcSkuPrice,
width: 100,
},
{
title: '实付金额',
key: 'actualPrice',
render: () => `-`,
width: 100,
},
];
useEffect(() => {
getInfo();
}, []);
return (
<PageContainer
header={{
title: '',
}}
footer={[
<Button
key="back"
onClick={() => {
history.back();
}}
>
</Button>,
]}
>
<ProCard style={{ marginBottom: 12 }}>
<Descriptions
bordered
title={
<>
<span style={{ marginRight: 20 }}></span>
<Tag color={Constants.orderStateEnum[String(info.pbcOrderState || 1)]?.status}>
{Constants.orderStateEnum[String(info.pbcOrderState || 1)]?.text}
</Tag>
</>
}
column={3}
>
<Descriptions.Item label="订单编号">{info.pbcOrderNo}</Descriptions.Item>
<Descriptions.Item label="订单类型">
{Constants.orderTypeEnum[info.pbcOrderType || 1]?.text}
</Descriptions.Item>
<Descriptions.Item label="下单时间">{info.pbcCreateAt}</Descriptions.Item>
<Descriptions.Item label="所属商户">{info.pbcBusinessName}</Descriptions.Item>
<Descriptions.Item label="商户联系人">{info.pbcBusinessContact}</Descriptions.Item>
<Descriptions.Item label="联系电话">{info.pbcBusinessContactMobile}</Descriptions.Item>
<Descriptions.Item label="收货人">{info.pbcOrderReceiverName}</Descriptions.Item>
<Descriptions.Item label="联系电话">{info.pbcOrderReceiverPhone}</Descriptions.Item>
<Descriptions.Item label="收货地址">
{`${info.pbcOrderReceiverProvince || ''}${info.pbcOrderReceiverCity || ''}${info.pbcOrderReceiverArea || ''}${info.pbcOrderReceiverStreet || ''}${info.pbcOrderReceiverAddress || ''}`}
</Descriptions.Item>
{info.pbcOrderType === 2 && (
<>
<Descriptions.Item label="快递公司">{info.pbcOrderExpressCompanyName}</Descriptions.Item>
<Descriptions.Item label="快递单号">{info.pbcOrderExpressNo}</Descriptions.Item>
</>
)}
</Descriptions>
</ProCard>
<ProCard title="商品信息" style={{ marginBottom: 12 }}>
<Table
dataSource={info.orderItemList || []}
columns={columns}
pagination={false}
rowKey={(item) => item.pbcId || Math.random().toString(36).slice(2)}
size="small"
bordered
/>
</ProCard>
<ProCard title="物流信息">
<Timeline
mode="left"
items={[
{
label: info.pbcCreateAt,
children: '订单创建',
show: true,
},
{
label: info.pbcDistributionCompletionTime,
children: '商品已发货',
show: info.pbcOrderState && info.pbcOrderState >= 2
},
{
label: info.pbcOrderCompletionTime,
children: '订单已完成',
show: info.pbcOrderState === 4
},
{
label: info.pbcOrderCancelTime,
children: '订单已取消',
show: info.pbcOrderState === 3
},
].filter(item => item.show)}
/>
</ProCard>
</PageContainer>
);
};
export default Detail;

@ -0,0 +1,14 @@
.ant-list-item-action {
overflow: auto;
}
.ant-list-item-action li {
float: right;
}
.ant-pro-list-row-title {
cursor: unset;
}
.ant-pro-list-row-title:hover {
color: unset;
}

@ -0,0 +1,291 @@
import Constants from '@/constants';
import {
getOrderPageForAdminUsingPost,
confirmReceiveForAdminUsingGet,
deliverGoodForAdminUsingGet,
exportOrderPageForAdminUsingPost
} from '@/services/pop-b2b2c/pbcOrderController';
import { isNumeric } from '@/utils/utils';
import { ActionType, ProFormInstance, ProList } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, history, useAccess } from '@umijs/max';
import { Button, message, Tag, Table } from 'antd';
import React, { useRef, useState } from 'react';
import './index.less';
/**
*
* @param param0
*/
const fetchData = async (params: any) => {
const msg = await getOrderPageForAdminUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
success: msg.retcode,
} as any;
};
const handleExport = async (values?: API.PbcOrder_) => {
const hide = message.loading('正在处理', 0);
try {
await exportOrderPageForAdminUsingPost(
{ ...values },
{
responseType: 'blob',
getResponse: true,
parseResponse: false,
data: { ...values, fileName: '导出' },
},
);
hide();
return false;
} catch (error) {
console.log(error);
hide();
message.error('处理失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const access: any = useAccess();
const ref = useRef<ProFormInstance<API.PbcOrder_>>();
const [tabActiveKey, setTabActiveKey] = useState<string>('0'); // 默认显示全部样单
return (
<PageContainer
header={{
title: '',
breadcrumb: {},
}}
tabActiveKey={tabActiveKey}
onTabChange={(key) => setTabActiveKey(key)}
tabList={[
{
tab: "全部",
key: "0"
},
{
tab: "待出样",
key: "1"
},
{
tab: "已发货",
key: "2"
},
{
tab: "已完成",
key: "4"
},
{
tab: "已取消",
key: "3"
},
]}
>
<ProList<API.PbcOrder_>
rowKey="pbcId"
actionRef={actionRef}
formRef={ref}
itemLayout='vertical'
request={(param: any) => {
const queryParam = {
...param,
pbcOrderState: tabActiveKey !== '0' ? parseInt(tabActiveKey) : undefined
};
return fetchData(queryParam);
}}
pagination={{
defaultPageSize: 10,
showSizeChanger: true,
}}
search={{
labelWidth: 'auto',
span: 6,
}}
params={{ pbcOrderState: tabActiveKey !== '0' ? parseInt(tabActiveKey) : undefined }}
dateFormatter="string"
toolBarRender={() => [
<Access key="export" accessible={access.sampleExport}>
<Button
type="primary"
onClick={() => {
const params = ref.current?.getFieldsValue();
handleExport(params);
}}
>
</Button>
</Access>,
]}
metas={{
pbcOrderNo: {
title: '样单编号',
},
productName: {
title: '商品名称',
},
pbcOrderReceiverName: {
title: '买家姓名',
},
pbcOrderReceiverPhone: {
title: '买家手机号',
},
pbcBusinessName: {
title: '所属商户',
},
pbcOrderType: {
title: '发货方式',
render: (text: any) => Constants.orderTypeEnum[text]?.text,
},
pbcCreateAt: {
search: {
transform: (value) => {
return {
startTime: value[0],
endTime: value[1] + ' 23:59:59',
};
},
},
valueType: 'dateRange',
title: '下单时间',
},
title: {
search: false,
render: (_, record) => (
<div style={{ display: 'flex', alignItems: 'center', width: '100%', fontSize: 14 }}>
<div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Tag color={Constants.sampleStateEnum[String(record.pbcOrderState || 1)]?.status} style={{ marginRight: '8px' }}>
{Constants.sampleStateEnum[String(record.pbcOrderState || 1)]?.text}
</Tag>
<Tag style={{ marginRight: '8px' }}>{Constants.orderTypeEnum[record.pbcOrderType || 1]?.text}</Tag>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderNo}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderReceiverName}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcOrderReceiverPhone}</span>
<span style={{ marginRight: '16px' }}>: {record.pbcCreateAt}</span>
<span style={{ marginLeft: 'auto' }}>: {record.pbcBusinessName}</span>
</div>
</div>
),
},
content: {
search: false,
render: (_, record) => {
const columns1 = [
{
title: '商品名',
dataIndex: 'pbcProductName',
key: 'pbcProductName',
render: (text: string, item: API.PbcOrderItem_) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
{item.pbcProductImage && (
<img
src={item.pbcProductImage}
alt={item.pbcProductName}
style={{ width: 60, height: 60, marginRight: 12, objectFit: 'cover' }}
/>
)}
<div>
<div style={{ fontWeight: 'bold' }}>{text}</div>
<div>: {item.pbcSkuColorName || '默认'}</div>
</div>
</div>
),
},
{
title: '单价',
dataIndex: 'pbcSkuPrice',
key: 'pbcSkuPrice',
render: (text: any) => typeof text === 'number' || (typeof text === 'string' && isNumeric(text)) ? `¥${text}` : text,
width: 100,
},
{
title: '数量',
dataIndex: 'pbcSkuCnt',
key: 'pbcSkuCnt',
width: 80,
},
{
title: '总金额',
key: 'totalPrice',
render: (_: any, item: API.PbcOrderItem_) => typeof item.pbcSkuPrice === 'number' || (typeof item.pbcSkuPrice === 'string' && isNumeric(item.pbcSkuPrice)) ? `¥${Number(item.pbcSkuPrice) * (item.pbcSkuCnt || 0)}` : item.pbcSkuPrice,
width: 100,
},
{
title: '实付金额',
key: 'actualPrice',
render: () => `-`,
width: 100,
},
];
return (
<Table
dataSource={record.orderItemList || []}
columns={columns1}
pagination={false}
rowKey={(item) => item.pbcId || Math.random().toString(36).slice(2)}
size="small"
bordered
/>
);
},
},
actions: {
render: (_, record) => [
<Button key="detail" onClick={() => history.push(`/sample/detail/${record.pbcId}`)}></Button>,
<Access key="manage" accessible={access.sampleManage}>
{record.pbcOrderState === 1 && (
<Button
type="primary"
onClick={() => {
deliverGoodForAdminUsingGet({ orderId: record.pbcId || 0 }).then(
(res) => {
if (res.retcode) {
message.success('发货成功');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
)}
{record.pbcOrderState === 2 && (
<Button
type="primary"
onClick={() => {
confirmReceiveForAdminUsingGet({ orderId: record.pbcId || 0 }).then(
(res) => {
if (res.retcode) {
message.success('已出样完成');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
)}
</Access>
],
},
}}
headerTitle=""
/>
</PageContainer>
);
};
export default TableList;

@ -16,6 +16,23 @@ export async function deliverGoodForAdminUsingGet(
});
}
/** 卖家发货订单,如果类型是到店自取,则就是状态变成已发货;如果类型是邮寄,还需要生成快递 卖家 GET /b2b2c/pbcOrder/admin/deliverGoodForOrderAdmin/${param0} */
export async function deliverGoodForOrderAdminUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.deliverGoodForOrderAdminUsingGETParams,
options?: { [key: string]: any },
) {
const { orderId: param0, ...queryParams } = params;
return request<API.AjaxResultString_>(
`/b2b2c/pbcOrder/admin/deliverGoodForOrderAdmin/${param0}`,
{
method: 'GET',
params: { ...queryParams },
...(options || {}),
},
);
}
/** 买家取消订单。这里暂时限定只有待出样状态的订单才能够取消掉 GET /b2b2c/pbcOrder/cancelOrderForBuyer/${param0} */
export async function cancelOrderForBuyerUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
@ -58,6 +75,20 @@ export async function confirmReceiveForBuyerUsingGet(
});
}
/** 后台把订单状态更改为已完成,不做任何校验 买家 GET /b2b2c/pbcOrder/confirmReceiveForOrderAdmin/${param0} */
export async function confirmReceiveForOrderAdminUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.confirmReceiveForOrderAdminUsingGETParams,
options?: { [key: string]: any },
) {
const { orderId: param0, ...queryParams } = params;
return request<API.AjaxResultString_>(`/b2b2c/pbcOrder/confirmReceiveForOrderAdmin/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 卖家发货订单,如果类型是到店自取,则就是状态变成已发货;如果类型是邮寄,还需要生成快递 卖家 GET /b2b2c/pbcOrder/deliverGoodForBusiness/${param0} */
export async function deliverGoodForBusinessUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)

@ -89,7 +89,25 @@ export async function getPurchaseAgentPageUsingPost(
);
}
/** 前端获取采购员申请详情 前端 GET /b2b2c/pbcPurchaseAgentInfo/purchaseAgentDetail */
/** 前端根据id获取采购员申请详情 后台 GET /b2b2c/pbcPurchaseAgentInfo/front/purchaseAgentDetail */
export async function purchaseAgentDetailForFrontUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.purchaseAgentDetailForFrontUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcPurchaseAgentInfo_>(
'/b2b2c/pbcPurchaseAgentInfo/front/purchaseAgentDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** 前端获取采购员申请详情,获取活跃状态 前端 GET /b2b2c/pbcPurchaseAgentInfo/purchaseAgentDetail */
export async function purchaseAgentDetailUsingGet(options?: { [key: string]: any }) {
return request<API.AjaxResultPbcPurchaseAgentInfo_>(
'/b2b2c/pbcPurchaseAgentInfo/purchaseAgentDetail',

@ -1070,6 +1070,11 @@ declare namespace API {
orderId: number;
};
type confirmReceiveForOrderAdminUsingGETParams = {
/** orderId */
orderId: number;
};
type createQrCodeUsingGETParams = {
/** 类型 */
codeType: string;
@ -1117,6 +1122,11 @@ declare namespace API {
orderId: number;
};
type deliverGoodForOrderAdminUsingGETParams = {
/** orderId */
orderId: number;
};
type fashionTrendDetailForAdminUsingGETParams = {
/** pbcId */
pbcId: number;
@ -4509,6 +4519,11 @@ declare namespace API {
pbcId: number;
};
type purchaseAgentDetailForFrontUsingGETParams = {
/** pbcId */
pbcId: number;
};
type queryAuthorityUsingPOSTParams = {
/** roleId */
roleId: number;

@ -107,3 +107,8 @@ export const handlePageQuery = (
param.filters = filters;
return param;
};
// 判断字符串是否为数字
export const isNumeric = (str: string): boolean => {
return !isNaN(Number(str)) && !isNaN(parseFloat(str));
}
Loading…
Cancel
Save