Commit cdf335d5 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复多个无聊单据明细 支付信息显示的问题

parent 8995a00a
......@@ -2,10 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-13 11:46:56
* @LastEditTime: 2021-05-17 14:34:06
* @Description: 查看退货数量与退款金额 抽屉
*/
import React from 'react';
import React, { useEffect } from 'react';
import { Drawer, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createAsyncFormActions } from '@formily/antd';
......@@ -147,6 +147,22 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
isEdit = false,
}) => {
useEffect(() => {
const { setFieldState } = schemaAction;
const { orderType } = (orderInfo || {});
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
if (isMateriel) {
setFieldState('REPOSIT_TABS', state => {
state.props['x-component-props'].hiddenKeys = ['tab-2'];
});
}
}, [orderInfo]);
const handleClose = () => {
if (onClose) {
onClose();
......@@ -203,20 +219,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
}}
editable={isEdit}
effects={($, actions) => {
const { setFieldState } = actions;
const { orderType } = orderInfo;
const isMateriel = (
orderType === ORDER_TYPE_INQUIRY_CONTRACT
|| orderType === ORDER_TYPE_BIDDING_CONTRACT
|| orderType === ORDER_TYPE_TENDER_CONTRACT
);
createEffects($, actions);
if (isMateriel) {
setFieldState('REPOSIT_TABS', state => {
state.props['x-component-props'].hiddenKeys = ['tab-2']
});
}
}}
onSubmit={handleSubmit}
actions={schemaAction}
......
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