审查视图

src/views/airtransport/queryFlight.vue 9.8 KB
小范 authored
1 2 3 4 5 6 7 8
<template>
    <el-container>
        <el-main>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">航班查询</div>
                </el-col>
            </el-row>
小范 authored
9
            <!--            搜索区域-->
小范 authored
10 11 12
            <el-row>
                <el-form :label-position="labelPosition" :model="queryFlight" :rules="rules" ref="queryFlight"
                         label-width="130px" class="demo-ruleForm">
小范 authored
13 14 15
                    <el-col :span="7" style="margin-left: 10px">
                        <el-form-item label="航班号:" prop="flightNo">
                            <el-input v-model="queryFlight.flightNo" style="width:180px;margin-left: -60px"></el-input>
小范 authored
16 17
                        </el-form-item>
                    </el-col>
小范 authored
18 19 20
                    <el-col :span="7">
                        <el-form-item label="航空公司代码:" prop="aircraftNo" label-width="110px">
                            <el-input v-model="queryFlight.aircraftNo" style="width:180px"></el-input>
小范 authored
21 22
                        </el-form-item>
                    </el-col>
小范 authored
23
                    <el-col :span="3" >
小范 authored
24
                        <el-button type="primary" @click="submitForm()">查询</el-button>
小范 authored
25 26 27
                    </el-col>
                </el-form>
            </el-row>
小范 authored
28
            <!--            表单区域-->
小范 authored
29 30 31 32
            <el-row>
                <el-table
                        :data="tableData"
                        border
小范 authored
33
                        height="500"
小范 authored
34
                        v-loading="tableloading"
小范 authored
35 36 37 38 39 40 41 42 43 44 45 46 47 48
                        style="width: 100%;margin-bottom: 10px">
                    <el-table-column
                            fixed="left"
                            label="操作"
                            width="100">
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    type="primary"
                                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                        </template>
                    </el-table-column>
                    <el-table-column
                            prop="flightNo"
xudada authored
49
                            label="航班号">
小范 authored
50 51 52
                    </el-table-column>
                    <el-table-column
                            prop="airwayCode"
小范 authored
53 54
                            label="航空公司代码"
                            width="150">
小范 authored
55 56 57
                    </el-table-column>
                    <el-table-column
                            prop="flightDate"
小范 authored
58 59
                            label="航空公司中文"
                            width="150">
小范 authored
60 61 62
                    </el-table-column>
                    <el-table-column
                            prop="transportAgentCode"
小范 authored
63 64
                            label="传输代理人"
                            width="120">
小范 authored
65 66 67
                    </el-table-column>
                    <el-table-column
                            prop="groundAgentCode"
小范 authored
68 69
                            label="地面代理人"
                            width="120">
小范 authored
70 71
                    </el-table-column>
                    <el-table-column
小范 authored
72
                            prop="linesType"
xudada authored
73
                            label="运输计划">
小范 authored
74 75 76
                    </el-table-column>
                    <el-table-column
                            prop="flightType"
xudada authored
77
                            label="航班性质">
小范 authored
78 79 80
                    </el-table-column>
                    <el-table-column
                            prop="shareFlightNo"
小范 authored
81 82
                            label="共享航班号"
                            width="120">
小范 authored
83 84 85
                    </el-table-column>
                    <el-table-column
                            prop="statusMsg"
小范 authored
86
                            label="海关回执">
小范 authored
87 88
                    </el-table-column>
                    <el-table-column
xudada authored
89
                            fixed="right"
小范 authored
90
                            prop=""
小范 authored
91
                            label="报文操作"
小范 authored
92
                            width="200">
小范 authored
93 94 95
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
小范 authored
96 97
                                    type="primary"
                                    @click="selectDetail(scope.$index,scope.row)">查看回执</el-button>
小范 authored
98 99 100 101 102 103 104 105 106 107 108 109 110 111
                            <el-button
                                    size="mini"
                                    type="danger"
                                    @click="handleDel(scope.$index, scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
            <el-row>
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
小范 authored
112 113
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
小范 authored
114
                            layout="total, sizes, prev, pager, next, jumper"
