queryAircraft.vue
9.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<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="queryAircraft" :rules="rules" ref="queryAircraft"
label-width="130px" class="demo-ruleForm">
<el-col :span="8">
<el-form-item label="航空器所有人代码:" prop="airwayCode" label-width="130px">
<el-input v-model="queryAircraft.airwayCode" style="width:190px"></el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="航空器注册号:" prop="aircraftNo" label-width="110px">
<el-input v-model="queryAircraft.aircraftNo" style="width:190px"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-button type="primary" @click="submitForm('queryBill')">查询</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=airwayCode"
label="航空器所有人代码"
width="120">
</el-table-column>
<el-table-column
prop="airwayNameEn"
label="所有人英文名称"
width="120">
</el-table-column>
<el-table-column
prop="airwayNameCn"
label="所有人中文名称"
width="150">
</el-table-column>
<el-table-column
prop="aircraftNo"
label="航空器注册编号"
width="120">
</el-table-column>
<el-table-column
prop="certNo"
label="国际证书编号"
width="120">
</el-table-column>
<el-table-column
prop="ownerCo"
label="航空器所有人"
width="120">
</el-table-column>
<el-table-column
prop="areoNationality"
label="国籍"
width="80">
</el-table-column>
<el-table-column
prop="areoModel"
label="机型"
width="80">
</el-table-column>
<el-table-column
prop="deliverDate"
label="交付日期"
width="120">
</el-table-column>
<el-table-column
prop="statusMsg"
label="海关回执"
width="120">
</el-table-column>
<el-table-column
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 {selectAircraft, editAircraft} from "../../api/transport";
export default {
data(){
return{
queryAircraft:{
airwayCode:undefined,
aircraftNo:undefined,
},
rules:{},
labelPosition:'left',
currentPage: 1,
pageSize:10,
total:0,
tableData:[],
tableloading:false
}
},
methods: {
//分页
handleSizeChange(val) {
this.pageSize=val;
},
handleCurrentChange(val) {
this.currentPage=val;
this.submitForm();
},
//获取通用航空器列表
submitForm() {
let params = {
currentPage: this.currentPage, pageSize: this.pageSize, airwayCode: this.queryAircraft.airwayCode,
aircraftNo: this.queryAircraft.aircraftNo
};
this.tableloading = true;
selectAircraft(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(() => {
editAircraft(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.airwayCode = JSON.parse(this.$route.query.airwayCode);
this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
},
//编辑通用航空器
handleEdit(index,row){
this.$router.push({path:'/aircraft',query: row})
},
//渲染方法
mounted(){
this.defaultData();
this.submitForm();
}
},
}
</script>