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
c2c90bae
Commit
c2c90bae
authored
Apr 08, 2022
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2-220418' into fix-0418-order
parents
0b242de3
8e5516a1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
33 deletions
+69
-33
basic.tsx
...ility/purchaseInquiry/addMallInquiry/components/basic.tsx
+53
-12
condition.tsx
...y/purchaseInquiry/addMallInquiry/components/condition.tsx
+16
-21
No files found.
src/pages/transaction/purchaseAbility/purchaseInquiry/addMallInquiry/components/basic.tsx
View file @
c2c90bae
...
...
@@ -106,7 +106,33 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
if
(
res
.
code
===
1000
)
{
result
[
idx
].
provinceCode
=
val
;
result
[
idx
].
province
=
item
.
name
;
city
[
idx
]
=
{
citydata
:
res
.
data
}
if
(
val
===
'0'
)
{
result
[
idx
].
cityCode
=
'0'
;
result
[
idx
].
city
=
intl
.
formatMessage
({
id
:
'components.suoyou'
});
city
[
idx
]
=
{
citydata
:
[{
code
:
'0'
,
name
:
intl
.
formatMessage
({
id
:
'components.suoyou'
}),
pcode
:
'0'
,
}]
}
}
else
{
const
tempCityList
=
[]
tempCityList
.
push
({
code
:
'0'
,
name
:
intl
.
formatMessage
({
id
:
'components.suoyou'
}),
pcode
:
'0'
,
})
for
(
const
cityItem
of
res
.
data
)
{
tempCityList
.
push
({
...
cityItem
})
}
city
[
idx
]
=
{
citydata
:
tempCityList
}
}
form
.
setFieldsValue
({
[
'city_'
+
idx
]:
'0'
})
setcity
([...
city
])
}
}).
catch
(()
=>
{})
...
...
@@ -150,17 +176,12 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
/** 添加一条地址 */
const
addFormAddress
=
(
idx
:
number
)
=>
{
const
address
:
any
=
{
provinceCode
:
''
,
provinceCode
:
'
0
'
,
province
:
''
,
cityCode
:
''
,
city
:
''
cityCode
:
'
0
'
,
city
:
intl
.
formatMessage
({
id
:
'components.suoyou'
})
}
if
(
requisitionFormAddress
[
idx
].
provinceCode
&&
requisitionFormAddress
[
idx
].
cityCode
)
{
setrequisitionFormAddress
([...
requisitionFormAddress
,
address
])
}
else
{
message
.
error
(
intl
.
formatMessage
({
id
:
'detail.purchase.message35'
}))
}
}
/** 删除一条地址 */
const
removeFormAddress
=
(
idx
:
any
)
=>
{
...
...
@@ -182,8 +203,17 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
}
}
useEffect
(()
=>
{
manageProvince
().
then
(
data
=>
{
setprovince
(
data
)
manageProvince
().
then
((
data
:
any
[])
=>
{
const
tempProvinceData
=
[]
tempProvinceData
.
push
({
code
:
'0'
,
name
:
intl
.
formatMessage
({
id
:
'components.suoyou'
}),
pcode
:
'0'
,
})
for
(
const
item
of
data
)
{
tempProvinceData
.
push
({
...
item
})
}
setprovince
(
tempProvinceData
)
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
...
...
@@ -194,8 +224,19 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
fetchdata
.
areas
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
getManageAreaByPcodeAll
({
pcode
:
item
.
provinceCode
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
const
tempCityList
=
[]
tempCityList
.
push
({
code
:
'0'
,
name
:
intl
.
formatMessage
({
id
:
'components.suoyou'
}),
pcode
:
'0'
,
})
if
(
item
.
provinceCode
!==
'0'
)
{
for
(
const
cityItem
of
res
.
data
)
{
tempCityList
.
push
({
...
cityItem
})
}
}
const
citydata
=
{
citydata
:
res
.
data
citydata
:
tempCityList
}
city
[
index
]
=
{
...
citydata
}
Promise
.
resolve
().
then
(()
=>
{
...
...
src/pages/transaction/purchaseAbility/purchaseInquiry/addMallInquiry/components/condition.tsx
View file @
c2c90bae
...
...
@@ -3,6 +3,7 @@ import { Form, Row, Col, Input, DatePicker, Select } from 'antd';
import
moment
from
'moment'
;
import
{
getLogisticsSelectListReceiverAddress
}
from
'@/services/LogisticsV2Api'
;
import
{
getIntl
}
from
'umi'
;
import
AddressSelect
from
'@/components/AddressSelect'
;
const
{
TextArea
}
=
Input
;
const
{
Option
}
=
Select
;
...
...
@@ -30,27 +31,14 @@ const Condition: React.FC<Iprops> = (props: any) => {
fetchdata
,
onBadge
}
=
props
;
const
[
address
,
setAddress
]
=
useState
<
Array
<
any
>>
([]);
const
[
deliveryTime
,
setDeliveryTime
]
=
useState
<
any
>
()
const
[
selAddress
,
setSelAddress
]
=
useState
<
ADDRESS_TYPE
>
();
/** 获取交付地址 */
const
handleGetLogistics
=
async
()
=>
{
const
service
=
getLogisticsSelectListReceiverAddress
;
const
res
=
await
service
();
if
(
res
.
code
===
1000
)
{
setAddress
(
res
.
data
);
}
}
useEffect
(()
=>
{
handleGetLogistics
();
},
[])
const
[
selAddress
,
setSelAddress
]
=
useState
<
any
>
({});
/** 选择地址 */
const
handleSelectAddress
=
(
val
:
any
,
option
:
any
)
=>
{
const
handleSelectAddress
=
(
info
)
=>
{
const
params
:
ADDRESS_TYPE
=
{
address
:
option
.
children
,
addressId
:
option
.
value
,
address
:
`
${
info
.
name
}
${
info
.
fullAddress
}
${
info
.
phone
}
`
,
addressId
:
info
.
id
,
}
setSelAddress
(
params
);
}
...
...
@@ -122,7 +110,7 @@ const Condition: React.FC<Iprops> = (props: any) => {
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'table.purchase.deliveryTime'
})
}
name=
"deliveryTime"
rules=
{
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'detail.purchase.message
38
'
})
}]
}
rules=
{
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'detail.purchase.message
54
'
})
}]
}
>
<
DatePicker
showTime=
{
{
format
:
'HH:mm'
}
}
...
...
@@ -135,15 +123,22 @@ const Condition: React.FC<Iprops> = (props: any) => {
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'detail.purchase.address'
})
}
name=
'addressId'
rules=
{
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'detail.purchase.message
38
'
})
}]
}
rules=
{
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'detail.purchase.message
55
'
})
}]
}
>
<
Select
{
/*
<Select
onSelect={handleSelectAddress}
>
{address.map(v => (
<Option key={v.id} value={v.id}>{v.fullAddress}</Option>
))}
</
Select
>
</Select> */
}
<
AddressSelect
value=
{
selAddress
.
address
&&
selAddress
.
address
as
any
}
isDefaultAddress
addressType=
{
1
}
disabled=
{
false
}
onChange=
{
handleSelectAddress
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'table.purchase.quotedPriceTime1'
})
}
...
...
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