审查视图

src/views/airtransport/queryArrival.vue 13.9 KB
小范 authored
1 2 3 4 5 6 7 8 9 10 11 12
<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="queryArrival" :rules="rules" ref="queryFlight"
                         label-width="130px" class="demo-ruleForm">
13 14
                    <el-col :span="7" >
                        <el-form-item label="航班号:" prop="flightNo" label-width="70px">
小范 authored
15 16 17
                            <el-input v-model="queryArrival.flightNo" style="width:190px"></el-input>
                        </el-form-item>
                    </el-col>
小范 authored
18
                    <el-col :span="7" >
19
                        <el-form-item label="航班日期:" prop="flightDate" label-width="80px">
小范 authored
20 21 22
                            <el-date-picker
                                    v-model="queryArrival.flightDate"
                                    type="date"
小范 authored
23
                                    value-format="yyyyMMdd"
小范 authored
24
                                    style="width:190px"
25 26
                                    placeholder="选择日期"
                                    :picker-options="pickerOptions">
小范 authored
27 28 29 30
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" >
小范 authored
31
                        <el-button type="primary" @click="submitForm()">查询</el-button>
小范 authored
32 33 34 35 36 37 38 39
                    </el-col>
                </el-form>
            </el-row>
            <!--            表单区域-->
            <el-row>
                <el-table
                        :data="tableData"
                        border
小范 authored
40
                        height="500"
小范 authored
41
                        v-loading="tableloading"
小范 authored
42 43 44 45 46 47 48 49 50 51 52 53 54 55
                        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
56
                            label="航班号">
小范 authored
57 58 59 60 61 62 63 64
                    </el-table-column>
                    <el-table-column
                            prop="flightDate"
                            label="航班日期"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            prop="aircraftNo"
65
                            label="航空器注册码">
小范 authored
66 67 68
                    </el-table-column>
                    <el-table-column
                            prop="departurePort"
小范 authored
69
                            label="出发港">
小范 authored
70 71 72
                    </el-table-column>
                    <el-table-column
                            prop="arrivalPort"
小范 authored
73
                            label="目的港">
小范 authored
74 75 76
                    </el-table-column>
                    <el-table-column
                            prop="customDistrictNo"
小范 authored
77
                            label="关区代码">
小范 authored
78
                    </el-table-column>
79 80 81 82
<!--                    <el-table-column-->
<!--                            prop="transportflag"-->
<!--                            label="运输计划">-->
<!--                    </el-table-column>-->
小范 authored
83 84 85
                    <el-table-column
                            prop="departuredatetime"
                            label="离港时间"
86
                            width="150">
小范 authored
87 88 89
                    </el-table-column>
                    <el-table-column
                            prop="statusMsg"
90 91 92
                            label="海关回执"
                            width="120"
                    show-overflow-tooltip>
小范 authored
93 94
                    </el-table-column>
                    <el-table-column
小范 authored
95
                            fixed="right"
小范 authored
96
                            prop=""
小范 authored
97
                            label="报文操作"
98
                            width="280">
小范 authored
99 100 101
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
小范 authored
102 103
                                    type="primary"
                                    @click="selectDetail(scope.$index,scope.row)">查看回执</el-button>
小范 authored
104 105
                            <el-button
                                    size="mini"
106 107 108 109
                                    type="warning"
                                    @click="trans_cancle(scope.row)">取消申报</el-button>
                            <el-button
                                    size="mini"
小范 authored
110 111 112 113 114 115 116 117 118 119 120
                                    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"
121
                            :current-page="pageNum"
小范 authored
122 123
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
小范 authored
124
                            layout="total, sizes, prev, pager, next, jumper"
小范 authored
125
                            :total="total">
小范 authored
126 127 128
                    </el-pagination>
                </div>
            </el-row>
小范 authored
129 130 131
            <!--查看回执弹框-->
            <el-dialog title="回执明细" :visible.sync="dialogTableVisible">
                <el-table :data="gridData">
132
                    <el-table-column property="sendtime" label="操作时间"></el-table-column>
小范 authored
133 134
                    <el-table-column property="createBy" label="操作人" ></el-table-column>
                    <el-table-column property="flightNo" label="航班号"></el-table-column>
