shanyunduo.cheng

目的航班规则列表

import request from '@/utils/request'
//目的航班规则接口
// 查询航班列表
export function findFlightNo(query) {
return request({
url: '/destinationFlight/findFlightNo',
method: 'post',
data: query
})
}
\ No newline at end of file
<template>
<div style="margin:40px">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form :inline="true" :model="queryParams" class="demo-form-inline">
<el-form-item label="航班号">
<el-input v-model="formInline.flyNum" placeholder="航班号"></el-input>
<el-input v-model="queryParams.purposeOfFlightNo" placeholder="航班号"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
</el-form-item>
</el-form>
<el-button style="margin-bottom:20px" type="primary" icon="el-icon-plus">添加</el-button>
<el-table
:data="flyList"
style="width: 800px"
v-loading="loading"
>
<el-table-column
prop="flyNum"
label="航班号"
>
prop="purposeOfFlightNo"
label="航班号">
</el-table-column>
<el-table-column
label="操作"
>
label="操作">
<el-link type="primary">查看</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary">修改</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary">删除</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary">启用</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary">停用</el-link>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
@size-change="getList"
@current-change="getList"
:current-page.sync="curPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:page-size.sync="limit"
layout="prev, pager, next, jumper, sizes, total"
:total="total"
background
style="margin-top:40px">
</el-pagination>
</el-pagination>
</div>
</template>
<script>
import {
findFlightNo
} from "@/api/destinationFlight";
export default {
data() {
return {
formInline: {
flyNum: ''
queryParams: {
purposeOfFlightNo: '',
start:0,
limit:10
},
flyList:[],
currentPage:1,
total:0
curPage:1,
limit:10,
total:0,
loading:false,
}
},
methods: {
onSubmit() {
console.log('submit!');
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
getAll(){
getList(){
this.queryParams.limit = this.limit;
if (this.curPage > 1) {
this.queryParams.start = (this.curPage - 1) * this.queryParams.limit
}else {
this.queryParams.start = 0;
}
this.loading = true;
findFlightNo(this.queryParams).then(response => {
this.flyList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
}
},
created:{
created() {
this.getList();
}
}
</script>
......