Commit 4d327715 authored by 陈智峰's avatar 陈智峰

Merge branch 'feng-jinfa-20221102' into 'jinfa-20221102'

fix: 金发bug See merge request project/jinfa-platform!445
parents 28d7551c 4986581c
......@@ -314,7 +314,7 @@ const SettlementList = () => {
if (res.code === 1000) {
ref.current.reloadCurrent()
setSelectedRowKeys([])
setSelectRow([])
setSelectRow([])
}
})
},
......@@ -355,7 +355,7 @@ const SettlementList = () => {
<Button disabled={!selectRow.selectedRowKeys.length} onClick={handlePayment}>{intl.formatMessage({ id: 'balance.batch.payment.btn' })}</Button>
</AuthButton>
<AuthButton btnCode='payable.export'>
<Button disabled={!selectRow.selectedRowKeys.length} onClick={handleExport}>{intl.formatMessage({ id: 'balance.batch.export.btn' })}</Button>
<Button disabled={!selectRow.selectedRowKeys.length} onClick={handleExport}>导出EXCEL</Button>
</AuthButton>
</Space>
</Col>
......
......@@ -13,11 +13,14 @@ import { AuthUrl } from '@/components/AuthButton/AuthUrl';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getSettleAccountsBusinessApplyAmountBuyerApplyAmountList, getSettleAccountsBusinessApplyAmountItemApplyAmountStatus } from '@/services/SettleV2Api'
import { getSettleAccountsBusinessApplyAmountBuyerApplyAmountList,
getSettleAccountsBusinessApplyAmountBuyerApplyAmountExportInvoice,
getSettleAccountsBusinessApplyAmountItemApplyAmountStatus } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl, Link } from 'umi';
import { fetchOptions } from '../../common';
import { downFileByBuffer } from '@/utils/index';
import moment from 'moment'
const intl = getIntl();
......@@ -29,7 +32,11 @@ const formActions = createFormActions();
const Search: React.FC = () => {
const ref = useRef<any>({})
const [rowSelection, rowCtl] = useRowSelectionTable();
const [rowSelection, rowCtl] = useRowSelectionTable({
extendsSelection: {
getCheckboxProps: (record) => ({ disabled: record.status !== 99})
}
});
const loadingTableData = async (params) => {
const _params = { ...params };
......@@ -111,30 +118,15 @@ const Search: React.FC = () => {
const exportFunc = ()=> {
console.log(rowCtl.selectedRowKeys);
// 02todo打印请款单
// 创建隐藏的可下载链接
// var eleLink = document.createElement('a');
// eleLink.download = 'filename';
// eleLink.style.display = 'none';
// // 字符内容转变成blob地址
// var blob = new Blob([JSON.stringify(res)]);
// eleLink.href = URL.createObjectURL(blob);
// // 触发点击
// document.body.appendChild(eleLink);
// eleLink.click();
// // 然后移除
// document.body.removeChild(eleLink);
// postSettleAccountsMemberSettlementAccountStatementCoordinationExport({ids: selectedRowKeys}, { responseType: 'blob', getResponse: true }).then((res: any) => {
// const { data, response } = res
// if (response.status == 200) {
// const suffixName = response.headers.get('content-disposition').split('.')[1]
// const fileName = `${moment().format('YYYYMMDD')}发票.${suffixName}`
// downFileByBuffer(data, fileName)
// ref.current.reloadCurrent()
// setSelectedRowKeys([])
// setSelectRow([])
// }
// })
getSettleAccountsBusinessApplyAmountBuyerApplyAmountExportInvoice({ids: rowCtl.selectedRowKeys.join(',')}, { responseType: 'blob', getResponse: true }).then((res: any) => {
const { data, response } = res
if (response.status == 200) {
// const suffixName = response.headers.get('content-disposition').split('.')[1]
const fileName = `${moment().format('YYYYMMDD')}请款单.xls`
downFileByBuffer(data, fileName)
ref.current.reloadCurrent()
}
})
}
return (
<PageHeaderWrapper>
......
......@@ -310,7 +310,7 @@ const InvoiceJoint: React.FC = () => {
const controllerBtns = (
<Space>
<AuthButton btnCode='invoice.srm.export'>
<Button disabled={!selectRow.selectedRowKeys.length} onClick={handleExport}>{intl.formatMessage({ id: 'balance.batch.export.btn' })}</Button>
<Button disabled={!selectRow.selectedRowKeys.length} onClick={handleExport}>导出EXCEL</Button>
</AuthButton>
</Space>
)
......
......@@ -88,7 +88,7 @@ const RequestBill: React.FC<RequestBillProps> = () => {
cehuiActions.submit().then(async ({ values }: any) => {
const result = await postPurchaseRequisitionRevokeProcess({ ...values, id: curentId });
if (result.code === 1000) {
pauseRef.current.setVisible(false);
cehuiRef.current.setVisible(false);
setTimeout(() => {
ref.current.reloadCurrent();
}, 800);
......
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