Commit 25a61922 authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改按钮显示

parent e14bac19
/*
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 16:38:48
* @Description: 查看退货数量与退款金额 抽屉
*/
import React from 'react';
import { Drawer, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import schema from './schema';
import { createEffects } from './effects';
import Stamp from '../Stamp';
import SteamerTicket from './components/SteamerTicket';
import styles from './index.less';
const schemaAction = createFormActions();
export interface PayListItem {
/**
* 支付次数
*/
payCount: number,
/**
* 支付环节
*/
payNode: string,
/**
* 支付比例
*/
payRatio: number,
/**
* 支付金额
*/
payAmount: number,
/**
* 支付方式
*/
payWay: string,
/**
* 支付渠道
*/
channel: string,
/**
* 支付时间
*/
payTime: string,
/**
* 退款金额
*/
refundAmount: number,
};
export interface OrderInfo {
/**
* 列表索引
*/
index?: number;
/**
* 订单号
*/
orderNo: string;
/**
* 商品名称
*/
productName: string;
/**
* 品类
*/
category: string;
/**
* 品牌
*/
brand: string;
/**
* 单位
*/
unit: string;
/**
* 采购数量
*/
purchaseCount: string;
/**
* 采购单价
*/
purchasePrice: string;
/**
* 采购金额
*/
purchaseAmount: string;
/**
* 支付记录
*/
payList: PayListItem;
/**
* 退款数量
*/
returnCount?: number | string;
/**
* 退款理由
*/
returnReason?: string;
};
interface ReturnInfoDrawerProps {
visible: boolean;
orderInfo: OrderInfo;
onClose: () => void;
onSubmit?: (values: { [key: string]: any }) => void;
/**
* 是否是编辑的
*/
isEdit?: boolean;
};
const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
visible = false,
orderInfo = {},
onClose,
onSubmit,
isEdit = false,
}) => {
const handleClose = () => {
if (onClose) {
onClose();
}
};
const handleSubmit = values => {
if (onSubmit) {
onSubmit(values);
} else {
onClose();
}
};
return (
<Drawer
title="查看退货数量与退款金额"
placement="right"
width={1120}
onClose={handleClose}
visible={visible}
closable={false}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button
onClick={handleClose}
style={{ marginRight: 8 }}
>
取消
</Button>
<Button
onClick={() => schemaAction.submit()}
type="primary"
>
确定
</Button>
</div>
}
>
<NiceForm
initialValues={orderInfo}
previewPlaceholder=" "
components={{
Stamp,
SteamerTicket,
}}
editable={isEdit}
effects={($, actions) => {
createEffects($, actions);
}}
onSubmit={handleSubmit}
actions={schemaAction}
schema={schema}
/>
</Drawer>
);
};
/*
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-22 10:37:43
* @Description: 查看退货数量与退款金额 抽屉
*/
import React from 'react';
import { Drawer, Button } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import schema from './schema';
import { createEffects } from './effects';
import Stamp from '../Stamp';
import SteamerTicket from './components/SteamerTicket';
import styles from './index.less';
const schemaAction = createFormActions();
export interface PayListItem {
/**
* 支付次数
*/
payCount: number,
/**
* 支付环节
*/
payNode: string,
/**
* 支付比例
*/
payRatio: number,
/**
* 支付金额
*/
payAmount: number,
/**
* 支付方式
*/
payWay: string,
/**
* 支付渠道
*/
channel: string,
/**
* 支付时间
*/
payTime: string,
/**
* 退款金额
*/
refundAmount: number,
};
export interface OrderInfo {
/**
* 列表索引
*/
index?: number;
/**
* 订单号
*/
orderNo: string;
/**
* 商品名称
*/
productName: string;
/**
* 品类
*/
category: string;
/**
* 品牌
*/
brand: string;
/**
* 单位
*/
unit: string;
/**
* 采购数量
*/
purchaseCount: string;
/**
* 采购单价
*/
purchasePrice: string;
/**
* 采购金额
*/
purchaseAmount: string;
/**
* 支付记录
*/
payList: PayListItem;
/**
* 退款数量
*/
returnCount?: number | string;
/**
* 退款理由
*/
returnReason?: string;
};
interface ReturnInfoDrawerProps {
visible: boolean;
orderInfo: OrderInfo;
onClose: () => void;
onSubmit?: (values: { [key: string]: any }) => void;
/**
* 是否是编辑的
*/
isEdit?: boolean;
};
const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
visible = false,
orderInfo = {},
onClose,
onSubmit,
isEdit = false,
}) => {
const handleClose = () => {
if (onClose) {
onClose();
}
};
const handleSubmit = values => {
if (onSubmit) {
onSubmit(values);
} else {
onClose();
}
};
return (
<Drawer
title="查看退货数量与退款金额"
placement="right"
width={1120}
onClose={handleClose}
visible={visible}
closable={false}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button
onClick={handleClose}
style={{ marginRight: 8 }}
>
{onSubmit ? '取消' : '关闭'}
</Button>
{onSubmit && (
<Button
onClick={() => schemaAction.submit()}
type="primary"
>
确定
</Button>
)}
</div>
}
>
<NiceForm
initialValues={orderInfo}
previewPlaceholder=" "
components={{
Stamp,
SteamerTicket,
}}
editable={isEdit}
effects={($, actions) => {
createEffects($, actions);
}}
onSubmit={handleSubmit}
actions={schemaAction}
schema={schema}
/>
</Drawer>
);
};
export default ReturnInfoDrawer;
\ No newline at end of file
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