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,6 +226,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
...searchVal,
});
if (orderListRes) {
let processEnumRes = { data: [], code: 0 };
// 售后退货、换货才涉及工作流相关
if (type === 2 || type === 3) {
// 获取对应订单列表的工作流类型
const payload = [];
......@@ -242,7 +246,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
});
});
const processEnumRes: any = await PublicApi.postOrderGetProcessEnum({
processEnumRes = await PublicApi.postOrderGetProcessEnum({
list: payload,
}, {
ctlType: 'none',
......@@ -251,6 +255,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
message.error('获取工作流枚举失败,请稍候再试');
return;
}
}
// const mockMap = {
// 1: 18,
......@@ -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