Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform-ui
Commits
1e12c2e8
Commit
1e12c2e8
authored
Sep 19, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
# Conflicts: # src/views/vehicleType/modal/oneType.vue
parents
0e988e2b
197f1733
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2221 additions
and
2056 deletions
+2221
-2056
oneCampsiteModal.vue
src/views/campsiteManage/modal/oneCampsiteModal.vue
+637
-579
oneTourModal.vue
src/views/tourManage/modal/oneTourModal.vue
+939
-877
oneType.vue
src/views/vehicleType/modal/oneType.vue
+32
-35
oneCampsiteModal.vue
src/views/xxOfficialWebsite/modal/oneCampsiteModal.vue
+613
-565
No files found.
src/views/campsiteManage/modal/oneCampsiteModal.vue
View file @
1e12c2e8
...
...
@@ -6,14 +6,16 @@
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"营地名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入营地名称"
@
blur=
"checkName()"
></el-input><span
v-if=
"isExist"
style=
"color:red;"
>
标签名已存在
</span>
<el-input
v-model=
"form.name"
placeholder=
"请输入营地名称"
@
blur=
"checkName()"
></el-input>
<span
v-if=
"isExist"
style=
"color:red;"
>
标签名已存在
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"营地地址"
prop=
"addressStr"
>
<el-input
v-model=
"form.addressStr"
readonly
placeholder=
"请输入营地地址"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
<el-input
v-model=
"form.addressStr"
readonly
placeholder=
"请输入营地地址"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -39,14 +41,16 @@
</el-col>
</el-row>
<el-form-item
label=
"营地类型"
prop=
"approvers"
>
<span
v-for=
"item in form.campsiteTagListVos"
:key=
"item.id"
style=
"border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;"
>
{{
item
.
name
}}
</span>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editLable(form.campsiteTagListVos)"
>
编辑
</el-button>
<span
v-for=
"item in form.campsiteTagListVos"
:key=
"item.id"
style=
"border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;"
>
{{
item
.
name
}}
</span>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editLable(form.campsiteTagListVos)"
>
编辑
</el-button>
</el-form-item>
<el-row>
<el-col
:span=
"4"
>
<el-form-item
label=
"热度值"
>
<el-input
v-model=
"form.hot"
placeholder=
"请输入热度值"
type=
"number"
min=
"0"
></el-input>
<el-input
v-model=
"form.hot"
placeholder=
"请输入热度值"
type=
"number"
min=
"0"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -60,14 +64,37 @@
:on-success=
"handleAvatarSuccess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:485*485px
</span></div>
<img
v-if=
"$utils.isString(form.logo) && !$utils.isEmpty(form.logo)"
:src=
"form.logo"
style=
"width:300px;max-height:300px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
<img
v-if=
"$utils.isString(form.logo) && !$utils.isEmpty(form.logo)"
:src=
"form.logo"
style=
"width:300px;max-height:300px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"alt"
>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入描述"
></el-input>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入替代文本"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-title"
>
<el-input
v-model=
"form.imgTitle"
type=
"text"
placeholder=
"请输入图片title"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-keyword"
>
<el-input
v-model=
"form.imgKeyword"
type=
"text"
placeholder=
"请输入图片关键字"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-desc"
>
<el-input
v-model=
"form.imgDesc"
type=
"text"
placeholder=
"请输入图片描述"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -80,10 +107,13 @@
:on-success=
"handlePosterSuccess"
:on-progress=
"uploadPosterProcess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<span
style=
"color: red;"
>
建议尺寸:485*485px
</span></div>
<el-progress
v-show=
"imgPosterFlag == true"
type=
"circle"
:percentage=
"percent_poster"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src=
"form.posterBackground"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgPosterFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:485*485px
</span></div>
<el-progress
v-show=
"imgPosterFlag == true"
type=
"circle"
:percentage=
"percent_poster"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src=
"form.posterBackground"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgPosterFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"轮播图"
:style=
"
{display:'block'}" prop="carouse">
...
...
@@ -95,7 +125,7 @@
:file-list=
"fileList2"
:on-success=
"handleBannerSuccess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
最多上传5张
<span
style=
"color: red;"
>
建议尺寸:1080*644px
</span></div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
最多上传5张
<span
style=
"color: red;"
>
建议尺寸:1080*644px
</span></div>
<el-button
v-if=
"fileList2.length
<5
"
size=
"small"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
</el-form-item>
...
...
@@ -103,13 +133,15 @@
<el-tab-pane
label=
"营地详情"
name=
"first"
>
<!--
<Editor
v-if=
"activeName2=='first'"
@
input=
"handelContentIncrease"
:value=
"form.content"
:myQuillEditor=
"'myQuillEditorContent'"
:activeName2=
"activeName2"
></Editor>
-->
<div
class=
"editor-container"
v-if=
"activeName2=='first'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
</el-tab-pane>
<el-tab-pane
label=
"配套&收费"
name=
"second"
>
<!--
<Editor
v-if=
"activeName2=='second'"
@
input=
"handelIntroduceIncrease"
:value=
"form.configure"
:myQuillEditor=
"'myQuillEditorIntroduce'"
:activeName2=
"activeName2"
></Editor>
-->
<div
class=
"editor-container"
v-if=
"activeName2=='second'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.configure"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.configure"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
</el-tab-pane>
</el-tabs>
...
...
@@ -117,601 +149,627 @@
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
v-if=
"title=='创建' && !isCreate && campsiteshop_btn_update"
@
click=
"create('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate && campsiteshop_btn_update"
@
click=
"update('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='创建' && !isCreate && campsiteshop_btn_update"
@
click=
"create('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate && campsiteshop_btn_update"
@
click=
"update('form')"
>
确 定
</el-button>
</div>
<!--编辑营地地址-->
<campsiteModal
v-if=
"showCampsiteVisible && campsiteshop_btn_update"
:obj=
"campsiteObj"
v-on:campsiteEvent =
"campsiteEvent"
></campsiteModal>
<campsiteModal
v-if=
"showCampsiteVisible && campsiteshop_btn_update"
:obj=
"campsiteObj"
v-on:campsiteEvent=
"campsiteEvent"
></campsiteModal>
<!--编辑营地标签-->
<campsiteLabelModal
v-if=
"editLableVisible && campsiteshop_btn_update"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent =
"tourLabelEvent"
></campsiteLabelModal>
<campsiteLabelModal
v-if=
"editLableVisible && campsiteshop_btn_update"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent=
"tourLabelEvent"
></campsiteLabelModal>
</div>
</
template
>
<
style
>
textarea
{
textarea
{
display
:
none
;
}
.info
{
.info
{
border-radius
:
10px
;
line-height
:
20px
;
padding
:
10px
;
margin
:
10px
;
background-color
:
#ffffff
;
}
.el-upload-list
{
.el-upload-list
{
display
:
flex
;
width
:
100px
;
}
.el-upload-list
li
{
.el-upload-list
li
{
margin-left
:
10px
;
}
</
style
>
<
script
>
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
campsiteLabelModal
from
"../../tourManage/modal/tourLabelModal"
;
//标签
import
campsiteModal
from
"./campsiteModal"
;
//营地地址
import
{
getOneCampsiteShop
,
campsiteAllTagList
,
editCampsiteShop
,
addCampsiteShop
,
existCampsiteShop
}
from
'api/campsiteManage'
;
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
campsiteLabelModal
from
"../../tourManage/modal/tourLabelModal"
;
//标签
import
campsiteModal
from
"./campsiteModal"
;
//营地地址
import
{
getOneCampsiteShop
,
campsiteAllTagList
,
editCampsiteShop
,
addCampsiteShop
,
existCampsiteShop
}
from
'api/campsiteManage'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
export
default
{
props
:
[
"oneRow"
,
"title"
,
"campsiteshop_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
UE
,
campsiteModal
,
campsiteLabelModal
},
data
()
{
var
checkPhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'手机号不能为空'
));
}
else
{
const
reg
=
/^
[
1
](([
3
][
0-9
])
|
([
4
][
5,7,9
])
|
([
5
][
0-9
])
|
([
6
][
6
])
|
([
7
][
1,2,3,5,6,7,8
])
|
([
8
][
0-9
])
|
([
9
][
1,8,9
]))[
0-9
]{8}
$/
console
.
log
(
reg
.
test
(
value
));
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
return
callback
(
new
Error
(
'请输入正确的手机号'
));
}
}
};
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
defaultMsg
:
'这里是UE测试'
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
export
default
{
props
:
[
"oneRow"
,
"title"
,
"campsiteshop_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
UE
,
campsiteModal
,
campsiteLabelModal
},
data
()
{
var
checkPhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'手机号不能为空'
));
}
else
{
const
reg
=
/^
[
1
](([
3
][
0-9
])
|
([
4
][
5,7,9
])
|
([
5
][
0-9
])
|
([
6
][
6
])
|
([
7
][
1,2,3,5,6,7,8
])
|
([
8
][
0-9
])
|
([
9
][
1,8,9
]))[
0-9
]{8}
$/
console
.
log
(
reg
.
test
(
value
));
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
return
callback
(
new
Error
(
'请输入正确的手机号'
));
}
}
};
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
defaultMsg
:
'这里是UE测试'
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
},
isExist
:
false
,
//名称是否已存在
campsiteObj
:
{},
//营地地址
departureList
:
[],
//出发地列表
departureObj
:
{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:
[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
''
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
,
id
:
undefined
,
name
:
undefined
,
//营地名称
hot
:
0
,
//营地热度
servicePhone
:
""
,
//客服电话
phone
:
""
,
//联系电话
province
:
undefined
,
//省份
provinceName
:
undefined
,
//省份名称
city
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
address
:
undefined
,
//详细地址
latitude
:
undefined
,
longitude
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:
[],
//banner轮播
posterBackground
:
''
,
//海报背景
},
showCampsiteVisible
:
false
,
//编辑营地地址
rules
:
{
name
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地名称'
,
trigger
:
'blur'
},
servicePhone
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入客服电话'
,
trigger
:
'blur'
},
phone
:
{
//validator: checkPhone,
type
:
'string'
,
trigger
:
'blur'
,
message
:
'请输入联系电话'
,
required
:
true
},
concat
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入联系人'
,
trigger
:
'blur'
},
addressStr
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地地址'
,
}
},
checkList
:
[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//营地标签
allLabelList
:
[],
//全部营地标签
}
},
isExist
:
false
,
//名称是否已存在
campsiteObj
:
{},
//营地地址
departureList
:
[],
//出发地列表
departureObj
:{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
''
,
id
:
undefined
,
name
:
undefined
,
//营地名称
hot
:
0
,
//营地热度
servicePhone
:
""
,
//客服电话
phone
:
""
,
//联系电话
province
:
undefined
,
//省份
provinceName
:
undefined
,
//省份名称
city
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
address
:
undefined
,
//详细地址
latitude
:
undefined
,
longitude
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:[],
//banner轮播
posterBackground
:
''
,
//海报背景
created
()
{
this
.
getAllLabelList
();
},
showCampsiteVisible
:
false
,
//编辑营地地址
rules
:
{
name
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地名称'
,
trigger
:
'blur'
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
)
{
if
(
!
newValue
)
{
this
.
cleanForm
();
}
},
servicePhone
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入客服电话'
,
trigger
:
'blur'
},
phone
:{
validator
:
checkPhone
,
trigger
:
'blur'
,
required
:
true
},
concat
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入联系人'
,
trigger
:
'blur'
},
addressStr
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地地址'
,
}
},
checkList
:[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//营地标签
allLabelList
:
[],
//全部营地标签
}
},
created
()
{
this
.
getAllLabelList
();
},
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
){
if
(
!
newValue
){
this
.
cleanForm
();
}
},
},
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
){
let
row
=
this
.
oneRow
;
this
.
getOne
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
/**
* 判断标签名是否已存在
* */
checkName
(){
this
.
form
.
name
=
(
this
.
form
.
name
).
trim
();
if
(
!
this
.
form
.
name
){
return
;
}
let
params
=
{
name
:
this
.
form
.
name
};
if
(
this
.
title
==
"编辑"
){
params
.
id
=
this
.
form
.
id
;
}
existCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
isExist
=
response
.
data
;
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
/**
* 编辑营地标签
* */
editLable
(
list
){
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
/**
* 创建
* */
create
(
formName
){
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
carouse
=
[];
//营地轮播图
this
.
form
.
carouse
.
map
(
function
(
item
)
{
let
c
=
{
id
:
item
.
id
,
imgUrl
:
item
.
imgUrl
};
carouse
.
push
(
c
);
});
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
)
{
let
row
=
this
.
oneRow
;
this
.
getOne
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
/**
*
营地类别
*
判断标签名是否已存在
* */
let
campsiteTagDTOS
=
[];
this
.
form
.
campsiteTagListVos
.
map
(
function
(
item
)
{
campsiteTagDTOS
.
push
(
item
.
id
);
});
let
params
=
{
name
:
this
.
form
.
name
,
//营地名称
logo
:
this
.
form
.
logo
,
//封面图
content
:
this
.
form
.
content
,
//营地详情
configure
:
this
.
form
.
configure
,
//配套&收费
hot
:
this
.
form
.
hot
,
//营地热度
campsiteTagDTOS
:
campsiteTagDTOS
,
//营地类别
carouselDTOS
:
carouse
,
//轮播图
concat
:
this
.
form
.
concat
,
//联系人
servicePhone
:
this
.
form
.
servicePhone
,
//客服电话
phone
:
this
.
form
.
phone
,
//联系电话
province
:
this
.
campsiteObj
.
province
,
//省份
provinceName
:
this
.
campsiteObj
.
provinceName
,
//省份名称
city
:
this
.
campsiteObj
.
city
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
address
:
this
.
campsiteObj
.
address
,
//详细地址
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
}
else
{
return
;
}
});
},
/**
* 判断营地名称是否已存在
* */
isExistCampsiteShop
(
type
,
datas
){
if
(
!
this
.
form
.
name
){
return
;
}
let
params
=
{
name
:
this
.
form
.
name
};
if
(
type
==
'update'
){
//编辑
params
.
id
=
this
.
form
.
id
;
}
existCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
isExist
=
response
.
data
;
if
(
response
.
data
){
this
.
isCreate
=
false
;
}
if
(
!
response
.
data
&&
type
==
"update"
){
//编辑
this
.
toUpdate
(
datas
);
}
if
(
!
response
.
data
&&
type
==
"create"
){
//创建
this
.
toCreate
(
datas
);
}
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 编辑
* */
update
(
formName
){
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
isCreate
=
true
;
let
carouse
=
[];
//营地轮播图
this
.
form
.
carouse
.
map
(
function
(
item
)
{
let
c
=
{
id
:
item
.
id
,
imgUrl
:
item
.
imgUrl
};
carouse
.
push
(
c
);
});
checkName
()
{
this
.
form
.
name
=
(
this
.
form
.
name
).
trim
();
if
(
!
this
.
form
.
name
)
{
return
;
}
let
params
=
{
name
:
this
.
form
.
name
};
if
(
this
.
title
==
"编辑"
)
{
params
.
id
=
this
.
form
.
id
;
}
existCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
isExist
=
response
.
data
;
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
/**
*
营地类别
*
编辑营地标签
* */
let
campsiteTagDTOS
=
[];
this
.
form
.
campsiteTagListVos
.
map
(
function
(
item
)
{
campsiteTagDTOS
.
push
(
item
.
id
);
});
let
params
=
{
id
:
this
.
form
.
id
,
name
:
this
.
form
.
name
,
//营地名称
logo
:
this
.
form
.
logo
,
//封面图
content
:
this
.
form
.
content
,
//营地详情
configure
:
this
.
form
.
configure
,
//配套&收费
hot
:
this
.
form
.
hot
,
//营地热度
campsiteTagDTOS
:
campsiteTagDTOS
,
//营地类别
carouselDTOS
:
carouse
,
//轮播图
concat
:
this
.
form
.
concat
,
//联系人
servicePhone
:
this
.
form
.
servicePhone
,
//客服电话
phone
:
this
.
form
.
phone
,
//联系电话
province
:
this
.
campsiteObj
.
province
,
//省份
provinceName
:
this
.
campsiteObj
.
provinceName
,
//省份名称
city
:
this
.
campsiteObj
.
city
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
address
:
this
.
campsiteObj
.
address
,
//详细地址
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"update"
,
params
);
}
else
{
return
;
}
});
},
/**
* 更新
* */
toUpdate
(
params
){
editCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 创建
* */
toCreate
(
params
){
editCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'创建失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 获取全部营地类型
* */
getAllLabelList
()
{
campsiteAllTagList
().
then
(
response
=>
{
this
.
allLabelList
=
response
;
});
},
editLable
(
list
)
{
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
/**
* 创建
* */
create
(
formName
)
{
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
carouse
=
[];
//营地轮播图
this
.
form
.
carouse
.
map
(
function
(
item
)
{
let
c
=
{
id
:
item
.
id
,
imgUrl
:
item
.
imgUrl
};
carouse
.
push
(
c
);
});
/**
* 营地类别
* */
let
campsiteTagDTOS
=
[];
this
.
form
.
campsiteTagListVos
.
map
(
function
(
item
)
{
campsiteTagDTOS
.
push
(
item
.
id
);
});
let
params
=
{
name
:
this
.
form
.
name
,
//营地名称
logo
:
this
.
form
.
logo
,
//封面图
content
:
this
.
form
.
content
,
//营地详情
configure
:
this
.
form
.
configure
,
//配套&收费
hot
:
this
.
form
.
hot
,
//营地热度
campsiteTagDTOS
:
campsiteTagDTOS
,
//营地类别
carouselDTOS
:
carouse
,
//轮播图
concat
:
this
.
form
.
concat
,
//联系人
servicePhone
:
this
.
form
.
servicePhone
,
//客服电话
phone
:
this
.
form
.
phone
,
//联系电话
province
:
this
.
campsiteObj
.
province
,
//省份
provinceName
:
this
.
campsiteObj
.
provinceName
,
//省份名称
city
:
this
.
campsiteObj
.
city
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
address
:
this
.
campsiteObj
.
address
,
//详细地址
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
}
else
{
return
;
}
});
},
/**
* 判断营地名称是否已存在
* */
isExistCampsiteShop
(
type
,
datas
)
{
if
(
!
this
.
form
.
name
)
{
return
;
}
let
params
=
{
name
:
this
.
form
.
name
};
if
(
type
==
'update'
)
{
//编辑
params
.
id
=
this
.
form
.
id
;
}
existCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
isExist
=
response
.
data
;
if
(
response
.
data
)
{
this
.
isCreate
=
false
;
}
if
(
!
response
.
data
&&
type
==
"update"
)
{
//编辑
this
.
toUpdate
(
datas
);
}
if
(
!
response
.
data
&&
type
==
"create"
)
{
//创建
this
.
toCreate
(
datas
);
}
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 编辑
* */
update
(
formName
)
{
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
isCreate
=
true
;
let
carouse
=
[];
//营地轮播图
this
.
form
.
carouse
.
map
(
function
(
item
)
{
let
c
=
{
id
:
item
.
id
,
imgUrl
:
item
.
imgUrl
};
carouse
.
push
(
c
);
});
/**
* 营地类别
* */
let
campsiteTagDTOS
=
[];
this
.
form
.
campsiteTagListVos
.
map
(
function
(
item
)
{
campsiteTagDTOS
.
push
(
item
.
id
);
});
let
params
=
{
id
:
this
.
form
.
id
,
name
:
this
.
form
.
name
,
//营地名称
logo
:
this
.
form
.
logo
,
//封面图
content
:
this
.
form
.
content
,
//营地详情
configure
:
this
.
form
.
configure
,
//配套&收费
hot
:
this
.
form
.
hot
,
//营地热度
campsiteTagDTOS
:
campsiteTagDTOS
,
//营地类别
carouselDTOS
:
carouse
,
//轮播图
concat
:
this
.
form
.
concat
,
//联系人
servicePhone
:
this
.
form
.
servicePhone
,
//客服电话
phone
:
this
.
form
.
phone
,
//联系电话
province
:
this
.
campsiteObj
.
province
,
//省份
provinceName
:
this
.
campsiteObj
.
provinceName
,
//省份名称
city
:
this
.
campsiteObj
.
city
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
address
:
this
.
campsiteObj
.
address
,
//详细地址
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"update"
,
params
);
}
else
{
return
;
}
});
},
/**
* 更新
* */
toUpdate
(
params
)
{
editCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 创建
* */
toCreate
(
params
)
{
editCampsiteShop
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'创建失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 获取全部营地类型
* */
getAllLabelList
()
{
campsiteAllTagList
().
then
(
response
=>
{
this
.
allLabelList
=
response
;
});
},
/**
* 关闭营地地址弹框
* */
campsiteEvent
(
obj
)
{
this
.
showCampsiteVisible
=
false
;
if
(
obj
)
{
this
.
campsiteObj
=
obj
;
let
provinceObj
=
getRegionByCodes
([
obj
.
province
]);
let
cityObj
=
getRegionByCodes
([
obj
.
city
]);
this
.
campsiteObj
.
provinceName
=
provinceObj
[
0
].
name
;
this
.
campsiteObj
.
cityName
=
cityObj
[
0
].
name
;
this
.
form
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
address
;
console
.
log
(
this
.
campsiteObj
);
}
},
/**
* 编辑营地地址
* */
selectDestination
()
{
let
that
=
this
;
this
.
campsiteObj
.
showTitle
=
"营地地址编辑"
;
this
.
campsiteObj
.
eventName
=
'campsiteEvent'
;
this
.
campsiteObj
.
keyword
=
this
.
campsiteObj
.
address
;
this
.
showCampsiteVisible
=
true
;
},
/**
* 关闭营地标签弹框
* */
tourLabelEvent
(
obj
)
{
let
that
=
this
;
this
.
editLableVisible
=
false
;
let
arr
=
[];
let
ckeckList
=
[];
if
(
obj
)
{
this
.
allLabelList
.
map
(
function
(
item
)
{
obj
.
map
(
function
(
b
)
{
if
(
item
.
name
==
b
)
{
arr
.
push
(
item
);
ckeckList
.
push
(
b
);
}
});
});
this
.
form
.
campsiteTagListVos
=
arr
;
this
.
checkList
=
ckeckList
;
console
.
log
(
obj
);
}
},
/**
* 获取一条营地
* */
getOne
(
id
)
{
let
that
=
this
;
getOneCampsiteShop
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
campsiteObj
=
{
address
:
response
.
data
.
address
,
province
:
response
.
data
.
province
,
provinceName
:
response
.
data
.
provinceName
,
city
:
response
.
data
.
city
,
cityName
:
response
.
data
.
cityName
,
latitude
:
response
.
data
.
latitude
,
longitude
:
response
.
data
.
longitude
,
};
response
.
data
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
address
;
let
arr
=
[];
that
.
allLabelList
.
map
(
function
(
b
)
{
response
.
data
.
campsiteTagListVos
.
map
(
function
(
item
)
{
if
(
item
.
id
==
b
.
id
)
{
arr
.
push
(
item
.
name
);
}
});
});
this
.
checkList
=
arr
;
/**
* 关闭营地地址弹框
* */
campsiteEvent
(
obj
)
{
this
.
showCampsiteVisible
=
false
;
if
(
obj
)
{
this
.
campsiteObj
=
obj
;
let
provinceObj
=
getRegionByCodes
([
obj
.
province
]);
let
cityObj
=
getRegionByCodes
([
obj
.
city
]);
this
.
campsiteObj
.
provinceName
=
provinceObj
[
0
].
name
;
this
.
campsiteObj
.
cityName
=
cityObj
[
0
].
name
;
this
.
form
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
address
;
console
.
log
(
this
.
campsiteObj
);
}
},
/**
* 编辑营地地址
* */
selectDestination
()
{
let
that
=
this
;
this
.
campsiteObj
.
showTitle
=
"营地地址编辑"
;
this
.
campsiteObj
.
eventName
=
'campsiteEvent'
;
this
.
campsiteObj
.
keyword
=
this
.
campsiteObj
.
address
;
this
.
showCampsiteVisible
=
true
;
},
/**
* 关闭营地标签弹框
* */
tourLabelEvent
(
obj
)
{
let
that
=
this
;
this
.
editLableVisible
=
false
;
let
arr
=
[];
let
ckeckList
=
[];
if
(
obj
)
{
this
.
allLabelList
.
map
(
function
(
item
)
{
obj
.
map
(
function
(
b
)
{
if
(
item
.
name
==
b
)
{
arr
.
push
(
item
);
ckeckList
.
push
(
b
);
}
});
});
this
.
form
.
campsiteTagListVos
=
arr
;
this
.
checkList
=
ckeckList
;
console
.
log
(
obj
);
}
},
/**
* 获取一条营地
* */
getOne
(
id
)
{
let
that
=
this
;
getOneCampsiteShop
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
campsiteObj
=
{
address
:
response
.
data
.
address
,
province
:
response
.
data
.
province
,
provinceName
:
response
.
data
.
provinceName
,
city
:
response
.
data
.
city
,
cityName
:
response
.
data
.
cityName
,
latitude
:
response
.
data
.
latitude
,
longitude
:
response
.
data
.
longitude
,
};
response
.
data
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
address
;
let
arr
=
[];
that
.
allLabelList
.
map
(
function
(
b
)
{
response
.
data
.
campsiteTagListVos
.
map
(
function
(
item
)
{
if
(
item
.
id
==
b
.
id
)
{
arr
.
push
(
item
.
name
);
}
});
});
this
.
checkList
=
arr
;
//轮播
let
fileList2
=
[];
response
.
data
.
carouse
.
map
(
function
(
p
)
{
let
pp
=
{
id
:
p
.
id
,
url
:
p
.
imgUrl
};
fileList2
.
push
(
pp
);
});
this
.
fileList2
=
fileList2
;
this
.
activeName2
=
"first"
;
})
},
/**
* 旅游-弹框-取消
* */
cancel
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneCampsiteDialogEvent"
,
false
);
},
/**
* 配套&收费 富文本
* */
handelIntroduceIncrease
(
step
){
this
.
form
.
configure
=
step
;
},
/**
* 富文本 营地详情
* */
editorReadyEvent
(
instance
){
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
){
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
){
t
.
form
.
configure
=
instance
.
getContent
();
}
});
},
/**
* 删除banner
* */
handleRemove
(
file
,
fileList
){
let
list
=
[];
fileList
.
map
(
function
(
item
){
if
(
item
.
url
!=
file
.
url
){
list
.
push
(
item
);
}
});
this
.
fileList2
=
list
;
let
arr
=
[];
this
.
form
.
carouse
.
map
(
function
(
item
){
if
(
item
.
imgUrl
!=
file
.
url
){
arr
.
push
(
item
);
}
});
this
.
form
.
carouse
=
arr
;
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
){
this
.
form
.
logo
=
res
.
data
;
},
/**
* banner上传
* */
handleBannerSuccess
(
res
,
file
){
this
.
fileList2
.
push
({
url
:
res
.
data
});
this
.
form
.
carouse
.
push
({
imgUrl
:
res
.
data
});
},
/**
* 海报背景上传
* **/
handlePosterSuccess
(
res
,
file
){
this
.
percent_poster
=
0
;
this
.
imgPosterFlag
=
false
;
this
.
form
.
posterBackground
=
res
.
data
;
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess
(
event
,
file
,
fileList
)
{
this
.
imgPosterFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent_poster
=
Math
.
floor
(
event
.
percent
);
},
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
campsiteObj
=
{
name
:
""
};
//营地地址
this
.
fileList2
=
[];
this
.
activeName2
=
''
;
//营地详情
this
.
form
=
{
id
:
undefined
,
name
:
undefined
,
//营地名称
hot
:
0
,
//营地热度
servicePhone
:
""
,
//客服电话
phone
:
""
,
//联系电话
province
:
undefined
,
//省份
provinceName
:
undefined
,
//省份名称
city
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
address
:
undefined
,
//详细地址
latitude
:
undefined
,
longitude
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:[],
//banner轮播
posterBackground
:
''
,
alt
:
''
,
};
this
.
showCampsiteVisible
=
false
;
//编辑营地地址
}
//轮播
let
fileList2
=
[];
response
.
data
.
carouse
.
map
(
function
(
p
)
{
let
pp
=
{
id
:
p
.
id
,
url
:
p
.
imgUrl
};
fileList2
.
push
(
pp
);
});
this
.
fileList2
=
fileList2
;
this
.
activeName2
=
"first"
;
})
},
/**
* 旅游-弹框-取消
* */
cancel
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneCampsiteDialogEvent"
,
false
);
},
/**
* 配套&收费 富文本
* */
handelIntroduceIncrease
(
step
)
{
this
.
form
.
configure
=
step
;
},
/**
* 富文本 营地详情
* */
editorReadyEvent
(
instance
)
{
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
)
{
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
)
{
t
.
form
.
configure
=
instance
.
getContent
();
}
});
},
/**
* 删除banner
* */
handleRemove
(
file
,
fileList
)
{
let
list
=
[];
fileList
.
map
(
function
(
item
)
{
if
(
item
.
url
!=
file
.
url
)
{
list
.
push
(
item
);
}
});
this
.
fileList2
=
list
;
let
arr
=
[];
this
.
form
.
carouse
.
map
(
function
(
item
)
{
if
(
item
.
imgUrl
!=
file
.
url
)
{
arr
.
push
(
item
);
}
});
this
.
form
.
carouse
=
arr
;
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
)
{
this
.
form
.
logo
=
res
.
data
;
},
/**
* banner上传
* */
handleBannerSuccess
(
res
,
file
)
{
this
.
fileList2
.
push
({
url
:
res
.
data
});
this
.
form
.
carouse
.
push
({
imgUrl
:
res
.
data
});
},
/**
* 海报背景上传
* **/
handlePosterSuccess
(
res
,
file
)
{
this
.
percent_poster
=
0
;
this
.
imgPosterFlag
=
false
;
this
.
form
.
posterBackground
=
res
.
data
;
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess
(
event
,
file
,
fileList
)
{
this
.
imgPosterFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent_poster
=
Math
.
floor
(
event
.
percent
);
},
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
campsiteObj
=
{
name
:
""
};
//营地地址
this
.
fileList2
=
[];
this
.
activeName2
=
''
;
//营地详情
this
.
form
=
{
id
:
undefined
,
name
:
undefined
,
//营地名称
hot
:
0
,
//营地热度
servicePhone
:
""
,
//客服电话
phone
:
""
,
//联系电话
province
:
undefined
,
//省份
provinceName
:
undefined
,
//省份名称
city
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
address
:
undefined
,
//详细地址
latitude
:
undefined
,
longitude
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:
[],
//banner轮播
posterBackground
:
''
,
alt
:
''
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
};
this
.
showCampsiteVisible
=
false
;
//编辑营地地址
}
}
}
}
</
script
>
src/views/tourManage/modal/oneTourModal.vue
View file @
1e12c2e8
...
...
@@ -31,16 +31,16 @@
</el-row>
<el-row>
<el-col
:span=
"4"
>
<el-form-item
label=
"是否为推荐"
>
<el-radio
class=
"radio"
v-model=
"form.recommend"
label=
"1"
>
是
</el-radio>
<el-radio
class=
"radio"
v-model=
"form.recommend"
label=
"0"
>
否
</el-radio>
</el-form-item>
<el-form-item
label=
"是否为推荐"
>
<el-radio
class=
"radio"
v-model=
"form.recommend"
label=
"1"
>
是
</el-radio>
<el-radio
class=
"radio"
v-model=
"form.recommend"
label=
"0"
>
否
</el-radio>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"会员价格"
>
<el-radio
class=
"radio"
v-model=
"form.isMember"
label=
"1"
>
启用会员价
</el-radio>
<el-radio
class=
"radio"
v-model=
"form.isMember"
label=
"0"
>
不启用会员价
</el-radio>
</el-form-item>
<el-form-item
label=
"会员价格"
>
<el-radio
class=
"radio"
v-model=
"form.isMember"
label=
"1"
>
启用会员价
</el-radio>
<el-radio
class=
"radio"
v-model=
"form.isMember"
label=
"0"
>
不启用会员价
</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
""
>
...
...
@@ -50,75 +50,88 @@
<el-row>
<el-col
:span=
"4"
>
<el-form-item
label=
"库存"
prop=
"stock"
>
<el-input
v-model=
"form.stock"
placeholder=
"请输入总人数"
type=
"number"
min=
"0"
></el-input>
<el-input
v-model=
"form.stock"
placeholder=
"请输入总人数"
type=
"number"
min=
"0"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!--
<el-col
:span=
"24"
>
-->
<el-form-item
label=
"出发地"
>
<el-input
style=
"display: inline-block;margin-right: 10px;width: 240px;"
v-model=
"item.name"
v-for=
"item in departureList"
:key=
"item.id"
readonly
placeholder=
"请输入内容"
></el-input>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editDeparture(departureList)"
>
编辑
</el-button>
<!--
<el-autocomplete-->
<!--v-for="item in departureList"-->
<!--:key="item.id"-->
<!--class="inline-input"-->
<!--style="margin-left: 10px;"-->
<!--v-model="item.name"-->
<!--:fetch-suggestions="querySearch"-->
<!--placeholder="请输入内容"-->
<!--@select="handleSelect"-->
<!-->
</el-autocomplete>
-->
</el-form-item>
<el-form-item
label=
"出发地"
>
<el-input
style=
"display: inline-block;margin-right: 10px;width: 240px;"
v-model=
"item.name"
v-for=
"item in departureList"
:key=
"item.id"
readonly
placeholder=
"请输入内容"
></el-input>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editDeparture(departureList)"
>
编辑
</el-button>
<!--
<el-autocomplete-->
<!--v-for="item in departureList"-->
<!--:key="item.id"-->
<!--class="inline-input"-->
<!--style="margin-left: 10px;"-->
<!--v-model="item.name"-->
<!--:fetch-suggestions="querySearch"-->
<!--placeholder="请输入内容"-->
<!--@select="handleSelect"-->
<!-->
</el-autocomplete>
-->
</el-form-item>
<!--
</el-col>
-->
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"目的地"
>
<el-input
v-model=
"destinationObj.address"
readonly
placeholder=
"请选择目的地"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
<el-input
v-model=
"destinationObj.address"
readonly
placeholder=
"请选择目的地"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!--
<el-col
:span=
"6"
>
-->
<el-form-item
label=
"途径地"
>
<!--
<el-input
v-for=
"item in pathway"
style=
"display: inline-block;margin-right: 10px;width: 240px;"
--
>
<!--:key="item.id" v-model="item.name" readonly placeholder="请选择途径地" :data-rowId="item.id" :on-icon-click="selectPathway" icon="edit">
</el-input>
-->
<el-button
v-for=
"item in pathway"
:key=
"item.id"
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
@
click=
"editPathway(item)"
>
{{
item
.
name
}}
<i
class=
"el-icon-edit el-icon--right"
></i></el-button>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"plus"
@
click=
"addPathway()"
>
添加
</el-button>
</el-form-item>
<el-form-item
label=
"途径地"
>
<!--
<el-input
v-for=
"item in pathway"
style=
"display: inline-block;margin-right: 10px;width: 240px;"
--
>
<!--:key="item.id" v-model="item.name" readonly placeholder="请选择途径地" :data-rowId="item.id" :on-icon-click="selectPathway" icon="edit">
</el-input>
-->
<el-button
v-for=
"item in pathway"
:key=
"item.id"
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
@
click=
"editPathway(item)"
>
{{
item
.
name
}}
<i
class=
"el-icon-edit el-icon--right"
></i></el-button>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"plus"
@
click=
"addPathway()"
>
添加
</el-button>
</el-form-item>
<!--
</el-col>
-->
</el-row>
<el-row>
<el-form-item
prop=
"operator"
label=
"活动日期"
>
<!--tourDepartTimeVo-->
<el-button
v-for=
"item in form.tourDepartTimeVo"
disabled
:key=
"item.id"
class=
"el-button el-button--default"
type=
"button"
>
{{
item
.
startTime
}}
~
{{
item
.
endTime
}}
</el-button>
<el-form-item
prop=
"operator"
label=
"活动日期"
>
<!--tourDepartTimeVo-->
<el-button
v-for=
"item in form.tourDepartTimeVo"
disabled
:key=
"item.id"
class=
"el-button el-button--default"
type=
"button"
>
{{
item
.
startTime
}}
~
{{
item
.
endTime
}}
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editTime()"
>
编辑
</el-button>
<!--
<el-input
v-model=
"form.operator"
placeholder=
"请选择活动日期"
></el-input>
-->
</el-form-item>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editTime()"
>
编辑
</el-button>
<!--
<el-input
v-model=
"form.operator"
placeholder=
"请选择活动日期"
></el-input>
-->
</el-form-item>
</el-row>
<el-form-item
label=
"旅行标签"
>
<span
v-for=
"item in form.tagDTOS"
:key=
"item.id"
style=
"border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;"
>
{{
item
.
name
}}
</span>
<!--
<el-checkbox-group
v-model=
"checkList"
>
-->
<!--
<el-checkbox
v-for=
"item in allLabelList"
--
>
<!--:key="item.id" :label="item.name">
</el-checkbox>
-->
<span
v-for=
"item in form.tagDTOS"
:key=
"item.id"
style=
"border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;"
>
{{
item
.
name
}}
</span>
<!--
<el-checkbox-group
v-model=
"checkList"
>
-->
<!--
<el-checkbox
v-for=
"item in allLabelList"
--
>
<!--:key="item.id" :label="item.name">
</el-checkbox>
-->
<!--
</el-checkbox-group>
-->
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editLable(form.tagDTOS)"
>
编辑
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"edit"
@
click=
"editLable(form.tagDTOS)"
>
编辑
</el-button>
</el-form-item>
<el-row>
<el-col
:span=
"4"
>
<el-form-item
label=
"浏览量"
>
<el-input
v-model=
"form.viewCount"
placeholder=
"请输入浏览量"
type=
"number"
min=
"0"
></el-input>
<el-input
v-model=
"form.viewCount"
placeholder=
"请输入浏览量"
type=
"number"
min=
"0"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<el-form-item
label=
"排序"
>
<el-input
v-model=
"form.rank"
placeholder=
"请输入排序值"
type=
"number"
min=
"0"
></el-input>
<el-input
v-model=
"form.rank"
placeholder=
"请输入排序值"
type=
"number"
min=
"0"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
...
...
@@ -142,16 +155,40 @@
:on-success=
"handleAvatarSuccess"
:on-progress=
"uploadProcess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<span
style=
"color: red;"
>
建议尺寸:320*228px
</span></div>
<el-progress
v-show=
"imgFlag == true"
type=
"circle"
:percentage=
"percent"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.cover) && !$utils.isEmpty(form.cover) && !imgFlag"
:src=
"form.cover"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:320*228px
</span></div>
<el-progress
v-show=
"imgFlag == true"
type=
"circle"
:percentage=
"percent"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.cover) && !$utils.isEmpty(form.cover) && !imgFlag"
:src=
"form.cover"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"alt"
>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入描述"
></el-input>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入替代文本"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-title"
>
<el-input
v-model=
"form.imgTitle"
type=
"text"
placeholder=
"请输入图片title"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-keyword"
>
<el-input
v-model=
"form.imgKeyword"
type=
"text"
placeholder=
"请输入图片关键字"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-desc"
>
<el-input
v-model=
"form.imgDesc"
type=
"text"
placeholder=
"请输入图片描述"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -164,10 +201,13 @@
:on-success=
"handlePosterSuccess"
:on-progress=
"uploadPosterProcess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<span
style=
"color: red;"
>
建议尺寸:320*228px
</span></div>
<el-progress
v-show=
"imgPosterFlag == true"
type=
"circle"
:percentage=
"percent_poster"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src=
"form.posterBackground"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgPosterFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:320*228px
</span></div>
<el-progress
v-show=
"imgPosterFlag == true"
type=
"circle"
:percentage=
"percent_poster"
style=
"margin-top: 20px"
></el-progress>
<img
v-if=
"$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src=
"form.posterBackground"
style=
"width:300px;max-height:300px;"
>
<i
v-else-if=
"!imgPosterFlag"
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"轮播图"
:style=
"
{display:'block'}">
...
...
@@ -186,21 +226,24 @@
<el-tabs
v-model=
"activeName2"
type=
"card"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"行程亮点"
name=
"first"
>
<div
class=
"editor-container"
v-if=
"activeName2=='first'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
<!--
<Editor
v-if=
"activeName2=='first'"
@
input=
"handelContentIncrease"
:value=
"form.content"
:myQuillEditor=
"'myQuillEditorContent'"
:activeName2=
"activeName2"
></Editor>
-->
<!--
<Editor
v-if=
"activeName2=='first'"
@
input=
"handelContentIncrease"
:value=
"form.content"
:myQuillEditor=
"'myQuillEditorContent'"
:activeName2=
"activeName2"
></Editor>
-->
</el-tab-pane>
<el-tab-pane
label=
"行程介绍"
name=
"second"
>
<div
class=
"editor-container"
v-if=
"activeName2=='second'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.introduce"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.introduce"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
<!--
<Editor
v-if=
"activeName2=='second'"
@
input=
"handelIntroduceIncrease"
:value=
"form.introduce"
:myQuillEditor=
"'myQuillEditorIntroduce'"
:activeName2=
"activeName2"
></Editor>
-->
<!--
<Editor
v-if=
"activeName2=='second'"
@
input=
"handelIntroduceIncrease"
:value=
"form.introduce"
:myQuillEditor=
"'myQuillEditorIntroduce'"
:activeName2=
"activeName2"
></Editor>
-->
</el-tab-pane>
<el-tab-pane
label=
"费用说明"
name=
"third"
>
<el-tab-pane
label=
"费用说明"
name=
"third"
>
<div
class=
"editor-container"
v-if=
"activeName2=='third'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.explain"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.explain"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
<!--
<Editor
v-if=
"activeName2=='third'"
@
input=
"handelExplainIncrease"
:value=
"form.explain"
:myQuillEditor=
"'myQuillEditorExplain'"
:activeName2=
"activeName2"
></Editor>
-->
<!--
<Editor
v-if=
"activeName2=='third'"
@
input=
"handelExplainIncrease"
:value=
"form.explain"
:myQuillEditor=
"'myQuillEditorExplain'"
:activeName2=
"activeName2"
></Editor>
-->
</el-tab-pane>
</el-tabs>
</el-form>
...
...
@@ -210,758 +253,774 @@
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate&&good_btn_update"
@
click=
"update('form')"
>
确 定
</el-button>
</div>
<!--编辑出发地-->
<departureModal
v-if=
"editDepartureVisible"
:list=
"departureList"
v-on:departureEvent =
"departureEvent"
></departureModal>
<departureModal
v-if=
"editDepartureVisible"
:list=
"departureList"
v-on:departureEvent=
"departureEvent"
></departureModal>
<!--编辑目的地-->
<destination
v-if=
"showDestinationVisible"
:obj=
"destinationObj"
v-on:destinationEvent =
"destinationEvent"
></destination>
<destination
v-if=
"showDestinationVisible"
:obj=
"destinationObj"
v-on:destinationEvent=
"destinationEvent"
></destination>
<!--编辑途径地-->
<destination
v-if=
"showPathWayVisible"
:obj=
"onePathObj"
v-on:pathWayEvent
=
"pathWayEvent"
></destination>
<destination
v-if=
"showPathWayVisible"
:obj=
"onePathObj"
v-on:pathWayEvent
=
"pathWayEvent"
></destination>
<!--编辑活动时间-->
<tourTime
v-if=
"showTimeVisible"
:list=
"form.tourDepartTimeVo"
:number=
"form.number"
v-on:tourDepartTimeEvent =
"tourDepartTimeEvent"
></tourTime>
<tourTime
v-if=
"showTimeVisible"
:list=
"form.tourDepartTimeVo"
:number=
"form.number"
v-on:tourDepartTimeEvent=
"tourDepartTimeEvent"
></tourTime>
<!--编辑旅游标签-->
<tourLabelModal
v-if=
"editLableVisible"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent =
"tourLabelEvent"
></tourLabelModal>
<tourLabelModal
v-if=
"editLableVisible"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent=
"tourLabelEvent"
></tourLabelModal>
</div>
</
template
>
<
style
>
textarea
{
textarea
{
display
:
none
;
}
.el-upload-list
{
.el-upload-list
{
display
:
flex
;
width
:
100px
;
}
.el-upload-list
li
{
.el-upload-list
li
{
margin-left
:
10px
;
}
</
style
>
<
script
>
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
Destination
from
"./destinationModal"
;
//目的地弹框
import
tourTime
from
"./tourTime"
;
//活动时间
import
tourLabelModal
from
"./tourLabelModal"
;
//旅游标签
import
departureModal
from
"./departureModal"
;
//出发地弹框
import
{
page
,
goodsEdit
,
getOneGoodsById
}
from
'api/tourManage'
;
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
Destination
from
"./destinationModal"
;
//目的地弹框
import
tourTime
from
"./tourTime"
;
//活动时间
import
tourLabelModal
from
"./tourLabelModal"
;
//旅游标签
import
departureModal
from
"./departureModal"
;
//出发地弹框
import
{
page
,
goodsEdit
,
getOneGoodsById
}
from
'api/tourManage'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
getAllCompany
,
getAll
}
from
'api/base_info/branch_company/'
;
import
{
getTourTagList
,
getAllTourTag
}
from
'api/tourManage'
;
import
ElRow
from
"element-ui/packages/row/src/row"
;
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
getAllCompany
,
getAll
}
from
'api/base_info/branch_company/'
;
import
{
getTourTagList
,
getAllTourTag
}
from
'api/tourManage'
;
import
ElRow
from
"element-ui/packages/row/src/row"
;
export
default
{
props
:
[
"oneTourRow"
,
"title"
,
"good_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
export
default
{
props
:
[
"oneTourRow"
,
"title"
,
"good_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
// Editor,
ElRow
,
UE
,
Destination
,
tourTime
,
tourLabelModal
,
departureModal
},
data
()
{
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
ElRow
,
UE
,
Destination
,
tourTime
,
tourLabelModal
,
departureModal
},
percent
:
0
,
//上传进度
imgFlag
:
false
,
onePathObj
:{
name
:
""
},
//待编辑的途径地
destinationObj
:{},
//目的地
departureList
:
[],
//出发地列表
departureObj
:{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
undefined
,
childPrice
:
undefined
,
//儿童价
isOutside
:
"0"
,
tourDepartVo
:
undefined
,
//type:0出发地 1途径地 2目的地
content
:
""
,
//行程亮点
cover
:
undefined
,
//封面图
describe
:
undefined
,
//描述
introduce
:
""
,
//行程介绍
crtTime
:
undefined
,
explain
:
""
,
//费用说明
name
:
undefined
,
//旅行名称
price
:
undefined
,
//成人价
rank
:
undefined
,
recommend
:
"0"
,
//是否设置为推荐,默认不推荐
saleCount
:
undefined
,
//初始销量
status
:
undefined
,
//0:未发布,1:上架 2:下架
stock
:
undefined
,
//总人数
unit
:
undefined
,
//单位
updTime
:
undefined
,
//更新时间
viewCount
:
undefined
,
//浏览量
isMember
:
"0"
,
//是否是会员商品
tagDTOS
:
[],
//旅行标签
bannerDTOS
:[],
//banner轮播
posterBackground
:
''
,
//海报背景
},
showDestinationVisible
:
false
,
//编辑目的地
showPathWayVisible
:
false
,
//编辑途径地
showTimeVisible
:
false
,
//编辑时间
rules
:
{
name
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入旅游名称'
,
trigger
:
'blur'
},
price
:
{
required
:
true
,
message
:
'请输入价格'
,
},
childPrice
:
{
required
:
true
,
message
:
'请输入儿童价格'
},
stock
:
{
required
:
true
,
message
:
'请输入库存'
}
data
()
{
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
},
percent
:
0
,
//上传进度
imgFlag
:
false
,
onePathObj
:
{
name
:
""
},
//待编辑的途径地
destinationObj
:
{},
//目的地
departureList
:
[],
//出发地列表
departureObj
:
{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:
[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
undefined
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
,
childPrice
:
undefined
,
//儿童价
isOutside
:
"0"
,
tourDepartVo
:
undefined
,
//type:0出发地 1途径地 2目的地
content
:
""
,
//行程亮点
cover
:
undefined
,
//封面图
describe
:
undefined
,
//描述
introduce
:
""
,
//行程介绍
crtTime
:
undefined
,
explain
:
""
,
//费用说明
name
:
undefined
,
//旅行名称
price
:
undefined
,
//成人价
rank
:
undefined
,
recommend
:
"0"
,
//是否设置为推荐,默认不推荐
saleCount
:
undefined
,
//初始销量
status
:
undefined
,
//0:未发布,1:上架 2:下架
stock
:
undefined
,
//总人数
unit
:
undefined
,
//单位
updTime
:
undefined
,
//更新时间
viewCount
:
undefined
,
//浏览量
isMember
:
"0"
,
//是否是会员商品
tagDTOS
:
[],
//旅行标签
bannerDTOS
:
[],
//banner轮播
posterBackground
:
''
,
//海报背景
},
showDestinationVisible
:
false
,
//编辑目的地
showPathWayVisible
:
false
,
//编辑途径地
showTimeVisible
:
false
,
//编辑时间
rules
:
{
name
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入旅游名称'
,
trigger
:
'blur'
},
price
:
{
required
:
true
,
message
:
'请输入价格'
,
},
childPrice
:
{
required
:
true
,
message
:
'请输入儿童价格'
},
stock
:
{
required
:
true
,
message
:
'请输入库存'
}
},
checkList
:
[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//旅游标签
editDepartureVisible
:
false
,
//出发地弹框
allUpkeepItems
:
null
,
dialogStatus
:
undefined
,
allLabelList
:
[],
//全部旅游标签
}
},
checkList
:[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//旅游标签
editDepartureVisible
:
false
,
//出发地弹框
allUpkeepItems
:
null
,
dialogStatus
:
undefined
,
allLabelList
:
[],
//全部旅游标签
}
},
created
()
{
getAll
()
.
then
(
response
=>
{
this
.
allCompaniesArr
=
response
.
data
;
})
getAllCompany
(
codeAndBranchCompany
=>
{
this
.
allCompanies
=
codeAndBranchCompany
;
});
this
.
getAllLabelList
();
},
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
){
if
(
!
newValue
){
this
.
cleanForm
();
}
},
},
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
){
let
row
=
this
.
oneTourRow
;
this
.
getOneGoods
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
/**
* 封面图
* */
uploadProcess
(
event
,
file
,
fileList
)
{
this
.
imgFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent
=
Math
.
floor
(
event
.
percent
);
},
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
getWeek
(
week
,
name
){
let
weekStr
=
""
;
switch
(
week
)
{
case
0
:
weekStr
=
name
+
"天"
;
break
;
case
1
:
weekStr
=
name
+
"一"
;
break
;
case
2
:
weekStr
=
name
+
"二"
;
break
;
case
3
:
weekStr
=
name
+
"三"
;
break
;
case
4
:
weekStr
=
name
+
"四"
;
break
;
case
5
:
weekStr
=
name
+
"五"
;
break
;
case
6
:
weekStr
=
name
+
"六"
;
break
;
}
return
weekStr
;
},
/**
* 编辑出发地
* */
editDeparture
(
list
){
console
.
log
(
list
);
this
.
editDepartureVisible
=
true
;
},
/**
* 关闭出发地弹框
* */
departureEvent
(
obj
){
this
.
editDepartureVisible
=
false
;
if
(
obj
){
this
.
departureList
=
obj
;
console
.
log
(
obj
);
}
},
/**
* 编辑旅游标签
* */
editLable
(
list
){
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
/**
* 创建
* */
create
(
formName
){
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
//旅游标签
let
tagDTOS
=
[];
this
.
form
.
tagDTOS
.
map
(
function
(
item
){
if
(
item
.
tagId
){
tagDTOS
.
push
({
tagId
:
item
.
tagId
});
}
else
{
tagDTOS
.
push
({
tagId
:
item
.
id
});
}
});
let
siteDTOS
=
[];
//出发地
this
.
departureList
.
map
(
function
(
item
){
let
pp
=
item
.
province
?
item
.
province
:
item
.
addrProvince
;
let
c
=
item
.
addrCity
?
item
.
addrCity
:
item
.
city
;
let
provinceObj
=
pp
?
getRegionByCodes
([
pp
]):
[{
name
:
""
}];
let
cityObj
=
c
?
getRegionByCodes
([
c
]):[{
name
:
""
}];
let
p
=
{
name
:
item
.
name
,
departTime
:
item
.
departTime
?
item
.
departTime
:
0
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
companyId
:
item
.
companyId
,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
0
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
created
()
{
getAll
()
.
then
(
response
=>
{
this
.
allCompaniesArr
=
response
.
data
;
})
getAllCompany
(
codeAndBranchCompany
=>
{
this
.
allCompanies
=
codeAndBranchCompany
;
});
if
(
this
.
departureList
.
length
<=
0
){
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择出发地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
this
.
getAllLabelList
();
},
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
)
{
if
(
!
newValue
)
{
this
.
cleanForm
();
}
},
},
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
)
{
let
row
=
this
.
oneTourRow
;
this
.
getOneGoods
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
//途径地
this
.
pathway
.
map
(
function
(
item
){
let
provinceObj
=
item
.
province
?
getRegionByCodes
([
item
.
province
]):
[{
name
:
""
}];
let
cityObj
=
item
.
city
?
getRegionByCodes
([
item
.
city
]):[{
name
:
""
}];
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
/**
* 封面图
* */
uploadProcess
(
event
,
file
,
fileList
)
{
this
.
imgFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent
=
Math
.
floor
(
event
.
percent
);
},
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
getWeek
(
week
,
name
)
{
let
weekStr
=
""
;
switch
(
week
)
{
case
0
:
weekStr
=
name
+
"天"
;
break
;
case
1
:
weekStr
=
name
+
"一"
;
break
;
case
2
:
weekStr
=
name
+
"二"
;
break
;
case
3
:
weekStr
=
name
+
"三"
;
break
;
case
4
:
weekStr
=
name
+
"四"
;
break
;
case
5
:
weekStr
=
name
+
"五"
;
break
;
case
6
:
weekStr
=
name
+
"六"
;
break
;
}
return
weekStr
;
},
/**
* 编辑出发地
* */
editDeparture
(
list
)
{
console
.
log
(
list
);
this
.
editDepartureVisible
=
true
;
},
/**
* 关闭出发地弹框
* */
departureEvent
(
obj
)
{
this
.
editDepartureVisible
=
false
;
if
(
obj
)
{
this
.
departureList
=
obj
;
console
.
log
(
obj
);
}
},
/**
* 编辑旅游标签
* */
editLable
(
list
)
{
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
/**
* 创建
* */
create
(
formName
)
{
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
//旅游标签
let
tagDTOS
=
[];
this
.
form
.
tagDTOS
.
map
(
function
(
item
)
{
if
(
item
.
tagId
)
{
tagDTOS
.
push
({
tagId
:
item
.
tagId
});
}
else
{
tagDTOS
.
push
({
tagId
:
item
.
id
});
}
});
let
siteDTOS
=
[];
//出发地
this
.
departureList
.
map
(
function
(
item
)
{
let
pp
=
item
.
province
?
item
.
province
:
item
.
addrProvince
;
let
c
=
item
.
addrCity
?
item
.
addrCity
:
item
.
city
;
let
provinceObj
=
pp
?
getRegionByCodes
([
pp
])
:
[{
name
:
""
}];
let
cityObj
=
c
?
getRegionByCodes
([
c
])
:
[{
name
:
""
}];
let
p
=
{
name
:
item
.
name
,
departTime
:
item
.
departTime
?
item
.
departTime
:
0
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
companyId
:
item
.
companyId
,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
0
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
if
(
this
.
departureList
.
length
<=
0
)
{
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择出发地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
//途径地
this
.
pathway
.
map
(
function
(
item
)
{
let
provinceObj
=
item
.
province
?
getRegionByCodes
([
item
.
province
])
:
[{
name
:
""
}];
let
cityObj
=
item
.
city
?
getRegionByCodes
([
item
.
city
])
:
[{
name
:
""
}];
// let provinceObj = getRegionByCodes([item.province]);
// let cityObj = getRegionByCodes([item.city]);
let
p
=
{
name
:
item
.
name
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
let
p
=
{
name
:
item
.
name
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
// companyId: item.id,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
1
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
//destinationObj目的地
let
destinationObj
=
this
.
destinationObj
;
if
(
!
destinationObj
.
name
){
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择目的地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
let
provinceObj
=
destinationObj
.
province
?
getRegionByCodes
([
destinationObj
.
province
]):[{
name
:
""
}];
let
cityObj
=
destinationObj
.
city
?
getRegionByCodes
([
destinationObj
.
city
]):[{
name
:
""
}];
let
p
=
{
name
:
destinationObj
.
name
,
address
:
destinationObj
.
addrDetail
?
destinationObj
.
addrDetail
:
destinationObj
.
address
,
province
:
destinationObj
.
addrProvince
?
destinationObj
.
addrProvince
:
destinationObj
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
destinationObj
.
addrCity
?
destinationObj
.
addrCity
:
destinationObj
.
city
,
longitude
:
destinationObj
.
longitude
,
latitude
:
destinationObj
.
latitude
,
type
:
2
};
siteDTOS
.
push
(
p
);
this
.
isCreate
=
true
;
let
params
=
{
isOutside
:
this
.
form
.
isOutside
,
//省内、省外
name
:
this
.
form
.
name
,
//旅游路线名称
cover
:
this
.
form
.
cover
,
//封面图
price
:
this
.
form
.
price
,
//成人价
childPrice
:
this
.
form
.
childPrice
,
//儿童价
viewCount
:
this
.
form
.
viewCount
,
//商品浏览量
saleCount
:
this
.
form
.
saleCount
,
//商品销售量
describe
:
this
.
form
.
describe
,
//商品描述
content
:
this
.
form
.
content
,
//商品详情(行程亮点)
introduce
:
this
.
form
.
introduce
,
//行程介绍
explain
:
this
.
form
.
explain
,
//费用说明
rank
:
this
.
form
.
rank
,
//旅行排序
recommend
:
this
.
form
.
recommend
,
//是否推荐:0-未推荐;1-已推荐
isMember
:
this
.
form
.
isMember
,
//是否启用会员价
stock
:
this
.
form
.
stock
,
//库存
unit
:
this
.
form
.
unit
,
//单位
number
:
this
.
form
.
number
,
//活动天数
bannerDTOS
:
this
.
form
.
bannerDTOS
,
//banner轮播图
siteDTOS
:
siteDTOS
,
//出发地type=0,途径地type=1,目的地type=2
priceDTOS
:
this
.
form
.
tourDepartTimeVo
,
//活动日期
tagDTOS
:
tagDTOS
,
//旅游标签
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
//seo 标签优化
};
console
.
log
(
params
);
goodsEdit
(
params
).
then
(
response
=>
{
this
.
isCreate
=
false
;
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'添加成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneTourDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'添加失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
1
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
//destinationObj目的地
let
destinationObj
=
this
.
destinationObj
;
if
(
!
destinationObj
.
name
)
{
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择目的地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
let
provinceObj
=
destinationObj
.
province
?
getRegionByCodes
([
destinationObj
.
province
])
:
[{
name
:
""
}];
let
cityObj
=
destinationObj
.
city
?
getRegionByCodes
([
destinationObj
.
city
])
:
[{
name
:
""
}];
let
p
=
{
name
:
destinationObj
.
name
,
address
:
destinationObj
.
addrDetail
?
destinationObj
.
addrDetail
:
destinationObj
.
address
,
province
:
destinationObj
.
addrProvince
?
destinationObj
.
addrProvince
:
destinationObj
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
destinationObj
.
addrCity
?
destinationObj
.
addrCity
:
destinationObj
.
city
,
longitude
:
destinationObj
.
longitude
,
latitude
:
destinationObj
.
latitude
,
type
:
2
};
siteDTOS
.
push
(
p
);
this
.
isCreate
=
true
;
let
params
=
{
isOutside
:
this
.
form
.
isOutside
,
//省内、省外
name
:
this
.
form
.
name
,
//旅游路线名称
cover
:
this
.
form
.
cover
,
//封面图
price
:
this
.
form
.
price
,
//成人价
childPrice
:
this
.
form
.
childPrice
,
//儿童价
viewCount
:
this
.
form
.
viewCount
,
//商品浏览量
saleCount
:
this
.
form
.
saleCount
,
//商品销售量
describe
:
this
.
form
.
describe
,
//商品描述
content
:
this
.
form
.
content
,
//商品详情(行程亮点)
introduce
:
this
.
form
.
introduce
,
//行程介绍
explain
:
this
.
form
.
explain
,
//费用说明
rank
:
this
.
form
.
rank
,
//旅行排序
recommend
:
this
.
form
.
recommend
,
//是否推荐:0-未推荐;1-已推荐
isMember
:
this
.
form
.
isMember
,
//是否启用会员价
stock
:
this
.
form
.
stock
,
//库存
unit
:
this
.
form
.
unit
,
//单位
number
:
this
.
form
.
number
,
//活动天数
bannerDTOS
:
this
.
form
.
bannerDTOS
,
//banner轮播图
siteDTOS
:
siteDTOS
,
//出发地type=0,途径地type=1,目的地type=2
priceDTOS
:
this
.
form
.
tourDepartTimeVo
,
//活动日期
tagDTOS
:
tagDTOS
,
//旅游标签
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
//seo 标签优化
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
};
console
.
log
(
params
);
goodsEdit
(
params
).
then
(
response
=>
{
this
.
isCreate
=
false
;
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'添加成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneTourDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'添加失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
}
else
{
return
;
}
});
}
});
}
else
{
return
;
}
});
},
/**
* 编辑
* */
update
(
formName
){
//旅游标签
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
tagDTOS
=
[];
this
.
form
.
tagDTOS
.
map
(
function
(
item
){
if
(
item
.
tagId
){
tagDTOS
.
push
({
tagId
:
item
.
tagId
});
}
else
{
tagDTOS
.
push
({
tagId
:
item
.
id
});
}
});
let
siteDTOS
=
[];
//出发地
this
.
departureList
.
map
(
function
(
item
){
let
pp
=
item
.
province
?
item
.
province
:
item
.
addrProvince
;
let
c
=
item
.
addrCity
?
item
.
addrCity
:
item
.
city
;
let
provinceObj
=
pp
?
getRegionByCodes
([
pp
]):
[{
name
:
""
}];
let
cityObj
=
c
?
getRegionByCodes
([
c
]):[{
name
:
""
}];
let
p
=
{
id
:
item
.
id
,
name
:
item
.
name
,
departTime
:
item
.
departTime
?
item
.
departTime
:
0
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
companyId
:
item
.
companyId
,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
0
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
if
(
this
.
departureList
.
length
<=
0
){
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择出发地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
//途径地
this
.
pathway
.
map
(
function
(
item
){
let
provinceObj
=
item
.
province
?
getRegionByCodes
([
item
.
province
]):
[{
name
:
""
}];
let
cityObj
=
item
.
city
?
getRegionByCodes
([
item
.
city
]):[{
name
:
""
}];
let
p
=
{
id
:
item
.
id
,
name
:
item
.
name
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
},
/**
* 编辑
* */
update
(
formName
)
{
//旅游标签
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
tagDTOS
=
[];
this
.
form
.
tagDTOS
.
map
(
function
(
item
)
{
if
(
item
.
tagId
)
{
tagDTOS
.
push
({
tagId
:
item
.
tagId
});
}
else
{
tagDTOS
.
push
({
tagId
:
item
.
id
});
}
});
let
siteDTOS
=
[];
//出发地
this
.
departureList
.
map
(
function
(
item
)
{
let
pp
=
item
.
province
?
item
.
province
:
item
.
addrProvince
;
let
c
=
item
.
addrCity
?
item
.
addrCity
:
item
.
city
;
let
provinceObj
=
pp
?
getRegionByCodes
([
pp
])
:
[{
name
:
""
}];
let
cityObj
=
c
?
getRegionByCodes
([
c
])
:
[{
name
:
""
}];
let
p
=
{
id
:
item
.
id
,
name
:
item
.
name
,
departTime
:
item
.
departTime
?
item
.
departTime
:
0
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
companyId
:
item
.
companyId
,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
0
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
if
(
this
.
departureList
.
length
<=
0
)
{
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择出发地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
//途径地
this
.
pathway
.
map
(
function
(
item
)
{
let
provinceObj
=
item
.
province
?
getRegionByCodes
([
item
.
province
])
:
[{
name
:
""
}];
let
cityObj
=
item
.
city
?
getRegionByCodes
([
item
.
city
])
:
[{
name
:
""
}];
let
p
=
{
id
:
item
.
id
,
name
:
item
.
name
,
address
:
item
.
addrDetail
?
item
.
addrDetail
:
item
.
address
,
// companyId: item.id,
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
1
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
//destinationObj目的地
let
destinationObj
=
this
.
destinationObj
;
if
(
!
destinationObj
.
name
){
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择目的地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
let
provinceObj
=
destinationObj
.
province
?
getRegionByCodes
([
destinationObj
.
province
]):[{
name
:
""
}];
let
cityObj
=
destinationObj
.
city
?
getRegionByCodes
([
destinationObj
.
city
]):[{
name
:
""
}];
let
p
=
{
id
:
destinationObj
.
id
,
name
:
destinationObj
.
name
,
address
:
destinationObj
.
addrDetail
?
destinationObj
.
addrDetail
:
destinationObj
.
address
,
province
:
destinationObj
.
addrProvince
?
destinationObj
.
addrProvince
:
destinationObj
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
destinationObj
.
addrCity
?
destinationObj
.
addrCity
:
destinationObj
.
city
,
longitude
:
destinationObj
.
longitude
,
latitude
:
destinationObj
.
latitude
,
type
:
2
};
siteDTOS
.
push
(
p
);
let
params
=
{
id
:
this
.
form
.
id
,
isOutside
:
this
.
form
.
isOutside
,
//省内、省外
name
:
this
.
form
.
name
,
//旅游路线名称
cover
:
this
.
form
.
cover
,
//封面图
price
:
this
.
form
.
price
,
//成人价
childPrice
:
this
.
form
.
childPrice
,
//儿童价
viewCount
:
this
.
form
.
viewCount
,
//商品浏览量
saleCount
:
this
.
form
.
saleCount
,
//商品销售量
describe
:
this
.
form
.
describe
,
//商品描述
content
:
this
.
form
.
content
,
//商品详情(行程亮点)
introduce
:
this
.
form
.
introduce
,
//行程介绍
explain
:
this
.
form
.
explain
,
//费用说明
rank
:
this
.
form
.
rank
,
//旅行排序
recommend
:
this
.
form
.
recommend
,
//是否推荐:0-未推荐;1-已推荐
isMember
:
this
.
form
.
isMember
,
//是否启用会员价
stock
:
this
.
form
.
stock
,
//库存
unit
:
this
.
form
.
unit
,
//单位
number
:
this
.
form
.
number
,
//活动天数
bannerDTOS
:
this
.
form
.
bannerDTOS
,
//banner轮播图
siteDTOS
:
siteDTOS
,
//出发地type=0,途径地type=1,目的地type=2
priceDTOS
:
this
.
form
.
tourDepartTimeVo
,
//活动日期
tagDTOS
:
tagDTOS
,
//旅游标签
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
//seo 标签优化
};
console
.
log
(
params
);
this
.
isCreate
=
true
;
console
.
log
(
this
.
form
);
goodsEdit
(
params
).
then
(
response
=>
{
this
.
isCreate
=
false
;
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
province
:
item
.
addrProvince
?
item
.
addrProvince
:
item
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
item
.
addrCity
?
item
.
addrCity
:
item
.
city
,
longitude
:
item
.
longitude
,
latitude
:
item
.
latitude
,
type
:
1
,
rank
:
item
.
rank
};
siteDTOS
.
push
(
p
);
});
//destinationObj目的地
let
destinationObj
=
this
.
destinationObj
;
if
(
!
destinationObj
.
name
)
{
this
.
$notify
({
title
:
'警告'
,
message
:
'请选择目的地'
,
type
:
'warning'
,
duration
:
2000
});
return
;
}
let
provinceObj
=
destinationObj
.
province
?
getRegionByCodes
([
destinationObj
.
province
])
:
[{
name
:
""
}];
let
cityObj
=
destinationObj
.
city
?
getRegionByCodes
([
destinationObj
.
city
])
:
[{
name
:
""
}];
let
p
=
{
id
:
destinationObj
.
id
,
name
:
destinationObj
.
name
,
address
:
destinationObj
.
addrDetail
?
destinationObj
.
addrDetail
:
destinationObj
.
address
,
province
:
destinationObj
.
addrProvince
?
destinationObj
.
addrProvince
:
destinationObj
.
province
,
provinceName
:
provinceObj
[
0
].
name
,
cityName
:
cityObj
[
0
].
name
,
city
:
destinationObj
.
addrCity
?
destinationObj
.
addrCity
:
destinationObj
.
city
,
longitude
:
destinationObj
.
longitude
,
latitude
:
destinationObj
.
latitude
,
type
:
2
};
siteDTOS
.
push
(
p
);
let
params
=
{
id
:
this
.
form
.
id
,
isOutside
:
this
.
form
.
isOutside
,
//省内、省外
name
:
this
.
form
.
name
,
//旅游路线名称
cover
:
this
.
form
.
cover
,
//封面图
price
:
this
.
form
.
price
,
//成人价
childPrice
:
this
.
form
.
childPrice
,
//儿童价
viewCount
:
this
.
form
.
viewCount
,
//商品浏览量
saleCount
:
this
.
form
.
saleCount
,
//商品销售量
describe
:
this
.
form
.
describe
,
//商品描述
content
:
this
.
form
.
content
,
//商品详情(行程亮点)
introduce
:
this
.
form
.
introduce
,
//行程介绍
explain
:
this
.
form
.
explain
,
//费用说明
rank
:
this
.
form
.
rank
,
//旅行排序
recommend
:
this
.
form
.
recommend
,
//是否推荐:0-未推荐;1-已推荐
isMember
:
this
.
form
.
isMember
,
//是否启用会员价
stock
:
this
.
form
.
stock
,
//库存
unit
:
this
.
form
.
unit
,
//单位
number
:
this
.
form
.
number
,
//活动天数
bannerDTOS
:
this
.
form
.
bannerDTOS
,
//banner轮播图
siteDTOS
:
siteDTOS
,
//出发地type=0,途径地type=1,目的地type=2
priceDTOS
:
this
.
form
.
tourDepartTimeVo
,
//活动日期
tagDTOS
:
tagDTOS
,
//旅游标签
posterBackground
:
this
.
form
.
posterBackground
,
//海报背景
alt
:
this
.
form
.
alt
,
//seo 标签优化
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
};
console
.
log
(
params
);
this
.
isCreate
=
true
;
console
.
log
(
this
.
form
);
goodsEdit
(
params
).
then
(
response
=>
{
this
.
isCreate
=
false
;
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneTourDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
}
else
{
return
;
}
});
this
.
$emit
(
"oneTourDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
},
/**
* 获取全部旅游标签
* */
getAllLabelList
()
{
getAllTourTag
().
then
(
response
=>
{
this
.
allLabelList
=
response
.
data
;
});
}
});
}
else
{
return
;
}
});
},
/**
* 获取全部旅游标签
* */
getAllLabelList
()
{
getAllTourTag
().
then
(
response
=>
{
this
.
allLabelList
=
response
.
data
;
});
},
},
/**
* 关闭目的地弹框
* */
destinationEvent
(
obj
)
{
this
.
showDestinationVisible
=
false
;
if
(
obj
)
{
this
.
destinationObj
=
obj
;
console
.
log
(
obj
);
}
},
/**
* 选择目的地
* */
selectDestination
()
{
let
that
=
this
;
this
.
destinationObj
.
showTitle
=
"目的地编辑"
;
this
.
destinationObj
.
headTitle
=
"目的地名称"
;
this
.
destinationObj
.
eventName
=
'destinationEvent'
;
this
.
destinationObj
.
keyword
=
this
.
destinationObj
.
address
;
this
.
showDestinationVisible
=
true
;
},
/**
* 关闭活动日期
* */
tourDepartTimeEvent
(
params
)
{
this
.
showTimeVisible
=
false
;
if
(
params
)
{
this
.
form
.
number
=
params
.
num
;
this
.
form
.
tourDepartTimeVo
=
params
.
priceDTOS
;
console
.
log
(
params
);
}
},
/**
* 关闭途径地弹框
* */
pathWayEvent
(
obj
)
{
this
.
showPathWayVisible
=
false
;
if
(
obj
)
{
if
(
obj
.
showTitle
==
"途径地编辑"
)
{
if
(
obj
.
method
==
"delete"
)
{
//删除当前路径
this
.
pathway
.
splice
(
obj
,
1
);
}
else
{
this
.
onePathObj
=
obj
;
}
}
else
{
this
.
pathway
.
push
(
obj
);
}
console
.
log
(
obj
);
}
},
/**
* 编辑一条途径地数据
* */
selectPathway
(
obj
)
{
let
that
=
this
;
console
.
log
(
obj
);
this
.
onePathObj
=
obj
;
this
.
onePathObj
.
showTitle
=
"途径地编辑"
;
this
.
onePathObj
.
headTitle
=
"途径地名称"
;
},
/**
* 关闭旅游标签弹框
* */
tourLabelEvent
(
obj
)
{
let
that
=
this
;
this
.
editLableVisible
=
false
;
let
arr
=
[];
let
ckeckList
=
[];
if
(
obj
)
{
this
.
allLabelList
.
map
(
function
(
item
)
{
obj
.
map
(
function
(
b
)
{
if
(
item
.
name
==
b
)
{
arr
.
push
(
item
);
ckeckList
.
push
(
b
);
}
});
});
this
.
form
.
tagDTOS
=
arr
;
this
.
checkList
=
ckeckList
;
console
.
log
(
obj
);
}
},
/**
* 编辑一条途径地
**/
editPathway
(
item
)
{
this
.
onePathObj
=
item
;
this
.
onePathObj
.
showTitle
=
"途径地编辑"
;
//弹框名称
this
.
onePathObj
.
headTitle
=
"途径地名称"
;
this
.
onePathObj
.
keyword
=
item
.
address
,
//根据关键词查找经纬度
this
.
onePathObj
.
eventName
=
"pathWayEvent"
;
this
.
showPathWayVisible
=
true
;
},
/**
* 添加途径地
* */
addPathway
()
{
let
that
=
this
;
this
.
onePathObj
=
{
showTitle
:
"途径地添加"
,
//弹框名称
headTitle
:
"途径地名称"
,
name
:
undefined
,
//地址名称
keyword
:
"东莞市"
,
//根据关键词查找经纬度
address
:
undefined
,
//详细地址
longitude
:
113.758993
,
latitude
:
23.031565
,
eventName
:
"pathWayEvent"
};
this
.
showPathWayVisible
=
true
;
},
/**
* 添加时间
* */
editTime
()
{
this
.
showTimeVisible
=
true
;
},
/**
* 获取一条旅游路线
* */
getOneGoods
(
id
)
{
let
params
=
{
id
:
id
};
let
that
=
this
;
getOneGoodsById
(
params
).
then
(
response
=>
{
that
.
pathway
=
[];
response
.
data
.
tourDepartVo
.
map
(
function
(
item
)
{
if
(
item
.
type
==
0
)
{
//出发地
that
.
departureList
.
push
(
item
);
}
if
(
item
.
type
==
2
&&
that
.
destinationObj
.
name
==
""
)
{
//目的地
that
.
destinationObj
=
item
;
}
if
(
item
.
type
==
1
)
{
//途径地
that
.
pathway
.
push
(
item
);
}
});
let
arr
=
[];
this
.
form
=
response
.
data
;
this
.
allLabelList
.
map
(
function
(
b
)
{
response
.
data
.
tagDTOS
.
map
(
function
(
item
)
{
if
(
item
.
tagId
==
b
.
id
)
{
arr
.
push
(
item
.
name
);
}
});
});
this
.
checkList
=
arr
;
/**
* 关闭目的地弹框
* */
destinationEvent
(
obj
)
{
this
.
showDestinationVisible
=
false
;
if
(
obj
)
{
this
.
destinationObj
=
obj
;
console
.
log
(
obj
);
}
},
/**
* 选择目的地
* */
selectDestination
()
{
let
that
=
this
;
this
.
destinationObj
.
showTitle
=
"目的地编辑"
;
this
.
destinationObj
.
headTitle
=
"目的地名称"
;
this
.
destinationObj
.
eventName
=
'destinationEvent'
;
this
.
destinationObj
.
keyword
=
this
.
destinationObj
.
address
;
this
.
showDestinationVisible
=
true
;
},
/**
* 关闭活动日期
* */
tourDepartTimeEvent
(
params
)
{
this
.
showTimeVisible
=
false
;
if
(
params
)
{
this
.
form
.
number
=
params
.
num
;
this
.
form
.
tourDepartTimeVo
=
params
.
priceDTOS
;
console
.
log
(
params
);
}
},
/**
* 关闭途径地弹框
* */
pathWayEvent
(
obj
)
{
this
.
showPathWayVisible
=
false
;
if
(
obj
)
{
if
(
obj
.
showTitle
==
"途径地编辑"
)
{
if
(
obj
.
method
==
"delete"
)
{
//删除当前路径
this
.
pathway
.
splice
(
obj
,
1
);
}
else
{
this
.
onePathObj
=
obj
;
}
}
else
{
this
.
pathway
.
push
(
obj
);
}
console
.
log
(
obj
);
}
},
/**
* 编辑一条途径地数据
* */
selectPathway
(
obj
)
{
let
that
=
this
;
console
.
log
(
obj
);
this
.
onePathObj
=
obj
;
this
.
onePathObj
.
showTitle
=
"途径地编辑"
;
this
.
onePathObj
.
headTitle
=
"途径地名称"
;
},
/**
* 关闭旅游标签弹框
* */
tourLabelEvent
(
obj
)
{
let
that
=
this
;
this
.
editLableVisible
=
false
;
let
arr
=
[];
let
ckeckList
=
[];
if
(
obj
)
{
this
.
allLabelList
.
map
(
function
(
item
)
{
obj
.
map
(
function
(
b
)
{
if
(
item
.
name
==
b
)
{
arr
.
push
(
item
);
ckeckList
.
push
(
b
);
}
});
});
this
.
form
.
tagDTOS
=
arr
;
this
.
checkList
=
ckeckList
;
console
.
log
(
obj
);
}
},
/**
* 编辑一条途径地
**/
editPathway
(
item
)
{
this
.
onePathObj
=
item
;
this
.
onePathObj
.
showTitle
=
"途径地编辑"
;
//弹框名称
this
.
onePathObj
.
headTitle
=
"途径地名称"
;
this
.
onePathObj
.
keyword
=
item
.
address
,
//根据关键词查找经纬度
this
.
onePathObj
.
eventName
=
"pathWayEvent"
;
this
.
showPathWayVisible
=
true
;
},
/**
* 添加途径地
* */
addPathway
()
{
let
that
=
this
;
this
.
onePathObj
=
{
showTitle
:
"途径地添加"
,
//弹框名称
headTitle
:
"途径地名称"
,
name
:
undefined
,
//地址名称
keyword
:
"东莞市"
,
//根据关键词查找经纬度
address
:
undefined
,
//详细地址
longitude
:
113.758993
,
latitude
:
23.031565
,
eventName
:
"pathWayEvent"
};
this
.
showPathWayVisible
=
true
;
},
/**
* 添加时间
* */
editTime
()
{
this
.
showTimeVisible
=
true
;
},
/**
* 获取一条旅游路线
* */
getOneGoods
(
id
)
{
let
params
=
{
id
:
id
};
let
that
=
this
;
getOneGoodsById
(
params
).
then
(
response
=>
{
that
.
pathway
=
[];
response
.
data
.
tourDepartVo
.
map
(
function
(
item
)
{
if
(
item
.
type
==
0
)
{
//出发地
that
.
departureList
.
push
(
item
);
}
if
(
item
.
type
==
2
&&
that
.
destinationObj
.
name
==
""
)
{
//目的地
that
.
destinationObj
=
item
;
}
if
(
item
.
type
==
1
)
{
//途径地
that
.
pathway
.
push
(
item
);
}
});
let
arr
=
[];
this
.
form
=
response
.
data
;
this
.
allLabelList
.
map
(
function
(
b
)
{
response
.
data
.
tagDTOS
.
map
(
function
(
item
)
{
if
(
item
.
tagId
==
b
.
id
)
{
arr
.
push
(
item
.
name
);
}
});
});
this
.
checkList
=
arr
;
//轮播
let
fileList2
=
[];
response
.
data
.
bannerDTOS
.
map
(
function
(
item
)
{
let
p
=
{
url
:
item
.
cover
};
fileList2
.
push
(
p
);
});
this
.
fileList2
=
fileList2
;
this
.
form
.
isMember
=
this
.
form
.
isMember
+
""
;
this
.
form
.
recommend
=
this
.
form
.
recommend
+
""
;
this
.
form
.
isOutside
=
this
.
form
.
isOutside
+
""
;
this
.
activeName2
=
"first"
;
})
},
querySearch
(
queryString
,
cb
)
{
let
selectArry
=
[];
this
.
allCompaniesArr
.
map
(
function
(
item
)
{
item
.
value
=
item
.
name
;
selectArry
.
push
(
item
);
});
this
.
selectArry
=
selectArry
;
var
results
=
queryString
?
selectArry
.
filter
(
this
.
createFilter
(
queryString
))
:
selectArry
;
// 调用 callback 返回建议列表的数据
cb
(
results
);
},
handleSelect
(
item
)
{
this
.
departureObj
=
item
;
console
.
log
(
item
);
},
createFilter
(
queryString
)
{
return
(
restaurant
)
=>
{
return
(
restaurant
.
name
.
indexOf
(
queryString
.
toLowerCase
())
!=
-
1
);
};
},
/**
* 旅游-弹框-取消
* */
cancelTour
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneTourDialogEvent"
,
false
);
},
/**
* 富文本 旅游
* */
editorReadyEvent
(
instance
)
{
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
)
{
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
)
{
t
.
form
.
introduce
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"third"
)
{
t
.
form
.
explain
=
instance
.
getContent
();
}
});
},
//轮播
let
fileList2
=
[];
response
.
data
.
bannerDTOS
.
map
(
function
(
item
)
{
let
p
=
{
url
:
item
.
cover
};
fileList2
.
push
(
p
);
});
this
.
fileList2
=
fileList2
;
this
.
form
.
isMember
=
this
.
form
.
isMember
+
""
;
this
.
form
.
recommend
=
this
.
form
.
recommend
+
""
;
this
.
form
.
isOutside
=
this
.
form
.
isOutside
+
""
;
this
.
activeName2
=
"first"
;
})
},
querySearch
(
queryString
,
cb
)
{
let
selectArry
=
[];
this
.
allCompaniesArr
.
map
(
function
(
item
)
{
item
.
value
=
item
.
name
;
selectArry
.
push
(
item
);
});
this
.
selectArry
=
selectArry
;
var
results
=
queryString
?
selectArry
.
filter
(
this
.
createFilter
(
queryString
))
:
selectArry
;
// 调用 callback 返回建议列表的数据
cb
(
results
);
},
handleSelect
(
item
)
{
this
.
departureObj
=
item
;
console
.
log
(
item
);
},
createFilter
(
queryString
)
{
return
(
restaurant
)
=>
{
return
(
restaurant
.
name
.
indexOf
(
queryString
.
toLowerCase
())
!=
-
1
);
};
},
/**
* 旅游-弹框-取消
* */
cancelTour
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneTourDialogEvent"
,
false
);
},
/**
* 富文本 旅游
* */
editorReadyEvent
(
instance
)
{
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
)
{
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
)
{
t
.
form
.
introduce
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"third"
)
{
t
.
form
.
explain
=
instance
.
getContent
();
}
});
},
// /**
// * 富文本内容 费用说明
// * @param step
...
...
@@ -981,99 +1040,102 @@ import ElRow from "element-ui/packages/row/src/row";
// handelContentIncrease(step){
// this.form.content = step;
// },
/**
* 删除banner
* */
handleRemove
(
file
,
fileList
){
let
list
=
[];
fileList
.
map
(
function
(
item
){
if
(
item
.
url
!=
file
.
url
){
list
.
push
(
item
);
}
});
this
.
fileList2
=
list
;
let
arr
=
[];
this
.
form
.
bannerDTOS
.
map
(
function
(
item
){
if
(
item
.
cover
!=
file
.
url
){
arr
.
push
(
item
);
}
});
this
.
form
.
bannerDTOS
=
arr
;
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
){
this
.
percent
=
0
;
this
.
imgFlag
=
false
;
this
.
form
.
cover
=
res
.
data
;
},
/**
* 海报背景上传
* **/
handlePosterSuccess
(
res
,
file
){
this
.
percent_poster
=
0
;
this
.
imgPosterFlag
=
false
;
this
.
form
.
posterBackground
=
res
.
data
;
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess
(
event
,
file
,
fileList
)
{
this
.
imgPosterFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent_poster
=
Math
.
floor
(
event
.
percent
);
},
/**
* banner上传
* */
handleBannerSuccess
(
res
,
file
){
this
.
fileList2
.
push
({
url
:
res
.
data
});
this
.
form
.
bannerDTOS
.
push
({
cover
:
res
.
data
});
},
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
onePathObj
=
{
name
:
""
};
//待编辑的途径地
this
.
destinationObj
=
{
name
:
""
},
//目的地
this
.
departureList
=
[],
//出发地列表
this
.
departureObj
=
{
name
:
""
},
//出发地
this
.
pathway
=
[],
//途径地
this
.
fileList2
=
[],
this
.
activeName2
=
''
,
//行程亮点
this
.
form
=
{
isOutside
:
"0"
,
//省内、省外
childPrice
:
undefined
,
//儿童价
tourDepartVo
:
undefined
,
//type:0出发地 1途径地 2目的地
content
:
""
,
//行程亮点
cover
:
undefined
,
//封面图
describe
:
undefined
,
//描述
introduce
:
""
,
//行程介绍
crtTime
:
undefined
,
explain
:
""
,
//费用说明
name
:
undefined
,
//旅行名称
price
:
undefined
,
//成人价
rank
:
undefined
,
recommend
:
"0"
,
//是否推荐0:不推荐,1推荐
saleCount
:
undefined
,
//初始销量
status
:
undefined
,
//0:未发布,1:上架 2:下架
stock
:
undefined
,
//总人数
unit
:
undefined
,
//单位
updTime
:
undefined
,
//更新时间
viewCount
:
undefined
,
//浏览量
isMember
:
"0"
,
//是否是会员商品0不启用,1启用
tagDTOS
:
[],
//旅行标签
bannerDTOS
:[],
//banner轮播
tourDepartTimeVo
:[],
//活动时间
posterBackground
:
''
,
//海报背景
alt
:
''
,
},
this
.
showDestinationVisible
=
false
,
//编辑目的地
this
.
showPathWayVisible
=
false
,
//编辑途径地
this
.
showTimeVisible
=
false
;
//编辑时间
this
.
activeName2
=
""
;
}
/**
* 删除banner
* */
handleRemove
(
file
,
fileList
)
{
let
list
=
[];
fileList
.
map
(
function
(
item
)
{
if
(
item
.
url
!=
file
.
url
)
{
list
.
push
(
item
);
}
});
this
.
fileList2
=
list
;
let
arr
=
[];
this
.
form
.
bannerDTOS
.
map
(
function
(
item
)
{
if
(
item
.
cover
!=
file
.
url
)
{
arr
.
push
(
item
);
}
});
this
.
form
.
bannerDTOS
=
arr
;
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
)
{
this
.
percent
=
0
;
this
.
imgFlag
=
false
;
this
.
form
.
cover
=
res
.
data
;
},
/**
* 海报背景上传
* **/
handlePosterSuccess
(
res
,
file
)
{
this
.
percent_poster
=
0
;
this
.
imgPosterFlag
=
false
;
this
.
form
.
posterBackground
=
res
.
data
;
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess
(
event
,
file
,
fileList
)
{
this
.
imgPosterFlag
=
true
;
console
.
log
(
event
.
percent
);
this
.
percent_poster
=
Math
.
floor
(
event
.
percent
);
},
/**
* banner上传
* */
handleBannerSuccess
(
res
,
file
)
{
this
.
fileList2
.
push
({
url
:
res
.
data
});
this
.
form
.
bannerDTOS
.
push
({
cover
:
res
.
data
});
},
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
onePathObj
=
{
name
:
""
};
//待编辑的途径地
this
.
destinationObj
=
{
name
:
""
},
//目的地
this
.
departureList
=
[],
//出发地列表
this
.
departureObj
=
{
name
:
""
},
//出发地
this
.
pathway
=
[],
//途径地
this
.
fileList2
=
[],
this
.
activeName2
=
''
,
//行程亮点
this
.
form
=
{
isOutside
:
"0"
,
//省内、省外
childPrice
:
undefined
,
//儿童价
tourDepartVo
:
undefined
,
//type:0出发地 1途径地 2目的地
content
:
""
,
//行程亮点
cover
:
undefined
,
//封面图
describe
:
undefined
,
//描述
introduce
:
""
,
//行程介绍
crtTime
:
undefined
,
explain
:
""
,
//费用说明
name
:
undefined
,
//旅行名称
price
:
undefined
,
//成人价
rank
:
undefined
,
recommend
:
"0"
,
//是否推荐0:不推荐,1推荐
saleCount
:
undefined
,
//初始销量
status
:
undefined
,
//0:未发布,1:上架 2:下架
stock
:
undefined
,
//总人数
unit
:
undefined
,
//单位
updTime
:
undefined
,
//更新时间
viewCount
:
undefined
,
//浏览量
isMember
:
"0"
,
//是否是会员商品0不启用,1启用
tagDTOS
:
[],
//旅行标签
bannerDTOS
:
[],
//banner轮播
tourDepartTimeVo
:
[],
//活动时间
posterBackground
:
''
,
//海报背景
alt
:
''
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
},
this
.
showDestinationVisible
=
false
,
//编辑目的地
this
.
showPathWayVisible
=
false
,
//编辑途径地
this
.
showTimeVisible
=
false
;
//编辑时间
this
.
activeName2
=
""
;
}
}
}
}
</
script
>
src/views/vehicleType/modal/oneType.vue
View file @
1e12c2e8
...
...
@@ -7,7 +7,7 @@
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"车型名称"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入车型名称"
></el-input>
<el-input
v-model=
"form.name"
placeholder=
"请输入车型名称"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -94,25 +94,27 @@
<el-form-item
label=
"房车配置"
></el-form-item>
<el-row>
<el-col
:span=
"8"
v-for=
"(item, index) in labelList"
:key=
"item.id"
>
<el-col
:span=
"8"
v-for=
"(item, index) in labelList"
:key=
"item.id"
>
<el-form-item>
<span
style=
"width: 150px;text-align:right;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;padding-right: 10px;"
>
{{
item
.
parent
.
name
}}
</span>
<el-input
v-model=
"item.selectChild"
readonly
icon=
"edit"
@
click=
"editConfig(item)"
style=
"width: 70%;"
></el-input>
<span
style=
"width: 150px;text-align:right;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;padding-right: 10px;"
>
{{
item
.
parent
.
name
}}
</span>
<el-input
v-model=
"item.selectChild"
readonly
icon=
"edit"
@
click=
"editConfig(item)"
style=
"width: 70%;"
></el-input>
<!--
<el-select
v-model=
"item.childNameLists"
style=
"width: 80%"
v-if=
"item.parent.isMore==1"
multiple
placeholder=
"请选择"
@
change =
"selectItem"
>
-->
<!--
<el-option-->
<!--v-for="iitem in item.children"-->
<!--:key="iitem.name"-->
<!--:label="iitem.name"-->
<!--:value="iitem.id">-->
<!--
</el-option>
-->
<!--
<el-option-->
<!--v-for="iitem in item.children"-->
<!--:key="iitem.name"-->
<!--:label="iitem.name"-->
<!--:value="iitem.id">-->
<!--
</el-option>
-->
<!--
</el-select>
-->
<!--
<el-select
v-model=
"item.childNameLists"
v-else
placeholder=
"请选择"
@
change =
"selectItem"
>
-->
<!--
<el-option-->
<!--v-for="iitem in item.children"-->
<!--:key="iitem.id"-->
<!--:label="iitem.name"-->
<!--:value="iitem.id">-->
<!--
</el-option>
-->
<!--
<el-option-->
<!--v-for="iitem in item.children"-->
<!--:key="iitem.id"-->
<!--:label="iitem.name"-->
<!--:value="iitem.id">-->
<!--
</el-option>
-->
<!--
</el-select>
-->
</el-form-item>
</el-col>
...
...
@@ -120,25 +122,27 @@
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"关键标签"
>
<!--
<el-select
v-model=
"value5"
multiple
placeholder=
"请选择"
style=
"width: 100%;"
>
-->
<!--
<el-option-->
<!--v-for="item in options"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value">-->
<!--
</el-option>
-->
<!--
</el-select>
-->
<el-input
v-model=
"form.keyword"
placeholder=
"请输入关键标签"
readonly
icon=
"edit"
@
click=
"editLabe"
></el-input>
<!--
<el-select
v-model=
"value5"
multiple
placeholder=
"请选择"
style=
"width: 100%;"
>
-->
<!--
<el-option-->
<!--v-for="item in options"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value">-->
<!--
</el-option>
-->
<!--
</el-select>
-->
<el-input
v-model=
"form.keyword"
placeholder=
"请输入关键标签"
readonly
icon=
"edit"
@
click=
"editLabe"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"房车参数"
>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"plus"
@
click=
"addModelParam()"
>
添加
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--primary"
type=
"button"
icon=
"plus"
@
click=
"addModelParam()"
>
添加
</el-button>
<el-col
v-for=
"(item, index) in form.modelParam"
:key=
"index"
>
<el-form-item
label=
"参数名称"
style=
"margin: 10px 5px;"
>
<el-input
style=
"width: 30%;"
v-model=
"item.key"
></el-input>
<el-input
style=
"width: 30%;"
v-model=
"item.val"
></el-input>
<el-input
style=
"width: 30%;"
v-model=
"item.key"
></el-input>
<el-input
style=
"width: 30%;"
v-model=
"item.val"
></el-input>
<el-button
type=
"danger"
size=
"small"
@
click=
"delModelParam(index)"
>
删除
</el-button>
</el-form-item>
</el-col>
...
...
@@ -924,11 +928,4 @@ import UE from '../../modal/Ueditor';//百度ue富文本
border-bottom
:
1px
solid
#999
;
padding
:
3px
;
}
.cx
{
margin-top
:
0px
;
margin-bottom
:
0px
;
height
:
180px
;
}
</
style
>
src/views/xxOfficialWebsite/modal/oneCampsiteModal.vue
View file @
1e12c2e8
<
template
>
<!-- 营地:创建、编辑 -->
<div
class
=
"activity"
>
<div
class
=
"activity"
>
<h4>
{{
title
}}
</h4>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
label-width=
"90px"
>
<el-row>
...
...
@@ -10,97 +10,125 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"副标题"
prop=
"subtitle"
>
<el-input
v-model=
"form.subtitle"
placeholder=
"请输入活动副标题"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"活动主图"
:style=
"
{display:'block'}" prop="banner">
<el-upload
class=
"upload-demo"
:headers=
"getHeaderWithToken"
:action=
"BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:485*485px
</span></div>
<img
v-if=
"$utils.isString(form.banner) && !$utils.isEmpty(form.banner)"
:src=
"form.banner"
style=
"width:300px;max-height:300px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"活动主图"
:style=
"
{display:'block'}" prop="banner">
<el-upload
class=
"upload-demo"
:headers=
"getHeaderWithToken"
:action=
"BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
list-type=
"picture"
>
<div
slot=
"tip"
class=
"el-upload__tip"
><span
style=
"color: red;"
>
建议尺寸:485*485px
</span></div>
<img
v-if=
"$utils.isString(form.banner) && !$utils.isEmpty(form.banner)"
:src=
"form.banner"
style=
"width:300px;max-height:300px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"alt"
>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入描述"
></el-input>
<el-input
v-model=
"form.alt"
type=
"text"
placeholder=
"请输入替代文本"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-title"
>
<el-input
v-model=
"form.imgTitle"
type=
"text"
placeholder=
"请输入图片title"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-keyword"
>
<el-input
v-model=
"form.imgKeyword"
type=
"text"
placeholder=
"请输入图片关键字"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"img-desc"
>
<el-input
v-model=
"form.imgDesc"
type=
"text"
placeholder=
"请输入图片描述"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"总人数"
prop=
"limitNum"
>
<el-input
v-model=
"form.limitNum"
placeholder=
"请输入总人数"
type=
"number"
:maxlength=
8
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"开始时间"
prop=
"startTime"
>
<el-date-picker
v-model=
"form.startTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"结束时间"
prop=
"endTime"
>
<el-date-picker
v-model=
"form.endTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"报名时间"
prop=
"regCloseTime"
>
<el-date-picker
v-model=
"form.regCloseTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动说明"
prop=
"actDesc"
>
<el-input
v-model=
"form.actDesc"
placeholder=
"请输入活动说明"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"排序"
prop=
"rank"
>
<el-input
v-model=
"form.rank"
placeholder=
"请输入活动说明"
type=
"number"
:maxlength=
11
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"总人数"
prop=
"limitNum"
>
<el-input
v-model=
"form.limitNum"
placeholder=
"请输入总人数"
type=
"number"
:maxlength=
8
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"开始时间"
prop=
"startTime"
>
<el-date-picker
v-model=
"form.startTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"结束时间"
prop=
"endTime"
>
<el-date-picker
v-model=
"form.endTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动地址"
prop=
"address"
>
<el-input
v-model=
"form.addressStr"
readonly
placeholder=
"请输入活动地址"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动位置"
>
<el-select
class=
"filter-item"
v-model=
"form.location"
placeholder=
"请选择状态"
>
<el-option
:key=
"0"
label=
"无限制"
:value=
"0"
></el-option>
<el-option
:key=
"1"
label=
"欣欣官网"
:value=
"1"
></el-option>
<el-option
:key=
"2"
label=
"滴房车官网"
:value=
"2"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"报名时间"
prop=
"regCloseTime"
>
<el-date-picker
v-model=
"form.regCloseTime"
type=
"datetime"
:editable=
"true"
format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动说明"
prop=
"actDesc"
>
<el-input
v-model=
"form.actDesc"
placeholder=
"请输入活动说明"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"排序"
prop=
"rank"
>
<el-input
v-model=
"form.rank"
placeholder=
"请输入活动说明"
type=
"number"
:maxlength=
11
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动地址"
prop=
"address"
>
<el-input
v-model=
"form.addressStr"
readonly
placeholder=
"请输入活动地址"
:on-icon-click=
"selectDestination"
icon=
"edit"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"活动位置"
>
<el-select
class=
"filter-item"
v-model=
"form.location"
placeholder=
"请选择状态"
>
<el-option
:key=
"0"
label=
"无限制"
:value=
"0"
></el-option>
<el-option
:key=
"1"
label=
"欣欣官网"
:value=
"1"
></el-option>
<el-option
:key=
"2"
label=
"滴房车官网"
:value=
"2"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!--BASE_API + -->
<el-tabs
v-model=
"activeName2"
type=
"card"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"活动图文内容"
name=
"first"
>
<!--
<Editor
v-if=
"activeName2=='first'"
@
input=
"handelContentIncrease"
:value=
"form.content"
:myQuillEditor=
"'myQuillEditorContent'"
:activeName2=
"activeName2"
></Editor>
-->
<div
class=
"editor-container"
v-if=
"activeName2=='first'"
>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
<UE
:editorId=
"activeName2"
:defaultMsg=
"form.content"
:config=
config
ref=
"ue"
@
ready=
"editorReadyEvent"
></UE>
</div>
</el-tab-pane>
</el-tabs>
...
...
@@ -108,529 +136,549 @@
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
v-if=
"title=='创建' && !isCreate && campsiteshop_btn_update"
@
click=
"create('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate && campsiteshop_btn_update"
@
click=
"update('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='创建' && !isCreate && campsiteshop_btn_update"
@
click=
"create('form')"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate && campsiteshop_btn_update"
@
click=
"update('form')"
>
确 定
</el-button>
</div>
<!--编辑营地地址-->
<campsiteModal
v-if=
"showCampsiteVisible && campsiteshop_btn_update"
:obj=
"campsiteObj"
v-on:campsiteEvent =
"campsiteEvent"
></campsiteModal>
<campsiteModal
v-if=
"showCampsiteVisible && campsiteshop_btn_update"
:obj=
"campsiteObj"
v-on:campsiteEvent=
"campsiteEvent"
></campsiteModal>
<!--编辑营地标签-->
<campsiteLabelModal
v-if=
"editLableVisible && campsiteshop_btn_update"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent =
"tourLabelEvent"
></campsiteLabelModal>
<campsiteLabelModal
v-if=
"editLableVisible && campsiteshop_btn_update"
:allLabelList=
"allLabelList"
:checkList=
"checkList"
v-on:tourLabelEvent=
"tourLabelEvent"
></campsiteLabelModal>
</div>
</
template
>
<
style
>
textarea
{
textarea
{
display
:
none
;
}
.info
{
.info
{
border-radius
:
10px
;
line-height
:
20px
;
padding
:
10px
;
margin
:
10px
;
background-color
:
#ffffff
;
}
.el-upload-list
{
.el-upload-list
{
display
:
flex
;
width
:
100px
;
}
.el-upload-list
li
{
.el-upload-list
li
{
margin-left
:
10px
;
}
</
style
>
<
script
>
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
campsiteLabelModal
from
"../../tourManage/modal/tourLabelModal"
;
//标签
import
campsiteModal
from
"./campsiteModal"
;
//营地地址
import
{
getOneCampsiteShop
,
campsiteAllTagList
,
editCampsiteShop
,
addCampsiteShop
,
existCampsiteShop
}
from
'api/campsiteManage'
;
import
{
getOneActivityShop
,
editActivity
}
from
'api/officialWebsit/activity'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
// import Editor from "../../modal/editorTool";//富文本
import
UE
from
'../../modal/Ueditor'
;
//百度ue富文本
import
campsiteLabelModal
from
"../../tourManage/modal/tourLabelModal"
;
//标签
import
campsiteModal
from
"./campsiteModal"
;
//营地地址
import
{
getOneCampsiteShop
,
campsiteAllTagList
,
editCampsiteShop
,
addCampsiteShop
,
existCampsiteShop
}
from
'api/campsiteManage'
;
import
{
getOneActivityShop
,
editActivity
}
from
'api/officialWebsit/activity'
;
import
{
getSonRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
export
default
{
props
:
[
"oneRow"
,
"title"
,
"campsiteshop_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
UE
,
campsiteModal
,
campsiteLabelModal
},
data
()
{
var
checkPhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'手机号不能为空'
));
}
else
{
const
reg
=
/^
[
1
](([
3
][
0-9
])
|
([
4
][
5,7,9
])
|
([
5
][
0-9
])
|
([
6
][
6
])
|
([
7
][
1,2,3,5,6,7,8
])
|
([
8
][
0-9
])
|
([
9
][
1,8,9
]))[
0-9
]{8}
$/
console
.
log
(
reg
.
test
(
value
));
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
return
callback
(
new
Error
(
'请输入正确的手机号'
));
}
}
};
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
defaultMsg
:
'这里是UE测试'
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
import
rsCode
from
'../../../utils/rsCode'
;
import
{
getToken
}
from
'../../../utils/auth'
;
import
{
mapGetters
}
from
'vuex'
;
export
default
{
props
:
[
"oneRow"
,
"title"
,
"campsiteshop_btn_update"
],
name
:
'upkeepDialog'
,
components
:
{
UE
,
campsiteModal
,
campsiteLabelModal
},
data
()
{
var
checkPhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'手机号不能为空'
));
}
else
{
const
reg
=
/^
[
1
](([
3
][
0-9
])
|
([
4
][
5,7,9
])
|
([
5
][
0-9
])
|
([
6
][
6
])
|
([
7
][
1,2,3,5,6,7,8
])
|
([
8
][
0-9
])
|
([
9
][
1,8,9
]))[
0-9
]{8}
$/
console
.
log
(
reg
.
test
(
value
));
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
return
callback
(
new
Error
(
'请输入正确的手机号'
));
}
}
};
return
{
imgPosterFlag
:
false
,
percent_poster
:
0
,
BASE_API
:
process
.
env
.
BASE_API
,
defaultMsg
:
'这里是UE测试'
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
350
},
isExist
:
false
,
//名称是否已存在
campsiteObj
:
{},
//营地地址
departureList
:
[],
//出发地列表
departureObj
:
{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:
[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
undefined
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
,
id
:
undefined
,
title
:
undefined
,
//营地名称
subtitle
:
undefined
,
//营地热度
startTime
:
undefined
,
//客服电话
endTime
:
undefined
,
//联系电话
regCloseTime
:
undefined
,
//省份
provinceCode
:
undefined
,
//省份名称
province
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
cityCode
:
undefined
,
//详细地址
city
:
undefined
,
townCode
:
undefined
,
town
:
undefined
,
address
:
undefined
,
latitude
:
undefined
,
longitude
:
undefined
,
limitNum
:
0
,
isShow
:
0
,
isOpenReg
:
0
,
isDel
:
0
,
isPublish
:
0
,
isHomePage
:
0
,
crtUser
:
undefined
,
crtName
:
undefined
,
crtTime
:
undefined
,
actDesc
:
undefined
,
willNum
:
undefined
,
location
:
0
,
rank
:
0
,
type
:
undefined
,
banner
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:
[],
//banner轮播
posterBackground
:
''
,
//海报背景
},
showCampsiteVisible
:
false
,
//编辑营地地址
rules
:
{
name
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地名称'
,
trigger
:
'blur'
},
servicePhone
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入客服电话'
,
trigger
:
'blur'
},
phone
:
{
validator
:
checkPhone
,
trigger
:
'blur'
,
required
:
true
},
concat
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入联系人'
,
trigger
:
'blur'
},
addressStr
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入活动地址'
,
}
},
checkList
:
[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//营地标签
allLabelList
:
[],
//全部营地标签
}
},
isExist
:
false
,
//名称是否已存在
campsiteObj
:
{},
//营地地址
departureList
:
[],
//出发地列表
departureObj
:{
name
:
""
},
//出发地
pathway
:
[],
//途径地
isCreate
:
false
,
//是否点击了创建-确定
fileList2
:[],
activeName2
:
''
,
//行程亮点
form
:
{
alt
:
undefined
,
id
:
undefined
,
title
:
undefined
,
//营地名称
subtitle
:
undefined
,
//营地热度
startTime
:
undefined
,
//客服电话
endTime
:
undefined
,
//联系电话
regCloseTime
:
undefined
,
//省份
provinceCode
:
undefined
,
//省份名称
province
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
cityCode
:
undefined
,
//详细地址
city
:
undefined
,
townCode
:
undefined
,
town
:
undefined
,
address
:
undefined
,
latitude
:
undefined
,
longitude
:
undefined
,
limitNum
:
0
,
isShow
:
0
,
isOpenReg
:
0
,
isDel
:
0
,
isPublish
:
0
,
isHomePage
:
0
,
crtUser
:
undefined
,
crtName
:
undefined
,
crtTime
:
undefined
,
actDesc
:
undefined
,
willNum
:
undefined
,
location
:
0
,
rank
:
0
,
type
:
undefined
,
banner
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:[],
//banner轮播
posterBackground
:
''
,
//海报背景
created
()
{
},
showCampsiteVisible
:
false
,
//编辑营地地址
rules
:
{
name
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入营地名称'
,
trigger
:
'blur'
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
)
{
if
(
!
newValue
)
{
this
.
cleanForm
();
}
},
servicePhone
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入客服电话'
,
trigger
:
'blur'
},
phone
:{
validator
:
checkPhone
,
trigger
:
'blur'
,
required
:
true
},
concat
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入联系人'
,
trigger
:
'blur'
},
addressStr
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入活动地址'
,
}
},
checkList
:[],
//已选中的标签
allCompanies
:
{},
allCompaniesArr
:
[],
oneTourDialogVisible
:
false
,
editLableVisible
:
false
,
//营地标签
allLabelList
:
[],
//全部营地标签
}
},
created
()
{
},
watch
:
{
oneTourDialogVisible
(
newValue
,
oldValue
){
if
(
!
newValue
){
this
.
cleanForm
();
}
},
},
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
){
let
row
=
this
.
oneRow
;
this
.
getOne
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
mounted
()
{
this
.
cleanForm
();
if
(
this
.
title
==
"编辑"
)
{
let
row
=
this
.
oneRow
;
this
.
getOne
(
row
.
id
);
}
else
{
this
.
activeName2
=
"first"
;
}
this
.
oneTourDialogVisible
=
true
;
},
computed
:
{
getHeaderWithToken
()
{
return
{
Authorization
:
getToken
()};
},
},
methods
:
{
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
);
},
handleChange
(
id
)
{
console
.
log
(
id
)
},
/**
* 编辑营地标签
* */
editLable
(
list
)
{
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
handleChange
(
id
)
{
console
.
log
(
id
)
},
/**
* 编辑营地标签
* */
editLable
(
list
)
{
console
.
log
(
list
);
this
.
editLableVisible
=
true
;
},
isExistCampsiteShop
(
type
,
datas
){
console
.
log
(
datas
)
if
(
type
==
"update"
){
//编辑
this
.
toUpdate
(
datas
);
}
if
(
type
==
"create"
){
//创建
this
.
toCreate
(
datas
);
}
},
/**
* 创建
* */
create
(
formName
){
const
set
=
this
.
$refs
;
if
(
this
.
form
.
startTime
&&
(
typeof
this
.
form
.
startTime
==
"object"
)){
this
.
form
.
startTime
=
this
.
form
.
startTime
.
getTime
();
}
if
(
this
.
form
.
endTime
&&
(
typeof
this
.
form
.
endTime
==
"object"
)){
this
.
form
.
endTime
=
this
.
form
.
endTime
.
getTime
();
}
if
(
this
.
form
.
regCloseTime
&&
(
typeof
this
.
form
.
regCloseTime
==
"object"
)){
this
.
form
.
regCloseTime
=
this
.
form
.
regCloseTime
.
getTime
();
}
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
params
=
{
alt
:
this
.
form
.
alt
,
id
:
this
.
form
.
id
,
title
:
this
.
form
.
title
,
//营地名称
subtitle
:
this
.
form
.
subtitle
,
//营地热度
startTime
:
this
.
form
.
startTime
,
//客服电话
endTime
:
this
.
form
.
endTime
,
//联系电话
regCloseTime
:
this
.
form
.
regCloseTime
,
//省份
provinceCode
:
this
.
campsiteObj
.
province
,
//省份名称
province
:
this
.
campsiteObj
.
provinceName
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
cityCode
:
this
.
campsiteObj
.
city
,
//详细地址
city
:
this
.
campsiteObj
.
cityName
,
townCode
:
this
.
campsiteObj
.
townCode
,
town
:
this
.
campsiteObj
.
town
,
address
:
this
.
campsiteObj
.
address
,
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
limitNum
:
this
.
form
.
limitNum
,
isShow
:
this
.
form
.
isShow
,
isOpenReg
:
this
.
form
.
isOpenReg
,
isDel
:
this
.
form
.
isDel
,
isHomePage
:
this
.
form
.
isHomePage
,
isHomePage
:
this
.
form
.
isHomePage
,
crtUser
:
this
.
form
.
crtUser
,
crtName
:
this
.
form
.
crtName
,
crtTime
:
this
.
form
.
crtTime
,
actDesc
:
this
.
form
.
actDesc
,
banner
:
this
.
form
.
banner
,
willNum
:
this
.
form
.
willNum
,
location
:
this
.
form
.
location
,
rank
:
this
.
form
.
rank
,
type
:
this
.
form
.
type
,
content
:
this
.
form
.
content
,
//营地详情
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
}
else
{
return
;
}
});
},
/**
* 编辑
* */
update
(
formName
){
const
set
=
this
.
$refs
;
isExistCampsiteShop
(
type
,
datas
)
{
console
.
log
(
datas
)
if
(
type
==
"update"
)
{
//编辑
this
.
toUpdate
(
datas
);
}
if
(
type
==
"create"
)
{
//创建
this
.
toCreate
(
datas
);
}
},
/**
* 创建
* */
create
(
formName
)
{
const
set
=
this
.
$refs
;
if
(
this
.
form
.
startTime
&&
(
typeof
this
.
form
.
startTime
==
"object"
))
{
this
.
form
.
startTime
=
this
.
form
.
startTime
.
getTime
();
}
if
(
this
.
form
.
endTime
&&
(
typeof
this
.
form
.
endTime
==
"object"
))
{
this
.
form
.
endTime
=
this
.
form
.
endTime
.
getTime
();
}
if
(
this
.
form
.
regCloseTime
&&
(
typeof
this
.
form
.
regCloseTime
==
"object"
))
{
this
.
form
.
regCloseTime
=
this
.
form
.
regCloseTime
.
getTime
();
}
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
let
params
=
{
alt
:
this
.
form
.
alt
,
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
,
id
:
this
.
form
.
id
,
title
:
this
.
form
.
title
,
//营地名称
subtitle
:
this
.
form
.
subtitle
,
//营地热度
startTime
:
this
.
form
.
startTime
,
//客服电话
endTime
:
this
.
form
.
endTime
,
//联系电话
regCloseTime
:
this
.
form
.
regCloseTime
,
//省份
provinceCode
:
this
.
campsiteObj
.
province
,
//省份名称
province
:
this
.
campsiteObj
.
provinceName
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
cityCode
:
this
.
campsiteObj
.
city
,
//详细地址
city
:
this
.
campsiteObj
.
cityName
,
townCode
:
this
.
campsiteObj
.
townCode
,
town
:
this
.
campsiteObj
.
town
,
address
:
this
.
campsiteObj
.
address
,
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
limitNum
:
this
.
form
.
limitNum
,
isShow
:
this
.
form
.
isShow
,
isOpenReg
:
this
.
form
.
isOpenReg
,
isDel
:
this
.
form
.
isDel
,
isHomePage
:
this
.
form
.
isHomePage
,
isHomePage
:
this
.
form
.
isHomePage
,
crtUser
:
this
.
form
.
crtUser
,
crtName
:
this
.
form
.
crtName
,
crtTime
:
this
.
form
.
crtTime
,
actDesc
:
this
.
form
.
actDesc
,
banner
:
this
.
form
.
banner
,
willNum
:
this
.
form
.
willNum
,
location
:
this
.
form
.
location
,
rank
:
this
.
form
.
rank
,
type
:
this
.
form
.
type
,
content
:
this
.
form
.
content
,
//营地详情
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
}
else
{
return
;
}
});
},
/**
* 编辑
* */
update
(
formName
)
{
const
set
=
this
.
$refs
;
if
(
this
.
form
.
startTime
&&
(
typeof
this
.
form
.
startTime
==
"object"
)){
this
.
form
.
startTime
=
this
.
form
.
startTime
.
getTime
();
}
if
(
this
.
form
.
endTime
&&
(
typeof
this
.
form
.
endTime
==
"object"
)){
this
.
form
.
endTime
=
this
.
form
.
endTime
.
getTime
();
}
if
(
this
.
form
.
regCloseTime
&&
(
typeof
this
.
form
.
regCloseTime
==
"object"
)){
this
.
form
.
regCloseTime
=
this
.
form
.
regCloseTime
.
getTime
();
}
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
isCreate
=
true
;
let
params
=
{
alt
:
this
.
form
.
alt
,
id
:
this
.
form
.
id
,
title
:
this
.
form
.
title
,
//营地名称
subtitle
:
this
.
form
.
subtitle
,
//营地热度
startTime
:
this
.
form
.
startTime
,
//客服电话
endTime
:
this
.
form
.
endTime
,
//联系电话
regCloseTime
:
this
.
form
.
regCloseTime
,
//省份
provinceCode
:
this
.
campsiteObj
.
province
,
//省份名称
province
:
this
.
campsiteObj
.
provinceName
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
cityCode
:
this
.
campsiteObj
.
city
,
//详细地址
city
:
this
.
campsiteObj
.
cityName
,
townCode
:
this
.
campsiteObj
.
townCode
,
town
:
this
.
campsiteObj
.
town
,
address
:
this
.
campsiteObj
.
address
,
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
limitNum
:
this
.
form
.
limitNum
,
isShow
:
this
.
form
.
isShow
,
banner
:
this
.
form
.
banner
,
isOpenReg
:
this
.
form
.
isOpenReg
,
isDel
:
this
.
form
.
isDel
,
isHomePage
:
this
.
form
.
isHomePage
,
isHomePage
:
this
.
form
.
isHomePage
,
crtUser
:
this
.
form
.
crtUser
,
crtName
:
this
.
form
.
crtName
,
crtTime
:
this
.
form
.
crtTime
,
actDesc
:
this
.
form
.
actDesc
,
willNum
:
this
.
form
.
willNum
,
location
:
this
.
form
.
location
,
rank
:
this
.
form
.
rank
,
type
:
this
.
form
.
type
,
content
:
this
.
form
.
content
,
//营地详情
};
this
.
isExistCampsiteShop
(
"update"
,
params
);
}
else
{
return
;
}
});
},
/**
* 更新
* */
toUpdate
(
params
){
console
.
log
(
"............修改"
)
editActivity
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 创建
* */
toCreate
(
params
){
editActivity
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'创建失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 关闭营地地址弹框
* */
campsiteEvent
(
obj
){
this
.
showCampsiteVisible
=
false
;
if
(
obj
){
this
.
campsiteObj
=
obj
;
console
.
log
(
obj
)
let
provinceObj
=
getRegionByCodes
([
obj
.
province
]);
let
cityObj
=
getRegionByCodes
([
obj
.
city
]);
let
townObj
=
getRegionByCodes
([
obj
.
townCode
])
this
.
campsiteObj
.
provinceName
=
provinceObj
[
0
].
name
;
this
.
campsiteObj
.
cityName
=
cityObj
[
0
].
name
;
this
.
campsiteObj
.
town
=
townObj
[
0
].
name
this
.
campsiteObj
.
townCode
=
obj
.
townCode
this
.
form
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
town
+
this
.
campsiteObj
.
address
;
console
.
log
(
this
.
campsiteObj
);
}
},
/**
* 编辑营地地址
* */
selectDestination
(){
let
that
=
this
;
console
.
log
(
this
.
campsiteObj
)
this
.
campsiteObj
.
showTitle
=
"活动地址编辑"
;
this
.
campsiteObj
.
eventName
=
'campsiteEvent'
;
this
.
campsiteObj
.
keyword
=
this
.
campsiteObj
.
address
;
this
.
showCampsiteVisible
=
true
;
},
/**
* 获取一条营地
* */
getOne
(
id
){
let
that
=
this
;
getOneActivityShop
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
campsiteObj
=
{
address
:
response
.
data
.
address
,
province
:
response
.
data
.
provinceCode
,
provinceName
:
response
.
data
.
province
,
city
:
response
.
data
.
cityCode
,
cityName
:
response
.
data
.
city
,
latitude
:
response
.
data
.
latitude
,
longitude
:
response
.
data
.
longitude
,
townCode
:
response
.
data
.
townCode
,
town
:
response
.
data
.
town
};
response
.
data
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
town
+
this
.
campsiteObj
.
address
;
})
},
/**
* 旅游-弹框-取消
* */
cancel
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneCampsiteDialogEvent"
,
false
);
},
/**
* 配套&收费 富文本
* */
handelIntroduceIncrease
(
step
){
this
.
form
.
configure
=
step
;
},
/**
* 富文本 营地详情
* */
editorReadyEvent
(
instance
){
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
){
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
){
t
.
form
.
actDesc
=
instance
.
getContent
();
}
});
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
){
console
.
log
(
res
.
data
)
this
.
form
.
banner
=
res
.
data
;
},
if
(
this
.
form
.
startTime
&&
(
typeof
this
.
form
.
startTime
==
"object"
))
{
this
.
form
.
startTime
=
this
.
form
.
startTime
.
getTime
();
}
if
(
this
.
form
.
endTime
&&
(
typeof
this
.
form
.
endTime
==
"object"
))
{
this
.
form
.
endTime
=
this
.
form
.
endTime
.
getTime
();
}
if
(
this
.
form
.
regCloseTime
&&
(
typeof
this
.
form
.
regCloseTime
==
"object"
))
{
this
.
form
.
regCloseTime
=
this
.
form
.
regCloseTime
.
getTime
();
}
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
isCreate
=
true
;
let
params
=
{
alt
:
this
.
form
.
alt
,
imgTitle
:
this
.
form
.
imgTitle
,
imgKeyword
:
this
.
form
.
imgKeyword
,
imgDesc
:
this
.
form
.
imgDesc
,
id
:
this
.
form
.
id
,
title
:
this
.
form
.
title
,
//营地名称
subtitle
:
this
.
form
.
subtitle
,
//营地热度
startTime
:
this
.
form
.
startTime
,
//客服电话
endTime
:
this
.
form
.
endTime
,
//联系电话
regCloseTime
:
this
.
form
.
regCloseTime
,
//省份
provinceCode
:
this
.
campsiteObj
.
province
,
//省份名称
province
:
this
.
campsiteObj
.
provinceName
,
//市编号
cityName
:
this
.
campsiteObj
.
cityName
,
//市名称
cityCode
:
this
.
campsiteObj
.
city
,
//详细地址
city
:
this
.
campsiteObj
.
cityName
,
townCode
:
this
.
campsiteObj
.
townCode
,
town
:
this
.
campsiteObj
.
town
,
address
:
this
.
campsiteObj
.
address
,
latitude
:
this
.
campsiteObj
.
latitude
,
longitude
:
this
.
campsiteObj
.
longitude
,
limitNum
:
this
.
form
.
limitNum
,
isShow
:
this
.
form
.
isShow
,
banner
:
this
.
form
.
banner
,
isOpenReg
:
this
.
form
.
isOpenReg
,
isDel
:
this
.
form
.
isDel
,
isHomePage
:
this
.
form
.
isHomePage
,
isHomePage
:
this
.
form
.
isHomePage
,
crtUser
:
this
.
form
.
crtUser
,
crtName
:
this
.
form
.
crtName
,
crtTime
:
this
.
form
.
crtTime
,
actDesc
:
this
.
form
.
actDesc
,
willNum
:
this
.
form
.
willNum
,
location
:
this
.
form
.
location
,
rank
:
this
.
form
.
rank
,
type
:
this
.
form
.
type
,
content
:
this
.
form
.
content
,
//营地详情
};
this
.
isExistCampsiteShop
(
"update"
,
params
);
}
else
{
return
;
}
});
},
/**
* 更新
* */
toUpdate
(
params
)
{
console
.
log
(
"............修改"
)
editActivity
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'编辑成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'编辑失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 创建
* */
toCreate
(
params
)
{
editActivity
(
params
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
$emit
(
"oneCampsiteDialogEvent"
,
true
);
}
else
{
this
.
$notify
({
title
:
'创建失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 关闭营地地址弹框
* */
campsiteEvent
(
obj
)
{
this
.
showCampsiteVisible
=
false
;
if
(
obj
)
{
this
.
campsiteObj
=
obj
;
console
.
log
(
obj
)
let
provinceObj
=
getRegionByCodes
([
obj
.
province
]);
let
cityObj
=
getRegionByCodes
([
obj
.
city
]);
let
townObj
=
getRegionByCodes
([
obj
.
townCode
])
this
.
campsiteObj
.
provinceName
=
provinceObj
[
0
].
name
;
this
.
campsiteObj
.
cityName
=
cityObj
[
0
].
name
;
this
.
campsiteObj
.
town
=
townObj
[
0
].
name
this
.
campsiteObj
.
townCode
=
obj
.
townCode
this
.
form
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
town
+
this
.
campsiteObj
.
address
;
console
.
log
(
this
.
campsiteObj
);
}
},
/**
* 编辑营地地址
* */
selectDestination
()
{
let
that
=
this
;
console
.
log
(
this
.
campsiteObj
)
this
.
campsiteObj
.
showTitle
=
"活动地址编辑"
;
this
.
campsiteObj
.
eventName
=
'campsiteEvent'
;
this
.
campsiteObj
.
keyword
=
this
.
campsiteObj
.
address
;
this
.
showCampsiteVisible
=
true
;
},
/**
* 获取一条营地
* */
getOne
(
id
)
{
let
that
=
this
;
getOneActivityShop
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
campsiteObj
=
{
address
:
response
.
data
.
address
,
province
:
response
.
data
.
provinceCode
,
provinceName
:
response
.
data
.
province
,
city
:
response
.
data
.
cityCode
,
cityName
:
response
.
data
.
city
,
latitude
:
response
.
data
.
latitude
,
longitude
:
response
.
data
.
longitude
,
townCode
:
response
.
data
.
townCode
,
town
:
response
.
data
.
town
};
response
.
data
.
addressStr
=
this
.
campsiteObj
.
provinceName
+
this
.
campsiteObj
.
cityName
+
this
.
campsiteObj
.
town
+
this
.
campsiteObj
.
address
;
})
},
/**
* 旅游-弹框-取消
* */
cancel
()
{
this
.
cleanForm
();
this
.
$emit
(
"oneCampsiteDialogEvent"
,
false
);
},
/**
* 配套&收费 富文本
* */
handelIntroduceIncrease
(
step
)
{
this
.
form
.
configure
=
step
;
},
/**
* 富文本 营地详情
* */
editorReadyEvent
(
instance
)
{
let
t
=
this
;
instance
.
addListener
(
'contentChange'
,
()
=>
{
if
(
t
.
activeName2
==
"first"
)
{
t
.
form
.
content
=
instance
.
getContent
();
}
else
if
(
t
.
activeName2
==
"second"
)
{
t
.
form
.
actDesc
=
instance
.
getContent
();
}
});
},
/**
* 封面图上传
* **/
handleAvatarSuccess
(
res
,
file
)
{
console
.
log
(
res
.
data
)
this
.
form
.
banner
=
res
.
data
;
},
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
campsiteObj
=
{
name
:
""
};
//营地地址
this
.
fileList2
=
[];
this
.
activeName2
=
''
;
//营地详情
this
.
form
=
{
alt
:
undefined
,
id
:
undefined
,
title
:
undefined
,
//营地名称
subtitle
:
undefined
,
//营地热度
startTime
:
""
,
//客服电话
endTime
:
""
,
//联系电话
regCloseTime
:
undefined
,
//省份
provinceCode
:
undefined
,
//省份名称
province
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
cityCode
:
undefined
,
//详细地址
city
:
undefined
,
townCode
:
undefined
,
town
:
undefined
,
address
:
undefined
,
latitude
:
undefined
,
longitude
:
undefined
,
limitNum
:
0
,
isShow
:
0
,
isOpenReg
:
0
,
isDel
:
0
,
banner
:
undefined
,
isPublish
:
0
,
isHomePage
:
0
,
crtUser
:
undefined
,
crtName
:
undefined
,
crtTime
:
undefined
,
actDesc
:
undefined
,
willNum
:
undefined
,
location
:
0
,
rank
:
undefined
,
type
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:[],
//banner轮播
posterBackground
:
''
,
//海报背景
};
this
.
showCampsiteVisible
=
false
;
//编辑营地地址
}
/**
* 清空旅游弹框数据
*/
cleanForm
()
{
this
.
campsiteObj
=
{
name
:
""
};
//营地地址
this
.
fileList2
=
[];
this
.
activeName2
=
''
;
//营地详情
this
.
form
=
{
alt
:
undefined
,
imgTitle
:
undefined
,
imgKeyword
:
undefined
,
imgDesc
:
undefined
,
id
:
undefined
,
title
:
undefined
,
//营地名称
subtitle
:
undefined
,
//营地热度
startTime
:
""
,
//客服电话
endTime
:
""
,
//联系电话
regCloseTime
:
undefined
,
//省份
provinceCode
:
undefined
,
//省份名称
province
:
undefined
,
//市编号
cityName
:
undefined
,
//市名称
cityCode
:
undefined
,
//详细地址
city
:
undefined
,
townCode
:
undefined
,
town
:
undefined
,
address
:
undefined
,
latitude
:
undefined
,
longitude
:
undefined
,
limitNum
:
0
,
isShow
:
0
,
isOpenReg
:
0
,
isDel
:
0
,
banner
:
undefined
,
isPublish
:
0
,
isHomePage
:
0
,
crtUser
:
undefined
,
crtName
:
undefined
,
crtTime
:
undefined
,
actDesc
:
undefined
,
willNum
:
undefined
,
location
:
0
,
rank
:
undefined
,
type
:
undefined
,
content
:
''
,
//营地详情
concat
:
""
,
//联系人
logo
:
undefined
,
//封面图
configure
:
''
,
//配套&收费
campsiteTagListVos
:
[],
//营地类型
carouse
:
[],
//banner轮播
posterBackground
:
''
,
//海报背景
};
this
.
showCampsiteVisible
=
false
;
//编辑营地地址
}
}
}
}
</
script
>
<
style
>
.activity
.edui-editor
{
z-index
:
2000
!important
;
}
.activity
.edui-editor
{
z-index
:
2000
!important
;
}
</
style
>
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