Commit 6095ba76 authored by 陈万宝's avatar 陈万宝

feat: 更新商品字段

parent 6f9f4424
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
} }
.ant-form-item { .ant-form-item {
margin-bottom: 0; margin-bottom: 0;
margin-left: 20px; margin-left: 40px;
} }
} }
} }
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
margin: 0 10px; margin: 0 10px;
padding:0 8px; padding: 0 8px;
border-radius: 8px; border-radius: 8px;
} }
.repertoryLimit { .repertoryLimit {
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
} }
} }
.conBg { .conBg {
background:#f8f8f8 ; background: #f8f8f8;
min-width: 100%; min-width: 100%;
width: fit-content; width: fit-content;
:global { :global {
...@@ -299,6 +299,5 @@ ...@@ -299,6 +299,5 @@
.rowWarp { .rowWarp {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
background:#f8f8f8 ; background: #f8f8f8;
} }
...@@ -2,40 +2,98 @@ import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle } f ...@@ -2,40 +2,98 @@ import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle } f
import { Button, Modal, Radio, Form, InputNumber, Switch } from 'antd'; import { Button, Modal, Radio, Form, InputNumber, Switch } from 'antd';
import styles from '../common.less'; import styles from '../common.less';
import { ENUM_SET_REPERTORY } from '../config'; import { ENUM_SET_REPERTORY } from '../config';
import { debounce } from '@/utils/utils';
const AddRepertoryModal = (props, ref) => { const AddRepertoryModal = (props, ref) => {
const [confirmLoading, setConfirmLoading] = useState(false); const [confirmLoading, setConfirmLoading] = useState(false);
const [modalText, setModalText] = useState('Content of the modal');
const [openRepertory, setOpenRepertory] = useState(false); const [openRepertory, setOpenRepertory] = useState(false);
const [form] = Form.useForm();
const [repertoryState, setRepertoryState] = useState('');
const [initialValues, setInitialValues] = useState({
productStock: 0,
maxStock: 0,
autoStock: 0,
});
// const { const { modifiedInventory, intactData, repertoryModel } = props;
// open,
// setOpen,
// } = props;
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
// changeVal 就是暴露给父组件的方法 // changeVal 就是暴露给父组件的方法
setOpenRepertory: newVal => { setOpenRepertory: newVal => {
setOpenRepertory(newVal); setOpenRepertory(newVal);
}, },
})); }));
const onChange3 = () => {}; // 自动补全
const onChangeAutoStock = e => {
const handleOk = () => { form.setFieldsValue({
setModalText('The modal will be closed after two seconds'); autoStock: e ? 1 : 0,
setConfirmLoading(true); });
setTimeout(() => { };
setOpenRepertory(false); // 勾选库存设置
setConfirmLoading(false); const onChangeSetRepertory = e => {
}, 2000); console.log('form', form);
setRepertoryState(`${e.target.value}`);
if (+e.target.value === 0) {
form.setFieldsValue({
productStock: 0,
});
} else {
const { maxStock } = form.getFieldsValue(['maxStock']);
form.setFieldsValue({
productStock: maxStock,
});
}
};
// 最大库存设置
const onChangeMaxStock = e => {
// 已经勾选最大库存 自动更新剩余库存
if (+repertoryState === 1) {
form.setFieldsValue({
productStock: e,
});
}
};
const getFormValues = debounce(() => {
const values = form.getFieldsValue();
console.log('values========', values);
}, 400);
const handleOk = async () => {
const values = await form.validateFields();
console.log('values', values);
// 回调库存
modifiedInventory(values);
// setConfirmLoading(true);
// setTimeout(() => {
// setOpenRepertory(false);
// setConfirmLoading(false);
// }, 2000);
}; };
const handleCancel = () => { const handleCancel = () => {
console.log('Clicked cancel button');
setOpenRepertory(false); setOpenRepertory(false);
}; };
useEffect(() => { useEffect(() => {
console.log('open', openRepertory); console.log('open', openRepertory);
}, [openRepertory]); const { productStock, serviceItem } = intactData?.items;
const { autoStock, maxStock } = serviceItem;
const params = {
productStock,
autoStock,
maxStock,
};
switch (repertoryModel) {
case 'all': // 统一设置
setInitialValues(params);
break;
case 'mlti': // 多规格设置
setInitialValues(params);
break;
case 'singular': // 单规格设置
setInitialValues(params);
break;
default:
break;
}
}, [openRepertory, intactData]);
return ( return (
<> <>
{openRepertory && ( {openRepertory && (
...@@ -46,10 +104,10 @@ const AddRepertoryModal = (props, ref) => { ...@@ -46,10 +104,10 @@ const AddRepertoryModal = (props, ref) => {
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onCancel={handleCancel} onCancel={handleCancel}
> >
<Form> <Form form={form} initialValues={initialValues} onValuesChange={getFormValues}>
<Form.Item className={styles.itemInlineModal}> <Form.Item className={styles.itemInlineModal}>
<Form.Item <Form.Item
name="receptionVolume" name="productStock"
label="剩余库存" label="剩余库存"
style={{ style={{
display: 'flex', display: 'flex',
...@@ -58,28 +116,36 @@ const AddRepertoryModal = (props, ref) => { ...@@ -58,28 +116,36 @@ const AddRepertoryModal = (props, ref) => {
rules={[{ required: true, message: '请填写剩余库存' }]} rules={[{ required: true, message: '请填写剩余库存' }]}
> >
<InputNumber <InputNumber
min={1} min={0}
style={{ width: 200, display: 'inline-block' }} style={{ width: 200, display: 'inline-block' }}
placeholder="请输入" placeholder="请输入"
/> />
</Form.Item> </Form.Item>
<Form.Item name="limitPurchase" style={{ width: 200, display: 'inline-block' }}> <Form.Item style={{ width: 200, display: 'inline-block' }}>
<Radio.Group options={ENUM_SET_REPERTORY} onChange={onChange3} value={1} /> <Radio.Group value={repertoryState} onChange={onChangeSetRepertory}>
<Radio.Button value="0">清空</Radio.Button>
<Radio.Button value="1">最大</Radio.Button>
</Radio.Group>
</Form.Item> </Form.Item>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="receptionVolume" name="maxStock"
label="最大库存" label="最大库存"
rules={[{ required: true, message: '请填写最大库存' }]} rules={[{ required: true, message: '请填写最大库存' }]}
> >
<InputNumber min={1} style={{ width: 200 }} placeholder="请输入" /> <InputNumber
min={0}
style={{ width: 200 }}
placeholder="请输入"
onChange={onChangeMaxStock}
/>
</Form.Item> </Form.Item>
<Form.Item name="receptionVolume" label="自动补足"> <Form.Item name="autoStock" label="自动补足">
<Switch <Switch
checkedChildren="开启" checkedChildren="开启"
unCheckedChildren="关闭" unCheckedChildren="关闭"
defaultChecked // defaultChecked
onChange={onChange3} onChange={onChangeAutoStock}
/> />
</Form.Item> </Form.Item>
<div className={styles.textStyle}>修改成功后,原库存将被替换,请谨慎操作!</div> <div className={styles.textStyle}>修改成功后,原库存将被替换,请谨慎操作!</div>
......
...@@ -69,10 +69,13 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -69,10 +69,13 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const [tagList, setTagList] = useState([]); const [tagList, setTagList] = useState([]);
const [unitsList, setUnitsList] = useState([]); const [unitsList, setUnitsList] = useState([]);
const [takeawayData, setTakeawayData] = useState({}); const [takeawayData, setTakeawayData] = useState({});
const [specList, setSpecList] = useState([]); // const [multiSpecList, setMultiSpecList] = useState([]);
// const [singularSpecList, setSingularSpecList] = useState([]);
const [takeawaySku, setTakeawaySku] = useState([]); const [mltiSpu, setMultiSpu] = useState([]);
const [singularSpu, setSingularSpu] = useState([]);
const [intactData, setIntactData] = useState({});
const [repertoryState, setRepertoryState] = useState(''); const [repertoryState, setRepertoryState] = useState('');
const [repertoryModel, setRepertoryModel] = useState('');
const initialDealValue = [ const initialDealValue = [
{ {
specGroupName: '', specGroupName: '',
...@@ -90,7 +93,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -90,7 +93,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
return { return {
...values, ...values,
temp: 'takeawayItem', temp: 'takeawayItem',
limitPurchase: values.limitPurchase ? 1 : 0, intactData,
}; };
} catch (errorInfo) { } catch (errorInfo) {
return null; return null;
...@@ -98,7 +101,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -98,7 +101,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
}; };
const takeawayCalc = takeawayData => { const takeawayCalc = takeawayData => {
// 商品基本信息编辑商品名称 // 商品基本信息编辑商品名称
const { infoMation: name, takeawayItem, saleTimeType, singleDelivery } = takeawayData; const { infoMation: name, infoMation, takeawayItem, saleTimeType } = takeawayData;
// weight 份量 specs规格 生成sku规则 weight * specs // weight 份量 specs规格 生成sku规则 weight * specs
const { const {
specs = [], specs = [],
...@@ -111,11 +114,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -111,11 +114,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
maxStock, maxStock,
saleTimes, saleTimes,
label, label,
unit,
quantity,
productStock,
singleDelivery,
} = takeawayItem; } = takeawayItem;
const takeawaySkuTemp = []; const singularSpecList = [{ specGroupName: '份量', specs: [] }]; // 单规格
const takeawaySpecList = [{ specGroupName: '份量', specs: [] }] const multiSpecList = [{ specGroupName: '份量', specs: [] }]; // 多规格
console.log('takeawayData', takeawayData); const multiSpu = []; // 单库存spu
if (name) { let singularSpu = []; // 多库存spu
const temp = { const temp = {
salePrice: 1, salePrice: 1,
productStock: 2, productStock: 2,
...@@ -132,16 +140,28 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -132,16 +140,28 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
saleTimes, saleTimes,
autoStock: '', // 弹框设置---自动补足 autoStock: '', // 弹框设置---自动补足
}, },
};
// 单规格
if (+repertoryType === 1) {
const sepcs = { maxStock, quantity, unit, productStock };
singularSpecList[0].specs = [sepcs];
singularSpu = [{ ...temp, sepcs: [sepcs] }];
setSingularSpu(singularSpu);
} }
// 多规格
if (+repertoryType === 2) {
console.log('222');
if (name) {
if (weight.length) { if (weight.length) {
weight.forEach((item, weightIndex) => { weight.forEach((item, weightIndex) => {
takeawaySpecList[0].specs = weight multiSpecList[0].specs = weight;
// 循环一次 插入规则列表 // 循环一次 插入规则列表
let isFirstLoops = true let isFirstLoops = true;
if (specs.length) { if (specs.length) {
specs.forEach((specsItem, specsIndex) => { specs.forEach((specsItem, specsIndex) => {
if (isFirstLoops) { if (isFirstLoops && multiSpecList.length < specs.length + 1) {
takeawaySpecList.push(specsItem) multiSpecList.push(specsItem);
} }
if (specsItem.specs.length > 1) { if (specsItem.specs.length > 1) {
specsItem.specs.forEach((itm, idx) => { specsItem.specs.forEach((itm, idx) => {
...@@ -149,30 +169,57 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -149,30 +169,57 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
...temp, ...temp,
specs: [{ ...item }, { ...specsItem.specs[idx] }], specs: [{ ...item }, { ...specsItem.specs[idx] }],
}; };
takeawaySkuTemp.push(params); multiSpu.push(params);
}); });
} else { } else {
const params = { const params = {
...temp, ...temp,
specs: [{ ...item }, { ...specsItem.specs[0] }], specs: [{ ...item }, { ...specsItem.specs[0] }],
}; };
takeawaySkuTemp.push(params); multiSpu.push(params);
} }
isFirstLoops = false
}); });
isFirstLoops = false;
} else { } else {
const params = { const params = {
...temp, ...temp,
specs: [{ ...item }], specs: [{ ...item }],
}; };
takeawaySkuTemp.push(params); multiSpu.push(params);
} }
}); });
} }
} }
console.log('takeawaySkuTemp', takeawaySkuTemp, takeawaySpecList); setMultiSpu(multiSpu);
setTakeawaySku(takeawaySkuTemp); }
setSpecList(takeawaySpecList) // +repertoryType === 1 单规格 2多规格
const intactData = {
type: 5, // 外卖类型
...infoMation,
label,
list,
description,
detailImageList,
singleDelivery,
specList: +repertoryType === 1 ? singularSpecList : multiSpecList, // 单库存和多库存specList
items: +repertoryType === 1 ? singularSpu : multiSpu,
};
console.log('intactData======>', intactData);
setIntactData(intactData);
return intactData;
};
// 设置库存
const modifiedInventory = params => {
const { productStock, maxStock, autoStock } = params;
if (intactData?.items.length) {
intactData.items.forEach(item => {
item.productStock = productStock;
item.serviceItem.autoStock = autoStock;
item.serviceItem.maxStock = maxStock;
});
setIntactData(intactData);
}
return false;
}; };
const onChange = () => {}; const onChange = () => {};
const onDealFinish = values => { const onDealFinish = values => {
...@@ -249,12 +296,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -249,12 +296,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (+e.target.value === 0) { if (+e.target.value === 0) {
form.setFieldsValue({ form.setFieldsValue({
productStock: 0, productStock: 0,
}) });
} else { } else {
const { maxStock } = form.getFieldsValue(['maxStock']) const { maxStock } = form.getFieldsValue(['maxStock']);
form.setFieldsValue({ form.setFieldsValue({
productStock: maxStock, productStock: maxStock,
}) });
} }
}; };
// 最大库存设置 // 最大库存设置
...@@ -263,23 +310,27 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -263,23 +310,27 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
if (+repertoryState === 1) { if (+repertoryState === 1) {
form.setFieldsValue({ form.setFieldsValue({
productStock: e, productStock: e,
}) });
}
} }
};
// 切换时间 // 切换时间
const onChangeTime = e => { const onChangeTime = e => {
setTimeType(e.target.value); setTimeType(e.target.value);
}; };
// 自动补全
const onChangeAutoStock = e => { const onChangeAutoStock = e => {
setTimeType(e.target.value); form.setFieldsValue({
autoStock: e ? 1 : 0,
});
}; };
// 显示加入库存弹框 // 显示加入库存弹框
const showAddRepertoryModal = () => { const showAddRepertoryModal = params => {
AddRepertoryRef.current.setOpenRepertory(true); AddRepertoryRef.current.setOpenRepertory(true);
setRepertoryModel(params);
};
const onFinish = values => {
console.log('Received values of form:', values);
}; };
// const onFinish = values => {
// console.log('Received values of form:', values);
// };
// 拼接sku 名称 // 拼接sku 名称
const calcLabelName = (takeawayData, item) => { const calcLabelName = (takeawayData, item) => {
const tempName = `${takeawayData?.infoMation?.name || ''}`; const tempName = `${takeawayData?.infoMation?.name || ''}`;
...@@ -287,7 +338,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -287,7 +338,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const tempQuantity = `(${item.specs[0]?.quantity || ''}`; const tempQuantity = `(${item.specs[0]?.quantity || ''}`;
const tempUnit = `${item.specs[0]?.unit || ''})`; const tempUnit = `${item.specs[0]?.unit || ''})`;
const tempSecondSpecName = `${item.specs[1]?.specName || ''}`; const tempSecondSpecName = `${item.specs[1]?.specName || ''}`;
const isShow = tempQuantity && tempUnit && '+' const isShow = tempQuantity && tempUnit && '+';
return `${tempName} ${tempSpecName} ${tempQuantity} ${isShow} ${tempUnit} ${tempSecondSpecName}`; return `${tempName} ${tempSpecName} ${tempQuantity} ${isShow} ${tempUnit} ${tempSecondSpecName}`;
}; };
const init = async () => { const init = async () => {
...@@ -478,6 +529,28 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -478,6 +529,28 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Title title="规格信息" /> <Title title="规格信息" />
{/* <Form.Item label="限购" name="limitPurchase" valuePropName="checked">
<Checkbox onChange={() => radioChangeEvent('limitPurchase')}>
<b style={{ marginLeft: 10 }}>启用限购</b>
<span style={{ marginLeft: 10 }} className="ant-form-text">
限制每人可购买数量
</span>
</Checkbox>
</Form.Item> */}
<Form.Item label="库存" name="stock">
<Radio.Group
options={ENUM_REPERTORY}
onChange={onChangeRepertory}
value="1"
buttonStyle="solid"
optionType="button"
/>
</Form.Item>
{repertoryType === '1' && (
<>
<Form.Item label="份量" className={styles.required}> <Form.Item label="份量" className={styles.required}>
<Form.Item <Form.Item
name="quantity" name="quantity"
...@@ -488,7 +561,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -488,7 +561,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
> >
<InputNumber min={1} style={{ width: 200 }} placeholder="请输入数字" /> <InputNumber min={1} style={{ width: 200 }} placeholder="请输入数字" />
</Form.Item> </Form.Item>
<Form.Item {/* <Form.Item
name="unit" name="unit"
rules={[{ type: 'array', required: true, message: '请选择单位' }]} rules={[{ type: 'array', required: true, message: '请选择单位' }]}
style={{ style={{
...@@ -504,7 +577,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -504,7 +577,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
onChange={props.onCategoryChange} onChange={props.onCategoryChange}
options={unitsList} options={unitsList}
/> />
</Form.Item> </Form.Item> */}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="salePrice" name="salePrice"
...@@ -513,28 +586,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -513,28 +586,6 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
> >
<InputNumber min={0} style={{ width: 200 }} placeholder="元" /> <InputNumber min={0} style={{ width: 200 }} placeholder="元" />
</Form.Item> </Form.Item>
{/* <Form.Item label="限购" name="limitPurchase" valuePropName="checked">
<Checkbox onChange={() => radioChangeEvent('limitPurchase')}>
<b style={{ marginLeft: 10 }}>启用限购</b>
<span style={{ marginLeft: 10 }} className="ant-form-text">
限制每人可购买数量
</span>
</Checkbox>
</Form.Item> */}
<Form.Item label="库存" name="stock">
<Radio.Group
options={ENUM_REPERTORY}
onChange={onChangeRepertory}
value="1"
buttonStyle="solid"
optionType="button"
/>
</Form.Item>
{repertoryType === '1' && (
<>
<Form.Item className={styles.itemInline}> <Form.Item className={styles.itemInline}>
<Form.Item <Form.Item
name="productStock" name="productStock"
...@@ -551,12 +602,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -551,12 +602,11 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
placeholder="请输入" placeholder="请输入"
/> />
</Form.Item> </Form.Item>
<Form.Item name="limitPurchase" style={{ width: 200, display: 'inline-block' }}> <Form.Item style={{ width: 200, display: 'inline-block' }}>
<Radio.Group <Radio.Group value={repertoryState} onChange={onChangeSetRepertory}>
options={ENUM_SET_REPERTORY} <Radio.Button value="0">清空</Radio.Button>
onChange={onChangeSetRepertory} <Radio.Button value="1">最大</Radio.Button>
value={1} </Radio.Group>
/>
</Form.Item> </Form.Item>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
...@@ -564,7 +614,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -564,7 +614,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
label="最大库存" label="最大库存"
rules={[{ required: true, message: '请填写最大库存' }]} rules={[{ required: true, message: '请填写最大库存' }]}
> >
<InputNumber min={0} style={{ width: 200 }} placeholder="请输入" onChange={onChangeMaxStock} /> <InputNumber
min={0}
style={{ width: 200 }}
placeholder="请输入"
onChange={onChangeMaxStock}
/>
</Form.Item> </Form.Item>
<Form.Item name="autoStock" label="自动补足"> <Form.Item name="autoStock" label="自动补足">
<Switch <Switch
...@@ -575,6 +630,27 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -575,6 +630,27 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
/> />
<div className={styles.textStyle}>修改成功后,原库存将被替换,请谨慎操作!</div> <div className={styles.textStyle}>修改成功后,原库存将被替换,请谨慎操作!</div>
</Form.Item> </Form.Item>
<div className={styles.rowWarp}>
{singularSpu.length > 0 &&
takeawayData?.infoMation?.name &&
singularSpu.map((item, index) => (
<div className={styles.specsBetween}>
<Form.Item label={calcLabelName(takeawayData, item)}>
<div className={styles.specsBetween}>
<span className={styles.repertoryLimit}>1/1</span>
<div
className={styles.specRepertory}
onClick={() => {
showAddRepertoryModal('singular'); // 单规格库存
}}
>
设置库存
</div>
</div>
</Form.Item>
</div>
))}
</div>
</> </>
)} )}
{repertoryType === '2' && ( {repertoryType === '2' && (
...@@ -728,6 +804,8 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -728,6 +804,8 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
)} )}
</Form.List> */} </Form.List> */}
</Form.Item> </Form.Item>
{takeawayData?.takeawayItem?.weight?.length > 0 && (
<>
<Form.Item> <Form.Item>
<div>添加规格(如加料、甜度、辣度等)</div> <div>添加规格(如加料、甜度、辣度等)</div>
<Form.List name="specs"> <Form.List name="specs">
...@@ -843,16 +921,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -843,16 +921,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
danger danger
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
onClick={() => { onClick={() => {
showAddRepertoryModal(true); showAddRepertoryModal('all'); // 统一库存
}} }}
shape="round" shape="round"
> >
统一设置置库存 统一设置置库存
</Button> </Button>
<div className={styles.rowWarp}> <div className={styles.rowWarp}>
{takeawaySku.length > 0 && {mltiSpu.length > 0 &&
takeawayData?.infoMation?.name && takeawayData?.infoMation?.name &&
takeawaySku.map((item, index) => ( mltiSpu.map((item, index) => (
<div className={styles.specsBetween}> <div className={styles.specsBetween}>
<Form.Item label={calcLabelName(takeawayData, item)}> <Form.Item label={calcLabelName(takeawayData, item)}>
<div className={styles.specsBetween}> <div className={styles.specsBetween}>
...@@ -860,7 +938,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -860,7 +938,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
<div <div
className={styles.specRepertory} className={styles.specRepertory}
onClick={() => { onClick={() => {
showAddRepertoryModal(true); showAddRepertoryModal('mlti'); // 多个库存
}} }}
> >
设置库存 设置库存
...@@ -873,9 +951,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => { ...@@ -873,9 +951,16 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
</Form.Item> </Form.Item>
</> </>
)} )}
</>
)}
</Form> </Form>
{/* 加入库存 */} {/* 加入库存 */}
<AddRepertoryModal ref={AddRepertoryRef} /> <AddRepertoryModal
ref={AddRepertoryRef}
modifiedInventory={modifiedInventory}
intactData={intactData}
repertoryModel={repertoryModel}
/>
{/* 加入多规格 */} {/* 加入多规格 */}
<AddMultiSpecModal ref={AddMultiSpecRef} /> <AddMultiSpecModal ref={AddMultiSpecRef} />
</> </>
......
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