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
3bd9eb64
Commit
3bd9eb64
authored
Dec 04, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接待提交审核修改收货。发货地址相关
parent
337db0fd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
22 deletions
+112
-22
index.tsx
...ges/afterService/components/ExchangeAddressInfo/index.tsx
+3
-3
index.tsx
...pages/afterService/components/ReturnAddressInfo/index.tsx
+14
-11
index.ts
...afterService/components/ReturnAddressInfo/schema/index.ts
+2
-1
index.tsx
...terService/exchangeManage/components/DetailInfo/index.tsx
+2
-3
verify.tsx
...s/afterService/exchangeManage/exchangePrSubmit/verify.tsx
+91
-4
No files found.
src/pages/afterService/components/ExchangeAddressInfo/index.tsx
View file @
3bd9eb64
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
1-25 15:25:52
* @LastEditTime: 2020-1
2-04 18:04:07
* @Description: 换货收货地址
* @Description: 换货收货地址
*/
*/
import
React
from
'react'
;
import
React
from
'react'
;
...
@@ -174,8 +174,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
...
@@ -174,8 +174,8 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
};
};
});
});
onField
Input
Change$
(
'*(shippingAddress,pickupAddress)'
).
subscribe
(
fieldState
=>
{
onField
Value
Change$
(
'*(shippingAddress,pickupAddress)'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
,
originAsyncData
}
=
fieldState
;
const
{
name
,
value
,
originAsyncData
=
[]
}
=
fieldState
;
const
deliveryTypeValue
=
getFieldValue
(
'deliveryType'
);
const
deliveryTypeValue
=
getFieldValue
(
'deliveryType'
);
const
fullData
=
originAsyncData
.
find
(
item
=>
item
.
id
===
value
);
const
fullData
=
originAsyncData
.
find
(
item
=>
item
.
id
===
value
);
...
...
src/pages/afterService/components/ReturnAddressInfo/index.tsx
View file @
3bd9eb64
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
1-25 15:05:45
* @LastEditTime: 2020-1
2-04 18:00:18
* @Description: 退货地址信息
* @Description: 退货地址信息
*/
*/
import
React
from
'react'
;
import
React
from
'react'
;
...
@@ -129,16 +129,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
...
@@ -129,16 +129,6 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
const
linkage
=
useLinkageUtils
();
const
linkage
=
useLinkageUtils
();
onFormInit$
().
subscribe
(()
=>
{
if
(
isEdit
)
{
linkage
.
show
(
'deliveryAddress'
);
linkage
.
hide
(
'deliveryAddresShow'
);
}
else
{
linkage
.
hide
(
'deliveryAddress'
);
linkage
.
show
(
'deliveryAddresShow'
);
}
});
// 联动配送方式
// 联动配送方式
onFieldValueChange$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
onFieldValueChange$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
const
{
name
,
value
}
=
fieldState
;
const
{
name
,
value
}
=
fieldState
;
...
@@ -146,14 +136,27 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
...
@@ -146,14 +136,27 @@ const ReturnAddressInfo: React.FC<ReturnAddressInfo> = ({
switch
(
value
)
{
switch
(
value
)
{
// 物流
// 物流
case
1
:
{
case
1
:
{
if
(
isEdit
)
{
linkage
.
show
(
'shippingAddress'
);
linkage
.
show
(
'shippingAddress'
);
linkage
.
hide
(
'pickupAddress'
);
linkage
.
hide
(
'pickupAddress'
);
}
else
{
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
linkage
.
show
(
'deliveryAddressShow'
);
}
break
;
break
;
};
};
// 自提
// 自提
case
2
:
{
case
2
:
{
if
(
isEdit
)
{
linkage
.
hide
(
'shippingAddress'
);
linkage
.
hide
(
'shippingAddress'
);
linkage
.
show
(
'pickupAddress'
);
linkage
.
show
(
'pickupAddress'
);
}
else
{
setFieldState
(
'deliveryAddressShow'
,
fieldState
=>
{
fieldState
.
title
=
'退货自提地址'
});
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
linkage
.
show
(
'deliveryAddressShow'
);
}
break
;
break
;
};
};
// 无需物流
// 无需物流
...
...
src/pages/afterService/components/ReturnAddressInfo/schema/index.ts
View file @
3bd9eb64
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2020-11-09 15:56:35
* @Date: 2020-11-09 15:56:35
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
1-20 15:41:12
* @LastEditTime: 2020-1
2-04 18:02:43
* @Description:
* @Description:
*/
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
...
@@ -67,6 +67,7 @@ export const schema: ISchema = {
...
@@ -67,6 +67,7 @@ export const schema: ISchema = {
deliveryAddressShow
:
{
deliveryAddressShow
:
{
type
:
'object'
,
type
:
'object'
,
title
:
'退货收货地址'
,
title
:
'退货收货地址'
,
visible
:
false
,
'x-component'
:
'Children'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
'x-component-props'
:
{
children
:
'{{DeliveryAddress}}'
,
children
:
'{{DeliveryAddress}}'
,
...
...
src/pages/afterService/exchangeManage/components/DetailInfo/index.tsx
View file @
3bd9eb64
...
@@ -52,7 +52,7 @@ interface DetailInfoProps {
...
@@ -52,7 +52,7 @@ interface DetailInfoProps {
// 历史记录目标路径
// 历史记录目标路径
target
?:
string
;
target
?:
string
;
// 头部右侧拓展
// 头部右侧拓展
headExtra
?:
(
info
:
DetailInfo
)
=>
React
.
ReactNode
;
headExtra
?:
(
info
:
DetailInfo
,
returnAddress
:
ReturnAddressValues
,
exchangeAddress
:
ExchangeAddressValues
)
=>
React
.
ReactNode
;
};
};
interface
DetailInfo
extends
GetAsReplaceGoodsGetDetailBySupplierResponse
{
interface
DetailInfo
extends
GetAsReplaceGoodsGetDetailBySupplierResponse
{
...
@@ -227,7 +227,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -227,7 +227,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
};
};
const
handleReturnAddressSubmit
=
values
=>
{
const
handleReturnAddressSubmit
=
values
=>
{
console
.
log
(
'values'
,
values
)
setReturnAddress
(
values
);
setReturnAddress
(
values
);
};
};
...
@@ -321,7 +320,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -321,7 +320,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}
}
extra=
{
(
extra=
{
(
<>
<>
{
headExtra
&&
headExtra
(
detailInfo
)
}
{
headExtra
&&
headExtra
(
detailInfo
,
returnAddress
,
exchangeAddress
)
}
</>
</>
)
}
)
}
>
>
...
...
src/pages/afterService/exchangeManage/exchangePrSubmit/verify.tsx
View file @
3bd9eb64
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07
* @Date: 2020-11-04 17:22:07
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-1
1-20 10:47:03
* @LastEditTime: 2020-1
2-04 18:39:57
* @Description:
* @Description:
*/
*/
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Button
}
from
'antd'
;
import
{
Button
,
message
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
...
@@ -14,10 +14,95 @@ import { usePageStatus } from '@/hooks/usePageStatus';
...
@@ -14,10 +14,95 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import
DetailInfo
from
'../components/DetailInfo'
;
import
DetailInfo
from
'../components/DetailInfo'
;
import
VerifyModal
from
'../../components/VerifyModal'
;
import
VerifyModal
from
'../../components/VerifyModal'
;
interface
ReturnAddress
{
/**
* 收货地址id
*/
receiveId
:
number
;
/**
* 收货地址
*/
receiveAddress
:
string
;
/**
* 收货者名称
*/
receiveUserName
:
string
;
/**
* 收货者电话
*/
receiveUserTel
:
string
;
};
interface
ExchangeAddress
{
/**
* 配送方式
*/
deliveryType
:
number
;
/**
* 发货地址id
*/
sendId
:
number
;
/**
* 发货地址
*/
sendAddress
:
string
;
/**
* 发货者名称
*/
sendUserName
:
string
;
/**
* 发货者电话
*/
sendUserTel
:
string
;
};
const
ExchangePrSubmitVerify
:
React
.
FC
=
()
=>
{
const
ExchangePrSubmitVerify
:
React
.
FC
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
{
id
}
=
usePageStatus
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
exchangeAddress
,
setExchangeAddress
]
=
useState
<
ExchangeAddress
>
(
null
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddress
>
(
null
);
const
handleSubmitVerify
=
(
info
,
returnAddress
,
exchangeAddress
)
=>
{
// 退货方式为 物流,并且退货收货地址为空时
if
(
info
.
returnGoodsAddress
.
deliveryType
===
1
&&
!
returnAddress
)
{
message
.
error
(
'请选择退货收货地址'
);
return
;
}
if
(
exchangeAddress
&&
exchangeAddress
.
deliveryType
===
1
&&
!
exchangeAddress
.
id
)
{
message
.
error
(
'请选择换货发货地址'
);
return
;
}
if
(
exchangeAddress
&&
exchangeAddress
.
deliveryType
===
2
&&
!
exchangeAddress
.
id
)
{
message
.
error
(
'请选择换货自提地址'
);
return
;
}
setReturnAddress
({
receiveId
:
returnAddress
.
id
,
receiveAddress
:
returnAddress
.
receiveAddress
,
receiveUserName
:
returnAddress
.
receiveUserName
,
receiveUserTel
:
returnAddress
.
receiveUserTel
,
});
setExchangeAddress
({
deliveryType
:
exchangeAddress
.
deliveryType
,
sendId
:
exchangeAddress
.
id
,
sendAddress
:
exchangeAddress
.
sendAddress
,
sendUserName
:
exchangeAddress
.
sendUserName
,
sendUserTel
:
exchangeAddress
.
sendUserTel
,
});
setVisible
(
true
);
};
const
handleSubmit
=
values
=>
{
const
handleSubmit
=
values
=>
{
if
(
!
id
)
{
if
(
!
id
)
{
...
@@ -27,6 +112,8 @@ const ExchangePrSubmitVerify: React.FC = () => {
...
@@ -27,6 +112,8 @@ const ExchangePrSubmitVerify: React.FC = () => {
PublicApi
.
postAsReplaceGoodsSubmitVerify
({
PublicApi
.
postAsReplaceGoodsSubmitVerify
({
applyId
:
id
,
applyId
:
id
,
...
values
,
...
values
,
...
exchangeAddress
,
...
returnAddress
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
history
.
goBack
();
history
.
goBack
();
...
@@ -41,11 +128,11 @@ const ExchangePrSubmitVerify: React.FC = () => {
...
@@ -41,11 +128,11 @@ const ExchangePrSubmitVerify: React.FC = () => {
<
DetailInfo
<
DetailInfo
id=
{
id
}
id=
{
id
}
target=
"/memberCenter/payandSettle/creditApplication/quotaFormQuery/detail"
target=
"/memberCenter/payandSettle/creditApplication/quotaFormQuery/detail"
headExtra=
{
()
=>
(
headExtra=
{
(
info
,
returnAddress
,
exchangeAddress
)
=>
(
<
Button
<
Button
type=
"primary"
type=
"primary"
icon=
{
<
FormOutlined
/>
}
icon=
{
<
FormOutlined
/>
}
onClick=
{
()
=>
setVisible
(
true
)
}
onClick=
{
()
=>
handleSubmitVerify
(
info
,
returnAddress
,
exchangeAddress
)
}
>
>
提交审核
提交审核
</
Button
>
</
Button
>
...
...
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