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
linweijiong
jinfa-platform
Commits
4d63c859
Commit
4d63c859
authored
Feb 25, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理新增渠道商品价格设置异常和提交字段异常
parent
301e31ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
setPrice.tsx
src/pages/commodity/products/addChannelItem/setPrice.tsx
+9
-4
addDirectChannel.tsx
src/pages/commodity/products/addDirectChannel.tsx
+1
-1
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+3
-3
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+1
-0
No files found.
src/pages/commodity/products/addChannelItem/setPrice.tsx
View file @
4d63c859
...
...
@@ -82,7 +82,7 @@ const SetPrice:React.FC<IProps> = (props) => {
},
[
priceTableData
])
useEffect
(()
=>
{
if
(
productSelectRowInStore
.
priceType
===
3
)
{
if
(
productSelectRowInStore
?
.
priceType
===
3
)
{
// 积分
formPrice
.
setFieldsValue
({
isMemberPrice
:
false
})
setDisabledMemberPrice
(
true
)
...
...
@@ -108,7 +108,7 @@ const SetPrice:React.FC<IProps> = (props) => {
}
const
structureTable
=
(
data
:
any
,
name
?:
string
)
=>
{
console
.
log
(
data
,
'structureTableData'
)
//
console.log(data, 'structureTableData')
// 构建table 列columns
let
col
:
any
=
[]
let
temp
:
any
=
[]
...
...
@@ -162,6 +162,11 @@ const SetPrice:React.FC<IProps> = (props) => {
item
.
attributeAndValueList
.
map
(
_item
=>
{
temp
[
_item
.
customerAttribute
.
name
]
=
{
value
:
_item
.
customerAttributeValue
.
value
,
vId
:
_item
.
customerAttributeValue
.
id
,
id
:
_item
.
customerAttribute
.
id
}
})
// 预先排序
let
tempUnit
=
{}
Object
.
keys
(
item
.
unitPrice
).
sort
((
a
:
any
,
b
:
any
)
=>
a
.
split
(
'-'
)[
0
]
-
b
.
split
(
'-'
)[
0
]).
forEach
(
key
=>
{
tempUnit
[
key
]
=
item
.
unitPrice
[
key
];
})
_tableData
.
push
({
"id"
:
item
.
id
,
// 行数据id
"goodsId"
:
item
.
goods
?.
id
||
''
,
// 货品ID 可能为null
...
...
@@ -170,7 +175,7 @@ const SetPrice:React.FC<IProps> = (props) => {
"商品名称"
:
name
||
productName
,
"对应货品"
:
item
.
goods
?.
name
||
''
,
...
temp
,
"单价"
:
item
.
unitPrice
"单价"
:
tempUnit
})
})
setSpecTableData
(
_tableData
)
...
...
@@ -256,7 +261,7 @@ const SetPrice:React.FC<IProps> = (props) => {
if
(
isBatchSetting
){
// 判断是否批量设置价格
newTabeData
.
map
(
_item
=>
_item
[
'单价'
]
=
_priceRange
)
}
else
{
newTabeData
[
curretSetPriceRow
[
'索引'
]]
=
_row
newTabeData
=
newTabeData
.
map
(
_item
=>
_item
[
'id'
]
===
curretSetPriceRow
[
'id'
]
?
_row
:
_item
)
}
setPriceTableData
(
newTabeData
)
constructedPrarams
()
...
...
src/pages/commodity/products/addDirectChannel.tsx
View file @
4d63c859
...
...
@@ -52,7 +52,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
let
params
:
any
=
{}
console
.
log
(
values
,
'vvv'
)
values
.
map
((
item
,
index
)
=>
{
if
(
index
!==
2
)
if
(
!
item
?.
carriageType
)
params
=
{
...
params
,
...
item
}
else
params
.
logistics
=
{
...
item
}
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
4d63c859
...
...
@@ -337,7 +337,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if
(
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
unitPrice
)
{
let
tempUnit
=
{}
let
unitPric
=
productInfoByEdit
.
unitPriceAndPicList
[
i
]?.
unitPrice
Object
.
keys
(
unitPric
).
sort
().
forEach
(
function
(
key
)
{
Object
.
keys
(
unitPric
).
sort
().
forEach
(
key
=>
{
tempUnit
[
key
]
=
unitPric
[
key
];
})
_tempObj
[
'单价'
]
=
tempUnit
...
...
@@ -349,7 +349,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
if
(
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'单价'
])
{
let
tempUnit
=
{}
let
unitPric
=
_tableDataSource
[
i
]
&&
tableDataSource
[
i
]
&&
tableDataSource
[
i
][
'单价'
]
Object
.
keys
(
unitPric
).
sort
().
forEach
(
function
(
key
)
{
Object
.
keys
(
unitPric
).
sort
().
forEach
(
key
=>
{
tempUnit
[
key
]
=
unitPric
[
key
]
})
_tempObj
[
'单价'
]
=
tempUnit
...
...
@@ -416,7 +416,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
id
:
attributeObjArr
[
_index
].
customerAttributeId
,
name
:
attributeObjArr
[
_index
].
attributeName
}
console
.
log
(
attributeValObjArr
,
item
,
index
,
_item
,
_index
,
_tableDataSource
,
'调试属性'
)
//
console.log(attributeValObjArr, item, index, _item, _index, _tableDataSource, '调试属性')
_tempObject
.
customerAttributeValue
=
{
// @fixed bug: 属性名称相同的情况下 只找第一个元素 会出现id异常
// id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
...
...
src/pages/commodity/products/directChannel.tsx
View file @
4d63c859
...
...
@@ -169,6 +169,7 @@ const DirectChannel: React.FC<{}> = () => {
{
title
:
'操作'
,
dataIndex
:
'option'
,
width
:
150
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
...
...
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