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
47f0f20f
Commit
47f0f20f
authored
Dec 15, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
售后维修不需要工作流相关
parent
e5d82bda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
+34
-25
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+34
-25
No files found.
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
47f0f20f
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-1
4 15:33:42
* @LastEditTime: 2020-12-1
5 10:08:13
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -226,30 +226,35 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
...
searchVal
,
});
if
(
orderListRes
)
{
// 获取对应订单列表的工作流类型
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
);
let
processEnumRes
=
{
data
:
[],
code
:
0
};
// 售后退货、换货才涉及工作流相关
if
(
type
===
2
||
type
===
3
)
{
// 获取对应订单列表的工作流类型
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
);
});
});
});
const
processEnumRes
:
any
=
await
PublicApi
.
postOrderGetProcessEnum
({
list
:
payload
,
},
{
ctlType
:
'none'
,
});
if
(
processEnumRes
.
code
!==
1000
)
{
message
.
error
(
'获取工作流枚举失败,请稍候再试'
)
;
return
;
processEnumRes
=
await
PublicApi
.
postOrderGetProcessEnum
({
list
:
payload
,
},
{
ctlType
:
'none'
,
});
if
(
processEnumRes
.
code
!==
1000
)
{
message
.
error
(
'获取工作流枚举失败,请稍候再试'
);
return
;
}
}
// const mockMap = {
...
...
@@ -261,7 +266,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
let
i
=
0
;
orderListRes
.
data
.
forEach
(
item
=>
{
item
.
productDateilss
.
forEach
(
product
=>
{
product
.
processEnum
=
processEnumRes
.
data
[
i
]
.
processEnum
;
product
.
processEnum
=
processEnumRes
.
data
[
i
]
?
processEnumRes
.
data
[
i
].
processEnum
:
undefined
;
// product.processEnum = mockMap[Math.floor(Math.random()*2 + 1)];
i
++
;
// 防止重复添加数据
...
...
@@ -512,6 +517,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 过滤工作流不同的 商品
filterProductByProcessEnum
=
(
data
)
=>
{
// 售后退货、换货才涉及工作流相关
if
(
this
.
props
.
type
!==
2
&&
this
.
props
.
type
!==
3
)
{
return
data
;
}
const
first
=
data
.
length
?
data
[
0
]
:
null
;
if
(
!
first
)
{
...
...
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