Commit ae8914f5 authored by 武广's avatar 武广

feat: 添加企业客户

parent 9b63e7d9
import slash from 'slash2';
import defaultSettings from './defaultSettings'; // https://umijs.org/config/
import webpackPlugin from './plugin.config';
import groupMealRoute from './groupMealRoute';
const { pwa, primaryColor } = defaultSettings; // preview.pro.ant.design only do not use in your production ;
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
......@@ -286,6 +286,13 @@ export default {
name: 'businessInfo',
component: './businessManage/info',
},
{
title: '商户管理后台-商家资料',
path: '/businessInfo',
name: 'businessInfo',
component: './businessManage/info',
},
...groupMealRoute,
{
component: './404',
},
......
export default [
{
title: '商户管理后台-企业团餐-企业客户',
path: '/businessCustomer',
name: 'BusinessCustomer',
component: './businessCustomer/index',
},
];
import React from 'react';
import { Button, Form, Input, Alert, Cascader, Col, Row, Modal, Select } from 'antd';
import { layout } from '../model/index';
const CustomerInfo = props => {
const [form] = Form.useForm();
// 关闭分组信息弹窗
const handleCancel = () => {
props.handleClose(false);
};
// 添加/保存分组
const handleConfirm = async () => {};
const extra = <Alert message="选中后,顾客下单需至少选择1个“下单必选分组”" type="error" />;
return (
<Modal
title="企业客户信息"
visible={props.visible}
destroyOnClose
maskClosable={false}
width="800px"
onOk={handleConfirm}
onCancel={handleCancel}
>
<Form name="basic" {...layout} form={form}>
<Form.Item
label="公司名称"
name="name"
rules={[{ required: true, message: '请输入公司名称!' }]}
>
<Input />
</Form.Item>
<Form.Item label="下单必选分组" name="necessary" extra={extra}>
<Input />
</Form.Item>
<Form.Item
label="企业截止时间"
name="name"
rules={[{ required: true, message: '请输入企业截止时间!' }]}
>
<Input />
</Form.Item>
</Form>
</Modal>
);
};
export default CustomerInfo;
import React, { useState, useRef } from 'react';
import ProTable from '@ant-design/pro-table';
import { Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { customerColumn } from './model/index';
import CustomerInfo from './components/CustomerInfo';
const BusinessCustomer = () => {
const [visible, setVisible] = useState(true);
const query = async () => {};
const onEdit = async () => {};
return (
<div>
<ProTable
search={{
collapsed: false,
collapseRender: () => null,
}}
columns={customerColumn({ onEdit })}
request={params => query({ ...params })}
rowKey={r => r.id}
expandIconColumnIndex={10}
bordered
options={false}
toolBarRender={() => [
<Button key="3" icon={<PlusOutlined />} type="primary" onClick={onEdit}>
添加企业客户
</Button>,
]}
scroll={{ x: '100%', y: 400 }}
/>
<CustomerInfo visible={visible} />
</div>
);
};
export default BusinessCustomer;
import React from 'react';
import { Button } from 'antd';
export const customerColumn = options => {
const { onEdit } = options;
return [
{
title: 'ID',
dataIndex: 'name',
width: 120,
align: 'center',
},
{
title: '公司名称',
dataIndex: 'name',
width: 120,
align: 'center',
},
{
title: '截单时间(分钟)',
dataIndex: 'name',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '餐品类型',
dataIndex: 'name',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '创建人',
dataIndex: 'name',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '创建时间',
dataIndex: 'createdAt',
width: 120,
align: 'center',
hideInSearch: true,
},
{
title: '操作',
hideInSearch: true,
dataIndex: 'action',
width: 200,
align: 'center',
fixed: 'right',
render: (val, r) => (
<Button key="edit" onClick={() => onEdit(r, 'edit')}>
编辑
</Button>
),
},
];
};
export const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 18 },
};
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