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
shenshaokai
jinfa-platform
Commits
34b56a47
Commit
34b56a47
authored
Oct 28, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:去掉theInvoiceInfo字段的传递,交给后端自行冗余
parent
b9af4593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
usePageStatus.ts
src/hooks/usePageStatus.ts
+3
-0
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+11
-2
No files found.
src/hooks/usePageStatus.ts
View file @
34b56a47
...
@@ -9,6 +9,7 @@ export enum PageStatus {
...
@@ -9,6 +9,7 @@ export enum PageStatus {
export
const
usePageStatus
=
()
=>
{
export
const
usePageStatus
=
()
=>
{
const
{
preview
,
id
=
''
,
...
rest
}
=
history
.
location
.
query
const
{
preview
,
id
=
''
,
...
rest
}
=
history
.
location
.
query
const
lastTypeParams
=
history
.
location
.
pathname
.
substr
(
history
.
location
.
pathname
.
lastIndexOf
(
'/'
))
// 默认预览状态
// 默认预览状态
let
pageStatus
=
PageStatus
.
PREVIEW
let
pageStatus
=
PageStatus
.
PREVIEW
if
(
preview
===
'1'
)
{
if
(
preview
===
'1'
)
{
...
@@ -25,6 +26,7 @@ export const usePageStatus = () => {
...
@@ -25,6 +26,7 @@ export const usePageStatus = () => {
pageStatus
,
pageStatus
,
id
,
id
,
preview
,
preview
,
lastTypeParams
,
...
rest
,
...
rest
,
}
}
}
}
\ No newline at end of file
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
34b56a47
...
@@ -108,7 +108,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -108,7 +108,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
[
btnLoading
,
setBtnLoading
]
=
useState
(
false
)
const
update
=
useUpdate
()
const
update
=
useUpdate
()
const
[
productSumPrice
,
setProductSumPrice
]
=
useState
<
number
>
(
0
)
const
[
productSumPrice
,
setProductSumPrice
]
=
useState
<
number
>
(
0
)
const
{
pageStatus
,
id
,
page_type
=
'0'
,
modelType
,
spam_id
}
=
usePageStatus
()
const
{
pageStatus
,
id
,
page_type
=
'0'
,
modelType
,
spam_id
,
lastTypeParams
}
=
usePageStatus
()
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(()
=>
{
const
[
initFormValue
,
setInitFormValue
]
=
useState
<
any
>
(()
=>
{
let
resultState
=
{}
let
resultState
=
{}
...
@@ -162,6 +162,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -162,6 +162,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
handleSubmit
=
async
(
value
)
=>
{
const
handleSubmit
=
async
(
value
)
=>
{
try
{
try
{
let
fnResult
=
null
let
fnResult
=
null
// 可做新增/修改的判断
// if (lastTypeParams === 'add') {
// } else if (lastTypeParams === 'edit') {
// }
switch
(
page_type
)
{
switch
(
page_type
)
{
case
'0'
:
{
case
'0'
:
{
// 新增订单/编辑订单
// 新增订单/编辑订单
...
@@ -186,7 +192,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
@@ -186,7 +192,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...
omit
(
value
.
deliveryAddresId
,
[
'id'
]),
...
omit
(
value
.
deliveryAddresId
,
[
'id'
]),
// 冗余发票信息
// 冗余发票信息
theInvoiceId
:
value
.
theInvoiceId
?
value
.
theInvoiceId
.
id
:
undefined
,
theInvoiceId
:
value
.
theInvoiceId
?
value
.
theInvoiceId
.
id
:
undefined
,
theInvoiceInfo
:
value
.
theInvoiceId
||
null
// 去掉该冗余字段的传递, 只做详情展示
// theInvoiceInfo: (value.typeof value.theInvoiceId === 'object' ? value.theInvoiceId : null
// theInvoiceInfo: value.theInvoiceInfo
}
}
setBtnLoading
(
true
)
setBtnLoading
(
true
)
fnResult
=
id
?
await
PublicApi
.
postOrderProcurementOrderUpdate
({...
params
,
id
})
:
await
PublicApi
.
postOrderProcurementOrderAddReinsurancePolicy
(
params
)
fnResult
=
id
?
await
PublicApi
.
postOrderProcurementOrderUpdate
({...
params
,
id
})
:
await
PublicApi
.
postOrderProcurementOrderAddReinsurancePolicy
(
params
)
...
...
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