Commit 63cee027 authored by Bill's avatar Bill

修改结算付款

parent ea57483e
......@@ -86,10 +86,14 @@ const SettlementList = () => {
{
title: '操作',
render: (text, record: any) => {
if(record.status === 1) {
return <Button type="link" onClick={() => handleManualsettlement(record.id)}>手动结算</Button>
}
return (
<StatusActions
status={record.status <= 2 ? record.status : 4 }
id={record.id}
roleId={record.roleId}
excludes={[1, 3]}
settlementId={record.memberId || 1}
handleUpload={handleUploadVoucher}
......@@ -100,6 +104,19 @@ const SettlementList = () => {
}
]
/**
*
* @param params 手动结算
*/
const handleManualsettlement = (id) => {
PublicApi.postReportSettlementPlatformManualSettlement({id: id})
.then(({data, code}) => {
if(code === 1000) {
formActions.submit();
}
})
}
/**
* 上传凭证
* @param params
......
/*
* @Author: your name
* @Date: 2020-10-23 17:24:23
* @Description: 结算能力列表操作
* @Description: 结算能力列表操作
*/
import React, { useState, useEffect } from 'react';
import ModalContainer from '../ModalContainer';
......@@ -18,9 +18,10 @@ interface Iprops {
id: number, // 应付,应收账款id
settlementDate?: string, // 结算日期
settlementId?: number, // 结算方id
roleId?: number, // 结算方角色id
payName?: string, //付款方
excludes: number[], // 排除数组,比如当应付的时候,只留下查看凭证跟付款, 应收账款的时候保留三个
type?: number, // 1 -> 应付账款结算 2-> 应收账款结算, 用于判断 查看付款凭证
type?: number, // 1 -> 应付账款结算 2-> 应收账款结算, 用于判断 查看付款凭证
handleReconciledComfirm?: (params: any) => void // 对账确定回调
handleComfirmInCompletePayment?: (params: any) => void, // 确认未到款回调
handleComfirmCompletePayment?: (params:any) => void, //确认到款回调
......@@ -54,10 +55,10 @@ const ConfirmAccountComponent: React.FC<Iprops> = (props) => {
({visible, show, cancel}) => {
return (
<>
<Modal
width={400}
title="确认对账完成"
visible={visible}
<Modal
width={400}
title="确认对账完成"
visible={visible}
onCancel={cancel}
onOk={() => onOk({onCancel: cancel, id: props.id})}
>
......@@ -80,16 +81,16 @@ const ConfirmCollected = (props) => {
({visible, show, cancel}) => {
return (
<>
<Modal width={548} title="确认付款凭证" onCancel={cancel} visible={visible}
<Modal width={548} title="确认付款凭证" onCancel={cancel} visible={visible}
footer={(
<Space>
<Button onClick={cancel}>取消</Button>
<Button
danger
<Button
danger
onClick={() => props.handleComfirmInCompletePayment({onCancel: cancel, status: 0, id: props.id})}
>确认未到款</Button>
<Button
type={"primary"}
<Button
type={"primary"}
onClick={() => props.handleComfirmCompletePayment({onCancel: cancel, status: 1, id: props.id})}
>确认到款</Button>
</Space>
......@@ -160,7 +161,8 @@ const ViewPaymentVoucher = (props) => {
interface UploadVocherProps {
settlementId: number,
id: number
id: number,
roleId: number,
handleUpload: (params: any) => void
}
......@@ -170,7 +172,7 @@ interface FileType {
}
// 待付款 状态 上传付款凭证
const UploadVoucher: React.FC<UploadVocherProps> = (props) => {
const { settlementId } = props;
const { settlementId, roleId } = props;
const [fileList, setFileList] = useState<FileType[]>([]);
const getFileList = (list: FileType[]) => {
......@@ -183,22 +185,22 @@ const UploadVoucher: React.FC<UploadVocherProps> = (props) => {
({visible, show, cancel}) => {
return (
<>
<Modal
width={548}
title="上传付款凭证"
onCancel={cancel}
visible={visible}
<Modal
width={548}
title="上传付款凭证"
onCancel={cancel}
visible={visible}
footer={(
<Space>
<Button onClick={cancel}>取消</Button>
<Button
type={"primary"}
<Button
type={"primary"}
onClick={() => props.handleUpload({onCancel: cancel, id: props.id, fileList: fileList})}
>确认</Button>
</Space>
)}
>
<UploadPayVoucher id={settlementId} getFileList={getFileList} />
<UploadPayVoucher id={settlementId} roleId={roleId} getFileList={getFileList} />
</Modal>
<div className={styles.modalBtn} onClick={show}>付款</div>
</>
......@@ -227,4 +229,4 @@ const StatusActions: React.FC<Iprops> = (props: Iprops) => {
)
}
export default StatusActions
\ No newline at end of file
export default StatusActions
......@@ -22,6 +22,7 @@ interface VoucherFileProps {
interface Iprops {
fileList?: VoucherFileProps[],
id: number, // 结算方id
roleId: number, // 结算方角色id
getFileList: (params: any[]) => void
}
......@@ -47,13 +48,17 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
useEffect(() => {
async function getAccountInfo() {
///settle/accounts/corporate/account/config
const { data, code } = await PublicApi.getSettleAccountsCorporateAccountConfig({memberId: props.id.toString()});
const { data, code } = await PublicApi.getSettleAccountsCorporateAccountConfig(
{
memberId: props.id.toString(),
memberRoleId: props.roleId.toString()
});
if(code == 1000) {
setAccountInfo(data);
}
}
getAccountInfo()
}, [props.id])
}, [props.id, props.roleId])
/***
* 上传前检查
......
......@@ -94,12 +94,16 @@ const SettlementList = () => {
{
title: '操作',
render: (text, record: any) => {
if(record.status === 1) {
return <Button type="link" onClick={() => handleManualsettlement(record.id)}>手动结算</Button>
}
return (
<StatusActions
status={record.status <= 2 ? record.status : 4 }
id={record.id}
excludes={[1, 3]}
settlementId={record.memberId || 1}
settlementId={record.memberId}
roleId={record.roleId}
handleUpload={handleUploadVoucher}
type={SCORE_PAYER}
/>
......@@ -109,6 +113,20 @@ const SettlementList = () => {
]
/**
*
* @param params 手动结算
*/
const handleManualsettlement = (id) => {
PublicApi.postReportSettlementScoreManualSettlement({id: id})
.then(({data, code}) => {
if(code === 1000) {
formActions.submit();
}
})
}
/**
* 上传凭证
* @param params
*/
......
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