Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
linweijiong
jinfa-platform
Commits
a90b1bd7
Commit
a90b1bd7
authored
Dec 11, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
e4b07d88
69fc7fbf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
36 deletions
+67
-36
index.tsx
src/pages/balance/accountsReceivable/invoice/index.tsx
+5
-13
invoice.tsx
src/pages/balance/components/InvoiceCreate/invoice.tsx
+23
-16
invoiceDrawerInfo.tsx
...es/balance/components/InvoiceCreate/invoiceDrawerInfo.tsx
+39
-7
No files found.
src/pages/balance/accountsReceivable/invoice/index.tsx
View file @
a90b1bd7
...
...
@@ -70,21 +70,15 @@ const SettlementList = () => {
const
handleShow
=
async
(
record
:
GetSettleAccountsMemberSettlementPageReceiptInvoiceResponseDetail
)
=>
{
(
document
.
body
.
parentNode
as
HTMLBodyElement
).
style
.
overflowY
=
"hidden"
;
setVisible
(
true
)
setActiveData
(
record
)
// setActiveData({
// id: record.id,
// type: record.invoiceStatus,
// settlementOrderType: record.settlementOrderType || 5,
// // payRoleId: record.payRoleId,
// // payMemberId: record.payMemberId
// })
const
hide
=
message
.
loading
(
'正在加载中'
,
0
);
/** 退货类型 */
const
service
=
record
.
settlementOrderType
===
5
?
getSettleAccountsMemberSettlementGetReturnInvoiceProveDetail
:
getSettleAccountsMemberSettlementGetInvoiceProveDetail
const
{
code
,
data
,
message
:
msg
}
=
await
service
({
id
:
record
.
id
.
toString
()
});
hide
()
if
(
code
!==
1000
)
{
message
.
error
(
msg
);
return
...
...
@@ -94,9 +88,11 @@ const SettlementList = () => {
message
.
error
(
"无发票信息"
);
return
}
setVisible
(
true
)
setInvoiceInfo
(
data
);
return
;
}
setVisible
(
true
)
setInvoiceInfo
([(
data
as
GetSettleAccountsMemberSettlementGetInvoiceProveDetailResponse
)]);
}
...
...
@@ -117,10 +113,6 @@ const SettlementList = () => {
let
res
=
{}
keys
.
forEach
((
item
)
=>
{
const
array
=
value
[
item
];
// res[item] = array.map((_row) => {
// const { invoiceDate, ...rest } = _row;
// return { invoiceDate: invoiceDate.format('YYYY-MM-DD'), ...rest}
// })
res
[
item
]
=
array
})
/** 退货类型 */
...
...
@@ -314,7 +306,7 @@ const SettlementList = () => {
/>
</
Card
>
<
InvoiceDrawerInfo
mode=
{
activeData
.
invoiceStatus
===
1
?
'edit'
:
'view'
}
mode=
{
activeData
?.
invoiceStatus
===
0
?
'edit'
:
'view'
}
visible=
{
visible
}
invoiceInfoData=
{
invoiceInfo
}
onCancel=
{
handleOnCancel
}
...
...
src/pages/balance/components/InvoiceCreate/invoice.tsx
View file @
a90b1bd7
...
...
@@ -6,22 +6,27 @@ import { getIntl } from 'umi';
const
intl
=
getIntl
()
interface
Iprops
{
infos
:
{
typeName
:
string
,
kindName
:
string
,
invoiceTitle
:
string
,
taxNo
:
string
,
bankOfDeposit
:
string
,
account
:
string
,
address
:
string
,
tel
:
string
,
originalProveList
?:
{
number
:
number
,
invoiceDate
:
string
,
invoiceAmount
:
string
,
remark
:
string
}[]
props
:
{
'x-component-props'
:
{
infos
:
{
typeName
:
string
,
kindName
:
string
,
invoiceTitle
:
string
,
taxNo
:
string
,
bankOfDeposit
:
string
,
account
:
string
,
address
:
string
,
tel
:
string
,
originalProveList
?:
{
number
:
number
,
invoiceDate
:
string
,
invoiceAmount
:
string
,
remark
:
string
}[]
}
}
}
}
const
infoList
=
[
...
...
@@ -35,7 +40,9 @@ const infoList = [
{
title
:
intl
.
formatMessage
({
id
:
'balance.components.invoiceCreate.invoiceInfo.infoList.tel'
}),
dataIndex
:
'tel'
}
]
const
InvoiceInfo
:
React
.
FC
<
Iprops
>
&
{
isVirtualFieldComponent
:
boolean
}
=
(
props
)
=>
{
const
{
infos
}
=
props
;
console
.
log
(
props
);
const
xComponentProps
=
props
.
props
[
'x-component-props'
]
const
{
infos
}
=
xComponentProps
;
return
(
<>
...
...
src/pages/balance/components/InvoiceCreate/invoiceDrawerInfo.tsx
View file @
a90b1bd7
...
...
@@ -5,11 +5,13 @@ import {
SchemaMarkupField
as
Field
}
from
'@formily/antd'
import
{
Button
,
Drawer
}
from
'antd'
;
import
React
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
ArrayList
from
'./arrayList'
;
import
{
Input
,
DatePicker
}
from
'@formily/antd-components'
;
import
styles
from
'./invoiceDrawerInfo.less'
;
import
InvoiceInfo
from
'./invoice'
import
{
getIntl
}
from
'umi'
const
intl
=
getIntl
();
const
formActions
=
createFormActions
();
interface
Iprops
{
...
...
@@ -20,8 +22,16 @@ interface Iprops {
invoiceInfoData
:
any
}
type
ProveListType
=
{
number
:
string
,
invoiceDate
:
string
,
invoiceAmount
:
number
remark
:
string
,
}
const
InvoiceDrawerInfo
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
visible
,
onCancel
,
invoiceInfoData
,
onSubmit
}
=
props
;
const
{
visible
,
onCancel
,
invoiceInfoData
,
onSubmit
,
mode
}
=
props
;
const
[
initialValue
,
setInitialValue
]
=
useState
<
{
[
key
:
string
]:
ProveListType
}
>
({});
const
handleCancel
=
()
=>
{
onCancel
?.()
...
...
@@ -31,10 +41,10 @@ const InvoiceDrawerInfo: React.FC<Iprops> = (props: Iprops) => {
return
(
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
Button
onClick=
{
handleCancel
}
style=
{
{
marginRight
:
8
}
}
>
取消
{
intl
.
formatMessage
({
id
:
'balance.components.invoiceCreate.invoiceDrawer.renderFooter.button.1'
})
}
</
Button
>
<
Button
onClick=
{
()
=>
formActions
.
submit
()
}
type=
"primary"
>
确认
{
intl
.
formatMessage
({
id
:
'balance.components.invoiceCreate.invoiceDrawer.renderFooter.button.2'
})
}
</
Button
>
</
div
>
)
...
...
@@ -45,23 +55,45 @@ const InvoiceDrawerInfo: React.FC<Iprops> = (props: Iprops) => {
onSubmit
?.(
values
)
}
useEffect
(()
=>
{
if
(
mode
===
'view'
&&
invoiceInfoData
)
{
const
data
=
{};
invoiceInfoData
?.
forEach
((
_item
,
index
)
=>
{
const
{
proveList
}
=
_item
;
data
[
`list-
${
index
}
`
]
=
proveList
})
setInitialValue
(
data
);
}
},
[
mode
,
invoiceInfoData
])
return
(
<
Drawer
visible=
{
visible
}
width=
{
800
}
title=
"开具发票"
onClose=
{
handleCancel
}
footer=
{
renderFooter
()
}
>
<
SchemaForm
value=
{
initialValue
}
onSubmit=
{
handleSubmit
}
components=
{
{
ArrayCustom
:
ArrayList
,
Input
:
Input
,
DatePicker
}
}
components=
{
{
ArrayCustom
:
ArrayList
,
Input
:
Input
,
DatePicker
,
InvoiceInfo
}
}
actions=
{
formActions
}
editable=
{
mode
===
'edit'
}
>
{
invoiceInfoData
?.
map
((
_item
,
key
)
=>
{
return
(
<
div
key=
{
key
}
>
<
InvoiceInfo
infos=
{
_item
}
/>
<
div
key=
{
key
}
style=
{
{
display
:
'flex'
,
flexDirection
:
'column'
}
}
>
<
Field
type=
"object"
x
-
component=
'InvoiceInfo'
x
-
component
-
props=
{
{
infos
:
_item
}
}
/>
<
Field
name=
{
`list-${key}`
}
type=
"array"
...
...
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