Commit f36253a4 authored by 卢均锐's avatar 卢均锐

feat: 业务请款&业务请款协同完成

parent 2f992165
......@@ -442,6 +442,32 @@ const BalancedRoute = {
},
],
},
// 业务请款协同
{
path: '/memberCenter/balance/businessRequestFundsCollaboration',
relationParentCode: 'balance',
name: '业务请款协同',
routes: [
{
path:
'/memberCenter/balance/businessRequestFundsCollaboration/search',
component: '@/pages/balance/businessRequestFundsCollaboration/search',
relationParentCode: 'balance',
name: '请款单查询',
icon: 'smile',
},
{
hideInMenu: true,
path:
'/memberCenter/balance/businessRequestFundsCollaboration/search/preview',
component: '@/pages/balance/businessRequestFundsCollaboration/detail',
relationParentCode: 'balance',
name: '请款单详情',
icon: 'smile',
noMargin: true,
},
],
},
],
};
......
......@@ -54,8 +54,8 @@ const Admin: React.FC = () => {
)
}, {
title: intl.formatMessage({ id: 'balance.qingkuanleixing' }),
key: 'applyType',
dataIndex: 'applyType',
key: 'applyTypeName',
dataIndex: 'applyTypeName',
}, {
title: intl.formatMessage({ id: 'balance.qingkuanfang' }),
key: 'payee',
......@@ -80,8 +80,8 @@ const Admin: React.FC = () => {
width: 180
}, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
key: 'statusName',
dataIndex: 'statusName',
render: (text: any, record: any) => <StatusTag type='default' title={text} />
},
{
......@@ -127,7 +127,11 @@ const Admin: React.FC = () => {
const handleMenuClick = (e: any, record: any) => {
if (e.key === '1') {
history.push(`/memberCenter/balance/businessRequestFunds/admin/edit?id=${record.id}&no=${record.applyNo}`)
if(record.applyType === 1){
history.push(`/memberCenter/balance/businessRequestFunds/admin/fundsEdit?id=${record.id}&no=${record.applyNo}`)
}else{
history.push(`/memberCenter/balance/businessRequestFunds/admin/edit?id=${record.id}&no=${record.applyNo}`)
}
}
}
......
......@@ -5,59 +5,119 @@ import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
// import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import { priceFormat } from '@/utils/numberFomat';
import { getSettleAccountsBusinessApplyAmountFindApplyAmountRosSourceContracts } from '@/services/SettleV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
interface ContractDrawerProps {
visible: boolean,
partyBMemberId?: number,
partyBRoleId?: number,
onClose?: () => void,
onOk?: (rows: any[]) => void
}
const intl = getIntl();
const formActions = createFormActions();
const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProps) => {
const { visible, onClose } = props;
const { visible, partyBMemberId, partyBRoleId, onClose, onOk } = props;
const ref = useRef<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const [selectedRows, setSelectedRows] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
const _params = { ...params, partyBMemberId, partyBRoleId }
const { data } = await getSettleAccountsBusinessApplyAmountFindApplyAmountRosSourceContracts(_params)
return data;
}
const columns: ColumnType<any>[] = [{
title: '合同编号',
key: 'memberId',
dataIndex: 'memberId',
key: 'billNo',
dataIndex: 'billNo',
}, {
title: '合同摘要',
key: 'memberName',
dataIndex: 'memberName',
key: 'billAbstract',
dataIndex: 'billAbstract',
}, {
title: '合同生效时间',
key: 'memberType',
dataIndex: 'memberType',
key: 'billTime',
dataIndex: 'billTime',
}, {
title: '合同失效时间',
key: 'memberRole',
dataIndex: 'memberRole',
key: 'billEndTime',
dataIndex: 'billEndTime',
}, {
title: '含税/税率',
key: 'taxRate',
dataIndex: 'taxRate',
width: 150,
render: (text: any) => {
return text > 0 ? `是/${text}%` : '否';
}
}, {
title: '合同金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'billAmount',
dataIndex: 'billAmount',
render: (text: any) => ${priceFormat(text)}`
}, {
title: '合同剩余金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'remainAmount',
dataIndex: 'remainAmount',
render: (text: any) => ${priceFormat(text)}`
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
setSelectedRowKeys([record.id]);
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRows]
if (selected) {
childArr.push(record.billId);
childRowArr.push(record);
} else {
childArr.splice(
childArr.findIndex((item) => item === record.billId),
1
);
childRowArr.splice(
childRowArr.findIndex((item) => item.billId === record.billId),
1
);
}
setSelectedRowKeys(childArr)
setSelectedRows(childRowArr)
};
const handleSelectAll = (selected, selectedRow, changeRows) => {
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRows];
if (selected) {
childArr = Array.from(
new Set([...childArr, ...changeRows.map((item) => item.billId)])
);
childRowArr = Array.from(
new Set([...childRowArr, ...changeRows])
);
} else {
childArr = childArr.filter(
(item) => !changeRows.some((e) => e.billId === item)
);
childRowArr = childRowArr.filter(
(item) => !changeRows.some((e) => e.billId === item.billId)
);
}
setSelectedRowKeys(childArr);
setSelectedRows(childRowArr);
}
const _onOk = () => {
const _rows = [...selectedRows]
setSelectedRows([])
setSelectedRowKeys([])
onOk?.(_rows);
}
return (
<Drawer
......@@ -65,14 +125,14 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
key={`contract_${partyBMemberId}`}
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={_onOk} type="primary">
{'确定'}
</Button>
</div>
......@@ -80,14 +140,14 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
rowKey="billId"
rowSelection={{
type: 'radio',
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
onSelectAll: handleSelectAll,
}}
controlRender={
<NiceForm
......@@ -97,7 +157,7 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
'contractNo',
FORM_FILTER_PATH,
)
}}
......@@ -111,11 +171,11 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
grid: true
},
properties: {
memberName: {
contractNo: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入会员名称',
placeholder: '请输入合同编号',
align: 'flex-start',
},
},
......@@ -134,18 +194,18 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
},
},
properties: {
"applyAbstract": {
"contractAbstract": {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanzhaiyao' }),
placeholder: '请输入合同摘要',
allowClear: true,
}
},
"[expectPayTimeStart,expectPayTimeEnd]": {
"[startTime,endTime]": {
type: 'string',
"x-component": "daterange",
"x-component-props": {
placeholder: [intl.formatMessage({ id: 'balance.yujifukuankaishishijian' }), intl.formatMessage({ id: 'balance.yujifukuanjieshushijian' })],
placeholder: ['合同开始时间', '合同结束时间'],
allowClear: true,
}
},
......
......@@ -5,58 +5,66 @@ import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
// import { getOrderCommonSettleBuyerOrderPage } from '@/services/OrderNewV2Api'
import { getAuth } from '@/utils/auth'
import { priceFormat } from '@/utils/numberFomat';
import { getSettleAccountsBusinessApplyAmountFindApplyAmountRosSourceOrders } from '@/services/SettleV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
interface RequestFundsDrawerProps {
visible: boolean,
applyType: number,
onClose?: () => void,
onOk?: (rows: any[]) => void
}
const intl = getIntl();
const formActions = createFormActions();
const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFundsDrawerProps) => {
const { visible, onClose } = props;
const { visible, applyType, onClose, onOk } = props;
const ref = useRef<any>({})
const { memberId, memberRoleId } = (getAuth() || {})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const [selectedRow, setSelectedRow] = useState<any>([])
const [selectedRows, setSelectedRows] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getOrderCommonSettleBuyerOrderPage(_params)
const _params = { ...params, orderType: applyType, buyerMemberId: memberId, buyerRoleId: memberRoleId }
const { data } = await getSettleAccountsBusinessApplyAmountFindApplyAmountRosSourceOrders(_params)
return data;
}
const columns: ColumnType<any>[] = [{
title: '单据号',
key: 'orderNo',
dataIndex: 'orderNo',
key: 'billNo',
dataIndex: 'billNo',
}, {
title: '单据摘要',
key: 'digest',
dataIndex: 'digest',
key: 'billAbstract',
dataIndex: 'billAbstract',
}, {
title: '单据类型',
key: 'memberType',
dataIndex: 'memberType',
key: 'billTypeName',
dataIndex: 'billTypeName',
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'billTime',
dataIndex: 'billTime',
}, {
title: '单据状态',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'billStatus',
dataIndex: 'billStatus',
}, {
title: '单据金额',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'billAmount',
dataIndex: 'billAmount',
render: (text: any) => ${priceFormat(text)}`
}, {
title: '已付款',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'paid',
dataIndex: 'paid',
render: (text: any) => ${priceFormat(text)}`
}, {
title: '含税/税率',
key: 'taxRate',
......@@ -67,54 +75,63 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
}
}, {
title: '已请款待付款',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'appliedUnpaid',
dataIndex: 'appliedUnpaid',
render: (text: any) => ${priceFormat(text)}`
}, {
title: '待请款',
key: 'memberLevel',
dataIndex: 'memberLevel',
key: 'applyPayment',
dataIndex: 'applyPayment',
render: (text: any) => ${priceFormat(text)}`
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRow]
let childRowArr = [...selectedRows]
if (selected) {
childArr.push(record.productId);
childArr.push(record.billId);
childRowArr.push(record);
} else {
childArr.splice(
childArr.findIndex((item) => item === record.orderId),
childArr.findIndex((item) => item === record.billId),
1
);
childRowArr.splice(
childRowArr.findIndex((item) => item.orderId === record.orderId),
childRowArr.findIndex((item) => item.billId === record.billId),
1
);
}
setSelectedRowKeys(childArr)
setSelectedRow(childRowArr)
setSelectedRows(childRowArr)
};
const handleSelectAll = (selected, selectedRow, changeRows) => {
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRow];
let childRowArr = [...selectedRows];
if (selected) {
childArr = Array.from(
new Set([...childArr, ...changeRows.map((item) => item.orderId)])
new Set([...childArr, ...changeRows.map((item) => item.billId)])
);
childRowArr = Array.from(
new Set([...childRowArr, ...changeRows])
);
} else {
childArr = childArr.filter(
(item) => !changeRows.some((e) => e.orderId === item)
(item) => !changeRows.some((e) => e.billId === item)
);
childRowArr = childRowArr.filter(
(item) => !changeRows.some((e) => e.orderId === item.orderId)
(item) => !changeRows.some((e) => e.billId === item.billId)
);
}
setSelectedRow(childRowArr)
setSelectedRowKeys(childArr);
setSelectedRows(childRowArr)
}
const _onOk = () => {
const _rows = [...selectedRows]
setSelectedRows([])
setSelectedRowKeys([])
onOk?.(_rows);
}
......@@ -124,14 +141,14 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
key={`requestFunds_${applyType}`}
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={_onOk} type="primary">
{'确定'}
</Button>
</div>
......@@ -139,10 +156,10 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="orderId"
rowKey="billId"
rowSelection={{
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
......@@ -156,7 +173,7 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
useStateFilterSearchLinkageEffect(
$,
actions,
'orderId',
'orderNo',
FORM_FILTER_PATH,
)
}}
......@@ -170,7 +187,7 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
grid: true
},
properties: {
memberName: {
orderNo: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
......
......@@ -19,7 +19,7 @@ import WriteOffDrawer from '../../components/WriteOffDrawer'
const intl = getIntl();
const TABLINK = [
{ id: 'basicLayout', title: intl.formatMessage({ id: 'balance.jibenxinxi' }) },
{ id: 'billLayout', title: intl.formatMessage({ id: 'balance.duizhangdanmingxi' }) },
{ id: 'billLayout', title: '请款明细' },
]
const SearchDetail = () => {
......@@ -64,7 +64,7 @@ const SearchDetail = () => {
{ label: '请款类型', extra: data.applyTypeName, type: 'text' },
{ label: '支付方式', extra: data.moneyPayWayName, type: 'text' },
{ label: '请款备注', extra: data.remark, type: 'text' },
{ label: '对账单号', extra: <Link to={`/memberCenter/balance/businessReconciliation/search/preview?id=${data.reconciliationId}&no=${data.reconciliationNo}`}>{data.reconciliationNo}</Link>, type: 'text' },
{ label: '对账单号', extra: data?.reconciliationNo ? <Link to={`/memberCenter/balance/businessReconciliation/search/preview?id=${data.reconciliationId}&no=${data.reconciliationNo}`}>{data.reconciliationNo}</Link> : '-', type: 'text' },
{ label: '发票号码', extra: '40122826 (2020-08-25)', type: 'text' },
{ label: '状态', extra: <StatusTag type='primary' title={data.statusName} />, type: 'text' },
{ label: '单据时间', extra: data.createTime, type: 'text' },
......@@ -97,11 +97,22 @@ const SearchDetail = () => {
_getDetail()
}, [])
const _handleOpen = (record: any) => {
if (record.billType === 1) {
window.open(`/memberCenter/tranactionAbility/purchaseOrder/orderList/preview?id=${record.billId}`)
} else if (record.billType === 2) {
window.open(`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.billId}`)
}else {
window.open(`/memberCenter/afterService/returnApplication/returnQuery/detail?id=${record.billId}`)
}
}
const columns: ColumnType<any>[] = [
{
title: '单据号',
key: 'billNo',
dataIndex: 'billNo',
render: (text: any, record: any) => <Button type='link' onClick={() => {_handleOpen(record)}}>{text}</Button>
},
{
title: '单据摘要',
......@@ -110,8 +121,8 @@ const SearchDetail = () => {
},
{
title: '单据类型',
key: 'billType',
dataIndex: 'billType',
key: 'billTypeName',
dataIndex: 'billTypeName',
},
{
title: '单据时间',
......@@ -166,13 +177,13 @@ const SearchDetail = () => {
title: '核销金额',
key: 'writeOffAmount',
dataIndex: 'writeOffAmount',
render: (text: any, record: any) => <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
},
{
title: '可核销金额',
key: 'canWriteOffAmount',
dataIndex: 'canWriteOffAmount',
render: (text: any, record: any) => <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
},
];
......
import React, { useRef, useState } from 'react'
import { Card, Typography, Space, Button } from 'antd'
import React, { useRef } from 'react'
import { Card, Typography, Space } from 'antd'
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -57,8 +57,8 @@ const Search: React.FC = () => {
)
}, {
title: intl.formatMessage({ id: 'balance.qingkuanleixing' }),
key: 'applyType',
dataIndex: 'applyType',
key: 'applyTypeName',
dataIndex: 'applyTypeName',
}, {
title: intl.formatMessage({ id: 'balance.qingkuanfang' }),
key: 'payee',
......@@ -83,9 +83,9 @@ const Search: React.FC = () => {
width: 180
}, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='default' title={record.status} />
key: 'statusName',
dataIndex: 'statusName',
render: (text: any, record: any) => <StatusTag type='default' title={text} />
}];
return (
......
import React, { Fragment, useEffect, useState, useMemo, useRef } from 'react';
import { Button } from 'antd';
import { getIntl, history, Link } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from '@linkseeks/god';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
import StatusTag from '@/components/StatusTag';
import PeripheralLayout from '@/pages/transaction/purchaseAbility/components/detail';
import Card from '@/pages/transaction/purchaseAbility/components/card';
import CommonLayout from '@/pages/transaction/purchaseAbility/components/detail/components/bidCommonLayout';
import { getSettleAccountsBusinessApplyAmountDetailApplyAmount, getSettleAccountsBusinessApplyAmountApplyAmountRowList } from '@/services/SettleV2Api'
import WriteOffDrawer from '../../components/WriteOffDrawer'
const intl = getIntl();
const TABLINK = [
{ id: 'basicLayout', title: intl.formatMessage({ id: 'balance.jibenxinxi' }) },
{ id: 'billLayout', title: '请款明细' },
]
const SearchDetail = () => {
const {
query: {
id,
no
},
pathname,
} = history.location;
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [writeOffVisible, setWriteOffVisible] = useState<any>(false);
const [dataSource, setDataSource] = useState<any>({});
const currentRef = useRef({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [writeOffRecord, setWriteOffRecord] = useState<any>({});
const _tabs = useMemo(() => {
let _list = [];
TABLINK.forEach((item) => {
_list.push(item)
})
return _list;
}, [pathPci])
const _getDetail = () => {
const _params: any = {
applyAmountId: id,
applyNo: no
}
getSettleAccountsBusinessApplyAmountDetailApplyAmount(_params).then((res) => {
if (res.code === 1000) {
const data = res.data;
setDataSource(data);
setBasicEffect(
[
{
col: [
{ label: '请款单号', extra: data.applyNo, type: 'text' },
{ label: '请款摘要', extra: data.applyAbstract, type: 'text' },
{ label: '请款类型', extra: data.applyTypeName, type: 'text' },
{ label: '支付方式', extra: data.moneyPayWayName, type: 'text' },
{ label: '请款备注', extra: data.remark, type: 'text' },
{ label: '对账单号', extra: data?.reconciliationNo ? <Link to={`/memberCenter/balance/businessReconciliation/search/preview?id=${data.reconciliationId}&no=${data.reconciliationNo}`}>{data.reconciliationNo}</Link> : '-', type: 'text' },
{ label: '发票号码', extra: '40122826 (2020-08-25)', type: 'text' },
{ label: '状态', extra: <StatusTag type='primary' title={data.statusName} />, type: 'text' },
{ label: '单据时间', extra: data.createTime, type: 'text' },
]
},
{
col: [
{ label: '收款方', extra: data.payee, type: 'text' },
{ label: '账号名称', extra: data.accountName, type: 'text' },
{ label: '银行账号', extra: data.bankAccount, type: 'text' },
{ label: '开户行', extra: data.bankDeposit, type: 'text' },
{ label: '请款金额', extra: ${priceFormat(data.applyAmount)}`, type: 'text' },
{ label: '核销金额', extra: ${priceFormat(data.writeOffAmount)}`, type: 'text' },
{ label: '预计付款日期', extra: formatTimeString(data.expectPayTime, 'YYYY-MM-DD'), type: 'text' },
{ label: '付款方式', extra: data.payWayName, type: 'text' },
]
},
]
)
}
})
}
const _openWriteOff = (record) => {
setWriteOffRecord(record)
setWriteOffVisible(true)
}
useEffect(() => {
_getDetail()
}, [])
const _handleOpen = (record: any) => {
if (record.billType === 1) {
window.open(`/memberCenter/tranactionAbility/saleOrder/orderList/preview?id=${record.billId}`)
} else if (record.billType === 2) {
window.open(`memberCenter/contract/coordination/coordinationList/details?contractId=${record.billId}`)
}else {
window.open(`/memberCenter/afterService/returnManage/returnQuery/detail?id=${record.billId}`)
}
}
const columns: ColumnType<any>[] = [
{
title: '单据号',
key: 'billNo',
dataIndex: 'billNo',
render: (text: any, record: any) => <Button type='link' onClick={() => {_handleOpen(record)}}>{text}</Button>
},
{
title: '单据摘要',
key: 'billAbstract',
dataIndex: 'billAbstract',
},
{
title: '单据类型',
key: 'billTypeName',
dataIndex: 'billTypeName',
},
{
title: '单据时间',
key: 'billTime',
dataIndex: 'billTime',
},
{
title: '单据状态',
key: 'billStatus',
dataIndex: 'billStatus',
render: (text: any) => <StatusTag type='primary' title={text} />
},
{
title: '单据金额',
key: 'billAmount',
dataIndex: 'billAmount',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '含税/税率',
key: 'taxRate',
dataIndex: 'taxRate',
render: (text: any) => {
return text > 0 ? `是/${text}%` : '否';
}
},
{
title: '已付款',
key: 'paid',
dataIndex: 'paid',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '已请款待付款',
key: 'appliedUnpaid',
dataIndex: 'appliedUnpaid',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '对账金额',
key: 'reconciliationAmount',
dataIndex: 'reconciliationAmount',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '请款金额',
key: 'applyPayment',
dataIndex: 'applyPayment',
render: (text: any) => ${priceFormat(text)}`
},
{
title: '核销金额',
key: 'writeOffAmount',
dataIndex: 'writeOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
},
{
title: '可核销金额',
key: 'canWriteOffAmount',
dataIndex: 'canWriteOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
},
];
const loadingTableData = async (params) => {
const _params = { ...params };
_params.applyAmountId = id;
_params.applyNo = no;
const { data } = await getSettleAccountsBusinessApplyAmountApplyAmountRowList(_params)
return data
}
return (
<>
<PeripheralLayout
no={dataSource?.applyNo}
detail={dataSource?.applyAbstract}
tabLink={_tabs}
components={
<Fragment>
<CommonLayout layoutId="basicLayout" title={intl.formatMessage({ id: 'balance.jibenxinxi' })} effect={basicEffect} commonSpan={12} />
<Card id='billLayout' title={'请款明细'}>
<StandardTable
keepAlive={false}
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
</Fragment>
}
/>
<WriteOffDrawer visible={writeOffVisible} record={writeOffRecord} onClose={() => { setWriteOffVisible(false) }} />
</>
)
}
export default SearchDetail;
import React, { useRef, useState } from 'react'
import { Card, Typography, Space, Button } from 'antd'
import React, { useRef } from 'react'
import { Card, Typography, Space } from 'antd'
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -11,7 +11,6 @@ import NiceForm from '@/components/NiceForm'
import StatusTag from '@/components/StatusTag';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getSettleAccountsBusinessApplyAmountTeamworkVendorApplyAmountList, getSettleAccountsBusinessApplyAmountItemApplyAmountStatus } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl, Link } from 'umi';
......@@ -57,8 +56,8 @@ const Search: React.FC = () => {
)
}, {
title: intl.formatMessage({ id: 'balance.qingkuanleixing' }),
key: 'applyType',
dataIndex: 'applyType',
key: 'applyTypeName',
dataIndex: 'applyTypeName',
}, {
title: intl.formatMessage({ id: 'balance.qingkuanfang' }),
key: 'payer',
......@@ -87,9 +86,9 @@ const Search: React.FC = () => {
width: 180
}, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='default' title={record.status} />
key: 'statusName',
dataIndex: 'statusName',
render: (text: any, record: any) => <StatusTag type='default' title={text} />
}];
return (
......
import React, { useRef, useState, useMemo } from 'react';
import { Drawer, Button, Form, Input } from 'antd';
import { Drawer, Button, Form, Input, Table } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { formatTimeString } from '@/utils'
......@@ -154,14 +154,18 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
<Form
form={form}
>
<StandardTable
keepAlive={false}
fetchTableData={params => loadingTableData(params)}
columns={editAble ? editColumns : columns}
currentRef={ref}
tableProps={{ pagination: !editAble }}
rowKey="id"
/>
{editAble ? (
<StandardTable
keepAlive={false}
fetchTableData={params => loadingTableData(params)}
columns={editAble ? editColumns : columns}
currentRef={ref}
tableProps={{ pagination: !editAble }}
rowKey="id"
/>
) : (
<Table dataSource={record.writeOffRecords} columns={columns} pagination={false} />
)}
</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