Commit e2f6196d authored by Bill's avatar Bill

fix: 修改结算筛选文字描述错误问题

parent efe491c4
......@@ -200,7 +200,6 @@
"suggestProduct":{
"sort":23,
"props": {
"theme":0,
"visible":true,
"childrenData":[
{
......
/* eslint-disable react/display-name */
/*
* @Author: Bill
* @Date: 2020-10-20 11:04:07
......@@ -5,25 +6,25 @@
*/
import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Button, Modal, DatePicker, Tag, Space } from 'antd';
import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema, createFormActions } from '@formily/antd';
import { StandardTable } from 'god';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { schema } from './schema';
import StatusTag from '../components/StatusTag';
import { PublicApi } from '@/services/api'
import { Moment } from 'moment';
import { ColumnsType } from 'antd/es/table';
import EyePreview from '@/components/EyePreview';
import { schema } from './schema';
import StatusTag from '../components/StatusTag';
import useFetchColumns from '../hooks/useFetchColumns';
import Voucher from '../components/Voucher';
import UploadVoucherModal from '../components/UploadVoucherModal';
import { priceFormat } from '@/utils/numberFomat'
import useIsExistsBrokerage from '../hooks/useIsExistsBrokerage';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import { priceFormat } from '@/utils/numberFomat';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import NiceForm from '@/components/NiceForm';
interface SearchParams {
settlementName?: string,
......@@ -50,19 +51,19 @@ const SettlementList = () => {
balanceInfo,
payVoucherInfo
} = useFetchColumns();
const { hasBrokerage, filterColumns } = useIsExistsBrokerage()
const { hasBrokerage, filterColumns } = useIsExistsBrokerage();
const [files, setFiles] = useState<any>([]);
// const [hasBrokerage, setHasBrokerage] = useState(true);
const ref = useRef<any>({})
const ref = useRef<any>({});
const fetchListData = async (params) => {
const searchData = {
...params,
status: typeof params.status == 'undefined' ? 0 : params.status,
}
const res = await PublicApi.getSettleAccountsPlatformSettlementPagePayableSettlement(searchData)
};
const res = await PublicApi.getSettleAccountsPlatformSettlementPagePayableSettlement(searchData);
return res.data;
}
};
const columns: ColumnsType<any> = [
{
......@@ -74,7 +75,7 @@ const SettlementList = () => {
<EyePreview url={url}>
{text}
</EyePreview>
)
);
}
},
{ title: '结算日期', dataIndex: 'settlementDate' },
......@@ -104,51 +105,51 @@ const SettlementList = () => {
{ text: '待对账', value: 1 },
{ text: '待付款', value: 2 },
{ text: '待收款', value: 3 },
{ text: '完成', value: 4 },
{ text: '完成', value: 4 },
],
onFilter: (value, record: any) => record.status == value,
render: (text, record: any) => {
return (
<StatusTag status={record.status} />
)
);
}
},
{
title: '操作',
render: (text, record: any) => {
if (record.status === 1) {
return <a onClick={() => handleManualsettlement(record.id)}>手动结算</a>
return <a onClick={() => handleManualsettlement(record.id)}>手动结算</a>;
}
if (record.status === 2) {
return <a onClick={() => handlePay({id: record.id, settlementId: record.memberId, roleId: record.roleId})}>付款</a>
return <a onClick={() => handlePay({id: record.id, settlementId: record.memberId, roleId: record.roleId})}>付款</a>;
}
return <a onClick={() => handleViewPayModal({id: record.id})}>查看付款凭证</a>
return <a onClick={() => handleViewPayModal({id: record.id})}>查看付款凭证</a>;
}
}
]
];
/**
*
* @param params 手动结算
*/
const handleManualsettlement = async (id: number) => {
const { data, code } = await PublicApi.postReportSettlementPlatformManualSettlement({id: id})
const { data, code } = await PublicApi.postReportSettlementPlatformManualSettlement({id: id});
if(code === 1000) {
formActions.submit();
}
}
};
const fetchVouchers = useCallback(async (id: number) => {
const { code, data } = await PublicApi.getSettleAccountsPlatformSettlementGetPayablePayProve({id: id.toString()})
const { code, data } = await PublicApi.getSettleAccountsPlatformSettlementGetPayablePayProve({id: id.toString()});
if (code === 1000) {
setFiles(data);
}
}, [])
}, []);
useEffect(() => {
if (payVoucherInfo !== null) {
fetchVouchers(payVoucherInfo.id);
}
}, [payVoucherInfo])
}, [payVoucherInfo]);
/**
* 上传凭证
......@@ -159,20 +160,20 @@ const SettlementList = () => {
.then((data) => {
if(data.code === 1000) {
formActions.submit();
params.onCancel()
params.onCancel();
}
})
}
});
};
/**
* 搜索
*/
const handleSearch = (values: SearchParams) => {
const format = 'YYYY-MM-DD'
const format = 'YYYY-MM-DD';
const startTime = values.startTime?.format(format);
const endTime = values.endTime ? values.endTime.endOf("day").format('YYYY-MM-DD HH:mm:ss') : "";
ref.current.reload({...values, startTime, endTime});
}
};
const frozenColumn = useMemo(() => filterColumns(columns, ["brokerage"]), [filterColumns, columns]);
return (
<PageHeaderWrapper>
......@@ -218,8 +219,8 @@ const SettlementList = () => {
<Voucher files={files} />
</Modal>
</PageHeaderWrapper>
)
}
);
};
export default SettlementList
export default SettlementList;
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