Commit d0bcdcbb authored by Bill's avatar Bill

fix: 结算金额,首页bug

parent e2f39a8f
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { Dropdown, Space, Menu } from 'antd'
import { CaretDownOutlined, EnvironmentOutlined } from '@ant-design/icons'
......@@ -6,34 +6,16 @@ import "../styles/Location.less"
const Location: React.FC = () => {
const menuHeaderDropdown = (
<Menu selectedKeys={[]}>
<Menu.Item>
<Space>
<span>北京</span>
</Space>
</Menu.Item>
<Menu.Item>
<Space>
<span>上海</span>
</Space>
</Menu.Item>
<Menu.Item>
<Space>
<span>石河子</span>
</Space>
</Menu.Item>
</Menu>
);
useEffect(() => {
}, [])
return (
<Dropdown overlay={menuHeaderDropdown} placement='bottomRight' className="locationBox">
<Space style={{cursor: 'pointer'}} size={5}>
<EnvironmentOutlined />
<span>广州</span>
<CaretDownOutlined />
</Space>
</Dropdown>
<Space style={{cursor: 'pointer'}} size={5}>
<EnvironmentOutlined />
<span>广州</span>
{/* <CaretDownOutlined /> */}
</Space>
)
}
export default Location
\ No newline at end of file
export default Location
......@@ -41,6 +41,12 @@ const SelectLang: React.FC = () => {
</Menu>
);
// useEffect(() => {
// function getLang() {
// PublicApi.getLange
// }
// }, [])
const renderCurrentLang = () => {
let currentLang: countryItem
GlobalConfig.publicSelect.siteList.map(item => {
......@@ -65,4 +71,4 @@ const SelectLang: React.FC = () => {
)
}
export default SelectLang
\ No newline at end of file
export default SelectLang
......@@ -20,6 +20,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { logisticsColumn } from '../../common/columns';
import { priceFormat } from '@/utils/numberFomat';
const RangePicker = DatePicker.RangePicker
const formActions = createFormActions();
......@@ -101,7 +102,8 @@ const logisticsDetail: React.FC = () => {
>
<Descriptions.Item label="结算日期">{infoDetail?.settlementDate}</Descriptions.Item>
<Descriptions.Item label="结算单数">{infoDetail?.totalCount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{infoDetail?.amount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{priceFormat(infoDetail?.amount)}</Descriptions.Item>
<Descriptions.Item label="结算方">{infoDetail?.settlementName}</Descriptions.Item>
<Descriptions.Item label="结算方式">{infoDetail?.settlementWayName}</Descriptions.Item>
<Descriptions.Item label="外部状态"><StatusTag text={infoDetail?.statusName}></StatusTag></Descriptions.Item>
......
......@@ -20,6 +20,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag'
import { productNoticecolumns } from '../../common/columns';
import { priceFormat } from '@/utils/numberFomat';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
......@@ -101,7 +102,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
>
<Descriptions.Item label="结算日期">{infoDetail?.settlementDate}</Descriptions.Item>
<Descriptions.Item label="结算单数">{infoDetail?.totalCount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{infoDetail?.amount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{priceFormat(infoDetail?.amount)}</Descriptions.Item>
<Descriptions.Item label="结算方">{infoDetail?.settlementName}</Descriptions.Item>
<Descriptions.Item label="结算方式">{infoDetail?.settlementWayName}</Descriptions.Item>
<Descriptions.Item label="外部状态"><StatusTag text={infoDetail?.statusName}></StatusTag></Descriptions.Item>
......@@ -113,7 +114,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
rowKey: 'orderNo',
}}
columns={productNoticecolumns}
currentRef={ref}
......
......@@ -20,6 +20,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { logisticsColumn } from '../../common/columns';
import { priceFormat } from '@/utils/numberFomat';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
......@@ -99,7 +100,7 @@ const logisticsDetail: React.FC = () => {
>
<Descriptions.Item label="结算日期">{infoDetail?.settlementDate}</Descriptions.Item>
<Descriptions.Item label="结算单数">{infoDetail?.totalCount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{infoDetail?.amount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{priceFormat(infoDetail?.amount)}</Descriptions.Item>
<Descriptions.Item label="结算方">{infoDetail?.settlementName}</Descriptions.Item>
<Descriptions.Item label="结算方式">{infoDetail?.settlementWayName}</Descriptions.Item>
<Descriptions.Item label="外部状态"><StatusTag text={infoDetail?.statusName}></StatusTag></Descriptions.Item>
......@@ -111,7 +112,7 @@ const logisticsDetail: React.FC = () => {
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
rowKey: 'orderNo',
}}
columns={logisticsColumn}
currentRef={ref}
......
......@@ -20,6 +20,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import StatusTag from '../../components/StatusTag';
import { productNoticecolumns } from '../../common/columns';
import { priceFormat } from '@/utils/numberFomat';
const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
......@@ -103,7 +104,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
>
<Descriptions.Item label="结算日期">{infoDetail?.settlementDate}</Descriptions.Item>
<Descriptions.Item label="结算单数">{infoDetail?.totalCount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{infoDetail?.amount}</Descriptions.Item>
<Descriptions.Item label="结算金额">{priceFormat(infoDetail?.amount)}</Descriptions.Item>
<Descriptions.Item label="结算方">{infoDetail?.settlementName}</Descriptions.Item>
<Descriptions.Item label="结算方式">{infoDetail?.settlementWayName}</Descriptions.Item>
<Descriptions.Item label="外部状态"><StatusTag text={infoDetail?.statusName}></StatusTag></Descriptions.Item>
......
import { PublicApi } from '@/services/api';
import { useEffect, useState } from 'react';
const useIsExistBrokerage = (columns, blackListDataIndex: string[]) => {
const [retColumn, setRetColumn] = useState(columns);
const fetchIsExist = async () => {
const { data, code } = await PublicApi.getSettleAccountsPlatformSettlementIsExistsBrokerage();
if (code !== 1000) {
return
}
if (data) {
const newColumn = retColumn.filter((item) => !blackListDataIndex.includes(item.dataIndex))
setRetColumn(newColumn)
}
}
useEffect(() => {
fetchIsExist()
}, [])
return { retColumn };
}
export default useIsExistBrokerage
......@@ -20,6 +20,7 @@ import { payStatus } from '../../common';
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { fetchOptions } from '../../common';
import useIsExistBrokerage from '../../hooks/useIsExistsBrokerage';
const formActions = createFormActions();
const { RangePicker } = DatePicker;
......@@ -53,9 +54,9 @@ const AccountReceivable = () => {
{title: '结算日期', dataIndex: 'settlementDate'},
{title: '结算方式', dataIndex: 'settlementWayName'},
{title: '总单数', dataIndex: 'totalCount'},
{title: '代收金额', dataIndex: 'collectAmount'},
{title: '代收金额', dataIndex: 'collectAmount', render: (text) => `¥${text}`},
{title: '佣金', dataIndex: 'brokerage'},
{title: '结算金额', dataIndex: 'amount'},
{title: '结算金额', dataIndex: 'amount', render: (text) => `¥${text}`},
{title: '结算时间', dataIndex: 'settlementTime'},
{title: '支付方式', dataIndex: 'payWayName'},
{
......@@ -87,8 +88,7 @@ const AccountReceivable = () => {
}
}
]
const { retColumn } = useIsExistBrokerage(columns, ["brokerage"]);
/**
* 确认对账
* @param {cancel: function, id: number} cancel 为关闭回调函数
......@@ -150,7 +150,7 @@ const AccountReceivable = () => {
tableProps={{
rowKey: 'id',
}}
columns={columns}
columns={retColumn}
currentRef={ref}
// rowSelection={rowSelection}
fetchTableData={(params: any) => fetchListData(params)}
......
......@@ -20,6 +20,8 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import StatusTag from '../../components/StatusTag';
import { timeRange } from '@/utils/index';
import moment from 'moment';
import useIsExistsBrokerage from '../../hooks/useIsExistsBrokerage';
import { priceFormat } from '@/utils/numberFomat';
const formActions = createFormActions();
const columns = [
......@@ -28,8 +30,12 @@ const columns = [
{title: '单据类型', dataIndex: 'settlementOrderTypeName'},
{title: '单据时间', dataIndex: 'orderTime'},
{title: '订单类型', dataIndex: 'orderTypeName'},
{title: '单据总额', dataIndex: 'orderAmount'},
{title: '代收金额', dataIndex: 'collectAmount'},
{
title: '单据总额',
dataIndex: 'orderAmount',
render: (text) => `¥${text}`
},
{title: '代收金额', dataIndex: 'collectAmount', render: (text) => `¥${text}`},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '佣金比例',
......@@ -39,7 +45,7 @@ const columns = [
}
},
{title: '扣减佣金', dataIndex: 'brokerage'},
{title: '本期结余额', dataIndex: 'settlementAmount'}
{title: '本期结余额', dataIndex: 'settlementAmount', render: (text) => `¥${text}`}
]
......@@ -70,6 +76,8 @@ const Info: React.FC = () => {
}
}, [id])
const { retColumn } = useIsExistsBrokerage(columns, ["brokerage", "ratio"])
/**
* 搜索
*/
......@@ -114,7 +122,7 @@ const Info: React.FC = () => {
>
<Descriptions.Item label="结算日期:">{infoDetail?.settlementDate}</Descriptions.Item>
<Descriptions.Item label="结算单数:">{infoDetail?.totalCount }</Descriptions.Item>
<Descriptions.Item label="结算金额:">{infoDetail?.amount}</Descriptions.Item>
<Descriptions.Item label="结算金额:">{priceFormat(infoDetail?.amount)}</Descriptions.Item>
<Descriptions.Item label="结算方式:">{infoDetail?.settlementWayName}</Descriptions.Item>
<Descriptions.Item label="结算状态:">
<StatusTag text={infoDetail?.statusName} />
......@@ -129,7 +137,7 @@ const Info: React.FC = () => {
tableProps={{
rowKey: record => (`${record.orderNo}-${record.payTime}`),
}}
columns={columns}
columns={retColumn}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
......
......@@ -36,7 +36,7 @@ const columns = [
title: '兑换比率',
dataIndex: 'ratio',
render: (text, record) => {
return record.ratio * 100 + "%"
return record.ratio + "%"
}
},
{title: '本期结余额', dataIndex: 'settlementAmount'}
......
......@@ -444,12 +444,13 @@ const Detail: React.FC<{}> = () => {
{
info && info.outerTaskType !== 29
? <div style={{marginTop: '20px'}}>
<ReceiptDeliveryDetailsCard>
<StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === SourceEnum.order ? 'order' : 'product')} dataSource={info.details}></StatisticsTab>
<ReceiptDeliveryDetailsCard defaultActiveKey="1">
<StatisticsTab tabKey="1" tab="收发货统计" columns={receiveColumns(info.source === SourceEnum.order ? 'order' : 'product')} dataSource={info.details}></StatisticsTab>
{
info.pnoReceiveDeliverDetailDOList &&
info.pnoReceiveDeliverDetailDOList.length > 0
? <DetailTab
tabKey="2"
tab="收发货明细"
columns={receiptAndDeliveryDetailsColumns}
dataSource={info.pnoReceiveDeliverDetailDOList}
......
......@@ -10,6 +10,7 @@ interface Iprops {
tab: string,
columns: ColumnsType<any>,
dataSource: any[],
tabKey: string,
handleConfirm: (type: string, params: any) => void
}
......@@ -78,7 +79,6 @@ const DetailTab: React.FC<Iprops> = (props) => {
props.handleConfirm(type, params);
}
const sorted = dataSource && dataSource.sort((a, b) => a.deliveryBatch - b.deliveryBatch ) || []
return (
<div >
<div >
......@@ -163,11 +163,12 @@ const DetailTab: React.FC<Iprops> = (props) => {
</div>
<Table
dataSource={activeData.pnoReceiveDeliverDetailProductBOList}
rowKey={"orderNo"}
rowKey={(record) => record.produceNoticeOrderDetailId + "-" + record.productId}
columns={columns}
/>
</div>
)
}
export default DetailTab;
......@@ -3,29 +3,30 @@ import { Card, Tabs } from 'antd';
const TabPane = Tabs.TabPane
interface Iprops {};
interface Iprops {
defaultActiveKey: string
};
const ReceiptDeliveryDetailsCard: React.FC<Iprops> = (props) => {
const newChildren = React.Children.map(props.children, (child: any) => {
if(child && child.type) {
return (
<TabPane tab={child.props.tab}>
const newChildren = React.Children.map(props.children, (child: any, index) => {
if(child) {
return (
<TabPane tab={child.props.tab} key={child.props.tabKey.toString() || index.toString()}>
{child}
</TabPane>
)
} else {
return child
return null
}
})
console.log(props.defaultActiveKey)
return (
<Card bodyStyle={{padding: '10px 24px 24px 24px'}}>
<Tabs>
<Tabs defaultActiveKey={props.defaultActiveKey}>
{newChildren}
</Tabs>
</Card>
</Card>
)
}
export default ReceiptDeliveryDetailsCard
\ No newline at end of file
export default ReceiptDeliveryDetailsCard
......@@ -5,6 +5,7 @@ interface Iprops {
tab: string,
columns: ColumnsType<any>,
dataSource: any[],
tabKey: string,
}
const StatisticsTab: React.FC<Iprops> = (props) => {
......@@ -14,4 +15,4 @@ const StatisticsTab: React.FC<Iprops> = (props) => {
)
}
export default StatisticsTab
\ No newline at end of file
export default StatisticsTab
......@@ -203,7 +203,6 @@ const Query: React.FC<{}> = (props) => {
*/
const handleSearch = useCallback((values: any) => {
const {docTime, ...rest} = values;
console.log(docTime);
const {st, et} = timeRange(docTime);
let searchData = {
...rest,
......
......@@ -277,6 +277,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
const auth = getAuth();
localStorage.setItem("auth", JSON.stringify({
...auth,
company: rest.company_name,
validateMsg: null,
validateStatus: 1,
validateStatusDesc: "待审核"
......
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