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
43d435bf
Commit
43d435bf
authored
May 08, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接 v2售后换货相关
parent
fd87edb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
126 deletions
+249
-126
index.less
...pages/afterService/components/OuterCirculation/index.less
+2
-0
index.tsx
...rvice/exchangeApplication/components/DetailInfo/index.tsx
+76
-26
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+85
-68
index.ts
.../exchangePrSubmit/components/ExchangeForm/schema/index.ts
+11
-6
index.tsx
...terService/exchangeManage/components/DetailInfo/index.tsx
+75
-26
No files found.
src/pages/afterService/components/OuterCirculation/index.less
View file @
43d435bf
.steps {
padding-top: 2px;
overflow: auto;
}
\ No newline at end of file
src/pages/afterService/exchangeApplication/components/DetailInfo/index.tsx
View file @
43d435bf
...
...
@@ -22,6 +22,11 @@ import {
ORDER_TYPE2_POINTS
,
ORDER_TYPE2_CHANNEL_POINTS
,
}
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'
;
...
...
@@ -89,6 +94,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
isPointsOrder
=
detailInfo
?.
orderType
===
ORDER_TYPE2_POINTS
||
detailInfo
?.
orderType
===
ORDER_TYPE2_CHANNEL_POINTS
;
const
isMateriel
=
(
detailInfo
?.
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
const
productColumns
:
EditableColumns
[]
=
[
{
title
:
'订单号'
,
...
...
@@ -101,31 +112,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
:
!
isPointsOrder
?
'采购数量'
:
'兑换数量'
,
dataIndex
:
'purchaseCount'
,
...
...
@@ -163,7 +213,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
dataIndex
:
'needReplaceName'
,
align
:
'center'
,
},
];
]
as
EditableColumns
[]
;
// 获取换货申请详情
const
getDetailInfo
=
()
=>
{
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
43d435bf
...
...
@@ -40,7 +40,6 @@ const {
onFormInputChange$
,
onFormInit$
,
onFieldInputChange$
,
onFieldValueChange$
,
}
=
FormEffectHooks
;
interface
BillsFormProps
{
...
...
@@ -53,10 +52,6 @@ interface BillsFormProps {
* 订单id,从订单列表跳转过来的
*/
orderId
?:
number
,
/**
* 历史记录目标路径
*/
target
:
string
;
};
interface
DetailInfo
{
...
...
@@ -94,7 +89,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
id
,
isEdit
=
false
,
orderId
,
target
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
({
applyTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
...
...
@@ -106,6 +100,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const
[
visibleGoodsDrawer
,
setVisibleGoodsDrawer
]
=
useState
(
false
);
const
[
orderTypeValue
,
setOrderTypeValue
]
=
useState
(
0
);
const
isPointsOrder
=
orderTypeValue
===
ORDER_TYPE2_POINTS
||
orderTypeValue
===
ORDER_TYPE2_CHANNEL_POINTS
;
const
isMateriel
=
(
orderTypeValue
===
ORDER_TYPE_INQUIRY_CONTRACT
||
orderTypeValue
===
ORDER_TYPE_BIDDING_CONTRACT
...
...
@@ -148,63 +143,68 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
},
isMateriel
?
{
title
:
'合同编号'
,
dataIndex
:
'
type2
'
,
dataIndex
:
'
contractNo
'
,
align
:
'center'
,
render
:
()
=>
'H-13-00002'
,
}
:
null
,
].
filter
(
Boolean
)
as
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'
,
align
:
'center'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
},
{
title
:
'品类'
,
dataIndex
:
'category'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
'unit'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'订单数量'
:
'兑换数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'单价'
:
'所需积分'
,
dataIndex
:
'price'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'采购金额'
:
'所需积分小计'
,
dataIndex
:
'amount'
,
align
:
'center'
,
render
:
(
_
,
record
)
=>
(
record
.
purchaseCount
*
record
.
price
).
toFixed
(
2
),
},
{
title
:
'已换货数量'
,
dataIndex
:
'replaceCount'
,
align
:
'center'
,
},
];
};
const
childTableColumn
:
ColumnType
<
any
>
[]
=
([
!
isMateriel
?{
title
:
'商品ID'
,
dataIndex
:
'productId'
,
align
:
'center'
,
}
:
{
title
:
'物料编号'
,
dataIndex
:
'materialCode'
,
align
:
'center'
,
},
!
isMateriel
?
{
title
:
'商品名称'
,
dataIndex
:
'productName'
,
align
:
'center'
,
}
:
{
title
:
'物料名称、规格'
,
dataIndex
:
'materialName'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
`
${
text
}
/
${
record
.
materialType
}
`
,
},
{
title
:
'品类'
,
dataIndex
:
!
isMateriel
?
'category'
:
'materialCategory'
,
align
:
'center'
,
},
{
title
:
'品牌'
,
dataIndex
:
!
isMateriel
?
'brand'
:
'materialBrand'
,
align
:
'center'
,
},
{
title
:
'单位'
,
dataIndex
:
!
isMateriel
?
'unit'
:
'materialUnit'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'订单数量'
:
'兑换数量'
,
dataIndex
:
'purchaseCount'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'单价'
:
'所需积分'
,
dataIndex
:
'price'
,
align
:
'center'
,
},
{
title
:
!
isPointsOrder
?
'采购金额'
:
'所需积分小计'
,
dataIndex
:
'amount'
,
align
:
'center'
,
render
:
(
_
,
record
)
=>
(
record
.
purchaseCount
*
record
.
price
).
toFixed
(
2
),
},
{
title
:
'已换货数量'
,
dataIndex
:
'replaceCount'
,
align
:
'center'
,
},
]);
// 根据供应会员获取订单列表
const
getOrderList
=
(
params
):
Promise
<
OrderListRes
>
=>
{
...
...
@@ -257,6 +257,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
outerTaskList
,
replaceBatch
,
replaceId
,
manualReplaceGoodsAddress
,
returnBatch
,
...
rest
}
=
res
.
data
;
...
...
@@ -307,11 +309,13 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
remaining
:
item
.
purchaseCount
||
0
,
// 已换货数量,这里取 采购数量判断即可
id
:
item
.
orderRecordId
,
taskType
,
orderType
:
rest
.
orderType
,
},
associated
:
!
item
.
materielId
?
''
:
`
${
item
.
productId
}
/
${
item
.
productName
}
/
${
item
.
category
}
/
${
item
.
brand
}
`
,
materielNameAndType
:
`
${
item
.
materielName
||
''
}${
item
.
materielType
?
'/'
+
item
.
materielType
:
''
}
`
,
})),
...
rest
,
});
setOrderTypeValue
(
rest
.
orderType
);
setGoodsValue
(
goodsDetailList
.
map
(
item
=>
item
.
orderRecordId
));
}
}).
finally
(()
=>
{
...
...
@@ -387,17 +391,17 @@ const ExchangeForm: 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
=
value
=>
{
const
{
...
...
@@ -424,7 +428,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const
payload
=
{
...
rest
,
replaceId
:
id
||
0
,
replaceId
:
+
id
||
0
,
supplierMemberId
:
supplierMember
[
0
].
memberId
,
supplierRoleId
:
supplierMember
[
0
].
roleId
,
supplierMemberName
:
supplierMember
[
0
].
name
,
...
...
@@ -475,6 +479,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
brand
,
unit
,
extraData
,
associated
,
materielNameAndType
,
...
rest
})
=>
({
orderRecordId
:
extraData
.
id
,
...
...
@@ -484,7 +490,6 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
...
rest
,
})),
taskType
:
replaceGoodsList
[
0
].
extraData
.
taskType
,
orderType
:
replaceGoodsList
[
0
].
extraData
.
orderType
,
};
PublicApi
.
postAsReplaceGoodsSave
(
payload
)
...
...
@@ -554,8 +559,20 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
remaining
:
item
.
purchaseCount
-
(
item
.
replaceCount
||
0
),
// 可换货数量
id
:
item
.
id
,
taskType
:
item
.
processEnum
,
orderType
:
item
.
orderType
,
},
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
);
});
...
...
@@ -652,7 +669,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
setGoodsValue
([]);
});
onField
Value
Change$
(
'orderType'
).
subscribe
(
fieldState
=>
{
onField
Input
Change$
(
'orderType'
).
subscribe
(
fieldState
=>
{
setOrderTypeValue
(
fieldState
.
value
);
});
}
}
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/schema/index.ts
View file @
43d435bf
...
...
@@ -302,32 +302,37 @@ 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'
,
},
category
:
{
materielType
:
{
type
:
'string'
,
title
:
'规格'
,
'x-component'
:
'Text'
,
},
materielCategory
:
{
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/exchangeManage/components/DetailInfo/index.tsx
View file @
43d435bf
...
...
@@ -26,6 +26,11 @@ import {
ORDER_TYPE2_POINTS
,
ORDER_TYPE2_CHANNEL_POINTS
,
}
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'
;
...
...
@@ -102,6 +107,11 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
const
isPointsOrder
=
detailInfo
?.
orderType
===
ORDER_TYPE2_POINTS
||
detailInfo
?.
orderType
===
ORDER_TYPE2_CHANNEL_POINTS
;
const
isMateriel
=
(
detailInfo
?.
orderType
===
ORDER_TYPE_INQUIRY_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_BIDDING_CONTRACT
||
detailInfo
?.
orderType
===
ORDER_TYPE_TENDER_CONTRACT
);
// 获取换货申请详情
const
getDetailInfo
=
()
=>
{
...
...
@@ -181,31 +191,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
:
!
isPointsOrder
?
'采购数量'
:
'兑换数量'
,
dataIndex
:
'purchaseCount'
,
...
...
@@ -252,7 +301,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
</>
),
},
];
]
as
EditableColumns
[]
;
useEffect
(()
=>
{
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