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
60fe6a69
Commit
60fe6a69
authored
Jan 21, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复积分订单商品信息没有返回报错的问题
parent
bf65463f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
25 deletions
+29
-25
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+29
-25
No files found.
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
60fe6a69
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-
07 16:57:04
* @LastEditTime: 2021-01-
21 14:50:59
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -94,7 +94,7 @@ function transformParentKeys(data: any[], childCheckedKeys: string[]) {
}
// 判断两者长度 一样 就表示父节点时候选中的
if
(
atom
.
checkeds
.
length
===
atom
.
productDateilss
.
length
)
{
if
(
atom
.
checkeds
.
length
===
(
atom
.
productDateilss
&&
atom
.
productDateilss
.
length
)
)
{
ret
.
push
(
atom
.
id
);
}
});
...
...
@@ -233,16 +233,18 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
const
payload
=
[];
orderListRes
.
data
.
forEach
(
item
=>
{
item
.
productDateilss
.
forEach
(
product
=>
{
const
atom
=
{
productId
:
product
.
productId
,
memberId
:
product
.
memberId
,
memberRoleId
:
product
.
memberRoleId
,
shopId
:
item
.
shopId
,
type
,
// 流程类型
};
payload
.
push
(
atom
);
});
if
(
item
.
productDateilss
)
{
item
.
productDateilss
.
forEach
(
product
=>
{
const
atom
=
{
productId
:
product
.
productId
,
memberId
:
product
.
memberId
,
memberRoleId
:
product
.
memberRoleId
,
shopId
:
item
.
shopId
,
type
,
// 流程类型
};
payload
.
push
(
atom
);
});
}
});
if
(
!
payload
.
length
)
{
...
...
@@ -272,19 +274,21 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 组装数据
let
i
=
0
;
orderListRes
.
data
.
forEach
(
item
=>
{
item
.
productDateilss
.
forEach
(
product
=>
{
product
.
processEnum
=
processEnumRes
.
data
[
i
]
?
processEnumRes
.
data
[
i
].
processEnum
:
undefined
;
// product.processEnum = mockMap[Math.floor(Math.random()*2 + 1)];
i
++
;
// 防止重复添加数据
if
(
!
this
.
flattened
.
find
(
flat
=>
flat
.
id
===
product
.
id
))
{
this
.
flattened
.
push
({
...
product
,
orderNo
:
item
.
orderNo
,
payInfoList
:
item
.
payInfoList
,
});
}
});
if
(
item
.
productDateilss
)
{
item
.
productDateilss
.
forEach
(
product
=>
{
product
.
processEnum
=
processEnumRes
.
data
[
i
]
?
processEnumRes
.
data
[
i
].
processEnum
:
undefined
;
// product.processEnum = mockMap[Math.floor(Math.random()*2 + 1)];
i
++
;
// 防止重复添加数据
if
(
!
this
.
flattened
.
find
(
flat
=>
flat
.
id
===
product
.
id
))
{
this
.
flattened
.
push
({
...
product
,
orderNo
:
item
.
orderNo
,
payInfoList
:
item
.
payInfoList
,
});
}
});
}
});
this
.
setState
({
...
...
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