Commit ad5992ff authored by 武广's avatar 武广

feat: 对接企业外卖、虚拟商品接口

parent 04c231d7
......@@ -12,9 +12,11 @@ import {
Modal,
Select,
message,
notification,
} from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
import moment from 'moment';
import {
layout,
mealType,
......@@ -23,7 +25,12 @@ import {
infoOptions,
mealSections,
} from '../staticData/index';
import { apiEnterpriseInfo, apiNewEnterprise, apiEditEnterprise } from '../service';
import {
apiEnterpriseInfo,
apiNewEnterprise,
apiEditEnterprise,
apiEnterprisePickSelf,
} from '../service';
import style from '../style/info.less';
import MealSection from './MealSection';
import MealLimit from './MealLimit';
......@@ -35,29 +42,91 @@ const CustomerInfo = props => {
const [form] = Form.useForm();
const [meals, setMeals] = useState({});
const [mealTypes, setMealTypes] = useState([]);
const [pickSelfList, setPickSelfList] = useState([]);
// 关闭分组信息弹窗
const handleCancel = () => {
props.handleClose(false);
};
// 添加/保存分组
// 校验时间
const checkTime = (arr, curren) => {
let valid = false;
arr.forEach(item => {
if (curren > item.beginTime && curren < item.endTime) {
valid = true;
}
});
return valid;
};
// 提交
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
// const res = await form.getFieldsValue();
if (res.mealTimePeriod.length < 1) {
message.warn('请选择餐段');
return;
}
const params = Object.assign({}, res);
const params = Object.assign(
{
hideImage: 0,
},
res,
);
const arr = [];
let validTime = false;
res.mealTimePeriod.forEach(item => {
if (item.mealPeriodType) {
arr.push(item);
const obj = Object.assign({}, item);
obj.beginTime = moment(obj.time[0]).format('HH:mm');
obj.endTime = moment(obj.time[1]).format('HH:mm');
delete obj.time;
if (checkTime(arr, obj.beginTime) || checkTime(arr, obj.endTime)) {
validTime = true;
}
arr.push(obj);
}
});
if (validTime) {
notification.error({ message: '时间段不能交叉!' });
return;
}
params.mealTimePeriod = arr;
console.log('res :>> ', res);
if (res.hideInfo && res.hideInfo.length) {
params.hidePrice = res.hideInfo.includes('hidePrice') ? 1 : 0;
params.hideImage = res.hideInfo.includes('hideImage') ? 1 : 0;
delete params.hideInfo;
}
const limits = [];
if (!res.mealLimit) {
notification.error({ message: '请输入限额!' });
return;
}
// 处理限额
Object.keys(res.mealLimit).forEach(item => {
const json = {
mealPeriodType: item.replace('limit', ''),
limit: [],
};
Object.keys(res.mealLimit[item]).forEach(t => {
json.limit.push({
mealType: t,
limit: res.mealLimit[item][t],
});
});
limits.push(json);
});
params.mealLimit = limits;
console.log('params :>> ', params);
// let api = apiNewEnterprise;
// if (props.id) {
// params.id = props.id;
// api = apiEditEnterprise;
// }
// await api(params);
notification.success({ message: '保存成功!' });
};
// 风险提示
......@@ -86,25 +155,25 @@ const CustomerInfo = props => {
}
if (mealTypes.includes('1') && mealTypes.includes('2')) {
if (!(ms.includes('1') && ms.includes('2'))) {
if (ms.includes('3')) {
ms = ['3'];
if (ms.includes('4')) {
ms = ['4'];
} else {
ms = [];
}
}
} else if (ms.length < 3 && ms.length) {
ms = ['1', '2'];
if (ms.includes('3')) {
ms.push('3');
if (ms.includes('4')) {
ms.push('4');
}
}
form.setFieldsValue({
types: ms,
mealType: ms,
});
setMealTypes(ms);
} catch {
form.setFieldsValue({
types: mealTypes,
mealType: mealTypes,
});
}
};
......@@ -126,14 +195,57 @@ const CustomerInfo = props => {
setMeals(values);
};
// 获取企业客户
// 获取企业客户信息
const getInfo = async () => {
const res = await apiEnterpriseInfo(1);
const res = await apiEnterpriseInfo(props.id);
const obj = Object.assign({}, res);
if (res.mealTimePeriod && res.mealTimePeriod.length) {
obj.mealTimePeriod = res.mealTimePeriod.map(item => ({
mealPeriodType: `${item.mealPeriodType}`,
time: [moment(item.beginTime), moment(item.endTime)],
}));
} else {
obj.mealTimePeriod = [];
}
if (res.mealLimit) {
obj.mealLimit = {};
res.mealLimit.forEach(item => {
obj.mealLimit[`limit${item.mealPeriodType}`] = {};
item.limit.forEach(limit => {
obj.mealLimit[`limit${item.mealPeriodType}`][limit.mealType] = limit.limit;
});
});
}
obj.hideInfo = [];
if (+res.hidePrice) {
obj.hideInfo.push('hidePrice');
}
if (+res.hideImage) {
obj.hideInfo.push('hideImage');
}
obj.mealType = res.mealType.map(item => `${item}`);
form.setFieldsValue(obj);
};
// 获取自提点列表
const getPickSelf = async () => {
const res = await apiEnterprisePickSelf({});
setPickSelfList(
res.map(item => ({
[item.id]: { text: item.name },
})),
);
};
useEffect(() => {
if (props.visible) {
getInfo();
if (props.id) {
getInfo();
} else {
getPickSelf();
}
} else {
form.setFieldsValue({});
}
}, [props.visible]);
......@@ -143,7 +255,7 @@ const CustomerInfo = props => {
open={props.visible}
destroyOnClose
maskClosable={false}
width="880px"
width="900px"
onOk={handleConfirm}
onCancel={handleCancel}
>
......@@ -160,9 +272,11 @@ const CustomerInfo = props => {
>
<Input />
</Form.Item>
<Form.Item label="企业取餐点" name="pickselfIds">
<Select />
</Form.Item>
{!props.id && (
<Form.Item label="企业取餐点" name="pickselfIds">
<Select options={pickSelfList} />
</Form.Item>
)}
<Form.Item
label="企业截止时间"
name="endOrderTime"
......@@ -194,17 +308,32 @@ const CustomerInfo = props => {
<Divider orientation="left" plain>
企业单笔消费限额
</Divider>
{Object.keys(meals).map(meal => (
<Form.Item label={meals[meal]} key={meal} required wrapperCol={{ span: 20 }}>
<Row>
{mealTypes.map((t, i) => (
<Col span={7} offset={i ? 1 : 0} key={t}>
<MealLimit value={t} label={mealType[t]} name={`${meal}-${t.value}`} />
</Col>
<Form.List name="mealLimit">
{fields => (
<>
{Object.keys(meals).map(meal => (
<Form.Item label={`${mealSections[meal]}订单`} required wrapperCol={{ span: 20 }}>
<Form.List
name={`limit${meal}`}
key={`${meal}limit`}
required
wrapperCol={{ span: 20 }}
>
{fs => (
<Row key={`row${meal}`}>
{mealTypes.map((t, i) => (
<Col span={7} offset={i ? 1 : 0} key={t}>
<MealLimit value={t} label={mealType[t]} name={`${t}`} />
</Col>
))}
</Row>
)}
</Form.List>
</Form.Item>
))}
</Row>
</Form.Item>
))}
</>
)}
</Form.List>
<Form.Item label="商品隐藏信息" name="hideInfo">
<CheckboxGroup options={hideOptions} />
</Form.Item>
......
......@@ -44,3 +44,14 @@ export async function apiEditEnterprise(data) {
prefix: goodsApi,
});
}
/**
* 查询自提点列表
* http://yapi.quantgroups.com/project/389/interface/api/65494
*/
export async function apiEnterprisePickSelf(data) {
return request.post('/api/consoles/selfPickUpLocation/list', {
data,
prefix: goodsApi,
});
}
import React, { useState } from 'react';
import { Form, InputNumber, Modal } from 'antd';
import React, { useEffect } from 'react';
import { Form, InputNumber, Modal, notification } from 'antd';
import { layout } from '../staticData/goods';
import { isCheckPriceTwoDecimal } from '@/utils/validator';
import { apiMealInfoUpdate } from '../service';
const SaleDateModal = props => {
const [form] = Form.useForm();
......@@ -15,8 +16,22 @@ const SaleDateModal = props => {
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
const params = {
id: props.id,
enterprisePrice: res.price,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
handleCancel();
props.handleRefresh();
};
useEffect(() => {
if (props.visible) {
form.setFieldsValue({ price: null });
}
}, [props.visible]);
return (
<Modal
title="修改企业商品价格"
......@@ -24,13 +39,14 @@ const SaleDateModal = props => {
destroyOnClose
maskClosable={false}
width="300px"
okText="保存"
onOk={handleConfirm}
onCancel={handleCancel}
>
<Form name="basicInfo" {...layout} form={form}>
<Form.Item
label="企业商品价格"
name="types"
name="price"
rules={[
{ required: true, message: '请输入企业商品价格!' },
{ validator: isCheckPriceTwoDecimal, message: '请输入正确的价格' },
......
import React, { useState } from 'react';
import { Form, InputNumber, Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
import React, { useEffect } from 'react';
import { Form, InputNumber, Modal, notification } from 'antd';
import { layout } from '../staticData/goods';
import { isCheckPriceTwoDecimal } from '@/utils/validator';
import { apiMealInfoUpdate } from '../service';
const SaleDateModal = props => {
const [form] = Form.useForm();
const [value, setValue] = useState(1);
// 关闭弹窗
const handleCancel = () => {
props.handleClose(false);
};
const onChangeWeek = e => {
setValue(e.target.value);
};
// 提交
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
const params = {
id: props.id,
sort: res.sort,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
handleCancel();
props.handleRefresh();
};
useEffect(() => {
if (props.visible) {
form.setFieldsValue({ sort: null });
}
}, [props.visible]);
return (
<Modal
title="修改商品排序"
......@@ -31,6 +38,7 @@ const SaleDateModal = props => {
destroyOnClose
maskClosable={false}
width="300px"
okText="保存"
onOk={handleConfirm}
onCancel={handleCancel}
>
......
import React, { useState } from 'react';
import { Form, Checkbox, Space, Col, Row, Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
import React, { useState, useEffect } from 'react';
import { Checkbox, Space, message, Modal, notification } from 'antd';
import { weekOptions } from '../staticData/goods';
import { apiMealInfoUpdate } from '../service';
const SaleDateModal = props => {
const [form] = Form.useForm();
const [value, setValue] = useState([]);
// 关闭弹窗
......@@ -19,10 +17,28 @@ const SaleDateModal = props => {
// 提交
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
if (!value || value.length < 1) {
message.error('请选择可售日期');
return;
}
if (props.id) {
const params = {
id: props.id,
saleDateList: value,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
}
handleCancel();
props.handleRefresh(value);
};
useEffect(() => {
if (props.visible) {
setValue([]);
}
}, [props.visible]);
return (
<Modal
title={props.title || '设置可售日期'}
......@@ -30,6 +46,7 @@ const SaleDateModal = props => {
destroyOnClose
maskClosable={false}
width="200px"
okText="保存"
onOk={handleConfirm}
onCancel={handleCancel}
>
......
import React, { useState } from 'react';
import { Form, Input, Checkbox, Space, Col, Row, Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
import React, { useState, useEffect } from 'react';
import { Form, Checkbox, Space, Modal, notification, message } from 'antd';
import { mealColumn } from '../staticData/goods';
import { apiMealInfoUpdate } from '../service';
const SaleDateModal = props => {
const [form] = Form.useForm();
......@@ -19,10 +18,28 @@ const SaleDateModal = props => {
// 提交
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
if (!value || value.length < 1) {
message.error('请选择餐段');
return;
}
if (props.id) {
const params = {
id: props.id,
tabIds: value,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
}
handleCancel();
props.handleRefresh(value);
};
useEffect(() => {
if (props.visible) {
setValue([]);
}
}, [props.visible]);
return (
<Modal
title={props.title || '修改可售餐段'}
......@@ -30,6 +47,7 @@ const SaleDateModal = props => {
destroyOnClose
maskClosable={false}
width="200px"
okText="保存"
onOk={handleConfirm}
onCancel={handleCancel}
>
......
import React, { useState } from 'react';
import { Form, Select, Modal, Table, Input, Button, Pagination } from 'antd';
import React, { useState, useEffect } from 'react';
import { Select, Modal, Table, Input, Button, Pagination, notification } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
import { apiTakeawayList } from '../service';
import { SelectGoodsColumn } from '../staticData/goods';
import { apiSelGoodsList, apiSelVirtualGoodsList } from '../service';
import { getShopListByPickSelf } from '../service/bll';
import { SelectGoodsColumn, productType } from '../staticData/goods';
import style from '../style/index.less';
import { jsonToArray, deepClone } from '@/utils/utils';
const { Option } = Select;
const SaleDateModal = props => {
const [form] = Form.useForm();
const [searchType, setSearchType] = useState('1');
const [searchKeyword, setSearchKeyword] = useState('');
const [goodsType, setGoodsType] = useState('1');
const [shopId, setShopId] = useState('');
const [searchName, setSearchName] = useState('');
const [loading, setLoading] = useState(false);
const [page, setPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [dataSource, setDataSource] = useState([]);
const [shopList, setShopList] = useState(jsonToArray(productType));
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [selectedRows, setSelectedRows] = useState([]);
const searchList = async params => {
console.log('params :>> ', params);
console.log('searchType :>> ', searchType);
// const data = {
// page: params.current,
// size: params.pageSize,
// data: params,
// };
// return apiTakeawayList(data);
console.log('shopId :>> ', shopId);
const { enterpriseId } = props;
const searchObj = {};
if (searchKeyword && searchType && !params.search) {
if (searchType === '1') {
searchObj.name = searchKeyword;
} else {
searchObj.skuId = searchKeyword;
}
}
const data = {
page: params.current || page,
size: params.pageSize || pageSize,
data: Object.assign(
{
shopId,
productType,
enterpriseId,
},
searchObj,
params,
),
};
setLoading(true);
let api = apiSelGoodsList;
if (props.type === 'virtual') {
api = apiSelVirtualGoodsList;
}
const res = await api(data);
setDataSource(res);
setLoading(false);
};
// 点击搜索
const onSearch = () => {
setSearchKeyword(searchName);
searchList({ [searchType === '1' ? 'name' : 'skuId']: searchName });
};
// 切换店铺
const onChangeShop = v => {
setShopId(v);
searchList({
shopId: v,
});
setSelectedRowKeys([]);
};
// 关闭弹窗
......@@ -33,23 +80,84 @@ const SaleDateModal = props => {
// 提交
const handleConfirm = async () => {
const res = await form.validateFields();
console.log('res :>> ', res);
if (!selectedRows || selectedRows.length < 1) {
notification.error({ message: '请选择要添加的商品' });
return;
}
props.onSelectChange(deepClone(selectedRows));
handleCancel();
};
const onSelectChange = newSelectedRowKeys => {
console.log('selectedRowKeys changed: ', newSelectedRowKeys);
setSelectedRowKeys(newSelectedRowKeys);
// 商品单选
const onSelectChange = (record, selected) => {
const { skuId } = record;
if (selected) {
const keys = [...selectedRowKeys, skuId];
const arr = [...selectedRows, record];
setSelectedRowKeys(keys);
setSelectedRows(arr);
} else {
const rows = [];
const keys = [];
selectedRows.forEach(item => {
if (item.skuId !== skuId) {
rows.push(item);
keys.push(item.skuId);
}
});
setSelectedRowKeys(keys);
setSelectedRows(rows);
}
};
// 商品全选
const onSelectAllChange = (selected, rows) => {
const keys = [...selectedRowKeys];
const arr = [...selectedRows];
if (selected) {
rows.forEach(item => {
if (!keys.includes(item.skuId)) {
keys.push(item.skuId);
arr.push(item);
}
});
setSelectedRowKeys(keys);
setSelectedRows(arr);
} else {
dataSource.forEach(item => {
const index = keys.findIndex(k => k === item.skuId);
if (index > -1) {
keys.splice(index, 1);
arr.splice(index, 1);
}
});
setSelectedRowKeys(keys);
setSelectedRows(arr);
}
};
// 切换页码
const onPageChange = (current, size) => {
setPage(current);
setPageSize(size);
searchList({
current,
pageSize: size,
});
};
// 获取店铺列表
const getShopList = async () => {
const res = await getShopListByPickSelf({
enterpriseId: props.enterpriseId,
pickSelfIdList: props.pickSelfIdList,
});
setShopList(res);
};
const rowSelection = {
selectedRowKeys,
onChange: onSelectChange,
onSelect: onSelectChange,
onSelectAll: onSelectAllChange,
};
const selectBefore = (
<Select defaultValue="1" onChange={setSearchType}>
......@@ -57,13 +165,13 @@ const SaleDateModal = props => {
<Option value="2">SKU</Option>
</Select>
);
const selectAfter = <SearchOutlined onClick={searchList} />;
const selectAfter = <SearchOutlined onClick={onSearch} />;
const footers = () => [
<div className={style.footers}>
<Pagination defaultCurrent={6} total={500} showQuickJumper onChange={onPageChange} />
<div className={style['footers-btn']}>
<div className={style['footers-desc']}>
已选商品(<span className={style['footers-num']}>0</span>)
已选商品(<span className={style['footers-num']}>{selectedRows.length}</span>)
</div>
<Button key="back" onClick={handleCancel}>
取消
......@@ -75,6 +183,12 @@ const SaleDateModal = props => {
</div>,
];
useEffect(() => {
getShopList();
setGoodsType(props.productType);
searchList({});
}, []);
return (
<Modal
title="选择商品"
......@@ -87,19 +201,33 @@ const SaleDateModal = props => {
footer={footers()}
>
<div className={style['select-goods-box']}>
<Select placeholder="请选择店铺" className={style['select-goods-box--select']} />
<Select
placeholder="请选择店铺"
options={shopList}
value={shopId}
onChange={onChangeShop}
className={style['select-goods-box--select']}
/>
<Select
placeholder="请选择商品类型"
disabled
value={goodsType}
options={jsonToArray(productType)}
className={style['select-goods-box--select']}
/>
<Input
addonBefore={selectBefore}
addonAfter={selectAfter}
onChange={e => setSearchName(e.target.value)}
className={style['select-goods-box--txt']}
/>
</div>
<Table rowSelection={rowSelection} columns={SelectGoodsColumn} dataSource={dataSource} />
<Table
rowSelection={rowSelection}
rowKey="skuId"
columns={SelectGoodsColumn}
dataSource={dataSource}
/>
</Modal>
);
};
......
import { apiEnterpriseList, apiShopList } from './index';
import debounce from 'lodash/debounce';
import { apiEnterpriseList, apiShopList, apiShopListByPickSelfID } from './index';
// 获取企业列表
export const getEnterpriseList = async (name = '') => {
const res = await apiEnterpriseList({ name });
......@@ -10,7 +12,8 @@ export const getEnterpriseList = async (name = '') => {
};
};
// 获取店铺列表
export const getShopList = async (name = '') => {
export const getShopList = debounce(async e => {
const { name } = e;
const res = await apiShopList({ name });
return {
id: res[res.length - 1].id,
......@@ -18,4 +21,15 @@ export const getShopList = async (name = '') => {
[item.id]: { text: item.name },
})),
};
}, 300);
// 获取店铺列表通过自提点ID
export const getShopListByPickSelf = async e => {
const { name } = e;
const res = await apiShopListByPickSelfID({ name });
return {
id: res[res.length - 1].id,
list: res.map(item => ({
[item.id]: { text: item.name },
})),
};
};
......@@ -13,6 +13,16 @@ export async function apiTakeawayList(param) {
prefix: goodsApi,
});
}
/**
* 获取企业虚拟商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
export async function apiVirtualList(param) {
return request.post('/api/consoles/product/enterprise/virtual/pageList', {
data: param,
prefix: goodsApi,
});
}
/**
* 企业客户列表
* http://yapi.quantgroups.com/project/389/interface/api/65324
......@@ -74,7 +84,7 @@ export async function apiSelPickSelfList(param) {
});
}
/**
* 企业团餐->查询商品 - 选择商品弹窗
* 企业团餐->查询外卖商品 - 选择商品弹窗
* http://yapi.quantgroups.com/project/389/interface/api/65479
*/
export async function apiSelGoodsList(param) {
......@@ -84,7 +94,17 @@ export async function apiSelGoodsList(param) {
});
}
/**
* 企业团餐->添加商品保存
* 企业团餐->查询商品 - 选择虚拟商品弹窗
* http://yapi.quantgroups.com/project/389/interface/api/65479
*/
export async function apiSelVirtualGoodsList(param) {
return request.post('/api/consoles/product/enterprise/virtual/sku/page', {
data: param,
prefix: goodsApi,
});
}
/**
* 企业团餐->添加外卖商品保存
* http://yapi.quantgroups.com/project/389/interface/api/65094
*/
export async function apiSaveGoodsList(param) {
......@@ -93,3 +113,33 @@ export async function apiSaveGoodsList(param) {
prefix: goodsApi,
});
}
/**
* 企业团餐->添加虚拟商品保存
* http://yapi.quantgroups.com/project/389/interface/api/65484
*/
export async function apiSaveVirtualGoodsList(param) {
return request.post('/api/consoles/products/enterprise/virtual/add', {
data: param,
prefix: goodsApi,
});
}
/**
* 企业团餐->虚拟品->根据企业ID查询店铺列表
* http://yapi.quantgroups.com/project/389/interface/api/65504
*/
export async function apiShopListByEnterpriseID(param) {
return request.post('/api/consoles/product/enterprise/virtual/shops', {
data: param,
prefix: goodsApi,
});
}
/**
* 企业团餐->根据企业ID+自提点列表查询店铺列表
* http://yapi.quantgroups.com/project/389/interface/api/65539
*/
export async function apiShopListByPickSelfID(param) {
return request.post('/api/consoles/product/enterprise/queryByEnterpriseIdAndPickSelfId', {
data: param,
prefix: goodsApi,
});
}
......@@ -2,6 +2,7 @@ import React from 'react';
import { Button, Space, Switch } from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { jsonToArray } from '@/utils/utils';
import { getShopList } from '../service/bll';
export const layout = {
labelCol: { span: 4 },
......@@ -16,6 +17,15 @@ export const mealColumn = {
4: '晚餐',
};
// 商品类型
export const productType = {
1: '实物商品',
2: '虚拟商品',
// 3: '电子卡券'(废弃)
4: '服务类商品',
5: '外卖商品',
};
export const weekOptions = {
1: '周一',
2: '周二',
......@@ -27,19 +37,38 @@ export const weekOptions = {
};
export const takeawayGoodsColumn = options => {
const { onDel, companyEnum, shopEnum, onChangeFlag, setVisibleSaleDate, enterprises } = options;
const {
onDel,
companyEnum,
shopEnum,
onChangeFlag,
setVisibleSaleDate,
enterprises,
setRecordID,
setVisiblePrice,
setVisibleSaleSection,
setVisibleSort,
} = options;
return [
{
title: '企业名称',
dataIndex: 'enterpriseId',
hideInTable: true,
fieldProps: {
showSearch: true,
filterOption: (v, option) => (option?.label ?? '').toLowerCase().includes(v.toLowerCase()),
},
valueEnum: enterprises, // companyEnum,
},
{
title: '微店名称',
dataIndex: 'shopId',
hideInTable: true,
valueEnum: {}, // shopEnum,
fieldProps: {
showSearch: true,
},
request: getShopList,
// valueEnum: {}, // shopEnum,
},
{
title: 'SKU编码',
......@@ -70,7 +99,12 @@ export const takeawayGoodsColumn = options => {
render: (_, record) => (
<Space>
<span>{_}</span>
<span onClick={setVisibleSaleDate(true)}>
<span
onClick={() => {
setRecordID(record.id);
setVisibleSaleDate(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -85,7 +119,12 @@ export const takeawayGoodsColumn = options => {
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<span
onClick={() => {
setRecordID(record.id);
setVisibleSaleSection(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -100,7 +139,12 @@ export const takeawayGoodsColumn = options => {
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<span
onClick={() => {
setRecordID(record.id);
setVisiblePrice(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -134,7 +178,12 @@ export const takeawayGoodsColumn = options => {
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<span
onClick={() => {
setRecordID(record.id);
setVisibleSort(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -149,7 +198,7 @@ export const takeawayGoodsColumn = options => {
render: (_, record) => (
<Space>
<span>
<Switch onChange={onChangeFlag} />
<Switch checked={+_ === 1} onChange={e => onChangeFlag(record.id, e)} />
</span>
</Space>
),
......@@ -184,7 +233,7 @@ export const takeawayGoodsColumn = options => {
align: 'center',
fixed: 'right',
render: (val, r) => (
<Button key="del" onClick={() => onDel(r, 'del')}>
<Button key="del" onClick={() => onDel(r.id)}>
删除
</Button>
),
......@@ -193,7 +242,7 @@ export const takeawayGoodsColumn = options => {
};
export const GoodsInfoColumn = options => {
const { onDel, companyEnum, shopEnum, onChangeFlag, setVisibleSaleDate } = options;
const { onDel, setVisibleSaleDate, setVisibleSaleSection, setEditID } = options;
return [
{
title: '微店名称',
......@@ -202,7 +251,6 @@ export const GoodsInfoColumn = options => {
{
title: '商品名称',
dataIndex: 'skuName',
width: 120,
align: 'center',
},
{
......@@ -225,14 +273,19 @@ export const GoodsInfoColumn = options => {
},
{
title: '可售日期',
dataIndex: 'saleTimeType',
width: 120,
dataIndex: 'saleDate',
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span onClick={setVisibleSaleDate(true)}>
{_ &&
(_.length === 7 ? '不限制' : <span>{_.map(item => weekOptions[item]).join('/')}</span>)}
<span
onClick={() => {
setEditID(record.skuId);
setVisibleSaleDate(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -240,14 +293,18 @@ export const GoodsInfoColumn = options => {
},
{
title: '可售餐段',
dataIndex: 'saleDate',
width: 120,
dataIndex: 'mealType',
align: 'center',
hideInSearch: true,
render: (_, record) => (
<Space>
<span>{_}</span>
<span>
<span>{_ && _.map(item => mealColumn[item]).join('/')}</span>
<span
onClick={() => {
setEditID(record.skuId);
setVisibleSaleSection(true);
}}
>
<FormOutlined />
</span>
</Space>
......@@ -280,7 +337,7 @@ export const SelectGoodsColumn = [
{
title: '商品ID',
width: 120,
dataIndex: 'id',
dataIndex: 'skuId',
},
{
title: '商品名称',
......
import React, { useState, useEffect, useRef } from 'react';
import { useHistory } from 'react-router-dom';
import { ProTable } from '@ant-design/pro-components';
import { Button, Space } from 'antd';
import { Button, notification } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { takeawayGoodsColumn } from './staticData/goods';
import utilStyle from '@/utils/utils.less';
import { apiTakeawayList } from './service';
import { apiTakeawayList, apiSelPickSelfList, apiMealInfoDel, apiMealInfoUpdate } from './service';
import { getEnterpriseList } from './service/bll';
import SaleDateModal from './components/SaleDateModal';
import SaleSectionModal from './components/SaleSectionModal';
......@@ -13,26 +13,41 @@ import GoodPriceModal from './components/GoodPriceModal';
import GoodSortModal from './components/GoodSortModal';
import { getToUrlQuery } from '@/utils/utils';
const BusinessCustomer = () => {
// 企业外卖商品
const TakeawayGoods = () => {
const history = useHistory();
const refTable = useRef();
const [pageLoading, setPageLoading] = useState(false); // 可售日期弹窗
const [pageLoading, setPageLoading] = useState(true); // 可售日期弹窗
const [visibleSaleDate, setVisibleSaleDate] = useState(false); // 可售日期弹窗
const [visibleSaleSection, setVisibleSaleSection] = useState(false); // 可售餐段弹窗
const [visiblePrice, setVisiblePrice] = useState(false); // 修改企业商品价格弹窗
const [visibleSort, setVisibleSort] = useState(false); // 商品排序弹窗
const [enterprises, setEnterprises] = useState([]); // 企业列表
const [activeKey, setActiveKey] = useState('tab1');
const [enterpriseId, setEnterpriseId] = useState('10');
const [activeKey, setActiveKey] = useState('');
const [enterpriseId, setEnterpriseId] = useState('');
const [pickSelfList, setPickSelfList] = useState([]); // 取餐点列表
const [recordID, setRecordID] = useState(''); // 编辑的记录ID
// 搜索商品列表
const searchList = async params => {
const data = {
page: params.current,
size: params.pageSize,
data: params,
};
return apiTakeawayList(data);
if (params.enterpriseId && params.enterpriseId !== enterpriseId) {
setEnterpriseId(params.enterpriseId);
}
// const data = {
// page: params.current,
// size: params.pageSize,
// data: params,
// };
// return apiTakeawayList(data);
};
const onDel = async id => {
await apiMealInfoDel({
id,
});
notification.success({
message: '删除成功',
});
};
const onDel = async () => {};
const onAdd = async () => {
const query = getToUrlQuery();
history.push({
......@@ -40,20 +55,45 @@ const BusinessCustomer = () => {
query,
});
};
const onChangeFlag = async (id, checked) => {
const params = {
id,
showFlag: checked ? 1 : 0,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
};
const options = {
setVisibleSaleDate,
setVisibleSaleSection,
setVisiblePrice,
setVisibleSort,
onDel,
setRecordID,
enterprises,
onChangeFlag,
};
// 根据企业ID获取取餐点
const getPickSelf = async () => {
const res = await apiSelPickSelfList({});
setPickSelfList(
res.map(item => ({
key: item.pickSelfId,
label: <span>{item.pickSelfName}</span>,
})),
);
setActiveKey(res[0].pickSelfId);
};
// 获取企业列表
const getList = async name => {
const obj = getEnterpriseList(name);
const obj = await getEnterpriseList(name);
setEnterprises(obj.list);
setEnterpriseId(obj.id);
getPickSelf(obj.id);
setPageLoading(true);
};
......@@ -87,20 +127,7 @@ const BusinessCustomer = () => {
menu: {
type: 'tab',
activeKey,
items: [
{
key: 'tab1',
label: <span>取餐点1</span>,
},
{
key: 'tab2',
label: <span>取餐点2</span>,
},
{
key: 'tab3',
label: <span>取餐点3</span>,
},
],
items: pickSelfList,
onChange: key => {
setActiveKey(key);
},
......@@ -116,25 +143,42 @@ const BusinessCustomer = () => {
)}
{/* 可售日期弹窗 */}
{visibleSaleDate && (
<SaleDateModal visible={visibleSaleDate} handleClose={() => setVisibleSaleDate(false)} />
<SaleDateModal
visible={visibleSaleDate}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSaleDate(false)}
/>
)}
{/* 可售餐段弹窗 */}
{visibleSaleSection && (
<SaleSectionModal
visible={visibleSaleSection}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSaleSection(false)}
/>
)}
{/* 修改企业商品价格弹窗 */}
{visiblePrice && (
<GoodPriceModal visible={visiblePrice} handleClose={() => setVisiblePrice(false)} />
<GoodPriceModal
visible={visiblePrice}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisiblePrice(false)}
/>
)}
{/* 商品排序弹窗 */}
{visibleSort && (
<GoodSortModal visible={visibleSort} handleClose={() => setVisibleSort(false)} />
<GoodSortModal
visible={visibleSort}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSort(false)}
/>
)}
</div>
);
};
export default BusinessCustomer;
export default TakeawayGoods;
import React, { useRef, useState, useEffect } from 'react';
import {
Input,
Checkbox,
Radio,
Button,
notification,
Spin,
Select,
Row,
Col,
Form,
Table,
} from 'antd';
import { Button, notification, Spin, Select, Row, Col, Table, message } from 'antd';
import { useHistory } from 'react-router-dom';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { GoodsInfoColumn } from './staticData/goods';
import SaleDateModal from './components/SaleDateModal';
import SaleSectionModal from './components/SaleSectionModal';
import SelectGoodsModal from './components/SelectGoodsModal';
import { apiSelPickSelfList, apiSaveGoodsList } from './service';
import style from './style/index.less';
const TakeawayGoodsInfo = props => {
const { id } = props.location.query;
const history = useHistory();
const [loading, setLoading] = useState(false);
const [visibleSaleDate, setVisibleSaleDate] = useState(false); // 可售日期弹窗
const [visibleSaleSection, setVisibleSaleSection] = useState(false); // 可售餐段弹窗
const [visibleSelectGoods, setVisibleSelectGoods] = useState(false); // 选择商品弹窗
const [dataSource, setDataSource] = useState([]);
const [pickSelfList, setPickSelfList] = useState([]); // 取餐点列表
const [slePickSelf, setSelPickSelf] = useState([]); // 选中的取餐点列表
const [editID, setEditID] = useState(''); // 编辑ID
// 取消
const onCancel = () => {
history.goBack();
};
// 提交
// const onSubmit = () => {
// };
const onSubmit = async () => {
if (!dataSource || dataSource.length < 1) {
message.error('请添加商品');
return;
}
const skuInfoList = dataSource.map(item => ({
skuId: item.skuId,
enterprisePrice: item.enterprisePrice,
mealTypeList: item.mealType,
saleDateList: item.saleDate,
}));
const params = {
shopId: id,
enterpriseId: id,
pickSelfIdList: slePickSelf,
skuInfoList,
};
await apiSaveGoodsList(params);
notification.success({ message: '添加成功' });
onCancel();
};
// 提交
const onDel = () => {};
// 删除
const onDel = i => {
const arr = dataSource.splice(i, 1);
setDataSource(arr);
};
// 根据企业ID获取取餐点
const getPickSelf = async () => {
const res = await apiSelPickSelfList({
enterpriseId: id,
});
setPickSelfList(
res.map(item => ({
key: item.pickSelfId,
label: <span>{item.pickSelfName}</span>,
})),
);
};
// 刷新列表数据
const refreshList = (type, v) => {
const arr = dataSource.map(item => {
if (editID) {
if (item.skuId === editID) {
item[type] = v;
}
} else {
item[type] = v;
}
return item;
});
setDataSource(arr);
};
// const initData = async () => {
// setLoading(true);
// };
// useEffect(() => {
// initData();
// }, []);
useEffect(() => {
getPickSelf();
}, []);
const options = {
setVisibleSaleDate,
setVisibleSaleSection,
setEditID,
onDel,
};
......@@ -66,8 +115,10 @@ const TakeawayGoodsInfo = props => {
<Select
mode="multiple"
showSearch
options={pickSelfList}
className={style['info-box--select']}
placeholder="清选择"
onChange={setSelPickSelf}
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
......@@ -87,8 +138,22 @@ const TakeawayGoodsInfo = props => {
<Row className={style['info-box--line']}>
<Col span={24}>
<div className={style['info-box--batch-btn']}>
<Button>批量配置日期</Button>
<Button>批量配置餐段</Button>
<Button
onClick={() => {
setEditID('');
setVisibleSaleDate(true);
}}
>
批量配置日期
</Button>
<Button
onClick={() => {
setEditID('');
setVisibleSaleSection(true);
}}
>
批量配置餐段
</Button>
</div>
<Table columns={GoodsInfoColumn(options)} dataSource={dataSource} />
</Col>
......@@ -96,21 +161,30 @@ const TakeawayGoodsInfo = props => {
<Row className={style['info-box--btns']}>
<Col span={4} />
<Col span={20}>
<Button type="primary" className={style['info-box--btns__confirm']}>
<Button
type="primary"
onClick={onSubmit}
className={style['info-box--btns__confirm']}
>
确定
</Button>
<Button>取消</Button>
<Button onClick={onCancel}>取消</Button>
</Col>
</Row>
</Spin>
{/* 可售日期弹窗 */}
{visibleSaleDate && (
<SaleDateModal visible={visibleSaleDate} handleClose={() => setVisibleSaleDate(false)} />
<SaleDateModal
visible={visibleSaleDate}
handleRefresh={v => refreshList('saleDate', v)}
handleClose={() => setVisibleSaleDate(false)}
/>
)}
{/* 可售餐段弹窗 */}
{visibleSaleSection && (
<SaleSectionModal
visible={visibleSaleSection}
handleRefresh={v => refreshList('mealType', v)}
handleClose={() => setVisibleSaleSection(false)}
/>
)}
......@@ -118,6 +192,7 @@ const TakeawayGoodsInfo = props => {
{visibleSelectGoods && (
<SelectGoodsModal
visible={visibleSelectGoods}
onSelectChange={setDataSource}
handleClose={() => setVisibleSelectGoods(false)}
/>
)}
......
import React, { useState, useEffect, useRef } from 'react';
import { useHistory } from 'react-router-dom';
import { ProTable } from '@ant-design/pro-components';
import { Button, notification } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { takeawayGoodsColumn } from './staticData/goods';
import utilStyle from '@/utils/utils.less';
import { apiVirtualList, apiSelPickSelfList, apiMealInfoDel, apiMealInfoUpdate } from './service';
import { getEnterpriseList } from './service/bll';
import SaleDateModal from './components/SaleDateModal';
import SaleSectionModal from './components/SaleSectionModal';
import GoodPriceModal from './components/GoodPriceModal';
import GoodSortModal from './components/GoodSortModal';
import { getToUrlQuery } from '@/utils/utils';
// 企业虚拟商品
const VirtualGoods = () => {
const history = useHistory();
const refTable = useRef();
const [pageLoading, setPageLoading] = useState(true); // 可售日期弹窗
const [visibleSaleDate, setVisibleSaleDate] = useState(false); // 可售日期弹窗
const [visibleSaleSection, setVisibleSaleSection] = useState(false); // 可售餐段弹窗
const [visiblePrice, setVisiblePrice] = useState(false); // 修改企业商品价格弹窗
const [visibleSort, setVisibleSort] = useState(false); // 商品排序弹窗
const [enterprises, setEnterprises] = useState([]); // 企业列表
const [activeKey, setActiveKey] = useState('');
const [enterpriseId, setEnterpriseId] = useState('');
const [pickSelfList, setPickSelfList] = useState([]); // 取餐点列表
const [recordID, setRecordID] = useState(''); // 编辑的记录ID
// 搜索商品列表
const searchList = async params => {
if (params.enterpriseId && params.enterpriseId !== enterpriseId) {
setEnterpriseId(params.enterpriseId);
}
// const data = {
// page: params.current,
// size: params.pageSize,
// data: params,
// };
// return apiVirtualList(data);
};
const onDel = async id => {
await apiMealInfoDel({
id,
});
notification.success({
message: '删除成功',
});
};
const onAdd = async () => {
const query = getToUrlQuery();
history.push({
pathname: '/takeawayGoodsInfo',
query,
});
};
const onChangeFlag = async (id, checked) => {
const params = {
id,
showFlag: checked ? 1 : 0,
};
await apiMealInfoUpdate(params);
notification.success({ message: '保存成功' });
};
const options = {
setVisibleSaleDate,
setVisibleSaleSection,
setVisiblePrice,
setVisibleSort,
onDel,
setRecordID,
enterprises,
onChangeFlag,
};
// 根据企业ID获取取餐点
const getPickSelf = async () => {
const res = await apiSelPickSelfList({});
setPickSelfList(
res.map(item => ({
key: item.pickSelfId,
label: <span>{item.pickSelfName}</span>,
})),
);
setActiveKey(res[0].pickSelfId);
};
// 获取企业列表
const getList = async name => {
const obj = await getEnterpriseList(name);
setEnterprises(obj.list);
setEnterpriseId(obj.id);
getPickSelf(obj.id);
setPageLoading(true);
};
useEffect(() => {
getList('');
// setTimeout(() => {
// // refTable.current.reload();
// }, 1000);
}, []);
return (
<div>
{pageLoading && (
<ProTable
search={{
span: 6,
className: utilStyle.formSearch,
collapsed: false,
collapseRender: () => null,
}}
actionRef={refTable}
tableClassName={utilStyle.formTable}
columns={takeawayGoodsColumn(options)}
request={params => searchList({ ...params })}
rowKey={r => r.id}
expandIconColumnIndex={10}
bordered
options={false}
form={{ initialValues: { enterpriseId } }}
toolbar={{
menu: {
type: 'tab',
activeKey,
items: pickSelfList,
onChange: key => {
setActiveKey(key);
},
},
actions: [
<Button key="1" icon={<PlusOutlined />} type="primary" onClick={onAdd}>
添加外卖商品
</Button>,
],
}}
scroll={{ x: '100%', y: 400 }}
/>
)}
{/* 可售日期弹窗 */}
{visibleSaleDate && (
<SaleDateModal
visible={visibleSaleDate}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSaleDate(false)}
/>
)}
{/* 可售餐段弹窗 */}
{visibleSaleSection && (
<SaleSectionModal
visible={visibleSaleSection}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSaleSection(false)}
/>
)}
{/* 修改企业商品价格弹窗 */}
{visiblePrice && (
<GoodPriceModal
visible={visiblePrice}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisiblePrice(false)}
/>
)}
{/* 商品排序弹窗 */}
{visibleSort && (
<GoodSortModal
visible={visibleSort}
id={recordID}
handleRefresh={() => searchList({})}
handleClose={() => setVisibleSort(false)}
/>
)}
</div>
);
};
export default VirtualGoods;
import React, { useRef, useState, useEffect } from 'react';
import {
Input,
Checkbox,
Radio,
Button,
notification,
Spin,
Select,
Row,
Col,
Form,
Table,
} from 'antd';
import { Button, notification, Spin, Select, Row, Col, Table, message } from 'antd';
import { useHistory } from 'react-router-dom';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { GoodsInfoColumn } from './staticData/goods';
import SaleDateModal from './components/SaleDateModal';
import SaleSectionModal from './components/SaleSectionModal';
import SelectGoodsModal from './components/SelectGoodsModal';
import { apiSaveVirtualGoodsList, apiShopListByEnterpriseID } from './service';
import style from './style/index.less';
const TakeawayGoodsInfo = props => {
const VirtualGoodsInfo = props => {
const { id } = props.location.query;
const history = useHistory();
const [loading, setLoading] = useState(false);
const [visibleSaleDate, setVisibleSaleDate] = useState(false); // 可售日期弹窗
const [visibleSaleSection, setVisibleSaleSection] = useState(true); // 可售餐段弹窗
const [visibleSelectGoods, setVisibleSelectGoods] = useState(true); // 选择商品弹窗
const [visibleSaleSection, setVisibleSaleSection] = useState(false); // 可售餐段弹窗
const [visibleSelectGoods, setVisibleSelectGoods] = useState(false); // 选择商品弹窗
const [dataSource, setDataSource] = useState([]);
const [shopList, setShopList] = useState([]); // 店铺列表
const [sleShopID, setSelShopID] = useState(''); // 选中的店铺
const [editID, setEditID] = useState(''); // 编辑ID
// 取消
const onCancel = () => {
history.goBack();
};
// 提交
// const onSubmit = () => {
// };
const onSubmit = async () => {
if (!dataSource || dataSource.length < 1) {
message.error('请添加商品');
return;
}
const skuInfoList = dataSource.map(item => ({
skuId: item.skuId,
enterprisePrice: item.enterprisePrice,
mealTypeList: item.mealType,
saleDateList: item.saleDate,
}));
const params = {
shopId: sleShopID,
enterpriseId: id,
skuInfoList,
};
await apiSaveVirtualGoodsList(params);
notification.success({ message: '添加成功' });
onCancel();
};
// 提交
const onDel = () => {};
// 删除
const onDel = i => {
const arr = dataSource.splice(i, 1);
setDataSource(arr);
};
// 根据企业ID获取店铺列表
const getShopList = async () => {
const res = await apiShopListByEnterpriseID({
enterpriseId: id,
});
setShopList(
res.map(item => ({
key: item.id,
label: <span>{item.name}</span>,
})),
);
};
// 刷新列表数据
const refreshList = (type, v) => {
const arr = dataSource.map(item => {
if (editID) {
if (item.skuId === editID) {
item[type] = v;
}
} else {
item[type] = v;
}
return item;
});
setDataSource(arr);
};
// const initData = async () => {
// setLoading(true);
// };
// useEffect(() => {
// initData();
// }, []);
useEffect(() => {
getShopList();
}, []);
const options = {
setVisibleSaleDate,
setVisibleSaleSection,
setEditID,
onDel,
};
......@@ -63,7 +111,16 @@ const TakeawayGoodsInfo = props => {
选择店铺:
</Col>
<Col span={20}>
<Select className={style['info-box--select']} placeholder="清选择" />
<Select
showSearch
options={shopList}
className={style['info-box--select']}
placeholder="清选择"
onChange={setSelShopID}
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
/>
</Col>
</Row>
<Row className={style['info-box--line']}>
......@@ -78,27 +135,54 @@ const TakeawayGoodsInfo = props => {
</Row>
<Row className={style['info-box--line']}>
<Col span={24}>
<div className={style['info-box--batch-btn']}>
<Button
onClick={() => {
setEditID('');
setVisibleSaleDate(true);
}}
>
批量配置日期
</Button>
<Button
onClick={() => {
setEditID('');
setVisibleSaleSection(true);
}}
>
批量配置餐段
</Button>
</div>
<Table columns={GoodsInfoColumn(options)} dataSource={dataSource} />
</Col>
</Row>
<Row className={style['info-box--btns']}>
<Col span={4} />
<Col span={20}>
<Button type="primary" className={style['info-box--btns__confirm']}>
<Button
type="primary"
onClick={onSubmit}
className={style['info-box--btns__confirm']}
>
确定
</Button>
<Button>取消</Button>
<Button onClick={onCancel}>取消</Button>
</Col>
</Row>
</Spin>
{/* 可售日期弹窗 */}
{visibleSaleDate && (
<SaleDateModal visible={visibleSaleDate} handleClose={() => setVisibleSaleDate(false)} />
<SaleDateModal
visible={visibleSaleDate}
handleRefresh={v => refreshList('saleDate', v)}
handleClose={() => setVisibleSaleDate(false)}
/>
)}
{/* 可售餐段弹窗 */}
{visibleSaleSection && (
<SaleSectionModal
visible={visibleSaleSection}
handleRefresh={v => refreshList('mealType', v)}
handleClose={() => setVisibleSaleSection(false)}
/>
)}
......@@ -106,6 +190,8 @@ const TakeawayGoodsInfo = props => {
{visibleSelectGoods && (
<SelectGoodsModal
visible={visibleSelectGoods}
type="virtual"
onSelectChange={setDataSource}
handleClose={() => setVisibleSelectGoods(false)}
/>
)}
......@@ -114,4 +200,4 @@ const TakeawayGoodsInfo = props => {
);
};
export default TakeawayGoodsInfo;
export default VirtualGoodsInfo;
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