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
linweijiong
jinfa-platform
Commits
4d3b5581
Commit
4d3b5581
authored
Feb 19, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 售后换货支持积分订单
parent
a26d6757
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
27 deletions
+63
-27
index.tsx
src/pages/afterService/components/GoodsDrawer/index.tsx
+42
-19
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+19
-6
index.tsx
...pplication/repairPrSubmit/components/RepairForm/index.tsx
+1
-1
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+1
-1
No files found.
src/pages/afterService/components/GoodsDrawer/index.tsx
View file @
4d3b5581
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-02-
09 17:02
:36
* @LastEditTime: 2021-02-
19 15:03
:36
* @Description: 维修商品抽屉组件
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
...
...
@@ -13,7 +13,13 @@ import BigNumber from 'bignumber.js';
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
,
PAYWAY
,
PAY_CHANNEL
,
PayOutWorkState
}
from
'@/constants'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
,
PAYWAY
,
PAY_CHANNEL
,
PayOutWorkState
,
}
from
'@/constants'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NestTable
from
'@/components/NestTable'
;
import
{
goodItem
,
OrderListParams
,
OrderListRes
}
from
'./interface'
;
...
...
@@ -23,24 +29,40 @@ import { PublicApi } from '@/services/api';
const
formActions
=
createFormActions
();
const
PAGE_SIZE
=
1
0
;
const
PAGE_SIZE
=
1
6
;
interface
GoodsDrawerProps
{
// 选中值(子表格的值)
/**
* 选中值(子表格的值)
*/
checked
:
number
[];
// 抽屉标题
/**
* 抽屉标题
*/
title
?:
string
;
// 是否可见的
/**
* 是否可见的
*/
visible
:
boolean
;
// 关闭事件
/**
* 关闭事件
*/
onClose
:
()
=>
void
;
// 确定事件
/**
* 确定事件
*/
onConfirm
:
(
values
:
goodItem
[])
=>
void
;
// 选项改变事件
/**
* 选项改变事件
*/
onChange
:
(
value
:
number
[])
=>
void
;
// 获取订单列表数据
/**
* 获取订单列表数据
*/
fetchOrderList
:
(
params
:
any
)
=>
Promise
<
OrderListRes
>
;
// NestTableProps
/**
* NestTableProps
*/
nestProps
?:
{
[
key
:
string
]:
any
,
};
...
...
@@ -48,11 +70,10 @@ interface GoodsDrawerProps {
* 是否展示检索框
*/
searchable
?:
boolean
;
/**
* 流程类型:1.订单交易流程 2.售后换货流程 3.售后退货流程 4.售后维修流程
*/
t
ype
:
1
|
2
|
3
|
4
,
afterT
ype
:
1
|
2
|
3
|
4
,
};
interface
GoodsDrawerState
{
...
...
@@ -213,7 +234,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 获取订单列表
getOrderList
=
async
()
=>
{
const
{
page
,
size
,
searchVal
}
=
this
.
state
;
const
{
fetchOrderList
,
t
ype
}
=
this
.
props
;
const
{
fetchOrderList
,
afterT
ype
}
=
this
.
props
;
if
(
!
fetchOrderList
)
{
return
;
...
...
@@ -229,7 +250,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
let
processEnumRes
=
{
data
:
[],
code
:
0
};
// 售后退货、换货才涉及工作流相关
if
(
type
===
2
||
t
ype
===
3
)
{
if
(
afterType
===
2
||
afterT
ype
===
3
)
{
// 获取对应订单列表的工作流类型
const
payload
=
[];
...
...
@@ -241,7 +262,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
memberId
:
product
.
memberId
,
memberRoleId
:
product
.
memberRoleId
,
shopId
:
item
.
shopId
,
type
,
// 流程类型
type
:
afterType
,
// 流程类型
};
payload
.
push
(
atom
);
});
...
...
@@ -286,6 +307,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
...
product
,
orderNo
:
item
.
orderNo
,
payInfoList
:
item
.
payInfoList
,
orderType
:
item
.
type
,
});
}
});
...
...
@@ -540,7 +562,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 过滤工作流不同的 商品
filterProductByProcessEnum
=
(
data
)
=>
{
// 售后退货、换货才涉及工作流相关
if
(
this
.
props
.
type
!==
2
&&
this
.
props
.
t
ype
!==
3
)
{
if
(
this
.
props
.
afterType
!==
2
&&
this
.
props
.
afterT
ype
!==
3
)
{
return
data
;
}
const
first
=
data
.
length
?
data
[
0
]
:
null
;
...
...
@@ -548,9 +570,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
if
(
!
first
)
{
return
[];
}
const
filtered
=
data
.
filter
(
item
=>
item
.
processEnum
===
first
.
processEnum
);
// 过滤工作流不同的的商品,并且 订单类型不同的订单
const
filtered
=
data
.
filter
(
item
=>
item
.
processEnum
===
first
.
processEnum
&&
item
.
orderType
===
first
.
orderType
);
if
(
filtered
.
length
!==
data
.
length
)
{
message
.
warning
(
'已过滤掉
售后工作流不同的
商品'
);
message
.
warning
(
'已过滤掉
售后工作流不同 / 订单类型不同的
商品'
);
}
return
filtered
;
};
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
4d3b5581
...
...
@@ -12,7 +12,12 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReplaceGoodsPageReturnedGoodsResponseDetail
}
from
'@/services/AfterServiceApi'
;
import
{
normalizeFiledata
,
FileData
,
isJSONStr
}
from
'@/utils'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
,
ORDER_TYPE2_POINTS
,
ORDER_TYPE2_CHANNEL_POINTS
,
}
from
'@/constants'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
NiceForm
from
'@/components/NiceForm'
;
...
...
@@ -131,7 +136,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
},
];
const
childTableColumn
:
ColumnType
<
any
>
[]
=
[
const
childTableColumn
=
(
record
):
ColumnType
<
any
>
[]
=>
{
const
isPointsOrder
=
record
.
type
===
ORDER_TYPE2_POINTS
||
record
.
type
===
ORDER_TYPE2_CHANNEL_POINTS
;
return
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
...
...
@@ -158,17 +165,17 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
align
:
'center'
,
},
{
title
:
'订单
数量'
,
title
:
!
isPointsOrder
?
'订单数量'
:
'兑换
数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
'单价
'
,
title
:
!
isPointsOrder
?
'单价'
:
'所需积分
'
,
dataIndex
:
'price'
,
align
:
'center'
,
},
{
title
:
'采购金额
'
,
title
:
!
isPointsOrder
?
'采购金额'
:
'所需积分小计
'
,
dataIndex
:
'amount'
,
align
:
'center'
,
render
:
(
_
,
record
)
=>
(
record
.
purchaseCount
*
record
.
price
).
toFixed
(
2
),
...
...
@@ -179,6 +186,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
align
:
'center'
,
},
];
};
// 根据供应会员获取订单列表
const
getOrderList
=
(
params
):
Promise
<
OrderListRes
>
=>
{
...
...
@@ -230,6 +238,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
outerTaskList
,
replaceBatch
,
replaceId
,
orderType
,
...
rest
}
=
res
.
data
;
...
...
@@ -280,6 +289,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
remaining
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
id
:
item
.
orderRecordId
,
taskType
,
orderType
,
},
})),
...
rest
,
...
...
@@ -299,6 +309,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
setInfoLoading
(
true
);
PublicApi
.
getOrderProcurementOrderDetails
({
id
:
`
${
orderId
}
`
,
orderNo
:
''
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -450,6 +461,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
...
rest
,
})),
taskType
:
replaceGoodsList
[
0
].
extraData
.
taskType
,
orderType
:
replaceGoodsList
[
0
].
extraData
.
orderType
,
};
PublicApi
.
postAsReplaceGoodsSave
(
payload
)
...
...
@@ -519,6 +531,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
remaining
:
item
.
purchaseCount
-
(
item
.
replaceCount
||
0
),
// 可换货数量
id
:
item
.
id
,
taskType
:
item
.
processEnum
,
orderType
:
item
.
orderType
,
},
};
value
.
push
(
atom
);
...
...
@@ -621,7 +634,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
<
GoodsDrawer
title=
"选择换货商品"
t
ype=
{
2
}
afterT
ype=
{
2
}
visible=
{
visibleGoodsDrawer
}
fetchOrderList=
{
getOrderList
}
onClose=
{
()
=>
setVisibleGoodsDrawer
(
false
)
}
...
...
src/pages/afterService/repairApplication/repairPrSubmit/components/RepairForm/index.tsx
View file @
4d3b5581
...
...
@@ -460,7 +460,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
</
Card
>
<
GoodsDrawer
t
ype=
{
4
}
afterT
ype=
{
4
}
visible=
{
visibleDrawer
}
fetchOrderList=
{
getOrderList
}
onClose=
{
()
=>
setVisibleDrawer
(
false
)
}
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
4d3b5581
...
...
@@ -681,7 +681,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
<
GoodsDrawer
title=
"选择退货商品"
t
ype=
{
3
}
afterT
ype=
{
3
}
visible=
{
visibleGoodsDrawer
}
fetchOrderList=
{
getOrderList
}
onClose=
{
()
=>
setVisibleGoodsDrawer
(
false
)
}
...
...
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