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
43fa21bc
Commit
43fa21bc
authored
Aug 16, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营地列表-必填项添加
parent
5e2a800b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
82 deletions
+120
-82
oneCampsiteModal.vue
src/views/campsiteManage/modal/oneCampsiteModal.vue
+119
-81
vehiclePlanModal.vue
src/views/vehicle/vehicleSchedulManage/vehiclePlanModal.vue
+1
-1
No files found.
src/views/campsiteManage/modal/oneCampsiteModal.vue
View file @
43fa21bc
...
...
@@ -5,35 +5,35 @@
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
label-width=
"90px"
>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"营地名称"
>
<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-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"营地地址"
>
<el-form-item
label=
"营地地址"
prop=
"addressStr"
>
<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-form-item
label=
"客服电话"
prop=
"servicePhone"
>
<el-input
v-model=
"form.servicePhone"
placeholder=
"请输入客服电话"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"联系人"
>
<el-form-item
label=
"联系人"
prop=
"concat"
>
<el-input
v-model=
"form.concat"
placeholder=
"请输入联系人"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"联系电话"
>
<el-form-item
label=
"联系电话"
prop=
"phone"
>
<el-input
v-model=
"form.phone"
placeholder=
"请输入联系电话"
></el-input>
</el-form-item>
</el-col>
...
...
@@ -51,7 +51,7 @@
</el-col>
</el-row>
<!--BASE_API + -->
<el-form-item
label=
"封面图"
:style=
"
{display:'block'}">
<el-form-item
label=
"封面图"
:style=
"
{display:'block'}"
prop="logo"
>
<el-upload
class=
"upload-demo"
:headers=
"getHeaderWithToken"
...
...
@@ -79,7 +79,7 @@
<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'}">
<el-form-item
label=
"轮播图"
:style=
"
{display:'block'}"
prop="carouse"
>
<el-upload
class=
"upload-demo"
:headers=
"getHeaderWithToken"
...
...
@@ -110,8 +110,8 @@
</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()"
>
确 定
</el-button>
<el-button
type=
"primary"
v-if=
"title=='编辑' && !isCreate && campsiteshop_btn_update"
@
click=
"update()"
>
确 定
</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>
...
...
@@ -170,6 +170,19 @@
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
,
...
...
@@ -210,20 +223,30 @@
},
showCampsiteVisible
:
false
,
//编辑营地地址
rules
:
{
name
:
[
{
name
:{
type
:
'string'
,
required
:
true
,
message
:
'请输入
消息内容
'
,
message
:
'请输入
营地名称
'
,
trigger
:
'blur'
},
{
min
:
0
,
max
:
100
,
message
:
'长度小于 100 个字符'
,
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
:
{},
...
...
@@ -299,7 +322,7 @@
/**
* 创建
* */
create
(){
create
(
formName
){
// this.isCreate = true;
let
carouse
=
[];
//营地轮播图
this
.
form
.
carouse
.
map
(
function
(
item
)
{
...
...
@@ -316,28 +339,35 @@
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
,
//海报背景
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
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
,
//海报背景
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"create"
,
params
);
}
else
{
return
;
}
});
},
/**
* 判断营地名称是否已存在
...
...
@@ -378,46 +408,54 @@
/**
* 编辑
* */
update
(){
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
);
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
,
//海报背景
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"update"
,
params
);
}
else
{
return
;
}
});
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
,
//海报背景
};
console
.
log
(
params
);
this
.
isExistCampsiteShop
(
"update"
,
params
);
},
/**
* 更新
...
...
src/views/vehicle/vehicleSchedulManage/vehiclePlanModal.vue
View file @
43fa21bc
...
...
@@ -130,7 +130,7 @@
if
(
!
value
)
{
return
callback
(
new
Error
(
'手机号不能为空'
));
}
else
{
const
reg
=
/^
1
[
3|4|5|7|8
][
0-9
]\d
{8}
$/
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
();
...
...
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