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

feat: 更新时间问题

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