审查视图

src/views/airtransport/queryFlightplan.vue 12.1 KB
小范 authored
1 2 3 4 5 6 7 8 9 10
<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>
小范 authored
11
                <el-form :label-position="labelPosition" :model="queryFlightplan"  ref="queryFlightplan"
小范 authored
12
                         label-width="130px" class="demo-ruleForm">
小范 authored
13 14 15
                    <el-col :span="6" style="margin-left: 10px">
                        <el-form-item label="承运人:" prop="awcd" label-width="70px">
                            <el-input v-model="queryFlightplan.awcd" style="width:190px"></el-input>
小范 authored
16 17 18 19 20 21 22 23 24 25 26 27 28
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="航班号:" prop="flightNo" label-width="70px">
                            <el-input v-model="queryFlightplan.flightNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="6" >
                        <el-form-item label="航班日期:" prop="flightDate" label-width="80px">
                            <el-date-picker
                                    v-model="queryFlightplan.flightDate"
                                    type="date"
小范 authored
29
                                    format="yyyyMMdd"
xudada authored
30
                                    value-format="yyyyMMdd"
小范 authored
31
                                    style="width:190px"
32 33
                                    placeholder="选择日期"
                                    :picker-options="pickerOptions">
小范 authored
34 35 36 37 38 39 40 41 42 43 44 45 46
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="4" >
                        <el-button type="primary" @click="submitForm('queryFlightplan')">查询</el-button>
                    </el-col>
                </el-form>
            </el-row>
            <!--            表单区域-->
            <el-row>
                <el-table
                        :data="tableData"
                        border
小范 authored
47
                        height="500"
小范 authored
48 49 50 51 52 53 54 55 56 57 58 59 60 61
                        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"
小范 authored
62 63
                            label="航班号"
                            width="120">
小范 authored
64 65 66
                    </el-table-column>
                    <el-table-column
                            prop="flightDate"
小范 authored
67 68
                            label="航班日期"
                    width="120">
小范 authored
69 70 71
                    </el-table-column>
                    <el-table-column
                            prop="departurePort"
小范 authored
72
                            label="出发港">
小范 authored
73 74 75
                    </el-table-column>
                    <el-table-column
                            prop="departureCustomNo"
小范 authored
76
                            label="关区代码">
小范 authored
77 78 79
                    </el-table-column>
                    <el-table-column
                            prop="arrivalPort"
小范 authored
80
                            label="目的港">
小范 authored
81 82 83
                    </el-table-column>
                    <el-table-column
                            prop="arrivalCustomNo"
小范 authored
84
                            label="关区代码">
小范 authored
85 86 87 88
                    </el-table-column>
                    <el-table-column
                            prop="currentTakeoffTime"
                            label="离港时间"
小范 authored
89
                            width="120">
小范 authored
90 91 92 93
                    </el-table-column>
                    <el-table-column
                            prop="currentLandingTime"
                            label="抵港时间"
小范 authored
94
                            width="120">
小范 authored
95 96 97
                    </el-table-column>
                    <el-table-column
                            prop="transportflag"
小范 authored
98
                            label="进出港">
小范 authored
99 100 101
                    </el-table-column>
                    <el-table-column
                            prop="linesType"
小范 authored
102 103
                            label="执行任务类型"
                            width="120">
小范 authored
104 105 106
                    </el-table-column>
                    <el-table-column
                            prop="statusMsg"
107 108
                            label="海关回执"
                    show-overflow-tooltip>
小范 authored
109 110
                    </el-table-column>
                    <el-table-column
小范 authored
111
                            fixed="right"
小范 authored
112 113
                            prop=""
                            label="报文操作"
小范 authored
114
                            width="200">
小范 authored
115 116 117
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
小范 authored
118
                                    type="primary"
小范 authored
119
                                    @click="selectDetail(scope.$index,scope.row)">查看回执</el-button>
小范 authored
120 121 122 123 124 125 126 127 128 129 130 131 132 133
                            <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
134 135
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
小范 authored
136
                            layout="total, sizes, prev, pager, next, jumper"
小范 authored
137
                            :total="total">
小范 authored
138 139 140
                    </el-pagination>
                </div>
            </el-row>
小范 authored
141 142 143
            <!--            查看回执弹框-->
            <el-dialog title="回执明细" :visible.sync="dialogTableVisible">
                <el-table :data="gridData">
144
                    <el-table-column property="createTime" label="操作时间" fixed="left" width="150"></el-table-column>
小范 authored
145 146 147
                    <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>
148
                    <el-table-column property="receiptContent" label="回执内容" show-overflow-tooltip fixed="right" width="300"></el-table-column>
小范 authored
149 150
                </el-table>
            </el-dialog>
小范 authored
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
        </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>
小范 authored
173
    import {selectFlightPlan, editFlightPlan, selectReturnMsg} from "../../api/transport";
174 175
    import loginUserInfo from '@/api/base.js'
小范 authored
176 177 178
    export default {
        data(){
            return{
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
                pickerOptions: {
                    disabledDate(time) {
                        return time.getTime() > Date.now();
                    },
                    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);
                            picker.$emit('pick', date);
                        }
                    }]
                },
小范 authored
204
                queryFlightplan:{
小范 authored
205 206
                    flightNo:'',
                    flightDate:'',
小范 authored
207
                    aircraftNo:undefined,
小范 authored
208
                    awcd:''
小范 authored
209 210
                },
                labelPosition:'left',
小范 authored
211 212 213
                currentPage: 1,
                pageSize:10,
                total:0,
小范 authored
214
                tableData: [],
小范 authored
215 216 217
                tableloading:false,
                gridData:[],
                dialogTableVisible: false,
小范 authored
218 219 220
            }
        },
        methods: {
小范 authored
221 222 223 224 225 226 227 228 229 230 231
            //查询回执列表
            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
232 233 234 235 236 237 238 239 240
            //分页
            handleSizeChange(val) {
                this.pageSize=val;
            },
            handleCurrentChange(val) {
                this.currentPage=val;
                this.submitForm();
            },
            //获取当日飞行计划列表
小范 authored
241 242 243
            submitForm() {
                let params = {
                    currentPage: this.currentPage, pageSize: this.pageSize, flightNo: this.queryFlightplan.flightNo,
小范 authored
244
                    awcd: this.queryFlightplan.awcd, flightDate: this.queryFlightplan.flightDate
小范 authored
245
                };
小范 authored
246
                console.log(params)
小范 authored
247
                this.tableloading = true;
小范 authored
248
                selectFlightPlan(params).then(res => {
小范 authored
249
                    let response = res.data.data;
小范 authored
250
                    console.log(response)
小范 authored
251 252 253 254
                    this.tableData = response.list;
                    this.tableloading = false;
                    this.total = response.total;
                });
小范 authored
255
            },
小范 authored
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
            //列表删除功能
            handleDel(index, row) {
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    editFlightPlan(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
286
            defaultData() {
xudada authored
287
                Object.assign(this.queryFlightplan, this.$route.query);
小范 authored
288 289 290 291
            },
            //编辑当日飞行计划
            handleEdit(index,row){
                this.$router.push({path:'/flightplan',query: row})
小范 authored
292
        },
xudada authored
293 294 295 296 297 298 299

      },
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
小范 authored
300 301
    }
</script>