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
1515ae21
Commit
1515ae21
authored
Jun 16, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改虚拟商品切换店铺没有清空问题
parent
9da949ff
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
24 deletions
+93
-24
SelectGoodsModal.jsx
src/pages/businessGoods/components/SelectGoodsModal.jsx
+9
-1
bll.js
src/pages/businessGoods/service/bll.js
+20
-7
goods.js
src/pages/businessGoods/staticData/goods.js
+44
-10
index.less
src/pages/businessGoods/style/index.less
+11
-1
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+3
-2
virtualGoods.jsx
src/pages/businessGoods/virtualGoods.jsx
+3
-2
virtualGoodsInfo.jsx
src/pages/businessGoods/virtualGoodsInfo.jsx
+3
-1
No files found.
src/pages/businessGoods/components/SelectGoodsModal.jsx
View file @
1515ae21
...
...
@@ -193,8 +193,12 @@ const SaleDateModal = props => {
onSelect
:
onSelectChange
,
onSelectAll
:
onSelectAllChange
,
};
const
onChangeSearchType
=
v
=>
{
setSearchType
(
v
);
setSearchName
(
''
);
};
const
selectBefore
=
(
<
Select
defaultValue=
"1"
onChange=
{
set
SearchType
}
>
<
Select
defaultValue=
"1"
onChange=
{
onChange
SearchType
}
>
<
Option
value=
"1"
key=
{
1
}
>
名称
</
Option
>
...
...
@@ -264,7 +268,11 @@ const SaleDateModal = props => {
<
Input
addonBefore=
{
selectBefore
}
addonAfter=
{
selectAfter
}
value=
{
searchName
}
allowClear
type=
{
+
searchType
===
2
?
'
number
'
:
'
text
'
}
onChange=
{
e
=>
setSearchName
(
e
.
target
.
value
)
}
onPressEnter=
{
onSearch
}
className=
{
style
[
'
select-goods-box--txt
'
]
}
/>
</
div
>
...
...
src/pages/businessGoods/service/bll.js
View file @
1515ae21
...
...
@@ -9,18 +9,19 @@ export const getEnterpriseList = async (param = {}) => {
});
if
(
res
&&
res
.
data
&&
res
.
data
.
records
)
{
const
data
=
res
.
data
.
records
;
const
json
=
{};
data
.
forEach
(
item
=>
{
json
[
item
.
id
]
=
{
text
:
item
.
name
};
});
const
arr
=
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
id
,
key
:
item
.
id
,
}));
return
{
id
:
data
[
data
.
length
-
1
].
id
,
list
:
json
,
id
:
data
[
0
].
id
,
list
:
arr
,
};
}
return
{
id
:
''
,
list
:
{}
,
list
:
[]
,
};
};
// 获取店铺列表
...
...
@@ -57,3 +58,15 @@ export const getShopListByPickSelf = async e => {
list
:
{},
};
};
// 获取店铺名称
export
const
getEnterpriseName
=
(
arr
,
id
)
=>
{
let
name
=
''
;
if
(
arr
&&
arr
.
length
)
{
arr
.
forEach
(
item
=>
{
if
(
+
item
.
value
===
+
id
)
{
name
=
item
.
label
;
}
});
}
return
name
;
};
src/pages/businessGoods/staticData/goods.js
View file @
1515ae21
...
...
@@ -8,7 +8,7 @@ export const layout = {
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
18
},
};
// 0-推荐 1-早餐 2-午餐 3-下午茶 4-晚餐
//
餐段
0-推荐 1-早餐 2-午餐 3-下午茶 4-晚餐
export
const
mealColumn
=
{
// 0: '推荐',
1
:
'
早餐
'
,
...
...
@@ -43,12 +43,14 @@ export const weekOptions = {
7
:
'
周日
'
,
};
// 外卖商品列表字段
export
const
takeawayGoodsColumn
=
options
=>
{
const
{
onDel
,
onChangeFlag
,
setVisibleSaleDate
,
enterprises
,
enterpriseId
,
setRecordID
,
setEditItem
,
setVisiblePrice
,
...
...
@@ -61,12 +63,15 @@ export const takeawayGoodsColumn = options => {
title
:
'
企业名称
'
,
dataIndex
:
'
enterpriseId
'
,
hideInTable
:
true
,
valueType
:
'
select
'
,
fieldProps
:
{
value
:
+
enterpriseId
,
showSearch
:
true
,
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
onChange
:
onChangeEnterprise
,
options
:
enterprises
,
allowClear
:
false
,
},
valueEnum
:
enterprises
,
},
{
title
:
'
微店名称
'
,
...
...
@@ -80,6 +85,12 @@ export const takeawayGoodsColumn = options => {
request
:
getShopList
,
valueEnum
:
{},
},
{
title
:
'
微店名称
'
,
dataIndex
:
'
shopName
'
,
hideInSearch
:
true
,
align
:
'
center
'
,
},
{
title
:
'
SKU编码
'
,
dataIndex
:
'
skuId
'
,
...
...
@@ -268,6 +279,7 @@ export const takeawayGoodsColumn = options => {
];
};
// 添加商品列表字段
export
const
GoodsInfoColumn
=
options
=>
{
const
{
onDel
,
...
...
@@ -299,8 +311,9 @@ export const GoodsInfoColumn = options => {
align
:
'
center
'
,
render
:
(
_
,
record
)
=>
(
<
Space
>
<
span
>
{
_
}
<
/span
>
<
span
key
=
"
1
"
>
{
_
}
<
/span
>
<
span
key
=
"
2
"
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditItem
(
record
);
...
...
@@ -336,17 +349,18 @@ export const GoodsInfoColumn = options => {
render
:
(
_
,
record
)
=>
(
<
Space
>
{
_
&&
_
.
length
?
(
<
div
>
<
div
key
=
"
1
"
>
{
_
.
length
===
7
?
(
'
不限制
'
)
:
(
<
span
>
{
_
.
map
(
item
=>
weekOptions
[
item
]).
join
(
'
/
'
)}
<
/span
>
<
span
key
=
"
3
"
>
{
_
.
map
(
item
=>
weekOptions
[
item
]).
join
(
'
/
'
)}
<
/span
>
)}
<
/div
>
)
:
(
<
span
>-<
/span
>
<
span
key
=
"
2
"
>-<
/span
>
)}
<
span
key
=
"
4
"
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditItem
(
record
);
...
...
@@ -366,11 +380,14 @@ export const GoodsInfoColumn = options => {
render
:
(
_
,
record
)
=>
(
<
Space
>
{
_
&&
_
.
length
?
(
<
span
>
{
_
.
map
(
item
=>
mealColumn
[
item
]).
join
(
'
/
'
)}
<
/span
>
<
span
key
=
"
1
"
>
{
_
.
map
(
item
=>
mealColumn
[
item
]).
join
(
'
/
'
)}
<
/span
>
)
:
(
<
span
className
=
{
style
.
columnTip
}
>
请配置
<
/span
>
<
span
key
=
"
2
"
className
=
{
style
.
columnTip
}
>
请配置
<
/span
>
)}
<
span
key
=
"
3
"
className
=
{
style
.
columnBtnEdit
}
onClick
=
{()
=>
{
setEditItem
(
record
);
...
...
@@ -411,6 +428,7 @@ export const GoodsInfoColumn = options => {
];
};
// 选择商品弹窗字段
export
const
SelectGoodsColumn
=
[
{
title
:
'
商品ID
'
,
...
...
@@ -458,18 +476,21 @@ export const SelectGoodsColumn = [
// 企业虚拟商品列表字段
export
const
virtualGoodsColumn
=
options
=>
{
const
{
onDel
,
enterprises
,
onChangeEnterprise
}
=
options
;
const
{
onDel
,
enterprises
,
enterpriseId
,
onChangeEnterprise
}
=
options
;
return
[
{
title
:
'
企业名称
'
,
dataIndex
:
'
enterpriseId
'
,
hideInTable
:
true
,
valueType
:
'
select
'
,
fieldProps
:
{
value
:
+
enterpriseId
,
showSearch
:
true
,
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
onChange
:
onChangeEnterprise
,
options
:
enterprises
,
allowClear
:
false
,
},
valueEnum
:
enterprises
,
// companyEnum,
},
{
title
:
'
微店名称
'
,
...
...
@@ -483,6 +504,12 @@ export const virtualGoodsColumn = options => {
request
:
getShopList
,
valueEnum
:
{},
// shopEnum,
},
{
title
:
'
微店名称
'
,
dataIndex
:
'
shopName
'
,
hideInSearch
:
true
,
align
:
'
center
'
,
},
{
title
:
'
SKU编码
'
,
dataIndex
:
'
skuId
'
,
...
...
@@ -582,6 +609,13 @@ export const virtualGoodsColumn = options => {
return
record
.
createDate
;
},
},
{
title
:
'
可售餐段
'
,
dataIndex
:
'
tabId
'
,
align
:
'
center
'
,
valueEnum
:
mealColumn
,
hideInTable
:
true
,
},
{
title
:
'
操作
'
,
hideInSearch
:
true
,
...
...
src/pages/businessGoods/style/index.less
View file @
1515ae21
...
...
@@ -39,7 +39,17 @@
width: 200px;
}
.select-goods-box--txt {
width: 260px;
width: 300px;
:global {
.ant-input::-webkit-inner-spin-button,
.ant-input::-webkit-outer-spin-button {
margin: 0;
-webkit-appearance: none;
}
.ant-input {
-webkit-appearance: textfield;
}
}
}
}
.footers {
...
...
src/pages/businessGoods/takeawayGoods.jsx
View file @
1515ae21
...
...
@@ -11,7 +11,7 @@ import {
apiTakeawayGoodsDel
,
apiMealInfoUpdate
,
}
from
'
./service
'
;
import
{
getEnterpriseList
}
from
'
./service/bll
'
;
import
{
getEnterpriseList
,
getEnterpriseName
}
from
'
./service/bll
'
;
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
GoodPriceModal
from
'
./components/GoodPriceModal
'
;
...
...
@@ -85,7 +85,7 @@ const TakeawayGoods = () => {
const
query
=
Object
.
assign
(
{
id
:
enterpriseId
,
name
:
enterprises
[
enterpriseId
].
text
,
name
:
getEnterpriseName
(
enterprises
,
enterpriseId
)
,
},
params
,
);
...
...
@@ -160,6 +160,7 @@ const TakeawayGoods = () => {
onDel
,
setRecordID
,
setEditItem
,
enterpriseId
,
enterprises
,
onChangeEnterprise
,
onChangeFlag
,
...
...
src/pages/businessGoods/virtualGoods.jsx
View file @
1515ae21
...
...
@@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons';
import
{
virtualGoodsColumn
}
from
'
./staticData/goods
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
{
apiVirtualList
,
apiVirtualGoodsDel
}
from
'
./service
'
;
import
{
getEnterpriseList
}
from
'
./service/bll
'
;
import
{
getEnterpriseList
,
getEnterpriseName
}
from
'
./service/bll
'
;
import
{
getToUrlQuery
}
from
'
@/utils/utils
'
;
// 企业虚拟商品
...
...
@@ -67,7 +67,7 @@ const VirtualGoods = () => {
const
query
=
Object
.
assign
(
{
id
:
enterpriseId
,
name
:
enterprises
[
enterpriseId
].
text
,
name
:
getEnterpriseName
(
enterprises
,
enterpriseId
)
,
},
params
,
);
...
...
@@ -101,6 +101,7 @@ const VirtualGoods = () => {
const
options
=
{
onDel
,
enterprises
,
enterpriseId
,
onChangeEnterprise
,
};
...
...
src/pages/businessGoods/virtualGoodsInfo.jsx
View file @
1515ae21
...
...
@@ -135,6 +135,8 @@ const VirtualGoodsInfo = props => {
}),
);
setSelectedRowKeys
(
keys
);
}
else
{
setDataSource
([]);
}
};
...
...
@@ -212,7 +214,7 @@ const VirtualGoodsInfo = props => {
</
Row
>
<
Row
className=
{
style
[
'
info-box--line
'
]
}
>
<
Col
span=
{
24
}
>
<
Table
columns=
{
GoodsInfoColumn
(
options
)
}
dataSource=
{
dataSource
}
/>
<
Table
rowKey=
"skuId"
columns=
{
GoodsInfoColumn
(
options
)
}
dataSource=
{
dataSource
}
/>
</
Col
>
</
Row
>
<
Row
className=
{
style
[
'
info-box--btns
'
]
}
>
...
...
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