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
cfd1f819
Commit
cfd1f819
authored
Jun 15, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改回显问题
parent
b28c7ec1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
111 additions
and
34 deletions
+111
-34
GoodPriceModal.jsx
src/pages/businessGoods/components/GoodPriceModal.jsx
+2
-2
GoodSortModal.jsx
src/pages/businessGoods/components/GoodSortModal.jsx
+8
-3
SaleDateModal.jsx
src/pages/businessGoods/components/SaleDateModal.jsx
+14
-2
SaleSectionModal.jsx
src/pages/businessGoods/components/SaleSectionModal.jsx
+11
-1
SelectGoodsModal.jsx
src/pages/businessGoods/components/SelectGoodsModal.jsx
+3
-2
goods.js
src/pages/businessGoods/staticData/goods.js
+44
-11
index.less
src/pages/businessGoods/style/index.less
+6
-0
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+6
-0
takeawayGoodsInfo.jsx
src/pages/businessGoods/takeawayGoodsInfo.jsx
+10
-9
virtualGoodsInfo.jsx
src/pages/businessGoods/virtualGoodsInfo.jsx
+7
-4
No files found.
src/pages/businessGoods/components/GoodPriceModal.jsx
View file @
cfd1f819
...
...
@@ -19,7 +19,6 @@ const SaleDateModal = props => {
// 提交
const
handleConfirm
=
async
()
=>
{
const
res
=
await
form
.
validateFields
();
console
.
log
(
'
res :>>
'
,
res
);
if
(
props
.
id
)
{
const
params
=
{
id
:
props
.
id
,
...
...
@@ -34,7 +33,8 @@ const SaleDateModal = props => {
useEffect
(()
=>
{
if
(
props
.
visible
)
{
form
.
setFieldsValue
({
price
:
null
});
const
price
=
props
.
item
?.
enterprisePrice
||
props
.
item
?.
activityPrice
||
null
;
form
.
setFieldsValue
({
price
});
}
},
[
props
.
visible
]);
...
...
src/pages/businessGoods/components/GoodSortModal.jsx
View file @
cfd1f819
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
Form
,
InputNumber
,
Modal
,
notification
}
from
'
antd
'
;
import
{
layout
}
from
'
../staticData/goods
'
;
import
{
apiMealInfoUpdate
}
from
'
../service
'
;
const
SaleDateModal
=
props
=>
{
const
[
form
]
=
Form
.
useForm
();
const
layout
=
{
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
14
},
};
// 关闭弹窗
const
handleCancel
=
()
=>
{
props
.
handleClose
(
false
);
...
...
@@ -27,7 +31,8 @@ const SaleDateModal = props => {
useEffect
(()
=>
{
if
(
props
.
visible
)
{
form
.
setFieldsValue
({
sort
:
null
});
const
sort
=
props
.
item
?.
sort
||
1000
;
form
.
setFieldsValue
({
sort
});
}
},
[
props
.
visible
]);
...
...
@@ -42,7 +47,7 @@ const SaleDateModal = props => {
onOk=
{
handleConfirm
}
onCancel=
{
handleCancel
}
>
<
Form
name=
"basicInfo"
initialValues=
{
{
sort
:
1000
}
}
{
...
layout
}
form=
{
form
}
>
<
Form
name=
"basicInfo"
{
...
layout
}
form=
{
form
}
>
<
Form
.
Item
label=
"排序"
name=
"sort"
rules=
{
[{
required
:
true
,
message
:
'
请输入排序!
'
}]
}
>
<
InputNumber
max=
{
999999
}
min=
{
1
}
/>
</
Form
.
Item
>
...
...
src/pages/businessGoods/components/SaleDateModal.jsx
View file @
cfd1f819
...
...
@@ -35,7 +35,17 @@ const SaleDateModal = props => {
useEffect
(()
=>
{
if
(
props
.
visible
)
{
setValue
([]);
let
v
=
[];
const
dateList
=
props
.
item
?.
saleDateList
||
props
.
item
?.
saleDate
;
if
(
dateList
&&
dateList
.
length
)
{
v
=
dateList
.
map
(
item
=>
{
if
(
typeof
item
===
'
object
'
)
{
return
`
${
item
.
code
}
`
;
}
return
`
${
item
}
`
;
});
}
setValue
(
v
);
}
},
[
props
.
visible
]);
...
...
@@ -53,7 +63,9 @@ const SaleDateModal = props => {
<
Checkbox
.
Group
onChange=
{
onChangeWeek
}
value=
{
value
}
>
<
Space
direction=
"vertical"
>
{
Object
.
keys
(
weekOptions
).
map
(
key
=>
(
<
Checkbox
value=
{
key
}
>
{
weekOptions
[
key
]
}
</
Checkbox
>
<
Checkbox
key=
{
key
}
value=
{
key
}
>
{
weekOptions
[
key
]
}
</
Checkbox
>
))
}
</
Space
>
</
Checkbox
.
Group
>
...
...
src/pages/businessGoods/components/SaleSectionModal.jsx
View file @
cfd1f819
...
...
@@ -35,7 +35,17 @@ const SaleDateModal = props => {
useEffect
(()
=>
{
if
(
props
.
visible
)
{
setValue
([]);
let
v
=
[];
const
tabCate
=
props
.
item
.
tabCateList
||
props
.
item
.
tabCate
;
if
(
tabCate
&&
tabCate
.
length
)
{
v
=
tabCate
.
map
(
item
=>
{
if
(
typeof
item
===
'
object
'
)
{
return
`
${
item
.
tabId
}
`
;
}
return
`
${
item
}
`
;
});
}
setValue
(
v
);
}
},
[
props
.
visible
]);
...
...
src/pages/businessGoods/components/SelectGoodsModal.jsx
View file @
cfd1f819
...
...
@@ -3,7 +3,7 @@ import { Select, Modal, Table, Input, Button, Pagination, notification } from 'a
import
{
SearchOutlined
}
from
'
@ant-design/icons
'
;
import
{
apiSelGoodsList
,
apiSelVirtualGoodsList
,
apiShopListByPickSelfID
}
from
'
../service
'
;
import
{
getShopListByPickSelf
}
from
'
../service/bll
'
;
import
{
SelectGoodsColumn
,
productType
}
from
'
../staticData/goods
'
;
import
{
SelectGoodsColumn
,
productType
,
weekOptions
}
from
'
../staticData/goods
'
;
import
style
from
'
../style/index.less
'
;
import
{
jsonToArray
,
deepClone
}
from
'
@/utils/utils
'
;
...
...
@@ -11,7 +11,7 @@ const { Option } = Select;
const
SaleDateModal
=
props
=>
{
const
[
searchType
,
setSearchType
]
=
useState
(
'
1
'
);
const
[
searchKeyword
,
setSearchKeyword
]
=
useState
(
''
);
const
[
shopId
,
setShopId
]
=
useState
(
props
.
shopID
);
const
[
shopId
,
setShopId
]
=
useState
(
props
.
shopID
||
null
);
const
[
shopName
,
setShopName
]
=
useState
(
''
);
const
[
searchName
,
setSearchName
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -106,6 +106,7 @@ const SaleDateModal = props => {
const
arr
=
deepClone
(
selectedRows
).
map
(
item
=>
({
...
item
,
shopId
,
saleDate
:
Object
.
keys
(
weekOptions
),
shopName
:
sName
,
}));
props
.
onSelectChange
(
arr
);
...
...
src/pages/businessGoods/staticData/goods.js
View file @
cfd1f819
import
React
from
'
react
'
;
import
{
Button
,
Space
,
Switch
}
from
'
antd
'
;
import
{
FormOutlined
}
from
'
@ant-design/icons
'
;
import
{
jsonToArray
}
from
'
@/utils/utils
'
;
import
{
getShopList
}
from
'
../service/bll
'
;
import
style
from
'
../style/index.less
'
;
export
const
layout
=
{
labelCol
:
{
span
:
4
},
...
...
@@ -50,6 +50,7 @@ export const takeawayGoodsColumn = options => {
setVisibleSaleDate
,
enterprises
,
setRecordID
,
setEditItem
,
setVisiblePrice
,
setVisibleSaleSection
,
setVisibleSort
,
...
...
@@ -105,14 +106,18 @@ export const takeawayGoodsColumn = options => {
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
<
Space
>
{
_
&&
_
.
length
&&
(
{
_
&&
_
.
length
?
(
<
div
>
{
_
.
length
===
7
?
'
不限制
'
:
<
span
>
{
_
.
map
(
item
=>
item
.
name
).
join
(
'
/
'
)}
<
/span>
}
<
/div
>
)
:
(
<
span
>-<
/span
>
)}
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setRecordID
(
record
.
id
);
setEditItem
(
record
);
setVisibleSaleDate
(
true
);
}}
>
...
...
@@ -128,10 +133,12 @@ export const takeawayGoodsColumn = options => {
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
<
Space
>
{
_
&&
_
.
length
&&
<
span
>
{
_
.
map
(
item
=>
item
.
tabName
).
join
(
'
/
'
)}
<
/span>
}
{
_
&&
_
.
length
?
<
span
>
{
_
.
map
(
item
=>
item
.
tabName
).
join
(
'
/
'
)}
<
/span> : <span>-
</
span
>
}
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setRecordID
(
record
.
id
);
setEditItem
(
record
);
setVisibleSaleSection
(
true
);
}}
>
...
...
@@ -150,8 +157,10 @@ export const takeawayGoodsColumn = options => {
<
Space
>
<
span
>
{
_
}
<
/span
>
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setRecordID
(
record
.
id
);
setEditItem
(
record
);
setVisiblePrice
(
true
);
}}
>
...
...
@@ -189,8 +198,10 @@ export const takeawayGoodsColumn = options => {
<
Space
>
<
span
>
{
_
}
<
/span
>
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setRecordID
(
record
.
id
);
setEditItem
(
record
);
setVisibleSort
(
true
);
}}
>
...
...
@@ -235,7 +246,7 @@ export const takeawayGoodsColumn = options => {
},
},
{
title
:
'
当日
餐段
'
,
title
:
'
可售
餐段
'
,
dataIndex
:
'
tabId
'
,
align
:
'
center
'
,
valueEnum
:
mealColumn
,
...
...
@@ -258,7 +269,13 @@ export const takeawayGoodsColumn = options => {
};
export
const
GoodsInfoColumn
=
options
=>
{
const
{
onDel
,
setVisibleSaleDate
,
setVisibleSaleSection
,
setEditID
,
setVisiblePrice
}
=
options
;
const
{
onDel
,
setVisibleSaleDate
,
setVisibleSaleSection
,
setEditItem
,
setVisiblePrice
,
}
=
options
;
return
[
{
title
:
'
微店名称
'
,
...
...
@@ -284,8 +301,9 @@ export const GoodsInfoColumn = options => {
<
Space
>
<
span
>
{
_
}
<
/span
>
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditI
D
(
record
.
skuI
d
);
setEditI
tem
(
recor
d
);
setVisiblePrice
(
true
);
}}
>
...
...
@@ -317,11 +335,21 @@ export const GoodsInfoColumn = options => {
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
<
Space
>
{
_
&&
(
_
.
length
===
7
?
'
不限制
'
:
<
span
>
{
_
.
map
(
item
=>
weekOptions
[
item
]).
join
(
'
/
'
)}
<
/span>
)
}
{
_
&&
_
.
length
?
(
<
div
>
{
_
.
length
===
7
?
(
'
不限制
'
)
:
(
<
span
>
{
_
.
map
(
item
=>
weekOptions
[
item
]).
join
(
'
/
'
)}
<
/span
>
)}
<
/div
>
)
:
(
<
span
>-<
/span
>
)}
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditI
D
(
record
.
skuI
d
);
setEditI
tem
(
recor
d
);
setVisibleSaleDate
(
true
);
}}
>
...
...
@@ -337,10 +365,15 @@ export const GoodsInfoColumn = options => {
hideInSearch
:
true
,
render
:
(
_
,
record
)
=>
(
<
Space
>
<
span
>
{
_
&&
_
.
map
(
item
=>
mealColumn
[
item
]).
join
(
'
/
'
)}
<
/span
>
{
_
&&
_
.
length
?
(
<
span
>
{
_
.
map
(
item
=>
mealColumn
[
item
]).
join
(
'
/
'
)}
<
/span
>
)
:
(
<
span
className
=
{
style
.
columnTip
}
>
请配置
<
/span
>
)}
<
span
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditI
D
(
record
.
skuI
d
);
setEditI
tem
(
recor
d
);
setVisibleSaleSection
(
true
);
}}
>
...
...
src/pages/businessGoods/style/index.less
View file @
cfd1f819
...
...
@@ -59,3 +59,9 @@
color: #1890ff;
}
}
.columnTip {
color: #999;
}
.columnBtnEdit {
cursor: pointer;
}
src/pages/businessGoods/takeawayGoods.jsx
View file @
cfd1f819
...
...
@@ -32,6 +32,7 @@ const TakeawayGoods = () => {
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
();
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
recordID
,
setRecordID
]
=
useState
(
''
);
// 编辑的记录ID
const
[
editItem
,
setEditItem
]
=
useState
({});
// 编辑的记录信息
// 刷新列表
const
onRefresh
=
()
=>
{
...
...
@@ -158,6 +159,7 @@ const TakeawayGoods = () => {
setVisibleSort
,
onDel
,
setRecordID
,
setEditItem
,
enterprises
,
onChangeEnterprise
,
onChangeFlag
,
...
...
@@ -207,6 +209,7 @@ const TakeawayGoods = () => {
<
SaleDateModal
visible=
{
visibleSaleDate
}
id=
{
recordID
}
item=
{
editItem
}
handleRefresh=
{
()
=>
onRefresh
()
}
handleClose=
{
()
=>
setVisibleSaleDate
(
false
)
}
/>
...
...
@@ -216,6 +219,7 @@ const TakeawayGoods = () => {
<
SaleSectionModal
visible=
{
visibleSaleSection
}
id=
{
recordID
}
item=
{
editItem
}
handleRefresh=
{
()
=>
onRefresh
()
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
/>
...
...
@@ -225,6 +229,7 @@ const TakeawayGoods = () => {
<
GoodPriceModal
visible=
{
visiblePrice
}
id=
{
recordID
}
item=
{
editItem
}
handleRefresh=
{
()
=>
onRefresh
()
}
handleClose=
{
()
=>
setVisiblePrice
(
false
)
}
/>
...
...
@@ -234,6 +239,7 @@ const TakeawayGoods = () => {
<
GoodSortModal
visible=
{
visibleSort
}
id=
{
recordID
}
item=
{
editItem
}
handleRefresh=
{
()
=>
onRefresh
()
}
handleClose=
{
()
=>
setVisibleSort
(
false
)
}
/>
...
...
src/pages/businessGoods/takeawayGoodsInfo.jsx
View file @
cfd1f819
...
...
@@ -22,7 +22,7 @@ const TakeawayGoodsInfo = props => {
const
[
dataSource
,
setDataSource
]
=
useState
([]);
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
slePickSelf
,
setSelPickSelf
]
=
useState
([]);
// 选中的取餐点列表
const
[
editI
D
,
setEditID
]
=
useState
(
''
);
// 编辑ID
const
[
editI
tem
,
setEditItem
]
=
useState
({});
// 编辑信息
const
[
shopId
,
setShopId
]
=
useState
(
''
);
// 店铺ID
// 取消
...
...
@@ -109,8 +109,8 @@ const TakeawayGoodsInfo = props => {
// 刷新列表数据
const
refreshList
=
(
type
,
v
)
=>
{
const
arr
=
dataSource
.
map
(
item
=>
{
if
(
editI
D
)
{
if
(
item
.
skuId
===
editID
)
{
if
(
editI
tem
.
skuId
)
{
if
(
`
${
item
.
skuId
}
`
===
`
${
editItem
.
skuId
}
`
)
{
item
[
type
]
=
v
;
}
}
else
{
...
...
@@ -130,9 +130,6 @@ const TakeawayGoodsInfo = props => {
setVisibleSelectGoods
(
true
);
};
// const initData = async () => {
// setLoading(true);
// };
useEffect
(()
=>
{
getPickSelf
();
getSelPickSelf
();
...
...
@@ -141,7 +138,7 @@ const TakeawayGoodsInfo = props => {
const
options
=
{
setVisibleSaleDate
,
setVisibleSaleSection
,
setEditI
D
,
setEditI
tem
,
onDel
,
setVisiblePrice
,
};
...
...
@@ -190,7 +187,7 @@ const TakeawayGoodsInfo = props => {
<
div
className=
{
style
[
'
info-box--batch-btn
'
]
}
>
<
Button
onClick=
{
()
=>
{
setEditI
D
(
''
);
setEditI
tem
({}
);
setVisibleSaleDate
(
true
);
}
}
>
...
...
@@ -198,7 +195,7 @@ const TakeawayGoodsInfo = props => {
</
Button
>
<
Button
onClick=
{
()
=>
{
setEditI
D
(
''
);
setEditI
tem
({}
);
setVisibleSaleSection
(
true
);
}
}
>
...
...
@@ -230,6 +227,7 @@ const TakeawayGoodsInfo = props => {
{
visibleSaleDate
&&
(
<
SaleDateModal
visible=
{
visibleSaleDate
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
saleDate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleDate
(
false
)
}
/>
...
...
@@ -238,6 +236,7 @@ const TakeawayGoodsInfo = props => {
{
visibleSaleSection
&&
(
<
SaleSectionModal
visible=
{
visibleSaleSection
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
tabCate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
/>
...
...
@@ -246,6 +245,7 @@ const TakeawayGoodsInfo = props => {
{
visiblePrice
&&
(
<
GoodPriceModal
visible=
{
visiblePrice
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
enterprisePrice
'
,
v
)
}
handleClose=
{
()
=>
setVisiblePrice
(
false
)
}
/>
...
...
@@ -258,6 +258,7 @@ const TakeawayGoodsInfo = props => {
productType=
{
5
}
pickSelfIdList=
{
slePickSelf
}
shopID=
{
shopId
}
item=
{
editItem
}
onChangeShop=
{
setShopId
}
onSelectChange=
{
setDataSource
}
handleClose=
{
()
=>
setVisibleSelectGoods
(
false
)
}
...
...
src/pages/businessGoods/virtualGoodsInfo.jsx
View file @
cfd1f819
...
...
@@ -25,7 +25,7 @@ const VirtualGoodsInfo = props => {
const
[
sleShopID
,
setSelShopID
]
=
useState
(
''
);
// 选中的店铺ID
const
[
sleShopName
,
setSelShopName
]
=
useState
(
''
);
// 选中的店铺名称
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
editI
D
,
setEditID
]
=
useState
(
''
);
// 编辑ID
const
[
editI
tem
,
setEditItem
]
=
useState
({});
// 编辑信息
// 取消
const
onCancel
=
()
=>
{
...
...
@@ -148,8 +148,8 @@ const VirtualGoodsInfo = props => {
// 刷新列表数据
const
refreshList
=
(
type
,
v
)
=>
{
const
arr
=
dataSource
.
map
(
item
=>
{
if
(
editI
D
)
{
if
(
item
.
skuId
===
editID
)
{
if
(
editI
tem
.
skuId
)
{
if
(
`
${
item
.
skuId
}
`
===
`
${
editItem
.
skuId
}
`
)
{
item
[
type
]
=
v
;
}
}
else
{
...
...
@@ -167,7 +167,7 @@ const VirtualGoodsInfo = props => {
const
options
=
{
setVisibleSaleDate
,
setVisibleSaleSection
,
setEditI
D
,
setEditI
tem
,
setVisiblePrice
,
onDel
,
};
...
...
@@ -233,6 +233,7 @@ const VirtualGoodsInfo = props => {
{
visibleSaleDate
&&
(
<
SaleDateModal
visible=
{
visibleSaleDate
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
saleDate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleDate
(
false
)
}
/>
...
...
@@ -241,6 +242,7 @@ const VirtualGoodsInfo = props => {
{
visibleSaleSection
&&
(
<
SaleSectionModal
visible=
{
visibleSaleSection
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
tabCate
'
,
v
)
}
handleClose=
{
()
=>
setVisibleSaleSection
(
false
)
}
/>
...
...
@@ -249,6 +251,7 @@ const VirtualGoodsInfo = props => {
{
visiblePrice
&&
(
<
GoodPriceModal
visible=
{
visiblePrice
}
item=
{
editItem
}
handleRefresh=
{
v
=>
refreshList
(
'
enterprisePrice
'
,
v
)
}
handleClose=
{
()
=>
setVisiblePrice
(
false
)
}
/>
...
...
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