|
|
1
|
+<template>
|
|
|
2
|
+ <el-container>
|
|
|
3
|
+ <el-main >
|
|
|
4
|
+ <!--检索条件-->
|
|
|
5
|
+ <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
|
|
|
6
|
+ <el-col :span="6">
|
|
|
7
|
+ <template>
|
|
|
8
|
+ 承运人
|
|
|
9
|
+ </template>
|
|
|
10
|
+ <el-input v-model="queryinfo.carrier" placeholder="承运人" style="width: 150px">
|
|
|
11
|
+ </el-input>
|
|
|
12
|
+ </el-col>
|
|
|
13
|
+ <el-col :span="6">
|
|
|
14
|
+ <template>
|
|
|
15
|
+ 航班号
|
|
|
16
|
+ </template>
|
|
|
17
|
+ <el-input v-model="queryinfo.flightno" placeholder="航班号" style="width: 150px">
|
|
|
18
|
+ </el-input>
|
|
|
19
|
+ </el-col>
|
|
|
20
|
+
|
|
|
21
|
+ <el-col :span="8">
|
|
|
22
|
+ <el-button type="primary" v-on:click="getList">查询</el-button>
|
|
|
23
|
+ <el-button type="success" v-on:click="toAddDialog">新增</el-button>
|
|
|
24
|
+
|
|
|
25
|
+ </el-col>
|
|
|
26
|
+ </el-row>
|
|
|
27
|
+ <!--TableList-->
|
|
|
28
|
+ <el-row>
|
|
|
29
|
+ <template>
|
|
|
30
|
+ <el-table
|
|
|
31
|
+ v-loading="tableloading"
|
|
|
32
|
+ :data="tableData"
|
|
|
33
|
+ style="width: 100%"
|
|
|
34
|
+ :default-sort = "{prop: 'date', order: 'descending'}"
|
|
|
35
|
+ >
|
|
|
36
|
+ <el-table-column
|
|
|
37
|
+ prop="carrier"
|
|
|
38
|
+ label="承运人">
|
|
|
39
|
+ </el-table-column>
|
|
|
40
|
+ <el-table-column
|
|
|
41
|
+ prop="flightno"
|
|
|
42
|
+ label="航班号">
|
|
|
43
|
+ </el-table-column>
|
|
|
44
|
+ <el-table-column
|
|
|
45
|
+ prop="originatingstation"
|
|
|
46
|
+ label="起始站">
|
|
|
47
|
+ </el-table-column>
|
|
|
48
|
+ <el-table-column
|
|
|
49
|
+ prop="destinationstation"
|
|
|
50
|
+ label="目的站">
|
|
|
51
|
+ </el-table-column>
|
|
|
52
|
+ <el-table-column
|
|
|
53
|
+ prop="crossdays"
|
|
|
54
|
+ label="跨天天数">
|
|
|
55
|
+ </el-table-column>
|
|
|
56
|
+ <el-table-column
|
|
|
57
|
+ prop="effectivedate"
|
|
|
58
|
+ label="航班计划开始时间">
|
|
|
59
|
+ </el-table-column>
|
|
|
60
|
+ <el-table-column
|
|
|
61
|
+ prop="expirationdate"
|
|
|
62
|
+ label="航班计划结束时间">
|
|
|
63
|
+ </el-table-column>
|
|
|
64
|
+ <el-table-column
|
|
|
65
|
+ prop="schedule"
|
|
|
66
|
+ label="航班计划航班时刻">
|
|
|
67
|
+ </el-table-column>
|
|
|
68
|
+ <el-table-column
|
|
|
69
|
+ prop="remark"
|
|
|
70
|
+ label="备注">
|
|
|
71
|
+ </el-table-column>
|
|
|
72
|
+ <el-table-column
|
|
|
73
|
+ fixed="right"
|
|
|
74
|
+ label="操作"
|
|
|
75
|
+ width="180">
|
|
|
76
|
+ <template slot-scope="scope">
|
|
|
77
|
+ <el-button type="success" size="small" @click="toEditDialog(scope.row)">编辑</el-button>
|
|
|
78
|
+ <el-button type="danger" size="small" @click="del(scope.$index,scope.row)">删除</el-button>
|
|
|
79
|
+ </template>
|
|
|
80
|
+ </el-table-column>
|
|
|
81
|
+ </el-table>
|
|
|
82
|
+ </template>
|
|
|
83
|
+ </el-row>
|
|
|
84
|
+ <!--分页模块-->
|
|
|
85
|
+ <el-row style="float: right;margin-top: 20px">
|
|
|
86
|
+ <div class="block">
|
|
|
87
|
+ <el-pagination
|
|
|
88
|
+ @size-change="handleSizeChange"
|
|
|
89
|
+ @current-change="handleCurrentChange"
|
|
|
90
|
+ :current-page="queryinfo.currentPage"
|
|
|
91
|
+ :page-sizes="[10, 20, 30, 40]"
|
|
|
92
|
+ :page-size="queryinfo.pageSize"
|
|
|
93
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
94
|
+ :total="total">
|
|
|
95
|
+ </el-pagination>
|
|
|
96
|
+ </div>
|
|
|
97
|
+ </el-row>
|
|
|
98
|
+<!-- 新增弹框-->
|
|
|
99
|
+ <el-row>
|
|
|
100
|
+ <el-dialog :title="dialogMap[dialogStatus]"
|
|
|
101
|
+ :visible.sync="dialogCross.addDialog" align="center" style="margin-top: -20px">
|
|
|
102
|
+ <el-form ref="form" :model="form" label-width="150px" label-position="right" :inline="true" :rules="rules">
|
|
|
103
|
+ <el-form-item label="启/禁用" style="margin-top: 15px">
|
|
|
104
|
+ <el-select v-model="form.state" placeholder="请选择" style="width: 200px" :clearable="true">
|
|
|
105
|
+ <el-option label="启用" value="1"></el-option>
|
|
|
106
|
+ <el-option label="禁用" value="0"></el-option>
|
|
|
107
|
+ </el-select>
|
|
|
108
|
+<!-- <el-input v-model="form.state" :clearable="true"></el-input>-->
|
|
|
109
|
+ </el-form-item>
|
|
|
110
|
+ <el-form-item label="承运人">
|
|
|
111
|
+ <el-input v-model="form.carrier" :clearable="true"></el-input>
|
|
|
112
|
+ </el-form-item>
|
|
|
113
|
+ <el-form-item label="航班号">
|
|
|
114
|
+ <el-input v-model="form.flightno" :clearable="true"></el-input>
|
|
|
115
|
+ </el-form-item>
|
|
|
116
|
+ <el-form-item label="起始站">
|
|
|
117
|
+ <el-input v-model="form.originatingstation" :clearable="true"></el-input>
|
|
|
118
|
+ </el-form-item>
|
|
|
119
|
+ <el-form-item label="目的站">
|
|
|
120
|
+ <el-input v-model="form.destinationstation" :clearable="true"></el-input>
|
|
|
121
|
+ </el-form-item>
|
|
|
122
|
+ <el-form-item label="跨天天数">
|
|
|
123
|
+ <el-input v-model="form.crossdays" :clearable="true"></el-input>
|
|
|
124
|
+ </el-form-item>
|
|
|
125
|
+ <el-form-item label="航班计划开始时间">
|
|
|
126
|
+ <el-date-picker type="date" v-model="form.effectivedate" style="width: 200px" :clearable="true"></el-date-picker>
|
|
|
127
|
+ </el-form-item>
|
|
|
128
|
+ <el-form-item label="航班计划结束时间">
|
|
|
129
|
+ <el-date-picker type="date" v-model="form.expirationdate" style="width: 200px" :clearable="true"></el-date-picker>
|
|
|
130
|
+ </el-form-item>
|
|
|
131
|
+ <el-form-item label="航班计划航班时刻">
|
|
|
132
|
+ <el-select v-model="form.schedule" placeholder="请选择" style="width: 200px" :clearable="true">
|
|
|
133
|
+ <el-option label="周一" value="1"></el-option>
|
|
|
134
|
+ <el-option label="周二" value="2"></el-option>
|
|
|
135
|
+ <el-option label="周三" value="3"></el-option>
|
|
|
136
|
+ <el-option label="周四" value="4"></el-option>
|
|
|
137
|
+ <el-option label="周五" value="5"></el-option>
|
|
|
138
|
+ <el-option label="周六" value="6"></el-option>
|
|
|
139
|
+ <el-option label="周日" value="7"></el-option>
|
|
|
140
|
+ </el-select>
|
|
|
141
|
+<!-- <el-date-picker type="date" prefix-icon=0 v-model="form.schedule" style="width: 200px" :clearable="true"></el-date-picker>-->
|
|
|
142
|
+ </el-form-item>
|
|
|
143
|
+ <el-form-item label="备注">
|
|
|
144
|
+ <el-input v-model="form.remark" :clearable="true"></el-input>
|
|
|
145
|
+ </el-form-item>
|
|
|
146
|
+ </el-form>
|
|
|
147
|
+ <div slot="footer" class="dialog-footer" align="center">
|
|
|
148
|
+ <el-button type="info" @click="dialogCross.addDialog = false">取消</el-button>
|
|
|
149
|
+ <el-button type="primary" @click="dialogStatus==='create'?add():edit()">提 交</el-button>
|
|
|
150
|
+ </div>
|
|
|
151
|
+ </el-dialog>
|
|
|
152
|
+ </el-row>
|
|
|
153
|
+
|
|
|
154
|
+ </el-main>
|
|
|
155
|
+ </el-container>
|
|
|
156
|
+
|
|
|
157
|
+</template>
|
|
|
158
|
+
|
|
|
159
|
+<script>
|
|
|
160
|
+ import { addCrossday,ediCrossday,delCrossday,selectLists } from '../../api/mt1201'
|
|
|
161
|
+
|
|
|
162
|
+ export default {
|
|
|
163
|
+ name: "Cross",
|
|
|
164
|
+ data() {
|
|
|
165
|
+ /*初始化值*/
|
|
|
166
|
+ return {
|
|
|
167
|
+ queryinfo:{
|
|
|
168
|
+ carrier:'',
|
|
|
169
|
+ flightno:'',
|
|
|
170
|
+ currentPage:1,
|
|
|
171
|
+ pageSize:10,
|
|
|
172
|
+ },
|
|
|
173
|
+ total:0,
|
|
|
174
|
+ tableData: [],
|
|
|
175
|
+ tableloading:true,
|
|
|
176
|
+ dialogMap: {
|
|
|
177
|
+ update: '编辑',
|
|
|
178
|
+ create: '新增'
|
|
|
179
|
+ },
|
|
|
180
|
+ dialogStatus: 'create',
|
|
|
181
|
+ dialogCross: {
|
|
|
182
|
+ // 添加对话框
|
|
|
183
|
+ addDialog: false,
|
|
|
184
|
+ // 编辑对话框
|
|
|
185
|
+ editDialog: false
|
|
|
186
|
+ },
|
|
|
187
|
+ form:{
|
|
|
188
|
+ state:'1',
|
|
|
189
|
+ carrier:'',
|
|
|
190
|
+ flightno:'',
|
|
|
191
|
+ originatingstation:'',
|
|
|
192
|
+ destinationstation:'',
|
|
|
193
|
+ crossdays:'',
|
|
|
194
|
+ effectivedate:'',
|
|
|
195
|
+ expirationdate:'',
|
|
|
196
|
+ schedule:'',
|
|
|
197
|
+ remark:''
|
|
|
198
|
+ },
|
|
|
199
|
+ rules: {
|
|
|
200
|
+ state: [
|
|
|
201
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
202
|
+ ],
|
|
|
203
|
+ flightno: [
|
|
|
204
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
205
|
+ ],
|
|
|
206
|
+ crossdays: [
|
|
|
207
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
208
|
+ ],
|
|
|
209
|
+ effectivedate: [
|
|
|
210
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
211
|
+ ],
|
|
|
212
|
+ expirationdate: [
|
|
|
213
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
214
|
+ ],
|
|
|
215
|
+ schedule: [
|
|
|
216
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
217
|
+ ],
|
|
|
218
|
+ }
|
|
|
219
|
+ }
|
|
|
220
|
+ },
|
|
|
221
|
+ methods: {
|
|
|
222
|
+ // 危险品操作员分页
|
|
|
223
|
+ handleSizeChange(val) {
|
|
|
224
|
+ this.queryinfo.pageSize = val
|
|
|
225
|
+ this.getList()
|
|
|
226
|
+ },
|
|
|
227
|
+ handleCurrentChange(val) {
|
|
|
228
|
+ this.queryinfo.pageNum = val
|
|
|
229
|
+ this.getList()
|
|
|
230
|
+ },
|
|
|
231
|
+ // 自动获取列表
|
|
|
232
|
+ activated(){
|
|
|
233
|
+ this.getList();
|
|
|
234
|
+ },
|
|
|
235
|
+ //查询
|
|
|
236
|
+ getList() {
|
|
|
237
|
+ const _this = this
|
|
|
238
|
+ selectLists(this.queryinfo).then((response) => {
|
|
|
239
|
+ const res = response.data
|
|
|
240
|
+ if (res.code != '200') {
|
|
|
241
|
+ return _this.$message.error('获取消息收发记录,失败!')
|
|
|
242
|
+ }
|
|
|
243
|
+ // 获取列表数据
|
|
|
244
|
+ _this.tableData = res.data.list
|
|
|
245
|
+ // 获取列表的总记录数
|
|
|
246
|
+ _this.total = res.data.total
|
|
|
247
|
+ _this.$message.success('获取消息收发记录,成功!')
|
|
|
248
|
+ }).catch(error => {
|
|
|
249
|
+ // 关闭加载
|
|
|
250
|
+ _this.$message.error(error.toString())
|
|
|
251
|
+ })
|
|
|
252
|
+ },
|
|
|
253
|
+ // 打开新增
|
|
|
254
|
+ toAddDialog() {
|
|
|
255
|
+ this.dialogStatus = 'create'
|
|
|
256
|
+ this.dialogCross.addDialog = true
|
|
|
257
|
+ this.form = {
|
|
|
258
|
+ state:'1',
|
|
|
259
|
+ carrier:'',
|
|
|
260
|
+ flightno:'',
|
|
|
261
|
+ originatingstation:'',
|
|
|
262
|
+ destinationstation:'',
|
|
|
263
|
+ crossdays:'',
|
|
|
264
|
+ effectivedate:'',
|
|
|
265
|
+ expirationdate:'',
|
|
|
266
|
+ schedule:'',
|
|
|
267
|
+ remark:''
|
|
|
268
|
+ }
|
|
|
269
|
+
|
|
|
270
|
+ // this.$nextTick(() => {
|
|
|
271
|
+ // this.form = Object.assign({}, row)
|
|
|
272
|
+ // })
|
|
|
273
|
+ },
|
|
|
274
|
+ // 新增功能
|
|
|
275
|
+ add() {
|
|
|
276
|
+ // 进行表单的预验证
|
|
|
277
|
+ this.$refs.form.validate(valid => {
|
|
|
278
|
+ // 未通过,表单预校验
|
|
|
279
|
+ if (!valid) return
|
|
|
280
|
+ addCrossday(this.form).then((response) => {
|
|
|
281
|
+ const res = response.data
|
|
|
282
|
+ // 添加失败
|
|
|
283
|
+ if (res.code !== '200') {
|
|
|
284
|
+ // 关闭加载
|
|
|
285
|
+ return this.$message.error(res.msg)
|
|
|
286
|
+ }
|
|
|
287
|
+ // 添加,成功
|
|
|
288
|
+ this.$message.success(res.msg)
|
|
|
289
|
+ // 隐藏对话框
|
|
|
290
|
+ this.dialogCross.addDialog = false
|
|
|
291
|
+ // 刷新列表
|
|
|
292
|
+ this.getList()
|
|
|
293
|
+ }).catch(error => {
|
|
|
294
|
+ this.$message.error(error.toString())
|
|
|
295
|
+ })
|
|
|
296
|
+ })
|
|
|
297
|
+ },
|
|
|
298
|
+ // 打开编辑
|
|
|
299
|
+ toEditDialog(row) {
|
|
|
300
|
+ this.dialogCross.addDialog = true;
|
|
|
301
|
+ this.dialogStatus = 'update';
|
|
|
302
|
+ // console.log(row);
|
|
|
303
|
+ this.form=row;
|
|
|
304
|
+ },
|
|
|
305
|
+ // 编辑功能
|
|
|
306
|
+ edit() {
|
|
|
307
|
+ // 进行表单的预验证
|
|
|
308
|
+ this.$refs.form.validate(valid => {
|
|
|
309
|
+ // 未通过,表单预校验
|
|
|
310
|
+ if (!valid) return
|
|
|
311
|
+ ediCrossday(this.form).then((response) => {
|
|
|
312
|
+ console.log(row)
|
|
|
313
|
+ const res = response.data
|
|
|
314
|
+ if (res.code != '200') {
|
|
|
315
|
+ return this.$message.error(res.msg)
|
|
|
316
|
+ }
|
|
|
317
|
+ this.$message.success(res.msg)
|
|
|
318
|
+ // 隐藏对话框
|
|
|
319
|
+ this.dialogCross.addDialog = false
|
|
|
320
|
+ // 刷新列表
|
|
|
321
|
+ this.getList()
|
|
|
322
|
+ }).catch(error => {
|
|
|
323
|
+ this.$message.error(error.toString())
|
|
|
324
|
+ })
|
|
|
325
|
+ })
|
|
|
326
|
+ },
|
|
|
327
|
+ // 删除
|
|
|
328
|
+ del(index, row) {
|
|
|
329
|
+ // 弹框询问是否删除?
|
|
|
330
|
+ this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
|
|
|
331
|
+ confirmButtonText: '确定删除',
|
|
|
332
|
+ cancelButtonText: '取消',
|
|
|
333
|
+ type: 'warning'
|
|
|
334
|
+ }
|
|
|
335
|
+ ).then(() => {
|
|
|
336
|
+ console.log(row);
|
|
|
337
|
+ delCrossday(row.autoid).then((response) => {
|
|
|
338
|
+ // console.log(row)
|
|
|
339
|
+ const res = response.data
|
|
|
340
|
+ this.$message.success(res.msg)
|
|
|
341
|
+ this.getList()
|
|
|
342
|
+ }).catch(error => {
|
|
|
343
|
+ this.$message.error(res.msg)
|
|
|
344
|
+ })
|
|
|
345
|
+ }).catch(() => {
|
|
|
346
|
+ })
|
|
|
347
|
+ },
|
|
|
348
|
+ // // 关闭对话框
|
|
|
349
|
+ // dangerous_addDialogClosed() {
|
|
|
350
|
+ // // 重置对话框
|
|
|
351
|
+ // this.$refs.dangerousAddForm.resetFields()
|
|
|
352
|
+ // },
|
|
|
353
|
+ },
|
|
|
354
|
+
|
|
|
355
|
+ }
|
|
|
356
|
+</script>
|
|
|
357
|
+
|
|
|
358
|
+<style scoped>
|
|
|
359
|
+ .el-input-group{
|
|
|
360
|
+ display: table;
|
|
|
361
|
+ }
|
|
|
362
|
+</style> |