Commit 99754b29 authored by 卢均锐's avatar 卢均锐

feat: 缓存业务对账相关

-业务对账接口对接 -业务对账协同接口对接 -业务请款相关页面
parent 5d7abf4e
...@@ -35,6 +35,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -35,6 +35,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
const loadingTableData = async (params) => { const loadingTableData = async (params) => {
const _params = { ...params, ...searchParams } const _params = { ...params, ...searchParams }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params) const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
setDataSource(data);
return data; return data;
} }
...@@ -53,7 +54,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -53,7 +54,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
title: intl.formatMessage({ id: 'balance.fahuopici' }), title: intl.formatMessage({ id: 'balance.fahuopici' }),
key: 'deliveryBatch', key: 'deliveryBatch',
dataIndex: 'deliveryBatch', dataIndex: 'deliveryBatch',
// render: (text: any, record: any) => `第${text}批`, render: (text: any, record: any) => `第${text}批`,
}, { }, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }), title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo', key: 'deliveryNo',
...@@ -343,7 +344,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -343,7 +344,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
selectedRows.forEach((item) => { selectedRows.forEach((item) => {
item.products.forEach((child) => { item.products.forEach((child) => {
if (childSelectedRowKeys.includes(child.productId)) { if (childSelectedRowKeys.includes(child.productId)) {
_rows.push({ ...child, orderId: item.billId, orderNo: item.billNo, expectPayTime: formatTimeString(child?.expectPayTime, 'YYYY-MM-DD') }); _rows.push({ ...child, ...item, orderId: item.billId, orderNo: item.billNo, expectPayTime: formatTimeString(child?.expectPayTime, 'YYYY-MM-DD') });
} }
}) })
}) })
...@@ -351,6 +352,17 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -351,6 +352,17 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
onOk?.(_rows); onOk?.(_rows);
} }
useEffect(() => {
if (visible) {
ref?.current?.reload();
}else{
setChildSelectedRowKeys([]);
setSelectedRowKeys([]);
setChildSelectedRows([]);
setSelectedRows([]);
}
}, [visible])
return ( return (
<Drawer <Drawer
title={intl.formatMessage({ id: 'balance.xuanzedaiduizhangmingxi' })} title={intl.formatMessage({ id: 'balance.xuanzedaiduizhangmingxi' })}
...@@ -437,7 +449,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -437,7 +449,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
}, },
}, },
properties: { properties: {
"batch": { "deliveryBatch": {
type: 'string', type: 'string',
"x-component-props": { "x-component-props": {
placeholder: intl.formatMessage({ id: 'balance.qingshurufahuopici' }), placeholder: intl.formatMessage({ id: 'balance.qingshurufahuopici' }),
......
...@@ -26,7 +26,7 @@ const TABLINK = [ ...@@ -26,7 +26,7 @@ const TABLINK = [
{ id: 'billLayout', title: intl.formatMessage({ id: 'balance.duizhangdanmingxi' }) }, { id: 'billLayout', title: intl.formatMessage({ id: 'balance.duizhangdanmingxi' }) },
{ id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), }, { id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), },
{ id: 'invoiceLayout', title: intl.formatMessage({ id: 'balance.fapiaoxinxi' }), }, { id: 'invoiceLayout', title: intl.formatMessage({ id: 'balance.fapiaoxinxi' }), },
{ id: 'recordLayout', title: '流转记录'} { id: 'recordLayout', title: '流转记录' }
] ]
const SearchDetail = () => { const SearchDetail = () => {
...@@ -108,88 +108,109 @@ const SearchDetail = () => { ...@@ -108,88 +108,109 @@ const SearchDetail = () => {
title: '订单号', title: '订单号',
key: 'orderNo', key: 'orderNo',
dataIndex: 'orderNo', dataIndex: 'orderNo',
fixed: 'left',
width: 100
}, },
{ {
title: '预计结算日期', title: '预计结算日期',
key: 'settlementDate', key: 'expectPayTime',
dataIndex: 'settlementDate', dataIndex: 'expectPayTime',
width: 150
}, },
{ {
title: '发货批次', title: '发货批次',
key: 'deliveryBatch', key: 'deliveryBatch',
dataIndex: 'deliveryBatch', dataIndex: 'deliveryBatch',
width: 150
}, },
{ {
title: '发货单号', title: '发货单号',
key: 'deliveryNo', key: 'deliveryNo',
dataIndex: 'deliveryNo', dataIndex: 'deliveryNo',
width: 150
}, },
{ {
title: '收货单号', title: '收货单号',
key: 'receiveNo', key: 'receiveNo',
dataIndex: 'receiveNo', dataIndex: 'receiveNo',
width: 150
}, },
{ {
title: '物料编码', title: '物料编码',
key: 'productNo', key: 'productNo',
dataIndex: 'productNo', dataIndex: 'productNo',
width: 150
}, },
{ {
title: '物料名称', title: '物料名称',
key: 'productName', key: 'productName',
dataIndex: 'productName', dataIndex: 'productName',
width: 150
}, },
{ {
title: '规格型号', title: '规格型号',
key: 'spec', key: 'spec',
dataIndex: 'spec', dataIndex: 'spec',
width: 150
}, },
{ {
title: '品类', title: '品类',
key: 'category', key: 'category',
dataIndex: 'category', dataIndex: 'category',
width: 150
}, },
{ {
title: '品牌', title: '品牌',
key: 'brand', key: 'brand',
dataIndex: 'brand', dataIndex: 'brand',
width: 150
}, },
{ {
title: '单位', title: '单位',
key: 'unit', key: 'unit',
dataIndex: 'unit', dataIndex: 'unit',
width: 150
}, },
{ {
title: '税率', title: '含税/税率',
key: 'taxRate', key: 'taxRate',
dataIndex: 'taxRate', dataIndex: 'taxRate',
width: 150,
render: (text: any) => {
return text > 0 ? `是/${text}%` : '否';
}
}, },
{ {
title: '单价(含税)', title: '单价(含税)',
key: 'price', key: 'price',
dataIndex: 'price', dataIndex: 'price',
width: 150,
render: (text: any) => ${priceFormat(text)}` render: (text: any) => ${priceFormat(text)}`
}, },
{ {
title: '待对账数量', title: '待对账数量',
key: 'reconciliationQuantity', key: 'reconciliationQuantity',
dataIndex: 'reconciliationQuantity', dataIndex: 'reconciliationQuantity',
width: 150
}, },
{ {
title: '待对账金额(含税)', title: '待对账金额(含税)',
key: 'reconciliationMoneyAmount', key: 'reconciliationMoneyAmount',
dataIndex: 'reconciliationMoneyAmount', dataIndex: 'reconciliationMoneyAmount',
width: 150,
render: (text: any) => ${priceFormat(text)}` render: (text: any) => ${priceFormat(text)}`
}, },
{ {
title: '本次对账数量', title: '本次对账数量',
key: 'currentReconciliationQuantity', key: 'currentReconciliationQuantity',
dataIndex: 'currentReconciliationQuantity', dataIndex: 'currentReconciliationQuantity',
width: 150
}, },
{ {
title: '本次对账金额(含税)', title: '本次对账金额(含税)',
key: 'currentMoney', key: 'currentMoney',
dataIndex: 'currentMoney', dataIndex: 'currentMoney',
width: 150,
render: (text: any) => ${priceFormat(text)}` render: (text: any) => ${priceFormat(text)}`
}, },
]; ];
...@@ -217,7 +238,7 @@ const SearchDetail = () => { ...@@ -217,7 +238,7 @@ const SearchDetail = () => {
keepAlive={false} keepAlive={false}
currentRef={currentRef} currentRef={currentRef}
columns={columns} columns={columns}
tableProps={{ rowKey: 'reconciliationRowId' }} tableProps={{ rowKey: 'reconciliationRowId', scroll: { x: 2600 } }}
fetchTableData={(params: any) => loadingTableData(params)} fetchTableData={(params: any) => loadingTableData(params)}
/> />
</Card> </Card>
......
...@@ -29,7 +29,6 @@ const TABLINK = [ ...@@ -29,7 +29,6 @@ const TABLINK = [
] ]
const Add = () => { const Add = () => {
console.log(history)
const { const {
query: { query: {
id, id,
...@@ -47,6 +46,7 @@ const Add = () => { ...@@ -47,6 +46,7 @@ const Add = () => {
const [drawerVisible, setDrawerVisible] = useState<boolean>(false); const [drawerVisible, setDrawerVisible] = useState<boolean>(false);
const [unsaved, setUnsaved] = useState(false); const [unsaved, setUnsaved] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [buyerData, setBuyerData] = useState<any>({});
const filesRef = useRef<any>({}); const filesRef = useRef<any>({});
const _tabs = useMemo(() => { const _tabs = useMemo(() => {
...@@ -120,7 +120,7 @@ const Add = () => { ...@@ -120,7 +120,7 @@ const Add = () => {
const data = res.data.data; const data = res.data.data;
let _fields = {} let _fields = {}
for (let key in data) { for (let key in data) {
_fields[`currentReconciliationQuantity_${key}`] = data[key]['currentReconciliationQuantity'] _fields[`currentReconciliationQuantity_${data[key].orderNo}_${data[key].productId}`] = data[key]['currentReconciliationQuantity']
} }
form.setFieldsValue(_fields); form.setFieldsValue(_fields);
setTabelSource(data); setTabelSource(data);
...@@ -137,6 +137,7 @@ const Add = () => { ...@@ -137,6 +137,7 @@ const Add = () => {
const data = res.data; const data = res.data;
setDataSource(data); setDataSource(data);
setTabelSource(data.rows); setTabelSource(data.rows);
setBuyerData({ buyerMemberId: state?.rows?.[0]?.buyerMemberId, buyerRoleId: state?.rows?.[0]?.buyerRoleId })
} }
}) })
} else { } else {
...@@ -161,9 +162,10 @@ const Add = () => { ...@@ -161,9 +162,10 @@ const Add = () => {
} }
/** 删除列表 */ /** 删除列表 */
const handleRemove = (index: number) => { const handleRemove = (index: number, record: any) => {
const data = [...tabelSource]; const data = [...tabelSource];
data.splice(index, 1); data.splice(index, 1);
form.setFieldsValue({ [`currentReconciliationQuantity_${record.orderNo}_${record.productId}`]: null });
setTabelSource(data) setTabelSource(data)
} }
...@@ -183,7 +185,7 @@ const Add = () => { ...@@ -183,7 +185,7 @@ const Add = () => {
key: 'deliveryBatch', key: 'deliveryBatch',
dataIndex: 'deliveryBatch', dataIndex: 'deliveryBatch',
width: 100, width: 100,
// render: (text: any, record: any) => `第${text}批`, render: (text: any, record: any) => `第${text}批`,
}, { }, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }), title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo', key: 'deliveryNo',
...@@ -246,7 +248,7 @@ const Add = () => { ...@@ -246,7 +248,7 @@ const Add = () => {
render: (text: any, record: any, index: number) => ( render: (text: any, record: any, index: number) => (
_editAble ? ( _editAble ? (
<Form.Item <Form.Item
name={`currentReconciliationQuantity_${index}`} name={`currentReconciliationQuantity_${record.orderNo}_${record.productId}`}
style={{ margin: 0 }} style={{ margin: 0 }}
rules={[ rules={[
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) } { required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) }
...@@ -271,7 +273,7 @@ const Add = () => { ...@@ -271,7 +273,7 @@ const Add = () => {
fixed: 'right', fixed: 'right',
width: 100, width: 100,
render: (text: any, record: any, index: number) => ( render: (text: any, record: any, index: number) => (
<Button type='link' onClick={() => { handleRemove(index) }}> <Button type='link' onClick={() => { handleRemove(index, record) }}>
{intl.formatMessage({ id: 'balance.shanchu' })} {intl.formatMessage({ id: 'balance.shanchu' })}
</Button> </Button>
) )
...@@ -313,6 +315,8 @@ const Add = () => { ...@@ -313,6 +315,8 @@ const Add = () => {
_params.payer = dataSource.payer; _params.payer = dataSource.payer;
_params.payee = dataSource.payee; _params.payee = dataSource.payee;
_params.launchReconciliation = dataSource.launchReconciliation; _params.launchReconciliation = dataSource.launchReconciliation;
_params.buyerMemberId = buyerData.buyerMemberId;
_params.buyerRoleId = buyerData.buyerRoleId;
} else { } else {
_params.reconciliationId = id; _params.reconciliationId = id;
} }
...@@ -393,14 +397,14 @@ const Add = () => { ...@@ -393,14 +397,14 @@ const Add = () => {
</Button> : null} </Button> : null}
<Table dataSource={tabelSource} columns={_editAble ? columnsEdit : columns} scroll={{ x: 1300 }} pagination={false} /> <Table dataSource={tabelSource} columns={_editAble ? columnsEdit : columns} scroll={{ x: 1300 }} pagination={false} />
</Card> </Card>
<BusinessFileLayout fetchdata={[]} currentRef={filesRef} editAble={_editAble} /> <BusinessFileLayout fetchdata={dataSource?.files} currentRef={filesRef} editAble={_editAble} />
<DetailDrawer <DetailDrawer
searchParams={ searchParams={
{ {
payer: dataSource.payer, payer: dataSource.payer,
payee: dataSource.payee, // payee: dataSource.payee,
taxRate: tabelSource?.[0]?.taxRate || '', taxRate: tabelSource?.[0]?.taxRate || '',
ids: ids?.join(',') || '' ids: ids
} }
} }
visible={drawerVisible} visible={drawerVisible}
......
...@@ -14,7 +14,7 @@ import { priceFormat } from '@/utils/numberFomat' ...@@ -14,7 +14,7 @@ import { priceFormat } from '@/utils/numberFomat'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
import { getIntl, history, Link } from 'umi'; import { getIntl, history, Link } from 'umi';
import { getSettleAccountsBusinessReconciliationToSaveReconciliationList, postSettleAccountsBusinessReconciliationSubmitReconciliation, postSettleAccountsBusinessReconciliationDeleteReconciliation } from '@/services/SettleV2Api' import { postSettleAccountsBusinessReconciliationToSaveReconciliationList, postSettleAccountsBusinessReconciliationSubmitReconciliation, postSettleAccountsBusinessReconciliationDeleteReconciliation } from '@/services/SettleV2Api'
const intl = getIntl(); const intl = getIntl();
...@@ -34,7 +34,7 @@ const ReadyAdd: React.FC = () => { ...@@ -34,7 +34,7 @@ const ReadyAdd: React.FC = () => {
if (params.createTimeEnd) { if (params.createTimeEnd) {
_params.createTimeEnd = formatTimeString(Number(params.createTimeEnd), 'YYYY-MM-DD'); _params.createTimeEnd = formatTimeString(Number(params.createTimeEnd), 'YYYY-MM-DD');
} }
const { data } = await getSettleAccountsBusinessReconciliationToSaveReconciliationList(_params) const { data } = await postSettleAccountsBusinessReconciliationToSaveReconciliationList(_params)
return data return data
} }
...@@ -72,8 +72,8 @@ const ReadyAdd: React.FC = () => { ...@@ -72,8 +72,8 @@ const ReadyAdd: React.FC = () => {
width: 180 width: 180
}, { }, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }), title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status', key: 'statusName',
dataIndex: 'status', dataIndex: 'statusName',
render: (text: any) => <StatusTag type='primary' title={text} /> render: (text: any) => <StatusTag type='primary' title={text} />
}, },
{ {
...@@ -81,7 +81,7 @@ const ReadyAdd: React.FC = () => { ...@@ -81,7 +81,7 @@ const ReadyAdd: React.FC = () => {
dataIndex: 'operate', dataIndex: 'operate',
align: 'center', align: 'center',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
{record.button === 1 && <Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchSubmitBatch(record.reconciliationId)}> {record.status === 1 && <Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchSubmitBatch(record.reconciliationId)}>
<Button type='link'> <Button type='link'>
{intl.formatMessage({ id: 'balance.tijiao' })} {intl.formatMessage({ id: 'balance.tijiao' })}
</Button> </Button>
...@@ -100,15 +100,15 @@ const ReadyAdd: React.FC = () => { ...@@ -100,15 +100,15 @@ const ReadyAdd: React.FC = () => {
}]; }];
const fetchSubmitBatch = (id: number) => { const fetchSubmitBatch = (id: number) => {
postSettleAccountsBusinessReconciliationSubmitReconciliation({ reconciliationId: id }).then((res) => { postSettleAccountsBusinessReconciliationSubmitReconciliation({ id }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
} }
}) })
} }
const fetchDelete = (id: string) => { const fetchDelete = (id: number) => {
postSettleAccountsBusinessReconciliationDeleteReconciliation({ id: id }).then((res) => { postSettleAccountsBusinessReconciliationDeleteReconciliation({ id }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
} }
......
...@@ -55,7 +55,7 @@ const ReadyReconciliation: React.FC = () => { ...@@ -55,7 +55,7 @@ const ReadyReconciliation: React.FC = () => {
title: intl.formatMessage({ id: 'balance.fahuopici' }), title: intl.formatMessage({ id: 'balance.fahuopici' }),
key: 'deliveryBatch', key: 'deliveryBatch',
dataIndex: 'deliveryBatch', dataIndex: 'deliveryBatch',
// render: (text: any, record: any) => `第${text}批`, render: (text: any, record: any) => `第${text}批`,
}, { }, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }), title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo', key: 'deliveryNo',
......
...@@ -76,8 +76,8 @@ const Search: React.FC = () => { ...@@ -76,8 +76,8 @@ const Search: React.FC = () => {
width: 180 width: 180
}, { }, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }), title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status', key: 'statusName',
dataIndex: 'status', dataIndex: 'statusName',
render: (text: any) => <StatusTag type='primary' title={text} /> render: (text: any) => <StatusTag type='primary' title={text} />
}]; }];
......
...@@ -17,7 +17,7 @@ const { onFieldChange$ } = FormEffectHooks; ...@@ -17,7 +17,7 @@ const { onFieldChange$ } = FormEffectHooks;
export interface IProps { export interface IProps {
title: string, title: string,
visible: boolean, visible: boolean,
id: number, id: any,
onCancel?: () => void, onCancel?: () => void,
onOk?: () => void, onOk?: () => void,
fetch?: () => Promise<unknown>, fetch?: () => Promise<unknown>,
...@@ -38,8 +38,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -38,8 +38,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
const [confirmLoading, setConfirmLoading] = useState<boolean>(false); const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const useFormEffects = () => { const useFormEffects = () => {
onFieldChange$('state').subscribe(({ value }) => { onFieldChange$('isConfirm').subscribe(({ value }) => {
actions.setFieldState('auditOpinion', state => { actions.setFieldState('reason', state => {
if (value == 1) { if (value == 1) {
state.visible = false state.visible = false
} else { } else {
...@@ -60,7 +60,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -60,7 +60,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
{ label: intl.formatMessage({ id: 'detail.purchase.message86' }), value: 1 }, { label: intl.formatMessage({ id: 'detail.purchase.message86' }), value: 1 },
{ label: intl.formatMessage({ id: 'detail.purchase.message87' }), value: 0 } { label: intl.formatMessage({ id: 'detail.purchase.message87' }), value: 0 }
]} ]}
name='state' name='isConfirm'
required required
x-component="Radio" x-component="Radio"
x-component-props={{}} x-component-props={{}}
...@@ -78,9 +78,9 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -78,9 +78,9 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
setConfirmLoading(true); setConfirmLoading(true);
let value = { ...val } let value = { ...val }
let params: any = {} let params: any = {}
params.state = value.state; params.isConfirm = value.isConfirm;
value.state !== 1 && (params.auditOpinion = value.auditOpinion); value.isConfirm !== 1 && (params.reason = value.reason);
fetch({ id, ...params }).then(res => { fetch({ reconciliationId: id, ...params }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
onOk && onOk() onOk && onOk()
} }
...@@ -120,14 +120,14 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -120,14 +120,14 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
effects={() => useFormEffects()} effects={() => useFormEffects()}
onSubmit={(values) => handleSubmit(values)} onSubmit={(values) => handleSubmit(values)}
initialValues={{ initialValues={{
state: 1, isConfirm: 1,
status: 1 status: 1
}} }}
> >
{modalNode()} {modalNode()}
<Field <Field
title={modalText()} title={modalText()}
name={'auditOpinion'} name={'reason'}
x-component="TextArea" x-component="TextArea"
required required
x-component-props={{ x-component-props={{
......
...@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils' ...@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat' import { priceFormat } from '@/utils/numberFomat'
import { getSettleAccountsBusinessReconciliationTeamworkConfirmReconciliationList } from '@/services/SettleV2Api' import { getSettleAccountsBusinessReconciliationTeamworkConfirmReconciliationList } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi'; import { getIntl, Link } from 'umi';
const intl = getIntl(); const intl = getIntl();
const { Link, Text } = Typography; const { Text } = Typography;
// 对账单查询 // 对账单查询
...@@ -42,8 +42,8 @@ const ReadyConfirm: React.FC = () => { ...@@ -42,8 +42,8 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.duizhangdanhao' }), title: intl.formatMessage({ id: 'balance.duizhangdanhao' }),
key: 'reconciliationNo', key: 'reconciliationNo',
dataIndex: 'reconciliationNo', dataIndex: 'reconciliationNo',
render: (text: any) => ( render: (text: any, record: any) => (
<Link>{text}</Link> <Link to={`readyConfirm/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
) )
}, { }, {
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
...@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => { ...@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.caozuo' }), title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
render: (text: any) => <Button type='link'>{intl.formatMessage({ id: 'balance.queren' })}</Button> render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link>
}]; }];
return ( return (
......
...@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils' ...@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat' import { priceFormat } from '@/utils/numberFomat'
import { getSettleAccountsBusinessReconciliationTeamworkTobeApplyamountList } from '@/services/SettleV2Api' import { getSettleAccountsBusinessReconciliationTeamworkTobeApplyamountList } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi'; import { getIntl, Link } from 'umi';
const intl = getIntl(); const intl = getIntl();
const { Link, Text } = Typography; const { Text } = Typography;
// 待请款 // 待请款
...@@ -39,14 +39,14 @@ const ReadyPay: React.FC = () => { ...@@ -39,14 +39,14 @@ const ReadyPay: React.FC = () => {
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: intl.formatMessage({id: 'balance.duizhangdanhao'}), title: intl.formatMessage({ id: 'balance.duizhangdanhao' }),
key: 'reconciliationNo', key: 'reconciliationNo',
dataIndex: 'reconciliationNo', dataIndex: 'reconciliationNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Link>{text}</Link> <Link to={`readyPay/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
) )
}, { }, {
title: intl.formatMessage({id: 'balance.danjuzhaiyao'}), title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
key: 'reconciliationAbstract', key: 'reconciliationAbstract',
dataIndex: 'reconciliationAbstract', dataIndex: 'reconciliationAbstract',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -55,30 +55,30 @@ const ReadyPay: React.FC = () => { ...@@ -55,30 +55,30 @@ const ReadyPay: React.FC = () => {
</Space> </Space>
) )
}, { }, {
title: intl.formatMessage({id: 'balance.shoukuanfang'}), title: intl.formatMessage({ id: 'balance.shoukuanfang' }),
key: 'payee', key: 'payee',
dataIndex: 'payee', dataIndex: 'payee',
}, { }, {
title: intl.formatMessage({id: 'balance.duizhangzongjinehanshui'}), title: intl.formatMessage({ id: 'balance.duizhangzongjinehanshui' }),
key: 'reconciliationMoneyAmount', key: 'reconciliationMoneyAmount',
dataIndex: 'reconciliationMoneyAmount', dataIndex: 'reconciliationMoneyAmount',
render: (text: any, record: any) => ${priceFormat(text)}`, render: (text: any, record: any) => ${priceFormat(text)}`,
}, { }, {
title: intl.formatMessage({id: 'balance.danjushijian'}), title: intl.formatMessage({ id: 'balance.danjushijian' }),
key: 'createTime', key: 'createTime',
dataIndex: 'createTime', dataIndex: 'createTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'), render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180 width: 180
}, { }, {
title: intl.formatMessage({id: 'balance.waibuzhuangtai'}), title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status', key: 'status',
dataIndex: 'status', dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='primary' title={text} /> render: (text: any, record: any) => <StatusTag type='primary' title={text} />
}, { }, {
title: intl.formatMessage({id: 'balance.caozuo'}), title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
render: (text: any, record: any) => <Button type='link'>{intl.formatMessage({id: 'balance.qingkuan'})}</Button> render: (text: any, record: any) => <Link to={`readyPay/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.qingkuan' })}</Link>
}]; }];
return ( return (
...@@ -115,7 +115,7 @@ const ReadyPay: React.FC = () => { ...@@ -115,7 +115,7 @@ const ReadyPay: React.FC = () => {
type: 'string', type: 'string',
"x-component": 'Search', "x-component": 'Search',
'x-component-props': { 'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruduizhangdanhao'}), placeholder: intl.formatMessage({ id: 'balance.qingshuruduizhangdanhao' }),
align: 'flex-start', align: 'flex-start',
allowClear: true, allowClear: true,
}, },
...@@ -138,14 +138,14 @@ const ReadyPay: React.FC = () => { ...@@ -138,14 +138,14 @@ const ReadyPay: React.FC = () => {
"reconciliationAbstract": { "reconciliationAbstract": {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruduizhangdanzhaiyao'}), placeholder: intl.formatMessage({ id: 'balance.qingshuruduizhangdanzhaiyao' }),
allowClear: true, allowClear: true,
} }
}, },
"payee": { "payee": {
type: 'string', type: 'string',
"x-component-props": { "x-component-props": {
placeholder: intl.formatMessage({id: 'balance.qingshurushoukuanfang'}), placeholder: intl.formatMessage({ id: 'balance.qingshurushoukuanfang' }),
allowClear: true, allowClear: true,
} }
}, },
...@@ -153,14 +153,14 @@ const ReadyPay: React.FC = () => { ...@@ -153,14 +153,14 @@ const ReadyPay: React.FC = () => {
type: 'string', type: 'string',
"x-component": "dateSelect", "x-component": "dateSelect",
"x-component-props": { "x-component-props": {
placeholder: intl.formatMessage({id: 'balance.danjushijianquanbu'}), placeholder: intl.formatMessage({ id: 'balance.danjushijianquanbu' }),
allowClear: true, allowClear: true,
} }
}, },
submit: { submit: {
'x-component': 'Submit', 'x-component': 'Submit',
'x-component-props': { 'x-component-props': {
children: intl.formatMessage({id: 'balance.chaxun'}), children: intl.formatMessage({ id: 'balance.chaxun' }),
}, },
}, },
}, },
......
...@@ -47,7 +47,7 @@ const Search: React.FC = () => { ...@@ -47,7 +47,7 @@ const Search: React.FC = () => {
key: 'reconciliationNo', key: 'reconciliationNo',
dataIndex: 'reconciliationNo', dataIndex: 'reconciliationNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Link to={`search/preview?id=${record.id}`}>{text}</Link> <Link to={`search/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
) )
}, { }, {
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
......
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { Form, Button, Row, Col, Input, Select, DatePicker, Radio, Table, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { CheckCircleOutlined, PlusOutlined, LinkOutlined } from '@ant-design/icons';
import { getIntl, history, Prompt } from 'umi';
import { GlobalConfig } from '@/global/config'
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
import StatusTag from '@/components/StatusTag';
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';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
}
const intl = getIntl();
const TABLINK = [
{ id: 'basicLayout', title: intl.formatMessage({ id: 'balance.jibenxinxi' }) },
{ id: 'billLayout', title: '请款明细' },
]
const Add = () => {
const {
query: {
id,
no
},
pathname,
} = history.location;
const [form] = Form.useForm();
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
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);
const [buyerData, setBuyerData] = useState<any>({});
const filesRef = useRef<any>({});
const _tabs = useMemo(() => {
let _list = [];
TABLINK.forEach((item) => {
_list.push(item)
})
return _list;
}, [pathPci])
const _title = useMemo(() => {
switch (path) {
case 'add': return '新增请款单';
case 'edit': return '对账单请款';
}
}, [path])
const _editAble = useMemo(() => {
return path !== 'preview';
}, [path])
const _returnTopButton = () => {
return (
<Button type='primary' loading={submitLoading} icon={<CheckCircleOutlined />} >{intl.formatMessage({ id: 'balance.baocun' })}</Button>
)
}
return (
<div style={{ margin: '-24px -24px 0' }}>
<PeripheralLayout
no={_title}
tabLink={_tabs}
effect={_editAble && _returnTopButton()}
components={
<Form
{...layout}
form={form}
>
<Card id='basicLayout' title={intl.formatMessage({ id: 'balance.jibenxinxi' })}>
<Row gutter={[8, 8]} justify="space-between">
<Col span={11}>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='单据摘要'
name='reconciliationAbstract'
rules={[{ required: true, message: '请输入单据摘要' }]}
>
<Input placeholder={'请输入单据摘要'} maxLength={60} />
</Form.Item></Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='请款类型'
name='reconciliationtype'
rules={[{ required: true, message: '请选择请款类型' }]}
>
<Select placeholder={'请选择请款类型'} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='预计付款日期'
name='reconciliationDate'
rules={[{ required: true, message: '请选择预计付款日期' }]}
>
<DatePicker placeholder={'请选择预计付款日期'} style={{ width: '100%' }} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='付款方式'
name='reconciliationWay'
rules={[{ required: true, message: '请选择付款方式' }]}
>
<Radio.Group>
<Radio.Button value="1">现结</Radio.Button>
<Radio.Button value="2">月结</Radio.Button>
<Radio.Button value="3">帐期(按天)</Radio.Button>
<Radio.Button value="4">帐期(按月)</Radio.Button>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='支付方式'
name='reconciliationtPayWay'
rules={[{ required: true, message: '请选择支付方式' }]}
>
<Select placeholder={'请选择支付方式'} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='请款备注'
name='remarks'
rules={[{ required: true, message: '请输入请款备注' }]}
>
<Input placeholder={'请输入请款备注'} maxLength={80} />
</Form.Item>
</Col>
</Row>
</Col>
<Col span={11}>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='收款方'
>
<Input readOnly maxLength={80} addonAfter={<Button type='primary' icon={<LinkOutlined />} />} />
</Form.Item>
</Col>
</Row>
<Row>
<Form.Item
label='账号名称'
>
广州白马家具交易中心
</Form.Item>
</Row>
<Row>
<Form.Item
label='银行账号'
>
6214 7812 3456 7891 1234
</Form.Item>
</Row>
<Row>
<Form.Item
label='开户行'
>
中国建设银行广州市分行营业部
</Form.Item>
</Row>
<Row>
<Form.Item
label='请款金额'
>
¥ 10,000.00
</Form.Item>
</Row>
</Col>
</Row>
</Card>
<Card id='billLayout' title={'请款明细'}>
{_editAble ? <>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='单据类型'
name='reconciliationWay'
rules={[{ required: true, message: '请选择单据类型' }]}
>
<Radio.Group>
<Radio value="1">待请款单据</Radio>
<Radio value="2">待请款合同</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Button
type='dashed'
block
style={{
marginBottom: '24px',
}}
onClick={() => { setDrawerVisible(true) }}
>
<PlusOutlined />
{intl.formatMessage({ id: 'balance.xuanze' })}
</Button>
</> : null}
<Table dataSource={tabelSource} columns={[]} scroll={{ x: 1300 }} pagination={false} />
</Card>
</Form>
}
/>
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</div>
)
}
export default Add;
...@@ -34,7 +34,7 @@ const SearchDetail = () => { ...@@ -34,7 +34,7 @@ const SearchDetail = () => {
} = history.location; } = history.location;
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]); const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]); const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [writeOffVisible, setWriteOffVisible] = useState<any>({}); const [writeOffVisible, setWriteOffVisible] = useState<any>(false);
const [dataSource, setDataSource] = useState<any>({}); const [dataSource, setDataSource] = useState<any>({});
const currentRef = useRef({}); const currentRef = useRef({});
const [basicEffect, setBasicEffect] = useState<any>([ const [basicEffect, setBasicEffect] = useState<any>([
......
...@@ -45,7 +45,7 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => { ...@@ -45,7 +45,7 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => {
title: intl.formatMessage({ id: 'table.purchase.status' }), title: intl.formatMessage({ id: 'table.purchase.status' }),
key: 'status', key: 'status',
dataIndex: 'status', dataIndex: 'status',
render: (_text: any, _record: any) => <StatusTag type='primary' title={_record.stateName} /> render: (_text: any, _record: any) => <StatusTag type='primary' title={_text} />
}, },
{ {
title: intl.formatMessage({ id: 'table.purchase.operate' }), title: intl.formatMessage({ id: 'table.purchase.operate' }),
......
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