审查视图

src/views/nmms_import/OrigFlightList.vue 5.7 KB
1 2 3 4 5 6
<template>
    <el-container>
        <el-main >
            <!--检索条件-->
            <el-row>
                <el-col :span="4">
7
                    <div>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
                        <el-input v-model="carrier" placeholder="">
                            <template slot="prepend">航班号</template>
                        </el-input>
                    </div>
                </el-col>
                <el-col :span="5">
                    <div class="block">
                        <el-date-picker
                                v-model="flighttime"
                                type="date"
                                value-format="yyyy-MM-dd"
                                placeholder="航班日期">
                        </el-date-picker>
                    </div>
                </el-col>
                <el-col :span="2">
                    <div class="grid-content">
                        <el-button type="primary" v-on:click="getFlightList">航班查询</el-button>
                    </div>
                </el-col>
            </el-row>
            <!--TableList-->
            <el-row>
                <template>
                    <el-table
                            :data="tableData"
                            style="width: 100%"
                            :default-sort = "{prop: 'date', order: 'descending'}"
                    >
                        <el-table-column
                                prop="flightno"
                                label="航班号"
                                >
                        </el-table-column>
                        <el-table-column
                                prop="flightdate"
                                label="航班日期"
                               >
                        </el-table-column>
                        <el-table-column
                                prop="originstation"
                                label="始发站"
                                >
                        </el-table-column>
                        <el-table-column
                                prop="destinationstation"
                                label="目的站"
                                >
                        </el-table-column>
                        <el-table-column
                                fixed="right"
                                label="操作"
                                width="200">
                            <template slot-scope="scope">
                                <el-button
                                        size="mini"
                                        type="primary"
                                        @click="handleEdit(scope.$index, scope.row)">原始舱单</el-button>
                                <el-button
                                        size="mini"
                                        type="primary"
                                        @click="handleDelete(scope.$index, scope.row)">进港理货</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </template>
            </el-row>
            <!--分页模块-->
            <el-row style="float: right">
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                </div>
            </el-row>
        </el-main>
    </el-container>

</template>

<script>
    import { selectFlightLists } from '../../api/mt1201'
    export default {
        data() {
            /*初始化值*/
            return {
                carrier:undefined,
                tableData: [],
                flighttime: undefined,
                currentPage:1,
                pageSize:10,
                total:0
            }
        },
        methods: {
            /*设置默认航班时间*/
            getdatatime(){
                this.flighttime=new Date();
            },
            /*分页方法*/
            handleSizeChange(val) {
                this.pageSize=val;
                this.getFlightList();
            },
            handleCurrentChange(val) {
                this.currentPage=val;
                this.getFlightList();
            },
            /*查询列表请求*/
            getFlightList:function() {
                let params={currentPage:this.currentPage,pageSize:this.pageSize,flighttime:this.flighttime,carrier:this.carrier};
                this.listLoading = true;
                selectFlightLists(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
                    this.total=response.total;
                this.listLoading = false;
                });
            },
            /*原始舱单跳转*/
            handleEdit(index, row) {
                this.$router.push({name:'原始舱单',params:{index,row}})
            },
            /*进港理货跳转*/
            handleDelete(index, row) {
                this.$router.push({name:'进港理货',params:{index,row}})
            }
        },
        /*渲染方法*/
        mounted() {
            let that=this;
            that.getdatatime();
            that.getFlightList();
        },
    }
</script>

<style>
    .el-main{padding: 10px 0px 10px 0px;  }
    .el-col{margin-right: 10px;}
</style>