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

fix: 修改review问题

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