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
6c1d9e21
Commit
6c1d9e21
authored
Oct 20, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
d917c071
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
19 deletions
+33
-19
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+26
-17
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+7
-2
No files found.
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
6c1d9e21
...
...
@@ -131,23 +131,32 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// 从商城跳转, 需回显数据
if
(
initValue
)
{
const
productInfo
=
initValue
.
orderList
[
0
].
orderList
ctx
.
setFieldValue
(
'supplyMembersId'
,
initValue
.
supplyMembersId
)
ctx
.
setFieldValue
(
'supplyMembersName'
,
initValue
.
supplyMembersName
)
ctx
.
setFieldValue
(
'orderProductRequests'
,
await
filterProductDataById
([],
productInfo
.
map
(
v
=>
{
return
{
...
v
,
unitPrice
:
v
.
priceRange
.
reduce
((
prev
,
next
)
=>
{
prev
[
next
.
range
]
=
next
.
price
return
prev
},
{}),
isMemberPrice
:
!!
v
.
memberDiscount
,
purchaseCount
:
v
.
count
,
money
:
v
.
count
*
v
.
unitPrice
,
productId
:
v
.
id
}
})))
const
fn
=
async
()
=>
{
const
productInfo
=
initValue
.
orderList
[
0
].
orderList
ctx
.
setFieldValue
(
'supplyMembersId'
,
initValue
.
supplyMembersId
)
ctx
.
setFieldValue
(
'supplyMembersName'
,
initValue
.
supplyMembersName
)
ctx
.
setFieldValue
(
'orderProductRequests'
,
await
filterProductDataById
([],
productInfo
.
map
(
v
=>
{
return
{
...
v
,
unitPrice
:
v
.
priceRange
.
reduce
((
prev
,
next
)
=>
{
prev
[
next
.
range
]
=
next
.
price
return
prev
},
{}),
isMemberPrice
:
!!
v
.
memberDiscount
,
purchaseCount
:
v
.
count
,
money
:
v
.
count
*
v
.
unitPrice
,
productId
:
v
.
id
}
})))
}
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
ctx
.
setFormState
(
state
=>
{
state
.
remoteDataFn
=
fn
})
fn
()
}
// 写入收货地址数据
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
6c1d9e21
...
...
@@ -278,7 +278,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
<
NiceForm
loading=
{
formLoading
}
previewPlaceholder=
' '
editable=
{
pageStatus
!==
PageStatus
.
PREVIEW
}
//
editable={pageStatus !== PageStatus.PREVIEW}
value=
{
initFormValue
}
actions=
{
addSchemaAction
}
schema=
{
mergeAllSchemas
[
page_type
]
}
...
...
@@ -293,9 +293,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
setProductSumPrice
(
payload
)
})
$
(
'onFieldInputChange'
,
'orderModel'
).
subscribe
(
state
=>
{
const
{
editable
}
=
state
const
{
editable
,
value
}
=
state
// 手动切换过下单模式, 需重置受下单模式影响的字段
if
(
editable
)
{
if
(
value
===
OrderModalType
.
PURCHASE_ORDER
)
{
// 进货单下单,尝试回显保存的数据
console
.
log
(
state
)
return
;
}
ctx
.
reset
({
validate
:
false
,
selector
:
'*(quotationNo,supplyMembersName,orderProductRequests)'
...
...
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