添加了打回发票的理由
parent
6871657990
commit
29991bdf99
|
@ -1,5 +1,5 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
import {Button, DatePicker, Form, Input, InputNumber, Modal, Select, Typography, Image} from "antd";
|
||||
import {Button, DatePicker, Form, Input, InputNumber, Modal, Select, Typography, Image, Popconfirm} from "antd";
|
||||
import {
|
||||
InvoiceDetail,
|
||||
InvoiceIdentifyResponse,
|
||||
|
@ -14,11 +14,12 @@ import qs from "qs";
|
|||
|
||||
const {Text, Paragraph} = Typography;
|
||||
|
||||
function InvoiceDetailModal(props: { invoiceDetail: any, open: boolean, onClose: () => void, needRefresh?: () => void, isBase64?:boolean }) {
|
||||
function InvoiceDetailModal(props: { invoiceDetail: any, open: boolean, onClose: () => void, needRefresh?: () => void, isBase64?:boolean,isOwner:boolean}) {
|
||||
//const [open, setOpen] = useState(false)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [invoice, setInvoice] = useState(null as any)
|
||||
const [formItems, setFormItems] = useState(undefined)
|
||||
const [withdrawReason, setWithdrawReason] = useState("")
|
||||
//const [form] = Form.useForm();
|
||||
useEffect(() => {
|
||||
|
||||
|
@ -79,11 +80,12 @@ function InvoiceDetailModal(props: { invoiceDetail: any, open: boolean, onClose:
|
|||
refreshFormItems(value)
|
||||
}
|
||||
|
||||
const withDraw = () => {
|
||||
const withdraw = () => {
|
||||
setLoading(true)
|
||||
axiosInstance({
|
||||
url: 'common/invoice/' + props.invoiceDetail.invoiceId,
|
||||
method: 'delete',
|
||||
data:{deleteOpinion:withdrawReason}
|
||||
}).then(response => {
|
||||
console.log(response.data)
|
||||
setLoading(false)
|
||||
|
@ -106,10 +108,17 @@ function InvoiceDetailModal(props: { invoiceDetail: any, open: boolean, onClose:
|
|||
<div style={{width: '100%', display: "flex", flexDirection: "row", justifyContent: "space-between"}}>
|
||||
<Text>{props.invoiceDetail?.modified ? '' : ''}</Text>
|
||||
<div>
|
||||
{props.invoiceDetail?.invoiceState === 0 && <Button danger loading={loading} onClick={withDraw}
|
||||
{props.invoiceDetail?.invoiceState === 0 && <Popconfirm
|
||||
title={props.isOwner?"确定撤回吗?":"请填写撤回理由"}
|
||||
onConfirm={withdraw}
|
||||
okText="确定"
|
||||
//showCancel={false}
|
||||
cancelText="取消"
|
||||
onCancel={() => {setWithdrawReason("")}}
|
||||
description={props.isOwner?"":<TextArea rows={4} onChange={(e)=>{setWithdrawReason(e.target.value)}}/>}
|
||||
>
|
||||
撤回
|
||||
</Button>}
|
||||
<Button danger type="primary">撤回</Button>
|
||||
</Popconfirm>}
|
||||
|
||||
<Button type="primary" href={baseUrl + props.invoiceDetail?.invoiceFileUri} download
|
||||
>
|
||||
|
|
|
@ -416,7 +416,9 @@ function InvoiceListView(props: { isManagement: boolean }) {
|
|||
pageSize={Number(search.get('pageSize') ? search.get('pageSize') : 10)}
|
||||
total={totalNum} onChange={onChange}/>
|
||||
</div>
|
||||
<InvoiceDetailModal needRefresh={() => {
|
||||
<InvoiceDetailModal
|
||||
isOwner={!props.isManagement}
|
||||
needRefresh={() => {
|
||||
searchInvoiceContent(invoiceSearchOption)
|
||||
}} invoiceDetail={invoiceDetail} open={detailModalOpen} onClose={() => {
|
||||
setDetailModalOpen(false)
|
||||
|
|
|
@ -284,7 +284,8 @@ function MessageList(props: { count: number, onCountChange: (count: number) => v
|
|||
</Badge>
|
||||
</Popover>
|
||||
<InvoiceDetailModal open={invoiceModalOpen} invoiceDetail={invoiceDetail}
|
||||
onClose={() => setInvoiceModalOpen(false)} isBase64={true}/>
|
||||
onClose={() => setInvoiceModalOpen(false)} isBase64={true}
|
||||
isOwner={true}/>
|
||||
<ReimbursementDetail closeDetail={()=>{setReimbursementDetail(undefined)}}
|
||||
accessLevel={-1} reimbursement={reimbursementDetail}/>
|
||||
</>
|
||||
|
|
|
@ -113,7 +113,7 @@ function DisplayInvoicesList(props:{departureInvoice: Invoice, destinationInvoic
|
|||
onSelect={onSelect}
|
||||
treeData={getTreeData()}
|
||||
/>
|
||||
<InvoiceDetailModal invoiceDetail={invoiceDetail} open={detailModalOpen} onClose={() => {
|
||||
<InvoiceDetailModal isOwner={true} invoiceDetail={invoiceDetail} open={detailModalOpen} onClose={() => {
|
||||
setDetailModalOpen(false)
|
||||
}}/>
|
||||
</>)
|
||||
|
|
Loading…
Reference in New Issue