审查视图

src/views/nmms_import/OrigFlightList.vue 8.0 KB
1 2 3 4
<template>
    <el-container>
        <el-main >
            <!--检索条件-->
5 6 7 8 9 10
            <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
                <el-col :span="6">
                    <template>
                        航班号
                    </template>
                        <el-input v-model="vcarrier" placeholder="航班号" style="width: 150px">
11 12
                        </el-input>
                </el-col>
13 14 15 16
                <el-col :span="6">
                    <template>
                        航班日期
                    </template>
17 18 19 20
                        <el-date-picker
                                v-model="flighttime"
                                type="date"
                                value-format="yyyy-MM-dd"
朱兆平 authored
21 22 23
                                placeholder="航班日期"
                                :picker-options="dataPickerOptions"
                                style="width: 150px">
24 25
                        </el-date-picker>
                </el-col>
26 27
                <el-col :span="3">
                        <el-button type="primary" v-on:click="getFlightList">查询</el-button>
28 29 30 31 32 33
                </el-col>
            </el-row>
            <!--TableList-->
            <el-row>
                <template>
                    <el-table
xudada authored
34
                            v-loading="tableloading"
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
                            :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"
70
                                        type="success"
71 72 73 74 75 76 77
                                        @click="handleDelete(scope.$index, scope.row)">进港理货</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </template>
            </el-row>
            <!--分页模块-->
78
            <el-row style="float: right;margin-top: 20px">
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
                <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>
xudada authored
95 96 97 98 99
<style scoped>
    .el-input-group{
        display: table;
    }
</style>
100 101 102

<script>
    import { selectFlightLists } from '../../api/mt1201'
103
    import {mapActions, mapGetters} from 'vuex'
104
    import {loginedUserInfo} from "../../api/user";
105
    export default {
106
        name:'Orig',
107 108 109
        data() {
            /*初始化值*/
            return {
110
                carrier:'',
111 112 113 114
                tableData: [],
                flighttime: undefined,
                currentPage:1,
                pageSize:10,
xudada authored
115
                total:0,
116
                tableloading:true,
朱兆平 authored
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
                departmentid:'',
                dataPickerOptions: {
                    shortcuts: [{
                        text: '今天',
                        onClick(picker) {
                            picker.$emit('pick', new Date());
                        }
                    }, {
                        text: '昨天',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24);
                            picker.$emit('pick', date);
                        }
                    }, {
                        text: '一周前',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', date);
                        }
                    }]
                }
140 141
            }
        },
142 143 144 145
        mounted() {
            this.getdatatime();
            this.getFlightList();
        },
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
        methods: {
            /*设置默认航班时间*/
            getdatatime(){
                this.flighttime=new Date();
            },
            /*分页方法*/
            handleSizeChange(val) {
                this.pageSize=val;
                this.getFlightList();
            },
            handleCurrentChange(val) {
                this.currentPage=val;
                this.getFlightList();
            },
            /*查询列表请求*/
            getFlightList:function() {
162 163 164 165 166 167 168
                let params={
                    currentPage:this.currentPage,
                    pageSize:this.pageSize,
                    flighttime:this.flighttime,
                    carrier:this.carrier,
                    departmentid:loginedUserInfo().companyInfo.departmentid
                };
169 170 171 172
                this.listLoading = true;
                selectFlightLists(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
xudada authored
173
                    this.tableloading=false;
174
                    this.total=response.total;
175 176 177
                }).catch(e=>{

                }).finally(()=>{
178
                    this.listLoading = false;
179 180 181 182
                });
            },
            /*原始舱单跳转*/
            handleEdit(index, row) {
183
                // row.waybillType = 'MT1201'
184 185 186 187 188 189
                this.$router.push(
                        {
                            path:'/enter',
                            query:row
                        }
                    )
190 191 192
            },
            /*进港理货跳转*/
            handleDelete(index, row) {
193 194 195 196 197 198 199
                // row.waybillType = 'MT5201'
                this.$router.push(
                    {
                    path:'entertall',
                    query:row
                }
                    )
200 201
            }
        },
202 203 204 205 206 207 208 209
        computed:{
            vcarrier:{
                get:function () {
                    return this.carrier;
                },
                set:function (val) {
                    this.carrier=val.toUpperCase();
                }
210 211
            },
            ...mapGetters(['getUserInfoStore','getUserMenuStore']) // 动态计算属性,相当于this.$store.getters.resturantName
212
        },
213
        /*渲染方法*/
214
        activated() {
215
            let that=this;
216
217 218 219 220 221 222 223
        },
    }
</script>

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