Commit c8d86494 authored by Bill's avatar Bill

fix: 结算付款凭证提交参数bug

parent 5dedc92c
......@@ -872,4 +872,6 @@ export default {
'balance.businessRequestFundsCollaboration.detail.columns.applyPayment' : 'Amount requested',
'balance.businessRequestFundsCollaboration.detail.columns.writeOffAmount' : 'Write off amount',
'balance.businessRequestFundsCollaboration.detail.columns.canWriteOffAmount' : 'Write off amount',
'balance.shouldUploadPaymentFile': 'Please upload payment voucher',
'balance.business.shouldConfigAccount': 'The payment voucher shall be submitted after the merchant completes the configuration of corporate account'
}
......@@ -872,4 +872,7 @@ export default {
'balance.businessRequestFundsCollaboration.detail.columns.applyPayment' : '청구 금액',
'balance.businessRequestFundsCollaboration.detail.columns.writeOffAmount' : '금액을 심사하여 결산하다.',
'balance.businessRequestFundsCollaboration.detail.columns.canWriteOffAmount' : '청구 가능 금액',
'balance.shouldUploadPaymentFile': '지불 증명서를 업로드해 주십시오',
'balance.business.shouldConfigAccount': '상인이 공계정 설정을 완성한 후에 지불 증명서를 제출한다'
}
......@@ -874,4 +874,6 @@ export default {
'balance.accountsReceivable.settlementList.schema.schema.prePayEndTime': '预付开始时间',
'balance.accountsReceivable.settlementList.schema.schema.payStartTime': '实付开始时间',
'balance.accountsReceivable.settlementList.schema.schema.payEndTime': '实付结束时间',
'balance.shouldUploadPaymentFile': '请上传付款凭证',
'balance.business.shouldConfigAccount': '待商家完成对公账号配置,再提交付款凭证'
}
import React, { useEffect, useMemo, useState } from 'react';
import { useIntl } from 'umi'
import { Space, Modal, Popconfirm, Button, message } from 'antd';
import { Space, Modal, Popconfirm, Button, message, Tooltip } from 'antd';
// import UploadPayVoucher from '../UploadPayVoucher';
import UploadFiles from '@/components/UploadFiles/UploadFiles';
import { UploadProps, UploadChangeParam, UploadFile } from 'antd/lib/upload/interface'
......@@ -49,12 +49,14 @@ const UploadVoucherModal: React.FC<UploadVocherProps> = (props) => {
return;
}
async function getAccountInfo() {
const { data, code } = await getSettleAccountsGetMemberAccountConfig({
const { data, code, message: msg } = await getSettleAccountsGetMemberAccountConfig({
memberId: settlementId.toString(),
roleId: roleId.toString(),
});
if (code == 1000) {
setAccountInfo(data);
} else {
message.error(msg)
}
}
getAccountInfo()
......@@ -116,6 +118,10 @@ const UploadVoucherModal: React.FC<UploadVocherProps> = (props) => {
}
const handleComfirm = () => {
if (fileList.length === 0) {
message.error(intl.formatMessage({ id: 'balance.shouldUploadPaymentFile'}))
return
}
const postData = {
// account: accountInfo,
fileList: fileList.map((_item) => ({
......@@ -127,6 +133,13 @@ const UploadVoucherModal: React.FC<UploadVocherProps> = (props) => {
// handleUpload?.({onCancel: params.onCancel, id: params.id, fileList: params.fileList})
}
const buttonTooltip = () => {
if (accountInfo === null) {
return intl.formatMessage({ id: 'balance.business.shouldConfigAccount'});
}
return intl.formatMessage({ id: 'balance.shouldUploadPaymentFile'})
}
return (
<Modal
width={548}
......@@ -147,13 +160,18 @@ const UploadVoucherModal: React.FC<UploadVocherProps> = (props) => {
>
<Button loading={confirmLoading} type={"primary"}>{intl.formatMessage({ id: 'balance.components.uploadVoucherModal.button.2' })}</Button>
</Popconfirm>
: <Button
loading={confirmLoading}
type={"primary"}
onClick={() => handleComfirm()}
>
{intl.formatMessage({ id: 'balance.components.uploadVoucherModal.button.2' })}
</Button>
: <Tooltip title={buttonTooltip()}>
<Button
loading={confirmLoading}
type={"primary"}
onClick={() => handleComfirm()}
disabled={fileList.length === 0 || accountInfo === null}
>
{intl.formatMessage({ id: 'balance.components.uploadVoucherModal.button.2' })}
</Button>
</Tooltip>
}
</Space>
)}
......
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