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
1df4855a
Commit
1df4855a
authored
Jul 22, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对接采购销售订单列表、详情
parent
7b3d7961
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
682 additions
and
686 deletions
+682
-686
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+1
-1
constant.ts
src/pages/transaction/_public/order/constant.ts
+98
-97
useOrderDetail.tsx
...ages/transaction/_public/order/effects/useOrderDetail.tsx
+13
-26
index.tsx
...pages/transaction/components/orderDetailSection/index.tsx
+10
-10
index.tsx
src/pages/transaction/components/orderMergeInfo/index.tsx
+8
-22
index.tsx
src/pages/transaction/components/orderPayTabs/index.tsx
+7
-7
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+56
-112
index.tsx
...ges/transaction/components/orderTransformRecord/index.tsx
+24
-29
index.tsx
src/pages/transaction/effect/index.tsx
+31
-10
index.tsx
src/pages/transaction/purchaseOrder/constant/index.tsx
+79
-75
index.tsx
src/pages/transaction/purchaseOrder/index.tsx
+14
-9
index.tsx
...Order/orderCollect/components/productModalTable/index.tsx
+2
-9
index.tsx
src/pages/transaction/saleOrder/constant/index.tsx
+157
-72
index.tsx
src/pages/transaction/saleOrder/firstApprovedOrder/index.tsx
+2
-3
useSelfTable.tsx
...ction/saleOrder/firstApprovedOrder/model/useSelfTable.tsx
+20
-19
index.ts
.../transaction/saleOrder/firstApprovedOrder/schema/index.ts
+0
-3
index.tsx
src/pages/transaction/saleOrder/index.tsx
+15
-13
index.tsx
src/pages/transaction/saleOrder/readyApprovedOrder/index.tsx
+2
-33
useSelfTable.tsx
...ction/saleOrder/readyApprovedOrder/model/useSelfTable.tsx
+18
-17
index.ts
.../transaction/saleOrder/readyApprovedOrder/schema/index.ts
+57
-55
index.tsx
.../transaction/saleOrder/readyConfirmDelevedOrder/index.tsx
+2
-3
useSelfTable.tsx
...saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
+20
-26
index.tsx
src/pages/transaction/saleOrder/readyConfirmOrder/index.tsx
+1
-2
useSelfTable.tsx
...action/saleOrder/readyConfirmOrder/model/useSelfTable.tsx
+19
-11
index.tsx
src/pages/transaction/saleOrder/readyPayResult/index.tsx
+1
-2
useSelfTable.tsx
...ansaction/saleOrder/readyPayResult/model/useSelfTable.tsx
+2
-3
index.tsx
...pages/transaction/saleOrder/secondApprovedOrder/index.tsx
+3
-3
useSelfTable.tsx
...tion/saleOrder/secondApprovedOrder/model/useSelfTable.tsx
+20
-14
No files found.
src/pages/commodity/products/viewProducts.tsx
View file @
1df4855a
...
...
@@ -520,7 +520,7 @@ const viewProducts: React.FC<{}> = () => {
<
p
>
税率:
</
p
>
</
Col
>
<
Col
span=
{
20
}
>
<
p
>
{
productDetail
?.
taxRate
}
</
p
>
<
p
>
{
productDetail
?.
taxRate
?
`${productDetail?.taxRate}%`
:
null
}
</
p
>
</
Col
>
</
Row
>
{
...
...
src/pages/transaction/_public/order/constant.ts
View file @
1df4855a
...
...
@@ -156,121 +156,122 @@ export const tableListSchema: any = () => {
}
/**
* 销售订单高级筛选 公用
*/
export
const
saleTableListSchema
:
any
=
()
=>
{
const
{
orderTypes
:
OrderType
,
innerStatus
:
SaleOrderInsideWorkStateTexts
,
outerStatus
:
PurchaseOrderOutWorkStateTexts
}
=
getSaleOrderSelectOption
()
const
res
=
getSaleOrderSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
innerStatus
:
SaleOrderInsideWorkStateTexts
,
outerStatus
:
SaleOrderOutWorkStateTexts
}
=
res
return
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
ctl
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{controllerBtns}}'
,
return
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
ctl
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{controllerBtns}}'
,
},
},
orderNo
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
'flex-end'
,
},
}
},
orderNo
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
'flex-end'
,
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
colStyle
:
{
marginLeft
:
20
,
},
},
properties
:
{
"digest"
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
colStyle
:
{
marginLeft
:
20
,
},
"memberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
}
},
properties
:
{
orderThe
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
"memberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
}
},
"type"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
"orderType"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
},
enum
:
OrderType
.
map
(
item
=>
({
label
:
item
[
'text'
],
value
:
item
[
'id'
],
}))
},
enum
:
OrderType
.
map
(
item
=>
(
{
label
:
item
[
'name'
]
,
value
:
item
[
'status'
],
}))
},
"externalState"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择外部状态'
"outerStatus"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择外部状态'
},
enum
:
SaleOrderOutWorkStateTexts
.
map
(
item
=>
(
{
label
:
item
[
'text'
]
,
value
:
item
[
'id'
],
}))
},
enum
:
PurchaseOrderOutWorkStateTexts
.
map
(
item
=>
(
{
label
:
item
[
'name'
]
,
value
:
item
[
'status'
],
}))
},
"interiorState"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择内部状态'
"innerStatus"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择内部状态'
},
enum
:
SaleOrderInsideWorkStateTexts
.
map
(
item
=>
(
{
label
:
item
[
'text'
]
,
value
:
item
[
'id'
],
}))
},
enum
:
SaleOrderInsideWorkStateTexts
.
map
(
item
=>
({
label
:
item
[
'name'
],
value
:
item
[
'status'
],
}))
},
"[startCreateTime,endCreateTime]"
:
{
type
:
'array'
,
"x-component"
:
'DateRangePickerUnix'
,
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
"[startDate,endDate]"
:
{
type
:
'daterange'
,
// "x-component": 'DateRangePickerUnix',
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-component-props'
:
{
children
:
'查询'
,
submit
:
{
'x-component'
:
'Submit'
,
'x-component-props'
:
{
children
:
'查询'
,
}
,
},
},
},
}}
}
,
},
}}
},
}
}
}
}
src/pages/transaction/_public/order/effects/useOrderDetail.tsx
View file @
1df4855a
...
...
@@ -28,42 +28,39 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const
{
orderNo
}
=
history
.
location
.
query
const
{
type
}
=
options
const
dataRef
=
useRef
<
any
>
([
{
label
:
'对应报价单号'
,
name
:
'quot
ation
No'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'
orderThe
'
,
span
:
8
},
{
label
:
type
===
'saleOrder'
?
'采购会员'
:
'供应会员'
,
name
:
type
===
'saleOrder'
?
'
createMemberName'
:
'supplyMembers
Name'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderMode
l'
,
span
:
8
,
render
:
text
=>
GlobalConfig
.
web
.
orderMode
.
find
(
v
=>
v
.
value
===
text
)?.
label
||
''
},
{
label
:
'订单类型'
,
name
:
'
t
ypeName'
,
span
:
8
},
{
label
:
'对应报价单号'
,
name
:
'quot
e
No'
,
span
:
8
,
render
:
text
=>
<
Link
to=
{
'/'
}
>
{
text
}
</
Link
>
},
{
label
:
'订单摘要'
,
name
:
'
digest
'
,
span
:
8
},
{
label
:
type
===
'saleOrder'
?
'采购会员'
:
'供应会员'
,
name
:
type
===
'saleOrder'
?
'
buyerMemberName'
:
'vendorMember
Name'
,
span
:
8
},
{
label
:
'下单模式'
,
name
:
'orderMode
Name'
,
span
:
8
},
{
label
:
'订单类型'
,
name
:
'
orderT
ypeName'
,
span
:
8
},
{
label
:
'下单时间'
,
name
:
'createTime'
,
span
:
8
,
render
:
text
=>
formatTimeString
(
text
)
},
{
label
:
'外部状态'
,
name
:
'
externalStat
e'
,
name
:
'
outerStatusNam
e'
,
span
:
8
,
render
:
(
text
,
record
)
=>
<
StatusColors
type=
'out'
status=
{
text
}
text=
{
record
.
externalState
Name
}
/>
render
:
(
text
,
record
)
=>
<
StatusColors
type=
'out'
status=
{
text
}
text=
{
record
.
outerStatus
Name
}
/>
},
{
label
:
'内部状态'
,
name
:
type
===
'saleOrder'
?
'purchaseOrderInteriorState'
:
'interiorStat
e'
,
name
:
'innerStatusNam
e'
,
span
:
8
,
render
:
(
text
,
record
)
=>
<
StatusColors
type=
{
type
===
'saleOrder'
?
'saleInside'
:
'inside'
}
status=
{
text
}
text=
{
record
.
in
teriorState
Name
}
/>
render
:
(
text
,
record
)
=>
<
StatusColors
type=
{
type
===
'saleOrder'
?
'saleInside'
:
'inside'
}
status=
{
text
}
text=
{
record
.
in
nerStatus
Name
}
/>
},
])
useEffect
(()
=>
{
reloadFormData
()
// reloadPayList()
},
[])
const
reloadFormData
=
useCallback
(()
=>
{
if
(
id
||
orderNo
)
{
const
fn
=
type
===
'purchaseOrder'
?
PublicApi
.
getOrderProcurementOrderDetails
:
PublicApi
.
getOrderPurchaseOrderDetails
fn
(
id
?
{
id
}
:
{
orderNo
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
const
fn
=
type
===
'purchaseOrder'
?
PublicApi
.
getOrderBuyerDetail
:
PublicApi
.
getOrderVendorDetail
// @ts-ignore
fn
(
id
?
{
orderId
:
id
}
:
{
orderNo
},
{
ctlType
:
"none"
}).
then
(
res
=>
{
const
{
code
,
data
,
message
:
msg
}
=
res
if
(
code
===
1000
)
{
setFormData
(
data
)
// if(data.paymentInformationResponses.length > 0){
// setCurrentPayInfoId(data.paymentInformationResponses[0].id)
// }
reloadPayList
(
data
.
supplyMembersId
,
data
.
supplyMembersRoleId
)
reloadPayList
(
data
.
vendorMemberId
,
data
.
vendorRoleId
)
}
else
{
message
.
error
(
msg
)
}
...
...
@@ -80,16 +77,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
})
}
// const reloadPayList = useCallback(() => {
// PublicApi.getPayPayWayList().then(res => {
// const { code, data } = res
// if (code === 1000) {
// setPaylist(data)
// }
// })
// }, [id])
// 需共享的状态
const
formContext
=
{
...
...
src/pages/transaction/components/orderDetailSection/index.tsx
View file @
1df4855a
...
...
@@ -19,23 +19,23 @@ const OrderDetailSection:React.FC<OrderDetailSectionProps> = ({formContext, type
return
(
formContext
.
data
&&
<
div
className=
'gray-wrap'
>
<
AuditProcess
customTitleKey=
'
operationalProcess
'
customKey=
'st
ate
'
outerVerifyCurrent=
{
f
indLastIndexFlowState
(
formContext
.
data
.
externalWorkflowFlowRecordLogResponses
)
}
innerVerifyCurrent=
{
f
indLastIndexFlowState
(
formContext
.
data
.
interiorWorkflowFlowRecordLogResponses
)
}
customTitleKey=
'
stepName
'
customKey=
'st
ep
'
outerVerifyCurrent=
{
f
ormContext
.
data
.
currentOuterStep
}
innerVerifyCurrent=
{
f
ormContext
.
data
.
currentInnerStep
}
outerVerifySteps=
{
formContext
.
data
.
externalWorkflowFlowRecordLogResponse
s
?
formContext
.
data
.
externalWorkflowFlowRecordLogResponse
s
.
map
(
item
=>
({
formContext
.
data
.
outerStep
s
?
formContext
.
data
.
outerStep
s
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
status
:
(
item
.
step
<=
formContext
.
data
.
currentOuterStep
)
?
'finish'
:
'wait'
,
}))
:
null
}
innerVerifySteps=
{
formContext
.
data
.
in
teriorWorkflowFlowRecordLogResponse
s
?
formContext
.
data
.
in
teriorWorkflowFlowRecordLogResponse
s
.
map
(
item
=>
({
formContext
.
data
.
in
nerStep
s
?
formContext
.
data
.
in
nerStep
s
.
map
(
item
=>
({
...
item
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
status
:
(
item
.
step
<=
formContext
.
data
.
currentInnerStep
)
?
'finish'
:
'wait'
,
}))
:
null
}
...
...
src/pages/transaction/components/orderMergeInfo/index.tsx
View file @
1df4855a
...
...
@@ -10,39 +10,25 @@ 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
:
'
areaName
'
,
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
>
}
<
Col
>
{
record
.
countryCode
+
''
+
record
.
phone
}
</
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'
}
]
const
electronInfo
=
[
{
title
:
'电子合同'
,
name
:
'none'
},
]
// let invoiceDetalis: any = {};
// const clickLook = (id) => {
// console.log('fpId', id)
// PublicApi.getSettleAccountsMobileInvoiceMessageDetails({id}).then(res => {
// if(res.code === 1000){
// invoiceDetalis = res.data
// }
// })
// }
const
RenderCard
=
({
infoList
,
dataSource
})
=>
infoList
.
map
(
v
=>
dataSource
[
v
.
name
]
?
<
Row
key=
{
v
.
name
}
className=
{
style
[
'card-list'
]
}
>
<
Col
span=
{
6
}
className=
{
style
[
'card-list_title'
]
}
>
{
v
.
title
}
</
Col
>
<
Col
flex=
{
1
}
{
...
v
.
resetCol
}
>
{
v
.
render
?
v
.
render
(
dataSource
[
v
.
name
],
dataSource
)
:
dataSource
[
v
.
name
]
}
</
Col
>
...
...
@@ -52,7 +38,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
const
orderDetailCtx
=
useContext
(
OrderDetailContext
)
const
[
isModalVisible
,
setIsModalVisible
]
=
useState
(
false
)
const
{
data
,
ctl
}
=
orderDetailCtx
const
{
theInvoiceInfo
}
=
data
const
{
theInvoiceInfo
,
consignee
}
=
data
const
otherInfo
=
[
{
title
:
'发票:'
,
name
:
'theInvoiceInfo'
,
render
:
item
=>
<
div
className=
{
style
.
invoice_list_item
}
>
...
...
@@ -83,7 +69,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
<
Row
style=
{
{
marginTop
:
24
}
}
gutter=
{
24
}
>
<
Col
span=
{
(
data
.
externalStateName
!==
'不接受订单'
)
||
(
data
.
orderModel
>
30
)
?
15
:
12
}
>
<
MellowCard
title=
'交易信息'
fullHeight
>
<
RenderCard
infoList=
{
payInfo
}
dataSource=
{
data
}
/>
<
RenderCard
infoList=
{
payInfo
}
dataSource=
{
consignee
}
/>
</
MellowCard
>
</
Col
>
<
Col
span=
{
(
data
.
externalStateName
!==
'不接受订单'
)
||
(
data
.
orderModel
>
30
)
?
9
:
6
}
>
...
...
src/pages/transaction/components/orderPayTabs/index.tsx
View file @
1df4855a
...
...
@@ -39,17 +39,17 @@ const payChannel = [
const
OrderPayTabs
:
React
.
FC
<
OrderPayTabsProps
>
=
(
props
)
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
{
data
,
payList
,
ctl
}
=
useContext
(
OrderDetailContext
)
const
{
data
,
ctl
}
=
useContext
(
OrderDetailContext
)
// 简单流程为24
const
processEnum
=
data
.
processEnum
useEffect
(()
=>
{
// 过滤支付信息 取第一个待支付或者未到账的id
if
(
data
?.
payment
InformationResponse
s
?.
length
)
{
let
payments
=
data
.
payment
InformationResponse
s
.
filter
(
item
=>
item
.
externalState
===
1
||
item
.
externalState
===
4
)
if
(
data
?.
payments
?.
length
)
{
let
payments
=
data
.
payments
.
filter
(
item
=>
item
.
externalState
===
1
||
item
.
externalState
===
4
)
if
(
payments
.
length
)
{
ctl
.
setPayId
(
payments
[
0
].
i
d
)
ctl
.
setPayId
(
payments
[
0
].
paymentI
d
)
}
}
},
[])
...
...
@@ -63,7 +63,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
return
<
Row
justify=
'space-between'
style=
{
{
minWidth
:
216
}
}
>
<
Col
>
<
div
className=
{
style
.
fontGray
}
>
支付比例
</
div
>
<
div
className=
{
style
.
bignumber
}
>
{
dataSource
.
payRat
io
}
%
</
div
>
<
div
className=
{
style
.
bignumber
}
>
{
dataSource
.
payRat
e
}
%
</
div
>
<
div
className=
{
style
.
smallnumber
}
>
{
dataSource
.
channel
!==
0
&&
'¥'
}
{
dataSource
.
payPrice
||
0
}
...
...
@@ -85,7 +85,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
</
Row
>
}
const
urlsDatas
=
data
.
payment
InformationResponse
s
.
filter
(
item
=>
item
[
'channel'
]
===
5
&&
item
[
'payWay'
]
===
2
).
map
(
_item
=>
_item
[
'payOrderUrls'
]).
filter
(
__item
=>
__item
.
length
)
const
urlsDatas
=
data
.
payments
.
filter
(
item
=>
item
[
'channel'
]
===
5
&&
item
[
'payWay'
]
===
2
).
map
(
_item
=>
_item
[
'payOrderUrls'
]).
filter
(
__item
=>
__item
.
length
)
return
(
<>
...
...
@@ -94,7 +94,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
<
MellowCard
bordered=
{
false
}
fullHeight
>
{
/* <Row gutter={24}> */
}
<
Tabs
defaultActiveKey=
'1'
onChange=
{
onChange
}
>
{
data
.
payment
InformationResponses
&&
data
.
paymentInformationResponses
.
map
(
v
=>
<
TabPane
key=
{
v
.
i
d
}
tab=
{
<
TabHeader
dataSource=
{
v
}
/>
}
>
{
data
.
payment
s
&&
data
.
payments
.
map
(
v
=>
<
TabPane
key=
{
v
.
paymentI
d
}
tab=
{
<
TabHeader
dataSource=
{
v
}
/>
}
>
<
Row
>
<
Col
className=
{
style
.
fontGray
}
span=
{
4
}
>
支付环节:
</
Col
>
<
Col
>
{
v
.
payNode
}
</
Col
>
...
...
src/pages/transaction/components/orderProductTable/index.tsx
View file @
1df4855a
...
...
@@ -41,52 +41,23 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const
modalPriceActions
=
createFormActions
()
// 总计金额联动框
export
const
MoneyTotalBox
=
({
dataSource
,
preview
})
=>
{
const
{
orderProductRequests
=
[],
deliveryAddressInfo
,
freight
=
0
,
sumPrice
,
amount
,
orderModel
}
=
dataSource
||
{}
const
{
product
,
orderModel
}
=
dataSource
||
{}
const
{
couponAmount
,
freight
,
productAmount
,
promotionAmount
,
totalAmount
,
products
}
=
product
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
// 合计金额, 如果后端有传则用后端数据
const
sum
=
amount
||
orderProductRequests
.
reduce
((
prev
,
next
)
=>
prev
+
parseInt
((
next
.
money
||
0
)),
0
)
const
sum
=
productAmount
||
products
.
reduce
((
prev
,
next
)
=>
prev
+
parseInt
((
next
.
amount
||
0
)),
0
)
// 总计金额
const
amountMoney
=
sumPrice
||
sum
+
freight
// const modelRef = useRef<any>({})
// const [freePrice, setFreePrice] = useState<number>(0)
// const handleSetting = () => {
// modelRef.current.setVisible(true)
// }
const
amountMoney
=
totalAmount
||
sum
+
freight
// const handleConfirm = () => {
// setFreePrice(parseInt(modalPriceActions.getFieldValue('freePrice') || 0))
// modelRef.current.setVisible(false)
// }
// useEffect(() => {
// // 存在商品 并且有选择收货地址,则开始计算运费
// if (orderProductRequests && orderProductRequests.length > 0 && deliveryAddressInfo) {
// // 筛选配送方式为物流的商品并且使用了运费模板
// const logsiticsDataMaps = orderProductRequests.filter(v => v.logistics && v.logistics.useTemplate && v.logistics.deliveryType === 1)
// if (logsiticsDataMaps.length > 0) {
// PublicApi.postLogisticsFreightTemplateCalFreightPrice({
// orderProductList: logsiticsDataMaps.map(v => ({
// templateId: v.templateId,
// weight: v.weight
// })),
// receiverAddressId: deliveryAddressInfo.id
// }, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
// if (res.code === 1000) {
// setFreePrice(res.data)
// }
// })
// }
// }
// }, [orderProductRequests])
return
<
RowStyle
>
<
Col
span=
{
2
}
>
<
div
>
{
creditsCommodity
?
'合计所需积分'
:
'合计金额'
}
</
div
>
<
div
>
{
sum
}
</
div
>
</
Col
>
<
Col
span=
{
2
}
>
{
/* <div>运费 { !preview && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/> }</div> */
}
<
div
>
运费
</
div
>
<
div
>
{
freight
}
</
div
>
</
Col
>
...
...
@@ -94,34 +65,6 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<
div
>
{
creditsCommodity
?
'总计所需积分'
:
'总计金额'
}
</
div
>
<
div
>
{
amountMoney
}
</
div
>
</
Col
>
{
/* <ModalForm
modalTitle='设置运费'
currentRef={modelRef}
initialValues={freePrice}
schema={{
type: 'object',
properties: {
NO_SUBMIT_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top'
},
properties: {
freePrice: {
type: 'string',
title: '设置运费',
"x-props": {
addonBefore: '¥'
}
}
}
}
}
}}
actions={modalPriceActions}
confirm={handleConfirm}
/> */
}
</
RowStyle
>
}
...
...
@@ -213,7 +156,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
const
OrderProductTable
:
React
.
FC
<
OrderProductTableProps
>
=
({
editable
})
=>
{
const
{
ctl
,
data
,
preview
}
=
useContext
(
OrderDetailContext
)
const
{
orderProductRequests
=
[],
orderModel
}
=
data
||
{}
const
{
product
=
[],
orderModel
}
=
data
||
{}
const
creditsCommodity
=
(
orderModel
===
24
||
orderModel
===
25
)
// 积分或渠道积分下单模式
// 合同下单模式
const
contractOrder
=
(
orderModel
===
OrderModalType
.
PURCHASE_ENQUIRY_CONTRACT_ORDER
||
orderModel
===
OrderModalType
.
PURCHASE_TENDER_CONTRACT_ORDER
||
orderModel
===
OrderModalType
.
PURCHASE_BIDDING_CONTRACT_ORDER
)
...
...
@@ -225,40 +168,40 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
}
}
const
asyncGetMemberPrice
=
async
(
asyncData
:
any
[])
=>
{
return
await
Promise
.
all
(
asyncData
.
filter
(
v
=>
v
.
memberPrice
===
undefined
).
map
(
async
v
=>
{
console
.
log
(
v
,
'v'
)
const
{
code
,
data
}
=
await
PublicApi
.
getMemberManageUpperCreditParamGet
({
parentMemberId
:
v
.
m
emberId
,
parentMemberRoleId
:
v
.
membe
rRoleId
},
{
ttl
:
60
*
1000
,
useCache
:
true
})
return
code
===
1000
?
{
value
:
(
data
.
parameter
*
100
)
+
'%'
,
id
:
v
.
id
}
:
{
value
:
''
,
id
:
0
}
}
))
}
//
const asyncGetMemberPrice = async (asyncData: any[]) => {
//
return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
//
console.log(v, 'v')
//
const {code, data} = await PublicApi.getMemberManageUpperCreditParamGet({
// parentMemberId: v.vendorM
emberId,
// parentMemberRoleId: v.vendo
rRoleId
//
}, {ttl: 60 * 1000, useCache: true})
//
return code === 1000 ? { value: (data.parameter * 100) + '%', id: v.id } : { value: '', id: 0 }
//
}
//
))
//
}
useEffect
(()
=>
{
// 过滤 会员折扣不存在的列表
const
hasPriceList
=
orderProductReques
ts
.
filter
(
v
=>
!
v
.
memberPrice
)
if
(
hasPriceList
.
length
>
0
)
{
asyncGetMemberPrice
(
hasPriceList
).
then
((
asyncData
)
=>
{
const
newData
=
orderProductReques
ts
.
map
((
v
,
i
)
=>
{
if
(
!
v
.
memberPrice
)
{
v
.
memberPrice
=
asyncData
.
find
(
j
=>
j
.
id
===
v
.
id
)?.
value
||
''
}
return
v
})
ctl
.
setData
({
...
data
,
orderProductRequests
:
newData
})
})
}
},
[])
//
useEffect(() => {
//
// 过滤 会员折扣不存在的列表
// const hasPriceList = product.produc
ts.filter(v => !v.memberPrice)
//
if (hasPriceList.length > 0) {
//
asyncGetMemberPrice(hasPriceList).then((asyncData) => {
// const newData = product.produc
ts.map((v, i) => {
//
if (!v.memberPrice) {
//
v.memberPrice = asyncData.find(j => j.id === v.id)?.value || ''
//
}
//
return v
//
})
//
ctl.setData({
//
...data,
//
orderProductRequests: newData
//
})
//
})
//
}
//
}, [])
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
,
{
...
...
@@ -275,15 +218,15 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
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
:
'品类'
,
...
...
@@ -311,23 +254,24 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
},
{
title
:
'会员折扣'
,
dataIndex
:
'
memberPrice
'
,
dataIndex
:
'
discount
'
,
align
:
'center'
,
key
:
'memberPrice'
,
render
:
(
text
,
record
)
=>
record
.
isMemberPrice
?
(
text
*
10000
/
100
+
'%'
)
:
null
key
:
'discount'
,
// render: (text, record) => record.isMemberPrice ? (text * 10000 / 100 + '%') : null
render
:
(
text
,
record
)
=>
text
+
'%'
},
{
title
:
creditsCommodity
?
'兑换数量'
:
'采购数量'
,
dataIndex
:
'
purchaseCount
'
,
dataIndex
:
'
quantity
'
,
align
:
'center'
,
key
:
'
purchaseCount
'
,
key
:
'
quantity
'
,
editable
:
true
},
{
title
:
'含税'
,
dataIndex
:
'tax
Inclusive
'
,
dataIndex
:
'tax'
,
align
:
'center'
,
key
:
'tax
Inclusive
'
,
key
:
'tax'
,
render
:
(
t
,
r
)
=>
t
?
'是'
:
'否'
},
{
...
...
@@ -339,18 +283,18 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
},
{
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
&&
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
}
]
...
...
@@ -471,7 +415,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
<
MellowCard
title=
{
contractOrder
?
'订单物料'
:
'订单商品'
}
style=
{
{
marginTop
:
24
}
}
bordered=
{
false
}
>
<
Table
columns=
{
contractOrder
?
materialInfo
:
productInfoColumns
}
dataSource=
{
orderProductReques
ts
}
dataSource=
{
product
.
produc
ts
}
components=
{
productComponents
}
rowKey=
'id'
pagination=
{
false
}
...
...
src/pages/transaction/components/orderTransformRecord/index.tsx
View file @
1df4855a
...
...
@@ -19,17 +19,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
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'transformOut'
text=
{
record
.
stateName
}
/>
// @todo 需传递工作流状态重新render
key
:
'statusName'
,
},
{
title
:
'操作'
,
...
...
@@ -39,16 +37,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
PurchaseSideOrderCols
:
any
[]
=
[
...
...
@@ -61,9 +59,9 @@ const PurchaseSideOrderCols: any[] = [
},
{
title
:
'操作人'
,
dataIndex
:
'
roleName
'
,
dataIndex
:
'
operator
'
,
align
:
'center'
,
key
:
'
roleName
'
,
key
:
'
operator
'
,
},
{
title
:
'部门'
,
...
...
@@ -73,16 +71,15 @@ const PurchaseSideOrderCols: any[] = [
},
{
title
:
'职位'
,
dataIndex
:
'
position
'
,
dataIndex
:
'
jobTitle
'
,
align
:
'center'
,
key
:
'
position
'
,
key
:
'
jobTitle
'
,
},
{
title
:
'状态'
,
dataIndex
:
'state'
,
dataIndex
:
'stat
usNam
e'
,
align
:
'center'
,
key
:
'state'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'transformInside'
text=
{
record
.
stateName
}
/>
key
:
'statusName'
,
},
{
title
:
'操作'
,
...
...
@@ -92,18 +89,19 @@ const PurchaseSideOrderCols: any[] = [
},
{
title
:
'操作时间'
,
dataIndex
:
'
operation
Time'
,
dataIndex
:
'
create
Time'
,
align
:
'center'
,
key
:
'
operation
Time'
,
key
:
'
create
Time'
,
render
:
text
=>
formatTimeString
(
text
)
},
{
title
:
'审核意见'
,
dataIndex
:
'
auditOpinion
'
,
dataIndex
:
'
remark
'
,
align
:
'center'
,
key
:
'
auditOpinion
'
,
key
:
'
remark
'
,
},
]
const
SaleSideOrderCols
:
any
[]
=
[
{
title
:
'流转记录'
,
...
...
@@ -160,30 +158,27 @@ const SaleSideOrderCols: any[] = [
// 订单流转记录
const
OrderTransformRecord
:
React
.
FC
<
OrderTransformRecordProps
>
=
({
type
})
=>
{
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
{
externalProcurementOrderLogResponses
,
interiorProcurementOrderLogResponses
}
=
data
// 复杂流程或者多次支付显示标题
// const isShowOuterTitle = data?.processEnum !== 24 || data?.paymentInformationResponses?.length > 1
const
{
outerHistories
,
innerHistories
}
=
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"
>
<
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=
{
type
===
'saleOrder'
?
SaleSideOrderCols
:
PurchaseSideOrderCols
}
dataSource=
{
in
teriorProcurementOrderLogRespons
es
}
dataSource=
{
in
nerHistori
es
}
pagination=
{
false
}
rowKey=
"id"
/>
...
...
src/pages/transaction/effect/index.tsx
View file @
1df4855a
...
...
@@ -22,7 +22,7 @@ interface IState {
name
:
string
;
}
/** 获取
采购订单
下拉项:订单类型、内部状态、外部状态 */
/** 获取
采购订单查询
下拉项:订单类型、内部状态、外部状态 */
export
const
getPurchaseOrderSelectOption
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
GetOrderBuyerPageItemsResponse
>
()
...
...
@@ -38,23 +38,44 @@ export const getPurchaseOrderSelectOption = () => {
return
state
}
/**
@todo 获取销售订单
下拉项:订单类型、内部状态、外部状态 */
/**
获取 销售订单查询
下拉项:订单类型、内部状态、外部状态 */
export
const
getSaleOrderSelectOption
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
any
>
()
//
useEffect(() => {
// PublicApi.getOrderBuye
rPageItems({}).then(res => {
//
const { code, data } = res
//
if(code === 1000) {
//
setstate(data)
//
}
//
})
//
}, [])
useEffect
(()
=>
{
PublicApi
.
getOrderVendo
rPageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
}
})
},
[])
return
state
}
/** (销售订单审核各个页面)获取前端页面下拉框列表 */
export
const
getSaleOrderAuditPageSelectOption
=
()
=>
{
const
[
state
,
setstate
]
=
useState
<
any
>
()
useEffect
(()
=>
{
PublicApi
.
getOrderVendorValidatePageItems
({}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
===
1000
)
{
setstate
(
data
)
}
})
},
[])
return
state
}
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
// **以下*即将弃用*** //
/** 获取订单类型映射 */
...
...
src/pages/transaction/purchaseOrder/constant/index.tsx
View file @
1df4855a
...
...
@@ -3,84 +3,88 @@ import { history } from 'umi'
import
{
formatTimeString
}
from
'@/utils'
import
StatusColors
from
'../components/StatusColors'
import
EyePreview
from
'@/components/EyePreview'
import
{
getOrderType
,
getPurchaseOrderInsideWorkState
,
getPurchaseOrderOutWorkState
}
from
'../../effect'
// import { ORDER_TYPE, PurchaseOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import
{
getPurchaseOrderSelectOption
}
from
'../../effect'
export
const
baseOrderListColumns
:
any
=
()
=>
{
const
OrderType
=
getOrderType
()
const
PurchaseOrderOutWorkStateTexts
=
getPurchaseOrderOutWorkState
()
const
PurchaseOrderInsideWorkStateTexts
=
getPurchaseOrderInsideWorkState
()
const
res
=
getPurchaseOrderSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
innerStatus
:
PurchaseOrderInsideWorkStateTexts
,
outerStatus
:
PurchaseOrderOutWorkStateTexts
}
=
res
return
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`${history.location.pathname}/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
return
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`${history.location.pathname}/preview?id=${record.orderId}`
}
>
{
text
}
</
EyePreview
>
)
},
ellipsis
:
true
,
},
ellipsis
:
true
,
},
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'digest'
,
key
:
'digest'
,
ellipsis
:
true
,
},
{
title
:
'供应会员'
,
align
:
'center'
,
dataIndex
:
'memberName'
,
key
:
'memberName'
,
ellipsis
:
true
,
},
{
title
:
'下单时间'
,
align
:
'center'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
ellipsis
:
true
,
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'orderTypeName'
,
key
:
'orderTypeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
orderType
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'outerStatusName'
,
key
:
'outerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'outerStatusName'
]
}
/>,
filters
:
PurchaseOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
outerStatus
,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'innerStatusName'
,
key
:
'innerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
text=
{
record
[
'innerStatusName'
]
}
/>,
filters
:
PurchaseOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
innerStatus
,
}
]
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'digest'
,
key
:
'digest'
,
ellipsis
:
true
,
},
{
title
:
'供应会员'
,
align
:
'center'
,
dataIndex
:
'vendorMemberName'
,
key
:
'vendorMemberName'
,
ellipsis
:
true
,
},
{
title
:
'下单时间'
,
align
:
'center'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
ellipsis
:
true
,
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'orderTypeName'
,
key
:
'orderTypeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
orderType
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'outerStatusName'
,
key
:
'outerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'outerStatusName'
]
}
/>,
filters
:
PurchaseOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
outerStatus
,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'innerStatusName'
,
key
:
'innerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'inside'
text=
{
record
[
'innerStatusName'
]
}
/>,
filters
:
PurchaseOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
innerStatus
,
}
]
}
}
src/pages/transaction/purchaseOrder/index.tsx
View file @
1df4855a
...
...
@@ -146,15 +146,20 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
:
any
,
record
:
any
)
=>
renderOptionButton
(
record
)
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
:
any
,
record
:
any
)
=>
renderOptionButton
(
record
)
}
])
}
])
}
const
controllerBtns
=
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
...
...
@@ -162,7 +167,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
secondColumns
}
columns=
{
secondColumns
()
}
currentRef=
{
ref
}
controlRender=
{
<
NiceForm
...
...
src/pages/transaction/purchaseOrder/orderCollect/components/productModalTable/index.tsx
View file @
1df4855a
...
...
@@ -74,21 +74,14 @@ const orderProductShopTypeMaps = {
export
const
AddressPop
=
(
props
)
=>
{
const
{
pickInfo
=
null
,
children
}
=
props
let
receiveInfo
=
pickInfo
?.
render
&&
typeof
pickInfo
.
render
===
'object'
?
pickInfo
.
render
:
JSON
.
parse
(
pickInfo
.
render
)
return
pickInfo
&&
pickInfo
.
deliveryType
===
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
||
receiveInfo
.
fullAddress
}
</
p
>
</>
}
<
p
>
{
pickInfo
.
receiver
}
/
{
pickInfo
.
phone
}
</
p
>
<
p
>
{
pickInfo
.
address
}
</
p
>
</
div
>
</
Row
>
}
>
...
...
src/pages/transaction/saleOrder/constant/index.tsx
View file @
1df4855a
import
React
from
'react'
import
{
formatTimeString
}
from
'@/utils'
// import { ORDER_TYPE, SaleOrderInsideWorkStateTexts, PurchaseOrderOutWorkStateTexts } from '@/constants/order'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
EyePreview
from
'@/components/EyePreview'
import
{
history
}
from
'umi'
import
{
get
OrderType
,
getPurchaseOrderOutWorkState
,
getSaleOrderInsideWorkState
}
from
'../../effect'
import
{
get
SaleOrderSelectOption
}
from
'../../effect'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
getSaleOrderAuditPageSelectOption
}
from
'@/pages/transaction/effect'
;
export
const
baseOrderListColumns
:
any
=
()
=>
{
interface
LayoutState
{
/** flex布局的对齐方式 */
align
?:
string
,
/** 列的样式 */
colStyle
?:
Object
}
const
OrderType
=
getOrderType
()
const
SaleOrderInsideWorkStateTexts
=
getSaleOrderInsideWorkState
()
const
PurchaseOrderOutWorkStateTexts
=
getPurchaseOrderOutWorkState
()
/** 订单审核各个页面 只有订单类型查询的Schema */
export
const
tableListSchema
:
any
=
(
align
?:
String
,
colStyle
?:
Object
)
=>
{
console
.
log
(
align
,
colStyle
)
const
res
=
getSaleOrderAuditPageSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
}
=
res
return
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`${history.location.pathname}/preview?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
)
return
{
type
:
'object'
,
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component"
:
'SearchFilter'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
align
||
'flex-start'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
inline
:
true
,
colStyle
:
colStyle
||
{
marginRight
:
20
}
},
properties
:
{
orderThe
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
"memberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
}
},
"orderType"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
},
enum
:
OrderType
.
map
(
item
=>
({
label
:
item
[
'text'
],
value
:
item
[
'id'
],
}))
},
"[startDate,endDate]"
:
{
type
:
'daterange'
,
// "x-component": 'DateRangePickerUnix',
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
}
},
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
},
{
title
:
'采购会员'
,
align
:
'center'
,
dataIndex
:
'memberName'
,
key
:
'memberName'
,
},
{
title
:
'下单时间'
,
align
:
'center'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'sumPrice'
,
key
:
'sumPrice'
,
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'typeName'
,
key
:
'typeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'name'
],
value
:
Number
(
e
[
'status'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
type
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'externalState'
,
key
:
'externalState'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'externalStateName'
]
}
/>,
filters
:
PurchaseOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'name'
],
value
:
Number
(
e
[
'status'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
externalState
,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'purchaseOrderInteriorState'
,
key
:
'purchaseOrderInteriorState'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'saleInside'
text=
{
record
[
'interiorStateName'
]
}
/>,
filters
:
SaleOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'name'
],
value
:
Number
(
e
[
'status'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
purchaseOrderInteriorState
,
},
]
}
}
}
export
const
baseOrderListColumns
:
any
=
()
=>
{
const
res
=
getSaleOrderSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
innerStatus
:
SaleOrderInsideWorkStateTexts
,
outerStatus
:
SaleOrderOutWorkStateTexts
}
=
res
return
[
{
title
:
'订单号'
,
align
:
'center'
,
dataIndex
:
'orderNo'
,
key
:
'orderNo'
,
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`${history.location.pathname}/preview?id=${record.orderId}`
}
>
{
text
}
</
EyePreview
>
)
}
},
{
title
:
'订单摘要'
,
align
:
'center'
,
dataIndex
:
'orderThe'
,
key
:
'orderThe'
,
},
{
title
:
'采购会员'
,
align
:
'center'
,
dataIndex
:
'buyerMemberName'
,
key
:
'buyerMemberName'
,
},
{
title
:
'下单时间'
,
align
:
'center'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
render
:
(
text
)
=>
formatTimeString
(
text
)
},
{
title
:
'订单总额'
,
align
:
'center'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'orderTypeName'
,
key
:
'orderTypeName'
,
filters
:
OrderType
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
orderType
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'outerStatusName'
,
key
:
'outerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'outerStatusName'
]
}
/>,
filters
:
SaleOrderOutWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
outerStatus
,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'innerStatusName'
,
key
:
'innerStatusName'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'saleInside'
text=
{
record
[
'innerStatusName'
]
}
/>,
filters
:
SaleOrderInsideWorkStateTexts
.
map
((
e
,
i
)
=>
({
text
:
e
[
'text'
],
value
:
Number
(
e
[
'id'
])
})),
onFilter
:
(
value
,
record
)
=>
value
===
record
.
innerStatus
,
},
]
}
}
src/pages/transaction/saleOrder/firstApprovedOrder/index.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
tableListSchema
}
from
'.
/schema
'
import
{
tableListSchema
}
from
'.
./constant
'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -21,7 +21,6 @@ const fetchTableData = async (params) => {
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
,
...
...
@@ -58,7 +57,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
formilyProps=
{
{
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
(),
schema
:
tableListSchema
(
'flex-end'
,
{
marginLeft
:
20
}
),
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
...
...
src/pages/transaction/saleOrder/firstApprovedOrder/model/useSelfTable.tsx
View file @
1df4855a
...
...
@@ -3,7 +3,6 @@ import { Button } from 'antd'
import
{
baseOrderListColumns
}
from
'../../constant'
import
{
history
}
from
'umi'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
SaleOrderInsideWorkState
}
from
'@/constants/order'
// 业务hooks, 待新增订单
export
const
useSelfTable
=
()
=>
{
...
...
@@ -11,28 +10,30 @@ export const useSelfTable = () => {
const
[
rowSelection
,
rowSelectionCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
handleSubmit
=
async
(
record
)
=>
{
if
(
record
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
ONE_LEVEL_AUDIT_ORDER
)
{
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=
${
record
.
id
}
`
)
}
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/firstApprovedOrder/detail?id=
${
record
.
id
}
`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
// <>
// {
// record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER &&
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
)
}
>
提交审核
</
Button
>
// }
// </>
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
{
return
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
)
}
>
提交审核
</
Button
>
</>
}
}
])
}
])
}
return
{
columns
:
secondColumns
,
columns
:
secondColumns
()
,
ref
,
rowSelection
,
rowSelectionCtl
...
...
src/pages/transaction/saleOrder/firstApprovedOrder/schema/index.ts
View file @
1df4855a
...
...
@@ -2,9 +2,6 @@ import { ISchema } from '@formily/antd';
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
getOrderType
}
from
'@/pages/transaction/effect'
;
/**
* 除了订单必填字段, 默认
*/
export
const
tableListSchema
:
any
=
()
=>
{
const
OrderType
=
getOrderType
()
...
...
src/pages/transaction/saleOrder/index.tsx
View file @
1df4855a
...
...
@@ -22,7 +22,7 @@ import { useHttpRequest } from '@/hooks/useHttpRequest'
export
interface
SaleOrderProps
{
}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrder
PurchaseOrderList
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrder
VendorPage
(
params
)
return
data
}
...
...
@@ -103,18 +103,20 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
:
any
,
record
:
any
)
=>
renderOptionButton
(
record
)
// render: (text, record) => <>
// { record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && !record.procurementEevaluateState && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
// </>
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
:
any
,
record
:
any
)
=>
renderOptionButton
(
record
)
}
])
}
])
}
const
controllerBtns
=
<
Button
style=
{
{
width
:
140
}
}
onClick=
{
()
=>
{}
}
type=
'default'
>
导出
</
Button
>
...
...
@@ -122,7 +124,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
columns=
{
secondColumns
}
columns=
{
secondColumns
()
}
currentRef=
{
ref
}
controlRender=
{
<
NiceForm
...
...
src/pages/transaction/saleOrder/readyApprovedOrder/index.tsx
View file @
1df4855a
import
React
from
'react'
import
{
Card
,
message
}
from
'antd'
import
{
Card
}
from
'antd'
import
{
StandardTable
}
from
'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
tableListSchema
}
from
'./schema'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
DateRangePickerUnix
from
'@/components/NiceForm/components/DateRangePickerUnix'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
import
'../index.less'
import
{
tableListSchema
}
from
'../constant'
// 待提交审核订单
...
...
@@ -22,31 +20,14 @@ const fetchTableData = async (params) => {
return
data
}
// TODO
const
ReadyApprovedOrder
:
React
.
FC
<
ReadyApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
,
ref
}
=
useSelfTable
()
const
[
rowSelection
,
rowSelectionCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderSubmittedReviewOrderOneAll
)
const
handleBitchPush
=
async
()
=>
{
if
(
rowSelectionCtl
.
selectedRowKeys
.
length
>
0
)
{
const
{
code
}
=
await
run
({
ids
:
rowSelectionCtl
.
selectedRowKeys
})
if
(
code
===
1000
)
{
rowSelectionCtl
.
setSelectRow
([])
rowSelectionCtl
.
setSelectedRowKeys
([])
ref
.
current
.
reload
()
}
}
else
{
message
.
error
(
'请勾选要审核的订单'
)
}
}
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
rowSelection=
{
rowSelection
}
columns=
{
columns
}
currentRef=
{
ref
}
formilyLayouts=
{
{
...
...
@@ -69,19 +50,7 @@ const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => {
Submit
}
},
// layouts:
{
// order: 2,
// span: 16
//
}
}
}
// formilyChilds={{
// children: <Space>
// <Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
// </Space>,
// layouts: {
// span: 8
// }
// }}
/>
</
Card
>
</
PageHeaderWrapper
>
...
...
src/pages/transaction/saleOrder/readyApprovedOrder/model/useSelfTable.tsx
View file @
1df4855a
import
React
,
{
useRef
}
from
'react'
import
{
Button
}
from
'antd'
import
{
baseOrderListColumns
}
from
'../../constant'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
history
}
from
'umi'
// 业务hooks, 待审核订单
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
[
rowSelection
,
rowSelectionCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
handleSubmit
=
async
(
id
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/readyApprovedOrder/detail?id=
${
id
}
`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
{
return
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
.
id
)
}
>
提交审核
</
Button
>
</>
}
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
{
return
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
.
id
)
}
>
提交审核
</
Button
>
</>
}
}
])
}
])
}
return
{
columns
:
secondColumns
,
columns
:
secondColumns
()
,
ref
,
rowSelection
,
rowSelectionCtl
}
}
src/pages/transaction/saleOrder/readyApprovedOrder/schema/index.ts
View file @
1df4855a
import
{
ISchema
}
from
'@formily/antd'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
get
OrderType
}
from
'@/pages/transaction/effect'
;
import
{
get
SaleOrderAuditPageSelectOption
}
from
'@/pages/transaction/effect'
;
/**
* 除了订单必填字段, 默认
*/
export
const
tableListSchema
:
any
=
()
=>
{
const
OrderType
=
getOrderType
()
const
res
=
getSaleOrderAuditPageSelectOption
()
if
(
res
)
{
const
{
orderTypes
:
OrderType
,
}
=
res
return
{
type
:
'object'
,
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component"
:
'SearchFilter'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
'flex-start'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
inline
:
true
,
colStyle
:
{
marginRight
:
20
}
},
properties
:
{
orderThe
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
return
{
type
:
'object'
,
properties
:
{
orderNo
:
{
type
:
'string'
,
"x-component"
:
'SearchFilter'
,
'x-component-props'
:
{
placeholder
:
'请输入订单编号'
,
align
:
'flex-start'
,
},
"memberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
inline
:
true
,
colStyle
:
{
marginRight
:
20
}
},
"type"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
properties
:
{
orderThe
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'请输入订单摘要'
,
}
},
enum
:
OrderType
.
map
(
item
=>
({
label
:
item
[
'name'
],
value
:
item
[
'status'
],
}))
},
"[startCreateTime,endCreateTime]"
:
{
type
:
'array'
,
"x-component"
:
'DateRangePickerUnix'
,
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
"memberName"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请输入采购会员名称'
}
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-component-props'
:
{
children
:
'查询'
,
"type"
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择订单类型'
},
enum
:
OrderType
.
map
(
item
=>
({
label
:
item
[
'text'
],
value
:
item
[
'id'
],
}))
},
"[startCreateTime,endCreateTime]"
:
{
type
:
'array'
,
"x-component"
:
'DateRangePickerUnix'
,
'x-component-props'
:
{
placeholder
:
[
'开始时间'
,
'结束时间'
],
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
}
,
}
}
}
}
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/index.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
tableListSchema
}
from
'.
/schema
'
import
{
tableListSchema
}
from
'.
./constant
'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -16,11 +16,10 @@ import '../index.less'
export
interface
FirstApprovedOrderProps
{}
const
fetchTableData
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getOrder
ConfirmShipmentOrderList
(
params
)
const
{
data
}
=
await
PublicApi
.
getOrder
VendorValidateDeliveryPage
(
params
)
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/model/useSelfTable.tsx
View file @
1df4855a
...
...
@@ -3,7 +3,6 @@ import { history, Link } from 'umi'
import
{
Button
}
from
'antd'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
,
SaleOrderInsideWorkState
}
from
'@/constants/order'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
...
...
@@ -20,7 +19,7 @@ export const useSelfTable = () => {
render
:
(
text
,
record
)
=>
{
// 查看订单, 需根据状态显示不同schema
return
(
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.
i
d}`
}
>
<
EyePreview
url=
{
`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.
orderI
d}`
}
>
{
text
}
</
EyePreview
>
)
...
...
@@ -29,8 +28,8 @@ export const useSelfTable = () => {
{
title
:
'订单摘要/下单时间'
,
align
:
'center'
,
dataIndex
:
'
orderThe
'
,
key
:
'
orderThe
'
,
dataIndex
:
'
digest
'
,
key
:
'
digest
'
,
render
:
(
text
,
record
)
=>
<>
<
div
>
{
text
}
</
div
>
<
div
><
FieldTimeOutlined
/>
{
formatTimeString
(
record
.
createTime
)
}
</
div
>
...
...
@@ -40,56 +39,51 @@ export const useSelfTable = () => {
{
title
:
'采购会员'
,
align
:
'left'
,
dataIndex
:
'
m
emberName'
,
key
:
'
m
emberName'
,
dataIndex
:
'
buyerM
emberName'
,
key
:
'
buyerM
emberName'
,
},
{
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
:
'
shipmentBatch'
,
key
:
'shipmentBatch
'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
{
title
:
'已发货批次'
,
align
:
'center'
,
dataIndex
:
'
batchNo'
,
key
:
'batchNo
'
,
render
:
text
=>
text
?
`
${
text
}
次`
:
''
},
// @todo 发货单号跳转
{
title
:
'发货单号'
,
align
:
'center'
,
dataIndex
:
'deliverNo'
,
key
:
'deliverNo'
,
dataIndex
:
'deliver
y
No'
,
key
:
'deliver
y
No'
,
render
:
(
text
,
record
)
=>
<
Link
to=
{
`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`
}
>
{
text
}
</
Link
>
},
{
title
:
'订单类型'
,
align
:
'center'
,
dataIndex
:
'
t
ypeName'
,
key
:
'
t
ypeName'
,
dataIndex
:
'
orderT
ypeName'
,
key
:
'
orderT
ypeName'
,
},
{
title
:
'外部状态'
,
align
:
'center'
,
dataIndex
:
'
externalState
'
,
key
:
'
externalState
'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'
externalState
Name'
]
}
/>,
dataIndex
:
'
outerStatus
'
,
key
:
'
outerStatus
'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'out'
text=
{
record
[
'
outerStatus
Name'
]
}
/>,
},
{
title
:
'内部状态'
,
align
:
'center'
,
dataIndex
:
'
purchaseOrderInteriorState
'
,
key
:
'
purchaseOrderInteriorState
'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'saleInside'
text=
{
record
[
'in
teriorState
Name'
]
}
/>,
dataIndex
:
'
innerStatus
'
,
key
:
'
innerStatus
'
,
render
:
(
text
,
record
)
=>
<
StatusColors
status=
{
text
}
type=
'saleInside'
text=
{
record
[
'in
nerStatus
Name'
]
}
/>,
},
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
// <>
// { (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
// }
// </>
render
:
(
text
,
record
)
=>
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认发货
</
Button
>
}
]
...
...
src/pages/transaction/saleOrder/readyConfirmOrder/index.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
tableListSchema
}
from
'.
/schema
'
import
{
tableListSchema
}
from
'.
./constant
'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -20,7 +20,6 @@ const fetchTableData = async (params) => {
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
...
...
src/pages/transaction/saleOrder/readyConfirmOrder/model/useSelfTable.tsx
View file @
1df4855a
...
...
@@ -8,19 +8,27 @@ export const useSelfTable = () => {
const
handleConfirm
=
async
(
record
)
=>
{
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/readyConfirmOrder/detail?id=
${
record
.
id
}
`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认订单
</
Button
>
</>
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
{
return
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleConfirm
(
record
)
}
>
确认订单
</
Button
>
</>
}
}
])
}
])
}
return
{
columns
:
secondColumns
columns
:
secondColumns
()
}
}
src/pages/transaction/saleOrder/readyPayResult/index.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
tableListSchema
}
from
'.
/schema
'
import
{
tableListSchema
}
from
'.
./constant
'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -20,7 +20,6 @@ const fetchTableData = async (params) => {
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
...
...
src/pages/transaction/saleOrder/readyPayResult/model/useSelfTable.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,6 @@ import { Button, Row, Col } from 'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
import
{
ORDER_TYPE
}
from
'@/constants/order'
import
StatusColors
from
'@/pages/transaction/components/StatusColors'
import
{
FieldTimeOutlined
}
from
'@ant-design/icons'
import
{
...
...
@@ -50,13 +49,13 @@ const CircleChart = props => {
</
Chart
>
}
//
业务hooks,
待支付订单
// 待支付订单
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
PurchaseOrderOutWorkStateTexts
=
getPurchaseOrderOutWorkState
()
const
SaleOrderInsideWorkStateTexts
=
getSaleOrderInsideWorkState
()
const
payOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
...
...
src/pages/transaction/saleOrder/secondApprovedOrder/index.tsx
View file @
1df4855a
...
...
@@ -4,7 +4,7 @@ import { StandardTable } from 'god'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PublicApi
}
from
'@/services/api'
import
{
useSelfTable
}
from
'./model/useSelfTable'
import
{
tableListSchema
}
from
'.
/schema
'
import
{
tableListSchema
}
from
'.
./constant
'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
Submit
from
'@/components/NiceForm/components/Submit'
...
...
@@ -22,7 +22,6 @@ const fetchTableData = async (params) => {
return
data
}
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
{
columns
,
...
...
@@ -56,7 +55,8 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
formilyProps=
{
{
ctx
:
{
inline
:
false
,
schema
:
tableListSchema
(),
schema
:
tableListSchema
(
'flex-end'
,
{
marginLeft
:
20
}),
// schema: tableListSchema(),
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
...
...
src/pages/transaction/saleOrder/secondApprovedOrder/model/useSelfTable.tsx
View file @
1df4855a
...
...
@@ -8,24 +8,30 @@ import { SaleOrderInsideWorkState } from '@/constants/order'
export
const
useSelfTable
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
handleSubmit
=
async
(
record
)
=>
{
if
(
record
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
TWO_LEVEL_AUDIT_ORDER
)
{
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=
${
record
.
id
}
`
)
}
history
.
push
(
`/memberCenter/tranactionAbility/saleOrder/secondApprovedOrder/detail?id=
${
record
.
id
}
`
)
}
const
secondColumns
:
any
[]
=
baseOrderListColumns
().
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
)
}
>
提交审核
</
Button
>
</>
const
secondColumns
=
()
=>
{
const
alreadyColumns
=
baseOrderListColumns
()
if
(
alreadyColumns
)
{
return
alreadyColumns
.
concat
([
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
{
return
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleSubmit
(
record
)
}
>
提交审核
</
Button
>
</>
}
}
])
}
])
}
return
{
columns
:
secondColumns
,
columns
:
secondColumns
()
,
ref
}
}
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