Commit f9a29d58 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents ebe93517 1842bf1d
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { Form, Button, Row, Col, Input, Table, message } from 'antd';
import { Form, Button, Row, Col, Input, InputNumber, Table, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { CheckCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { getIntl, history, Prompt } from 'umi';
......@@ -155,7 +155,7 @@ const Add = () => {
let _dataSource = [...tabelSource];
const _i = _dataSource.findIndex((item) => item.productId === record.productId);
let _item = { ..._dataSource[_i] };
_item.currentReconciliationQuantity = _val;
_item.currentReconciliationQuantity = Number(_val);
_item.currentMoney = _val * Number(record.price);
_dataSource[_i] = _item;
setTabelSource(_dataSource);
......@@ -251,10 +251,15 @@ const Add = () => {
name={`currentReconciliationQuantity_${record.orderNo}_${record.productId}`}
style={{ margin: 0 }}
rules={[
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) }
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) },
{
validator: (_, value) => {
return value > record.reconciliationQuantity ? Promise.reject(new Error('不能大于待对账数量')) : Promise.resolve()
}
},
]}
>
<Input type='number' max={record.reconciliationQuantity} value={record.currentReconciliationQuantity} onChange={(e) => { _changeNumbers(record, e.target.value) }} addonBefore="¥" />
<Input type='number' max={record.reconciliationQuantity} value={record.currentReconciliationQuantity} onChange={(e) => { _changeNumbers(record, e.target.value) }} />
</Form.Item>
) : text
)
......
......@@ -243,12 +243,15 @@ const SearchDetail = () => {
case 'readyConfirm':
return <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => { setModalVisible(true) }}>确认对账单</Button>
case 'readyPay':
<Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })}>
<Button type='primary' icon={<CheckCircleOutlined />}>
{intl.formatMessage({ id: 'balance.tijiao' })}
</Button>
</Popconfirm>
break;
return (
<Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })}>
<Button type='primary' icon={<CheckCircleOutlined />}>
{intl.formatMessage({ id: 'balance.tijiao' })}
</Button>
</Popconfirm>
)
default:
return null
}
}
......
......@@ -78,7 +78,7 @@ const ReadyPay: React.FC = () => {
title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => <Link to={`readyPay/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.qingkuan' })}</Link>
render: (text: any, record: any) => <Link to={`readyPay/detail?id=${record.reconciliationId}&no=${record.reconciliationNo}`}>{intl.formatMessage({ id: 'balance.qingkuan' })}</Link>
}];
return (
......
import React, { useRef, useState } from 'react'
import { Card, Typography, Space, Button } from 'antd'
import { PlusOutlined } from '@ant-design/icons';
import { Card, Typography, Space, Button, Popconfirm, Dropdown, Menu } from 'antd'
import { PlusOutlined, CaretDownOutlined } from '@ant-design/icons';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -12,12 +12,12 @@ import StatusTag from '@/components/StatusTag';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getSettleAccountsBusinessApplyAmountToAddApplyAmountList } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi';
import { history, getIntl, Link } from 'umi';
const intl = getIntl();
const { Link, Text } = Typography;
const { Text } = Typography;
// 请款单查询
......@@ -25,65 +25,116 @@ const formActions = createFormActions();
const Admin: React.FC = () => {
const ref = useRef<any>({})
// const loadingTableData = (params) => {
// const { data } = await getPurchaseRequisitionPage(params)
// return data
// }
const loadingTableData = async (params) => {
const _params = { ...params };
if (params.createTimeStart) {
_params.createTimeStart = formatTimeString(Number(params.createTimeStart), 'YYYY-MM-DD');
}
if (params.createTimeEnd) {
_params.createTimeEnd = formatTimeString(Number(params.createTimeEnd), 'YYYY-MM-DD');
}
const { data } = await getSettleAccountsBusinessApplyAmountToAddApplyAmountList(_params)
return data
}
const columns: ColumnType<any>[] = [{
title: intl.formatMessage({id: 'balance.qingkuandanhao'}),
key: 'orderNo',
dataIndex: 'orderNo',
title: intl.formatMessage({ id: 'balance.qingkuandanhao' }),
key: 'applyNo',
dataIndex: 'applyNo',
render: (text: any, record: any) => (
<Link>{text}</Link>
<Link to={`search/preview?id=${record.id}&no=${text}`}>{text}</Link>
)
}, {
title: intl.formatMessage({id: 'balance.danjuzhaiyao'}),
key: 'details',
dataIndex: 'details',
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
key: 'applyAbstract',
dataIndex: 'applyAbstract',
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<Text type='secondary'>{text}</Text>
</Space>
)
}, {
title: intl.formatMessage({id: 'balance.qingkuanleixing'}),
key: 'type',
dataIndex: 'type',
title: intl.formatMessage({ id: 'balance.qingkuanleixing' }),
key: 'applyType',
dataIndex: 'applyType',
}, {
title: intl.formatMessage({id: 'balance.qingkuanfang'}),
title: intl.formatMessage({ id: 'balance.qingkuanfang' }),
key: 'payee',
dataIndex: 'payee',
}, {
title: intl.formatMessage({id: 'balance.qingkuanjine'}),
key: 'total',
dataIndex: 'total',
title: intl.formatMessage({ id: 'balance.qingkuanjine' }),
key: 'applyAmount',
dataIndex: 'applyAmount',
render: (text: any, record: any) => ${priceFormat(text)}`,
width: 180
}, {
title: intl.formatMessage({id: 'balance.yujifukuanriqi'}),
key: 'payTime',
dataIndex: 'payTime',
title: intl.formatMessage({ id: 'balance.yujifukuanriqi' }),
key: 'expectPayTime',
dataIndex: 'expectPayTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: intl.formatMessage({id: 'balance.danjushijian'}),
title: intl.formatMessage({ id: 'balance.danjushijian' }),
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: intl.formatMessage({id: 'balance.waibuzhuangtai'}),
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type='default' title={record.externalStateName} />
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='default' title={text} />
},
{
title: intl.formatMessage({ id: 'balance.caozuo' }),
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <>
{record.status === 1 && <Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchSubmitBatch(record.reconciliationId)}>
<Button type='link'>
{intl.formatMessage({ id: 'balance.tijiao' })}
</Button>
</Popconfirm>}
<Dropdown overlay={() => (
<Menu onClick={(e) => handleMenuClick(e, record)}>
<Menu.Item key="1">{intl.formatMessage({ id: 'balance.bianji' })}</Menu.Item>
<Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchDelete(record.reconciliationId)}>
<Menu.Item key="2">{intl.formatMessage({ id: 'balance.shanchu' })}</Menu.Item>
</Popconfirm>
</Menu>
)}>
<Button type='link'>{intl.formatMessage({ id: 'balance.gengduo' })}<CaretDownOutlined /></Button>
</Dropdown>
</>
}];
const fetchSubmitBatch = (id: number) => {
// postSettleAccountsBusinessReconciliationSubmitReconciliation({ id }).then((res) => {
// if (res.code === 1000) {
// ref.current.reload();
// }
// })
}
const fetchDelete = (id: number) => {
// postSettleAccountsBusinessReconciliationDeleteReconciliation({ id }).then((res) => {
// if (res.code === 1000) {
// ref.current.reload();
// }
// })
}
const handleMenuClick = (e: any, record: any) => {
if (e.key === '1') {
history.push(`/memberCenter/balance/businessReconciliation/readyAdd/edit?id=${record.reconciliationId}&no=${record.reconciliationNo}`)
}
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
// fetchTableData={params => loadingTableData(params)}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
......@@ -95,7 +146,7 @@ const Admin: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
'applyNo',
FORM_FILTER_PATH,
)
}}
......@@ -113,11 +164,11 @@ const Admin: React.FC = () => {
type: "object",
"x-component": "controllerBtns",
},
orderNo: {
applyNo: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruqingkuandanhao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanhao' }),
align: 'flex-end',
},
},
......@@ -136,36 +187,36 @@ const Admin: React.FC = () => {
},
},
properties: {
"digest": {
"applyAbstract": {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruqingkuandanzhaiyao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanzhaiyao' }),
}
},
"memberName": {
"payee": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.qingshurufukuanfang'})
placeholder: intl.formatMessage({ id: 'balance.qingshurufukuanfang' })
}
},
"[startDate,endDate]": {
"[createTimeStart,createTimeEnd]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.danjushijianquanbu'}),
placeholder: intl.formatMessage({ id: 'balance.danjushijianquanbu' }),
}
},
"[startPayDate,endPayDate]": {
"[expectPayTimeStart,expectPayTimeEnd]": {
type: 'string',
"x-component": "daterange",
"x-component-props": {
placeholder: [intl.formatMessage({id: 'balance.yujifukuankaishishijian'}), intl.formatMessage({id: 'balance.yujifukuanjieshushijian'})],
placeholder: [intl.formatMessage({ id: 'balance.yujifukuankaishishijian' }), intl.formatMessage({ id: 'balance.yujifukuanjieshushijian' })],
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({id: 'balance.chaxun'}),
children: intl.formatMessage({ id: 'balance.chaxun' }),
},
},
},
......
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
// import { getSettleAccountsBusinessReconciliationToReconciliationList } from '@/services/SettleV2Api'
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { getIntl } from 'umi';
interface MemberDrawerProps {
visible: boolean,
onClose?: () => void,
}
const intl = getIntl();
const formActions = createFormActions();
const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) => {
const { visible, onClose } = props;
const ref = useRef<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
return data;
}
const columns: ColumnType<any>[] = [{
title: '会员Id',
key: 'memberId',
dataIndex: 'memberId',
}, {
title: '会员名称',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '会员类型',
key: 'memberType',
dataIndex: 'memberType',
}, {
title: '会员角色',
key: 'memberRole',
dataIndex: 'memberRole',
}, {
title: '会员等级',
key: 'memberLevel',
dataIndex: 'memberLevel',
}];
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
setSelectedRowKeys([record.id]);
};
return (
<Drawer
title={'选择会员'}
placement={'right'}
onClose={onClose}
visible={visible}
key={'right'}
width={'50%'}
footer={
<div style={{ textAlign: 'right' }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={onClose} type="primary">
{'确定'}
</Button>
</div>
}
>
<StandardTable
keepAlive={false}
// fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
rowSelection={{
type: 'radio',
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
}}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
schema={{
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
memberName: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入会员名称',
align: 'flex-start',
},
},
}
}
}
}}
components={{
Submit,
}}
/>
}
/>
</Drawer>
);
}
export default MemberDrawer;
......@@ -5,18 +5,21 @@ import StandardTable from '@/components/StandardTable';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import Submit from '@/components/NiceForm/components/Submit'
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 { getSettleAccountsBusinessApplyAmountBuyerApplyAmountList, getSettleAccountsBusinessApplyAmountItemApplyAmountStatus } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi';
import { getIntl, Link } from 'umi';
import { fetchOptions } from '../../common';
const intl = getIntl();
const { Link, Text } = Typography;
const { Text } = Typography;
// 请款单查询
......@@ -24,65 +27,72 @@ const formActions = createFormActions();
const Search: React.FC = () => {
const ref = useRef<any>({})
// const loadingTableData = (params) => {
// const { data } = await getPurchaseRequisitionPage(params)
// return data
// }
const loadingTableData = async (params) => {
const _params = { ...params };
if (params.createTimeStart) {
_params.createTimeStart = formatTimeString(Number(params.createTimeStart), 'YYYY-MM-DD');
}
if (params.createTimeEnd) {
_params.createTimeEnd = formatTimeString(Number(params.createTimeEnd), 'YYYY-MM-DD');
}
const { data } = await getSettleAccountsBusinessApplyAmountBuyerApplyAmountList(_params)
return data
}
const columns: ColumnType<any>[] = [{
title: intl.formatMessage({id: 'balance.qingkuandanhao'}),
key: 'orderNo',
dataIndex: 'orderNo',
title: intl.formatMessage({ id: 'balance.qingkuandanhao' }),
key: 'applyNo',
dataIndex: 'applyNo',
render: (text: any, record: any) => (
<Link>{text}</Link>
<Link to={`search/preivew?id=${record.id}&no=${text}`}>{text}</Link>
)
}, {
title: intl.formatMessage({id: 'balance.danjuzhaiyao'}),
key: 'details',
dataIndex: 'details',
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
key: 'applyAbstract',
dataIndex: 'applyAbstract',
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<Text type='secondary'>{text}</Text>
</Space>
)
}, {
title: intl.formatMessage({id: 'balance.qingkuanleixing'}),
key: 'type',
dataIndex: 'type',
title: intl.formatMessage({ id: 'balance.qingkuanleixing' }),
key: 'applyType',
dataIndex: 'applyType',
}, {
title: intl.formatMessage({id: 'balance.qingkuanfang'}),
title: intl.formatMessage({ id: 'balance.qingkuanfang' }),
key: 'payee',
dataIndex: 'payee',
}, {
title: intl.formatMessage({id: 'balance.qingkuanjine'}),
key: 'total',
dataIndex: 'total',
title: intl.formatMessage({ id: 'balance.qingkuanjine' }),
key: 'applyAmount',
dataIndex: 'applyAmount',
render: (text: any, record: any) => ${priceFormat(text)}`,
width: 180
}, {
title: intl.formatMessage({id: 'balance.yujifukuanriqi'}),
key: 'payTime',
dataIndex: 'payTime',
title: intl.formatMessage({ id: 'balance.yujifukuanriqi' }),
key: 'expectPayTime',
dataIndex: 'expectPayTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: intl.formatMessage({id: 'balance.danjushijian'}),
title: intl.formatMessage({ id: 'balance.danjushijian' }),
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: intl.formatMessage({id: 'balance.waibuzhuangtai'}),
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type='default' title={record.externalStateName} />
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='default' title={record.status} />
}];
return (
<PageHeaderWrapper>
<Card>
<StandardTable
// fetchTableData={params => loadingTableData(params)}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="id"
......@@ -94,9 +104,13 @@ const Search: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
'applyNo',
FORM_FILTER_PATH,
)
useAsyncSelect(
'status',
fetchOptions(getSettleAccountsBusinessApplyAmountItemApplyAmountStatus),
);
}}
schema={{
type: 'object',
......@@ -108,12 +122,13 @@ const Search: React.FC = () => {
grid: true
},
properties: {
orderNo: {
applyNo: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruqingkuandanhao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanhao' }),
align: 'flex-start',
allowClear: true,
},
},
}
......@@ -131,42 +146,41 @@ const Search: React.FC = () => {
},
},
properties: {
"digest": {
"applyAbstract": {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruqingkuandanzhaiyao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruqingkuandanzhaiyao' }),
allowClear: true,
}
},
"innerStatus": {
"status": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.qingxuanzezhuangtai'})
placeholder: intl.formatMessage({ id: 'balance.qingxuanzezhuangtai' }),
allowClear: true,
},
enum: [
{ label: intl.formatMessage({id: 'balance.suoyou'}), value: '' },
{ label: intl.formatMessage({id: 'balance.daitijiao'}), value: 1 },
{ label: intl.formatMessage({id: 'balance.yitijiao'}), value: 2 },
{ label: intl.formatMessage({id: 'balance.yifukuan'}), value: 3 },
]
enum: []
},
"[startDate,endDate]": {
"[createTimeStart,createTimeEnd]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.danjushijianquanbu'}),
placeholder: intl.formatMessage({ id: 'balance.danjushijianquanbu' }),
allowClear: true,
}
},
"[startPayDate,endPayDate]": {
"[expectPayTimeStart,expectPayTimeEnd]": {
type: 'string',
"x-component": "daterange",
"x-component-props": {
placeholder: [intl.formatMessage({id: 'balance.yujifukuankaishishijian'}), intl.formatMessage({id: 'balance.yujifukuanjieshushijian'})],
placeholder: [intl.formatMessage({ id: 'balance.yujifukuankaishishijian' }), intl.formatMessage({ id: 'balance.yujifukuanjieshushijian' })],
allowClear: true,
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({id: 'balance.chaxun'}),
children: intl.formatMessage({ id: 'balance.chaxun' }),
},
},
},
......
......@@ -242,7 +242,7 @@ function useGetLayout() {
const props = _row.key === 'top' ? {
imageUrl: currentProps.imageUrl
} : {
visible: currentProps.visible || true,
visible: currentProps.visible ?? true,
theme: currentProps.theme || 0,
title: currentProps.title,
};
......
......@@ -91,9 +91,11 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
title: `${intl.formatMessage({ id: 'activePage.Activityprice' })}`,
dataIndex: 'activityPrice',
render: (_text, _record) => {
// const activityId = _record.activityId;
// const target = _record.activityList.find((_item: any) => _item.id === activityId)
return (
<div className={styles.priceInfo}>
<span>{_record.activityPrice}</span>
<span>{_record.activityPrice || _record?.plummetPrice || _record.deductionPrice || 0}</span>
<span className={styles.unit}>({_record.unit})</span>
</div>
);
......
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