Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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-admin
Commits
1bd2d0cc
Commit
1bd2d0cc
authored
Jul 30, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对接新订单列表和详情
parent
9f4d21ab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
241 additions
and
381 deletions
+241
-381
index.tsx
src/pages/orderSystem/index.tsx
+25
-108
index.tsx
...System/orderDetail/components/orderDeleveRecord/index.tsx
+53
-88
index.tsx
...derSystem/orderDetail/components/orderMergeInfo/index.tsx
+21
-40
index.tsx
...orderSystem/orderDetail/components/orderPayTabs/index.tsx
+9
-9
index.tsx
...System/orderDetail/components/orderProductTable/index.tsx
+87
-96
index.tsx
...tem/orderDetail/components/orderTransformRecord/index.tsx
+14
-16
index.tsx
src/pages/orderSystem/orderDetail/index.tsx
+32
-24
No files found.
src/pages/orderSystem/index.tsx
View file @
1bd2d0cc
import
React
,
{
useRef
,
useState
}
from
'react'
import
{
Card
,
Button
,
Modal
}
from
'antd'
import
React
,
{
useRef
}
from
'react'
import
{
Card
,
Button
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
PurchaseOrderOutWorkStateTexts
,
PurchaseOrderInsideWorkStateTexts
}
from
'@/constants'
import
{
ORDER_TYPE
}
from
'@/constants'
import
StatusColors
from
'./components/StatusColors'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
createFormActions
,
ISchema
}
from
'@formily/antd'
...
...
@@ -19,24 +18,6 @@ const formActions = createFormActions();
const
tableListSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
// orderNo: {
// type: 'string',
// "x-component": 'SearchFilter',
// 'x-component-props': {
// placeholder: '请输入订单编号',
// align: 'flex-end',
// },
// },
// [FORM_FILTER_PATH]: {
// type: 'object',
// 'x-component': 'flex-layout',
// 'x-component-props': {
// inline: true,
// colStyle: {
// marginLeft: 20
// }
// },
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
...
...
@@ -78,27 +59,26 @@ const tableListSchema: ISchema = {
},
properties
:
{
orderThe
:
{
digest
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
"
supplyMembers
Name"
:
{
"
vendorMember
Name"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入供应会员名称'
}
},
"
m
emberName"
:
{
"
buyerM
emberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]"
:
{
type
:
'array'
,
"x-component"
:
'DateRangePickerUnix'
,
"[startDate,endDate]"
:
{
type
:
'daterange'
,
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
...
...
@@ -120,30 +100,27 @@ export const baseOrderListColumns: any[] = [
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
<
EyePreview
url=
{
`/orderSystem/detail?id=${record.id}`
}
>
render
:
(
text
,
record
)
=>
<
EyePreview
url=
{
`/orderSystem/detail?id=${record.orderId}`
}
>
{
text
}
</
EyePreview
>
}
</
EyePreview
>
},
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'
orderThe
'
,
key
:
'
orderThe
'
,
dataIndex
:
'
digest
'
,
key
:
'
digest
'
,
},
{
title
:
'采购会员'
,
align
:
'center'
,
dataIndex
:
'
m
emberName'
,
key
:
'
m
emberName'
,
dataIndex
:
'
buyerM
emberName'
,
key
:
'
buyerM
emberName'
,
},
{
title
:
'供应会员'
,
align
:
'center'
,
dataIndex
:
'
supplyMembers
Name'
,
key
:
'
supplyMembers
Name'
,
dataIndex
:
'
vendorMember
Name'
,
key
:
'
vendorMember
Name'
,
},
{
title
:
'下单时间'
,
...
...
@@ -155,65 +132,37 @@ export const baseOrderListColumns: any[] = [
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'
sumPrice
'
,
key
:
'
sumPrice
'
,
render
:
(
t
,
r
)
=>
(
r
.
type
===
7
||
r
.
t
ype
===
8
)
?
t
:
'¥'
+
t
dataIndex
:
'
amount
'
,
key
:
'
amount
'
,
render
:
(
t
,
r
)
=>
(
r
.
orderType
===
7
||
r
.
orderT
ype
===
8
)
?
t
:
'¥'
+
t
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
(
text
)
=>
ORDER_TYPE
[
text
],
// 1.询价采购2.需求采购3.现货采购4.集采5.渠道直采6.渠道现货7.积分兑换8.渠道积分兑换
filters
:
[
{
text
:
'询价采购'
,
value
:
1
},
{
text
:
'需求采购'
,
value
:
2
},
{
text
:
'现货采购'
,
value
:
3
},
{
text
:
'集采'
,
value
:
4
},
{
text
:
'渠道直采'
,
value
:
5
},
{
text
:
'渠道现货'
,
value
:
6
},
{
text
:
'积分兑换'
,
value
:
7
},
{
text
:
'渠道积分兑换'
,
value
:
8
},
],
onFilter
:
(
value
,
record
)
=>
value
===
record
.
type
,
dataIndex
:
'orderTypeName'
,
key
:
'orderTypeName'
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'out'
/>,
filters
:
Object
.
entries
(
PurchaseOrderOutWorkStateTexts
).
map
(([
key
,
value
])
=>
({
text
:
value
,
value
:
Number
(
key
)})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
externalState
,
dataIndex
:
'outerStatusName'
,
key
:
'outerStatusName'
,
},
// {
// title: '内部状态',
// align: 'center',
// dataIndex: 'interiorState',
// key: 'interiorState',
// render: (text) => <StatusColors status={text} type='inside'/>,
// filters: Object.entries(PurchaseOrderInsideWorkStateTexts).map(([key, value]) => ({text: value, value: Number(key)})),
// onFilter: (value, record) => value === record.interiorState,
// },
]
// 销售订单查询
export
interface
SaleOrderProps
{
}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrderPlatform
OrderList
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrderPlatform
ManagePage
(
params
)
return
data
}
// 最后一步开始调试 TODO
const
SaleOrder
:
React
.
FC
<
SaleOrderProps
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({})
const
secondColumns
:
any
[]
=
baseOrderListColumns
.
concat
([
])
const
secondColumns
:
any
[]
=
baseOrderListColumns
.
concat
([])
const
controllerBtns
=
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
...
...
@@ -244,38 +193,6 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}
}
/>
}
// formilyLayouts={{
// justify: 'space-between'
// }}
// formilyChilds={{
// layouts: {
// order: 2
// },
// children: <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
// }}
// formilyProps={{
// ctx: {
// inline: false,
// schema: tableListSchema,
// effects: ($, actions) => {
// useStateFilterSearchLinkageEffect(
// $,
// actions,
// 'orderNo',
// FORM_FILTER_PATH,
// );
// },
// components: {
// DateRangePicker: DatePicker.RangePicker,
// DateRangePickerUnix,
// Submit
// }
// },
// layouts: {
// order: 3,
// span: 16
// }
// }}
/>
</
Card
>
}
...
...
src/pages/orderSystem/orderDetail/components/orderDeleveRecord/index.tsx
View file @
1bd2d0cc
...
...
@@ -19,9 +19,9 @@ const outOrderCols: any[] = [
},
{
title
:
'商品名称'
,
dataIndex
:
'
productN
ame'
,
dataIndex
:
'
n
ame'
,
align
:
'center'
,
key
:
'
productN
ame'
,
key
:
'
n
ame'
,
},
{
title
:
'品类'
,
...
...
@@ -43,28 +43,28 @@ const outOrderCols: any[] = [
},
{
title
:
'单价'
,
dataIndex
:
'
unitP
rice'
,
dataIndex
:
'
p
rice'
,
align
:
'center'
,
key
:
'
unitP
rice'
,
key
:
'
p
rice'
,
},
{
title
:
'采购数量'
,
dataIndex
:
'
purchaseCount
'
,
dataIndex
:
'
quantity
'
,
align
:
'center'
,
key
:
'
purchaseCount
'
,
key
:
'
quantity
'
,
},
{
title
:
'含税'
,
dataIndex
:
'
no
'
,
dataIndex
:
'
tax
'
,
align
:
'center'
,
key
:
'
no
'
,
render
:
(
)
=>
'是
'
key
:
'
tax
'
,
render
:
(
t
)
=>
t
?
'是'
:
'否
'
},
{
title
:
'金额'
,
dataIndex
:
'
price
'
,
dataIndex
:
'
amount
'
,
align
:
'center'
,
key
:
'
price
'
,
key
:
'
amount
'
,
},
{
title
:
'已发货'
,
...
...
@@ -74,21 +74,21 @@ const outOrderCols: any[] = [
},
{
title
:
'未发货'
,
dataIndex
:
'
notDelivered
'
,
dataIndex
:
'
leftCount
'
,
align
:
'center'
,
key
:
'
notDelivered
'
,
key
:
'
leftCount
'
,
},
{
title
:
'已收货'
,
dataIndex
:
'
goodsR
eceived'
,
dataIndex
:
'
r
eceived'
,
align
:
'center'
,
key
:
'
goodsR
eceived'
,
key
:
'
r
eceived'
,
},
{
title
:
'差异数量'
,
dataIndex
:
'differ
ence
Count'
,
dataIndex
:
'differCount'
,
align
:
'center'
,
key
:
'differ
ence
Count'
,
key
:
'differCount'
,
},
]
...
...
@@ -102,9 +102,9 @@ const sideChildrenCols: any[] = [
},
{
title
:
'商品名称'
,
dataIndex
:
'
productN
ame'
,
dataIndex
:
'
n
ame'
,
align
:
'center'
,
key
:
'
productN
ame'
,
key
:
'
n
ame'
,
},
{
title
:
'品类'
,
...
...
@@ -126,51 +126,51 @@ const sideChildrenCols: any[] = [
},
{
title
:
'采购数量'
,
dataIndex
:
'
purchaseCount
'
,
dataIndex
:
'
quantity
'
,
align
:
'center'
,
key
:
'
purchaseCount
'
,
key
:
'
quantity
'
,
},
{
title
:
'发货数量'
,
dataIndex
:
'deliver
GoodsCount
'
,
dataIndex
:
'deliver
ed
'
,
align
:
'center'
,
key
:
'deliver
GoodsCount
'
,
key
:
'deliver
ed
'
,
},
{
title
:
'
入库
数量'
,
dataIndex
:
'
storageCount
'
,
title
:
'
收货
数量'
,
dataIndex
:
'
received
'
,
align
:
'center'
,
key
:
'
storageCount
'
,
key
:
'
received
'
,
},
{
title
:
'差异数量'
,
dataIndex
:
'differ
ence
Count'
,
dataIndex
:
'differCount'
,
align
:
'center'
,
key
:
'differ
ence
Count'
,
key
:
'differCount'
,
},
]
// 订单发货记录
const
OrderDeleveRecord
:
React
.
FC
<
OrderDeleveRecordProps
>
=
(
props
)
=>
{
const
{
data
,
reloadFormData
}
=
useContext
(
OrderDetailContext
)
const
{
orderReceivingStatisticsResponses
,
orderDeliveryDetailsResponse
s
}
=
data
const
{
deliveries
,
deliveryDetail
s
}
=
data
const
sideOrderCols
:
any
[]
=
[
{
title
:
'收货批次'
,
dataIndex
:
'
deliveryBatch
'
,
dataIndex
:
'
batchNo
'
,
align
:
'center'
,
key
:
'
deliveryBatch
'
key
:
'
batchNo
'
},
{
title
:
'收货单号'
,
dataIndex
:
'
delivery
No'
,
dataIndex
:
'
receipt
No'
,
align
:
'center'
,
key
:
'
delivery
No'
,
key
:
'
receipt
No'
,
},
{
title
:
'收货时间'
,
dataIndex
:
'
delivery
Time'
,
dataIndex
:
'
receipt
Time'
,
align
:
'center'
,
key
:
'
delivery
Time'
,
key
:
'
receipt
Time'
,
render
:
text
=>
formatTimeString
(
text
)
},
{
...
...
@@ -181,88 +181,54 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
},
{
title
:
'物流公司'
,
dataIndex
:
'
logisticsCompanyName
'
,
dataIndex
:
'
company
'
,
align
:
'center'
,
key
:
'
logisticsCompanyName
'
key
:
'
company
'
},
{
title
:
'
入库
单号'
,
dataIndex
:
'
storage
No'
,
title
:
'
发货
单号'
,
dataIndex
:
'
delivery
No'
,
align
:
'center'
,
key
:
'
storage
No'
,
key
:
'
delivery
No'
,
},
{
title
:
'
入库
时间'
,
dataIndex
:
'
storag
eTime'
,
title
:
'
发货
时间'
,
dataIndex
:
'
creat
eTime'
,
align
:
'center'
,
key
:
'
storag
eTime'
,
key
:
'
creat
eTime'
,
render
:
text
=>
formatTimeString
(
text
)
},
{
title
:
'内部状态'
,
dataIndex
:
'interiorState'
,
align
:
'center'
,
key
:
'interiorState'
,
render
:
text
=>
<
StatusColors
type=
'deliveInside'
status=
{
text
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'ctl'
,
dataIndex
:
'innerStatusName'
,
align
:
'center'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
/* todo 需根据内部状态判断显示哪个按钮 */
}
{
record
.
interiorState
===
DeliverySideState
.
CONFIRM_RECEIPT_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleReturn
(
record
)
}
>
确认回单
</
Button
>
}
{
record
.
interiorState
===
DeliverySideState
.
WAREHOUSE_ORDER
&&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认收货
</
Button
>
}
</>
key
:
'innerStatusName'
,
},
]
// 确认收货
const
handleConfirm
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
await
PublicApi
.
postOrderConfirmReceipt
(
params
)
reloadFormData
&&
reloadFormData
()
}
// 确认回单
const
handleReturn
=
async
(
record
)
=>
{
const
params
=
{
orderId
:
record
.
orderId
,
id
:
record
.
id
}
await
PublicApi
.
postOrderReceiptOrderConfirmed
(
params
)
reloadFormData
&&
reloadFormData
()
}
return
(
<>
{
(
orderReceivingStatisticsResponses
?.
length
>
0
||
orderDeliveryDetailsResponse
s
?.
length
>
0
)
&&
(
deliveries
?.
length
>
0
||
deliveryDetail
s
?.
length
>
0
)
&&
<
MellowCard
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
id=
'deleveBox'
>
<
Tabs
defaultActiveKey=
"2"
animated=
{
false
}
>
{
orderReceivingStatisticsRespons
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'订单收货统计'
key=
"1"
>
deliveri
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'订单收货统计'
key=
"1"
>
<
Table
columns=
{
outOrderCols
}
dataSource=
{
orderReceivingStatisticsRespons
es
}
dataSource=
{
deliveri
es
}
pagination=
{
false
}
rowKey=
"productId"
/>
</
Tabs
.
TabPane
>
}
{
orderDeliveryDetailsResponse
s
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'订单收货明细'
key=
"2"
>
deliveryDetail
s
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'订单收货明细'
key=
"2"
>
<
NestTable
NestColumns=
{
[
sideOrderCols
,
sideChildrenCols
]
}
rowKey=
'
id
'
childrenDataKey=
'
orderDeliveryProducts
'
dataSource=
{
orderDeliveryDetailsResponse
s
}
rowKey=
'
batchNo
'
childrenDataKey=
'
productId
'
dataSource=
{
deliveryDetail
s
}
/>
</
Tabs
.
TabPane
>
}
...
...
@@ -275,4 +241,4 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
OrderDeleveRecord
.
defaultProps
=
{}
export
default
OrderDeleveRecord
\ No newline at end of file
export
default
OrderDeleveRecord
src/pages/orderSystem/orderDetail/components/orderMergeInfo/index.tsx
View file @
1bd2d0cc
...
...
@@ -11,22 +11,22 @@ import cx from 'classnames'
export
interface
OrderMergeInfoProps
{
}
const
payInfo
=
[
{
title
:
'交付日期'
,
name
:
'deliver
yTim
e'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'交付日期'
,
name
:
'deliver
Dat
e'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'交付地址'
,
name
:
'
deliveryAddressInfo
'
,
render
:
(
_
,
record
)
=>
title
:
'交付地址'
,
name
:
'
address
'
,
render
:
(
_
,
record
)
=>
<
div
>
<
Row
>
<
Col
>
{
record
.
receiverNam
e
}
</
Col
>
<
Col
>
{
record
.
consigne
e
}
</
Col
>
<
Col
>
/
</
Col
>
<
Col
>
{
record
.
phone
}
</
Col
>
{
record
.
isDefault
&&
<
Col
style=
{
{
marginLeft
:
6
}
}
><
Tag
color=
'default'
>
默认
</
Tag
></
Col
>
}
{
record
.
defaultConsignee
&&
<
Col
style=
{
{
marginLeft
:
6
}
}
><
Tag
color=
'default'
>
默认
</
Tag
></
Col
>
}
</
Row
>
<
div
style=
{
{
color
:
'#909399'
}
}
>
{
record
.
fullA
ddress
}
</
div
>
<
div
style=
{
{
color
:
'#909399'
}
}
>
{
record
.
areaName
+
''
+
record
.
a
ddress
}
</
div
>
</
div
>
},
{
title
:
'提货方式'
,
name
:
'deliveryType'
,
render
:
(
text
)
=>
DELIVERY_TYPE
[
text
]
},
{
title
:
'自提地址'
,
name
:
'pickUpAddress'
},
{
title
:
'运费'
,
name
:
'freight'
}
//
{ title: '提货方式', name: 'deliveryType', render: (text) => DELIVERY_TYPE[text] },
//
{ title: '自提地址', name: 'pickUpAddress' },
//
{ title: '运费', name: 'freight' }
]
...
...
@@ -42,19 +42,15 @@ const RenderCard = ({ infoList, dataSource }) => infoList.map(v => dataSource[v.
const
OrderMergeInfo
:
React
.
FC
<
OrderMergeInfoProps
>
=
(
props
)
=>
{
const
orderDetailCtx
=
useContext
(
OrderDetailContext
)
const
[
isModalVisible
,
setIsModalVisible
]
=
useState
(
false
)
// const address = useMemo(async () => {
// const { data } = await PublicApi.getLogisticsSelectListReceiverAddress()
// return data
// }, [])
const
{
data
,
ctl
}
=
orderDetailCtx
const
{
theInvoiceInfo
}
=
data
const
{
invoice
}
=
data
const
otherInfo
=
[
{
title
:
'发票'
,
name
:
'
theInvoiceInfo
'
,
render
:
item
=>
<
div
className=
{
style
.
invoice_list_item
}
>
{
title
:
'发票'
,
name
:
'
invoice
'
,
render
:
item
=>
<
div
className=
{
style
.
invoice_list_item
}
>
<
div
className=
{
style
.
invoice_list_item_content
}
>
<
div
className=
{
cx
(
style
.
invoice_list_item_content_tag
,
item
.
kind
!==
1
?
style
.
special
:
''
)
}
>
{
item
.
kind
===
1
?
'增值税普通发票'
:
'增值税专用发票'
}
</
div
>
<
div
className=
{
cx
(
style
.
invoice_list_item_content_tag
,
item
.
invoiceType
!==
1
?
style
.
special
:
''
)
}
>
{
item
.
invoiceType
===
1
?
'增值税普通发票'
:
'增值税专用发票'
}
</
div
>
<
div
className=
{
style
.
invoice_list_item_content_name
}
>
<
div
>
{
item
.
invoiceT
itle
}
</
div
>
<
div
>
{
item
.
t
itle
}
</
div
>
<
div
>
{
item
.
taxNo
}
</
div
>
</
div
>
</
div
>
...
...
@@ -69,27 +65,12 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
{
title
:
'其他要求'
,
name
:
'restsRequire'
},
]
// useEffect(() => {
// if (data.deliveryAddresId && !data.receiverName) {
// asyncSetAddress()
// }
// }, [data, address])
// const asyncSetAddress = async () => {
// const res = await address
// debugger
// ctl.setData({
// ...data,
// ...(res.find(v => v.id === data.deliveryAddresId) || {})
// })
// }
return
(
<>
<
Row
style=
{
{
marginTop
:
24
}
}
gutter=
{
24
}
>
<
Col
span=
{
data
.
orderModel
>
30
?
15
:
12
}
>
<
MellowCard
title=
'交易信息'
fullHeight
>
<
RenderCard
infoList=
{
payInfo
}
dataSource=
{
data
}
/>
<
RenderCard
infoList=
{
payInfo
}
dataSource=
{
data
.
consignee
}
/>
</
MellowCard
>
</
Col
>
<
Col
span=
{
data
.
orderModel
>
30
?
9
:
6
}
>
...
...
@@ -121,14 +102,14 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
</
Row
>
<
Modal
title=
"发票信息"
visible=
{
isModalVisible
}
onOk=
{
()
=>
setIsModalVisible
(
false
)
}
onCancel=
{
()
=>
setIsModalVisible
(
false
)
}
>
<
Row
gutter=
{
[
0
,
10
]
}
style=
{
{
fontSize
:
14
}
}
>
<
Col
span=
{
4
}
>
开具类型:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
type
===
1
?
"企业"
:
"个人"
}
</
Col
>
<
Col
span=
{
4
}
>
发票种类:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
kind
===
1
?
"增值税普通发票"
:
"增值税专用发票"
}
</
Col
>
<
Col
span=
{
4
}
>
发票抬头:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
invoiceT
itle
}
</
Col
>
<
Col
span=
{
4
}
>
纳税号:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
taxNo
}
</
Col
>
<
Col
span=
{
4
}
>
开户行:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
bankOfDeposit
}
</
Col
>
<
Col
span=
{
4
}
>
账号:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
account
}
</
Col
>
<
Col
span=
{
4
}
>
地址:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
addres
}
</
Col
>
<
Col
span=
{
4
}
>
电话:
</
Col
><
Col
span=
{
20
}
>
{
theInvoiceInfo
?.
tel
}
</
Col
>
<
Col
span=
{
4
}
>
开具类型:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
invoiceKind
===
1
?
"企业"
:
"个人"
}
</
Col
>
<
Col
span=
{
4
}
>
发票种类:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
invoiceType
===
1
?
"增值税普通发票"
:
"增值税专用发票"
}
</
Col
>
<
Col
span=
{
4
}
>
发票抬头:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
t
itle
}
</
Col
>
<
Col
span=
{
4
}
>
纳税号:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
taxNo
}
</
Col
>
<
Col
span=
{
4
}
>
开户行:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
bank
}
</
Col
>
<
Col
span=
{
4
}
>
账号:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
account
}
</
Col
>
<
Col
span=
{
4
}
>
地址:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
addres
}
</
Col
>
<
Col
span=
{
4
}
>
电话:
</
Col
><
Col
span=
{
20
}
>
{
invoice
?.
phone
}
</
Col
>
</
Row
>
</
Modal
>
</>
...
...
src/pages/orderSystem/orderDetail/components/orderPayTabs/index.tsx
View file @
1bd2d0cc
...
...
@@ -64,14 +64,14 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
// 简单流程为24
const
processEnum
=
data
.
processEnum
useEffect
(()
=>
{
PublicApi
.
getPayPayWayList
({
memberId
:
data
.
supplyMembersId
,
memberRoleId
:
data
.
supplyMembersRoleId
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setPaylist
(
data
)
}
})
},
[])
//
useEffect(() => {
//
PublicApi.getPayPayWayList({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => {
//
const { code, data } = res
//
if (code === 1000) {
//
setPaylist(data)
//
}
//
})
//
}, [])
return
(
<
Row
gutter=
{
24
}
style=
{
{
marginTop
:
24
}
}
>
...
...
@@ -79,7 +79,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
<
MellowCard
bordered=
{
false
}
fullHeight
>
{
/* <Row gutter={24}> */
}
<
Tabs
defaultActiveKey=
'1'
>
{
data
.
payment
InformationResponses
&&
data
.
paymentInformationResponse
s
.
map
(
v
=>
<
TabPane
key=
{
v
.
id
}
tab=
{
<
TabHeader
dataSource=
{
v
}
/>
}
>
{
data
.
payment
s
&&
data
.
payment
s
.
map
(
v
=>
<
TabPane
key=
{
v
.
id
}
tab=
{
<
TabHeader
dataSource=
{
v
}
/>
}
>
<
Row
>
<
Col
className=
{
style
.
fontGray
}
span=
{
4
}
>
支付环节:
</
Col
>
<
Col
>
{
v
.
payNode
}
</
Col
>
...
...
src/pages/orderSystem/orderDetail/components/orderProductTable/index.tsx
View file @
1bd2d0cc
...
...
@@ -84,10 +84,10 @@ const warehouseColumns: any[] = [
const
modalPriceActions
=
createFormActions
()
// 总计金额联动框
export
const
MoneyTotalBox
=
({
dataSource
,
isEditData
})
=>
{
const
{
orderProductRequests
=
[],
receiverAddressId
,
orderModel
,
sumPrice
,
amount
,
freigh
t
}
=
dataSource
||
{}
const
{
product
,
orderModel
,
sumPrice
,
amoun
t
}
=
dataSource
||
{}
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
const
sum
=
amount
||
orderProductReques
ts
.
reduce
((
prev
,
next
)
=>
prev
+
Number
((
next
.
price
||
0
)),
0
)
const
sum
=
amount
||
product
.
produc
ts
.
reduce
((
prev
,
next
)
=>
prev
+
Number
((
next
.
price
||
0
)),
0
)
const
modelRef
=
useRef
<
any
>
({})
const
[
freePrice
,
setFreePrice
]
=
useState
<
number
>
(
0
)
const
handleSetting
=
()
=>
{
...
...
@@ -99,30 +99,33 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
modelRef
.
current
.
setVisible
(
false
)
}
useEffect
(()
=>
{
// 存在商品 并且有选择收货地址,则开始计算运费
if
(
orderProductRequests
&&
orderProductRequests
.
length
>
0
&&
receiverAddressId
)
{
// 筛选配送方式为物流的商品并且使用了运费模板
const
logsiticsDataMaps
=
orderProductRequests
.
filter
(
v
=>
v
.
logistics
&&
v
.
logistics
.
useTemplate
&&
v
.
logistics
.
deliveryType
===
1
)
if
(
logsiticsDataMaps
.
length
>
0
)
{
PublicApi
.
postLogisticsFreightRemoteAddDetail
({
orderProductList
:
logsiticsDataMaps
.
map
(
v
=>
({
templateId
:
v
.
templateId
,
weight
:
v
.
weight
})),
receiverAddressId
},
{
ttl
:
10
*
1000
,
useCache
:
true
,
ctlType
:
'none'
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFreePrice
(
res
.
data
)
}
})
}
}
},
[
orderProductRequests
])
// useEffect(() => {
// // 存在商品 并且有选择收货地址,则开始计算运费
// if (orderProductRequests && orderProductRequests.length > 0 && receiverAddressId) {
// // 筛选配送方式为物流的商品并且使用了运费模板
// const logsiticsDataMaps = orderProductRequests.filter(v => v.logistics && v.logistics.useTemplate && v.logistics.deliveryType === 1)
// if (logsiticsDataMaps.length > 0) {
// PublicApi.postLogisticsFreightRemoteAddDetail({
// orderProductList: logsiticsDataMaps.map(v => ({
// templateId: v.templateId,
// weight: v.weight
// })),
// receiverAddressId
// }, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
// if (res.code === 1000) {
// setFreePrice(res.data)
// }
// })
// }
// }
// }, [orderProductRequests])
const
{
productAmount
,
totalAmount
,
freight
}
=
product
return
<
RowStyle
>
<
Col
span=
{
2
}
>
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
sum
}
</
div
>
<
div
>
{
productAmount
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
运费
{
isEditData
&&
<
SettingOutlined
style=
{
{
marginLeft
:
8
}
}
onClick=
{
handleSetting
}
/>
}
</
div
>
...
...
@@ -130,7 +133,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
{
creditsCommodity
?
'总计所需积分'
:
'总计金额'
}
</
div
>
<
div
>
{
sumPrice
||
sum
+
freePrice
}
</
div
>
<
div
>
{
totalAmount
||
sum
+
freePrice
}
</
div
>
</
Col
>
<
ModalForm
modalTitle=
'设置运费'
...
...
@@ -168,21 +171,14 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
// 自提地址框
export
const
AddressPop
=
(
props
)
=>
{
const
{
pickInfo
=
null
,
children
}
=
props
let
receiveInfo
=
pickInfo
?.
render
&&
JSON
.
parse
(
pickInfo
.
render
)
return
pickInfo
&&
pickInfo
.
deliveryType
===
2
?
<
Space
>
return
pickInfo
&&
pickInfo
.
deliverType
===
2
?
<
Space
>
<
EnvironmentOutlined
style=
{
{
marginRight
:
8
}
}
/>
<
Popover
content=
{
<
Row
>
<
div
>
<
h3
><
EnvironmentOutlined
/>
自提地址
</
h3
>
{
/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */
}
{
receiveInfo
&&
<>
<
p
>
{
receiveInfo
.
shipperName
}
/
{
receiveInfo
.
phone
}
</
p
>
<
p
>
{
receiveInfo
.
provinceName
+
receiveInfo
.
cityName
+
receiveInfo
.
districtName
+
receiveInfo
.
address
}
</
p
>
</>
}
<
p
>
{
pickInfo
.
receiver
}
/
{
pickInfo
.
phone
}
</
p
>
<
p
>
{
pickInfo
.
address
}
</
p
>
</
div
>
</
Row
>
}
>
...
...
@@ -279,8 +275,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
const
OrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
(
props
)
=>
{
const
{
ctl
,
data
}
=
useContext
(
OrderDetailContext
)
const
{
page_type
}
=
usePageStatus
()
const
{
orderProductRequests
=
[],
orderModel
}
=
data
||
{}
const
{
product
,
orderModel
}
=
data
||
{}
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
const
[
warehouseVisible
,
setWarehouseVisible
]
=
useState
(
false
)
...
...
@@ -288,49 +283,48 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
warehouseRef
=
useRef
<
any
>
({})
// 判断是否可操作当前表格
const
isEditData
=
SALE_ORDER_STATUS
.
READY_APPROVED_ORDER
===
parseInt
(
page_type
)
const
isEditData
=
false
const
productComponents
=
{
body
:
{
row
:
EditableRow
,
cell
:
EditableCell
}
}
const
asyncGetMemberPrice
=
async
(
asyncData
:
any
[])
=>
{
return
await
Promise
.
all
(
asyncData
.
filter
(
v
=>
v
.
memberPrice
===
undefined
).
map
(
async
v
=>
{
const
{
code
,
data
}
=
await
PublicApi
.
getMemberManageUpperCreditParamGet
({
parentMemberId
:
v
.
memberId
,
parentMemberRoleId
:
v
.
memberRoleId
},
{
ttl
:
60
*
1000
,
useCache
:
true
})
return
code
===
1000
?
{
value
:
(
data
.
parameter
*
100
)
+
'%'
,
id
:
v
.
id
}
:
{
value
:
''
,
id
:
0
}
}
))
}
useEffect
(()
=>
{
// 过滤 会员折扣不存在的列表
const
hasPriceList
=
orderProductRequests
.
filter
(
v
=>
!
v
.
memberPrice
)
if
(
hasPriceList
.
length
>
0
)
{
asyncGetMemberPrice
(
hasPriceList
).
then
((
asyncData
)
=>
{
if
(
asyncData
.
length
>
0
)
{
const
newData
=
orderProductRequests
.
map
((
v
,
i
)
=>
{
if
(
!
v
.
memberPrice
)
{
v
.
memberPrice
=
asyncData
.
find
(
j
=>
j
.
id
===
v
.
id
)?.
value
||
0
}
return
v
})
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
})
}
})
}
},
[
orderProductRequests
])
// const asyncGetMemberPrice = async (asyncData: any[]) => {
// return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
// const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({
// parentMemberId: v.memberId,
// parentMemberRoleId: v.memberRoleId
// }, {ttl: 60 * 1000, useCache: true})
// return code === 1000 ? { value: (data.parameter * 100) + '%', id: v.id } : { value: '', id: 0 }
// }
// ))
// }
// useEffect(() => {
// // 过滤 会员折扣不存在的列表
// const hasPriceList = orderProductRequests.filter(v => !v.memberPrice)
// if (hasPriceList.length > 0) {
// asyncGetMemberPrice(hasPriceList).then((asyncData) => {
// if (asyncData.length > 0) {
// const newData = orderProductRequests.map((v, i) => {
// if (!v.memberPrice) {
// v.memberPrice = asyncData.find(j => j.id === v.id)?.value || 0
// }
// return v
// })
// ctl.setData({
// ...data,
// orderProductRequests: newData
// })
// }
// })
// }
// }, [orderProductRequests])
const
handleSave
=
row
=>
{
const
newData
=
[...
orderProductReques
ts
];
const
newData
=
[...
product
.
produc
ts
];
const
index
=
newData
.
findIndex
(
item
=>
row
.
key
===
item
.
key
);
const
item
=
newData
[
index
];
newData
.
splice
(
index
,
1
,
{
...
...
@@ -339,7 +333,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
});
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
product
:
{
products
:
newData
}
})
};
...
...
@@ -351,15 +345,15 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const
productInfoColumns
:
any
[]
=
[
{
title
:
'ID'
,
dataIndex
:
'
i
d'
,
dataIndex
:
'
productI
d'
,
align
:
'center'
,
key
:
'
i
d'
,
key
:
'
productI
d'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'
productN
ame'
,
dataIndex
:
'
n
ame'
,
align
:
'center'
,
key
:
'
productN
ame'
,
key
:
'
n
ame'
,
},
{
title
:
'品类'
,
...
...
@@ -388,39 +382,37 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
},
{
title
:
'会员折扣'
,
dataIndex
:
'
memberPrice
'
,
dataIndex
:
'
discount
'
,
align
:
'center'
,
key
:
'
memberPrice
'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
10000
/
100
+
'%'
)
:
null
key
:
'
discount
'
,
render
:
(
text
,
record
)
=>
(
text
+
'%'
)
},
{
title
:
creditsCommodity
?
'兑换数量'
:
'采购数量'
,
dataIndex
:
'
purchaseCount
'
,
dataIndex
:
'
quantity
'
,
align
:
'center'
,
key
:
'
purchaseCount
'
key
:
'
quantity
'
},
{
title
:
'含税'
,
dataIndex
:
'
none
'
,
dataIndex
:
'
tax
'
,
align
:
'center'
,
key
:
'
none
'
,
render
:
(
)
=>
'是
'
key
:
'
tax
'
,
render
:
(
t
)
=>
t
?
'是'
:
'否
'
},
{
title
:
creditsCommodity
?
'所需积分小计'
:
'金额'
,
dataIndex
:
'
money
'
,
dataIndex
:
'
amount
'
,
align
:
'center'
,
key
:
'
money
'
,
key
:
'
amount
'
,
},
// 接口调用
{
title
:
'配送方式'
,
dataIndex
:
'
logistics
'
,
dataIndex
:
'
deliverType
'
,
align
:
'center'
,
key
:
'logistics'
,
// render: (text) => text && text.deliveryType && DELIVERY_TYPE[text.deliveryType]
render
:
(
text
)
=>
(
text
&&
text
.
deliveryType
&&
text
.
deliveryType
===
2
)
?
<
AddressPop
pickInfo=
{
text
}
>
{
DELIVERY_TYPE
[
text
.
deliveryType
]
}
</
AddressPop
>
:
DELIVERY_TYPE
[
text
?.
deliveryType
]
key
:
'deliverType'
,
render
:
(
text
,
record
)
=>
(
text
&&
text
===
2
)
?
<
AddressPop
pickInfo=
{
record
}
>
{
record
.
deliverTypeName
}
</
AddressPop
>
:
record
.
deliverTypeName
},
{
title
:
'仓位库存扣减记录'
,
...
...
@@ -433,8 +425,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
]
const
fetchWarehouseData
=
useCallback
(
async
(
params
)
=>
{
// const { data } = await PublicApi.getWarehousePositionDeductionRecordList({...params, productId: String(checkProductId)})
const
{
data
}
=
await
PublicApi
.
getWarehousePlatformPositionDeductionRecordList
({...
params
,
productId
:
String
(
checkProductId
)})
const
{
data
}
=
await
PublicApi
.
getProductPlatformPositionDeductionRecordList
({...
params
,
productId
:
String
(
checkProductId
)})
return
data
},
[
checkProductId
])
...
...
@@ -457,9 +448,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
<
MellowCard
title=
'订单商品'
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
>
<
Table
columns=
{
columns
}
dataSource=
{
orderProductReques
ts
}
dataSource=
{
product
.
produc
ts
}
components=
{
productComponents
}
rowKey=
'
i
d'
rowKey=
'
productI
d'
pagination=
{
false
}
/>
<
MoneyTotalBox
dataSource=
{
data
}
isEditData=
{
isEditData
}
/>
...
...
src/pages/orderSystem/orderDetail/components/orderTransformRecord/index.tsx
View file @
1bd2d0cc
...
...
@@ -17,17 +17,15 @@ const outOrderCols: any[] = [
},
{
title
:
'操作角色'
,
dataIndex
:
'
r
oleName'
,
dataIndex
:
'
operatorR
oleName'
,
align
:
'center'
,
key
:
'
r
oleName'
,
key
:
'
operatorR
oleName'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
dataIndex
:
'stat
usNam
e'
,
align
:
'center'
,
key
:
'state'
,
render
:
text
=>
<
StatusColors
status=
{
text
}
type=
'transformOut'
/>
// @todo 需传递工作流状态重新render
key
:
'statusName'
,
},
{
title
:
'操作'
,
...
...
@@ -37,16 +35,16 @@ const outOrderCols: any[] = [
},
{
title
:
'操作时间'
,
dataIndex
:
'
operation
Time'
,
dataIndex
:
'
create
Time'
,
align
:
'center'
,
key
:
'
operation
Time'
,
key
:
'
create
Time'
,
render
:
time
=>
formatTimeString
(
time
)
},
{
title
:
'审核意见'
,
dataIndex
:
'
auditOpinion
'
,
dataIndex
:
'
remark
'
,
align
:
'center'
,
key
:
'
auditOpinion
'
,
key
:
'
remark
'
,
},
]
const
sideOrderCols
:
any
[]
=
[
...
...
@@ -104,28 +102,28 @@ const sideOrderCols: any[] = [
// 订单流转记录
const
OrderTransformRecord
:
React
.
FC
<
OrderTransformRecordProps
>
=
(
props
)
=>
{
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
externalProcurementOrderLogResponses
,
interiorProcurementOrderLogRespons
es
}
=
data
const
{
outerHistories
,
innerHistori
es
}
=
data
return
(
<>
{
(
externalProcurementOrderLogResponses
?.
length
>
0
||
interiorProcurementOrderLogRespons
es
?.
length
>
0
)
&&
(
outerHistories
?.
length
>
0
||
innerHistori
es
?.
length
>
0
)
&&
<
MellowCard
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
>
<
Tabs
defaultActiveKey=
"1"
animated=
{
false
}
>
{
externalProcurementOrderLogRespons
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'外部订单流转记录'
key=
"1"
>
outerHistori
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'外部订单流转记录'
key=
"1"
>
<
Table
columns=
{
outOrderCols
}
dataSource=
{
externalProcurementOrderLogRespons
es
}
dataSource=
{
outerHistori
es
}
pagination=
{
false
}
rowKey=
"id"
/>
</
Tabs
.
TabPane
>
}
{
in
teriorProcurementOrderLogRespons
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'内部订单流转记录'
key=
"2"
>
in
nerHistori
es
?.
length
>
0
&&
<
Tabs
.
TabPane
tab=
'内部订单流转记录'
key=
"2"
>
<
Table
columns=
{
sideOrderCols
}
dataSource=
{
in
teriorProcurementOrderLogRespons
es
}
dataSource=
{
in
nerHistori
es
}
pagination=
{
false
}
rowKey=
"id"
/>
...
...
src/pages/orderSystem/orderDetail/index.tsx
View file @
1bd2d0cc
import
React
,
{
useState
,
useEffect
,
use
Context
,
use
Ref
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
OrderDetailHeader
from
'../components/OrderDetailHeader'
import
{
Link
,
history
}
from
'umi'
import
{
orderTypeLabel
,
SALE_ORDER_STATUS
}
from
'./constant'
import
{
Link
}
from
'umi'
import
{
formatTimeString
}
from
'@/utils'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
PublicApi
}
from
'@/services/api'
import
AuditProcess
from
'@/components/AuditProcess'
import
{
findLastIndexFlowState
}
from
'@/utils'
import
OrderDetailWrapper
from
'../components/OrderDetailWrapper'
import
{
GlobalConfig
}
from
'@/global/config'
import
OrderProductTable
from
'./components/orderProductTable'
import
{
OrderDetailContext
}
from
'./context'
import
OrderMergeInfo
from
'./components/orderMergeInfo'
import
OrderTransformRecord
from
'./components/orderTransformRecord'
import
OrderPayTabs
from
'./components/orderPayTabs'
import
StatusColors
from
'../components/StatusColors'
import
OrderDeleveRecord
from
'./components/orderDeleveRecord'
export
interface
CommonOrderDetailProps
{}
...
...
@@ -22,8 +18,7 @@ export interface CommonOrderDetailProps {}
const
CommonOrderDetail
:
React
.
FC
<
CommonOrderDetailProps
>
=
(
props
)
=>
{
const
[
formData
,
setFormData
]
=
useState
<
any
>
(
null
)
let
{
id
,
pageStatus
,
page_type
=
SALE_ORDER_STATUS
.
READY_APPROVED_ORDER
,
orderNo
}
=
usePageStatus
()
page_type
=
Number
(
page_type
)
let
{
id
,
pageStatus
}
=
usePageStatus
()
const
payResultVisible
=
useRef
<
any
>
({})
const
[
payResultType
,
setPayResultType
]
=
useState
<
'default'
|
'preview'
>
(
'default'
)
useEffect
(()
=>
{
...
...
@@ -31,8 +26,8 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
},
[])
const
reloadFormData
=
()
=>
{
if
(
id
||
orderNo
)
{
PublicApi
.
getOrderPlatform
OrderDetails
({
id
,
orderNo
}).
then
(({
data
,
code
})
=>
{
if
(
id
)
{
PublicApi
.
getOrderPlatform
ManageDetail
({
orderId
:
id
}).
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
setFormData
(
data
)
}
...
...
@@ -52,14 +47,13 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
}
const
detailList
=
[
{
label
:
'对应报价单号'
,
name
:
'quot
ation
No'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'
orderThe
'
,
span
:
8
},
{
label
:
'供应会员'
,
name
:
'
supplyMembers
Name'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderMode
l'
,
span
:
8
,
render
:
text
=>
GlobalConfig
.
web
.
orderMode
.
find
(
v
=>
v
.
value
===
text
)?.
label
||
''
},
{
label
:
'订单类型'
,
name
:
'
type'
,
span
:
8
,
render
:
text
=>
orderTypeLabel
[
text
]
},
{
label
:
'对应报价单号'
,
name
:
'quot
e
No'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'
digest
'
,
span
:
8
},
{
label
:
'供应会员'
,
name
:
'
vendorMember
Name'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderMode
Name'
,
span
:
8
},
{
label
:
'订单类型'
,
name
:
'
orderTypeName'
,
span
:
8
},
{
label
:
'下单时间'
,
name
:
'createTime'
,
span
:
8
,
render
:
text
=>
formatTimeString
(
text
)
},
{
label
:
'外部状态'
,
name
:
'externalState'
,
span
:
8
,
render
:
text
=>
<
StatusColors
type=
'out'
status=
{
text
}
/>
},
// { label: '内部状态', name: 'purchaseOrderInteriorState', span: 8, render: text => <StatusColors type='saleInside' status={text}/> },
{
label
:
'外部状态'
,
name
:
'outerStatusName'
,
span
:
8
},
]
const
headerTiTle
=
formData
?
{
picName
:
'单'
,
...
...
@@ -74,13 +68,27 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
<
OrderDetailWrapper
>
<
div
className=
'gray-wrap'
>
{
/* 工作流进度 */
}
{
pageStatus
!==
PageStatus
.
ADD
&&
formData
&&
formData
.
externalWorkflowFlowRecordLogResponses
&&
<
AuditProcess
customTitleKey=
'operationalProcess'
customKey=
'state'
outerVerifyCurrent=
{
findLastIndexFlowState
(
formData
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
formData
.
interiorWorkflowFlowRecordLogResponses
)
}
outerVerifySteps=
{
formData
.
externalWorkflowFlowRecordLogResponses
||
null
}
innerVerifySteps=
{
formData
.
interiorWorkflowFlowRecordLogResponses
||
null
}
{
pageStatus
!==
PageStatus
.
ADD
&&
formData
&&
formData
.
outerSteps
&&
<
AuditProcess
customTitleKey=
'stepName'
customKey=
'step'
outerVerifyCurrent=
{
formData
.
currentOuterStep
}
innerVerifyCurrent=
{
formData
.
currentInnerStep
}
outerVerifySteps=
{
formData
.
outerSteps
?
formData
.
outerSteps
.
map
(
item
=>
({
...
item
,
status
:
(
item
.
step
<=
formData
.
currentOuterStep
)
?
'finish'
:
'wait'
,
}))
:
null
}
innerVerifySteps=
{
formData
.
innerSteps
?
formData
.
innerSteps
.
map
(
item
=>
({
...
item
,
status
:
(
item
.
step
<=
formData
.
currentInnerStep
)
?
'finish'
:
'wait'
,
}))
:
null
}
></
AuditProcess
>
}
{
/* 商品列表 */
}
...
...
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