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
c2546718
Commit
c2546718
authored
Dec 03, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 物流能力地址修改成四级联动
parent
16adb735
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
52 deletions
+25
-52
index.tsx
src/components/AddressSelect/index.tsx
+14
-11
add.tsx
...sticsAbility/logisticsAdminister/receivingAddress/add.tsx
+2
-9
edit.tsx
...ticsAbility/logisticsAdminister/receivingAddress/edit.tsx
+2
-11
form.tsx
...ticsAbility/logisticsAdminister/receivingAddress/form.tsx
+0
-0
add.tsx
...sticsAbility/logisticsAdminister/shipmentsAddress/add.tsx
+2
-9
edit.tsx
...ticsAbility/logisticsAdminister/shipmentsAddress/edit.tsx
+3
-11
form.tsx
...ticsAbility/logisticsAdminister/shipmentsAddress/form.tsx
+0
-0
index.tsx
...eOrder/orderCollectCash/components/addressModal/index.tsx
+1
-0
schema.ts
...eOrder/orderCollectCash/components/addressModal/schema.ts
+1
-1
No files found.
src/components/AddressSelect/index.tsx
View file @
c2546718
...
...
@@ -41,18 +41,21 @@ const {
onFormInit$
,
}
=
FormEffectHooks
;
const
useFetchAreaEnumLinkageEffect
=
()
=>
{
export
const
useFetchAreaEnumLinkageEffect
=
()
=>
{
useValueLinkageEffect
({
type
:
'value:areaEnum'
,
resolve
:
async
({
origin
,
target
},
{
getFieldValue
,
setFieldState
})
=>
{
resolve
:
async
({
origin
,
target
},
{
getFieldValue
,
setFieldState
,
getFieldState
})
=>
{
const
parentValue
=
getFieldValue
(
origin
);
if
(
!
parentValue
)
{
setFieldState
(
target
,
innerState
=>
{
FormPath
.
setIn
(
innerState
,
'value'
,
undefined
);
FormPath
.
setIn
(
innerState
,
'props.enum'
,
[]);
});
return
;
}
getFieldState
(
origin
,
(
innerState
)
=>
{
if
(
innerState
.
modified
)
{
setFieldState
(
target
,
innerState
=>
{
FormPath
.
setIn
(
innerState
,
'value'
,
undefined
);
FormPath
.
setIn
(
innerState
,
'props.enum'
,
[]);
});
return
;
}
});
// loading start
setFieldState
(
target
,
...
...
@@ -486,7 +489,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
flag
:
visible
,
};
});
// 先获取地区信息
formActions
.
setFieldState
(
'provinceCode'
,
targetState
=>
{
FormPath
.
setIn
(
targetState
,
'props.x-props.hasFeedback'
,
true
);
...
...
@@ -607,7 +610,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
<
div
>
{
full
||
(
!
isStr
?
`${value?.name || ''} ${value?.fullAddress || ''} ${value?.phone || ''}`
:
value
)
}
</
div
>
);
};
if
(
!
editable
)
{
return
renderAddressStr
();
}
...
...
src/pages/transaction/logisticsAbility/logisticsAdminister/receivingAddress/add.tsx
View file @
c2546718
import
React
from
'react'
;
import
{
receiverAddress
}
from
'../component/schema'
import
AddressForm
from
'../component/addressForm'
;
import
{
postLogisticsReceiverAddressAdd
}
from
'@/services/LogisticsV2Api'
;
import
AddedAddressLayout
from
'./form'
;
const
ReceivingAddressAdded
=
()
=>
{
return
(
<
AddressForm
title=
'收货地区'
schema=
{
receiverAddress
}
fetch=
{
postLogisticsReceiverAddressAdd
}
isEdit
/>
<
AddedAddressLayout
mode=
'add'
/>
)
}
export
default
ReceivingAddressAdded
src/pages/transaction/logisticsAbility/logisticsAdminister/receivingAddress/edit.tsx
View file @
c2546718
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
receiverAddress
}
from
'../component/schema'
import
AddressForm
from
'../component/addressForm'
;
import
{
getLogisticsReceiverAddressGet
,
postLogisticsReceiverAddressUpdate
}
from
'@/services/LogisticsV2Api'
;
import
AddedAddressLayout
from
'./form'
;
const
ReceivingAddressEdit
=
()
=>
{
const
{
...
...
@@ -11,14 +9,7 @@ const ReceivingAddressEdit = () => {
},
}
=
history
.
location
;
return
(
<
AddressForm
id=
{
id
}
title=
'收货地区'
schema=
{
receiverAddress
}
fetch=
{
postLogisticsReceiverAddressUpdate
}
detail=
{
getLogisticsReceiverAddressGet
}
isEdit
/>
<
AddedAddressLayout
mode=
'edit'
id=
{
id
as
any
}
/>
)
}
export
default
ReceivingAddressEdit
src/pages/transaction/logisticsAbility/logisticsAdminister/receivingAddress/form.tsx
0 → 100644
View file @
c2546718
This diff is collapsed.
Click to expand it.
src/pages/transaction/logisticsAbility/logisticsAdminister/shipmentsAddress/add.tsx
View file @
c2546718
import
React
from
'react'
;
import
{
shipperAddress
}
from
'../component/schema'
import
AddressForm
from
'../component/addressForm'
;
import
{
postLogisticsShipperAddressAdd
}
from
'@/services/LogisticsV2Api'
;
import
AddedAddressLayout
from
'./form'
;
const
ShipperAddressAdded
=
()
=>
{
return
(
<
AddressForm
title=
'发货地区'
schema=
{
shipperAddress
}
fetch=
{
postLogisticsShipperAddressAdd
}
isEdit
/>
<
AddedAddressLayout
mode=
'add'
/>
)
}
export
default
ShipperAddressAdded
src/pages/transaction/logisticsAbility/logisticsAdminister/shipmentsAddress/edit.tsx
View file @
c2546718
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
shipperAddress
}
from
'../component/schema'
import
AddressForm
from
'../component/addressForm'
;
import
{
getLogisticsShipperAddressGet
,
postLogisticsShipperAddressUpdate
}
from
'@/services/LogisticsV2Api'
;
import
AddedAddressLayout
from
'./form'
;
const
ShipperAddressEdit
=
()
=>
{
const
{
...
...
@@ -10,15 +8,9 @@ const ShipperAddressEdit = () => {
id
},
}
=
history
.
location
;
return
(
<
AddressForm
id=
{
id
}
title=
'发货地区'
schema=
{
shipperAddress
}
fetch=
{
postLogisticsShipperAddressUpdate
}
detail=
{
getLogisticsShipperAddressGet
}
isEdit
/>
<
AddedAddressLayout
mode=
'edit'
id=
{
id
as
any
}
/>
)
}
export
default
ShipperAddressEdit
src/pages/transaction/logisticsAbility/logisticsAdminister/shipmentsAddress/form.tsx
0 → 100644
View file @
c2546718
This diff is collapsed.
Click to expand it.
src/pages/transaction/purchaseOrder/orderCollectCash/components/addressModal/index.tsx
View file @
c2546718
...
...
@@ -131,6 +131,7 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
effects=
{
(
$
,
ctx
)
=>
{
$
(
'onFormMount'
).
subscribe
(()
=>
{
// 四级联动
console
.
log
(
$
,
ctx
,
1
)
useChainEffects
(
$
,
ctx
)
})
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/components/addressModal/schema.ts
View file @
c2546718
...
...
@@ -51,7 +51,7 @@ const addressSchema: ISchema = {
'x-linkages'
:
[
{
type
:
'value:linkage'
,
condition
:
'{{!!$value}}'
,
condition
:
'{{!!$value}}
111
'
,
origin
:
'provinceCode'
,
target
:
'cityCode'
,
},
...
...
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