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 43a2f1da
authored
Aug 23, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'kuangyq_v2.9.0' of
http://192.168.3.233:8090/saas/scrm-micro-setti…
…ngs into kuangyq_v2.9.0
2 parents
701b0dfb
61639f16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
182 additions
and
217 deletions
src/views/account/addAccount.vue
src/views/account/components/baseInfo.vue
src/views/baseInfo/editInfo.vue
src/views/account/addAccount.vue
View file @
43a2f1d
...
...
@@ -10,15 +10,15 @@
</div>
<div
class=
"account-body scrm-box-f"
>
<div
class=
"form-title"
>
账户信息
</div>
<el-form
ref=
"accountInfoForm"
:model=
"accountInfoForm"
class=
"account-body-form"
label-width=
"120px"
:rules=
"accountInfoRules"
>
<el-form
ref=
"accountInfoForm"
:model=
"accountInfoForm"
class=
"account-body-form"
:rules=
"accountInfoRules"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"上级商户"
>
<el-form-item
label=
"上级商户
:
"
>
{{
accountDetail
.
merchantName
}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"上级商户模式"
>
<el-form-item
label=
"上级商户模式
:
"
>
{{
accountDetail
.
merchantModelName
}}
</el-form-item>
</el-col>
...
...
@@ -26,8 +26,8 @@
<el-row>
<el-col
:span=
"12"
>
<div
class=
"el-form-item level-row is-required"
>
<label
class=
"el-form-item__label"
style=
"width: 120px"
>
账户等级
</label>
<div
class=
"el-form-item__content"
style=
"margin-left: 120px"
>
<label
class=
"el-form-item__label"
>
账户等级:
</label>
<div
class=
"el-form-item__content"
>
<el-select
size=
"small"
:disabled=
"nextStatus"
v-model=
"accountDetail.merchantAccountLevel"
placeholder=
"请选择"
>
<el-option
v-for=
"item in accountLevel"
:key=
"item.dictValue"
:label=
"item.dictLabel"
:value=
"item.dictValue"
></el-option>
</el-select>
...
...
@@ -37,12 +37,12 @@
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"登录账户名"
prop=
"merchantLoginAccount"
>
<el-form-item
label=
"登录账户名
:
"
prop=
"merchantLoginAccount"
>
<el-input
:disabled=
"nextStatus"
size=
"small"
maxlength=
"15"
v-model=
"accountInfoForm.merchantLoginAccount"
placeholder=
"请输入登录账户名"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"登录密码"
prop=
"merchantLoginPassword"
>
<el-form-item
label=
"登录密码
:
"
prop=
"merchantLoginPassword"
>
<el-input
maxlength=
"20"
:disabled=
"nextStatus"
size=
"small"
type=
"password"
v-model=
"accountInfoForm.merchantLoginPassword"
placeholder=
"请输入登录密码(必须包含6-20个字母+数字)"
show-password
></el-input>
</el-form-item>
</el-col>
...
...
@@ -50,8 +50,8 @@
<el-row>
<el-col
:span=
"16"
>
<div
data-v-995a4ff0=
""
class=
"el-form-item is-required"
>
<label
for=
"merchantLoginAccount"
class=
"el-form-item__label"
style=
"width: 120px"
>
账户类型
</label>
<div
class=
"el-form-item__content
"
style=
"margin-left: 120px
"
>
<label
for=
"merchantLoginAccount"
class=
"el-form-item__label"
>
账户类型:
</label>
<div
class=
"el-form-item__content
account-type
"
>
<div
data-v-995a4ff0=
""
class=
"el-input el-input--small"
>
<auto-button
v-for=
"(item, index) in accountDetail.accountTypes"
:key=
"index"
:btnLabel=
"item.accounttypeName"
:btnValue=
"item.accounttypeId"
:stopClick=
"nextStatus"
@
getBtnStatus=
"getBtnStatus"
></auto-button>
</div>
...
...
@@ -441,7 +441,6 @@ export default {
padding-left
:
20px
;
}
&
-form
{
width
:
80%
;
margin
:
20px
auto
;
.form-row
{
/deep/
.el-form-item__content
{
...
...
@@ -574,4 +573,23 @@ export default {
z-index
:
999
;
//
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
}
/
deep
/
{
.el-form-item__content
{
display
:
flex
;
}
.el-form-item__label
{
width
:
154px
!important
;
}
.el-form-item__content
{
width
:
404px
;
margin-left
:
0
!important
;
}
}
.account-type
{
/deep/
{
.el-input
{
min-width
:
1000px
!important
;
}
}
}
</
style
>
src/views/account/components/baseInfo.vue
View file @
43a2f1d
...
...
@@ -3,115 +3,67 @@
<el-form
ref=
"baseForm"
:model=
"accountAddForm"
class=
"account-body-form"
label-width=
"120px"
:rules=
"baseRules"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"商户名称"
prop=
"merchantName"
>
<el-form-item
label=
"商户名称
:
"
prop=
"merchantName"
>
<el-input
size=
"small"
v-model=
"accountAddForm.merchantName"
:disabled=
"isEdit"
placeholder=
"请输入商户名称"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"商户简称"
>
<el-form-item
label=
"商户简称
:
"
>
<el-input
size=
"small"
v-model=
"accountAddForm.merchantAbbreviation"
placeholder=
"请输入商户简称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"联系电话
"
prop=
"merchantLegalPersonPhone
"
>
<el-form-item
label=
"联系电话
:"
prop=
"merchantLegalPersonPhone"
style=
"margin-bottom:5px
"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"accountAddForm.merchantLegalPersonPhone"
placeholder=
"请输入联系电话"
></el-input>
<
el-checkbox
v-model=
"accountAddForm.isloginName"
>
联系电话同时作为登录账户名
</el-checkbox
>
<
!--
<el-checkbox
v-model=
"accountAddForm.isloginName"
>
联系电话同时作为登录账户名
</el-checkbox>
--
>
</el-form-item>
<el-checkbox
v-model=
"accountAddForm.isloginName"
style=
"margin-left:154px;margin-bottom:20px"
>
联系电话同时作为登录账户名
</el-checkbox>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"联系人"
>
<el-form-item
label=
"联系人
:
"
>
<el-input
size=
"small"
v-model=
"accountAddForm.merchantLegalPerson"
placeholder=
"请输入联系人"
></el-input>
</el-form-item>
</el-col>
</el-row>
<!--
<el-row>
<el-col
:span=
"12"
>
<el-form-item
size=
"small"
label=
"商户类型"
class=
"merchant-row"
>
<el-input
v-model=
"accountAddForm.merchantOrgcode"
placeholder=
"请输入组织机构号码"
v-if=
"accountAddForm.merchantType == 2"
maxlength=
"50"
>
<el-select
v-model=
"accountAddForm.merchantType"
slot=
"prepend"
placeholder=
"请选择"
>
<el-option
label=
"个人"
:value=
"1"
></el-option>
<el-option
label=
"企业"
:value=
"2"
></el-option>
</el-select>
</el-input>
<el-input
size=
"small"
maxlength=
"18"
class=
"card-input"
v-model=
"accountAddForm.merchantOrgcode"
placeholder=
"请输入正确的身份证号"
v-if=
"accountAddForm.merchantType == 1"
>
<el-select
v-model=
"accountAddForm.merchantType"
slot=
"prepend"
placeholder=
"请选择"
>
<el-option
label=
"个人"
:value=
"1"
></el-option>
<el-option
label=
"企业"
:value=
"2"
></el-option>
</el-select>
</el-input>
</el-form-item>
</el-col>
</el-row>
-->
<el-row>
<el-col
:span=
"
24
"
>
<el-col
:span=
"
12
"
>
<ProvinceCity
ref=
"provinceForm"
:subdistrict=
"subdistrict"
@
selectProvince=
"selectProvince"
@
selectCity=
"selectCity"
:detailAddressLabel=
"detailAddressLabel"
@
selectAddressByMap=
"selectAddressByMap"
></ProvinceCity>
<!--
<el-form-item
size=
"small"
label=
"商户地址"
class=
"form-row"
>
<ProvinceCity
ref=
"provinceForm"
@
selectProvince=
"selectProvince"
@
selectCity=
"selectCity"
></ProvinceCity>
<el-input
readonly
style=
"flex:1"
v-model=
"accountAddForm.merchantAddress"
placeholder=
"请选择商户地址"
></el-input>
<el-button
type=
"primary"
class=
"form-btn"
@
click=
"hanleSelectMap"
>
选择地址
</el-button>
</el-form-item>
-->
</el-col>
</el-row>
<!--
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"联系电话"
prop=
"merchantLegalPersonPhone"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"accountAddForm.merchantLegalPersonPhone"
placeholder=
"请输入联系电话"
></el-input>
<el-checkbox
v-model=
"accountAddForm.isloginName"
>
联系电话同时作为登录账户名
</el-checkbox>
<el-form-item
label=
"驻店联系方式:"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"accountAddForm.residentContact"
placeholder=
"请输入驻店联系人"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"联系人"
>
<el-input
size=
"small"
v-model=
"accountAddForm.merchantLegalPerson"
placeholder=
"请输入联系人"
></el-input>
<el-form-item
label=
" "
prop=
"residentPhone"
>
<el-input
maxlength=
"13"
size=
"small"
class=
"phone-input"
v-model=
"accountAddForm.residentPhone"
placeholder=
"请输入驻店电话"
></el-input>
</el-form-item>
</el-col>
</el-row>
-->
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"
驻店联系人
"
>
<el-
input
maxlength=
"11"
size=
"small"
v-model=
"accountAddForm.residentContact"
placeholder=
"请输入驻店联系人"
></el-input
>
<el-form-item
label=
"
营业时间:"
class=
"open-time
"
>
<el-
time-picker
size=
"small"
value-format=
"HH:mm:ss"
is-range
v-model=
"accountAddForm.bussinessTime"
range-separator=
"至"
start-placeholder=
"开始时间"
end-placeholder=
"结束时间"
placeholder=
"选择时间范围"
></el-time-picker
>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"
驻店电话"
prop=
"residentPhone
"
>
<
el-input
maxlength=
"13"
size=
"small"
class=
"phone-input"
v-model=
"accountAddForm.residentPhone"
placeholder=
"请输入驻店电话"
></el-input
>
<el-form-item
label=
"
主营品牌:
"
>
<
select-brand
:brandListTree=
"brandListTree"
@
clickBrand=
"clickBrand"
ref=
"brandListTree"
></select-brand
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"经营业务类型"
>
<el-form-item
label=
"经营业务类型
:"
class=
"bussiness-type
"
>
<el-checkbox-group
v-model=
"accountAddForm.businessType"
>
<el-checkbox
v-for=
"item in businessType"
:label=
"item.dictValue"
:disabled=
"item.dictValue
<
= 6" :key="item">
{{
item
.
dictLabel
}}
</el-checkbox>
</el-checkbox-group>
<!--
<div
class=
"scrm-flex-center"
v-for=
"(item, index) in businessScopeCustomize"
:key=
"index"
>
<el-input
size=
"small"
v-model=
"businessScopeCustomize[index].name"
placeholder=
"请自定义营业范围,建议不超过10个"
></el-input>
<i
class=
"el-icon-circle-plus el-icon-btn"
@
click=
"addBusinessScope"
v-if=
"index == businessScopeCustomize.length - 1"
></i>
<i
class=
"el-icon-remove el-icon-btn"
@
click=
"removeBusinessScope"
v-else
></i>
</div>
-->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"营业时间"
class=
"open-time"
>
<el-time-picker
size=
"small"
value-format=
"HH:mm:ss"
is-range
v-model=
"accountAddForm.bussinessTime"
range-separator=
"至"
start-placeholder=
"开始时间"
end-placeholder=
"结束时间"
placeholder=
"选择时间范围"
></el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"主营品牌"
>
<select-brand
:brandListTree=
"brandListTree"
@
clickBrand=
"clickBrand"
ref=
"brandListTree"
></select-brand>
<!--
<el-input
size=
"small"
v-model=
"filterText"
></el-input>
<div
class=
"brand-tree"
>
<el-tree
:data=
"brandData"
show-checkbox
default-expand-all
node-key=
"id"
ref=
"brandTree"
highlight-current
:props=
"defaultProps"
:filter-node-method=
"filterNode"
@
check=
"clickDeal"
></el-tree>
</div>
-->
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"门店照片"
>
<el-form-item
label=
"门店照片:"
style=
"margin-bottom:5px"
>
<div
class=
"store-upload-list"
>
<template
v-if=
"accountAddForm.merchantFiles.length && accountAddForm.merchantFiles.length > 0"
>
<div
:key=
"index"
v-for=
"(item, index) in accountAddForm.merchantFiles"
class=
"store-border"
@
mouseenter=
"imgIndex = index"
@
mouseleave=
"imgIndex = ''"
>
...
...
@@ -125,32 +77,22 @@
<i
class=
"el-icon-plus"
></i>
</el-upload>
</div>
<div
class=
"tips"
>
图片格式仅支持JPG,PNG格式,大小1M
</div>
</el-form-item>
<div
class=
"tips"
>
图片格式仅支持JPG,PNG格式,大小1M
</div>
</el-col>
</el-row>
</el-form>
<!-- <GLDialog :visible.sync="dialogMapVisible" title="选择地图">
<map-view ref="mapForm" :mapHeight="450"></map-view>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogMapVisible = false">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
</span>
</GLDialog> -->
</div>
</template>
<
script
>
import
util
from
'@/utils/util'
// import mapView from '@/components/mapView/index'
import
SelectBrand
from
'../../baseInfo/selectBrand.vue'
import
ProvinceCity
from
'@/components/province-city/index.vue'
export
default
{
name
:
'base'
,
components
:
{
ProvinceCity
,
// mapView,
SelectBrand
},
props
:
{
...
...
@@ -289,62 +231,6 @@ export default {
if
(
!
value
)
return
true
return
data
.
label
.
indexOf
(
value
)
!==
-
1
},
// getAddress() {
// if (!this.$refs.mapForm.address) {
// this.$message.error('请选择地址')
// return
// }
// this.accountAddForm.merchantAddress = this.$refs.mapForm.address
// let lnglat = this.$refs.mapForm.lnglat
// this.accountAddForm.lat = lnglat.lat
// this.accountAddForm.lng = lnglat.lng
// var fullAddress = ''
// var provincecode = ''
// if (this.$refs.mapForm.geocoderAddress.addressComponent) {
// fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
// provincecode = this.$refs.mapForm.geocoderAddress.adcode
// this.addressData.fullAddress = fullAddress
// this.addressData.provincecode = provincecode
// } else {
// fullAddress = this.addressData.fullAddress
// provincecode = this.addressData.provincecode
// }
// // 获取省市
// var province = ''
// var city = ''
// if (fullAddress) {
// province = fullAddress.province
// city = fullAddress.city ? fullAddress.city : fullAddress.district
// } else {
// province = this.accountAddForm.provinceName
// city = this.accountAddForm.cityName
// provincecode = this.accountAddForm.cityCode
// }
// const municipalities = ['北京市', '天津市', '上海市', '重庆市']
// var municipality = municipalities.find(item => item == province)
// if (municipality) {
// city = city.slice(0, 2) + '城区'
// if (municipality === '重庆市') {
// provincecode = provincecode.slice(0, 4)
// provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县')
// }
// }
// // 判断省市是否匹配
// if (this.accountAddForm.provinceName) {
// if (this.accountAddForm.provinceName !== province && this.accountAddForm.cityName !== city) {
// this.$message.error('您选择的地址错误,请重新选择')
// this.accountAddForm.merchantAddress = ''
// return
// }
// }
// this.dialogMapVisible = false
// this.accountAddForm.provinceName = province
// this.accountAddForm.cityName = city
// this.$refs.provinceForm.init(province, city)
// const { provinceCode, cityCode } = this.$refs.provinceForm.provinceForm
// this.accountAddForm.provinceCode = provinceCode
// this.accountAddForm.cityCode = cityCode
// },
// 当直接点击选择地址时,获取省市ID
init
(
province
,
city
)
{
this
.
$refs
.
provinceForm
.
init
(
province
,
city
)
...
...
@@ -449,7 +335,7 @@ export default {
}
}
.account-body-form
{
width
:
80%
;
//
width
:
80%
;
margin
:
20px
auto
;
.form-row
{
/deep/
.el-form-item__content
{
...
...
@@ -501,9 +387,9 @@ export default {
}
.image-uploader
{
/deep/
.el-upload
{
width
:
1
20
px
;
height
:
80
px
;
line-height
:
80
px
;
width
:
1
04
px
;
height
:
104
px
;
line-height
:
104
px
;
}
}
.brand-tree
{
...
...
@@ -528,6 +414,8 @@ export default {
font-weight
:
400
;
color
:
#999999
;
line-height
:
30px
;
margin-left
:
154px
;
margin-bottom
:
20px
;
}
.btn-unselect
{
display
:
inline-block
;
...
...
@@ -577,4 +465,35 @@ export default {
}
}
}
/
deep
/
{
.tree-box
{
border
:
1px
solid
#e5e5e5
;
}
.el-checkbox
:last-of-type
{
margin-right
:
7px
;
}
}
.account-body-form
{
/deep/
{
.el-form-item
{
margin-bottom
:
20px
;
display
:
flex
;
}
.el-form-item__label
{
width
:
154px
!important
;
}
.el-form-item__content
{
width
:
404px
;
margin-left
:
0
!important
;
}
.select-input-box
{
width
:
404px
;
}
}
}
.bussiness-type
{
/deep/
.el-form-item__content
{
min-width
:
1000px
;
}
}
</
style
>
src/views/baseInfo/editInfo.vue
View file @
43a2f1d
...
...
@@ -12,7 +12,7 @@
<div
class=
"information-title"
>
修改企业信息
</div>
<div
class=
"information-form-box"
>
<el-form
ref=
"baseForm"
:model=
"infoForm"
class=
"account-body-form"
label-width=
"154px"
:rules=
"baseFormRules"
>
<Province
ref=
"provinceForm"
:subdistrict=
"subdistrict"
@
selectProvince=
"selectProvince"
@
selectCity=
"selectCity"
:detailAddressLabel=
"detailAddressLabel"
></Province>
<Province
ref=
"provinceForm"
:subdistrict=
"subdistrict"
@
selectProvince=
"selectProvince"
@
selectCity=
"selectCity"
@
selectAddressByMap=
"selectAddressByMap"
:detailAddressLabel=
"detailAddressLabel"
></Province>
<!--
<el-form-item
size=
"small"
label=
"商户地址:"
class=
"map-row"
>
<Province
ref=
"provinceForm"
:subdistrict=
"subdistrict"
@
selectProvince=
"selectProvince"
@
selectCity=
"selectCity"
></Province>
<el-input
class=
"input-width"
v-model=
"infoForm.merchantAddress"
placeholder=
"请选择商户地址"
readonly=
"readonly"
></el-input>
...
...
@@ -35,13 +35,13 @@
</el-form-item>
</el-form>
</div>
<GLDialog
:visible
.
sync=
"dialogMapVisible"
:mode=
"'big'"
bigTitle=
"选择地址"
>
<
!--
<
GLDialog
:visible
.
sync=
"dialogMapVisible"
:mode=
"'big'"
bigTitle=
"选择地址"
>
<map-view
ref=
"mapForm"
:mapHeight=
"mapHeight"
></map-view>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogMapVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"getAddress"
>
确 定
</el-button>
</span>
</GLDialog>
</GLDialog>
-->
<!--
<GLFooter
style=
"z-index: 2"
>
<el-button
type=
"primary"
@
click=
"handleSave"
>
提交
</el-button>
<el-button
@
click=
"goback"
>
取消
</el-button>
...
...
@@ -57,7 +57,7 @@
<
script
>
import
util
from
'@/utils/util'
import
mapView
from
'@/components/mapView/index'
//
import mapView from '@/components/mapView/index'
import
SelectBrand
from
'./selectBrand.vue'
import
TelPosition
from
'./telPosition.vue'
import
Province
from
'@/components/province-city/index.vue'
...
...
@@ -65,7 +65,7 @@ export default {
name
:
'EditInfo'
,
components
:
{
Province
,
mapView
,
//
mapView,
SelectBrand
,
TelPosition
},
...
...
@@ -109,7 +109,7 @@ export default {
}
},
mounted
()
{
this
.
$refs
.
provinceForm
.
provinceList
()
//
this.$refs.provinceForm.provinceList()
this
.
getUserInfo
()
},
methods
:
{
...
...
@@ -157,7 +157,14 @@ export default {
this
.
infoForm
.
businessType
=
businessType
.
map
(
item
=>
(
item
=
parseInt
(
item
)))
}
// 省市回显
this
.
$refs
.
provinceForm
.
init
(
this
.
infoForm
.
provinceName
,
this
.
infoForm
.
cityName
)
var
provinceData
=
{
province
:
this
.
infoForm
.
provinceName
,
city
:
this
.
infoForm
.
cityName
,
fullAddress
:
this
.
infoForm
.
merchantAddress
,
lng
:
this
.
infoForm
.
lng
,
lat
:
this
.
infoForm
.
lat
}
this
.
$refs
.
provinceForm
.
init
(
provinceData
)
if
(
!
this
.
infoForm
.
merchantBrandMain
)
{
this
.
infoForm
.
merchantBrandMain
=
[]
}
else
{
...
...
@@ -181,80 +188,90 @@ export default {
}
})
},
getAddress
()
{
if
(
!
this
.
$refs
.
mapForm
.
address
)
{
this
.
$message
.
error
(
'请选择地址'
)
return
}
this
.
infoForm
.
merchantAddress
=
this
.
$refs
.
mapForm
.
address
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
this
.
infoForm
.
lat
=
lnglat
.
lat
this
.
infoForm
.
lng
=
lnglat
.
lng
var
fullAddress
=
''
var
provincecode
=
''
if
(
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
)
{
fullAddress
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
provincecode
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
adcode
this
.
addressData
.
fullAddress
=
fullAddress
this
.
addressData
.
provincecode
=
provincecode
// this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
// this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode
}
else
{
fullAddress
=
this
.
addressData
.
fullAddress
provincecode
=
this
.
addressData
.
provincecode
}
// 获取省市
var
province
=
''
var
city
=
''
if
(
fullAddress
)
{
province
=
fullAddress
.
province
city
=
fullAddress
.
city
?
fullAddress
.
city
:
fullAddress
.
district
}
else
{
province
=
this
.
infoForm
.
provinceName
city
=
this
.
infoForm
.
cityName
provincecode
=
this
.
infoForm
.
cityCode
}
const
municipalities
=
[
'北京市'
,
'天津市'
,
'上海市'
,
'重庆市'
]
var
municipality
=
municipalities
.
find
(
item
=>
item
==
province
)
if
(
municipality
)
{
city
=
city
.
slice
(
0
,
2
)
+
'城区'
if
(
municipality
===
'重庆市'
)
{
provincecode
=
provincecode
.
slice
(
0
,
4
)
provincecode
==
5001
?
(
city
=
city
.
slice
(
0
,
2
)
+
'城区'
)
:
(
city
=
city
.
slice
(
0
,
2
)
+
'郊县'
)
}
}
// 判断省市是否匹配
if
(
this
.
infoForm
.
provinceName
)
{
if
(
this
.
infoForm
.
provinceName
!==
province
&&
this
.
infoForm
.
cityName
!==
city
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
infoForm
.
merchantAddress
=
''
return
}
}
this
.
dialogMapVisible
=
false
this
.
infoForm
.
provinceName
=
province
this
.
infoForm
.
cityName
=
city
// 当直接点击选择地址时,获取省市ID
this
.
$refs
.
provinceForm
.
init
(
province
,
city
)
},
//
getAddress() {
//
if (!this.$refs.mapForm.address) {
//
this.$message.error('请选择地址')
//
return
//
}
//
this.infoForm.merchantAddress = this.$refs.mapForm.address
//
let lnglat = this.$refs.mapForm.lnglat
//
this.infoForm.lat = lnglat.lat
//
this.infoForm.lng = lnglat.lng
//
var fullAddress = ''
//
var provincecode = ''
//
if (this.$refs.mapForm.geocoderAddress.addressComponent) {
//
fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
//
provincecode = this.$refs.mapForm.geocoderAddress.adcode
//
this.addressData.fullAddress = fullAddress
//
this.addressData.provincecode = provincecode
//
// this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
//
// this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode
//
} else {
//
fullAddress = this.addressData.fullAddress
//
provincecode = this.addressData.provincecode
//
}
//
// 获取省市
//
var province = ''
//
var city = ''
//
if (fullAddress) {
//
province = fullAddress.province
//
city = fullAddress.city ? fullAddress.city : fullAddress.district
//
} else {
//
province = this.infoForm.provinceName
//
city = this.infoForm.cityName
//
provincecode = this.infoForm.cityCode
//
}
//
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
//
var municipality = municipalities.find(item => item == province)
//
if (municipality) {
//
city = city.slice(0, 2) + '城区'
//
if (municipality === '重庆市') {
//
provincecode = provincecode.slice(0, 4)
//
provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县')
//
}
//
}
//
// 判断省市是否匹配
//
if (this.infoForm.provinceName) {
//
if (this.infoForm.provinceName !== province && this.infoForm.cityName !== city) {
//
this.$message.error('您选择的地址错误,请重新选择')
//
this.infoForm.merchantAddress = ''
//
return
//
}
//
}
//
this.dialogMapVisible = false
//
this.infoForm.provinceName = province
//
this.infoForm.cityName = city
//
// 当直接点击选择地址时,获取省市ID
//
this.$refs.provinceForm.init(province, city)
//
},
// 获取省
selectProvince
(
provinceName
,
provinceCode
)
{
selectProvince
(
val
)
{
this
.
infoForm
.
merchantAddress
=
''
this
.
infoForm
.
cityName
=
''
this
.
infoForm
.
provinceName
=
provinceN
ame
this
.
infoForm
.
provinceCode
=
provinceC
ode
this
.
infoForm
.
provinceName
=
val
.
n
ame
this
.
infoForm
.
provinceCode
=
val
.
adc
ode
},
// 获取市
selectCity
(
cityName
,
cityCode
)
{
if
(
cityN
ame
)
{
this
.
infoForm
.
cityName
=
cityN
ame
this
.
infoForm
.
cityCode
=
cityC
ode
selectCity
(
val
)
{
if
(
val
.
n
ame
)
{
this
.
infoForm
.
cityName
=
val
.
n
ame
this
.
infoForm
.
cityCode
=
val
.
adc
ode
}
else
{
this
.
infoForm
.
cityName
=
''
this
.
infoForm
.
cityCode
=
''
}
this
.
infoForm
.
merchantAddress
=
''
},
// 通过地图选择省市和详细地址
selectAddressByMap
(
val
)
{
console
.
log
(
val
)
const
{
provinceName
,
cityName
,
fullAddress
,
lat
,
lng
}
=
val
this
.
infoForm
.
merchantAddress
=
fullAddress
this
.
infoForm
.
provinceName
=
provinceName
this
.
infoForm
.
cityName
=
cityName
this
.
infoForm
.
lat
=
lat
this
.
infoForm
.
lng
=
lng
},
// 展示驻点电话弹框
showTelDia
()
{
this
.
$refs
.
telDialog
.
init
(
this
.
infoForm
.
residentPhone
)
...
...
@@ -352,4 +369,15 @@ export default {
//
min-width
:
200px
;
flex
:
1
;
}
/
deep
/
{
.el-form-item__content
{
width
:
432px
;
}
.tree-box
{
border
:
1px
solid
#e5e5e5
;
}
.el-checkbox
:last-of-type
{
margin-right
:
7px
;
}
}
</
style
>
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