Commit f8d9e151 authored by Bill's avatar Bill

fix: 修改结算付款bug

parent 00ddc67b
......@@ -6,7 +6,7 @@
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, DatePicker} from 'antd';
import { Button, Card, DatePicker} from 'antd';
import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { createFormActions } from '@formily/antd';
......@@ -90,12 +90,16 @@ const SettlementList = () => {
{
title: '操作',
render: (text: string, 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={PAYABLE_PAYER}
/>
......@@ -105,6 +109,19 @@ const SettlementList = () => {
]
/**
*
* @param params 手动结算
*/
const handleManualsettlement = (id) => {
PublicApi.postReportSettlementMemberManualSettlement({id: id})
.then(({data, code}) => {
if(code === 1000) {
formActions.submit();
}
})
}
/**
* 上传凭证
* @param params
*/
......
......@@ -108,6 +108,8 @@ const columns = [
<InvoiceCreate
id={record.id}
type={record.invoiceStatus}
payRoleId={record.payRoleId}
payMemberId={record.payMemberId}
title="开具发票"
width={800}
visible={visible}
......
......@@ -26,7 +26,9 @@ interface Iprops {
title: string,
width: number,
type: number, // 0 -> 开票, 1-> 查看
id: string, // 开票管理id,
id: string, // 开票管理id,
payRoleId: number,
payMemberId: number,
onCancel: () => void,
refresh: () => void
}
......@@ -46,7 +48,7 @@ const columns = [
]
const InvoiceDrawer: React.FC<Iprops> = (props) => {
const { visible, title, onCancel, width, type, id } = props;
const { visible, title, onCancel, width, type, id, payMemberId, payRoleId } = props;
const [invoiceInfo, setInvoiceInfo] = useState<InvoiceInfoProps>(null);
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const handleSubmit = () => {
......@@ -60,7 +62,7 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
}
const handleForm = (value: SubmitProps) => {
if(typeof value.list === 'undefined' || value.list.length == 0) {
message.error({
content: '请添加发票信息'
......@@ -68,7 +70,7 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
return;
}
const { kindName, typeName, ...rest } = invoiceInfo
const { kindName, typeName, ...rest } = invoiceInfo
const proveList = value.list.map((item) => { return {number: item.number, remark: item.remark, invoiceDate: item.invoiceDate.format('YYYY-MM-DD')} })
const postData = {
...rest,
......@@ -100,15 +102,15 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
}
})
}
}, [id, visible])
return (
<Drawer
visible={visible}
title={title}
width={width}
onClose={onCancel}
<Drawer
visible={visible}
title={title}
width={width}
onClose={onCancel}
footer={
<div
style={{
......@@ -133,7 +135,7 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
<div className={styles.invoiceNum}>发票号码</div>
<div className={styles.invoiceDate}>开票日期</div>
<div>备注</div>
</div>
</div>
<SchemaForm onSubmit={handleForm} actions={formActions} components={{ InvoiceArray, Input, DatePicker }}>
<Field
name="list"
......@@ -158,9 +160,9 @@ const InvoiceDrawer: React.FC<Iprops> = (props) => {
)
}
</Drawer>
)
}
export default InvoiceDrawer
\ No newline at end of file
export default InvoiceDrawer
/*
* @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, //确认到款回调
......@@ -49,10 +50,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={() => props.handleReconciledComfirm({onCancel: cancel, id: props.id})}
>
......@@ -75,16 +76,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>
......@@ -154,6 +155,7 @@ const ViewPaymentVoucher = (props) => {
interface UploadVocherProps {
settlementId: number,
id: number
roleId: number,
handleUpload: (params: any) => void
}
......@@ -163,7 +165,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[]) => {
......@@ -176,22 +178,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 roleId={roleId} id={settlementId} getFileList={getFileList} />
</Modal>
<div className={styles.modalBtn} onClick={show}>付款</div>
</>
......@@ -220,4 +222,4 @@ const StatusActions: React.FC<Iprops> = (props: Iprops) => {
)
}
export default StatusActions
\ No newline at end of file
export default StatusActions
......@@ -16,8 +16,9 @@ import { PublicApi } from '@/services/api';
interface Iprops {
fileList?: VoucherFileProps[],
id: number, // 结算方id
getFileList: (params: any[]) => void
id: number, // 结算方id
getFileList: (params: any[]) => void,
roleId: number
}
interface AccountInfo {
......@@ -42,11 +43,14 @@ 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])
......@@ -118,7 +122,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
<div className={styles.upload}>
<Upload {...uploadProps}>
<Button icon={<UploadOutlined />} loading={loading}>上传凭证</Button>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p>
</Upload>
</div>
......@@ -126,4 +130,4 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
)
}
export default UploadPayVoucher;
\ No newline at end of file
export default UploadPayVoucher;
import React, { useState, useEffect } from 'react';
import { Card, Col, Row, Select } from 'antd'
import { PublicApi } from '@/services/api';
import moment from 'moment';
const Option = Select.Option;
......@@ -37,7 +37,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
</Row>
<Row>
<Col span={6}>交期</Col>
<Col>{props.deliveryDate}</Col>
<Col>{props.deliveryDate && moment(props.deliveryDate).format('YYYY-MM-DD HH:mm:ss')}</Col>
</Row>
</Col>
<Col span={9} style={props.deliveryType == 1 ? {} : {display: 'none'}}>
......@@ -50,7 +50,7 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
</Row>
</Col>
{
props.editDeliverAddress
props.editDeliverAddress
? <Col span={9}>
<Row style={{marginBottom: '20px'}}>
<Col span={5}>{props.deliveryType == 2 ? '自提地址' : '发货地址' }</Col>
......@@ -80,10 +80,10 @@ const DeliveryInfomation: React.FC<Iprops> = (props) => {
</Row>
</Col>
}
</Row>
</Card>
)
}
export default DeliveryInfomation;
\ No newline at end of file
export default DeliveryInfomation;
import React, { useState, useEffect } from 'react';
import { Button, Drawer } from 'antd';
import Content from './content';
import { PublicApi } from '@/services/api'
import { createFormActions } from '@formily/antd'
const actions = createFormActions();
interface Iprops {
type: string, // veiw | edit,
......@@ -21,12 +18,13 @@ interface Iprops {
interface IfileProps {
name: string,
url: string
value: string
}
const DrawerProcessDetail: React.FC<Iprops> = (props) => {
const { id, brand, category, name, productProps, files, unitName, quantity, processUnitPrice} = props;
const [visible, setVisible] = useState<boolean>(false);
const filesList = files.map((item) => ({name: item.name, url: item.value}))
const onClose = () => {
setVisible(false)
......@@ -35,7 +33,7 @@ const DrawerProcessDetail: React.FC<Iprops> = (props) => {
const onOpen = () => {
setVisible(true)
}
return (
<>
<div onClick={onOpen}>
......@@ -62,22 +60,22 @@ const DrawerProcessDetail: React.FC<Iprops> = (props) => {
</div>
}
>
<Content
name={name}
id={id}
<Content
name={name}
id={id}
brand={brand}
category={category}
category={category}
unitName={unitName}
productProps={productProps}
quantity={quantity}
processUnitPrice={processUnitPrice}
type={"detail"}
files={files}
actions={actions}
quantity={parseFloat(quantity)}
processUnitPrice={parseFloat(processUnitPrice)}
type={"view"}
files={filesList}
// actions={actions}
/>
</Drawer>
</>
)
}
export default DrawerProcessDetail;
\ No newline at end of file
export default DrawerProcessDetail;
......@@ -63,10 +63,10 @@ interface Iprops {
quantity: number,
unitName: string,
processUnitPrice: number,
formSubmit: (value: any) => void,
formSubmit?: (value: any) => void,
type: 'edit' | 'view',
fileOnChange?: (value: any) => void
ref: any
ref?: any
}
const Content: React.FC<Iprops> = React.forwardRef((props, conftentRef) => {
......
......@@ -60,7 +60,7 @@ export const schema = {
justify: 'start'
},
properties: {
categoryId: {
customerCategoryId: {
type: 'string',
'x-component': 'Select',
'x-component-props': {
......
......@@ -64,26 +64,24 @@ const FundCenter: React.FC<Iprops> = () => {
? <Skeleton active />
: (
<>
<Row gutter={[16,16]}>
<div className={styles.centerRow}>
{
tagsList.map((item) => {
const hasAuth = !urls.includes(item.url);
const hasAuth = !urls.includes(item.url);;
if(!hasAuth) {
return null
}
return (
<Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</Link>
</Col>
<Link to={item.url} key={item.text} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</Link>
)
})
}
</Row>
</div>
<div>
{
Object.keys(requestData).map((item) => {
......
......@@ -73,27 +73,25 @@ const LogisticsCenter: React.FC<Iprops> = () => {
loading
? <Skeleton active />
: <>
<Row gutter={[24,16]}>
<div className={styles.centerRow}>
{
data.map((item) => {
const hasAuth = !urls.includes(item.url);
const hasAuth = !urls.includes(item.url);;
if(!hasAuth) {
return null
}
return (
<Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
<Badge count={item.key && requestData[item.key] || 0} className={styles.badge}></Badge>
</Link>
</Col>
<Link key={item.text} to={item.url} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
<Badge count={item.key && requestData[item.key] || 0} className={styles.badge}></Badge>
</Link>
)
})
}
</Row>
</div>
</>
}
</>
......
......@@ -66,7 +66,7 @@ const SettlementCenter: React.FC<Iprops> = () => {
loading
? <Skeleton active />
: <>
<Row gutter={[16,24]}>
<div className={styles.centerRow}>
{
tagsList.map((item) => {
const hasAuth = !urls.includes(item.url);
......@@ -74,18 +74,16 @@ const SettlementCenter: React.FC<Iprops> = () => {
return null
}
return (
<Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</Link>
</Col>
<Link to={item.url} key={item.text} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</Link>
)
})
}
</Row>
</div>
{
Object.keys(requestData).map((record) => {
return (
......
......@@ -17,10 +17,7 @@ const ShopCenter: React.FC<Iprops> = () => {
///template/shop/findShopList
const userAuth = getAuth();
const request = useCallback(async () => {
const {code, data} = await PublicApi.getTemplateShopFindShop({
memberId: userAuth.memberId,
roleId: userAuth.roleId
});
const {code, data} = await PublicApi.getTemplateWebMemberShopWebFindCurrMemberShop();
return {
code: code,
data: {
......@@ -47,9 +44,9 @@ const ShopCenter: React.FC<Iprops> = () => {
return (
loading
? <Skeleton active />
: <Row gutter={[16,24]}>
: <div className={styles.centerRow}>
<Authorize url={CREATE_SHOP} canView={true}>
<Col span={4} className={styles.tagsSpecial} >
<div className={styles.tagsSpecial} >
<Link to={CREATE_SHOP} className={styles.tagsItem}>
<div className={styles.icon}>
<img src={create_shop} />
......@@ -67,29 +64,29 @@ const ShopCenter: React.FC<Iprops> = () => {
: null
}
</Col>
</div>
</Authorize>
<Authorize url={SHOP_CENTER} canView={true}>
<Col span={4}>
<div className={styles.centerCol}>
<Link to={SHOP_CENTER} className={styles.tagsItem} >
<div className={styles.icon}>
<img src={create_shop} />
</div>
<div className={styles.text}>店铺模板</div>
</Link>
</Col>
</div>
</Authorize>
<Authorize url={SHOP_CENTER} canView={true}>
<Col span={4}>
<div className={styles.centerCol}>
<Link to={SHOP_CENTER} className={styles.tagsItem} >
<div className={styles.icon}>
<img src={create_shop} />
</div>
<div className={styles.text}>店铺装修</div>
</Link>
</Col>
</div>
</Authorize>
</Row>
</div>
)
}
}
......
......@@ -37,70 +37,110 @@
}
}
// .tags {
// padding: 24px 0 10px 0;
// display: flex;
// flex-direction: row;
// align-items: center;
// flex-wrap: wrap;
.tagsItem {
.tagsItem {
min-width: 160px;
display: flex;
flex-direction: row;
align-items: center;
padding: 8px;
padding-left: 12px;
padding-right: 10px;
background: #FAFBFC;
align-self: flex-start;
margin-right: 16px;
margin: 18px 0;
.icon {
width: 32px;
height: 32px;
margin-right: 8px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #303133;
}
.badge {
margin: 0 0 15px 5px;
}
}
.tagsSpecial {
width: 160px;
margin-right: 16px;
.ding_tips {
color: @main-color;
background: rgba(0, 179, 122, 0.12);
padding: 10px;
display: flex;
flex-direction: row;
align-items: center;
padding: 8px 16px;
background: #FAFBFC;
// width: 212px;
// margin: 0 16px 16px 0;
cursor: pointer;
align-self: flex-start;
// position: relative;
.icon {
width: 32px;
height: 32px;
margin-right: 16px;
}
position: relative;
margin-top: 20px;
.text {
font-size: 14px;
font-weight: 400;
color: #303133;
.ding_icon {
margin-right: 10px;
}
.badge {
margin: 0 0 15px 5px;
&:before {
content: '';
position: absolute;
top: -10px;
left: 20px;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid rgba(0, 179, 122, 0.12);;
}
}
}
.centerRow {
display: flex;
flex-direction: row;
.centerCol {
width: 160px;
margin-right: 16px;
}
}
.tagsSpecial {
.valueRow {
padding: 24px 0;
display: flex;
flex-direction: row;
// align-items: cen;
.ding_tips {
color: @main-color;
background: rgba(0, 179, 122, 0.12);
padding: 10px;
display: flex;
flex-direction: row;
position: relative;
margin-top: 20px;
.title {
width: 90px;
margin-right: 32px;
font-size: 12px;
color: #303133;
}
.values {
display: flex;
flex-wrap: nowrap;
.ding_icon {
margin-right: 10px;
.valueItem {
min-width: 98px;
margin-right: 32px;
.valueTitle {
color: #909399;
font-size: 12px;
height: 34px;
}
&:before {
content: '';
position: absolute;
top: -10px;
left: 20px;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid rgba(0, 179, 122, 0.12);;
.count {
font-size: 20px;
color: #303133;
font-weight: 600;
}
}
}
// }
}
.customWorkBench {
.btn {
// width: 181px;
width: 148px;
height: 48px;
background-color: #fff;
display: flex;
......
......@@ -59,7 +59,7 @@
}
.randomLogo {
background-color: #255BA3;
// background-color: #255BA3;
height: 100%;
border-radius: 50%;
color: #fff;
......@@ -100,20 +100,27 @@
justify-content: space-between;
flex: 1;
.companyName {
// .userStatus {
// display: flex;
// flex-direction: row;
// align-items: center;
// }
.company {
font-size: 14px;
font-weight: 600;
margin-right: 16px;
}
.status {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 12px;
.company {
font-size: 14px;
font-weight: 600;
margin-right: 16px;
}
justify-content: center;
.roles {
display: flex;
flex-direction: row;
margin-top: 9px;
}
}
......@@ -122,22 +129,32 @@
flex-direction: row;
align-items: center;
.link {
width: 88px;
text-align: center;
}
.divider {
border-left: 1px solid #EEF0F3;
margin-left: 24px;
padding-left: 24px;
padding-left: 12px;
display: flex;
flex-direction: row;
align-items: center;
.level {
display: flex;
flex-direction: row;
justify-content: center;
width: 140px;
.levelImg {
height: 16px;
}
}
.score {
margin: 0 30px;
width: 140px;
text-align: center;
}
}
}
......
......@@ -110,26 +110,27 @@ const UserCenter: React.FC<Iprops> = (props) => {
</div>
</Spin>
<div className={styles.infos}>
<div>
<div className={styles.companyName}>
<span className={styles.company}>{userAuth.company}</span>
<div className={styles.userStatus}>
<span className={styles.company}>{userAuth.company}</span>
<div className={styles.status}>
<div className={styles.roles}>
{
currentRole.map((item, key) => {
const statusList = ["success", "danger", "default", "warning", "nobility", "primary"]
return (
<div style={{marginRight: '16px'}} key={key}>
<StatusTag type={statusList[key]} title={item.memberRoleName} />
<StatusTag type={"success"} title={item.memberRoleName} />
</div>
)
})
}
</div>
</div>
<div style={{marginTop: '13px'}}>
<Badge status={STATUS_COLOR[userAuth.validateStatus]} text={userAuth.validateStatusDesc} />
</div>
</div>
<div className={styles.status}><Badge status={STATUS_COLOR[userAuth.validateStatus]} text={userAuth.validateStatusDesc}></Badge></div>
</div>
<div className={styles.otherValues}>
<Link to={EDIT_USER_URL}>修改会员信息</Link>
<Link to={EDIT_USER_URL} className={styles.link}>修改会员信息</Link>
<div className={styles.divider}>
<div className={styles.level}>
会员等级: <img src={LEVEL_IMAGE[userAuth.level]} className={styles.levelImg} />
......@@ -137,7 +138,7 @@ const UserCenter: React.FC<Iprops> = (props) => {
<div className={styles.score}>
平台积分: <strong>{userAuth.score}</strong>
</div>
<Link to={USER_CENTER_URL}>进入会员中心</Link>
<Link to={USER_CENTER_URL} className={styles.link}>进入会员中心</Link>
</div>
</div>
</div>
......
......@@ -15,7 +15,7 @@
}
.right {
margin-left: 24px;
flex-basis: 386px;
flex-basis: 320px;
.actions {
display: flex;
......@@ -23,10 +23,6 @@
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
.workBench {
width: 181px;
}
}
.commonMargin {
......@@ -47,7 +43,7 @@
flex-direction: row;
margin-left: auto;
cursor: pointer;
width: 181px;
width: 148px;
.icon {
font-size: 22px;
......@@ -57,6 +53,3 @@
}
}
@media (max-width: '1280px') {
}
......@@ -73,7 +73,7 @@ const Message: React.FC<{}> = () => {
<Card
title="消息列表"
extra={(
<div><Button>全部已读</Button></div>
<div><Button type="link">全部已读</Button></div>
)}
>
<List
......
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