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
014dec87
Commit
014dec87
authored
Nov 24, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加编辑状态 内容可编辑范围设置
parent
4035f0b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
23 deletions
+28
-23
FormInformationBasic.jsx
src/pages/ServiceGoods/components/FormInformationBasic.jsx
+3
-3
FormPriceOrStock.jsx
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
+3
-4
FormRuleVPictures.jsx
src/pages/ServiceGoods/components/FormRuleVPictures.jsx
+4
-4
config.js
src/pages/ServiceGoods/config.js
+14
-11
index.jsx
src/pages/ServiceGoods/index.jsx
+4
-1
No files found.
src/pages/ServiceGoods/components/FormInformationBasic.jsx
View file @
014dec87
...
@@ -90,7 +90,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -90,7 +90,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
>
>
<
Cascader
<
Cascader
placeholder=
"请选择商品类目!"
placeholder=
"请选择商品类目!"
disabled=
{
customer
.
isEdit
}
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
showSearch=
{
{
filter
:
filterCategoryOptions
}
}
showSearch=
{
{
filter
:
filterCategoryOptions
}
}
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
fieldNames=
{
{
label
:
'
name
'
,
value
:
'
id
'
,
children
:
'
children
'
}
}
onChange=
{
props
.
onCategoryChange
}
onChange=
{
props
.
onCategoryChange
}
...
@@ -106,7 +106,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -106,7 +106,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
>
>
<
Select
<
Select
showSearch
showSearch
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
disabled=
{
customer
.
is
Disable
d
}
placeholder=
"请选择商品品牌"
placeholder=
"请选择商品品牌"
filterOption=
{
fileterBrandOptions
}
filterOption=
{
fileterBrandOptions
}
>
>
...
@@ -125,7 +125,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
...
@@ -125,7 +125,7 @@ const FormInformationBasic = forwardRef((props, ref) => {
{
required
:
true
,
min
:
2
,
message
:
'
请输入最少两个字符的商品名称!
'
,
whitespace
:
true
},
{
required
:
true
,
min
:
2
,
message
:
'
请输入最少两个字符的商品名称!
'
,
whitespace
:
true
},
]
}
]
}
>
>
<
Input
placeholder=
"请输入商品名称"
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
/>
<
Input
placeholder=
"请输入商品名称"
disabled=
{
customer
.
is
Disable
d
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Popover
>
</
Popover
>
{
!
customer
.
isCard
&&
(
{
!
customer
.
isCard
&&
(
...
...
src/pages/ServiceGoods/components/FormPriceOrStock.jsx
View file @
014dec87
...
@@ -91,7 +91,7 @@ const SpecificationTemplate = (props, _) => {
...
@@ -91,7 +91,7 @@ const SpecificationTemplate = (props, _) => {
<>
<>
<
Form
.
Item
name=
{
formName
}
label=
{
label
}
>
<
Form
.
Item
name=
{
formName
}
label=
{
label
}
>
<
Select
<
Select
disabled=
{
customer
.
isEdit
}
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
allowClear
allowClear
options=
{
specList
}
options=
{
specList
}
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
...
@@ -151,7 +151,7 @@ const SpecificationTemplate = (props, _) => {
...
@@ -151,7 +151,7 @@ const SpecificationTemplate = (props, _) => {
)
}
)
}
</
Form
.
Item
>
</
Form
.
Item
>
))
}
))
}
{
fields
.
length
<
3
&&
(
!
customer
.
isEdit
||
customer
.
isCard
)
&&
(
{
fields
.
length
<
3
&&
!
customer
.
isDisabled
&&
(
<
Form
.
Item
noStyle
key=
"btnpush"
>
<
Form
.
Item
noStyle
key=
"btnpush"
>
<
Button
<
Button
style=
{
{
marginLeft
:
10
,
marginBottom
:
24
}
}
style=
{
{
marginLeft
:
10
,
marginBottom
:
24
}
}
...
@@ -206,7 +206,7 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu
...
@@ -206,7 +206,7 @@ const CreateBatchFormItems = ({ specInitValue, batchChange, editRef, defaultColu
<
Button
<
Button
key=
"batch"
key=
"batch"
type=
"primary"
type=
"primary"
disabled=
{
customer
.
isEdit
&&
!
customer
.
isCard
}
disabled=
{
customer
.
isEdit
&&
customer
.
isNormal
}
onClick=
{
batchChange
}
onClick=
{
batchChange
}
>
>
批量设置
批量设置
...
@@ -278,7 +278,6 @@ const FormPriceOrStock = forwardRef((props, ref) => {
...
@@ -278,7 +278,6 @@ const FormPriceOrStock = forwardRef((props, ref) => {
inputType
:
'
text
'
,
inputType
:
'
text
'
,
});
});
}
}
const
dynamicColumns
=
[...
columsData
,
...
StaticColumns
(
customer
)];
const
dynamicColumns
=
[...
columsData
,
...
StaticColumns
(
customer
)];
setDefaultColumns
(
dynamicColumns
);
setDefaultColumns
(
dynamicColumns
);
};
};
...
...
src/pages/ServiceGoods/components/FormRuleVPictures.jsx
View file @
014dec87
...
@@ -163,7 +163,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
...
@@ -163,7 +163,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
maxHeight=
{
customer
.
isCard
?
0
:
1200
}
maxHeight=
{
customer
.
isCard
?
0
:
1200
}
superTips=
"公共滑动图尺寸不可大于 1200*1200"
superTips=
"公共滑动图尺寸不可大于 1200*1200"
name=
"commonImageList"
name=
"commonImageList"
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
disabled=
{
customer
.
is
Disable
d
}
limit=
{
imgConfig
.
commonImageList
.
limit
}
limit=
{
imgConfig
.
commonImageList
.
limit
}
pictures=
{
commonImageList
}
pictures=
{
commonImageList
}
setPictureList=
{
list
=>
onCommonSuccessEvent
(
list
)
}
setPictureList=
{
list
=>
onCommonSuccessEvent
(
list
)
}
...
@@ -185,7 +185,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
...
@@ -185,7 +185,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<
UploadImage
<
UploadImage
name=
"cardImageList"
name=
"cardImageList"
limit=
{
imgConfig
.
cardImageList
.
limit
}
limit=
{
imgConfig
.
cardImageList
.
limit
}
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
disabled=
{
customer
.
is
Disable
d
}
pictures=
{
cardImageList
}
pictures=
{
cardImageList
}
setPictureList=
{
list
=>
onCardSuccessImageList
(
list
)
}
setPictureList=
{
list
=>
onCardSuccessImageList
(
list
)
}
/>
/>
...
@@ -206,7 +206,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
...
@@ -206,7 +206,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<
UploadImage
<
UploadImage
name=
{
key
}
name=
{
key
}
limit=
{
11
}
limit=
{
11
}
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
disabled=
{
customer
.
is
Disable
d
}
pictures=
{
imageList
[
key
]
}
pictures=
{
imageList
[
key
]
}
setPictureList=
{
list
=>
onPictureSuccessEvent
(
list
,
key
)
}
setPictureList=
{
list
=>
onPictureSuccessEvent
(
list
,
key
)
}
/>
/>
...
@@ -238,7 +238,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
...
@@ -238,7 +238,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
maxWidth=
{
customer
.
isCard
?
0
:
800
}
maxWidth=
{
customer
.
isCard
?
0
:
800
}
superTips=
"详情图宽度不可大于800"
superTips=
"详情图宽度不可大于800"
name=
"detailImageList"
name=
"detailImageList"
disabled=
{
customer
.
is
Edit
&&
!
customer
.
isCar
d
}
disabled=
{
customer
.
is
Disable
d
}
pictures=
{
detailImageList
}
pictures=
{
detailImageList
}
setPictureList=
{
list
=>
onDetailSuccessImageList
(
list
)
}
setPictureList=
{
list
=>
onDetailSuccessImageList
(
list
)
}
/>
/>
...
...
src/pages/ServiceGoods/config.js
View file @
014dec87
...
@@ -138,7 +138,7 @@ export const StaticColumns = customer => [
...
@@ -138,7 +138,7 @@ export const StaticColumns = customer => [
min
:
0
,
min
:
0
,
},
},
roleRules
:
{
required
:
true
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
佣金费率
'
,
title
:
'
佣金费率
'
,
...
@@ -161,7 +161,7 @@ export const StaticColumns = customer => [
...
@@ -161,7 +161,7 @@ export const StaticColumns = customer => [
min
:
0
,
min
:
0
,
},
},
roleRules
:
{
required
:
true
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
销售价
'
,
title
:
'
销售价
'
,
...
@@ -174,7 +174,7 @@ export const StaticColumns = customer => [
...
@@ -174,7 +174,7 @@ export const StaticColumns = customer => [
precision
:
2
,
precision
:
2
,
min
:
0
,
min
:
0
,
},
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
重量(kg)
'
,
title
:
'
重量(kg)
'
,
...
@@ -193,7 +193,7 @@ export const StaticColumns = customer => [
...
@@ -193,7 +193,7 @@ export const StaticColumns = customer => [
precision
:
3
,
precision
:
3
,
max
:
999999.999
,
max
:
999999.999
,
},
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
库存
'
,
title
:
'
库存
'
,
...
@@ -210,7 +210,10 @@ export const StaticColumns = customer => [
...
@@ -210,7 +210,10 @@ export const StaticColumns = customer => [
min
:
0
,
min
:
0
,
},
},
roleRules
:
{
required
:
true
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
isEdit
,
disabeldRender
:
record
=>
{
if
(
record
.
stock
===
null
)
return
false
;
return
customer
.
isEdit
&&
customer
.
isNormal
;
},
},
},
{
{
title
:
'
库存预警
'
,
title
:
'
库存预警
'
,
...
@@ -223,7 +226,7 @@ export const StaticColumns = customer => [
...
@@ -223,7 +226,7 @@ export const StaticColumns = customer => [
precision
:
0
,
precision
:
0
,
maxLength
:
5
,
maxLength
:
5
,
},
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
商品自编码
'
,
title
:
'
商品自编码
'
,
...
@@ -232,7 +235,7 @@ export const StaticColumns = customer => [
...
@@ -232,7 +235,7 @@ export const StaticColumns = customer => [
role
:
[
1
,
2
],
role
:
[
1
,
2
],
inputType
:
'
input
'
,
inputType
:
'
input
'
,
roleRules
:
{
required
:
true
},
roleRules
:
{
required
:
true
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
京东链接
'
,
title
:
'
京东链接
'
,
...
@@ -241,7 +244,7 @@ export const StaticColumns = customer => [
...
@@ -241,7 +244,7 @@ export const StaticColumns = customer => [
role
:
[
1
,
2
],
role
:
[
1
,
2
],
inputType
:
'
input
'
,
inputType
:
'
input
'
,
roleRules
:
{
required
:
false
},
roleRules
:
{
required
:
false
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
sku名称
'
,
title
:
'
sku名称
'
,
...
@@ -250,7 +253,7 @@ export const StaticColumns = customer => [
...
@@ -250,7 +253,7 @@ export const StaticColumns = customer => [
role
:
customer
.
isEdit
&&
customer
.
isJDGoods
?
[
1
,
2
]
:
[],
role
:
customer
.
isEdit
&&
customer
.
isJDGoods
?
[
1
,
2
]
:
[],
inputType
:
'
btnText
'
,
inputType
:
'
btnText
'
,
roleRules
:
{
required
:
false
},
roleRules
:
{
required
:
false
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
...
@@ -260,10 +263,10 @@ export const StaticColumns = customer => [
...
@@ -260,10 +263,10 @@ export const StaticColumns = customer => [
inputType
:
'
option
'
,
inputType
:
'
option
'
,
roleProps
:
{
roleProps
:
{
isJDGoods
:
customer
.
isJDGoods
,
isJDGoods
:
customer
.
isJDGoods
,
disabled
:
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabled
:
customer
.
is
Disable
d
,
min
:
0
,
min
:
0
,
},
},
roleRules
:
{
required
:
false
},
roleRules
:
{
required
:
false
},
disabeldRender
:
()
=>
customer
.
is
Edit
&&
!
customer
.
isCar
d
,
disabeldRender
:
()
=>
customer
.
is
Disable
d
,
},
},
];
];
src/pages/ServiceGoods/index.jsx
View file @
014dec87
...
@@ -241,7 +241,10 @@ const ServiceGoods = options => {
...
@@ -241,7 +241,10 @@ const ServiceGoods = options => {
canAddService
,
// 是否可以添加服务商品(电子卡券)
canAddService
,
// 是否可以添加服务商品(电子卡券)
canAddNormal
,
// 是否可以添加实物商品
canAddNormal
,
// 是否可以添加实物商品
isCard
:
productType
===
4
,
isCard
:
productType
===
4
,
isService
:
SourceData
.
state
&&
SourceData
.
state
!==
4
,
// 0, "商品删除" 1, "新建" 2, "提交审核" 3, "待审核" 4, "驳回" 5, "未上架" 6, "已上架" 7, "已下架"
isNormal
:
SourceData
.
state
&&
SourceData
.
state
!==
4
,
// 商品不是驳回状态
// 当商品进行编辑 & 类型不为电子卡券 & 商品状态不为驳回 禁用当前功能
isDisabled
:
isEdit
&&
productType
!==
4
&&
SourceData
.
state
&&
SourceData
.
state
!==
4
,
isJDGoods
:
isEdit
&&
SourceData
.
pageProductType
&&
+
SourceData
.
pageProductType
!==
1
,
isJDGoods
:
isEdit
&&
SourceData
.
pageProductType
&&
+
SourceData
.
pageProductType
!==
1
,
onEventBus
,
onEventBus
,
};
};
...
...
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