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
5e3339df
Commit
5e3339df
authored
Oct 13, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:手工下单收货
parent
9ba75b1d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
250 additions
and
18 deletions
+250
-18
index.ts
src/constants/index.ts
+16
-4
index.tsx
...aseOrder/orderPreview/components/orderMergeInfo/index.tsx
+1
-5
index.tsx
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
+62
-6
useSelfTable.tsx
...on/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
+1
-1
index.tsx
...leOrder/orderPreview/components/orderHandDeleve/index.tsx
+153
-0
index.tsx
src/pages/transaction/saleOrder/orderPreview/index.tsx
+16
-1
useSelfTable.tsx
...saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
+1
-1
No files found.
src/constants/index.ts
View file @
5e3339df
...
...
@@ -614,7 +614,12 @@ export enum PurchaseOrderInsideWorkState {
/**
* 待审核入库订单
*/
READY_WAREHOUSE_APPROVED_ORDER
READY_WAREHOUSE_APPROVED_ORDER
,
/**
* 手工收货
*/
HAND_RECEIPT_ORDER
}
// 销售订单内部工作流状态
...
...
@@ -707,7 +712,12 @@ export enum SaleOrderInsideWorkState {
/**
* 待审核物流单(新增物流单成功)
*/
DELIVERY_APPROVED_SUCCESS
DELIVERY_APPROVED_SUCCESS
,
/**
* 手工发货
*/
HAND_DELEVED_ORDER
,
}
// 支付外部状态
...
...
@@ -788,7 +798,8 @@ export const PurchaseOrderInsideWorkStateTexts = {
12
:
'确认收货'
,
14
:
'订单入库'
,
15
:
'订单归档'
,
16
:
'订单入库待审核'
16
:
'订单入库待审核'
,
17
:
'手工收货'
}
// 销售订单内部显示文案
...
...
@@ -812,7 +823,8 @@ export const SaleOrderInsideWorkStateTexts = {
23
:
'确认回单'
,
24
:
'订单归档'
,
25
:
'待审核发货单'
,
26
:
'待审核物流单'
26
:
'待审核物流单'
,
27
:
'手工发货'
}
export
const
PayOutWorkStateTexts
=
{
...
...
src/pages/transaction/purchaseOrder/orderPreview/components/orderMergeInfo/index.tsx
View file @
5e3339df
...
...
@@ -13,7 +13,7 @@ export interface OrderMergeInfoProps { }
const
payInfo
=
[
{
title
:
'交付日期'
,
name
:
'deliveryTime'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'交付地址'
,
name
:
'deliveryAddres
Id
'
,
render
:
(
_
,
record
)
=>
title
:
'交付地址'
,
name
:
'deliveryAddres
sInfo
'
,
render
:
(
_
,
record
)
=>
<
div
>
<
Row
>
<
Col
>
{
record
.
receiverName
}
</
Col
>
...
...
@@ -60,10 +60,6 @@ const RenderCard = ({ infoList, dataSource }) => infoList.map(v => dataSource[v.
const
OrderMergeInfo
:
React
.
FC
<
OrderMergeInfoProps
>
=
(
props
)
=>
{
const
orderDetailCtx
=
useContext
(
OrderDetailContext
)
const
address
=
useMemo
(
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getLogisticsSelectListReceiverAddress
()
return
data
},
[])
const
{
data
,
ctl
}
=
orderDetailCtx
return
(
...
...
src/pages/transaction/purchaseOrder/orderPreview/index.tsx
View file @
5e3339df
import
React
,
{
useState
,
useEffect
,
useContext
,
useRef
,
useCallback
}
from
'react'
import
OrderDetailHeader
from
'../../components/OrderDetailHeader'
import
{
Button
,
Row
,
Col
,
message
}
from
'antd'
import
{
Button
,
Row
,
Col
,
message
,
Modal
}
from
'antd'
import
{
Link
,
history
}
from
'umi'
import
{
orderTypeLabel
,
SALE_ORDER_STATUS
,
PURCHASE_ORDER_STATUS
}
from
'./constant'
import
{
formatTimeString
}
from
'@/utils'
...
...
@@ -22,6 +22,7 @@ import OrderPayModal from './components/orderPayModal'
import
OrderDeleveRecord
from
'./components/orderDeleveRecord'
import
{
PurchaseOrderInsideWorkState
}
from
'@/constants'
import
OrderElectronModal
from
'./components/orderElectronModal'
import
moment
from
'moment'
export
interface
CommonOrderDetailProps
{
}
...
...
@@ -33,6 +34,8 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
const
[
btnLoading
,
setBtnLoading
]
=
useState
<
boolean
>
(
false
)
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
const
[
payList
,
setPaylist
]
=
useState
<
any
[]
>
([])
// 手工收货时出现的弹窗
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
let
{
id
,
pageStatus
,
page_type
=
PURCHASE_ORDER_STATUS
.
PREVIEW_ORDER
}
=
usePageStatus
()
page_type
=
parseInt
(
page_type
)
...
...
@@ -145,6 +148,12 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
const
handleStartApply
=
()
=>
{
// 无需弹窗, 直接提交
if
(
page_type
===
PURCHASE_ORDER_STATUS
.
READY_SUBMIT_ORDER
||
page_type
===
PURCHASE_ORDER_STATUS
.
READY_DELEVED_ORDER
||
page_type
===
PURCHASE_ORDER_STATUS
.
READY_RETURN_DOCUMENT
)
{
// 确认手工收货
if
(
formData
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
)
{
setConfirmVisible
(
true
)
return
;
}
handleSubmit
({})
setBtnLoading
(
true
)
return
;
...
...
@@ -159,6 +168,8 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
payRef
.
current
.
setVisible
(
true
)
}
// 确认电子合同
if
(
page_type
===
PURCHASE_ORDER_STATUS
.
READY_CONFIRM_ELECTRON_ORDER
)
{
if
(
!
formData
.
electronicContractUrl
)
{
...
...
@@ -175,24 +186,29 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
return
null
}
let
text
=
''
switch
(
page_typ
e
)
{
case
P
URCHASE_ORDER_STATUS
.
READY_CONFIRM_ELECTRON
_ORDER
:
{
switch
(
formData
.
interiorStat
e
)
{
case
P
urchaseOrderInsideWorkState
.
SUBMIT_FINISH
_ORDER
:
{
text
=
'确认电子合同'
break
;
}
case
P
URCHASE_ORDER_STATUS
.
READY_PAY_ORDER
:
{
case
P
urchaseOrderInsideWorkState
.
CONFIRM_ELECTRONIC
:
{
text
=
'去支付'
break
;
}
case
P
URCHASE_ORDER_STATUS
.
READY_DELEVED_ORDER
:
{
case
P
urchaseOrderInsideWorkState
.
CONFIRM_RECEIPT
:
{
text
=
'去确认收货'
break
;
}
case
P
URCHASE_ORDER_STATUS
.
READY_RETURN_DOCUMENT
:
{
case
P
urchaseOrderInsideWorkState
.
FILLING_ORDER
:
{
text
=
'确认归档'
break
}
case
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
:
{
text
=
'确认手工收货'
break
}
default
:
{
text
=
'提交审核'
break
;
...
...
@@ -233,6 +249,16 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
approvedActions
.
submit
()
}
const
handleConfirm
=
async
()
=>
{
console
.
log
(
'确认收货'
)
const
{
code
}
=
await
PublicApi
.
postOrderManualConfirmReceipt
({
orderId
:
formData
.
id
})
if
(
code
===
1000
)
{
history
.
goBack
()
}
}
const
editableProductTable
=
pageStatus
!==
PageStatus
.
PREVIEW
return
formData
?
(
<
div
>
...
...
@@ -328,6 +354,36 @@ const CommonOrderDetail: React.FC<CommonOrderDetailProps> = (props) => {
<
OrderElectronModal
currentRef=
{
electronRef
}
/>
<
Modal
title=
'收货信息'
onOk=
{
handleConfirm
}
onCancel=
{
()
=>
setConfirmVisible
(
false
)
}
visible=
{
confirmVisible
}
>
{
formData
&&
<>
<
Row
>
<
Col
span=
{
6
}
>
发货地址:
</
Col
>
<
Col
>
{
formData
.
name
}
</
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
>
发货时间:
</
Col
>
<
Col
>
{
moment
(
formData
.
deliverTime
).
format
(
'YYYY-MM-DD'
)
}
</
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
>
物流单号:
</
Col
>
<
Col
>
{
formData
.
deliverNo
}
</
Col
>
</
Row
>
<
Row
>
<
Col
span=
{
6
}
>
物流公司:
</
Col
>
<
Col
>
{
formData
.
logisticsCompany
}
</
Col
>
</
Row
>
</>
}
</
Modal
>
</
OrderDetailContext
.
Provider
>
</
div
>
)
:
null
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/model/useSelfTable.tsx
View file @
5e3339df
...
...
@@ -91,7 +91,7 @@ export const useSelfTable = () => {
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
CONFIRM_RECEIPT
&&
{
(
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
CONFIRM_RECEIPT
||
record
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
)
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
</>
...
...
src/pages/transaction/saleOrder/orderPreview/components/orderHandDeleve/index.tsx
0 → 100644
View file @
5e3339df
import
React
,
{
useContext
,
useRef
,
useEffect
}
from
'react'
import
{
Modal
,
Button
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
{
createFormActions
,
ISchema
}
from
'@formily/antd'
import
ModalForm
from
'@/components/ModalForm'
import
{
history
}
from
'umi'
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
import
{
PublicApi
}
from
'@/services/api'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
{
OrderDetailContext
}
from
'../../context'
import
moment
from
'moment'
export
interface
OrderHandDeleveModalProps
{
currentRef
:
any
}
const
schemaActions
=
createFormActions
()
const
schema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
NO_SUBMIT
:
{
type
:
'object'
,
"x-component"
:
"mega-layout"
,
"x-component-props"
:
{
labelAlign
:
'left'
,
labelCol
:
6
},
properties
:
{
addresId
:
{
type
:
'string'
,
enum
:
[],
title
:
'发货地址'
,
"x-rules"
:
[
{
message
:
'请选择发货地址'
,
required
:
true
}
]
},
deliverTime
:
{
type
:
'string'
,
"x-component"
:
'date'
,
title
:
'发货日期'
,
"x-rules"
:
[
{
message
:
'请选择发货日期'
,
required
:
true
}
],
"x-mega-props"
:
{
full
:
true
}
},
deliverNo
:
{
type
:
'string'
,
title
:
'发货单号'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入发货单号'
},
{
limitByte
:
true
,
maxByte
:
20
},
]
},
logisticsCompanyId
:
{
type
:
'string'
,
enum
:
[],
title
:
'物流公司'
,
"x-rules"
:
[
{
message
:
'请选择物流公司'
,
required
:
true
}
]
},
name
:
{
type
:
'string'
,
display
:
false
},
logisticsCompany
:
{
type
:
'string'
,
display
:
false
}
}
}
}
}
const
OrderHandDeleveModal
:
React
.
FC
<
OrderHandDeleveModalProps
>
=
(
props
)
=>
{
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
dataRef
=
useRef
<
any
>
({})
const
handleSubmit
=
async
(
value
)
=>
{
const
params
=
{
...
value
,
orderId
:
data
.
id
,
deliverTime
:
moment
(
value
.
deliverTime
).
valueOf
()
}
const
{
code
}
=
await
PublicApi
.
postOrderManualDelivery
(
params
)
if
(
code
===
1000
)
{
history
.
goBack
()
}
}
const
handleConfirm
=
()
=>
{
schemaActions
.
submit
()
}
return
(
<
ModalForm
modalTitle=
'手工发货'
previewPlaceholder=
' '
currentRef=
{
props
.
currentRef
}
schema=
{
schema
}
actions=
{
schemaActions
}
onSubmit=
{
handleSubmit
}
confirm=
{
handleConfirm
}
initialValues=
{
{
deliverTime
:
moment
().
format
(
'YYYY-MM-DD'
)
}
}
effects=
{
(
$
,
actions
)
=>
{
useAsyncSelect
(
'addresId'
,
async
()
=>
(
await
PublicApi
.
getLogisticsSelectListShipperAddress
()).
data
,
[
'fullAddress'
,
'id'
])
useAsyncSelect
(
'logisticsCompanyId'
,
async
()
=>
(
await
PublicApi
.
getLogisticsSelectListCompany
()).
data
,
[
'name'
,
'id'
])
// 获取联动的select后续事件, 为了设置对应的name值
$
(
'requestAsyncSelect'
).
subscribe
(({
name
,
payload
})
=>
{
if
(
name
===
'addresId'
)
{
dataRef
.
current
.
addresId
=
payload
}
if
(
name
===
'logisticsCompanyId'
)
{
dataRef
.
current
.
logisticsCompanyId
=
payload
}
})
$
(
'onFieldInputChange'
,
'addresId'
).
subscribe
(({
value
})
=>
{
actions
.
setFieldValue
(
'name'
,
dataRef
.
current
.
addresId
.
find
(
v
=>
v
.
value
===
value
)?.
label
||
''
)
})
$
(
'onFieldInputChange'
,
'logisticsCompanyId'
).
subscribe
(({
value
})
=>
{
actions
.
setFieldValue
(
'logisticsCompany'
,
dataRef
.
current
.
logisticsCompanyId
.
find
(
v
=>
v
.
value
===
value
)?.
label
||
''
)
})
}
}
/>
)
}
OrderHandDeleveModal
.
defaultProps
=
{}
export
default
OrderHandDeleveModal
\ No newline at end of file
src/pages/transaction/saleOrder/orderPreview/index.tsx
View file @
5e3339df
...
...
@@ -23,6 +23,7 @@ import OrderDeleveRecord from './components/orderDeleveRecord'
import
OrderElectronModal
from
'./components/orderElectronModal'
import
ModalForm
from
'@/components/ModalForm'
import
{
createFormActions
}
from
'@formily/antd'
import
OrderHandDeleveModal
from
'./components/orderHandDeleve'
export
interface
CommonOrderDetailProps
{}
...
...
@@ -37,6 +38,7 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
page_type
=
Number
(
page_type
)
const
payResultVisible
=
useRef
<
any
>
({})
const
electronRef
=
useRef
<
any
>
({})
const
handDelevedRef
=
useRef
<
any
>
({})
const
[
payResultType
,
setPayResultType
]
=
useState
<
'default'
|
'preview'
>
(
'default'
)
useEffect
(()
=>
{
reloadFormData
()
...
...
@@ -169,6 +171,12 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
return
}
// 手工发货,需弹窗确认
if
(
formData
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
)
{
handDelevedRef
.
current
.
setVisible
(
true
)
return
;
}
// 一级审核, 二级审核, 确认订单 都需要通过弹窗确认后再提交
if
(
page_type
===
SALE_ORDER_STATUS
.
ONE_LEVEL_APPROVED_ORDER
||
page_type
===
SALE_ORDER_STATUS
.
TWO_LEVEL_APPROVED_ORDER
||
page_type
===
SALE_ORDER_STATUS
.
CONFIRM_ORDER
)
{
approvedRef
.
current
.
setVisible
(
true
)
...
...
@@ -205,6 +213,11 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
text
=
'确认归档'
break
}
case
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
:
{
text
=
'确认手工发货'
break
}
default
:
{
text
=
'提交审核'
break
;
...
...
@@ -229,7 +242,6 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
titleValue
:
formData
.
orderNo
}
:
null
console
.
log
(
'123'
)
return
formData
?
(
<
div
>
<
OrderDetailContext
.
Provider
value=
{
formContext
}
>
...
...
@@ -265,6 +277,9 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
<
OrderElectronModal
currentRef=
{
electronRef
}
/>
<
OrderHandDeleveModal
currentRef=
{
handDelevedRef
}
/>
<
OrderPayResultModal
currentRef=
{
payResultVisible
}
type=
{
payResultType
}
/>
{
/* 提交时触发的弹窗集合 */
}
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
View file @
5e3339df
...
...
@@ -91,7 +91,7 @@ export const useSelfTable = () => {
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* 支付结果确认到账= 待审核状态 */
}
{
record
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
CONFIRM_DELIVERY_ORDER
&&
{
(
record
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
CONFIRM_DELIVERY_ORDER
||
record
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
)
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
}
</>
...
...
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