Commit a80cf1bd authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复订单工作量取值问题

parent 88e6c2c3
......@@ -2,27 +2,29 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-04-22 14:54:25
* @LastEditTime: 2021-05-14 17:12:16
* @Description: 维修商品抽屉组件
*/
import React, { useState, useEffect } from 'react';
import React from 'react';
import { Drawer, Button, Pagination, message } from 'antd';
import { createFormActions } from '@formily/antd';
import moment from 'moment';
import BigNumber from 'bignumber.js';
import { ColumnType } from 'antd/lib/table/interface';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import {
PurchaseOrderOutWorkStateTexts,
ORDER_TYPE2,
PAYWAY,
PAY_CHANNEL,
PayOutWorkState,
} from '@/constants';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
} from '@/constants/order';
import NiceForm from '@/components/NiceForm';
import NestTable from '@/components/NestTable';
import { goodItem, OrderListParams, OrderListRes } from './interface';
import { goodItem, OrderListRes } from './interface';
import { listSearchSchema } from './schema';
import styles from './index.less';
import { PublicApi } from '@/services/api';
......@@ -74,6 +76,10 @@ interface GoodsDrawerProps {
* 流程类型:1.订单交易流程 2.售后换货流程 3.售后退货流程 4.售后维修流程
*/
afterType: 1 | 2 | 3 | 4;
/**
* 订单类型
*/
orderType: number;
};
interface GoodsDrawerState {
......@@ -160,7 +166,13 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 获取订单列表
getOrderList = async () => {
const { page, size, searchVal } = this.state;
const { fetchOrderList, afterType } = this.props;
const { fetchOrderList, afterType, orderType } = this.props;
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
if (!fetchOrderList) {
return;
......@@ -203,14 +215,16 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
return;
}
processEnumRes = await PublicApi.postOrderGetProcessEnum({
list: payload,
}, {
ctlType: 'none',
});
if (processEnumRes.code !== 1000) {
message.error('获取工作流枚举失败,请稍候再试');
return;
if (!isMateriel) {
processEnumRes = await PublicApi.postOrderGetProcessEnum({
list: payload,
}, {
ctlType: 'none',
});
if (processEnumRes.code !== 1000) {
message.error('获取工作流枚举失败,请稍候再试');
return;
}
}
}
......@@ -224,7 +238,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
orderListRes.data.forEach(item => {
if (item.productDateilss) {
item.productDateilss.forEach(product => {
product.processEnum = processEnumRes.data[i] ? processEnumRes.data[i].processEnum : undefined;
product.processEnum = !isMateriel ? processEnumRes.data[i] ? processEnumRes.data[i].processEnum : undefined : item.processEnum;
// product.processEnum = mockMap[Math.floor(Math.random()*2 + 1)];
i++;
// 防止重复添加数据
......
......@@ -692,6 +692,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
NestColumns: [tableColumn, childTableColumn],
}}
searchable={!orderId}
orderType={orderTypeValue}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
......
......@@ -618,6 +618,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
NestColumns: [tableColumn, childTableColumn],
}}
searchable={!orderId}
orderType={orderTypeValue}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
......
......@@ -750,6 +750,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
NestColumns: [tableColumn, childTableColumn],
}}
searchable={!orderId}
orderType={orderTypeValue}
/>
<ReturnInfoDrawer
......
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