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
陈智峰
jinfa-platform
Commits
3fffd890
Commit
3fffd890
authored
Sep 02, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仓位bug修复
parent
95c8f37e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
24 deletions
+101
-24
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+2
-1
index.ts
...transaction/purchaseOrder/readyAddOrder/constant/index.ts
+27
-17
detail.tsx
src/pages/transaction/purchaseOrder/readyAddOrder/detail.tsx
+29
-3
index.ts
.../transaction/purchaseOrder/readyAddOrder/effects/index.ts
+9
-0
useDetailOrder.tsx
...tion/purchaseOrder/readyAddOrder/model/useDetailOrder.tsx
+11
-2
index.ts
...s/transaction/purchaseOrder/readyAddOrder/schema/index.ts
+23
-1
No files found.
src/pages/repositories/adjustRepository.tsx
View file @
3fffd890
...
...
@@ -144,7 +144,8 @@ const AddRepository:React.FC<{}> = (props) => {
inventory
:
values
.
inventory
,
inventoryDeductWay
:
values
.
inventoryDeductWay
,
shopIds
:
values
.
shopIds
,
isAllMemberShare
:
values
.
isAllMemberShare
isAllMemberShare
:
values
.
isAllMemberShare
,
shopType
:
values
.
shopType
}
if
(
values
[
'applyMember'
])
{
params
[
'applyMember'
]
=
values
[
'applyMember'
].
map
(
v
=>
v
.
memberId
)
...
...
src/pages/transaction/purchaseOrder/readyAddOrder/constant/index.ts
View file @
3fffd890
export
enum
OrderModalType
{
/**
* 进货单下单
*/
PURCHASE_ORDER
=
5
,
/**
* 手工下单
*/
HAND_ORDER
,
/**
* 询价报价下单
*/
INQUIRY_QUOTATION_ORDER
,
/**
* 需求报价下单
*/
DEMAND_QUOTATION_ORDER
=
206
,
DEMAND_QUOTATION_ORDER
,
/**
* 合并订单下单
*/
...
...
@@ -28,19 +42,15 @@ export enum OrderModalType {
* 渠道现货手工下单
*/
CHANNEL_SPOT_MANUAL_ORDER
,
}
/**
* 询价报价下单
*/
INQUIRY_QUOTATION_ORDER
,
/**
* 进货单下单
*/
PURCHASE_ORDER
,
/**
* 手工下单
*/
HAND_ORDER
}
\ No newline at end of file
export
const
orderTypeLabel
=
[
''
,
'询价采购'
,
'需求采购'
,
'现货采购'
,
'集采'
,
'积分兑换'
,
'渠道直采'
,
'渠道现货'
,
'渠道积分兑换'
]
\ No newline at end of file
src/pages/transaction/purchaseOrder/readyAddOrder/detail.tsx
View file @
3fffd890
...
...
@@ -10,15 +10,19 @@ import NiceForm from '@/components/NiceForm'
import
{
orderDetailSchema
}
from
'./schema'
import
{
useDetailOrder
}
from
'./model/useDetailOrder'
import
ModalTable
from
'@/components/ModalTable'
import
{
useModelTypeChange
}
from
'./effects'
import
{
OrderModalType
,
orderTypeLabel
}
from
'./constant'
export
interface
PurchaseOrderDetailProps
{}
const
addSchemaAction
=
createFormActions
()
// 采购订单详情页. 包含新增和编辑
const
PurchaseOrderDetail
:
React
.
FC
<
PurchaseOrderDetailProps
>
=
(
props
)
=>
{
const
{
productColumns
}
=
useDetailOrder
()
// 页面进入时, 当前所处的下单模式
const
{
orderModel
}
=
history
.
location
.
query
const
{
productColumns
,
setShowProBtn
,
showProBtn
}
=
useDetailOrder
({
orderModel
})
// 页面进入时, 当前所处的下单模式
const
{
pageStatus
}
=
usePageStatus
()
const
handleOrderNo
=
()
=>
{}
...
...
@@ -27,7 +31,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const
orderNoPrice
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
<
div
className=
'connectBtn'
onClick=
{
handleOrderNo
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
const
orderMember
=
pageStatus
!==
PageStatus
.
PREVIEW
&&
<
div
className=
'connectBtn'
onClick=
{
handleOrderMember
}
><
LinkOutlined
style=
{
{
marginRight
:
4
}
}
/>
选择
</
div
>
const
productAddButton
=
<
Button
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
const
productAddButton
=
showProBtn
&&
<
Button
block
type=
'default'
style=
{
{
margin
:
'24px auto'
}
}
>
选择订单商品
</
Button
>
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -45,6 +49,28 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
actions=
{
addSchemaAction
}
schema=
{
orderDetailSchema
}
className=
'useConnectBtnWrapper'
effects=
{
(
$
,
ctx
)
=>
{
useModelTypeChange
(
state
=>
{
const
{
value
}
=
state
// 报价单的值 等同于是否填写过报价单
const
quotationOrderValue
=
ctx
.
getFieldValue
(
'quotationNo'
)
// 当选择了手工下单、渠道直采手工下单、渠道现货手工下单、或者选择了合并订单下单并未选择报价单则需要显示商品列表添加接口
if
(
value
===
OrderModalType
.
HAND_ORDER
||
value
===
OrderModalType
.
CHANNEL_DIRECT_MINING_ORDER
||
value
===
OrderModalType
.
CHANNEL_SPOT_MANUAL_ORDER
||
(
value
===
OrderModalType
.
CONSOLIDATED_ORDER
&&
quotationOrderValue
)
)
{
setShowProBtn
(
true
)
}
else
{
setShowProBtn
(
false
)
}
// 选择某种类型时, 需显示对应的订单类型
ctx
.
setFieldValue
(
'type'
,
orderTypeLabel
[
value
-
4
])
// -4 获得对应的数组下标, 由于id是固定的
})
}
}
expressionScope=
{
{
orderNoPrice
,
orderMember
,
...
...
src/pages/transaction/purchaseOrder/readyAddOrder/effects/index.ts
0 → 100644
View file @
3fffd890
import
{
ISchemaFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
export
const
useModelTypeChange
=
(
callback
)
=>
{
// 下单模式发生改变时
FormEffectHooks
.
onFieldValueChange$
(
'orderModel'
).
subscribe
(
state
=>
{
callback
(
state
)
})
}
\ No newline at end of file
src/pages/transaction/purchaseOrder/readyAddOrder/model/useDetailOrder.tsx
View file @
3fffd890
import
React
,
{
useState
}
from
'react'
import
{
OrderModalType
}
from
'../constant'
export
const
useDetailOrder
=
()
=>
{
export
const
useDetailOrder
=
(
options
)
=>
{
// const [productDataSource, setProductDataSource] = useState
const
[
showProBtn
,
setShowProBtn
]
=
useState
(
options
.
orderModel
)
const
[
showMemberType
,
setShowMemberType
]
=
useState
(
false
)
const
productColumns
:
any
[]
=
[
{
title
:
'商品ID'
,
...
...
@@ -30,6 +34,10 @@ export const useDetailOrder = () => {
]
return
{
productColumns
productColumns
,
showProBtn
,
setShowProBtn
,
showMemberType
,
setShowMemberType
}
}
\ No newline at end of file
src/pages/transaction/purchaseOrder/readyAddOrder/schema/index.ts
View file @
3fffd890
...
...
@@ -103,7 +103,29 @@ const basicInfo: ISchema = {
disabled
:
true
,
addonAfter
:
"{{orderMember}}"
},
}
},
orderNo
:
{
type
:
'string'
,
title
:
'订单编号'
,
"x-component"
:
'text'
},
type
:
{
type
:
'string'
,
title
:
'订单类型'
,
"x-component"
:
'text'
},
createTime
:
{
type
:
'string'
,
title
:
'下单时间'
},
interiorState
:
{
type
:
'string'
,
title
:
'内部状态'
},
externalState
:
{
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