Commit 3ae1249c authored by 卢均锐's avatar 卢均锐

feat: 缓存业务对账

-对接接口
parent b2ebd22c
......@@ -16,6 +16,7 @@ import ProgressLayout, { ProgressValue } from '@/pages/transaction/purchaseAbili
import CommonLayout from '@/pages/transaction/purchaseAbility/components/detail/components/bidCommonLayout';
import { getSettleAccountsBusinessReconciliationDetailReconciliation, getSettleAccountsBusinessReconciliationReconciliationRowList } from '@/services/SettleV2Api'
import BusinessFileLayout from '../../components/BusinessFileLayout';
const intl = getIntl();
const TABLINK = [
......@@ -85,7 +86,7 @@ const SearchDetail = () => {
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${data.reconciliationMoneyAmount}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' },
]
},
......@@ -164,6 +165,7 @@ const SearchDetail = () => {
title: '单价(含税)',
key: 'price',
dataIndex: 'price',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '待对账数量',
......@@ -174,6 +176,7 @@ const SearchDetail = () => {
title: '待对账金额(含税)',
key: 'reconciliationMoneyAmount',
dataIndex: 'reconciliationMoneyAmount',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '本次对账数量',
......@@ -184,6 +187,7 @@ const SearchDetail = () => {
title: '本次对账金额(含税)',
key: 'currentMoney',
dataIndex: 'currentMoney',
render: (text: any) => ${priceFormat(text)}`
},
];
......@@ -196,30 +200,30 @@ const SearchDetail = () => {
}
return (
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
tabLink={_tabs}
components={
<Fragment>
<ProgressLayout effect={[{ title: '外部流转', state: 1, logs: [] }]} />
<CommonLayout layoutId="basicLayout" title={intl.formatMessage({ id: 'balance.jibenxinxi' })} effect={basicEffect} commonSpan={12} />
<Card id='billLayout' title={intl.formatMessage({ id: 'balance.duizhangdanmingxi' })}>
<StandardTable
keepAlive={false}
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'reconciliationRowId' }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
<Card id='fileLayout' title={intl.formatMessage({ id: 'balance.fujian' })}>
</Card>
<CommonLayout layoutId="invoiceLayout" title={intl.formatMessage({ id: 'balance.fapiaoxinxi' })} effect={invoiceEffect} commonSpan={12} />
</Fragment>
}
/>
<div style={{margin: '-24px -24px 0'}}>
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
tabLink={_tabs}
components={
<Fragment>
<ProgressLayout effect={[{ title: '外部流转', state: 1, logs: [] }]} />
<CommonLayout layoutId="basicLayout" title={intl.formatMessage({ id: 'balance.jibenxinxi' })} effect={basicEffect} commonSpan={12} />
<Card id='billLayout' title={intl.formatMessage({ id: 'balance.duizhangdanmingxi' })}>
<StandardTable
keepAlive={false}
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'reconciliationRowId' }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
<BusinessFileLayout fetchdata={dataSource?.files} editAble={false} />
<CommonLayout layoutId="invoiceLayout" title={intl.formatMessage({ id: 'balance.fapiaoxinxi' })} effect={invoiceEffect} commonSpan={12} />
</Fragment>
}
/>
</div>
)
}
export default SearchDetail;
......@@ -8,7 +8,7 @@ import { GlobalConfig } from '@/global/config'
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
import StatusTag from '@/components/StatusTag';
import { getSettleAccountsBusinessReconciliationDetailReconciliation, getSettleAccountsBusinessReconciliationReconciliationRowList, postSettleAccountsBusinessReconciliationUpdateReconciliation, postSettleAccountsBusinessReconciliationSaveReconciliation } from '@/services/SettleV2Api'
import { getSettleAccountsBusinessReconciliationDetailReconciliation, getSettleAccountsBusinessReconciliationReconciliationRowList, postSettleAccountsBusinessReconciliationUpdateReconciliation, postSettleAccountsBusinessReconciliationSaveReconciliation, postSettleAccountsBusinessReconciliationGenerateReconciliation } from '@/services/SettleV2Api'
import PeripheralLayout from '@/pages/transaction/purchaseAbility/components/detail';
import Card from '@/pages/transaction/purchaseAbility/components/card';
......@@ -35,6 +35,7 @@ const Add = () => {
id,
no
},
state,
pathname,
} = history.location;
const [form] = Form.useForm();
......@@ -42,6 +43,7 @@ const Add = () => {
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [dataSource, setDataSource] = useState<any>({});
const [tabelSource, setTabelSource] = useState<any>([]);
const [ids, setIds] = useState<any>([]);
const [drawerVisible, setDrawerVisible] = useState<boolean>(false);
const [unsaved, setUnsaved] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
......@@ -50,9 +52,9 @@ const Add = () => {
const _tabs = useMemo(() => {
let _list = [];
TABLINK.forEach((item) => {
if (item.id === 'billLayout') {
item.title = `${item.title}${tabelSource.length ? '' : '(' + tabelSource.length + ')'}`
}
// if (item.id === 'billLayout') {
// item.title = `${item.title}${tabelSource.length ? '' : '(' + tabelSource.length + ')'}`
// }
_list.push(item)
})
return _list;
......@@ -130,7 +132,11 @@ const Add = () => {
if (_editAble) {
setUnsaved(true)
if (path === 'add') {
postSettleAccountsBusinessReconciliationGenerateReconciliation({ SettlementGenerateVO: state?.ros }).then((res) => {
if (res.code === 1000) {
}
})
} else {
_getDetail();
_getRowList();
......@@ -278,6 +284,8 @@ const Add = () => {
}
const _dataSource = { ...dataSource };
_dataSource.reconciliationMoneyAmount = _amount;
const _ids = tabelSource.map((item) => item.productId);
setIds(_ids);
setDataSource(_dataSource);
}, [tabelSource])
......@@ -289,16 +297,18 @@ const Add = () => {
reconciliationAbstract: formRes.reconciliationAbstract,
reconciliationMoneyAmount: formRes.reconciliationMoneyAmount,
remark: formRes.remark,
reconciliationNo: no,
rows: tabelSource
}
if (filesRef?.current?.data && filesRef?.current?.data.length > 0) {
_params.files = filesRef?.current?.data;
}
if (_flag) {
_params.payer = dataSource.payer;
_params.payee = dataSource.payee;
_params.launchReconciliation = dataSource.launchReconciliation;
} else {
_params.reconciliationId = id;
_params.reconciliationNo = no;
}
_fetch = _flag ? postSettleAccountsBusinessReconciliationSaveReconciliation : postSettleAccountsBusinessReconciliationUpdateReconciliation;
setSubmitLoading(true)
......@@ -315,8 +325,15 @@ const Add = () => {
})
}
const addRows = (rows) => {
const _tabelSource = [...tabelSource];
const _rows = _tabelSource.concat(rows);
setTabelSource(_rows);
setDrawerVisible(false);
}
return (
<>
<div style={{ margin: '-24px -24px 0' }}>
<PeripheralLayout
no={_title}
tabLink={_tabs}
......@@ -372,14 +389,23 @@ const Add = () => {
</Card>
<BusinessFileLayout fetchdata={[]} currentRef={filesRef} editAble={_editAble} />
<DetailDrawer
searchParams={
{
payer: dataSource.payer,
payee: dataSource.payee,
taxRate: tabelSource?.[0]?.taxRate || '',
ids: ids?.join(',') || ''
}
}
visible={drawerVisible}
onClose={() => { setDrawerVisible(false) }}
onOk={addRows}
/>
</Form>
}
/>
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</>
</div>
)
}
export default Add;
......@@ -37,8 +37,8 @@ const BusinessFileLayout: React.FC<BusinessFileLayoutProps> = (props: BusinessFi
if (file.response) {
if (file.response.code === 1000) {
arr.push({
name: file.name,
url: file.response.data
fileName: file.name,
fileUrl: file.response.data
})
setloading(false);
}
......@@ -71,9 +71,9 @@ const BusinessFileLayout: React.FC<BusinessFileLayoutProps> = (props: BusinessFi
<div>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<a className={styles.upload_left} href={v.url} target='_blank'>
<a className={styles.upload_left} href={v.fileUrl} target='_blank'>
<LinkOutlined />
<span>{v.name}</span>
<span>{v.fileName}</span>
</a>
{editAble && <div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
......
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