Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
72b5bce0
Commit
72b5bce0
authored
Feb 01, 2024
by
guang.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加付款凭证
parent
07de9c77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
222 additions
and
1 deletion
+222
-1
PaymentBillModal.jsx
src/pages/PaymentMange/components/PaymentBillModal.jsx
+67
-0
data.js
src/pages/PaymentMange/data.js
+134
-1
index.jsx
src/pages/PaymentMange/index.jsx
+21
-0
No files found.
src/pages/PaymentMange/components/PaymentBillModal.jsx
0 → 100644
View file @
72b5bce0
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
layout
}
from
'
@/utils/bll
'
;
import
{
BetaSchemaForm
}
from
'
@ant-design/pro-components
'
;
import
{
paymentInfoColumn
}
from
'
../data
'
;
const
PaymentBill
=
props
=>
{
const
refForm
=
React
.
useRef
();
const
closeModal
=
v
=>
{
!
v
&&
props
.
onClose
(
false
);
};
const
onSubmit
=
async
v
=>
{
// 关闭
closeModal
();
};
const
getInfo
=
async
()
=>
{
const
info
=
props
.
info
||
{};
let
images
=
[];
// info.paySuccessImage;
if
(
info
.
paySuccessImages
?.
length
)
{
images
=
info
.
paySuccessImages
.
map
((
item
,
i
)
=>
({
url
:
item
,
uid
:
i
,
status
:
'
done
'
,
name
:
''
,
}));
}
const
params
=
{
images
,
comment
:
info
.
payComment
||
''
,
};
refForm
.
current
?.
setFieldsValue
?.(
params
);
const
res
=
refForm
.
current
?.
getFieldsValue
();
console
.
log
(
res
);
};
useEffect
(()
=>
{
if
(
props
.
visible
)
{
getInfo
();
}
},
[
props
.
visible
]);
return
(
props
.
visible
&&
(
<
BetaSchemaForm
layoutType=
"ModalForm"
title=
"查看付款单"
open=
{
props
.
visible
}
width=
"600px"
modalProps=
{
{
maskClosable
:
false
,
destroyOnClose
:
true
,
okText
:
()
=>
<></>,
cancelText
:
'
关闭
'
,
}
}
formRef=
{
refForm
}
onOpenChange=
{
closeModal
}
layout=
"horizontal"
{
...
layout
}
onFinish=
{
onSubmit
}
columns=
{
paymentInfoColumn
(
props
.
status
)
}
/>
)
);
};
export
default
PaymentBill
;
src/pages/PaymentMange/data.js
View file @
72b5bce0
import
React
from
'
react
'
;
import
{
Button
}
from
'
antd
'
;
import
{
Button
,
Upload
}
from
'
antd
'
;
import
{
UploadOutlined
}
from
'
@ant-design/icons
'
;
import
styles
from
'
./style.less
'
;
export
const
payStateEnum
=
{
...
...
@@ -18,6 +19,13 @@ export const orderStateNum = {
4
:
{
text
:
'
已通过
'
},
};
export
const
dateStateEnum
=
{
1
:
{
text
:
'
一周
'
},
2
:
{
text
:
'
半个月
'
},
3
:
{
text
:
'
一个月
'
},
4
:
{
text
:
'
日结
'
},
};
export
const
redInvoiceState
=
{
1
:
{
text
:
'
是
'
,
actionValue
:
2
},
2
:
{
text
:
'
否
'
,
actionValue
:
1
},
...
...
@@ -131,6 +139,41 @@ export function columns(res, pages) {
<
/div
>
),
},
{
title
:
()
=>
(
<
div
style
=
{{
textAlign
:
'
center
'
}}
>
<
div
>
当前结算周期
<
/div
>
<
div
style
=
{{
color
:
'
#f00
'
}}
>
(
供应商维度
)
<
/div
>
<
/div
>
),
dataIndex
:
'
billPeriod
'
,
key
:
'
billPeriod
'
,
width
:
'
150px
'
,
hideInSearch
:
true
,
valueEnum
:
dateStateEnum
,
align
:
'
center
'
,
},
{
title
:
()
=>
(
<
div
style
=
{{
textAlign
:
'
center
'
}}
>
<
div
>
拖欠金额
<
/div
>
<
div
style
=
{{
color
:
'
#f00
'
}}
>
(
供应商维度
)
<
/div
>
<
/div
>
),
dataIndex
:
'
arrearsAmount
'
,
key
:
'
arrearsAmount
'
,
width
:
'
130px
'
,
hideInSearch
:
true
,
align
:
'
center
'
,
},
{
title
:
'
实付金额
'
,
dataIndex
:
'
paidAmount
'
,
key
:
'
paidAmount
'
,
width
:
'
100px
'
,
hideInSearch
:
true
,
align
:
'
center
'
,
},
{
title
:
'
是否缺少红字发票
'
,
dataIndex
:
'
redInvoiceState
'
,
...
...
@@ -199,6 +242,14 @@ export function columns(res, pages) {
<
Button
type
=
"
primary
"
className
=
{
styles
.
button
}
onClick
=
{()
=>
res
.
edit
(
3
,
row
)}
>
下载账单
<
/Button
>
<
Button
type
=
"
primary
"
className
=
{
styles
.
button
}
disabled
=
{
row
.
payState
!==
5
}
onClick
=
{()
=>
res
.
onPaymentOrder
(
1
,
row
)}
>
查看付款凭证
<
/Button
>
<
/div
>
),
},
...
...
@@ -206,3 +257,85 @@ export function columns(res, pages) {
}
export
const
toolBarRender
=
onExport
=>
()
=>
[];
// 上传文件
export
function
uploadPropsFn
({
keyName
,
limit
=
1
,
maxSize
=
1024
*
1024
*
5
,
maxSizeMsg
=
'
文件大小不能超过5M!
'
,
form
,
disabled
,
accept
=
'
.png,.bmp,.gif,.jpeg,.jpg
'
,
})
{
const
config
=
{
maxSize
,
disabled
,
multiple
:
limit
>
1
,
listType
:
'
picture-card
'
,
showUploadList
:
true
,
accept
,
onRemove
:
e
=>
{
const
fileValue
=
form
.
getFieldValue
(
keyName
)
||
[];
if
(
fileValue
.
fileList
)
{
const
files
=
fileValue
.
fileList
.
filter
(
item
=>
item
.
uid
!==
e
.
uid
);
form
.
setFieldValue
(
keyName
,
files
);
}
else
{
const
files
=
fileValue
.
filter
(
item
=>
item
.
uid
!==
e
.
uid
);
form
.
setFieldValue
(
keyName
,
files
);
}
},
};
return
config
;
}
/**
* 付款单弹窗
* status:1查看 0上传
* * */
export
const
paymentInfoColumn
=
status
=>
[
{
title
:
'
付款单
'
,
dataIndex
:
'
images
'
,
key
:
'
images
'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'
请上传付款单
'
}],
},
fieldProps
:
{
disabled
:
status
===
1
,
limit
:
1
,
accept
:
'
.png,.bmp,.gif,.jpeg,.jpg,.pdf
'
,
},
renderFormItem
:
(
s
,
c
,
form
)
=>
{
let
fileList
=
form
.
getFieldValue
(
'
images
'
)
||
[];
if
(
fileList
.
fileList
)
{
fileList
=
fileList
.
fileList
||
[];
}
return
(
<
Upload
{...
uploadPropsFn
.
call
(
this
,
{
keyName
:
'
images
'
,
form
,
accept
:
'
.png,.bmp,.gif,.jpeg,.jpg,.pdf
'
,
})}
fileList
=
{
fileList
}
disabled
=
{
status
===
1
}
>
<
UploadOutlined
/>
上传文件
<
/Upload
>
);
},
},
{
title
:
'
备注
'
,
dataIndex
:
'
comment
'
,
key
:
'
comment
'
,
align
:
'
center
'
,
valueType
:
'
textarea
'
,
fieldProps
:
{
disabled
:
status
===
1
,
maxLength
:
200
,
autoSize
:
{
minRows
:
2
,
maxRows
:
6
},
},
},
];
src/pages/PaymentMange/index.jsx
View file @
72b5bce0
...
...
@@ -8,6 +8,7 @@ import { saveAs } from 'file-saver';
import
{
format
}
from
'
date-fns
'
;
import
moment
from
'
moment
'
;
import
{
connect
}
from
'
dva
'
;
import
PaymentBillModal
from
'
./components/PaymentBillModal
'
;
import
{
PAYMENT_MANAGE
}
from
'
@/../config/permission.config
'
;
import
ToExamineModal
from
'
./ToExamine
'
;
import
{
columns
,
toolBarRender
}
from
'
./data
'
;
...
...
@@ -31,6 +32,9 @@ const PaymentMange = props => {
const
[
status
,
setstatus
]
=
useState
(
1
);
const
[
pages
,
setpages
]
=
useState
({});
const
[
toExamineModalVisibel
,
setToExamineModalVisibel
]
=
useState
(
false
);
const
[
visiblePaymentBill
,
setVisiblePaymentBill
]
=
useState
(
false
);
const
[
paymentStatus
,
setPaymentStatus
]
=
useState
(
0
);
const
[
supplierInfo
,
setSupplierInfo
]
=
useState
({});
const
reload
=
()
=>
{
if
(
actionRef
.
current
)
{
...
...
@@ -124,11 +128,18 @@ const PaymentMange = props => {
}
setloading
(
false
);
};
// 上传付款单和查看付款单
const
onPaymentOrder
=
(
status
,
row
)
=>
{
setPaymentStatus
(
status
);
setSupplierInfo
(
row
);
setVisiblePaymentBill
(
!
0
);
};
const
onToolBarRender
=
toolBarRender
();
const
res
=
{
edit
,
onPaymentOrder
,
canEditable
,
};
...
...
@@ -199,6 +210,16 @@ const PaymentMange = props => {
onColse
();
}
}
/>
{
visiblePaymentBill
&&
(
<
PaymentBillModal
visible=
{
visiblePaymentBill
}
status=
{
paymentStatus
}
info=
{
supplierInfo
}
onRefresh=
{
()
=>
reload
()
}
onClose=
{
()
=>
setVisiblePaymentBill
(
false
)
}
/>
)
}
</
PageHeaderWrapper
>
</
Spin
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment