Commit c9136e62 authored by XieZhiXiong's avatar XieZhiXiong
parents bc2bc2f0 4cecd1dd
This diff is collapsed.
......@@ -209,41 +209,39 @@ const SearchDetail = () => {
}
return (
<div style={{ margin: '-24px -24px 0' }}>
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
tabLink={_tabs}
components={
<Fragment>
<ProgressLayout effect={[{ title: '外部流转', state: 1, logs: dataSource?.externalLogStates }]} />
<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', scroll: { x: 2600 } }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
<BusinessFileLayout fetchdata={dataSource?.files} editAble={false} />
<Card id='invoiceLayout' title={intl.formatMessage({ id: 'balance.fapiaoxinxi' })}>
{dataSource?.invoiceMessages?.numbers.length > 0 ? (
<Row gutter={[8, 8]}>
{dataSource?.invoiceMessages?.numbers.map((item, index) => (
<Col span={6} key={`BusinessInvoiceCard_${index}`}>
<BusinessInvoiceCard data={item} />
</Col>
))}
</Row>
) : '-'}
</Card>
<RecordCommonLayout effect={{ externalLogs: dataSource?.records ?? [] }} />
</Fragment>
}
/>
</div>
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
tabLink={_tabs}
components={
<Fragment>
<ProgressLayout effect={[{ title: '外部流转', state: 1, logs: dataSource?.externalLogStates }]} />
<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', scroll: { x: 2600 } }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
<BusinessFileLayout fetchdata={dataSource?.files} editAble={false} />
<Card id='invoiceLayout' title={intl.formatMessage({ id: 'balance.fapiaoxinxi' })}>
{dataSource?.invoiceMessages?.numbers.length > 0 ? (
<Row gutter={[8, 8]}>
{dataSource?.invoiceMessages?.numbers.map((item, index) => (
<Col span={6} key={`BusinessInvoiceCard_${index}`}>
<BusinessInvoiceCard data={item} />
</Col>
))}
</Row>
) : '-'}
</Card>
<RecordCommonLayout effect={{ externalLogs: dataSource?.records ?? [] }} />
</Fragment>
}
/>
)
}
export default SearchDetail;
......@@ -345,7 +345,7 @@ const Add = () => {
}
return (
<div style={{ margin: '-24px -24px 0' }}>
<>
<PeripheralLayout
no={_title}
tabLink={_tabs}
......@@ -418,7 +418,7 @@ const Add = () => {
}
/>
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</div>
</>
)
}
export default Add;
......@@ -229,7 +229,7 @@ const SearchDetail = () => {
const _params: any = { reconciliationId: id }
postSettleAccountsBusinessReconciliationTeamworkGenerateApplyMount(_params).then((res) => {
if (res.code === 1000) {
history.push('/memberCenter/balance/businessReconciliation/readyAdd/funds', { data: res.data })
history.push('/memberCenter/balance/businessRequestFunds/admin/funds', { data: res.data })
}
})
}
......@@ -253,7 +253,7 @@ const SearchDetail = () => {
return (
<div style={{ margin: '-24px -24px 0' }}>
<>
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
......@@ -289,7 +289,7 @@ const SearchDetail = () => {
}
/>
<ModalOperate title='对账单确认' visible={modalVisible} id={id} fetch={postSettleAccountsBusinessReconciliationTeamworkConfirmReconciliation} onOk={_modalOk} onCancel={_modalCancle} />
</div>
</>
)
}
export default SearchDetail;
......@@ -200,7 +200,7 @@ const SearchDetail = () => {
}
return (
<div style={{ margin: '-24px -24px 0' }}>
<>
<PeripheralLayout
no={dataSource?.reconciliationNo}
detail={dataSource?.reconciliationAbstract}
......@@ -221,7 +221,7 @@ const SearchDetail = () => {
}
/>
<WriteOffDrawer visible={writeOffVisible} onClose={() => { setWriteOffVisible(false) }} />
</div>
</>
)
}
export default SearchDetail;
import React, { useRef } from 'react';
import { Drawer, Button } from 'antd';
import React, { useRef, useState, useMemo } from 'react';
import { Drawer, Button, Form, Input } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import { postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos } from '@/services/SettleV2Api'
import StatusTag from '@/components/StatusTag';
import { getIntl } from 'umi';
interface WriteOffDrawerProps {
visible: boolean,
record: any,
editAble?: boolean,
onClose?: () => void,
onOk?: (rows: any[]) => void
}
const intl = getIntl();
const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProps) => {
const { visible, onClose } = props;
const { visible, record, editAble = false, onClose, onOk } = props;
const ref = useRef<any>({})
const [tabelSource, setTabelSource] = useState<any>([]);
const [form] = Form.useForm();
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
_params.pageSize = editAble ? 100000 : _params.pageSize
_params.billId = record.billId
_params.sourceContractId = record.sourceContractId
_params.taxRate = record.taxRate
_params.notQueryDetailId = 0
const { data } = await postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos(_params)
setTabelSource(data.data)
return data;
}
const _changeNumbers = (record: any, value: any) => {
let _val = value.replace(/^\D*(\d*(?:\.\d{0,3})?).*$/g, '$1');
let _dataSource = [...tabelSource];
const _i = _dataSource.findIndex((item) => item.id === record.id);
let _item = { ..._dataSource[_i] };
_item.currentMoney = Number(_val);
_dataSource[_i] = _item;
setTabelSource(_dataSource);
}
const _handleOk = () => {
if (editAble) {
form.validateFields().then(formRes => {
onOk?.(tabelSource)
})
} else {
onClose?.()
}
}
const columns: ColumnType<any>[] = [{
title: '请款单号',
key: 'billNo',
dataIndex: 'billNo',
key: 'applyNo',
dataIndex: 'applyNo',
}, {
title: '请款摘要',
key: 'payer',
dataIndex: 'payer',
key: 'applyAbstract',
dataIndex: 'applyAbstract',
}, {
title: '请款类型',
key: 'deliveryBatch',
dataIndex: 'deliveryBatch',
key: 'applyTypeName',
dataIndex: 'applyTypeName',
}, {
title: '单据号',
key: 'deliveryNo',
dataIndex: 'deliveryNo',
key: 'applyRowBillNo',
dataIndex: 'applyRowBillNo',
}, {
title: '单据摘要',
key: 'deliveryNo',
dataIndex: 'deliveryNo',
key: 'applyRowBillAbstract',
dataIndex: 'applyRowBillAbstract',
}, {
title: '单据时间',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
key: 'applyBillDate',
dataIndex: 'applyBillDate',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: '单据状态',
key: 'receiveNo',
dataIndex: 'receiveNo',
key: 'applyStatusName',
dataIndex: 'applyStatusName',
render: (text: any, record: any) => <StatusTag type='primary' title={text} />
}, {
title: intl.formatMessage({ id: 'balance.hanshuishuil' }),
key: 'applyRowBillTaxRate',
dataIndex: 'applyRowBillTaxRate',
width: 100,
render: (text: any) => {
return text > 0 ? `是/${text}%` : '否';
}
}, {
title: '请款金额',
key: 'receiveTime',
dataIndex: 'receiveTime',
key: 'applyRowPayment',
dataIndex: 'applyRowPayment',
}, {
title: '核销金额',
key: 'orderStatus',
dataIndex: 'orderStatus',
key: 'writeOffAmount',
dataIndex: 'writeOffAmount',
render: (text: any) => ${priceFormat(text)}`
}, {
title: '可核销金额',
key: 'orderType',
dataIndex: 'orderType',
render: (text: any) => ${priceFormat(text)}`
key: 'canWriteAmount',
dataIndex: 'canWriteAmount',
render: (text: any, record: any) => ${priceFormat(text)}`
}];
const editColumns: ColumnType<any>[] = columns.concat([{
title: '本次核销金额',
key: 'canWriteAmount',
dataIndex: 'canWriteAmount',
render: (text: any, record: any) => (
<Form.Item
name={`canWriteAmount_${record.id}_${record.applyRowId}`}
style={{ margin: 0 }}
rules={[
{
validator: (_, value) => {
return value > record.canWriteAmount ? Promise.reject(new Error('可以核销金额')) : Promise.resolve()
}
},
]}
>
<Input type='number' addonBefore='¥' max={record.canWriteAmount} value={record.canWriteAmount} onChange={(e) => { _changeNumbers(record, e.target.value) }} />
</Form.Item>
)
}])
const _key = useMemo(() => record.billId, [record])
return (
<Drawer
......@@ -76,26 +138,31 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
key={_key}
width={'80%'}
footer={
<div style={{ textAlign: 'right' }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={onClose} type="primary">
<Button onClick={_handleOk} type="primary">
{'确定'}
</Button>
</div>
}
>
<StandardTable
keepAlive={false}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="billId"
/>
<Form
form={form}
>
<StandardTable
keepAlive={false}
fetchTableData={params => loadingTableData(params)}
columns={editAble ? editColumns : columns}
currentRef={ref}
tableProps={{ pagination: !editAble }}
rowKey="id"
/>
</Form>
</Drawer>
);
}
......
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