Commit e3c3c17b authored by 陈万宝's avatar 陈万宝

feat: 更新时间问题

parent 5d4359f5
......@@ -215,8 +215,12 @@
.ant-form-item-control-input-content {
display: flex;
}
.ant-form-text {
display: flex;
justify-content: center;
align-items: center;
}
}
}
.itemInline {
:global {
......
......@@ -214,7 +214,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
const sepcx = specs.map(item => item.specs);
sepcx.map(item => {
item.unit = '';
return item
return item;
});
// 生成 specs 规格sku
tempSku = [[...weight], ...sepcx].reduce(
......@@ -231,7 +231,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
obj.salePrice = salePrice;
obj.productStock = productStock;
obj.list = list;
obj.id = multiSpu?.[index]?.id || ''
obj.id = multiSpu?.[index]?.id || '';
obj.serviceItem = {
...temp.serviceItem,
productStock: multiSpu?.[index]?.serviceItem?.productStock || productStock,
......@@ -730,7 +730,9 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
) : null}
</Form.Item>
))}
<Form.Item>
{fields.length < 5 ? (
<Button
type="dashed"
onClick={() => add()}
......@@ -739,6 +741,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
>
新增售卖时段
</Button>
) : null}
</Form.Item>
</>
)}
......@@ -787,12 +790,21 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
{repertoryType === '1' && (
<>
<Form.Item label="份量" className={styles.required}>
{form.getFieldValue(['unit']) &&
Array.isArray(form.getFieldValue(['unit'])) &&
weightUnits.includes(
form
.getFieldValue(['unit'])
.slice(1)
.toString(),
) && <span className="ant-form-text"> 约</span>}
<Form.Item
// noStyle
shouldUpdate={(prevValues, curValues) => false}
>
{form => {
let unit = form.getFieldValue('unit') || '';
console.log('unit', unit);
unit =
(unit && (Array.isArray(unit) && unit?.length && unit?.slice(1).toString())) ||
unit;
......@@ -1222,7 +1234,7 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
}}
shape="round"
>
统一设置库存
统一设置库存
</Button>
<div className={styles.rowWarp}>
{multiSpu.length > 0 &&
......
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