审查视图

src/views/airtransport/queryRoute.vue 8.5 KB
xudada authored
1 2 3 4 5 6 7 8 9
<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>
xudada authored
10
                <el-form :model="queryRoute" ref="serialNo" label-width="130px" >
小范 authored
11
                    <el-col :span="6">
小范 authored
12
                        <el-form-item label="航线序号" prop="serialNo" label-width="130px">
小范 authored
13 14 15 16 17 18 19
                            <el-input v-model="queryRoute.serialNo" placeholder="请输入"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="3">   <el-button type="primary" @click="submitForm()">查 询</el-button></el-col>

                </el-form>
xudada authored
20 21
            </el-row>
            <el-row>
xudada authored
22
                <el-col :span="24">
xudada authored
23 24 25
                    <el-table
                            :data="tableData"
                            border
xudada authored
26 27
                            v-loading="tableloading"
                            style="width:100%;margin-bottom: 10px">
xudada authored
28 29
                        <el-table-column
                                fixed="left"
小范 authored
30
                                label="操作">
xudada authored
31 32 33 34
                            <template slot-scope="scope">
                                <el-button
                                        size="mini"
                                        type="primary"
xudada authored
35
                                        @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
xudada authored
36 37 38 39
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="serialNo"
小范 authored
40
                                label="航线序号">
xudada authored
41 42 43
                        </el-table-column>
                        <el-table-column
                                prop="departurePort"
小范 authored
44
                                label="出发港">
xudada authored
45 46 47 48
                        </el-table-column>
                        <el-table-column
                                prop="departureCustomNo"
                                label="出发港关区代码"
小范 authored
49
                                width="120">
xudada authored
50 51 52
                        </el-table-column>
                        <el-table-column
                                prop="arrivalPort"
小范 authored
53
                                label="目的港">
xudada authored
54 55 56 57
                        </el-table-column>
                        <el-table-column
                                prop="arrivalCustomNo"
                                label="目的港关区代码"
小范 authored
58
                                width="120">
xudada authored
59 60 61
                        </el-table-column>
                        <el-table-column
                                prop="std"
小范 authored
62
                                label="长期离港时间">
xudada authored
63 64 65
                        </el-table-column>
                        <el-table-column
                                prop="sta"
小范 authored
66
                                label="长期抵港时间">
xudada authored
67 68 69 70
                        </el-table-column>
                        <el-table-column
                                prop="effStartdate"
                                label="有效期起始时间"
小范 authored
71
                                width="120">
xudada authored
72 73 74 75
                        </el-table-column>
                        <el-table-column
                                prop="effEnddate"
                                label="有效期结束时间"
小范 authored
76
                                width="120">
xudada authored
77 78 79
                        </el-table-column>
                        <el-table-column
                                prop="plan"
小范 authored
80
                                label="每周执行情况">
xudada authored
81 82
                        </el-table-column>
                        <el-table-column
小范 authored
83
                                fixed="right"
xudada authored
84 85
                                prop="remark"
                                label="报文操作"
小范 authored
86
                                width="200">
xudada authored
87 88 89 90
                            <template slot-scope="scope">
                                <el-button
                                        size="mini"
                                        type="primary"
xudada authored
91 92 93
                                        @click="handleDetail(scope.$index, scope.row)">查看明细</el-button>
                                <el-button
                                        size="mini"
小范 authored
94
                                        type="danger"
xudada authored
95
                                        @click="handleDelete(scope.$index, scope.row)">删除</el-button>
xudada authored
96 97 98
                            </template>
                        </el-table-column>
                    </el-table>
xudada authored
99
                </el-col>
xudada authored
100
            </el-row>
小范 authored
101 102 103 104 105 106
            <el-row>
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
xudada authored
107 108
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="pageSize"
小范 authored
109
                            layout="total, sizes, prev, pager, next, jumper"
xudada authored
110
                            :total="total">
小范 authored
111 112 113
                    </el-pagination>
                </div>
            </el-row>
xudada authored
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
        </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>
xudada authored
135 136
    import {editRoute, selectRoute} from "../../api/transport";
xudada authored
137 138 139
    export default {
        data(){
            return{
小范 authored
140 141 142
                queryRoute:{
                    serialNo:undefined,
                },
小范 authored
143
                labelPosition:'left',
xudada authored
144 145 146 147
                currentPage: 1,
                pageSize:10,
                total:0,
                tableData:[],
小范 authored
148
                tableloading:false,
小范 authored
149 150 151
            }
        },
        methods: {
xudada authored
152
            //分页方法
小范 authored
153
            handleSizeChange(val) {
xudada authored
154
                this.pageSize=val;
小范 authored
155 156
            },
            handleCurrentChange(val) {
xudada authored
157
                this.currentPage=val;
xudada authored
158
                this.submitForm();
xudada authored
159
            },
xudada authored
160 161 162 163
            //查看明细
            handleDetail(index,row){
                console.log(row)
            },
xudada authored
164 165
            //获取航线列表
            submitForm(){
xudada authored
166
                let params={currentPage:this.currentPage,pageSize:this.pageSize,serialNo:this.queryRoute.serialNo};
xudada authored
167 168 169 170 171 172 173 174 175 176
                this.tableloading=true;
                selectRoute(params).then(res=>{
                    let response=res.data.data;
                    this.tableData=response.list;
                    this.tableloading=false;
                    this.total=response.total;
                     });
                },
            //编辑航线功能
            handleEdit(index,row){
xudada authored
177
                this.$router.push({path:'/route',query:row})
xudada authored
178 179 180
            },
            //获取默认值
            defaultData(){
小范 authored
181
                Object.assign(this.queryRoute, this.$route.query);
xudada authored
182 183 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 209
            },
            //列表删除功能
            handleDelete(index,row){
                    this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        editRoute(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: '已取消删除'
                        });
                    });
xudada authored
210 211
            }
        },
xudada authored
212 213 214 215 216
        //渲染方法
        mounted(){
            this.defaultData();
            this.submitForm();
        }
xudada authored
217 218
    }
</script>