Commit d9f92b1c authored by 武广's avatar 武广

fix: 修改餐品类型

parent f50d20a4
...@@ -164,25 +164,15 @@ const CustomerInfo = props => { ...@@ -164,25 +164,15 @@ const CustomerInfo = props => {
}); });
}; };
// 改变餐品类型 (1和2要选都选 要不都不选) // 改变餐品类型 (选自助餐必选外卖)
const onChangeMealType = async ms => { const onChangeMealType = async ms => {
try { try {
if (props.info && props.info.id && ms.length < mealTypes.length) { if (props.info && props.info.id && ms.length < mealTypes.length) {
await checkConfirm(); await checkConfirm();
} }
if (mealTypes.length > ms.length) { if (mealTypes.length < ms.length) {
if (ms.includes('1') && ms.includes('2')) { if (!ms.includes('1') && ms.includes('2')) {
ms = ['1', '2']; ms.push('1');
} else if (ms.includes('4')) {
ms = ['4'];
} else {
ms = [];
}
} else if (ms.includes('1') || ms.includes('2')) {
if (ms.includes('4')) {
ms = ['1', '2', '4'];
} else {
ms = ['1', '2'];
} }
} }
form.setFieldsValue({ form.setFieldsValue({
...@@ -248,6 +238,8 @@ const CustomerInfo = props => { ...@@ -248,6 +238,8 @@ const CustomerInfo = props => {
} }
if (res.data.mealType) { if (res.data.mealType) {
obj.mealType = res.data.mealType.map(item => `${item}`); obj.mealType = res.data.mealType.map(item => `${item}`);
} else {
obj.mealType = [];
} }
setMealTypes(obj.mealType); setMealTypes(obj.mealType);
const json = {}; const json = {};
......
...@@ -56,7 +56,6 @@ const BusinessCustomer = () => { ...@@ -56,7 +56,6 @@ const BusinessCustomer = () => {
添加企业客户 添加企业客户
</Button>, </Button>,
]} ]}
scroll={{ x: '100%', y: 400 }}
/> />
<CustomerInfo <CustomerInfo
visible={visible} visible={visible}
......
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