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
陈智峰
jinfa-platform
Commits
9cdcfbc3
Commit
9cdcfbc3
authored
Feb 09, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复换货地址不显示的问题
parent
c6d4c7fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
27 deletions
+92
-27
index.tsx
...ges/afterService/components/ExchangeAddressInfo/index.tsx
+86
-22
verify.tsx
...erService/exchangeManage/exchangePrConfirmBack/verify.tsx
+6
-5
No files found.
src/pages/afterService/components/ExchangeAddressInfo/index.tsx
View file @
9cdcfbc3
...
...
@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 09:54:04
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-29 14:09:18
* @LastEditTime: 2021-0
2-09 18:02:56
* @Description: 换货收货地址
*/
import
React
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
MellowCard
from
'@/components/MellowCard'
;
import
{
createFormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
create
Async
FormActions
,
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
...
...
@@ -15,7 +15,7 @@ import NiceForm from '@/components/NiceForm';
import
{
schema
}
from
'./schema'
;
import
styles
from
'./index.less'
;
const
modalFormActions
=
createFormActions
();
const
modalFormActions
=
create
Async
FormActions
();
const
{
onFieldValueChange$
,
onFieldInputChange$
,
...
...
@@ -74,6 +74,83 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
onSubmit
,
})
=>
{
useEffect
(()
=>
{
const
{
setFieldState
}
=
modalFormActions
;
// if (isEdit) {
// setFieldState('*(shippingAddress,pickupAddress)', state => {
// state.visible = true;
// });
// setFieldState('shippingAddressShow', state => {
// state.visible = false;
// });
// } else {
// setFieldState('*(shippingAddress,pickupAddress)', state => {
// state.visible = false;
// });
// setFieldState('shippingAddressShow', state => {
// state.visible = true;
// });
// }
switch
(
shippingAddress
.
deliveryType
)
{
// 物流
case
1
:
{
if
(
isEdit
)
{
setFieldState
(
'shippingAddress'
,
state
=>
{
state
.
visible
=
true
;
});
setFieldState
(
'pickupAddress'
,
state
=>
{
state
.
visible
=
false
;
});
}
else
{
setFieldState
(
'*(shippingAddress,pickupAddress)'
,
state
=>
{
state
.
visible
=
false
;
});
setFieldState
(
'shippingAddressShow'
,
state
=>
{
state
.
visible
=
true
;
});
}
break
;
};
// 自提
case
2
:
{
if
(
isEdit
)
{
setFieldState
(
'shippingAddress'
,
state
=>
{
state
.
visible
=
false
;
});
setFieldState
(
'pickupAddress'
,
state
=>
{
state
.
visible
=
true
;
});
}
else
{
setFieldState
(
'shippingAddressShow'
,
state
=>
{
state
.
title
=
'换货自提地址'
;
});
setFieldState
(
'pickupAddress'
,
state
=>
{
state
.
visible
=
true
;
});
setFieldState
(
'shippingAddressShow'
,
fieldState
=>
{
fieldState
.
title
=
'换货自提地址'
});
setFieldState
(
'*(shippingAddress,pickupAddress)'
,
state
=>
{
state
.
visible
=
false
;
});
setFieldState
(
'shippingAddressShow'
,
state
=>
{
state
.
visible
=
true
;
});
}
break
;
};
// 无需物流
case
3
:
{
setFieldState
(
'*(shippingAddress,pickupAddress,shippingAddressShow)'
,
state
=>
{
state
.
visible
=
false
;
});
break
;
};
default
:
break
};
},
[
shippingAddress
.
deliveryType
,
isEdit
]);
const
handleSubmit
=
values
=>
{
};
...
...
@@ -136,33 +213,20 @@ const ExchangeAddressInfo: React.FC<ExchangeAddressInfo> = ({
const
linkage
=
useLinkageUtils
();
// 联动配送方式
onField
Value
Change$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
onField
Input
Change$
(
'deliveryType'
).
subscribe
(
fieldState
=>
{
const
{
value
}
=
fieldState
;
switch
(
value
)
{
// 物流
case
1
:
{
if
(
isEdit
)
{
linkage
.
show
(
'shippingAddress'
);
linkage
.
hide
(
'pickupAddress'
);
}
else
{
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
linkage
.
show
(
'shippingAddressShow'
);
}
linkage
.
show
(
'shippingAddress'
);
linkage
.
hide
(
'pickupAddress'
);
break
;
};
// 自提
case
2
:
{
if
(
isEdit
)
{
linkage
.
hide
(
'shippingAddress'
);
linkage
.
show
(
'pickupAddress'
);
}
else
{
setFieldState
(
'shippingAddressShow'
,
fieldState
=>
{
fieldState
.
title
=
'换货自提地址'
});
linkage
.
hide
(
'*(shippingAddress,pickupAddress)'
);
linkage
.
show
(
'shippingAddressShow'
);
}
linkage
.
hide
(
'shippingAddress'
);
linkage
.
show
(
'pickupAddress'
);
break
;
};
// 无需物流
...
...
src/pages/afterService/exchangeManage/exchangePrConfirmBack/verify.tsx
View file @
9cdcfbc3
...
...
@@ -9,7 +9,7 @@ import DetailInfo from '../components/DetailInfo';
const
{
confirm
}
=
Modal
;
const
ExchangePrConfirmBackVerify
:
React
.
FC
=
()
=>
{
const
{
id
,
creditId
}
=
usePageStatus
();
const
{
id
}
=
usePageStatus
();
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
handleSubmit
=
(
info
)
=>
{
...
...
@@ -31,12 +31,12 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
const
handleDeliverAgain
=
(
info
)
=>
{
if
(
info
&&
info
.
re
turn
DeliveryGoodsList
&&
info
.
re
turn
DeliveryGoodsList
.
length
info
.
re
place
DeliveryGoodsList
&&
info
.
re
place
DeliveryGoodsList
.
length
)
{
// 未换货发货数量全部小于或等于 0 时
if
(
info
.
re
turn
DeliveryGoodsList
.
every
(
item
=>
{
info
.
re
place
DeliveryGoodsList
.
every
(
item
=>
{
return
item
.
detailList
.
every
(
good
=>
good
.
count
-
good
.
deliveryCount
<=
0
)
})
)
{
...
...
@@ -53,7 +53,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
}
// 未换货发货数量有大于 0 时
if
(
info
.
re
turn
DeliveryGoodsList
.
some
(
item
=>
{
info
.
re
place
DeliveryGoodsList
.
some
(
item
=>
{
return
item
.
detailList
.
some
(
good
=>
good
.
count
-
good
.
deliveryCount
>
0
)
})
)
{
...
...
@@ -81,6 +81,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
type=
"default"
icon=
{
<
SettingOutlined
/>
}
onClick=
{
()
=>
handleSubmit
(
detailInfo
)
}
loading=
{
submitLoading
}
>
确认全部换货发货单已收到回单
</
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