Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 493a80d0
authored
Apr 19, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
直辖市回显修改
1 parent
165232c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
src/components/province-city/index.vue
src/views/baseInfo/editInfo.vue
src/views/baseInfo/selectBrand.vue
src/components/province-city/index.vue
View file @
493a80d
<
template
>
<div>
<el-form
ref=
"provinceForm"
:model=
"provinceForm"
label-width=
"80px"
inline=
"true"
class=
"province"
>
<el-select
v-model=
"provinceForm.provinceName"
placeholder=
"选择省份"
@
change=
"selectProvince"
class=
"select-padding"
>
<el-select
v-model=
"provinceForm.provinceName"
clearable
placeholder=
"选择省份"
@
change=
"selectProvince"
class=
"select-padding"
>
<el-option
v-for=
"item in AllData"
:key=
"item.adcode"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectProvince(item)"
></el-option>
</el-select>
<el-select
v-model=
"provinceForm.cityName"
placeholder=
"选择您所在的市"
style=
"width: 250px"
@
change=
"selectCity"
class=
"select-padding"
>
<el-select
v-model=
"provinceForm.cityName"
clearable
placeholder=
"选择您所在的市"
style=
"width: 250px"
@
change=
"selectCity"
class=
"select-padding"
>
<el-option
v-for=
"item in cityList"
:key=
"item.adcode"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectCity(item)"
></el-option>
</el-select>
</el-form>
...
...
@@ -61,30 +61,25 @@ export default {
var
districtSearch
=
new
AMap
.
DistrictSearch
(
opts
)
districtSearch
.
search
(
'中国'
,
(
status
,
result
)
=>
{
this
.
AllData
=
result
.
districtList
[
0
].
districtList
this
.
AllData
.
unshift
({
adcode
:
''
,
name
:
'全部'
})
})
})
console
.
log
(
this
.
AllData
)
if
(
provinceName
)
{
this
.
AllData
.
map
(
item
=>
{
if
(
item
.
name
.
indexOf
(
provinceName
)
!=
-
1
)
{
this
.
provinceForm
.
provinceName
=
item
.
name
this
.
cityList
=
item
.
districtList
this
.
provinceForm
.
provinceCode
=
item
.
adcode
this
.
cityList
.
map
(
itm
=>
{
if
(
itm
.
name
.
indexOf
(
cityName
)
!=
-
1
)
{
this
.
provinceForm
.
cityCode
=
itm
.
adcode
this
.
provinceForm
.
cityName
=
itm
.
name
// console.log(itm.name)
// this.$set(this.provinceForm, 'cityName', itm.name)
if
(
provinceName
)
{
this
.
AllData
.
map
(
item
=>
{
if
(
item
.
name
.
indexOf
(
provinceName
)
!=
-
1
)
{
this
.
provinceForm
.
provinceName
=
item
.
name
this
.
cityList
=
item
.
districtList
this
.
provinceForm
.
provinceCode
=
item
.
adcode
this
.
cityList
.
map
(
itm
=>
{
if
(
itm
.
name
.
indexOf
(
cityName
)
!=
-
1
)
{
this
.
provinceForm
.
cityCode
=
itm
.
adcode
this
.
provinceForm
.
cityName
=
itm
.
name
// console.log(itm.name)
// this.$set(this.provinceForm, 'cityName', itm.name)
}
})
}
})
}
})
}
}
)
}
}
}
...
...
src/views/baseInfo/editInfo.vue
View file @
493a80d
...
...
@@ -85,7 +85,7 @@ export default {
mounted
()
{
// this.brandList()
this
.
getUserInfo
()
this
.
$refs
.
provinceForm
.
mapInit
()
//
this.$refs.provinceForm.mapInit()
},
methods
:
{
async
brandList
()
{
...
...
@@ -132,7 +132,7 @@ export default {
this
.
infoForm
.
businessType
=
businessType
.
map
(
item
=>
(
item
=
parseInt
(
item
)))
}
// 省市回显
this
.
$refs
.
provinceForm
.
i
nit
(
this
.
infoForm
.
provinceName
,
this
.
infoForm
.
cityName
)
this
.
$refs
.
provinceForm
.
mapI
nit
(
this
.
infoForm
.
provinceName
,
this
.
infoForm
.
cityName
)
if
(
!
this
.
infoForm
.
merchantBrandMain
)
{
this
.
infoForm
.
merchantBrandMain
=
[]
}
else
{
...
...
src/views/baseInfo/selectBrand.vue
View file @
493a80d
...
...
@@ -186,7 +186,7 @@ export default {
//过滤
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
return
data
.
name
.
indexOf
(
value
)
!==
-
1
return
data
.
label
.
indexOf
(
value
)
!==
-
1
},
// 显示隐藏
switchBrand
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment