Commit 47f0f20f authored by XieZhiXiong's avatar XieZhiXiong

售后维修不需要工作流相关

parent e5d82bda
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-14 15:33:42
* @LastEditTime: 2020-12-15 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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment