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
4554d541
Commit
4554d541
authored
Oct 23, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商城跳转的订单,加入回显数据,传多一个roleId参数
parent
840d2089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
index.ts
...s/transaction/purchaseOrder/orderCollect/effects/index.ts
+7
-3
index.tsx
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
+16
-1
index.ts
...es/transaction/purchaseOrder/orderCollect/schema/index.ts
+4
-0
No files found.
src/pages/transaction/purchaseOrder/orderCollect/effects/index.ts
View file @
4554d541
...
...
@@ -131,9 +131,10 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// 从商城跳转, 需回显数据
if
(
initValue
)
{
const
fn
=
async
()
=>
{
const
fn
=
async
(
initValue
)
=>
{
const
productInfo
=
initValue
.
orderList
[
0
].
orderList
ctx
.
setFieldValue
(
'supplyMembersId'
,
initValue
.
supplyMembersId
)
ctx
.
setFieldValue
(
'supplyMembersRoleId'
,
initValue
.
supplyMembersRoleId
)
ctx
.
setFieldValue
(
'supplyMembersName'
,
initValue
.
supplyMembersName
)
ctx
.
setFieldValue
(
'orderProductRequests'
,
await
filterProductDataById
([],
productInfo
.
map
(
v
=>
{
...
...
@@ -152,11 +153,14 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
}
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
ctx
.
setF
ormState
(
state
=>
{
ctx
.
setF
ieldState
(
'orderModel'
,
state
=>
{
state
.
remoteDataFn
=
fn
})
// ctx.setFormState(state => {
// state.remoteDataFn = fn
// })
fn
()
fn
(
initValue
)
}
// 写入收货地址数据
...
...
src/pages/transaction/purchaseOrder/orderCollect/index.tsx
View file @
4554d541
...
...
@@ -100,6 +100,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
// 采购订单详情页. 包含新增和编辑
const
PurchaseOrderDetail
:
React
.
FC
<
PurchaseOrderDetailProps
>
=
(
props
)
=>
{
const
shopDataRef
=
useRef
<
any
>
({})
const
memberRef
=
useRef
<
any
>
({})
const
inquiryRef
=
useRef
<
any
>
({})
const
demandRef
=
useRef
<
any
>
({})
...
...
@@ -145,6 +146,17 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
setFormLoading
(
false
)
})
}
if
(
modelType
)
{
shopDataRef
.
current
.
orderModel
=
parseInt
(
modelType
)
}
// 订单数据
if
(
spam_id
)
{
const
item
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
spam_id
))
if
(
item
)
{
shopDataRef
.
current
=
Object
.
assign
({},
shopDataRef
.
current
,
item
)
}
}
},
[])
const
handleSubmit
=
async
(
value
)
=>
{
...
...
@@ -298,7 +310,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
if
(
editable
)
{
if
(
value
===
OrderModalType
.
PURCHASE_ORDER
)
{
// 进货单下单,尝试回显保存的数据
console
.
log
(
state
)
console
.
log
(
shopDataRef
.
current
)
// 初始化时绑定加载进货单数据的函数
state
.
remoteDataFn
(
shopDataRef
.
current
)
return
;
}
ctx
.
reset
({
...
...
src/pages/transaction/purchaseOrder/orderCollect/schema/index.ts
View file @
4554d541
...
...
@@ -172,6 +172,10 @@ const basicInfo: ISchema = {
type
:
'string'
,
display
:
false
},
supplyMembersRoleId
:
{
type
:
'string'
,
display
:
false
},
orderNo
:
{
type
:
'string'
,
title
:
'订单编号'
,
...
...
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