Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
2400a604
Commit
2400a604
authored
Jun 14, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改餐段问题
parent
67e599c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
21 deletions
+53
-21
CustomerInfo.jsx
src/pages/businessCustomer/components/CustomerInfo.jsx
+13
-4
goods.js
src/pages/businessGoods/staticData/goods.js
+11
-10
takeawayGoodsInfo.jsx
src/pages/businessGoods/takeawayGoodsInfo.jsx
+29
-7
No files found.
src/pages/businessCustomer/components/CustomerInfo.jsx
View file @
2400a604
...
@@ -213,10 +213,19 @@ const CustomerInfo = props => {
...
@@ -213,10 +213,19 @@ const CustomerInfo = props => {
const
obj
=
Object
.
assign
({},
res
.
data
);
const
obj
=
Object
.
assign
({},
res
.
data
);
if
(
res
.
data
.
mealTimePeriod
&&
res
.
data
.
mealTimePeriod
.
length
)
{
if
(
res
.
data
.
mealTimePeriod
&&
res
.
data
.
mealTimePeriod
.
length
)
{
const
m
=
moment
().
format
(
'
YYYY-MM-DD
'
);
const
m
=
moment
().
format
(
'
YYYY-MM-DD
'
);
obj
.
mealTimePeriod
=
res
.
data
.
mealTimePeriod
.
map
(
item
=>
({
const
arr
=
Object
.
keys
(
mealSections
);
mealPeriodType
:
`
${
item
.
mealPeriodType
}
`
,
obj
.
mealTimePeriod
=
Object
.
keys
(
mealSections
).
map
(()
=>
({}));
time
:
[
moment
(
`
${
m
}
${
item
.
beginTime
}
`
),
moment
(
`
${
m
}
${
item
.
endTime
}
`
)],
res
.
data
.
mealTimePeriod
.
forEach
((
item
,
i
)
=>
{
}));
if
(
item
)
{
const
index
=
arr
.
indexOf
(
`
${
item
.
mealPeriodType
}
`
);
if
(
index
>
-
1
)
{
obj
.
mealTimePeriod
[
index
]
=
{
mealPeriodType
:
`
${
item
.
mealPeriodType
}
`
,
time
:
[
moment
(
`
${
m
}
${
item
.
beginTime
}
`
),
moment
(
`
${
m
}
${
item
.
endTime
}
`
)],
};
}
}
});
}
else
{
}
else
{
obj
.
mealTimePeriod
=
[];
obj
.
mealTimePeriod
=
[];
}
}
...
...
src/pages/businessGoods/staticData/goods.js
View file @
2400a604
...
@@ -82,7 +82,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -82,7 +82,7 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
SKU编码
'
,
title
:
'
SKU编码
'
,
dataIndex
:
'
skuId
'
,
dataIndex
:
'
skuId
'
,
width
:
1
6
0
,
width
:
1
7
0
,
align
:
'
center
'
,
align
:
'
center
'
,
},
},
{
{
...
@@ -101,7 +101,6 @@ export const takeawayGoodsColumn = options => {
...
@@ -101,7 +101,6 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
可售日期
'
,
title
:
'
可售日期
'
,
dataIndex
:
'
saleDateList
'
,
dataIndex
:
'
saleDateList
'
,
width
:
120
,
align
:
'
center
'
,
align
:
'
center
'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
...
@@ -125,7 +124,6 @@ export const takeawayGoodsColumn = options => {
...
@@ -125,7 +124,6 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
可售餐段
'
,
title
:
'
可售餐段
'
,
dataIndex
:
'
tabCateList
'
,
dataIndex
:
'
tabCateList
'
,
width
:
120
,
align
:
'
center
'
,
align
:
'
center
'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
...
@@ -145,7 +143,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -145,7 +143,7 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
企业价格
'
,
title
:
'
企业价格
'
,
dataIndex
:
'
activityPrice
'
,
dataIndex
:
'
activityPrice
'
,
width
:
1
0
0
,
width
:
1
2
0
,
align
:
'
center
'
,
align
:
'
center
'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
...
@@ -184,7 +182,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -184,7 +182,7 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
排序
'
,
title
:
'
排序
'
,
dataIndex
:
'
sort
'
,
dataIndex
:
'
sort
'
,
width
:
8
0
,
width
:
9
0
,
align
:
'
center
'
,
align
:
'
center
'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
...
@@ -204,8 +202,8 @@ export const takeawayGoodsColumn = options => {
...
@@ -204,8 +202,8 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
列出商品
'
,
title
:
'
列出商品
'
,
dataIndex
:
'
showFlag
'
,
dataIndex
:
'
showFlag
'
,
width
:
80
,
align
:
'
center
'
,
align
:
'
center
'
,
width
:
100
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
render
:
(
_
,
record
)
=>
(
<
Space
>
<
Space
>
...
@@ -217,15 +215,19 @@ export const takeawayGoodsColumn = options => {
...
@@ -217,15 +215,19 @@ export const takeawayGoodsColumn = options => {
},
},
{
{
title
:
'
餐品类型
'
,
title
:
'
餐品类型
'
,
dataIndex
:
'
mealType
'
,
dataIndex
:
'
mealTypeList
'
,
width
:
80
,
align
:
'
center
'
,
align
:
'
center
'
,
hideInSearch
:
true
,
hideInSearch
:
true
,
render
(
arr
)
{
if
(
arr
&&
arr
.
length
)
{
return
arr
.
map
(
item
=>
item
.
name
).
join
(
'
/
'
);
}
return
'
-
'
;
},
},
},
{
{
title
:
'
添加时间
'
,
title
:
'
添加时间
'
,
dataIndex
:
'
createDate
'
,
dataIndex
:
'
createDate
'
,
width
:
120
,
valueType
:
'
dateRange
'
,
valueType
:
'
dateRange
'
,
align
:
'
center
'
,
align
:
'
center
'
,
render
(
v
,
record
)
{
render
(
v
,
record
)
{
...
@@ -235,7 +237,6 @@ export const takeawayGoodsColumn = options => {
...
@@ -235,7 +237,6 @@ export const takeawayGoodsColumn = options => {
{
{
title
:
'
当日餐段
'
,
title
:
'
当日餐段
'
,
dataIndex
:
'
tabId
'
,
dataIndex
:
'
tabId
'
,
width
:
120
,
align
:
'
center
'
,
align
:
'
center
'
,
valueEnum
:
mealColumn
,
valueEnum
:
mealColumn
,
hideInTable
:
true
,
hideInTable
:
true
,
...
...
src/pages/businessGoods/takeawayGoodsInfo.jsx
View file @
2400a604
...
@@ -35,19 +35,41 @@ const TakeawayGoodsInfo = props => {
...
@@ -35,19 +35,41 @@ const TakeawayGoodsInfo = props => {
message
.
error
(
'
请添加商品
'
);
message
.
error
(
'
请添加商品
'
);
return
;
return
;
}
}
const
skuInfoList
=
dataSource
.
map
(
item
=>
({
const
skuInfoList
=
[];
skuId
:
item
.
skuId
,
try
{
enterprisePrice
:
item
.
enterprisePrice
,
dataSource
.
forEach
(
item
=>
{
mealTypeList
:
item
.
mealTypeList
.
map
(
m
=>
m
.
code
),
if
(
!
item
.
mealTypeList
||
item
.
mealTypeList
.
length
<
1
)
{
saleDateList
:
item
.
saleDate
,
throw
Error
(
'
请添加餐品类型!
'
);
tabCateList
:
item
.
tabCate
.
map
(
t
=>
({
tabId
:
t
})),
}
}));
if
(
!
item
.
enterprisePrice
||
item
.
enterprisePrice
.
length
<
1
)
{
throw
Error
(
'
请添加企业价格!
'
);
}
if
(
!
item
.
saleDate
||
item
.
saleDate
.
length
<
1
)
{
throw
Error
(
'
请添加可售日期!
'
);
}
if
(
!
item
.
tabCate
||
item
.
tabCate
.
length
<
1
)
{
throw
Error
(
'
请添加可售餐段!
'
);
}
const
json
=
{
skuId
:
item
.
skuId
,
enterprisePrice
:
item
.
enterprisePrice
,
mealTypeList
:
item
.
mealTypeList
.
map
(
m
=>
m
.
code
),
saleDateList
:
item
.
saleDate
,
tabCateList
:
item
.
tabCate
.
map
(
t
=>
({
tabId
:
t
})),
};
skuInfoList
.
push
(
json
);
});
}
catch
(
e
)
{
message
.
error
(
e
.
message
);
return
;
}
const
params
=
{
const
params
=
{
shopId
,
shopId
,
enterpriseId
:
id
,
enterpriseId
:
id
,
pickSelfIdList
:
slePickSelf
,
pickSelfIdList
:
slePickSelf
,
skuInfoList
,
skuInfoList
,
};
};
console
.
log
(
'
params :>>
'
,
params
);
const
res
=
await
apiSaveGoodsList
(
params
);
const
res
=
await
apiSaveGoodsList
(
params
);
if
(
res
&&
res
.
success
)
{
if
(
res
&&
res
.
success
)
{
notification
.
success
({
message
:
'
添加成功
'
});
notification
.
success
({
message
:
'
添加成功
'
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment