Commit 2c3d28fa authored by 卢均锐's avatar 卢均锐

fix: [19967]

parent 7eecac1b
......@@ -12,7 +12,7 @@ import PeripheralLayout from '@/pages/transaction/purchaseAbility/components/det
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 { getSettleAccountsBusinessApplyAmountDetailApplyAmount, getSettleAccountsBusinessApplyAmountApplyAmountRowList, postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos } from '@/services/SettleV2Api'
import WriteOffDrawer from '../../components/WriteOffDrawer'
......@@ -104,9 +104,28 @@ const SearchDetail = () => {
})
}
const _openWriteOff = (record) => {
setWriteOffRecord(record)
setWriteOffVisible(true)
const _openWriteOff = (record: any, type: number) => {
if (type === 1) {
setWriteOffRecord(record)
setWriteOffVisible(true)
} else {
const _params = {
billId: record.billId,
sourceContractId: record.sourceContractId,
notQueryDetailId: record.id,
taxRate: record.taxRate,
current: 1,
pageSize: 99999
};
postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos(_params).then((res) => {
if (res.code === 1000) {
const _record = { ...record };
_record.writeOffRecords = res.data.data;
setWriteOffRecord(_record)
setWriteOffVisible(true)
}
})
}
}
useEffect(() => {
......@@ -193,13 +212,13 @@ const SearchDetail = () => {
title: '核销金额',
key: 'writeOffAmount',
dataIndex: 'writeOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record, 1) }}>¥ {priceFormat(text)}</Button>
},
{
title: '可核销金额',
key: 'canWriteOffAmount',
dataIndex: 'canWriteOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record, 2) }}>¥ {priceFormat(text)}</Button>
},
];
......
......@@ -12,7 +12,7 @@ import PeripheralLayout from '@/pages/transaction/purchaseAbility/components/det
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 { getSettleAccountsBusinessApplyAmountDetailApplyAmount, getSettleAccountsBusinessApplyAmountApplyAmountRowList, postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos } from '@/services/SettleV2Api'
import WriteOffDrawer from '../../components/WriteOffDrawer'
......@@ -104,9 +104,28 @@ const SearchDetail = () => {
})
}
const _openWriteOff = (record) => {
setWriteOffRecord(record)
setWriteOffVisible(true)
const _openWriteOff = (record: any, type: number) => {
if (type === 1) {
setWriteOffRecord(record)
setWriteOffVisible(true)
} else {
const _params = {
billId: record.billId,
sourceContractId: record.sourceContractId,
notQueryDetailId: record.id,
taxRate: record.taxRate,
current: 1,
pageSize: 99999
};
postSettleAccountsBusinessApplyAmountFindCanApplyAmountRos(_params).then((res) => {
if (res.code === 1000) {
const _record = { ...record };
_record.writeOffRecords = res.data.data;
setWriteOffRecord(_record)
setWriteOffVisible(true)
}
})
}
}
useEffect(() => {
......@@ -118,7 +137,7 @@ const SearchDetail = () => {
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 {
} else {
window.open(`/memberCenter/afterService/returnManage/returnQuery/detail?id=${record.billId}`)
}
}
......@@ -128,7 +147,7 @@ const SearchDetail = () => {
title: '单据号',
key: 'billNo',
dataIndex: 'billNo',
render: (text: any, record: any) => <Button type='link' onClick={() => {_handleOpen(record)}}>{text}</Button>
render: (text: any, record: any) => <Button type='link' onClick={() => { _handleOpen(record) }}>{text}</Button>
},
{
title: '单据摘要',
......@@ -193,13 +212,13 @@ const SearchDetail = () => {
title: '核销金额',
key: 'writeOffAmount',
dataIndex: 'writeOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record, 1) }}>¥ {priceFormat(text)}</Button>
},
{
title: '可核销金额',
key: 'canWriteOffAmount',
dataIndex: 'canWriteOffAmount',
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record) }}>¥ ${priceFormat(text)}</Button>
render: (text: any, record: any) => text > 0 && <Button type='link' onClick={() => { _openWriteOff(record, 2) }}>¥ {priceFormat(text)}</Button>
},
];
......
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