index.vue
7.33 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
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="原航班" prop="sourceFlightNo">
<el-input v-model="queryParams.sourceFlightNo" placeholder="请输入原航班" clearable size="small" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable size="small">
<el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询原航班配置</el-button>
</el-form-item>
<br />
<el-form-item label="日期" prop="flightDate">
<el-date-picker v-model="queryParams.flightDate" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际目的航班</el-button> 
<span style="color: red;">注:原航班+日期查询该日期的航班实际情况</span>
</el-form-item>
<br />
<el-form-item>
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini">添加规则</el-button>
</el-col>
  <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="sourceFlightRulesList" >
<el-table-column label="原航班" align="center" prop="sourceFlightNo"/>
<el-table-column label="目的航班排序" align="center" prop="flightRank" width="280"/>
<!-- <el-table-column label="优先级" align="center" prop="priority" /> -->
<el-table-column label="周期" align="center" prop="dayOfWeek" width="180"/>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="开始时间" align="center" prop="startDate" width="100"/>
<el-table-column label="结束时间" align="center" prop="endDate" width="100"/>
<el-table-column label="最后修改人" align="center" prop="updateUserName" width="100"/>
<el-table-column label="最后修改时间" align="center" prop="updateTime" width="100"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"width="280" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" >修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" >删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" >启用</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" >停用</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" layout=" prev, pager, next, jumper, sizes,total"
:page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" />
<!-- 查看目的航班对话框 -->
<el-dialog title="实际目的航班" :visible.sync="openFlightDate" width="70%">
<el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate">
<el-table-column label="原航班" align="center" prop="sourceFlightNo"/>
<el-table-column label="实际目的航班" align="center" prop="actualFlight" width="280"/>
<el-table-column label="航班日期" align="center" prop="flightDate" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" >查看配置维度</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelFlightDate">返 回</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
findSourceFlightRulesApi,findSourceFlightAndFlightDateApi
} from "@/api/sourceFlightRules";
export default {
name: "SourceFlightRules",
data() {
return {
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 总条数
total: 0,
// 原航班规则数据
sourceFlightRulesList: [],
//目的航班数据
sourceFlightAndFlightDate:[],
statusList: [{'id':1,'name':'有效'}, {'id':2,'name':'配置中'},{'id':3,'name':'停用'}],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
openFlightDate: false,
// 查询参数
queryParams: {
start: 0, //当前条数【代表第几条数据 +1开始】
pageNum: 1,
limit: 20, //一页显示多少条数据
sourceFlightNo: undefined, //原航班号
status: undefined, //状态
flightDate: undefined //日期
},
// 表单参数
form: {},
// 表单校验
rules: {}
};
},
created() {
this.findSourceFlightRules();
},
methods: {
/** 查询原航班顺位规则*/
findSourceFlightRules() {
//this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit
}else{
this.queryParams.start=0;
}
findSourceFlightRulesApi(this.queryParams).then(response => {
this.sourceFlightRulesList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
},
/** 查询目的航班*/
findSourceFlightAndFlightDate(){
//校验原航班号非空
if(this.queryParams.sourceFlightNo===null||this.queryParams.sourceFlightNo===undefined||this.queryParams.sourceFlightNo.trim()===''){
this.$message.warning("原航班号为空");
return
}
//校验原日期非空
if(this.queryParams.flightDate===null||this.queryParams.flightDate===undefined){
this.$message.warning("日期为空");
return
}
this.openFlightDate = true;
this.loadingFlightDate=true;
this.sourceFlightAndFlightDate=[];
findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
this.sourceFlightAndFlightDate = response.data;
this.loadingFlightDate=false;
});
},
// 目的航班弹出框返回
cancelFlightDate() {
this.openFlightDate = false;
},
// 状态字典翻译
statusFormat(row) {
if(row.status==='1'){
return '有效'
}else if(row.status==='2'){
return '配置中'
}else if(row.status==='3'){
return '停用'
}
return row.status;
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start=0;
this.findSourceFlightRules();
}
}
};
</script>
<style>
</style>