Commit d9f92b1c authored by 武广's avatar 武广

fix: 修改餐品类型

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