Commit 6ddb7c73 authored by 武广's avatar 武广

feat: 添加外卖商品列表

parent ae933e1a
...@@ -5,4 +5,16 @@ export default [ ...@@ -5,4 +5,16 @@ export default [
name: 'BusinessCustomer', name: 'BusinessCustomer',
component: './businessCustomer/index', component: './businessCustomer/index',
}, },
{
title: '商户管理后台-企业团餐-外卖商品',
path: '/takeawayGoods',
name: 'TakeawayGoods',
component: './businessGoods/takeawayGoods',
},
{
title: '商户管理后台-企业团餐-虚拟商品',
path: '/virtualGoods',
name: 'VirtualGoods',
component: './businessGoods/virtualGoods',
},
]; ];
import React from 'react';
import { Button, Space, Switch } from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
export const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 18 },
};
// 0-推荐 1-早餐 2-午餐 3-下午茶 4-晚餐
export const mealColumn = {
// 0: '推荐',
1: '早餐',
2: '午餐',
// 3: '晚餐',
4: '晚餐',
};
export const takeawayGoodsColumn = options => {
const { onDel, companyEnum, shopEnum, onChangeFlag } = options;
return [
{
title: '企业名称',
dataIndex: 'enterpriseId',
hideInTable: true,
valueEnum: {}, // companyEnum,
},
{
title: '微店名称',
dataIndex: 'shopId',
hideInTable: true,
valueEnum: {}, // shopEnum,
},
{
title: 'SKU编码',
dataIndex: 'skuId',
width: 120,
align: 'center',
},
{
title: '商品名称',
dataIndex: 'skuName',
width: 120,
align: 'center',
},
{
title: '商品图片',
dataIndex: 'primaryImage',
width: 120,
align: 'center',
hideInSearch: true,
valueType: 'image',
},
{
title: '可售日期',
dataIndex: 'saleTimeType',
width: 120,
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<FormOutlined />
</span>
</Space>
),
},
{
title: '可售餐段',
dataIndex: 'saleDate',
width: 120,
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<FormOutlined />
</span>
</Space>
),
},
{
title: '企业价格',
dataIndex: 'activityPrice',
width: 120,
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<FormOutlined />
</span>
</Space>
),
},
{
title: '商品销售价',
dataIndex: 'price',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '状态',
dataIndex: 'status',
width: 120,
align: 'center',
hideInSearch: true,
valueEnum: {
1: '生效中',
2: '已下架',
3: '已售罄',
},
},
{
title: '排序',
dataIndex: 'sort',
width: 120,
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<FormOutlined />
</span>
</Space>
),
},
{
title: '列出商品',
dataIndex: 'showFlag',
width: 120,
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>
<Switch onChange={onChangeFlag} />
</span>
</Space>
),
},
{
title: '餐品类型',
dataIndex: 'mealType',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '添加时间',
dataIndex: 'createDate',
width: 120,
valueType: 'dateRange',
align: 'center',
},
{
title: '当日餐段',
dataIndex: 'tabId',
width: 120,
align: 'center',
valueEnum: mealColumn,
hideInTable: true,
},
{
title: '操作',
hideInSearch: true,
dataIndex: 'action',
width: '100px',
align: 'center',
fixed: 'right',
render: (val, r) => (
<Button key="del" onClick={() => onDel(r, 'del')}>
删除
</Button>
),
},
];
};
import React, { useState, useRef } from 'react';
import ProTable from '@ant-design/pro-table';
import { Button, Space } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { takeawayGoodsColumn } from './model/goods';
// import CustomerInfo from './components/CustomerInfo';
const BusinessCustomer = () => {
const [visible, setVisible] = useState(true);
const query = async () => {};
const onDel = async () => {};
return (
<div>
<ProTable
search={{
collapsed: false,
collapseRender: () => null,
}}
columns={takeawayGoodsColumn({ onDel })}
request={params => query({ ...params })}
rowKey={r => r.id}
expandIconColumnIndex={10}
bordered
// options={false}
tableAlertRender={() => (
<Space>
<Button>111</Button>
<Button>2222</Button>
</Space>
)}
scroll={{ x: '100%', y: 400 }}
/>
{/* <CustomerInfo visible={visible} /> */}
</div>
);
};
export default BusinessCustomer;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment