Commit 7f749d46 authored by Bill's avatar Bill

对接平台结算管理- 平台代收账款结算

parent 205ebda2
......@@ -136,8 +136,8 @@ const SettlementList = () => {
// /settle/accounts/member/settlement/pageReceiptInvoice
const searchParams = {
...params,
invoiceStatus: typeof params.orderType == 'undefined' ? 2 : params.orderType ,
payStatus: typeof params.status == 'undefined' ? 2 : params.status,
invoiceStatus: typeof params.invoiceStatus == 'undefined' ? 2 : params.invoiceStatus ,
payStatus: typeof params.payStatus == 'undefined' ? 2 : params.payStatus,
}
const { data } = await PublicApi.getSettleAccountsMemberSettlementPageReceiptInvoice(searchParams);
return data
......
......@@ -47,7 +47,8 @@ const columns = [
const InvoiceDrawer: React.FC<Iprops> = (props) => {
const { visible, title, onCancel, width, type, id } = props;
const [invoiceInfo, setInvoiceInfo] = useState<InvoiceInfoProps>(null)
const [invoiceInfo, setInvoiceInfo] = useState<InvoiceInfoProps>(null);
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const handleSubmit = () => {
if(type == 0) {
formActions.submit()
......@@ -69,11 +70,13 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
type: typeName == '企业' ? 1 : 2,
receiptInvoiceId: parseInt(id)
}
setSubmitLoading(true)
console.log(postData);
// /settle/accounts/member/settlement/invoiceProve
PublicApi.postSettleAccountsMemberSettlementInvoiceProve(postData)
.then((data) => {
if(data.code === 1000) {
setSubmitLoading(false)
props.refresh();
onCancel();
}
......
......@@ -90,7 +90,6 @@ const ConfirmCollected = (props) => {
const WrapVoucher = ({ id, type}) => {
const [files, setFiles] = useState([]);
console.log(id);
useEffect(() => {
if(id) {
const service = type == 1
......
......@@ -117,7 +117,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
<Voucher files={fileList} />
<div className={styles.upload}>
<Upload {...uploadProps}>
<Button icon={<UploadOutlined />}>上传凭证</Button>
<Button icon={<UploadOutlined />} loading={loading}>上传凭证</Button>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p>
</Upload>
</div>
......
......@@ -17,27 +17,31 @@ import { schema } from './schema';
import StatusTag from '../../components/StatusTag';
import StatusActions from '../../components/StatusActions';
import { payStatus } from '../../common';
import { PublicApi } from '@/services/api'
const formActions = createFormActions();
const AccountReceivable = () => {
const ref = useRef<any>({})
const fetchListData = async (params) => {
return {
data: [{id: 1}],
totalCount: 1
const searchData = {
status: 0,
...params
}
///settle/accounts/platform/settlement/pageReceivableSettlement
const { data } = await PublicApi.getSettleAccountsPlatformSettlementPageReceivableSettlement(searchData);
return data
}
const columns = [
{title: '结算单号', dataIndex: 'num'},
{title: '结算日期', dataIndex: 'num'},
{title: '结算方式', dataIndex: 'num'},
{title: '总单数', dataIndex: 'num'},
{title: '代收金额', dataIndex: 'num'},
{title: '佣金', dataIndex: 'num'},
{title: '结算金额', dataIndex: 'num'},
{title: '结算日期', dataIndex: 'num'},
{title: '支付方式', dataIndex: 'payMethod'},
{title: '结算单号', dataIndex: 'settlementNo'},
{title: '结算日期', dataIndex: 'settlementDate'},
{title: '结算方式', dataIndex: 'settlementWayName'},
{title: '总单数', dataIndex: 'totalCount'},
{title: '代收金额', dataIndex: 'collectAmount'},
{title: '佣金', dataIndex: 'brokerage'},
{title: '结算金额', dataIndex: 'amount'},
{title: '结算时间', dataIndex: 'settlementTime'},
{title: '支付方式', dataIndex: 'payWayName'},
{
title: '结算状态', dataIndex: 'status',
filters: payStatus,
......@@ -58,7 +62,7 @@ const AccountReceivable = () => {
type={2}
status={record.status}
settlementDate={record.settlementDate}
payName={record.payName}
payName={"平台"}
handleReconciledComfirm={handleConfirm}
handleComfirmInCompletePayment={handleComfirmInCompletePayment}
handleComfirmCompletePayment={handleComfirmCompletePayment}
......@@ -68,22 +72,58 @@ const AccountReceivable = () => {
}
]
/**
/**
* 确认对账
* @param cancel 关闭回调函数
* @param {cancel: function, id: number} cancel 为关闭回调函数
*/
const handleConfirm = (params: any) => {
console.log(123)
params.onCancel();
///settle/accounts/platform/settlement/confirmAccountComplete
PublicApi.postSettleAccountsMemberSettlementConfirmAccountComplete({settlementId: params.id})
.then((data) => {
if(data.code === 1000) {
params.onCancel();
formActions.submit();
}
})
}
/**
* 确认未到款
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmInCompletePayment = (params: any) => {
console.log(params);
params.onCancel()
PublicApi.postSettleAccountsMemberSettlementConfirmPayProve({id: params.id, status: params.status})
.then((data) => {
if(data.code === 1000) {
formActions.submit();
params.onCancel();
}
})
}
/**
* 确认到款
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmCompletePayment = (params: any) => {
params.onCancel();
PublicApi.postSettleAccountsMemberSettlementConfirmPayProve({id: params.id, status: params.status})
.then((data) => {
if(data.code === 1000) {
formActions.submit();
params.onCancel();
}
})
}
/**
* 搜索
*/
const handleSearch = (values: any) => {
const format = 'YYYY-MM-DD'
const startTime = values.startTime?.format(format);
const endTime = values.endTime?.format(format);
ref.current.reload({...values, startTime, endTime});
}
return (
......@@ -103,14 +143,14 @@ const AccountReceivable = () => {
expressionScope={{}}
components={{DatePicker}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'megaLayout.name', FORM_FILTER_PATH);
useStateFilterSearchLinkageEffect($, actions, 'megaLayout.settlementName', FORM_FILTER_PATH);
// useAsyncInitSelect(
// ['innerStatus', 'outerStatus'],
// fetchSelectOptions,
// );
}}
schema={schema}
onSubmit={values => ref.current.reload(values)}
onSubmit={handleSearch}
/>
}
/>
......
......@@ -12,13 +12,13 @@ export const schema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
settlementName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索结算单号',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
tip: '输入 结算单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -47,21 +47,28 @@ export const schema: ISchema = {
},
status: {
type: 'string',
enum: [],
enum: [
{label: '结算状态(全部)', value: 0},
{label: '待对账', value: 1},
{label: '待付款', value: 2},
{label: '待收款', value: 3},
{label: '待完成', value: 4},
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
},
},
// submit: {
// 'x-component': 'Submit',
// 'x-mega-props': {
// span: 1,
// },
// 'x-component-props': {
// children: '查询',
// },
// },
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
......
......@@ -7,7 +7,7 @@
import React, { useEffect, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import NiceForm from '@/components/NiceForm';
import { Card, Button } from 'antd';
import { Card, Button, message } from 'antd';
import { createFormActions } from '@formily/antd';
import { PlusOutlined } from '@ant-design/icons'
import ModalTable from '@/components/ModalTable';
......@@ -175,20 +175,26 @@ const MemberSettleAdd: React.FC = () => {
useEffect(() => {
if(id) {
async function getInfo() {
const { data } = await getSettleAccountsPlatformConfigGetMemberSettlementStrategyDetail({id})
setInitialValue({
name: data.name,
settlementOrderType: data.settlementOrderType.toString(),
memberList: data.memberList,
settlementWay: {
active: data.settlementWay,
otherValues: [data.settlementDays, data.settlementDate],
}
})
formActions.setFieldValue('Tabs.memberTab.someLists', data.memberList);
// 必须设置key
memberRowCtl.setSelectRow(data.memberList);
memberRowCtl.setSelectedRowKeys(data.memberList.map((item) => item.memberId))
const res = await getSettleAccountsPlatformConfigGetMemberSettlementStrategyDetail({id})
if(res.code === 1000) {
setInitialValue({
name: res.data.name,
settlementOrderType: res.data.settlementOrderType.toString(),
memberList: res.data.memberList,
settlementWay: {
active: res.data.settlementWay,
otherValues: [res.data.settlementDays, res.data.settlementDate],
}
})
formActions.setFieldValue('Tabs.memberTab.someLists', res.data.memberList);
// 必须设置key
memberRowCtl.setSelectRow(res.data.memberList);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId))
} else {
message.error({content: res.message})
}
}
getInfo();
}
......@@ -197,7 +203,7 @@ const MemberSettleAdd: React.FC = () => {
return (
<PageHeaderWrapper
extra={[
<Button key="1" type="primary" onClick={handleClick} >
<Button loading={submitLoading} key="1" type="primary" onClick={handleClick} >
保存
</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