Commit 82de3154 authored by 武广's avatar 武广

fix: 修改review问题

parent 31d6d7b0
......@@ -162,18 +162,14 @@ const CustomerInfo = props => {
if (props.id && ms.length < mealTypes.length) {
await checkConfirm();
}
// 添加餐段
if (mealTypes.length < ms.length) {
if (!ms.includes('1') && ms.includes('2')) {
ms.push('1');
}
} else if (!ms.includes('1') && ms.includes('2')) {
// 去除餐段
if (ms.includes('4')) {
ms = ['4'];
} else {
ms = [];
}
// 取消外卖,必须取消自助餐
if (mealTypes.includes('1') && !ms.includes('1')) {
ms = ms.filter(item => item !== '2');
}
// 选择自助餐,必须选择外卖
if (!mealTypes.includes('1') && ms.includes('2')) {
ms.push('1');
}
form.setFieldsValue({
mealType: ms,
......
......@@ -51,14 +51,13 @@ const SaleDateModal = props => {
api = apiSelVirtualGoodsList;
}
const res = await api(data);
console.log('res :>> ', res);
if (res && res.data && res.data.records) {
res.data.records.forEach(item => {
const arr =
res?.data?.records?.map(item => {
item.enterprisePrice = item.salePrice;
});
setDataSource(res.data.records);
setTotal(res.data.total);
}
return item;
}) || [];
setDataSource(arr);
setTotal(res?.data?.total || 0);
setLoading(false);
};
......
......@@ -108,24 +108,17 @@ const TakeawayGoods = () => {
// 根据企业ID获取取餐点
const getPickSelf = async id => {
const res = await apiSelPickSelfList({ enterpriseId: id });
if (res && res.data && res.data.length) {
setPickSelfList(
res.data.map(item => ({
key: `${item.pickSelfId}`,
label: <span>{item.pickSelfName}</span>,
})),
);
const pid = res.data[0].pickSelfId;
setActiveKey(`${pid}`);
if (pageLoaded) {
onRefresh();
}
} else {
setPickSelfList([]);
setActiveKey('');
if (pageLoaded) {
onRefresh();
}
const arr =
res?.data?.map(item => ({
key: `${item.pickSelfId}`,
label: <span>{item.pickSelfName}</span>,
})) || [];
setPickSelfList(arr);
const [obj] = res?.data || [];
const pid = `${obj?.pickSelfId || ''}`;
setActiveKey(`${pid}`);
if (pageLoaded) {
onRefresh();
}
};
......
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