Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
5dbc60e9
Commit
5dbc60e9
authored
Apr 16, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改页面
parent
c4038de4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
237 additions
and
50 deletions
+237
-50
AreaandType.vue
src/components/busManagement/AreaandType.vue
+237
-50
No files found.
src/components/busManagement/AreaandType.vue
View file @
5dbc60e9
...
@@ -10,23 +10,29 @@
...
@@ -10,23 +10,29 @@
<div
class=
"query-box"
>
<div
class=
"query-box"
>
<ul
class=
"user_time_picker"
>
<ul
class=
"user_time_picker"
>
<li>
<li>
<input
type=
"button"
class=
"normalBtn"
@
click=
"
outerVisible=true,addAreaType
()"
:value=
"$t('pub.addBtn')"
>
<input
type=
"button"
class=
"normalBtn"
@
click=
"
addAreaData
()"
:value=
"$t('pub.addBtn')"
>
</li>
</li>
</ul>
</ul>
</div>
</div>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
v-loading=
"loadingArea"
>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
v-loading=
"loadingArea"
>
<tr>
<th
colspan=
"4"
>
地区
</th>
</tr>
<tr>
<tr>
<th
width=
"400"
>
地区
</th>
<th
width=
"400"
>
地区
</th>
<th>
操作人
</th>
<th>
操作人
</th>
<th>
操作时间
</th>
<th>
操作时间
</th>
<th>
操作
</th>
<th>
操作
</th>
</tr>
</tr>
<tr>
<tr
v-for=
"(item,index) in AreaDataList"
:key=
"index"
>
<td>
大众化
</td>
<td>
{{
item
.
Name
}}
</td>
<td>
张三丰
</td>
<td>
{{
item
.
CreateByName
}}
</td>
<td>
2012-10-25
</td>
<td>
{{
item
.
CreateDateStr
}}
</td>
<td>
<td>
<el-button
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<el-button
type=
"primary"
icon=
"el-icon-edit"
@
click=
"getAreaUpdate(item.Id)"
circle
></el-button>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"删除"
placement=
"top-start"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delArea(item.Id)"
circle
></el-button>
</el-tooltip>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
@@ -40,28 +46,34 @@
...
@@ -40,28 +46,34 @@
></el-pagination>
></el-pagination>
<div
class=
"BusAddArea"
>
<div
class=
"BusAddArea"
>
<input
type=
"button"
class=
"normalBtn"
@
click=
"
outerVisible=true
"
:value=
"$t('pub.addBtn')"
>
<input
type=
"button"
class=
"normalBtn"
@
click=
"
addBusData()
"
:value=
"$t('pub.addBtn')"
>
</div>
</div>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
v-loading=
"loadingBus"
>
<tr>
<th
colspan=
"4"
>
车辆类型
</th>
</tr>
<tr>
<tr>
<th
width=
"400"
>
车辆类型
</th>
<th
width=
"400"
>
车辆类型
</th>
<th>
操作人
</th>
<th>
操作人
</th>
<th>
操作时间
</th>
<th>
操作时间
</th>
<th>
操作
</th>
<th>
操作
</th>
</tr>
</tr>
<tr>
<tr
v-for=
"(item,index) in BusTypeDataList"
:key=
"index"
>
<td>
大众化
</td>
<td>
{{
item
.
Name
}}
</td>
<td>
张三丰
</td>
<td>
{{
item
.
CreateByName
}}
</td>
<td>
2012-10-25
</td>
<td>
{{
item
.
CreateDateStr
}}
</td>
<td>
<td>
<el-button
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<el-button
type=
"primary"
icon=
"el-icon-edit"
@
click=
"getBusUpdate(item.Id)"
circle
></el-button>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"删除"
placement=
"top-start"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delBus(item.Id)"
circle
></el-button>
</el-tooltip>
</td>
</td>
</tr>
</tr>
</table>
</table>
<el-pagination
<el-pagination
background
background
@
current-change=
"BusCurrentChange"
@
current-change=
"BusCurrentChange"
:current-page
.
sync=
"currentPage"
:current-page
.
sync=
"currentPage
2
"
layout=
"total,prev, pager, next, jumper"
layout=
"total,prev, pager, next, jumper"
:page-size=
"BusTypeMsg.pageSize"
:page-size=
"BusTypeMsg.pageSize"
:total=
"totalBus"
:total=
"totalBus"
...
@@ -70,28 +82,53 @@
...
@@ -70,28 +82,53 @@
<el-dialog
<el-dialog
custom-class=
"w400"
custom-class=
"w400"
:title=
"dialogTitle"
:title=
"AreaTitle"
:visible
.
sync=
"outerVisible"
:visible
.
sync=
"AreaVisible"
center
:before-close=
"closeAreaMachie"
>
<el-form
label-width=
"100px"
>
<table
class=
"layerTable layerNoIcon"
>
<tr>
<td>
<el-form-item
label=
"名称"
>
<el-input
v-model=
"addAreaMsg.Name"
class=
"w217"
/>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"AreaVisible = false,addAreaMsg.Name=''"
>
{{
$t
(
'pub.cancelBtn'
)
}}
</button>
<button
class=
"normalBtn"
@
click=
"saveAreaInfo()"
>
{{
$t
(
'pub.saveBtn'
)
}}
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
"w400"
:title=
"BusTitle"
:visible
.
sync=
"BusVisible"
center
center
:before-close=
"close
Change
Machie"
:before-close=
"close
Bus
Machie"
>
>
<el-form
label-width=
"100px"
>
<el-form
label-width=
"100px"
>
<table
class=
"layerTable layerNoIcon"
>
<table
class=
"layerTable layerNoIcon"
>
<tr>
<tr>
<td>
<td>
<el-form-item
label=
"名称"
>
<el-form-item
label=
"名称"
>
<el-input
v-model=
"
Common
Name"
class=
"w217"
/>
<el-input
v-model=
"
addBusType.
Name"
class=
"w217"
/>
</el-form-item>
</el-form-item>
</td>
</td>
</tr>
</tr>
</table>
</table>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"
outerVisible = false
"
>
{{
$t
(
'pub.cancelBtn'
)
}}
</button>
<button
class=
"hollowFixedBtn"
@
click=
"
BusVisible = false,addBusType.Name=''
"
>
{{
$t
(
'pub.cancelBtn'
)
}}
</button>
<button
class=
"normalBtn"
@
click=
"s
ubmitForm('addMsg'
)"
>
{{
$t
(
'pub.saveBtn'
)
}}
</button>
<button
class=
"normalBtn"
@
click=
"s
aveBusInfo(
)"
>
{{
$t
(
'pub.saveBtn'
)
}}
</button>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -99,14 +136,17 @@ export default {
...
@@ -99,14 +136,17 @@ export default {
data
()
{
data
()
{
return
{
return
{
currentPage
:
1
,
currentPage
:
1
,
currentPage2
:
1
,
//地区总计
//地区总计
totalArea
:
0
,
totalArea
:
0
,
//车辆总计
//车辆总计
totalBus
:
0
,
totalBus
:
0
,
outerVisible
:
false
,
AreaVisible
:
false
,
dialogTitle
:
'新增'
,
BusVisible
:
false
,
AreaTitle
:
''
,
BusTitle
:
''
,
loadingArea
:
false
,
loadingArea
:
false
,
commonType
:
0
,
loadingBus
:
false
,
//地区请求参数
//地区请求参数
Areamsg
:
{
Areamsg
:
{
Type
:
1
,
Type
:
1
,
...
@@ -122,14 +162,15 @@ export default {
...
@@ -122,14 +162,15 @@ export default {
AreaDataList
:[],
AreaDataList
:[],
BusTypeDataList
:[],
BusTypeDataList
:[],
CommonName
:
''
,
//新增地区
//新增地区
addAreaMsg
:{
addAreaMsg
:{
Id
:
0
,
Type
:
1
,
Type
:
1
,
Name
:
''
Name
:
''
},
},
//新增车辆类型
//新增车辆类型
addBusType
:{
addBusType
:{
Id
:
0
,
Type
:
2
,
Type
:
2
,
Name
:
''
,
Name
:
''
,
}
}
...
@@ -137,40 +178,54 @@ export default {
...
@@ -137,40 +178,54 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
getAreaData
();
this
.
getAreaData
();
this
.
getBusData
();
},
},
filters
:
{
filters
:
{
},
},
methods
:
{
methods
:
{
//新增地区
addAreaData
(){
this
.
AreaVisible
=
true
;
this
.
AreaTitle
=
'新增地区'
;
this
.
addAreaMsg
.
Id
=
0
;
},
//新增车辆
addBusData
(){
this
.
BusVisible
=
true
;
this
.
BusTitle
=
'新增车辆类型'
;
this
.
addBusType
.
Id
=
0
;
},
//地区翻页
//地区翻页
AreaCurrentChange
(){
AreaCurrentChange
(
val
){
this
.
Areamsg
.
pageIndex
=
val
;
this
.
getAreaData
();
},
},
//车辆类型翻页
//车辆类型翻页
BusCurrentChange
(){
BusCurrentChange
(
val
){
this
.
BusTypeMsg
.
pageIndex
=
val
;
this
.
getBusData
();
},
},
closeChangeMachie
(
done
)
{
//关闭地区
//弹出框关闭初始化弹框内表单
closeAreaMachie
()
{
done
();
this
.
addAreaMsg
.
Name
=
''
;
this
.
resetForm
(
"addMsg"
);
this
.
BusVisible
=
false
;
},
this
.
addAreaMsg
.
Id
=
0
;
submitForm
(
addMsg
)
{
},
//提交创建、修改表单
//关闭车辆类型
this
.
$refs
[
addMsg
].
validate
(
valid
=>
{
closeBusMachie
()
{
if
(
valid
)
{
this
.
BusVisible
=
false
;
// this.addDraw();
this
.
addBusType
.
Name
=
''
;
}
else
{
this
.
addBusType
.
Id
=
0
;
return
false
;
}
});
},
},
//获取地区数据
//获取地区数据
getAreaData
(){
getAreaData
(){
this
.
apipost
(
'bus_get_GetBusAreaTypePageListService '
,
this
.
Areamsg
,
this
.
loadingArea
=
true
;
this
.
apipost
(
'bus_get_GetBusAreaTypePageListService'
,
this
.
Areamsg
,
res
=>
{
res
=>
{
console
.
log
(
res
,
'ressssss'
)
;
this
.
loadingArea
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
//this.companyList = res.data.data
this
.
AreaDataList
=
res
.
data
.
data
.
pageData
;
this
.
totalArea
=
res
.
data
.
data
.
count
;
}
else
{
}
else
{
this
.
Error
(
res
.
data
.
message
);
this
.
Error
(
res
.
data
.
message
);
}
}
...
@@ -178,11 +233,143 @@ export default {
...
@@ -178,11 +233,143 @@ export default {
err
=>
{}
err
=>
{}
)
)
},
},
//新增地区
//获取车辆数据
addAreaType
(){
getBusData
(){
this
.
outerVisible
=
true
;
this
.
loadingBus
=
true
;
this
.
commonType
=
1
;
this
.
apipost
(
'bus_get_GetBusAreaTypePageListService'
,
this
.
BusTypeMsg
,
res
=>
{
this
.
loadingBus
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
BusTypeDataList
=
res
.
data
.
data
.
pageData
;
this
.
totalBus
=
res
.
data
.
data
.
count
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
},
err
=>
{}
)
},
//保存地区
saveAreaInfo
(){
if
(
this
.
addAreaMsg
.
Name
==
''
){
this
.
Error
(
'请填写地区名称'
);
return
;
}
this
.
apipost
(
'bus_get_SetBusAreaTypeService'
,
this
.
addAreaMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
getAreaData
();
this
.
addAreaMsg
.
Name
=
""
;
this
.
AreaVisible
=
false
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
}
},
err
=>
{}
)
},
//保存车辆
saveBusInfo
(){
if
(
this
.
addBusType
.
Name
==
''
){
this
.
Error
(
'请填写车辆类型'
);
return
;
}
this
.
apipost
(
'bus_get_SetBusAreaTypeService'
,
this
.
addBusType
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
getBusData
();
this
.
addBusType
.
Name
=
""
;
this
.
BusVisible
=
false
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
},
err
=>
{}
)
},
//修改地区
getAreaUpdate
(
Id
){
this
.
AreaTitle
=
"修改地区"
this
.
AreaVisible
=
true
;
let
msg
=
{
Id
:
Id
}
this
.
apipost
(
'bus_get_GetBusAreaTypeService'
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
addAreaMsg
.
Id
=
res
.
data
.
data
.
Id
;
this
.
addAreaMsg
.
Name
=
res
.
data
.
data
.
Name
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
},
err
=>
{}
)
},
//修改车辆
getBusUpdate
(
Id
){
this
.
BusTitle
=
"修改车辆类型"
this
.
BusVisible
=
true
;
let
msg
=
{
Id
:
Id
}
this
.
apipost
(
'bus_get_GetBusAreaTypeService'
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
addBusType
.
Id
=
res
.
data
.
data
.
Id
;
this
.
addBusType
.
Name
=
res
.
data
.
data
.
Name
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
},
err
=>
{}
)
},
//删除地区
delArea
(
Id
){
var
that
=
this
;
this
.
Confirm
(
"是否删除?"
,
function
()
{
var
msg
=
{
Id
:
Id
};
that
.
apipost
(
"bus_post_RemoveBusAreaTypeService"
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
that
.
Success
(
'删除成功!'
);
that
.
getAreaData
();
}
else
{
that
.
Error
(
res
.
data
.
data
);
}
},
null
);
});
},
//删除车辆
delBus
(
Id
){
var
that
=
this
;
this
.
Confirm
(
"是否删除?"
,
function
()
{
var
msg
=
{
Id
:
Id
};
that
.
apipost
(
"bus_post_RemoveBusAreaTypeService"
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
that
.
Success
(
'删除成功!'
);
that
.
getBusData
();
}
else
{
that
.
Error
(
res
.
data
.
data
);
}
},
null
);
});
},
}
}
};
};
</
script
>
</
script
>
\ No newline at end of file
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