Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
shenshaokai
jinfa-platform
Commits
6b893492
Commit
6b893492
authored
Apr 11, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理价格策略批量设置价格无效,商品新增属性值校验异常
parent
24c2dc51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
34 deletions
+47
-34
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+32
-31
priceModal.tsx
src/pages/priceManage/priceStrategy/component/priceModal.tsx
+15
-3
No files found.
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
6b893492
...
...
@@ -248,41 +248,42 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
{
attrItem
.
type
===
1
&&
<
Form
.
Item
name=
{
attrItem
.
id
}
label=
{
attrItem
.
name
}
rules=
{
attrItem
.
isEmpty
&&
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.message'
})
}]
}
label=
{
<
span
>
{
attrItem
.
name
}
<
i
style=
{
{
color
:
'red'
}
}
>
*
</
i
></
span
>
}
>
<
Row
>
<
Col
span=
{
20
}
>
<
Select
disabled=
{
_isDisabled
}
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.placeholder.1'
})
}
allowClear
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
dropdownRender=
{
menu
=>
(
<>
{
menu
}
<
Divider
style=
{
{
margin
:
'8px 0'
}
}
/>
<
Space
align=
"baseline"
style=
{
{
padding
:
'0 8px 4px'
}
}
>
<
Form
.
Item
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.addAttribute.placeholder'
})
}
value=
{
newValue
}
onChange=
{
onNameChange
}
/>
</
Form
.
Item
>
<
Typography
.
Link
onClick=
{
(
e
)
=>
addItem
(
e
,
attrItem
)
}
style=
{
{
whiteSpace
:
'nowrap'
}
}
>
<
PlusOutlined
/>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.addAttribute.addButton'
})
}
</
Typography
.
Link
>
</
Space
>
</>
)
}
<
Form
.
Item
name=
{
attrItem
.
id
}
rules=
{
attrItem
.
isEmpty
&&
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.message'
})
}]
}
>
{
attrItem
?.
customerAttributeValueList
.
length
>
0
&&
attrItem
.
customerAttributeValueList
.
map
((
item
:
any
)
=>
(
<
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
value
}
</
Option
>
))
}
</
Select
>
<
Select
disabled=
{
_isDisabled
}
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.placeholder.1'
})
}
allowClear
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
dropdownRender=
{
menu
=>
(
<>
{
menu
}
<
Divider
style=
{
{
margin
:
'8px 0'
}
}
/>
<
Space
align=
"baseline"
style=
{
{
padding
:
'0 8px 4px'
}
}
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.addAttribute.placeholder'
})
}
value=
{
newValue
}
onChange=
{
onNameChange
}
/>
<
Typography
.
Link
onClick=
{
(
e
)
=>
addItem
(
e
,
attrItem
)
}
style=
{
{
whiteSpace
:
'nowrap'
}
}
>
<
PlusOutlined
/>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.addAttribute.addButton'
})
}
</
Typography
.
Link
>
</
Space
>
</>
)
}
>
{
attrItem
?.
customerAttributeValueList
.
length
>
0
&&
attrItem
.
customerAttributeValueList
.
map
((
item
:
any
)
=>
(
<
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
value
}
</
Option
>
))
}
</
Select
>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
.
Item
>
...
...
src/pages/priceManage/priceStrategy/component/priceModal.tsx
View file @
6b893492
...
...
@@ -106,11 +106,23 @@ const PriceModal: React.FC<PriceModalProps> = (props) => {
}
let
_row
=
{
...
curretSetPriceRow
,
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.unitPrice'
})]:
_priceRange
}
let
newTabeData
=
[
...
memberUnitPriceList
]
let
newTabeData
=
[]
if
(
isBatchSetting
)
{
// 判断是否批量设置价格
newTabeData
.
map
(
item
=>
item
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.unitPrice'
})]
=
_priceRange
)
// newTabeData.map(item => item[intl.formatMessage({ id: 'priceManage.priceStrategy.priceModal.unitPrice' })] = _priceRange)
memberUnitPriceList
.
forEach
(
element
=>
{
let
__item
=
{...
element
}
__item
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.unitPrice'
})]
=
_priceRange
newTabeData
.
push
(
__item
)
});
}
else
{
newTabeData
[
curretSetPriceRow
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.index'
})]]
=
_row
// newTabeData[curretSetPriceRow[intl.formatMessage({ id: 'priceManage.priceStrategy.priceModal.index' })]] = _row
memberUnitPriceList
.
forEach
(
element
=>
{
if
(
element
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.index'
})]
===
curretSetPriceRow
[
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.priceModal.index'
})])
{
newTabeData
.
push
(
_row
)
}
else
{
newTabeData
.
push
({...
element
})
}
})
}
schemaAction
.
setFieldValue
(
"memberUnitPriceList"
,
newTabeData
)
...
...
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