Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 10b2ef9f
authored
Jun 16, 2023
by
怪兽?别跑
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
门店活码调整
1 parent
1916d083
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
63 deletions
vue3-lw-pc/src/components/common/BaiduMap.vue
vue3-lw-pc/src/views/drainageCode/store/add.vue
vue3-lw-pc/src/components/common/BaiduMap.vue
View file @
10b2ef9
...
@@ -5,16 +5,17 @@
...
@@ -5,16 +5,17 @@
:disabled=
"isDetail"
:disabled=
"isDetail"
@
change=
"setChange"
@
change=
"setChange"
v-model=
"form.address"
v-model=
"form.address"
style=
"width: 500px"
style=
"width: 500px
;
"
popper-class=
"autoAddressClass"
popper-class=
"autoAddressClass"
:fetch-suggestions=
"querySearchAsync"
:fetch-suggestions=
"querySearchAsync"
:trigger-on-focus=
"false"
:trigger-on-focus=
"false"
placeholder=
"详细地址"
placeholder=
"详细地址"
clearable
clearable
@
select=
"handleSelect"
>
@
select=
"handleSelect"
>
<template
#
default=
"
{ item }">
<template
#
default=
"
{ item }">
<el-icon-search
class=
"el-icon-search fl mgr10"
/>
<el-icon-search
class=
"el-icon-search fl mgr10"
/>
<div
style=
"overflow: hidden"
>
<div
style=
"overflow: hidden
;
"
>
<div
class=
"title"
>
{{
item
.
title
}}
</div>
<div
class=
"title"
>
{{
item
.
title
}}
</div>
<span
class=
"address ellipsis"
>
{{
item
.
address
}}
</span>
<span
class=
"address ellipsis"
>
{{
item
.
address
}}
</span>
</div>
</div>
...
@@ -22,15 +23,15 @@
...
@@ -22,15 +23,15 @@
</el-autocomplete>
</el-autocomplete>
</el-form-item>
</el-form-item>
<el-form-item
label=
""
>
<el-form-item
label=
""
>
<div
id=
"map-container"
style=
"width: 500px; height: 300px"
/>
<div
id=
"map-container"
style=
"width: 500px; height: 300px
;
"
/>
</el-form-item>
</el-form-item>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
import
loadBMap
from
'@/utils/baiduMap.js'
import
loadBMap
from
'@/utils/baiduMap.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
form
:
{
form
:
{
...
@@ -41,28 +42,29 @@ export default {
...
@@ -41,28 +42,29 @@ export default {
addrPoint
:
{
addrPoint
:
{
// 详细地址经纬度
// 详细地址经纬度
lng
:
0
,
lng
:
0
,
lat
:
0
,
lat
:
0
},
}
},
},
map
:
''
,
// 地图实例
map
:
''
,
// 地图实例
mk
:
''
,
// Marker实例
mk
:
''
,
// Marker实例
locationPoint
:
null
,
locationPoint
:
null
}
}
},
},
props
:
{
props
:
{
initData
:
{
initData
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
{},
default
:
()
=>
{}
},
},
isDetail
:
{
isDetail
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
},
}
},
},
watch
:
{
watch
:
{
initData
:
{
initData
:
{
handler
(
value
)
{
handler
(
value
)
{
if
(
this
.
initData
.
area
&&
!
this
.
initData
.
address
)
{
if
(
this
.
initData
.
area
&&
!
this
.
initData
.
address
)
{
this
.
form
.
address
=
''
this
.
getPoint
(
this
.
initData
.
area
)
this
.
getPoint
(
this
.
initData
.
area
)
this
.
initMap
()
this
.
initMap
()
}
}
...
@@ -78,8 +80,8 @@ export default {
...
@@ -78,8 +80,8 @@ export default {
this
.
initMap
()
this
.
initMap
()
}
}
},
},
deep
:
true
,
deep
:
true
},
}
},
},
async
mounted
()
{
async
mounted
()
{
// 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P
// 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P
...
@@ -154,7 +156,7 @@ export default {
...
@@ -154,7 +156,7 @@ export default {
// alert('您选择的地址没有解析到结果!')
// alert('您选择的地址没有解析到结果!')
}
}
},
},
that
.
getCity
(
str
),
that
.
getCity
(
str
)
)
)
},
},
// 初始化地图
// 初始化地图
...
@@ -164,7 +166,7 @@ export default {
...
@@ -164,7 +166,7 @@ export default {
this
.
map
=
new
BMap
.
Map
(
'map-container'
,
{
enableMapClick
:
false
})
this
.
map
=
new
BMap
.
Map
(
'map-container'
,
{
enableMapClick
:
false
})
var
point
=
new
BMap
.
Point
(
var
point
=
new
BMap
.
Point
(
this
.
form
.
addrPoint
.
lng
||
117.2334414073489
,
this
.
form
.
addrPoint
.
lng
||
117.2334414073489
,
this
.
form
.
addrPoint
.
lat
||
31.826578293886
,
this
.
form
.
addrPoint
.
lat
||
31.826578293886
)
)
this
.
map
.
centerAndZoom
(
point
,
19
)
this
.
map
.
centerAndZoom
(
point
,
19
)
// 3、设置图像标注并绑定拖拽标注结束后事件
// 3、设置图像标注并绑定拖拽标注结束后事件
...
@@ -175,7 +177,7 @@ export default {
...
@@ -175,7 +177,7 @@ export default {
})
})
// 4、添加(右上角)平移缩放控件
// 4、添加(右上角)平移缩放控件
this
.
map
.
addControl
(
this
.
map
.
addControl
(
new
BMap
.
NavigationControl
({
anchor
:
BMAP_ANCHOR_TOP_RIGHT
,
type
:
BMAP_NAVIGATION_CONTROL_SMALL
}),
new
BMap
.
NavigationControl
({
anchor
:
BMAP_ANCHOR_TOP_RIGHT
,
type
:
BMAP_NAVIGATION_CONTROL_SMALL
})
)
)
// 5、添加(左下角)定位控件
// 5、添加(左下角)定位控件
var
geolocationControl
=
new
BMap
.
GeolocationControl
({
anchor
:
BMAP_ANCHOR_BOTTOM_LEFT
})
var
geolocationControl
=
new
BMap
.
GeolocationControl
({
anchor
:
BMAP_ANCHOR_BOTTOM_LEFT
})
...
@@ -212,7 +214,7 @@ export default {
...
@@ -212,7 +214,7 @@ export default {
that
.
locationPoint
=
new
BMap
.
Point
(
117.2334414073489
,
31.826578293886
)
that
.
locationPoint
=
new
BMap
.
Point
(
117.2334414073489
,
31.826578293886
)
}
}
},
},
{
enableHighAccuracy
:
true
},
{
enableHighAccuracy
:
true
}
)
)
}
}
},
},
...
@@ -243,7 +245,7 @@ export default {
...
@@ -243,7 +245,7 @@ export default {
}
else
{
}
else
{
cb
(
s
)
cb
(
s
)
}
}
},
}
}
}
var
local
=
new
BMap
.
LocalSearch
(
this
.
map
,
options
)
var
local
=
new
BMap
.
LocalSearch
(
this
.
map
,
options
)
local
.
search
(
str
)
local
.
search
(
str
)
...
@@ -318,21 +320,21 @@ export default {
...
@@ -318,21 +320,21 @@ export default {
address
:
''
,
address
:
''
,
addrPoint
:
{
addrPoint
:
{
lng
:
0
,
lng
:
0
,
lat
:
0
,
lat
:
0
},
}
}
}
this
.
onSubmit
()
this
.
onSubmit
()
}
}
},
},
onSubmit
()
{
onSubmit
()
{
this
.
$emit
(
'update'
,
this
.
form
)
this
.
$emit
(
'update'
,
this
.
form
)
},
}
},
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.autoAddressClass
{
.autoAddressClass
{
li
{
li
{
i.el-icon-search
{
i.el-icon-search
{
margin-top
:
11px
;
margin-top
:
11px
;
...
@@ -351,5 +353,5 @@ export default {
...
@@ -351,5 +353,5 @@ export default {
margin-bottom
:
5px
;
margin-bottom
:
5px
;
}
}
}
}
}
}
</
style
>
</
style
>
vue3-lw-pc/src/views/drainageCode/store/add.vue
View file @
10b2ef9
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<div>
<div>
<el-form
label-width=
"120px"
label-position=
"right"
ref=
"form"
:rules=
"rule"
:model=
"form"
>
<el-form
label-width=
"120px"
label-position=
"right"
ref=
"form"
:rules=
"rule"
:model=
"form"
>
<div
class=
"g-card"
>
<div
class=
"g-card"
>
<div
class=
"card-title"
style=
"display: inline-block"
>
基础信息
</div>
<div
class=
"card-title"
style=
"display: inline-block
;
"
>
基础信息
</div>
<div
style=
"float: right"
v-if=
"isDetail"
>
<div
style=
"float: right
;
"
v-if=
"isDetail"
>
<el-button
<el-button
type=
"primary"
type=
"primary"
@
click=
"
@
click=
"
...
@@ -11,10 +11,11 @@
...
@@ -11,10 +11,11 @@
path: 'add',
path: 'add',
query: {
query: {
id: $route.query.id,
id: $route.query.id,
obj: encodeURIComponent(JSON.stringify(form))
,
obj: encodeURIComponent(JSON.stringify(form))
}
,
}
})
})
">
"
>
编辑
编辑
</el-button>
</el-button>
</div>
</div>
...
@@ -23,9 +24,10 @@
...
@@ -23,9 +24,10 @@
:disabled=
"isDetail"
:disabled=
"isDetail"
v-model=
"form.storeName"
v-model=
"form.storeName"
placeholder=
"请输入门店名称"
placeholder=
"请输入门店名称"
style=
"width: 400px"
style=
"width: 400px
;
"
show-word-limit
show-word-limit
maxlength=
"30"
/>
maxlength=
"30"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"所属地区"
prop=
"area"
>
<el-form-item
label=
"所属地区"
prop=
"area"
>
<el-cascader
<el-cascader
...
@@ -34,7 +36,8 @@
...
@@ -34,7 +36,8 @@
:props=
"props"
:props=
"props"
:options=
"cityTree"
:options=
"cityTree"
ref=
"tree"
ref=
"tree"
@
change=
"handleTree"
></el-cascader>
@
change=
"handleTree"
></el-cascader>
</el-form-item>
</el-form-item>
<baidu-map
@
update=
"handleChange"
@
point=
"getPoint"
:isDetail=
"isDetail"
:initData=
"form"
></baidu-map>
<baidu-map
@
update=
"handleChange"
@
point=
"getPoint"
:isDetail=
"isDetail"
:initData=
"form"
></baidu-map>
</div>
</div>
...
@@ -47,10 +50,10 @@
...
@@ -47,10 +50,10 @@
<el-button
v-if=
"!isDetail"
icon=
"el-icon-plus"
type=
"primary"
plain
@
click=
"dialogVisibleQr = true"
>
<el-button
v-if=
"!isDetail"
icon=
"el-icon-plus"
type=
"primary"
plain
@
click=
"dialogVisibleQr = true"
>
{{
form
.
shopGuideUrl
?
'编辑'
:
'选择'
}}
员工活码
{{
form
.
shopGuideUrl
?
'编辑'
:
'选择'
}}
员工活码
</el-button>
</el-button>
<div
style=
"margin-top: 10px"
v-if=
"form.shopGuideUrl"
>
<div
style=
"margin-top: 10px
;
"
v-if=
"form.shopGuideUrl"
>
<ul
class=
"el-upload-list el-upload-list--picture-card"
>
<ul
class=
"el-upload-list el-upload-list--picture-card"
>
<li
class=
"el-upload-list__item is-success"
>
<li
class=
"el-upload-list__item is-success"
>
<img
style=
"width: 100%; height: 100%"
:src=
"form.shopGuideUrl"
/>
<img
style=
"width: 100%; height: 100%
;
"
:src=
"form.shopGuideUrl"
/>
<span
class=
"el-upload-list__item-actions"
>
<span
class=
"el-upload-list__item-actions"
>
<span
class=
"el-upload-list__item-delete"
>
<span
class=
"el-upload-list__item-delete"
>
<el-icon-delete
class=
"el-icon-delete"
@
click=
"handleRemove"
></el-icon-delete>
<el-icon-delete
class=
"el-icon-delete"
@
click=
"handleRemove"
></el-icon-delete>
...
@@ -63,7 +66,7 @@
...
@@ -63,7 +66,7 @@
<el-form-item
label=
"门店群活码"
>
<el-form-item
label=
"门店群活码"
>
<div
v-if=
"form.groupCodeUrl"
>
<div
v-if=
"form.groupCodeUrl"
>
<div>
{{
form
.
groupCodeName
}}
</div>
<div>
{{
form
.
groupCodeName
}}
</div>
<img
style=
"height: 80px; width: 80px; margin-top: 5px"
:src=
"form.groupCodeUrl"
/>
<img
style=
"height: 80px; width: 80px; margin-top: 5px
;
"
:src=
"form.groupCodeUrl"
/>
</div>
</div>
<el-button
<el-button
...
@@ -71,7 +74,8 @@
...
@@ -71,7 +74,8 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
type=
"primary"
type=
"primary"
plain
plain
@
click=
"dialogVisibleSelectQrCode = true"
>
@
click=
"dialogVisibleSelectQrCode = true"
>
{{
form
.
groupCodeUrl
?
'编辑'
:
'选择'
}}
群活码
{{
form
.
groupCodeUrl
?
'编辑'
:
'选择'
}}
群活码
</el-button>
</el-button>
</el-form-item>
</el-form-item>
...
@@ -83,7 +87,8 @@
...
@@ -83,7 +87,8 @@
active-text=
"启用"
active-text=
"启用"
inactive-text=
"停用"
inactive-text=
"停用"
:active-value=
"0"
:active-value=
"0"
:inactive-value=
"1"
></el-switch>
:inactive-value=
"1"
></el-switch>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<el-switch
<el-switch
...
@@ -92,7 +97,8 @@
...
@@ -92,7 +97,8 @@
active-text=
"启用"
active-text=
"启用"
inactive-text=
"停用"
inactive-text=
"停用"
:active-value=
"0"
:active-value=
"0"
:inactive-value=
"1"
></el-switch>
:inactive-value=
"1"
></el-switch>
</
template
>
</
template
>
</el-form-item>
</el-form-item>
</div>
</div>
...
@@ -112,19 +118,20 @@
...
@@ -112,19 +118,20 @@
<SelectQrCode
<SelectQrCode
v-model:visible=
"dialogVisibleSelectQrCode"
v-model:visible=
"dialogVisibleSelectQrCode"
@
success=
"selectedQrCode"
@
success=
"selectedQrCode"
:selected=
"selectedCodeList"
></SelectQrCode>
:selected=
"selectedCodeList"
></SelectQrCode>
<SelectStaffQrCode
v-model:visible=
"dialogVisibleQr"
@
success=
"selectedQr"
></SelectStaffQrCode>
<SelectStaffQrCode
v-model:visible=
"dialogVisibleQr"
@
success=
"selectedQr"
></SelectStaffQrCode>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
BaiduMap
from
'@/components/common/BaiduMap'
import
BaiduMap
from
'@/components/common/BaiduMap'
import
SelectQrCode
from
'@/components/SelectQrCode'
import
SelectQrCode
from
'@/components/SelectQrCode'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
import
SelectStaffQrCode
from
'@/components/SelectStaffQrCode'
import
SelectStaffQrCode
from
'@/components/SelectStaffQrCode'
import
{
getProCityList
}
from
'@/api/common'
import
{
getProCityList
}
from
'@/api/common'
import
{
addOrUpdateStore
,
storeDetail
}
from
'@/api/drainageCode/store'
import
{
addOrUpdateStore
,
storeDetail
}
from
'@/api/drainageCode/store'
export
default
{
export
default
{
name
:
'store-add'
,
name
:
'store-add'
,
data
()
{
data
()
{
return
{
return
{
...
@@ -132,7 +139,7 @@ export default {
...
@@ -132,7 +139,7 @@ export default {
current
:
{
current
:
{
province
:
''
,
province
:
''
,
city
:
''
,
city
:
''
,
area
:
''
,
area
:
''
},
},
form
:
{
form
:
{
storeState
:
1
,
storeState
:
1
,
...
@@ -149,7 +156,7 @@ export default {
...
@@ -149,7 +156,7 @@ export default {
groupCodeUrl
:
''
,
groupCodeUrl
:
''
,
groupCodeName
:
''
,
groupCodeName
:
''
,
groupCodeId
:
''
,
groupCodeId
:
''
,
shopGuideUrl
:
''
,
shopGuideUrl
:
''
},
},
selectedUserList
:
[],
selectedUserList
:
[],
dialogVisibleSelectUser
:
false
,
dialogVisibleSelectUser
:
false
,
...
@@ -159,27 +166,27 @@ export default {
...
@@ -159,27 +166,27 @@ export default {
cityTree
:
[],
cityTree
:
[],
props
:
{
props
:
{
label
:
'name'
,
label
:
'name'
,
value
:
'name'
,
value
:
'name'
},
},
rule
:
{
rule
:
{
storeName
:
[{
required
:
true
,
message
:
'请输入门店名称'
,
trigger
:
'blur'
}],
storeName
:
[{
required
:
true
,
message
:
'请输入门店名称'
,
trigger
:
'blur'
}],
area
:
[{
required
:
true
,
message
:
'请选择所属地区'
,
trigger
:
'blur'
}],
area
:
[{
required
:
true
,
message
:
'请选择所属地区'
,
trigger
:
'blur'
}],
address
:
[{
required
:
true
,
message
:
'请选择详细地址'
,
trigger
:
'blur'
}],
address
:
[{
required
:
true
,
message
:
'请选择详细地址'
,
trigger
:
'blur'
}]
},
},
dialogVisibleQr
:
false
,
dialogVisibleQr
:
false
}
}
},
},
props
:
{
props
:
{
isDetail
:
{
isDetail
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
},
}
},
},
components
:
{
components
:
{
BaiduMap
,
BaiduMap
,
SelectQrCode
,
SelectQrCode
,
SelectUser
,
SelectUser
,
SelectStaffQrCode
,
SelectStaffQrCode
},
},
methods
:
{
methods
:
{
handleRemove
()
{
handleRemove
()
{
...
@@ -223,6 +230,9 @@ export default {
...
@@ -223,6 +230,9 @@ export default {
},
},
handleTree
(
data
)
{
handleTree
(
data
)
{
this
.
form
.
area
=
this
.
areaArray
.
join
(
''
)
this
.
form
.
area
=
this
.
areaArray
.
join
(
''
)
this
.
form
.
address
=
''
this
.
form
.
longitude
=
''
this
.
form
.
latitude
=
''
},
},
selectedUser
(
data
)
{
selectedUser
(
data
)
{
this
.
selectedUserList
=
data
this
.
selectedUserList
=
data
...
@@ -268,7 +278,7 @@ export default {
...
@@ -268,7 +278,7 @@ export default {
this
.
$confirm
(
`是否确认取消
${
this
.
$route
.
query
.
id
?
'编辑'
:
'新建'
}
?取消后不可恢复,请谨慎操作。`
,
'提示'
,
{
this
.
$confirm
(
`是否确认取消
${
this
.
$route
.
query
.
id
?
'编辑'
:
'新建'
}
?取消后不可恢复,请谨慎操作。`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
$router
.
back
()
this
.
$router
.
back
()
...
@@ -295,7 +305,7 @@ export default {
...
@@ -295,7 +305,7 @@ export default {
this
.
selectedUserList
=
[...
arr
]
this
.
selectedUserList
=
[...
arr
]
// this.$forceUpdate()
// this.$forceUpdate()
}
}
},
}
},
},
created
()
{
created
()
{
getProCityList
({
isExtName
:
true
}).
then
((
res
)
=>
{
getProCityList
({
isExtName
:
true
}).
then
((
res
)
=>
{
...
@@ -311,15 +321,15 @@ export default {
...
@@ -311,15 +321,15 @@ export default {
}
}
})
})
}
}
},
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.card-title
{
.card-title
{
font-size
:
16px
;
font-size
:
16px
;
font-weight
:
500
;
font-weight
:
500
;
color
:
#333333
;
color
:
#333333
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
}
}
</
style
>
</
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