queryFlight.vue 11.1 KB
<template>
    <el-container>
        <el-main>
            <el-row class="row-bg">
                <el-col :span="24">
                    <div class="grid-content content">航班查询</div>
                </el-col>
            </el-row>
            <!--            搜索区域-->
            <el-row>
                <el-form :label-position="labelPosition" :model="queryFlight" :rules="rules" ref="queryFlight"
                         label-width="130px" class="demo-ruleForm">
                    <el-col :span="8" >
                        <el-form-item label="航班号:" prop="aircraftNo" label-width="80px">
                            <el-input v-model="queryFlight.aircraftNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="航空公司代码:" prop="flightNo" label-width="110px">
                            <el-input v-model="queryFlight.flightNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6" >
                        <el-button type="primary" @click="submitForm()">查询</el-button>
                    </el-col>
                </el-form>
            </el-row>
            <!--            表单区域-->
            <el-row>
                <el-table
                        :data="tableData"
                        border
                        v-loading="tableloading"
                        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"
                            label="航班号">
                    </el-table-column>
                    <el-table-column
                            prop="airwayCode"
                            label="航空公司代码">
                    </el-table-column>
                    <el-table-column
                            prop="flightDate"
                            label="航空公司中文">
                    </el-table-column>
                    <el-table-column
                            prop="transportAgentCode"
                            label="传输代理人">
                    </el-table-column>
                    <el-table-column
                            prop="groundAgentCode"
                            label="地面代理人">
                    </el-table-column>
                    <el-table-column
                            prop="linesType"
                            label="运输计划">
                    </el-table-column>
                    <el-table-column
                            prop="flightType"
                            label="航班性质">
                    </el-table-column>
                    <el-table-column
                            prop="shareFlightNo"
                            label="共享航班号">
                    </el-table-column>
                    <el-table-column
                            prop="statusMsg"
                            label="海关回执">
                    </el-table-column>
                    <el-table-column
                            fixed="right"
                            prop=""
                            label="报文操作"
                            width="200">
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    type="primary"
                                    @click="selectDetail(scope.$index,scope.row)">查看回执</el-button>
                            <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"
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                </div>
            </el-row>
            <!--查看回执弹框-->
            <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>
        </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;
    }

</style>
<script>
    import {editFlight, selectFlight, selectReturnMsg} from "../../api/transport";

    export default {
        data(){
            return{
                queryFlight:{
                    flightNo:undefined,
                    aircraftNo:undefined,
                },
                rules:{

                },
                labelPosition:'left',
                currentPage: 1,
                pageSize:10,
                total:0,
                tableData:[],
                tableloading:false,
                gridData:[],
                dialogTableVisible: false,
            }
        },
        methods: {
            //查询回执列表
            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;
                });
            },
            //分页方法
            handleSizeChange(val) {
                this.pageSize=val;
            },
            handleCurrentChange(val) {
                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){
                this.$router.push({path:'/flights',query:{uuid:JSON.stringify(row.uuid),airwayCode:JSON.stringify(row.airwayCode)
                        ,airwayNameEn:JSON.stringify(row.airwayNameEn), airwayNameCn:JSON.stringify(row.airwayNameCn),
                        transportAgentCode:JSON.stringify(row.transportAgentCode),groundAgentCode:JSON.stringify(row.groundAgentCode),
                        flightNo:JSON.stringify(row.flightNo),shareFlightNo:JSON.stringify(row.shareFlightNo),linesType:JSON.stringify(row.linesType),
                        std:JSON.stringify(row.std), sta:JSON.stringify(row.sta),effStartdate:JSON.stringify(row.effStartdate),
                        effEnddate:JSON.stringify(row.effEnddate),plan:JSON.stringify(row.plan), remark:JSON.stringify(row.remark),
                        createTime:JSON.stringify(row.createTime),createBy:JSON.stringify(row.createBy),updateTime:JSON.stringify(row.updateTime),
                        updateBy:JSON.stringify(row.updateBy),isDelete:JSON.stringify(row.isDelete),flightType:JSON.stringify(row.flightType), cancelFlag:JSON.stringify(row.cancelFlag),
                        departurePort:JSON.stringify(row.departurePort),arrivalPort:JSON.stringify(row.arrivalPort),departureCustomNo:JSON.stringify(row.departureCustomNo),
                        arrivalCustomNo:JSON.stringify(row.arrivalCustomNo),serialno:JSON.stringify(row.serialno),status:JSON.stringify(row.status),
                        statusMsg:JSON.stringify(row.statusMsg),messageid:JSON.stringify(row.messageid)
                    }})
            },
            //获取默认值
             defaultData(){
                 Object.assign(this.queryFlight, this.$route.query);
                 // this.flightNo = JSON.parse(this.$route.query.flightNo);
                 // this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
             },
            //列表删除功能
            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: '已取消删除'
                    });
                });
            }
        },
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
    }
</script>