Commit 5dbc60e9 authored by zhengke's avatar zhengke

修改页面

parent c4038de4
......@@ -10,23 +10,29 @@
<div class="query-box">
<ul class="user_time_picker">
<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>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loadingArea">
<tr>
<th colspan="4">地区</th>
</tr>
<tr>
<th width="400">地区</th>
<th>操作人</th>
<th>操作时间</th>
<th>操作</th>
</tr>
<tr>
<td>大众化</td>
<td>张三丰</td>
<td>2012-10-25</td>
<tr v-for="(item,index) in AreaDataList" :key="index">
<td>{{item.Name}}</td>
<td>{{item.CreateByName}}</td>
<td>{{item.CreateDateStr}}</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>
</tr>
</table>
......@@ -40,28 +46,34 @@
></el-pagination>
<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>
<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>
<th width="400">车辆类型</th>
<th>操作人</th>
<th>操作时间</th>
<th>操作</th>
</tr>
<tr>
<td>大众化</td>
<td>张三丰</td>
<td>2012-10-25</td>
<tr v-for="(item,index) in BusTypeDataList" :key="index">
<td>{{item.Name}}</td>
<td>{{item.CreateByName}}</td>
<td>{{item.CreateDateStr}}</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>
</tr>
</table>
<el-pagination
background
@current-change="BusCurrentChange"
:current-page.sync="currentPage"
:current-page.sync="currentPage2"
layout="total,prev, pager, next, jumper"
:page-size="BusTypeMsg.pageSize"
:total="totalBus"
......@@ -70,28 +82,53 @@
<el-dialog
custom-class="w400"
:title="dialogTitle"
:visible.sync="outerVisible"
:title="AreaTitle"
:visible.sync="AreaVisible"
center
:before-close="closeChangeMachie"
:before-close="closeAreaMachie"
>
<el-form label-width="100px">
<el-form label-width="100px">
<table class="layerTable layerNoIcon">
<tr>
<td>
<el-form-item label="名称">
<el-input v-model="CommonName" class="w217"/>
<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="outerVisible = false">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button>
<button class="hollowFixedBtn" @click="AreaVisible = false,addAreaMsg.Name=''">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" @click="saveAreaInfo()">{{$t('pub.saveBtn')}}</button>
</div>
</el-dialog>
<el-dialog
custom-class="w400"
:title="BusTitle"
:visible.sync="BusVisible"
center
:before-close="closeBusMachie"
>
<el-form label-width="100px">
<table class="layerTable layerNoIcon">
<tr>
<td>
<el-form-item label="名称">
<el-input v-model="addBusType.Name" class="w217"/>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="BusVisible = false,addBusType.Name=''">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" @click="saveBusInfo()">{{$t('pub.saveBtn')}}</button>
</div>
</el-dialog>
</div>
</template>
<script>
......@@ -99,14 +136,17 @@ export default {
data() {
return {
currentPage:1,
currentPage2:1,
//地区总计
totalArea:0,
//车辆总计
totalBus:0,
outerVisible:false,
dialogTitle:'新增',
AreaVisible:false,
BusVisible:false,
AreaTitle:'',
BusTitle:'',
loadingArea:false,
commonType:0,
loadingBus:false,
//地区请求参数
Areamsg: {
Type:1,
......@@ -122,14 +162,15 @@ export default {
AreaDataList:[],
BusTypeDataList:[],
CommonName:'',
//新增地区
addAreaMsg:{
Id:0,
Type:1,
Name:''
},
//新增车辆类型
addBusType:{
Id:0,
Type:2,
Name:'',
}
......@@ -137,40 +178,54 @@ export default {
},
mounted() {
this.getAreaData();
this.getBusData();
},
filters: {
},
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) {
//弹出框关闭初始化弹框内表单
done();
this.resetForm("addMsg");
//关闭地区
closeAreaMachie() {
this.addAreaMsg.Name='';
this.BusVisible=false;
this.addAreaMsg.Id=0;
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
// this.addDraw();
} else {
return false;
}
});
//关闭车辆类型
closeBusMachie() {
this.BusVisible=false;
this.addBusType.Name='';
this.addBusType.Id=0;
},
//获取地区数据
getAreaData(){
this.apipost('bus_get_GetBusAreaTypePageListService ', this.Areamsg,
this.loadingArea=true;
this.apipost('bus_get_GetBusAreaTypePageListService', this.Areamsg,
res => {
console.log(res,'ressssss');
this.loadingArea=false;
if (res.data.resultCode == 1) {
//this.companyList = res.data.data
this.AreaDataList = res.data.data.pageData;
this.totalArea = res.data.data.count;
}else{
this.Error(res.data.message);
}
......@@ -178,11 +233,143 @@ export default {
err => {}
)
},
//新增地区
addAreaType(){
this.outerVisible=true;
this.commonType=1;
}
//获取车辆数据
getBusData(){
this.loadingBus=true;
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>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment