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
shenshaokai
jinfa-platform
Commits
308034a1
Commit
308034a1
authored
Dec 22, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改翻译
parent
e7a2d8d4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
744 additions
and
747 deletions
+744
-747
schema.ts
src/components/AddressSelect/schema.ts
+1
-1
common.ts
src/locales/en-US/afterService/common.ts
+4
-5
components.ts
src/locales/en-US/afterService/components.ts
+7
-7
components.ts
src/locales/en-US/components.ts
+6
-6
components.ts
src/locales/ko-KR/components.ts
+5
-5
common.ts
src/locales/zh-CN/afterService/common.ts
+3
-4
index.tsx
src/pages/afterService/components/DeliverDrawer/index.tsx
+1
-1
index.tsx
...afterService/returnManage/components/DetailInfo/index.tsx
+717
-718
No files found.
src/components/AddressSelect/schema.ts
View file @
308034a1
...
...
@@ -204,7 +204,7 @@ export const createSchema = (addressType = 2): ISchema => {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
'x-component-props'
:
{
label
:
'{{ required("手机号码") }}'
,
label
:
`{{ required("
${
intl
.
formatMessage
({
id
:
'contract.shoujihaoma'
})}
") }}`
,
wrapperCol
:
24
,
},
properties
:
{
...
...
src/locales/en-US/afterService/common.ts
View file @
308034a1
...
...
@@ -54,11 +54,11 @@ export default {
'afterService.common.return.products'
:
'Return products'
,
'afterService.common.return.refunded'
:
'Refunded'
,
'afterService.common.replace.products'
:
'Replacement products'
,
'afterService.common.repair.products'
:
'Repair products'
,
'afterService.common.basicInfo.applyNo'
:
'Application number'
,
'afterService.common.basicInfo.orderType'
:
'After-sales order type'
,
'afterService.common.basicInfo.applyTime'
:
'Document time'
,
...
...
@@ -90,7 +90,7 @@ export default {
'afterService.common.applyVerify'
:
'Document review'
,
'afterService.common.confirmApply'
:
'Confirm application form'
,
'afterService.common.confirmVerify'
:
'Confirm documents'
,
'afterService.common.refundReceived'
:
'Return goods
receipt
'
,
'afterService.common.refundReceived'
:
'Return goods'
,
'afterService.common.refund'
:
'Refund'
,
'afterService.common.stop'
:
'Abort'
,
...
...
@@ -219,4 +219,4 @@ export default {
'afterService.apply.repairReason.required'
:
'Please fill in the reason for repair'
,
'afterService.apply.shippingAddress.repair'
:
'Repair Address'
,
'afterService.apply.shippingAddress.repair.required'
:
'Please select a repair address'
,
}
\ No newline at end of file
}
src/locales/en-US/afterService/components.ts
View file @
308034a1
...
...
@@ -3,7 +3,7 @@ export default {
'afterService.components.CheckVoucherModal.title'
:
'View voucher'
,
'afterService.components.DeliverDrawer.title'
:
'
{type}
delivery processing'
,
'afterService.components.DeliverDrawer.title'
:
'delivery processing'
,
'afterService.components.DeliverDrawer.overflow'
:
'The value filled in has exceeded the delivery quantity of {flow}, please fill in again'
,
'afterService.components.DeliverDrawer.type.replace'
:
'Replacement'
,
'afterService.components.DeliverDrawer.type.refund'
:
'Return goods'
,
...
...
@@ -15,17 +15,17 @@ export default {
'afterService.components.DeliverDrawer.category'
:
'Category'
,
'afterService.components.DeliverDrawer.brand'
:
'Brand'
,
'afterService.components.DeliverDrawer.unit'
:
'Unit'
,
'afterService.components.DeliverDrawer.applyCount'
:
'
{type}
Quantity'
,
'afterService.components.DeliverDrawer.applyCount'
:
'Quantity'
,
'afterService.components.DeliverDrawer.deliveryCount'
:
'Delivered {flow}'
,
'afterService.components.DeliverDrawer.noDeliveryCount'
:
'Not delivered in {flow}'
,
'afterService.components.DeliverDrawer.receiveCount'
:
'Received {flow}'
,
'afterService.components.DeliverDrawer.subCount'
:
'Number of differences'
,
'afterService.components.DeliverDrawer.count'
:
'
{flow}
delivery quantity'
,
'afterService.components.DeliverDrawer.count.required'
:
'Please enter
{flow}
delivery quantity'
,
'afterService.components.DeliverDrawer.count'
:
'delivery quantity'
,
'afterService.components.DeliverDrawer.count.required'
:
'Please enter delivery quantity'
,
'afterService.components.DeliverDrawer.count.legal'
:
'Keep up to 3 decimal places, greater than or equal to 0'
,
'afterService.components.DeliverDrawer.returnDeliverAddress'
:
'
{flow}
delivery address'
,
'afterService.components.DeliverDrawer.returnDeliverAddress.required'
:
'Please select
{flow}
delivery address'
,
'afterService.components.DeliverDrawer.deliveryTime'
:
'
{flow}
delivery time'
,
'afterService.components.DeliverDrawer.returnDeliverAddress'
:
'delivery address'
,
'afterService.components.DeliverDrawer.returnDeliverAddress.required'
:
'Please select delivery address'
,
'afterService.components.DeliverDrawer.deliveryTime'
:
'delivery time'
,
'afterService.components.DeliverDrawer.logisticsOrderNo'
:
'logistics order number'
,
'afterService.components.DeliverDrawer.logisticsName'
:
'logistics company'
,
...
...
src/locales/en-US/components.ts
View file @
308034a1
...
...
@@ -22,7 +22,7 @@ export default {
'components.qingshuru'
:
'Please enter'
,
'components.diqu'
:
'Region'
,
'components.shengfenzhixiashi'
:
'-Province/municipalities-'
,
'components.shi'
:
'-
市
-'
,
'components.shi'
:
'-
City
-'
,
'components.qu'
:
'-zone-'
,
'components.jiedao'
:
'-Street-'
,
'components.xiangxidizhi'
:
'Detailed address'
,
...
...
@@ -58,8 +58,8 @@ export default {
'components.zhanghukeyongyueyuan'
:
'Account available balance (yuan)'
,
'components.bencixuzhifuyuan'
:
'Pay this time (yuan)'
,
'components.cha'
:
'Poor'
,
'components.zhong'
:
'
中
'
,
'components.liang'
:
'
良
'
,
'components.zhong'
:
'
centre
'
,
'components.liang'
:
'
good
'
,
'components.you'
:
'Excellent'
,
'components.zhanbi'
:
'Proportion'
,
'components.fanbi'
:
'Inverse ratio'
,
...
...
@@ -69,7 +69,7 @@ export default {
'components.suoyou'
:
'All'
,
'components.tianjia'
:
'Add'
,
'components.guishudishi'
:
'Attribution to the city'
,
'components.companyLOGO'
:
'
公司
LOGO'
,
'components.companyLOGO'
:
'
Company
LOGO'
,
'components.companyjianjie'
:
'Company Profile'
,
'components.changfangzhaopian'
:
'Factory photos'
,
'components.zizhirongyu'
:
'Qualification honor'
,
...
...
@@ -187,7 +187,7 @@ export default {
'components.dianjichaxunliebiaoke'
:
'Click to query, the list can display the new products'
,
'components.anpinyinsousuo'
:
'Search by pinyin'
,
'components.chaping'
:
'bad review'
,
'components.zhongping'
:
'
中评
'
,
'components.zhongping'
:
'
commMiddle
'
,
'components.haoping'
:
'good comment'
,
'components.tuozhuaishangchuan'
:
'Drag and drop upload'
,
'components.shangchuan'
:
'Upload'
,
...
...
@@ -196,7 +196,7 @@ export default {
'components.qingxuanzequ'
:
'Please select a district'
,
'components.zanwushuju'
:
'No data yet'
,
'components.gong'
:
'Total'
,
'components.tiao'
:
'
条
'
,
'components.tiao'
:
'
strip
'
,
'components.quedingyaozhixingzhegecao'
:
'Are you sure you want to perform this operation?'
,
'components.shi1'
:
'Yes'
,
'components.fou'
:
'No'
,
...
...
src/locales/ko-KR/components.ts
View file @
308034a1
...
...
@@ -21,10 +21,10 @@ export default {
'components.ren'
:
'사람'
,
'components.qingshuru'
:
'입력하십시오.'
,
'components.diqu'
:
'지역.'
,
'components.shengfenzhixia
a
shi'
:
'-성/시-'
,
'components.shi'
:
'-시-'
,
'components.qu'
:
'-영역-'
,
'components.jiedao'
:
'-거리-'
,
'components.shengfenzhixiashi'
:
'-성/시-'
,
'components.shi'
:
'-시-'
,
'components.qu'
:
'-영역-'
,
'components.jiedao'
:
'-거리-'
,
'components.xiangxidizhi'
:
'상세 주소'
,
'components.qingshuruxiangxidizhi'
:
'상세 주소를 입력하십시오(최대 60자, 30자).'
,
'components.qingshuruxiangxidizhi1'
:
'상세 주소를 입력하십시오.'
,
...
...
@@ -243,7 +243,7 @@ export default {
'components.dianjixiazaishoujikehu'
:
'클릭하여 핸드폰 클라이언트 다운로드'
,
'components.dianjiyoushangjiaoxuanzeliu'
:
'오른쪽 상단을 클릭하여 브라우저 열기 선택'
,
'components.lingxishangchengAPP'
:
'옌옌상점 APP'
,
'components.CopyRightguangzhoushishushangyun'
:
'Copy Right©Guangzhou Shushangyun Network Technology Co., Ltd. 粤ICP备13044797号-5'
,
'components.CopyRightguangzhoushishushangyun'
:
'Copy Right©Guangzhou Shushangyun Network Technology Co., Ltd. 粤ICP备13044797号-5'
,
'components.mianzhaishengming'
:
'면책 성명'
,
'components.fuwutiaokuan'
:
'서비스 약관'
,
'components.lianxiwomen'
:
'연락처'
,
...
...
src/locales/zh-CN/afterService/common.ts
View file @
308034a1
...
...
@@ -54,11 +54,11 @@ export default {
'afterService.common.return.products'
:
'退货商品'
,
'afterService.common.return.refunded'
:
'已退款'
,
'afterService.common.replace.products'
:
'换货商品'
,
'afterService.common.repair.products'
:
'维修商品'
,
'afterService.common.basicInfo.applyNo'
:
'申请单号'
,
'afterService.common.basicInfo.orderType'
:
'售后订单类型'
,
'afterService.common.basicInfo.applyTime'
:
'单据时间'
,
...
...
@@ -219,4 +219,4 @@ export default {
'afterService.apply.repairReason.required'
:
'请填写维修原因'
,
'afterService.apply.shippingAddress.repair'
:
'维修地址'
,
'afterService.apply.shippingAddress.repair.required'
:
'请选择维修地址'
,
}
\ No newline at end of file
}
src/pages/afterService/components/DeliverDrawer/index.tsx
View file @
308034a1
...
...
@@ -356,7 +356,7 @@ const DeliverDrawer: React.FC<IProps> = (props) => {
}),
state
=>
{
if
(
+
value
>
+
noDeliveryCountValue
)
{
state
.
errors
=
[
intl
.
formatMessage
({
id
:
'afterService.components.DeliverDrawer.overflow'
},
{
flow
:
FLOW_TYPE_NAME_MAP
[
flowType
]
})];
;
state
.
errors
=
[
intl
.
formatMessage
({
id
:
'afterService.components.DeliverDrawer.overflow'
},
{
flow
:
FLOW_TYPE_NAME_MAP
[
flowType
]
})];
}
else
{
state
.
errors
=
[];
}
...
...
src/pages/afterService/returnManage/components/DetailInfo/index.tsx
View file @
308034a1
import
React
,
{
Suspense
,
useEffect
,
useState
}
from
'react'
;
import
{
Spin
,
Button
,
Row
,
Col
,
Badge
,
Switch
,
Tooltip
,
message
,
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
history
,
useIntl
}
from
'umi'
;
import
{
getAsReturnGoodsGetDetailBySupplier
,
GetAsReturnGoodsGetDetailBySupplierResponse
,
getAsReturnGoodsPageInnerWorkflowRecord
,
getAsReturnGoodsPageOuterWorkflowRecord
,
getAsReturnGoodsPageReturnedGoods
,
GetAsReturnGoodsPageReturnedGoodsResponse
,
postAsReturnGoodsConfirmReturnReceiveGoods
,
postAsReturnGoodsRefund
,
postAsReturnGoodsSetNeedReturnGoods
,
}
from
'@/services/AfterServiceV2Api'
;
import
{
RETURN_OUTER_STATUS_FINISHED
,
RETURN_OUTER_STATUS_TO_BE_REFUNDED
,
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
,
RETURN_OUTER_STATUS_NOT_RECEIVED
,
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
,
RETURN_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants/afterService'
;
import
{
ORDER_TYPE_TENDER_CONTRACT
,
ORDER_TYPE
,
}
from
'@/constants/order'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AnchorPage
from
'@/components/AnchorPage'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
AuditProcess
from
'@/components/AuditProcess'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
DescProgress
from
'@/components/DescProgress'
;
import
{
Values
as
ReturnAddressValues
}
from
'../../../components/ReturnAddressInfo'
;
import
ReturnInfoDrawer
,
{
ReturnApplyInfo
}
from
'../../../components/ReturnInfoDrawer'
;
import
{
OuterHistoryData
,
InnerHistoryData
}
from
'../../../components/FlowRecords'
;
import
{
RETURN_OUTER_STATUS_TAG_MAP
,
RETURN_INNER_STATUS_BADGE_MAP
,
}
from
'../../../constants'
;
import
{
isMaterialOrder
}
from
'../../../utils'
;
const
ProductList
=
React
.
lazy
(()
=>
import
(
'../../../components/ProductList'
));
const
ReturnAnalysis
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnAnalysis'
));
const
ReturnDetailInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnDetailInfo'
));
const
FileList
=
React
.
lazy
(()
=>
import
(
'../../../components/FileList'
));
const
ReturnAddressInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnAddressInfo'
));
const
Score
=
React
.
lazy
(()
=>
import
(
'../../../components/Score'
));
const
FlowRecords
=
React
.
lazy
(()
=>
import
(
'../../../components/FlowRecords'
));
const
BasicInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/BasicInfo'
));
interface
DetailInfoProps
{
/**
* 记录id
*/
id
:
string
;
/**
* 是否是可编辑 是否需要退货
*/
isEditReturn
?:
boolean
;
/**
* 是否是 可以退款的
*/
isEditRefund
?:
boolean
;
/**
* 是否是 可以编辑 地址的
*/
isEditAddress
?:
boolean
;
/**
* 是否是 可以编辑 退货发货相关
*/
isEditRefundDeliver
?:
boolean
;
/**
* 历史记录目标路径
*/
target
:
string
;
/**
* 头部右侧拓展
*/
headExtra
?:
(
info
:
DetailInfo
,
returnAddress
:
ReturnAddressValues
)
=>
React
.
ReactNode
;
};
interface
DetailInfo
extends
GetAsReturnGoodsGetDetailBySupplierResponse
{
fileList
:
FileData
[];
};
const
DetailInfo
:
React
.
FC
<
DetailInfoProps
>
=
({
id
,
isEditReturn
=
false
,
isEditRefund
=
false
,
isEditAddress
=
false
,
isEditRefundDeliver
=
false
,
target
,
headExtra
=
null
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
returnGoodsLoading
,
setReturnGoodsLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
visibleOrderDetial
,
setVisibleReturnInfo
]
=
useState
<
boolean
>
(
false
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
const
[
applyInfo
,
setApplyInfo
]
=
useState
<
ReturnApplyInfo
>
(
null
);
const
intl
=
useIntl
();
const
handleCheckOrderDetial
=
record
=>
{
setApplyInfo
({
orderId
:
record
.
orderId
,
orderNo
:
record
.
orderNo
,
productName
:
record
.
productName
,
category
:
record
.
category
,
brand
:
record
.
brand
,
unit
:
record
.
unit
,
purchaseCount
:
record
.
purchaseCount
,
purchasePrice
:
record
.
purchasePrice
,
purchaseAmount
:
record
.
purchaseAmount
,
returnCount
:
record
.
returnCount
,
returnReason
:
record
.
returnReason
,
payList
:
record
.
payList
.
map
(
item
=>
({
...
item
,
payWayTxt
:
item
.
payWayName
,
channelTxt
:
item
.
channelName
,
})),
orderType
:
detailInfo
?.
orderType
,
refundAmount
:
record
.
refundAmount
,
});
setVisibleReturnInfo
(
true
);
};
const
handleReturn
=
record
=>
{
if
(
!
isEditReturn
||
!
id
)
{
return
;
}
const
msg
=
message
.
loading
({
content
:
intl
.
formatMessage
({
id
:
'afterService.common.upload.message'
},
{
default
:
'正在更改...'
}),
duration
:
0
,
});
postAsReturnGoodsSetNeedReturnGoods
({
returnId
:
+
id
,
returnGoodsId
:
record
.
returnGoodsId
,
isNeed
:
record
.
isNeedReturn
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getReturnGoods
();
}
}).
finally
(()
=>
{
msg
();
});
};
const
isMateriel
=
isMaterialOrder
(
detailInfo
?.
orderType
);
const
productColumns
:
EditableColumns
[]
=
[
{
title
:
'订单号'
,
dataIndex
:
'orderNo'
,
render
:
(
text
,
record
)
=>
(
<
a
href=
{
`${target}/orderDetail?id=${record.orderId}`
}
target=
"_blank"
>
{
text
}
</
a
>
),
},
...(
!
isMateriel
?
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.productId'
},
{
default
:
'商品ID'
}),
dataIndex
:
'productId'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.productName'
},
{
default
:
'商品名称'
}),
dataIndex
:
'productName'
,
ellipsis
:
true
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.category'
},
{
default
:
'品类'
}),
dataIndex
:
'category'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.brand'
},
{
default
:
'品牌'
}),
dataIndex
:
'brand'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.unit'
},
{
default
:
'单位'
}),
dataIndex
:
'unit'
,
}
]
:
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialNo'
},
{
default
:
'物料编号'
}),
dataIndex
:
'productId'
,
},
{
title
:
`
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialName'
},
{
default
:
'物料名称'
})}
、
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialSpec'
},
{
default
:
'规格'
})}
`
,
dataIndex
:
'productName'
,
render
:
(
text
,
record
)
=>
`
${
text
}${
record
.
type
?
'/'
+
record
.
type
:
''
}
`
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.category'
},
{
default
:
'品类'
}),
dataIndex
:
'category'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.brand'
},
{
default
:
'品牌'
}),
dataIndex
:
'brand'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.unit'
},
{
default
:
'单位'
}),
dataIndex
:
'unit'
,
},
{
title
:
detailInfo
?.
orderType
!==
ORDER_TYPE_TENDER_CONTRACT
?
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialMergeInfo1'
},
{
default
:
'关联报价商品ID、名称、规格、品类、品牌'
})
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialMergeInfo2'
},
{
default
:
'关联投标商品ID、名称、规格、品类、品牌'
}),
dataIndex
:
'associatedProductId'
,
render
:
(
text
,
record
)
=>
`
${
text
||
''
}
/
${
record
.
associatedProductName
||
''
}
/
${
record
.
associatedType
||
''
}
/
${
record
.
associatedCategory
||
''
}
/
${
record
.
associatedBrand
||
''
}
`
,
},
]
),
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseCount'
},
{
default
:
'采购数量'
}),
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchasePrice'
},
{
default
:
'采购单价'
}),
dataIndex
:
'purchasePrice'
,
align
:
'center'
,
},
!
isMateriel
?
{
title
:
`
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.payAmount'
},
{
default
:
'已支付'
})}
/
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseAmount'
},
{
default
:
'采购金额'
})}
`
,
dataIndex
:
'payAmount'
,
render
:
(
text
,
record
)
=>
(
<
DescProgress
descriptions=
{
[
{
title
:
`${intl.formatMessage({ id: 'afterService.common.productColumns.payAmount2' }, { default: '已支付金额' })}:`
,
value
:
`${intl.formatMessage({ id: 'common.money' }, { default: '¥' })}${text}`
,
},
{
title
:
`${intl.formatMessage({ id: 'afterService.common.productColumns.purchaseAmount' }, { default: '采购金额' })}:`
,
value
:
`${intl.formatMessage({ id: 'common.money' }, { default: '¥' })}${record.purchaseAmount}`
,
},
]
}
percent=
{
(
text
/
record
.
purchaseAmount
)
*
100
}
/>
),
}
:
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseAmount'
},
{
default
:
'采购金额'
}),
dataIndex
:
'purchaseAmount'
,
align
:
'center'
,
render
:
text
=>
`
${
intl
.
formatMessage
({
id
:
'common.money'
},
{
default
:
'¥'
})}${
text
}
`
,
}
,
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.returnCount'
},
{
default
:
'退货数量'
}),
dataIndex
:
'returnCount'
,
align
:
'center'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.refundAmount'
},
{
default
:
'退货金额'
}),
dataIndex
:
'refundAmount'
,
align
:
'center'
,
},
{
title
:
(
<>
<
span
style=
{
{
marginRight
:
8
}
}
>
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.needReturn'
},
{
default
:
'是否需要退货'
})
}
</
span
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.needReturn.tip'
},
{
default
:
'如果商品因为缺陷原因,无法再退回加工后重新使用,可选择不需要退货,选择后,采购方无须退回不良品。'
})
}
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</>
),
dataIndex
:
'needReturnName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
{
!
isEditReturn
?
(
text
)
:
(
<
Switch
checked=
{
record
.
isNeedReturn
}
onChange=
{
()
=>
handleReturn
(
record
)
}
/>
)
}
</>
),
},
{
title
:
intl
.
formatMessage
({
id
:
'common.table.action'
}),
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
handleCheckOrderDetial
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.checkInfo'
},
{
default
:
'查看详情'
})
}
</
Button
>
</>
),
},
]
as
EditableColumns
[];
// 获取退货申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoloading
(
true
);
getAsReturnGoodsGetDetailBySupplier
({
returnId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
faultFileList
,
...
rest
}
=
res
.
data
;
setDetailInfo
({
faultFileList
,
fileList
:
faultFileList
?.
map
(
item
=>
normalizeFiledata
(
item
.
filePath
)),
...
rest
,
});
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setInfoloading
(
false
);
});
};
// 获取退货明细列表
const
getReturnGoods
=
()
=>
{
if
(
!
id
)
{
return
;
}
setReturnGoodsLoading
(
true
);
getAsReturnGoodsPageReturnedGoods
({
returnId
:
id
,
current
:
`
${
1
}
`
,
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReturnGoodsList
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setReturnGoodsLoading
(
false
);
});
};
useEffect
(()
=>
{
getDetailInfo
();
getReturnGoods
();
},
[]);
const
handleReturnAddressSubmit
=
values
=>
{
setReturnAddress
(
values
);
};
const
fetchOuterHistory
=
(
params
):
Promise
<
OuterHistoryData
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getAsReturnGoodsPageOuterWorkflowRecord
({
...
params
,
dataId
:
id
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
(
res
);
})
.
catch
(
err
=>
{
reject
(
err
);
});
});
};
const
fetchInnerHistory
=
(
params
):
Promise
<
InnerHistoryData
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getAsReturnGoodsPageInnerWorkflowRecord
({
...
params
,
dataId
:
id
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
(
res
);
})
.
catch
(
err
=>
{
reject
(
err
);
});
});
};
// 确认退货收货
const
handleReceivedConfirmReturnReceive
=
(
id
):
Promise
<
any
>
=>
{
return
postAsReturnGoodsConfirmReturnReceiveGoods
({
dataId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
};
// 退款
const
handleRefund
=
(
values
):
Promise
<
any
>
=>
{
const
{
id
,
refundAmount
,
...
rest
}
=
values
;
return
postAsReturnGoodsRefund
({
dataId
:
id
,
...
rest
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getDetailInfo
();
}
});
};
const
anchorsArr
=
[
{
key
:
'taskList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.taskList'
},
{
default
:
'流转进度'
}),
},
{
key
:
'basicInfo'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.basicInfo'
},
{
default
:
'基本信息'
}),
},
{
key
:
'goodsDetailList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.refundProducts'
},
{
default
:
'退货商品'
}),
},
{
key
:
'faultFileList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.faultFileList'
},
{
default
:
'附件'
}),
},
{
key
:
'returnGoodsAddress'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.returnGoodsAddress'
},
{
default
:
'退货收货地址'
}),
},
(
detailInfo
&&
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
?
{
key
:
'evaluate'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.evaluate'
},
{
default
:
'售后评价'
}),
}
:
null
),
(
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
&&
detailInfo
.
returnDeliveryGoodsList
.
length
>
0
?
{
key
:
'returnDeliveryGoodsList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.returnDeliveryGoodsList'
},
{
default
:
'退货发货信息'
}),
}
:
null
),
(
detailInfo
&&
!
isMateriel
&&
(
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_TO_BE_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_NOT_RECEIVED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
)
?
{
key
:
'refundList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.refundList'
},
{
default
:
'退款明细'
}),
}
:
null
),
{
key
:
'workflowRecord'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.workflowRecord'
},
{
default
:
'流转记录'
}),
},
].
filter
(
Boolean
);
const
BasicInfoData
=
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyNo'
},
{
default
:
'申请单号'
}),
value
:
detailInfo
&&
detailInfo
.
applyNo
?
detailInfo
.
applyNo
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.orderType'
},
{
default
:
'售后订单类型'
}),
value
:
detailInfo
&&
detailInfo
.
orderType
?
ORDER_TYPE
[
detailInfo
.
orderType
]
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyTime'
},
{
default
:
'单据时间'
}),
value
:
detailInfo
&&
detailInfo
.
applyTime
?
detailInfo
.
applyTime
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyAbstract'
},
{
default
:
'申请摘要'
}),
value
:
detailInfo
&&
detailInfo
.
applyAbstract
?
detailInfo
.
applyAbstract
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.consumerName'
},
{
default
:
'采购会员'
}),
value
:
detailInfo
&&
detailInfo
.
consumerName
?
detailInfo
.
consumerName
:
''
,
columnProps
:
{
span
:
2
,
},
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.outerStatus'
},
{
default
:
'外部状态'
}),
value
:
(
<
StatusTag
type=
{
RETURN_OUTER_STATUS_TAG_MAP
[
detailInfo
?.
outerStatus
]
}
title=
{
detailInfo
?.
outerStatusName
}
/>
),
columnProps
:
{
span
:
3
,
},
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.innerStatus'
},
{
default
:
'内部状态'
}),
value
:
(
<
Badge
color=
{
RETURN_INNER_STATUS_BADGE_MAP
[
detailInfo
?.
innerStatus
]
||
'#606266'
}
text=
{
detailInfo
?.
innerStatusName
}
/>
),
columnProps
:
{
span
:
3
,
},
},
];
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
`${detailInfo && detailInfo.applyAbstract ? detailInfo.applyAbstract : ''} | ${detailInfo && detailInfo.applyNo ? detailInfo.applyNo : ''}`
}
anchors=
{
anchorsArr
}
extra=
{
headExtra
&&
headExtra
(
detailInfo
,
returnAddress
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 流转进度 */
}
<
Col
span=
{
24
}
>
<
AuditProcess
outerVerifySteps=
{
detailInfo
&&
detailInfo
.
outerTaskList
?
detailInfo
.
outerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
outerVerifyCurrent=
{
findLastIndexFlowState
(
detailInfo
?.
outerTaskList
)
}
innerVerifySteps=
{
detailInfo
&&
detailInfo
.
innerTaskList
?
detailInfo
.
innerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
detailInfo
?.
innerTaskList
)
}
id=
"taskList"
/>
</
Col
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
BasicInfo
data=
{
BasicInfoData
}
id=
"basicInfo"
/>
</
Suspense
>
</
Col
>
{
/* 退货商品 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ProductList
title=
{
intl
.
formatMessage
({
id
:
'afterService.common.return.products'
},
{
default
:
'退货商品'
})
}
rowKey=
"orderRecordId"
columns=
{
productColumns
}
loading=
{
returnGoodsLoading
}
dataSource=
{
returnGoodsList
.
data
}
id=
"goodsDetailList"
/>
</
Suspense
>
</
Col
>
{
/* 附件 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
FileList
fileList=
{
detailInfo
?.
fileList
}
id=
"faultFileList"
/>
</
Suspense
>
</
Col
>
{
/* 退货地址信息 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnAddressInfo
deliveryAddress=
{
{
id
:
detailInfo
?.
returnGoodsAddress
?.
receiveId
,
name
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
receiveAddress
,
}
}
shippingAddress=
{
{
deliveryType
:
detailInfo
?.
returnGoodsAddress
?.
deliveryType
,
name
:
detailInfo
?.
returnGoodsAddress
?.
sendUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
sendUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
sendAddress
,
}
}
onFormSubmit=
{
handleReturnAddressSubmit
}
isEdit=
{
isEditAddress
&&
detailInfo
?.
innerStatus
===
RETURN_INNER_STATUS_UNCOMMITTED
}
id=
"returnGoodsAddress"
/>
</
Suspense
>
</
Col
>
{
/* 售后评价 */
}
{
detailInfo
&&
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
Score
score=
{
detailInfo
?.
evaluate
?.
level
}
content=
{
detailInfo
?.
evaluate
?.
content
}
id=
"evaluate"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 退货发货信息 */
}
{
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
&&
detailInfo
.
returnDeliveryGoodsList
.
length
>
0
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnAnalysis
summary=
{
detailInfo
&&
detailInfo
.
returnStatisticsList
?
detailInfo
.
returnStatisticsList
:
[]
}
detailed=
{
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
?
detailInfo
.
returnDeliveryGoodsList
:
[]
}
onConfirmReturnReceive=
{
handleReceivedConfirmReturnReceive
}
innerStatus=
{
detailInfo
?.
innerStatus
}
target=
{
target
}
isEdit=
{
isEditRefundDeliver
}
afterType=
{
3
}
deliveryType=
{
detailInfo
?.
returnGoodsAddress
?.
deliveryType
}
orderType=
{
detailInfo
?.
orderType
}
id=
"returnDeliveryGoodsList"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 退款明细信息 */
}
{
detailInfo
&&
!
isMateriel
&&
(
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_TO_BE_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_NOT_RECEIVED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
)
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnDetailInfo
dataSource=
{
detailInfo
&&
detailInfo
.
refundList
?
detailInfo
.
refundList
:
[]
}
onRefund=
{
handleRefund
}
outerStatus=
{
detailInfo
?.
outerStatus
}
purchaserId=
{
detailInfo
?.
memberId
}
purchaserRoleId=
{
detailInfo
?.
roleId
}
supplierId=
{
detailInfo
?.
parentMemberId
}
supplierRoleId=
{
detailInfo
?.
parentMemberRoleId
}
isEdit=
{
isEditRefund
}
id=
"refundList"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 内、外部流转记录 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
FlowRecords
fetchOuterHistory=
{
fetchOuterHistory
}
fetchInnerHistory=
{
fetchInnerHistory
}
outerStatusMap=
{
RETURN_OUTER_STATUS_TAG_MAP
}
innerStatusColorMap=
{
RETURN_INNER_STATUS_BADGE_MAP
}
id=
"workflowRecord"
/>
</
Suspense
>
</
Col
>
</
Row
>
<
ReturnInfoDrawer
visible=
{
visibleOrderDetial
}
applyInfo=
{
applyInfo
}
onClose=
{
()
=>
setVisibleReturnInfo
(
false
)
}
/>
</
AnchorPage
>
</
Spin
>
);
};
export
default
DetailInfo
;
\ No newline at end of file
import
React
,
{
Suspense
,
useEffect
,
useState
}
from
'react'
;
import
{
Spin
,
Button
,
Row
,
Col
,
Badge
,
Switch
,
Tooltip
,
message
,
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
history
,
useIntl
}
from
'umi'
;
import
{
getAsReturnGoodsGetDetailBySupplier
,
GetAsReturnGoodsGetDetailBySupplierResponse
,
getAsReturnGoodsPageInnerWorkflowRecord
,
getAsReturnGoodsPageOuterWorkflowRecord
,
getAsReturnGoodsPageReturnedGoods
,
GetAsReturnGoodsPageReturnedGoodsResponse
,
postAsReturnGoodsConfirmReturnReceiveGoods
,
postAsReturnGoodsRefund
,
postAsReturnGoodsSetNeedReturnGoods
,
}
from
'@/services/AfterServiceV2Api'
;
import
{
RETURN_OUTER_STATUS_FINISHED
,
RETURN_OUTER_STATUS_TO_BE_REFUNDED
,
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
,
RETURN_OUTER_STATUS_NOT_RECEIVED
,
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
,
RETURN_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants/afterService'
;
import
{
ORDER_TYPE_TENDER_CONTRACT
,
ORDER_TYPE
,
}
from
'@/constants/order'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AnchorPage
from
'@/components/AnchorPage'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
AuditProcess
from
'@/components/AuditProcess'
;
import
{
EditableColumns
}
from
'@/components/PolymericTable/interface'
;
import
DescProgress
from
'@/components/DescProgress'
;
import
{
Values
as
ReturnAddressValues
}
from
'../../../components/ReturnAddressInfo'
;
import
ReturnInfoDrawer
,
{
ReturnApplyInfo
}
from
'../../../components/ReturnInfoDrawer'
;
import
{
OuterHistoryData
,
InnerHistoryData
}
from
'../../../components/FlowRecords'
;
import
{
RETURN_OUTER_STATUS_TAG_MAP
,
RETURN_INNER_STATUS_BADGE_MAP
,
}
from
'../../../constants'
;
import
{
isMaterialOrder
}
from
'../../../utils'
;
const
ProductList
=
React
.
lazy
(()
=>
import
(
'../../../components/ProductList'
));
const
ReturnAnalysis
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnAnalysis'
));
const
ReturnDetailInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnDetailInfo'
));
const
FileList
=
React
.
lazy
(()
=>
import
(
'../../../components/FileList'
));
const
ReturnAddressInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ReturnAddressInfo'
));
const
Score
=
React
.
lazy
(()
=>
import
(
'../../../components/Score'
));
const
FlowRecords
=
React
.
lazy
(()
=>
import
(
'../../../components/FlowRecords'
));
const
BasicInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/BasicInfo'
));
interface
DetailInfoProps
{
/**
* 记录id
*/
id
:
string
;
/**
* 是否是可编辑 是否需要退货
*/
isEditReturn
?:
boolean
;
/**
* 是否是 可以退款的
*/
isEditRefund
?:
boolean
;
/**
* 是否是 可以编辑 地址的
*/
isEditAddress
?:
boolean
;
/**
* 是否是 可以编辑 退货发货相关
*/
isEditRefundDeliver
?:
boolean
;
/**
* 历史记录目标路径
*/
target
:
string
;
/**
* 头部右侧拓展
*/
headExtra
?:
(
info
:
DetailInfo
,
returnAddress
:
ReturnAddressValues
)
=>
React
.
ReactNode
;
};
interface
DetailInfo
extends
GetAsReturnGoodsGetDetailBySupplierResponse
{
fileList
:
FileData
[];
};
const
DetailInfo
:
React
.
FC
<
DetailInfoProps
>
=
({
id
,
isEditReturn
=
false
,
isEditRefund
=
false
,
isEditAddress
=
false
,
isEditRefundDeliver
=
false
,
target
,
headExtra
=
null
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
returnGoodsLoading
,
setReturnGoodsLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
visibleOrderDetial
,
setVisibleReturnInfo
]
=
useState
<
boolean
>
(
false
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
const
[
applyInfo
,
setApplyInfo
]
=
useState
<
ReturnApplyInfo
>
(
null
);
const
intl
=
useIntl
();
const
handleCheckOrderDetial
=
record
=>
{
setApplyInfo
({
orderId
:
record
.
orderId
,
orderNo
:
record
.
orderNo
,
productName
:
record
.
productName
,
category
:
record
.
category
,
brand
:
record
.
brand
,
unit
:
record
.
unit
,
purchaseCount
:
record
.
purchaseCount
,
purchasePrice
:
record
.
purchasePrice
,
purchaseAmount
:
record
.
purchaseAmount
,
returnCount
:
record
.
returnCount
,
returnReason
:
record
.
returnReason
,
payList
:
record
.
payList
.
map
(
item
=>
({
...
item
,
payWayTxt
:
item
.
payWayName
,
channelTxt
:
item
.
channelName
,
})),
orderType
:
detailInfo
?.
orderType
,
refundAmount
:
record
.
refundAmount
,
});
setVisibleReturnInfo
(
true
);
};
const
handleReturn
=
record
=>
{
if
(
!
isEditReturn
||
!
id
)
{
return
;
}
const
msg
=
message
.
loading
({
content
:
intl
.
formatMessage
({
id
:
'afterService.common.upload.message'
},
{
default
:
'正在更改...'
}),
duration
:
0
,
});
postAsReturnGoodsSetNeedReturnGoods
({
returnId
:
+
id
,
returnGoodsId
:
record
.
returnGoodsId
,
isNeed
:
record
.
isNeedReturn
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getReturnGoods
();
}
}).
finally
(()
=>
{
msg
();
});
};
const
isMateriel
=
isMaterialOrder
(
detailInfo
?.
orderType
);
const
productColumns
:
EditableColumns
[]
=
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.order.query.column.orderNo'
},
{
default
:
'订单号'
}),
dataIndex
:
'orderNo'
,
render
:
(
text
,
record
)
=>
(
<
a
href=
{
`${target}/orderDetail?id=${record.orderId}`
}
target=
"_blank"
>
{
text
}
</
a
>
),
},
...(
!
isMateriel
?
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.productId'
},
{
default
:
'商品ID'
}),
dataIndex
:
'productId'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.productName'
},
{
default
:
'商品名称'
}),
dataIndex
:
'productName'
,
ellipsis
:
true
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.category'
},
{
default
:
'品类'
}),
dataIndex
:
'category'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.brand'
},
{
default
:
'品牌'
}),
dataIndex
:
'brand'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.unit'
},
{
default
:
'单位'
}),
dataIndex
:
'unit'
,
}
]
:
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialNo'
},
{
default
:
'物料编号'
}),
dataIndex
:
'productId'
,
},
{
title
:
`
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialName'
},
{
default
:
'物料名称'
})}
、
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialSpec'
},
{
default
:
'规格'
})}
`
,
dataIndex
:
'productName'
,
render
:
(
text
,
record
)
=>
`
${
text
}${
record
.
type
?
'/'
+
record
.
type
:
''
}
`
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.category'
},
{
default
:
'品类'
}),
dataIndex
:
'category'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.brand'
},
{
default
:
'品牌'
}),
dataIndex
:
'brand'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.unit'
},
{
default
:
'单位'
}),
dataIndex
:
'unit'
,
},
{
title
:
detailInfo
?.
orderType
!==
ORDER_TYPE_TENDER_CONTRACT
?
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialMergeInfo1'
},
{
default
:
'关联报价商品ID、名称、规格、品类、品牌'
})
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.materialMergeInfo2'
},
{
default
:
'关联投标商品ID、名称、规格、品类、品牌'
}),
dataIndex
:
'associatedProductId'
,
render
:
(
text
,
record
)
=>
`
${
text
||
''
}
/
${
record
.
associatedProductName
||
''
}
/
${
record
.
associatedType
||
''
}
/
${
record
.
associatedCategory
||
''
}
/
${
record
.
associatedBrand
||
''
}
`
,
},
]
),
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseCount'
},
{
default
:
'采购数量'
}),
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchasePrice'
},
{
default
:
'采购单价'
}),
dataIndex
:
'purchasePrice'
,
align
:
'center'
,
},
!
isMateriel
?
{
title
:
`
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.payAmount'
},
{
default
:
'已支付'
})}
/
${
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseAmount'
},
{
default
:
'采购金额'
})}
`
,
dataIndex
:
'payAmount'
,
render
:
(
text
,
record
)
=>
(
<
DescProgress
descriptions=
{
[
{
title
:
`${intl.formatMessage({ id: 'afterService.common.productColumns.payAmount2' }, { default: '已支付金额' })}:`
,
value
:
`${intl.formatMessage({ id: 'common.money' }, { default: '¥' })}${text}`
,
},
{
title
:
`${intl.formatMessage({ id: 'afterService.common.productColumns.purchaseAmount' }, { default: '采购金额' })}:`
,
value
:
`${intl.formatMessage({ id: 'common.money' }, { default: '¥' })}${record.purchaseAmount}`
,
},
]
}
percent=
{
(
text
/
record
.
purchaseAmount
)
*
100
}
/>
),
}
:
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.purchaseAmount'
},
{
default
:
'采购金额'
}),
dataIndex
:
'purchaseAmount'
,
align
:
'center'
,
render
:
text
=>
`
${
intl
.
formatMessage
({
id
:
'common.money'
},
{
default
:
'¥'
})}${
text
}
`
,
}
,
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.returnCount'
},
{
default
:
'退货数量'
}),
dataIndex
:
'returnCount'
,
align
:
'center'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.refundAmount'
},
{
default
:
'退货金额'
}),
dataIndex
:
'refundAmount'
,
align
:
'center'
,
},
{
title
:
(
<>
<
span
style=
{
{
marginRight
:
8
}
}
>
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.needReturn'
},
{
default
:
'是否需要退货'
})
}
</
span
>
<
Tooltip
title=
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.needReturn.tip'
},
{
default
:
'如果商品因为缺陷原因,无法再退回加工后重新使用,可选择不需要退货,选择后,采购方无须退回不良品。'
})
}
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</>
),
dataIndex
:
'needReturnName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
{
!
isEditReturn
?
(
text
)
:
(
<
Switch
checked=
{
record
.
isNeedReturn
}
onChange=
{
()
=>
handleReturn
(
record
)
}
/>
)
}
</>
),
},
{
title
:
intl
.
formatMessage
({
id
:
'common.table.action'
}),
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
handleCheckOrderDetial
(
record
)
}
>
{
intl
.
formatMessage
({
id
:
'afterService.common.productColumns.checkInfo'
},
{
default
:
'查看详情'
})
}
</
Button
>
</>
),
},
]
as
EditableColumns
[];
// 获取退货申请详情
const
getDetailInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoloading
(
true
);
getAsReturnGoodsGetDetailBySupplier
({
returnId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
faultFileList
,
...
rest
}
=
res
.
data
;
setDetailInfo
({
faultFileList
,
fileList
:
faultFileList
?.
map
(
item
=>
normalizeFiledata
(
item
.
filePath
)),
...
rest
,
});
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setInfoloading
(
false
);
});
};
// 获取退货明细列表
const
getReturnGoods
=
()
=>
{
if
(
!
id
)
{
return
;
}
setReturnGoodsLoading
(
true
);
getAsReturnGoodsPageReturnedGoods
({
returnId
:
id
,
current
:
`
${
1
}
`
,
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReturnGoodsList
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setReturnGoodsLoading
(
false
);
});
};
useEffect
(()
=>
{
getDetailInfo
();
getReturnGoods
();
},
[]);
const
handleReturnAddressSubmit
=
values
=>
{
setReturnAddress
(
values
);
};
const
fetchOuterHistory
=
(
params
):
Promise
<
OuterHistoryData
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getAsReturnGoodsPageOuterWorkflowRecord
({
...
params
,
dataId
:
id
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
(
res
);
})
.
catch
(
err
=>
{
reject
(
err
);
});
});
};
const
fetchInnerHistory
=
(
params
):
Promise
<
InnerHistoryData
>
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getAsReturnGoodsPageInnerWorkflowRecord
({
...
params
,
dataId
:
id
,
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
);
}
reject
(
res
);
})
.
catch
(
err
=>
{
reject
(
err
);
});
});
};
// 确认退货收货
const
handleReceivedConfirmReturnReceive
=
(
id
):
Promise
<
any
>
=>
{
return
postAsReturnGoodsConfirmReturnReceiveGoods
({
dataId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
}
});
};
// 退款
const
handleRefund
=
(
values
):
Promise
<
any
>
=>
{
const
{
id
,
refundAmount
,
...
rest
}
=
values
;
return
postAsReturnGoodsRefund
({
dataId
:
id
,
...
rest
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getDetailInfo
();
}
});
};
const
anchorsArr
=
[
{
key
:
'taskList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.taskList'
},
{
default
:
'流转进度'
}),
},
{
key
:
'basicInfo'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.basicInfo'
},
{
default
:
'基本信息'
}),
},
{
key
:
'goodsDetailList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.refundProducts'
},
{
default
:
'退货商品'
}),
},
{
key
:
'faultFileList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.faultFileList'
},
{
default
:
'附件'
}),
},
{
key
:
'returnGoodsAddress'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.returnGoodsAddress'
},
{
default
:
'退货收货地址'
}),
},
(
detailInfo
&&
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
?
{
key
:
'evaluate'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.evaluate'
},
{
default
:
'售后评价'
}),
}
:
null
),
(
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
&&
detailInfo
.
returnDeliveryGoodsList
.
length
>
0
?
{
key
:
'returnDeliveryGoodsList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.returnDeliveryGoodsList'
},
{
default
:
'退货发货信息'
}),
}
:
null
),
(
detailInfo
&&
!
isMateriel
&&
(
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_TO_BE_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_NOT_RECEIVED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
)
?
{
key
:
'refundList'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.refundList'
},
{
default
:
'退款明细'
}),
}
:
null
),
{
key
:
'workflowRecord'
,
name
:
intl
.
formatMessage
({
id
:
'afterService.common.return.anchors.workflowRecord'
},
{
default
:
'流转记录'
}),
},
].
filter
(
Boolean
);
const
BasicInfoData
=
[
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyNo'
},
{
default
:
'申请单号'
}),
value
:
detailInfo
&&
detailInfo
.
applyNo
?
detailInfo
.
applyNo
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.orderType'
},
{
default
:
'售后订单类型'
}),
value
:
detailInfo
&&
detailInfo
.
orderType
?
ORDER_TYPE
[
detailInfo
.
orderType
]
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyTime'
},
{
default
:
'单据时间'
}),
value
:
detailInfo
&&
detailInfo
.
applyTime
?
detailInfo
.
applyTime
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.applyAbstract'
},
{
default
:
'申请摘要'
}),
value
:
detailInfo
&&
detailInfo
.
applyAbstract
?
detailInfo
.
applyAbstract
:
''
,
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.consumerName'
},
{
default
:
'采购会员'
}),
value
:
detailInfo
&&
detailInfo
.
consumerName
?
detailInfo
.
consumerName
:
''
,
columnProps
:
{
span
:
2
,
},
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.outerStatus'
},
{
default
:
'外部状态'
}),
value
:
(
<
StatusTag
type=
{
RETURN_OUTER_STATUS_TAG_MAP
[
detailInfo
?.
outerStatus
]
}
title=
{
detailInfo
?.
outerStatusName
}
/>
),
columnProps
:
{
span
:
3
,
},
},
{
title
:
intl
.
formatMessage
({
id
:
'afterService.common.basicInfo.innerStatus'
},
{
default
:
'内部状态'
}),
value
:
(
<
Badge
color=
{
RETURN_INNER_STATUS_BADGE_MAP
[
detailInfo
?.
innerStatus
]
||
'#606266'
}
text=
{
detailInfo
?.
innerStatusName
}
/>
),
columnProps
:
{
span
:
3
,
},
},
];
return
(
<
Spin
spinning=
{
infoLoading
}
>
<
AnchorPage
title=
{
`${detailInfo && detailInfo.applyAbstract ? detailInfo.applyAbstract : ''} | ${detailInfo && detailInfo.applyNo ? detailInfo.applyNo : ''}`
}
anchors=
{
anchorsArr
}
extra=
{
headExtra
&&
headExtra
(
detailInfo
,
returnAddress
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 流转进度 */
}
<
Col
span=
{
24
}
>
<
AuditProcess
outerVerifySteps=
{
detailInfo
&&
detailInfo
.
outerTaskList
?
detailInfo
.
outerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
outerVerifyCurrent=
{
findLastIndexFlowState
(
detailInfo
?.
outerTaskList
)
}
innerVerifySteps=
{
detailInfo
&&
detailInfo
.
innerTaskList
?
detailInfo
.
innerTaskList
.
map
(
item
=>
({
step
:
item
.
step
,
stepName
:
item
.
taskName
,
roleName
:
item
.
roleName
,
status
:
item
.
isExecute
?
'finish'
:
'wait'
,
}))
:
[]
}
innerVerifyCurrent=
{
findLastIndexFlowState
(
detailInfo
?.
innerTaskList
)
}
id=
"taskList"
/>
</
Col
>
{
/* 基本信息 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
BasicInfo
data=
{
BasicInfoData
}
id=
"basicInfo"
/>
</
Suspense
>
</
Col
>
{
/* 退货商品 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ProductList
title=
{
intl
.
formatMessage
({
id
:
'afterService.common.return.products'
},
{
default
:
'退货商品'
})
}
rowKey=
"orderRecordId"
columns=
{
productColumns
}
loading=
{
returnGoodsLoading
}
dataSource=
{
returnGoodsList
.
data
}
id=
"goodsDetailList"
/>
</
Suspense
>
</
Col
>
{
/* 附件 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
FileList
fileList=
{
detailInfo
?.
fileList
}
id=
"faultFileList"
/>
</
Suspense
>
</
Col
>
{
/* 退货地址信息 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnAddressInfo
deliveryAddress=
{
{
id
:
detailInfo
?.
returnGoodsAddress
?.
receiveId
,
name
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
receiveUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
receiveAddress
,
}
}
shippingAddress=
{
{
deliveryType
:
detailInfo
?.
returnGoodsAddress
?.
deliveryType
,
name
:
detailInfo
?.
returnGoodsAddress
?.
sendUserName
,
phone
:
detailInfo
?.
returnGoodsAddress
?.
sendUserTel
,
fullAddress
:
detailInfo
?.
returnGoodsAddress
?.
sendAddress
,
}
}
onFormSubmit=
{
handleReturnAddressSubmit
}
isEdit=
{
isEditAddress
&&
detailInfo
?.
innerStatus
===
RETURN_INNER_STATUS_UNCOMMITTED
}
id=
"returnGoodsAddress"
/>
</
Suspense
>
</
Col
>
{
/* 售后评价 */
}
{
detailInfo
&&
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
Score
score=
{
detailInfo
?.
evaluate
?.
level
}
content=
{
detailInfo
?.
evaluate
?.
content
}
id=
"evaluate"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 退货发货信息 */
}
{
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
&&
detailInfo
.
returnDeliveryGoodsList
.
length
>
0
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnAnalysis
summary=
{
detailInfo
&&
detailInfo
.
returnStatisticsList
?
detailInfo
.
returnStatisticsList
:
[]
}
detailed=
{
detailInfo
&&
detailInfo
.
returnDeliveryGoodsList
?
detailInfo
.
returnDeliveryGoodsList
:
[]
}
onConfirmReturnReceive=
{
handleReceivedConfirmReturnReceive
}
innerStatus=
{
detailInfo
?.
innerStatus
}
target=
{
target
}
isEdit=
{
isEditRefundDeliver
}
afterType=
{
3
}
deliveryType=
{
detailInfo
?.
returnGoodsAddress
?.
deliveryType
}
orderType=
{
detailInfo
?.
orderType
}
id=
"returnDeliveryGoodsList"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 退款明细信息 */
}
{
detailInfo
&&
!
isMateriel
&&
(
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_TO_BE_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_REFUNDED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_NOT_RECEIVED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
||
detailInfo
.
outerStatus
===
RETURN_OUTER_STATUS_FINISHED
)
&&
(
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
ReturnDetailInfo
dataSource=
{
detailInfo
&&
detailInfo
.
refundList
?
detailInfo
.
refundList
:
[]
}
onRefund=
{
handleRefund
}
outerStatus=
{
detailInfo
?.
outerStatus
}
purchaserId=
{
detailInfo
?.
memberId
}
purchaserRoleId=
{
detailInfo
?.
roleId
}
supplierId=
{
detailInfo
?.
parentMemberId
}
supplierRoleId=
{
detailInfo
?.
parentMemberRoleId
}
isEdit=
{
isEditRefund
}
id=
"refundList"
/>
</
Suspense
>
</
Col
>
)
}
{
/* 内、外部流转记录 */
}
<
Col
span=
{
24
}
>
<
Suspense
fallback=
{
null
}
>
<
FlowRecords
fetchOuterHistory=
{
fetchOuterHistory
}
fetchInnerHistory=
{
fetchInnerHistory
}
outerStatusMap=
{
RETURN_OUTER_STATUS_TAG_MAP
}
innerStatusColorMap=
{
RETURN_INNER_STATUS_BADGE_MAP
}
id=
"workflowRecord"
/>
</
Suspense
>
</
Col
>
</
Row
>
<
ReturnInfoDrawer
visible=
{
visibleOrderDetial
}
applyInfo=
{
applyInfo
}
onClose=
{
()
=>
setVisibleReturnInfo
(
false
)
}
/>
</
AnchorPage
>
</
Spin
>
);
};
export
default
DetailInfo
;
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