queryBill.vue 11.9 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="queryBill" :rules="rules" ref="queryBill"
                     label-width="130px" class="demo-ruleForm">
                    <el-col :span="5">
                        <el-form-item label="航班号:" prop="flightNo" label-width="70px">
                            <el-input v-model="queryBill.flightNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" >
                        <el-form-item label="航空器注册号:" prop="aircraftNo" label-width="110px">
                            <el-input v-model="queryBill.aircraftNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" >
                        <el-form-item label="航班日期:" prop="flightDate" label-width="80px">
                            <el-date-picker
                                    v-model="queryBill.flightDate"
                                    type="date"
                                    style="width:190px"
                                    placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" >
                        <el-form-item label="进出港:" prop="accessFlag" label-width="70px">
                            <el-input v-model="queryBill.accessFlag" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="3" >
                        <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
                            fixed
                            prop=aircraftNo"
                            label="航空器注册号"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="flightNo"
                            label="航班号"
                            width="80">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="flightDate"
                            label="航班日期"
                            width="150">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="accessFlag"
                            label="进出港标识"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="departureAirport"
                            label="出发港"
                            width="80">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="departuredatetime"
                            label="出发时间"
                            width="150">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="arrivalAirport"
                            label="目的港"
                            width="80">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="arrivaldatetime"
                            label="到达时间"
                            width="150">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="statusMsg"
                            label="海关回执"
                            width="150">
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop=""
                            label="报文操作"
                            width="150">
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    type="success"
                                    @click="handleEdit(scope.$index, scope.row)">查看</el-button>
                        </template>
                        <template slot-scope="scope">
                            <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-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 {editBill,selectBill} from "../../api/transport";

    export default {
        data(){
            return{
                queryBill:{
                    flightNo:undefined,
                    aircraftNo:undefined,
                    flightDate:undefined,
                    accessFlag:undefined,
                },
                tableloading:false,
                rules:{},
                labelPosition:'left',
                currentPage: 1,
                pageSize:10,
                total:0,
                tableData:[]
            }
        },
        methods: {
            //获取单据列表
            submitForm(){
                let params={currentPage:this.currentPage,pageSize:this.pageSize,flightNo:this.queryBill.flightNo,
                    aircraftNo:this.queryBill.aircraftNo,flightDate:this.queryBill.flightDate,accessFlag:this.queryBill.accessFlag};
                this.tableloading=true;
                selectBill(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
                    this.tableloading=false;
                    this.total=response.total;
                });
            },
            //列表删除功能
            handleDel(index,row){
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    editBill(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: '已取消删除'
                    });
                });
            },
            //获取默认值
            defaultData(){
                this.flightNo=JSON.parse(this.$route.query.flightNo);
                this.aircraftNo=JSON.parse(this.$route.query.aircraftNo);
                this.flightDate=JSON.parse(this.$route.query.flightDate);
                this.accessFlag=JSON.parse(this.$route.query.accessFlag);
            },
            //编辑单据查询
            handleEdit(index,row){
                this.$router.push({path:'/bill',query:{uuid:JSON.stringify(row.uuid),aircraftNo:JSON.stringify(row.aircraftNo),flightNo:JSON.stringify(row.flightNo),
                        flightDate:JSON.stringify(row.flightDate),accessFlag:JSON.stringify(row.accessFlag),departureAirport:JSON.stringify(row.departureAirport),
                        departuredatetime:JSON.stringify(row.departuredatetime),departureno:JSON.stringify(row.departureno),arrivalAirport:JSON.stringify(row.arrivalAirport),arrivaldatetime:JSON.stringify(row.arrivaldatetime),
                        arrivalno:JSON.stringify(row.arrivalno),aircrewSum:JSON.stringify(row.aircrewSum),interPassengerSum:JSON.stringify(row.interPassengerSum),localePassengerSum:JSON.stringify(row.localePassengerSum),
                        interBaggageNum:JSON.stringify(row.interBaggageNum),localeBaggageNum:JSON.stringify(row.localeBaggageNum),goodsNum:JSON.stringify(row.goodsNum),goodsQuantity:JSON.stringify(row.goodsQuantity),
                        cargoBillNum:JSON.stringify(row.cargoBillNum),passengerPage:JSON.stringify(row.passengerPage),aircrewBillNum:JSON.stringify(row.aircrewBillNum),aircrewCargoBillNum:JSON.stringify(row.aircrewCargoBillNum),
                        arrivalPosition:JSON.stringify(row.arrivalPosition), bussinessType:JSON.stringify(row.bussinessType),messageid:JSON.stringify(row.messageid),status:JSON.stringify(row.status),statusMsg:JSON.stringify(row.statusMsg),meno:JSON.stringify(row.meno),
                        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), remark:JSON.stringify(row.remark),remark1:JSON.stringify(row.remark1), remark2:JSON.stringify(row.remark2),remark3:JSON.stringify(row.remark3)}})
            },
            //分页
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            }
        },
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
    }
</script>