小范 authored
115
                            :total="total">
小范 authored
116 117 118
                    </el-pagination>
                </div>
            </el-row>
小范 authored
119 120 121 122 123 124 125 126 127 128
            <!--查看回执弹框-->
            <el-dialog title="回执明细" :visible.sync="dialogTableVisible">
                <el-table :data="gridData">
                    <el-table-column property="sendtime" label="操作时间" ></el-table-column>
                    <el-table-column property="createBy" label="操作人" ></el-table-column>
                    <el-table-column property="flightNo" label="航班号"></el-table-column>
                    <el-table-column property="flightDate" label="航班日期" ></el-table-column>
                    <el-table-column property="receiptContent" label="回执内容" ></el-table-column>
                </el-table>
            </el-dialog>
小范 authored
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
        </el-main>
    </el-container>
</template>
<style scoped>
    .grid-content {
        height: 36px;
        line-height: 36px;
    }
    .el-dialog__body{text-align: center}
    .content {
        border-left: 4px #409EFF solid;
        padding-left: 10px;
        background-color: #f9fafc;
        margin-bottom: 2px
    }

    .row-bg{
        background-color: white;
    }
小范 authored
148
小范 authored
149 150
</style>
<script>
小范 authored
151
    import {editFlight, selectFlight, selectReturnMsg} from "../../api/transport";
小范 authored
152
小范 authored
153 154 155 156 157 158 159
    export default {
        data(){
            return{
                queryFlight:{
                    flightNo:undefined,
                    aircraftNo:undefined,
                },
小范 authored
160 161 162
                rules:{

                },
小范 authored
163
                labelPosition:'left',
小范 authored
164 165 166 167
                currentPage: 1,
                pageSize:10,
                total:0,
                tableData:[],
小范 authored
168 169 170
                tableloading:false,
                gridData:[],
                dialogTableVisible: false,
小范 authored
171 172 173
            }
        },
        methods: {
小范 authored
174 175 176 177 178 179 180 181 182 183 184
            //查询回执列表
            selectDetail(index,row){
                this.gridData=[];
                this.dialogTableVisible=true;
                let params={messageid:row.messageid};
                selectReturnMsg(params).then(res=>{
                    let response=res.data.data;
                    console.log(response)
                    this.gridData=response;
                });
            },
小范 authored
185
            //分页方法
小范 authored
186
            handleSizeChange(val) {
小范 authored
187
                this.pageSize=val;
小范 authored
188 189
            },
            handleCurrentChange(val) {
小范 authored
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
                this.currentPage=val;
            },
            //获取航班列表
            submitForm(){
                let params={currentPage:this.currentPage,pageSize:this.pageSize,flightNo:this.queryFlight.flightNo,aircraftNo:this.queryFlight.aircraftNo};
                this.tableloading=true;
                selectFlight(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
                    this.tableloading=false;
                    this.total=response.total;
                });
            },
            //编辑航班查询功能
            handleEdit(index,row){
小范 authored
205
                this.$router.push({path:'/flights',query:row})
小范 authored
206 207 208
            },
            //获取默认值
             defaultData(){
小范 authored
209 210 211
                 Object.assign(this.queryFlight, this.$route.query);
                 // this.flightNo = JSON.parse(this.$route.query.flightNo);
                 // this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
小范 authored
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
             },
            //列表删除功能
            handleDel(index,row){
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    editFlight(row).then(res=>{
                        let response=res.data;
                        if(response.code=='200'){
                            this.$message({
                                type: 'info',
                                message: '删除成功'
                            });
                            this.submitForm();
                        }else{
                            this.$message({
                                type: 'info',
                                message: '删除失败'
                            });                            }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
小范 authored
240 241
            }
        },
小范 authored
242 243 244 245 246
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
小范 authored
247
    }
小范 authored
248
</script>