135 136
                    <el-table-column property="flightDate" label="航班日期"></el-table-column>
                    <el-table-column property="receiptContent" label="回执内容"></el-table-column>
小范 authored
137 138
                </el-table>
            </el-dialog>
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
<!--            取消申报弹框-->
            <el-dialog title="取消申报" :visible.sync="dialogFormVisible">
                <el-form :model="form">
                    <el-form-item label="取消原因" prop="content" >
                        <el-input
                                v-model="form.content"
                                type="textarea"
                                :rows="2" required="required"
                                placeholder="取消原因必填"
                        />
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click="trans_add('form')">确 定</el-button>
                </div>
            </el-dialog>
小范 authored
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
        </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>
178
    import {addAircraftStaying, editPrediction, selectPrediction, selectReturnMsg, cancelPrediction} from "../../api/transport";
179
    import loginUserInfo from "../../api/base";
小范 authored
180
小范 authored
181 182 183
    export default {
        data(){
            return{
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
                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
209 210 211 212
                queryArrival:{
                    flightNo:undefined,
                    flightDate:undefined,
                },
小范 authored
213
                rules: {},
小范 authored
214
                labelPosition:'left',
215
                pageNum: 1,
小范 authored
216 217 218
                pageSize:10,
                total:0,
                tableData:[],
小范 authored
219 220 221
                tableloading:false,
                gridData:[],
                dialogTableVisible: false,
222 223 224 225 226 227 228
                form:{
                    content:''
                },
                dialogFormVisible: false,
                textarea: '',
                row2:undefined
小范 authored
229 230 231
            }
        },
        methods: {
小范 authored
232 233 234 235
            //查询回执列表
            selectDetail(index,row){
                this.gridData=[];
                this.dialogTableVisible=true;
236
                console.log(row.messageid)
小范 authored
237 238 239
                let params={messageid:row.messageid};
                selectReturnMsg(params).then(res=>{
                    let response=res.data.data;
240
                    //console.log(response)
小范 authored
241 242 243
                    this.gridData=response;
                });
            },
244 245
            //取消申报
            trans_cancle(row){
246
                console.log(row)
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
                this.dialogFormVisible=true;
                this.row2=row;
            },
            trans_add(form) {
                this.dialogFormVisible=true;
                this.row2.content=this.form.content;
                console.log(this.row2);
                // 进行表单的预验证
                // this.$refs.form.validate(valid => {
                //     // 未通过,表单预校验
                //     if (!valid) return

                cancelPrediction(this.row2).then((response) => {
                        const res = response.data
                        // 添加失败
                        if (res.code !== '200') {
                            // 关闭加载
                            return this.$message.error(res.msg)
                        }
                        // 添加,成功
                        this.$message.success(res.msg)
                        // 隐藏对话框
                        this.dialogFormVisible = false
                        // 刷新列表
                        this.submitForm()
                    }).catch(error => {
                        this.$message.error(error.toString())
                    })
                // })
            },
小范 authored
277
            //分页
小范 authored
278
            handleSizeChange(val) {
小范 authored
279
                this.pageSize=val;
小范 authored
280 281
            },
            handleCurrentChange(val) {
282
                this.pageNum=val;
小范 authored
283 284 285 286 287
                this.submitForm();
            },
            //获取进港预报查询列表
            submitForm() {
                let params = {
288
                    pageNum: this.pageNum, pageSize: this.pageSize, flightNo: this.queryArrival.flightNo,
289
                    flightDate: this.queryArrival.flightDate,accessFlag:'0'
小范 authored
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
                };
                this.tableloading = true;
                selectPrediction(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(() => {
                    editPrediction(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() {
小范 authored
330 331 332
                Object.assign(this.queryArrival, this.$route.query);
                // this.flightNo = JSON.parse(this.$route.query.flightNo);
                // this.flightDate = JSON.parse(this.$route.query.flightDate);
小范 authored
333 334 335 336 337 338
            },
            //编辑进港预报
            handleEdit(index,row){
                this.$router.push({path:'/arrival',query: row})
            },
小范 authored
339
        },
小范 authored
340 341 342 343 344
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
小范 authored
345
    }
小范 authored
346
</script>