shanyunduo.cheng

目的航班规则列表

1 +import request from '@/utils/request'
2 +
3 +//目的航班规则接口
4 +
5 +// 查询航班列表
6 +export function findFlightNo(query) {
7 + return request({
8 + url: '/destinationFlight/findFlightNo',
9 + method: 'post',
10 + data: query
11 + })
12 + }
...\ No newline at end of file ...\ No newline at end of file
1 <template> 1 <template>
2 <div style="margin:40px"> 2 <div style="margin:40px">
3 - <el-form :inline="true" :model="formInline" class="demo-form-inline"> 3 + <el-form :inline="true" :model="queryParams" class="demo-form-inline">
4 <el-form-item label="航班号"> 4 <el-form-item label="航班号">
5 - <el-input v-model="formInline.flyNum" placeholder="航班号"></el-input> 5 + <el-input v-model="queryParams.purposeOfFlightNo" placeholder="航班号"></el-input>
6 </el-form-item> 6 </el-form-item>
7 <el-form-item> 7 <el-form-item>
8 - <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> 8 + <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
9 </el-form-item> 9 </el-form-item>
10 </el-form> 10 </el-form>
11 <el-button style="margin-bottom:20px" type="primary" icon="el-icon-plus">添加</el-button> 11 <el-button style="margin-bottom:20px" type="primary" icon="el-icon-plus">添加</el-button>
12 <el-table 12 <el-table
13 :data="flyList" 13 :data="flyList"
14 style="width: 800px" 14 style="width: 800px"
15 + v-loading="loading"
15 > 16 >
16 <el-table-column 17 <el-table-column
17 - prop="flyNum" 18 + prop="purposeOfFlightNo"
18 - label="航班号" 19 + label="航班号">
19 - >
20 </el-table-column> 20 </el-table-column>
21 <el-table-column 21 <el-table-column
22 - label="操作" 22 + label="操作">
23 - > 23 + <el-link type="primary">查看</el-link>
24 + <el-divider direction="vertical"></el-divider>
25 + <el-link type="primary">修改</el-link>
26 + <el-divider direction="vertical"></el-divider>
27 + <el-link type="primary">删除</el-link>
28 + <el-divider direction="vertical"></el-divider>
29 + <el-link type="primary">启用</el-link>
30 + <el-divider direction="vertical"></el-divider>
31 + <el-link type="primary">停用</el-link>
24 </el-table-column> 32 </el-table-column>
25 </el-table> 33 </el-table>
26 <el-pagination 34 <el-pagination
27 - @size-change="handleSizeChange" 35 + @size-change="getList"
28 - @current-change="handleCurrentChange" 36 + @current-change="getList"
29 - :current-page="currentPage" 37 + :current-page.sync="curPage"
30 :page-sizes="[10, 20, 30, 40]" 38 :page-sizes="[10, 20, 30, 40]"
31 - :page-size="10" 39 + :page-size.sync="limit"
32 layout="prev, pager, next, jumper, sizes, total" 40 layout="prev, pager, next, jumper, sizes, total"
33 :total="total" 41 :total="total"
34 background 42 background
...@@ -38,33 +46,44 @@ ...@@ -38,33 +46,44 @@
38 </template> 46 </template>
39 47
40 <script> 48 <script>
49 + import {
50 + findFlightNo
51 + } from "@/api/destinationFlight";
52 +
41 export default { 53 export default {
42 data() { 54 data() {
43 return { 55 return {
44 - formInline: { 56 + queryParams: {
45 - flyNum: '' 57 + purposeOfFlightNo: '',
58 + start:0,
59 + limit:10
46 }, 60 },
47 flyList:[], 61 flyList:[],
48 - currentPage:1, 62 + curPage:1,
49 - total:0 63 + limit:10,
64 + total:0,
65 + loading:false,
50 } 66 }
51 }, 67 },
52 methods: { 68 methods: {
53 - onSubmit() { 69 + getList(){
54 - console.log('submit!'); 70 + this.queryParams.limit = this.limit;
55 - }, 71 + if (this.curPage > 1) {
56 - handleSizeChange(val) { 72 + this.queryParams.start = (this.curPage - 1) * this.queryParams.limit
57 - console.log(`每页 ${val} 条`); 73 + }else {
58 - }, 74 + this.queryParams.start = 0;
59 - handleCurrentChange(val) { 75 + }
60 - console.log(`当前页: ${val}`); 76 + this.loading = true;
61 - }, 77 + findFlightNo(this.queryParams).then(response => {
62 - getAll(){ 78 + this.flyList = response.data.list;
79 + this.total = response.data.totalCount;
80 + this.loading = false;
81 + });
63 82
64 } 83 }
65 }, 84 },
66 - created:{ 85 + created() {
67 - 86 + this.getList();
68 } 87 }
69 } 88 }
70 </script> 89 </script>
......