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
fd87edb8
Commit
fd87edb8
authored
May 08, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接 v2售后退货相关
parent
54b15728
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
90 deletions
+199
-90
useBusinessEffects.ts
...components/ReturnInfoDrawer/effects/useBusinessEffects.ts
+0
-1
index.ts
.../afterService/components/ReturnInfoDrawer/schema/index.ts
+2
-1
index.tsx
...Service/returnApplication/components/DetailInfo/index.tsx
+76
-29
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+39
-26
index.ts
...tion/returnPrSubmit/components/ReturnForm/schema/index.ts
+6
-6
index.tsx
...afterService/returnManage/components/DetailInfo/index.tsx
+76
-27
No files found.
src/pages/afterService/components/ReturnInfoDrawer/effects/useBusinessEffects.ts
View file @
fd87edb8
...
...
@@ -5,7 +5,6 @@
* @LastEditTime: 2021-02-24 17:25:15
* @Description: 联动逻辑相关
*/
import
lodash
from
'lodash'
;
import
BigNumber
from
'bignumber.js'
;
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
...
...
src/pages/afterService/components/ReturnInfoDrawer/schema/index.ts
View file @
fd87edb8
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 14:20:17
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-26 18:07:46
* @LastEditTime: 2021-0
5-07 16:44:47
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -213,6 +213,7 @@ const schema: ISchema = {
type
:
'string'
,
title
:
'退款金额(元)'
,
editable
:
false
,
default
:
0
,
'x-component-props'
:
{
addonBefore
:
'¥ '
},
...
...
src/pages/afterService/returnApplication/components/DetailInfo/index.tsx
View file @
fd87edb8
...
...
@@ -2,15 +2,12 @@ import React, { Suspense, useEffect, useState } from 'react';
import
{
PageHeader
,
Descriptions
,
Card
,
Spin
,
Button
,
Row
,
Col
,
Badge
,
message
,
}
from
'antd'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -26,6 +23,11 @@ import {
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
,
RETURN_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants'
;
import
{
ORDER_TYPE_INQUIRY_CONTRACT
,
ORDER_TYPE_BIDDING_CONTRACT
,
ORDER_TYPE_TENDER_CONTRACT
,
}
from
'@/constants/order'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -118,6 +120,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setVisibleReturnInfo
(
true
);
};
const
isMateriel
=
(
detailInfo
?.
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
const
productColumns
:
EditableColumns
[]
=
[
{
title
:
'订单号'
,
...
...
@@ -130,31 +138,70 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
EyePreview
>
),
},
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
},
...(
!
isMateriel
?
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
}
]
:
[
{
title
:
'物料编号'
,
dataIndex
:
'materielNo'
,
align
:
'center'
,
},
{
title
:
'物料名称、规格'
,
dataIndex
:
'materielName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
`
${
text
}
/
${
record
.
materielType
}
`
,
},
{
title
:
'品类'
,
dataIndex
:
'materielCategory'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'materielBrand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'materielUnit'
,
align
:
'center'
,
},
{
title
:
detailInfo
?.
orderType
!==
ORDER_TYPE_TENDER_CONTRACT
?
'关联报价商品ID、名称、规格、品类、品牌'
:
'关联投标商品ID、名称、规格、品类、品牌'
,
dataIndex
:
'productId'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
`
${
text
}
/
${
record
.
productName
}
/
${
record
.
category
}
/
${
record
.
brand
}
`
,
},
]
),
{
title
:
'采购数量'
,
dataIndex
:
'purchaseCount'
,
...
...
@@ -206,7 +253,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</>
),
},
];
]
as
EditableColumns
[]
;
// 获取退货申请详情
const
getDetailInfo
=
()
=>
{
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
fd87edb8
...
...
@@ -7,10 +7,10 @@ import moment from 'moment';
import
{
findLastIndex
}
from
'lodash'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReturnGoodsPageReturnedGoodsResponse
}
from
'@/services/AfterServiceApi'
;
import
{
normalizeFiledata
,
FileData
,
isJSONStr
}
from
'@/utils'
;
import
{
GetAsReturnGoodsPageReturnedGoodsResponse
Detail
}
from
'@/services/AfterServiceApi'
;
import
{
normalizeFiledata
,
FileData
}
from
'@/utils'
;
import
{
PurchaseOrderOutWorkStateTexts
,
ORDER_TYPE2
}
from
'@/constants'
;
import
{
ORDER_TYPE_INQUIRY_CONTRACT
,
...
...
@@ -88,7 +88,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
});
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
}
);
const
[
returnGoodsList
,
setReturnGoodsList
]
=
useState
<
GetAsReturnGoodsPageReturnedGoodsResponse
Detail
[]
>
([]
);
const
[
unsaved
,
setUnsaved
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
...
...
@@ -140,9 +140,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
},
isMateriel
?
{
title
:
'合同编号'
,
dataIndex
:
'
type2
'
,
dataIndex
:
'
contractNo
'
,
align
:
'center'
,
render
:
()
=>
'H-13-00002'
,
}
:
null
,
].
filter
(
Boolean
)
as
ColumnType
<
any
>
[];
...
...
@@ -251,6 +250,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
outerTaskList
,
returnBatch
,
returnId
,
roleId
,
...
rest
}
=
res
.
data
;
...
...
@@ -292,19 +292,18 @@ const ReturnForm: React.FC<BillsFormProps> = ({
...
rest
,
});
setReturnGoodsList
({
data
:
goodsDetailList
.
map
(
item
=>
({
...
item
,
remaining
:
item
.
purchaseCount
||
0
,
// 可退货数量,这里取 采购数量判断即可
extraData
:
{
returnReason
:
item
.
returnReason
,
payList
:
(
item
.
payList
||
[]).
map
(({
payId
,
...
rest
})
=>
({
...
rest
,
id
:
payId
})),
id
:
item
.
orderRecordId
,
taskType
,
},
})),
totalCount
:
goodsDetailList
.
length
,
});
setReturnGoodsList
(
goodsDetailList
.
map
(
item
=>
({
...
item
,
remaining
:
item
.
purchaseCount
||
0
,
// 可退货数量,这里取 采购数量判断即可
extraData
:
{
returnReason
:
item
.
returnReason
,
payList
:
(
item
.
payList
||
[]).
map
(({
payId
,
...
rest
})
=>
({
...
rest
,
id
:
payId
})),
id
:
item
.
orderRecordId
,
taskType
,
},
associated
:
!
item
.
materielId
?
''
:
`
${
item
.
productId
}
/
${
item
.
productName
}
/
${
item
.
category
}
/
${
item
.
brand
}
`
,
materielNameAndType
:
`
${
item
.
materielName
||
''
}${
item
.
materielType
?
'/'
+
item
.
materielType
:
''
}
`
,
})));
setGoodsValue
(
goodsDetailList
.
map
(
item
=>
item
.
orderRecordId
));
}
}).
finally
(()
=>
{
...
...
@@ -380,17 +379,17 @@ const ReturnForm: React.FC<BillsFormProps> = ({
setVisibleGoodsDrawer
(
true
);
};
const
TableAddButton
=
isEdit
||
!
id
?
(
const
TableAddButton
=
(
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddGoods
}
type=
"dashed"
disabled=
{
!
isEdit
||
!!
id
}
block
>
{
!
isMateriel
?
'选择退货商品'
:
'选择退货物料'
}
</
Button
>
)
:
null
;
);
const
handleSubmit
=
values
=>
{
const
{
...
...
@@ -411,7 +410,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
refundList
,
...
rest
}
=
values
;
setSubmitLoading
(
true
);
const
payload
=
{
...
...
@@ -463,6 +461,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
extraData
,
needReturnName
,
isNeedReturn
,
refundAmount
,
associated
,
materielNameAndType
,
...
rest
})
=>
({
...
rest
,
...
...
@@ -484,7 +485,6 @@ const ReturnForm: React.FC<BillsFormProps> = ({
payId
:
id
,
};
}),
isNeedReturn
:
1
,
})),
taskType
:
returnGoodsList
[
0
].
extraData
.
taskType
,
};
...
...
@@ -571,6 +571,19 @@ const ReturnForm: React.FC<BillsFormProps> = ({
taskType
:
item
.
processEnum
,
remaining
:
item
.
purchaseCount
-
(
item
.
returnCount
||
0
),
// 可退货数量
},
isHasTax
:
item
.
taxInclusive
,
taxRate
:
item
.
taxRate
,
contractId
:
item
.
contractId
,
contractNo
:
item
.
contractNo
,
associated
:
!
isMateriel
?
''
:
`
${
item
.
productId
}
/
${
item
.
productName
}
/
${
item
.
category
}
/
${
item
.
brand
}
`
,
materielId
:
item
.
materialId
,
materielNo
:
item
.
materialCode
,
materielNameAndType
:
`
${
item
.
materialName
||
''
}${
item
.
materialType
?
'/'
+
item
.
materialType
:
''
}
`
,
materielName
:
item
.
materialName
,
materielType
:
item
.
materialType
,
materielCategory
:
item
.
materialCategory
,
materielBrand
:
item
.
materialBrand
,
materielUnit
:
item
.
materialUnit
,
};
value
.
push
(
atom
);
});
...
...
@@ -667,7 +680,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
<
NiceForm
value=
{
{
...
detailInfo
,
returnGoodsList
:
returnGoodsList
.
data
,
returnGoodsList
:
returnGoodsList
,
}
}
previewPlaceholder=
" "
expressionScope=
{
{
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/schema/index.ts
View file @
fd87edb8
...
...
@@ -301,32 +301,32 @@ export const addSchema = (orderType: number): ISchema => {
title
:
'订单号'
,
'x-component'
:
'OrderNo'
,
},
productId
:
{
materielNo
:
{
type
:
'string'
,
title
:
'物料编号'
,
'x-component'
:
'Text'
,
},
productNam
e
:
{
materielNameAndTyp
e
:
{
type
:
'string'
,
title
:
'物料名称、规格'
,
'x-component'
:
'Text'
,
},
c
ategory
:
{
materielC
ategory
:
{
type
:
'string'
,
title
:
'品类'
,
'x-component'
:
'Text'
,
},
b
rand
:
{
materielB
rand
:
{
type
:
'string'
,
title
:
'品牌'
,
'x-component'
:
'Text'
,
},
u
nit
:
{
materielU
nit
:
{
type
:
'string'
,
title
:
'单位'
,
'x-component'
:
'Text'
,
},
a
aa
:
{
a
ssociated
:
{
type
:
'string'
,
title
:
orderType
!==
ORDER_TYPE_TENDER_CONTRACT
?
'关联报价商品ID、名称、规格、品类、品牌'
:
'关联投标商品ID、名称、规格、品类、品牌'
,
'x-component'
:
'Text'
,
...
...
src/pages/afterService/returnManage/components/DetailInfo/index.tsx
View file @
fd87edb8
...
...
@@ -2,7 +2,6 @@ import React, { Suspense, useEffect, useState } from 'react';
import
{
PageHeader
,
Descriptions
,
Card
,
Spin
,
Button
,
Row
,
...
...
@@ -28,6 +27,11 @@ import {
RETURN_OUTER_STATUS_UNCONFIRMED_FINISHED
,
RETURN_INNER_STATUS_UNCOMMITTED
,
}
from
'@/constants'
;
import
{
ORDER_TYPE_INQUIRY_CONTRACT
,
ORDER_TYPE_BIDDING_CONTRACT
,
ORDER_TYPE_TENDER_CONTRACT
,
}
from
'@/constants/order'
;
import
{
normalizeFiledata
,
FileData
,
findLastIndexFlowState
}
from
'@/utils'
;
import
AvatarWrap
from
'@/components/AvatarWrap'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -145,6 +149,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
});
};
const
isMateriel
=
(
detailInfo
?.
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
const
productColumns
:
EditableColumns
[]
=
[
{
title
:
'订单号'
,
...
...
@@ -157,31 +167,70 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</
EyePreview
>
),
},
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
},
...(
!
isMateriel
?
[
{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
}
]
:
[
{
title
:
'物料编号'
,
dataIndex
:
'materielNo'
,
align
:
'center'
,
},
{
title
:
'物料名称、规格'
,
dataIndex
:
'materielName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
`
${
text
}
/
${
record
.
materielType
}
`
,
},
{
title
:
'品类'
,
dataIndex
:
'materielCategory'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'materielBrand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'materielUnit'
,
align
:
'center'
,
},
{
title
:
detailInfo
?.
orderType
!==
ORDER_TYPE_TENDER_CONTRACT
?
'关联报价商品ID、名称、规格、品类、品牌'
:
'关联投标商品ID、名称、规格、品类、品牌'
,
dataIndex
:
'productId'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
`
${
text
}
/
${
record
.
productName
}
/
${
record
.
category
}
/
${
record
.
brand
}
`
,
},
]
),
{
title
:
'采购数量'
,
dataIndex
:
'purchaseCount'
,
...
...
@@ -248,7 +297,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</>
),
},
];
]
as
EditableColumns
[]
;
// 获取退货申请详情
const
getDetailInfo
=
()
=>
{
...
...
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