1730532197@qq.com

lwj-菜单

1 +<template>
2 + <div class="app-container">
3 + <el-form :model="queryParams" ref="queryForm" :inline="true">
4 + <el-form-item label="原航班" prop="sourceFlightNo">
5 + <el-input v-model="queryParams.sourceFlightNo" placeholder="请输入原航班" clearable size="small" />
6 + </el-form-item>
7 + <el-form-item label="状态" prop="status">
8 + <el-select v-model="queryParams.status" placeholder="请选择" clearable size="small">
9 + <el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" />
10 + </el-select>
11 +
12 + </el-form-item>
13 +
14 + <el-form-item>
15 + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询原航班配置</el-button>
16 + </el-form-item>
17 + <br />
18 + <el-form-item label="日期" prop="flightDate">
19 +
20 + <el-date-picker v-model="queryParams.flightDate" type="date" placeholder="选择日期">
21 + </el-date-picker>
22 + </el-form-item>
23 +
24 + <el-form-item>
25 + <el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际目的航班</el-button>&#12288;
26 + <span style="color: red;">注:原航班+日期查询该日期的航班实际情况</span>
27 + </el-form-item>
28 + <br />
29 + <el-form-item>
30 + <el-col :span="1.5">
31 + <el-button type="primary" icon="el-icon-plus" size="mini">添加规则</el-button>
32 + </el-col>
33 + &#12288; <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
34 + </el-form-item>
35 + </el-form>
36 +
37 +
38 + <el-table v-loading="loading" :data="sourceFlightRulesList" >
39 +
40 + <el-table-column label="原航班" align="center" prop="sourceFlightNo"/>
41 + <el-table-column label="目的航班排序" align="center" prop="flightRank" width="280"/>
42 + <!-- <el-table-column label="优先级" align="center" prop="priority" /> -->
43 + <el-table-column label="周期" align="center" prop="dayOfWeek" width="180"/>
44 + <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
45 + <el-table-column label="开始时间" align="center" prop="startDate" width="100"/>
46 + <el-table-column label="结束时间" align="center" prop="endDate" width="100"/>
47 + <el-table-column label="最后修改人" align="center" prop="updateUserName" width="100"/>
48 + <el-table-column label="最后修改时间" align="center" prop="updateTime" width="100"/>
49 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"width="280" fixed="right">
50 + <template slot-scope="scope">
51 + <el-button size="mini" type="text" icon="el-icon-edit" >修改</el-button>
52 + <el-button size="mini" type="text" icon="el-icon-delete" >删除</el-button>
53 + <el-button size="mini" type="text" icon="el-icon-delete" >启用</el-button>
54 + <el-button size="mini" type="text" icon="el-icon-delete" >停用</el-button>
55 + </template>
56 + </el-table-column>
57 + </el-table>
58 +
59 + <pagination v-show="total>0" :total="total" layout=" prev, pager, next, jumper, sizes,total"
60 + :page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" />
61 +
62 +
63 + <!-- 查看目的航班对话框 -->
64 + <el-dialog title="实际目的航班" :visible.sync="openFlightDate" width="70%">
65 + <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate">
66 +
67 + <el-table-column label="原航班" align="center" prop="sourceFlightNo"/>
68 + <el-table-column label="实际目的航班" align="center" prop="actualFlight" width="280"/>
69 + <el-table-column label="航班日期" align="center" prop="flightDate" />
70 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"width="200">
71 + <template slot-scope="scope">
72 + <el-button size="mini" type="text" icon="el-icon-edit" >查看配置维度</el-button>
73 + </template>
74 + </el-table-column>
75 + </el-table>
76 + <div slot="footer" class="dialog-footer">
77 + <el-button @click="cancelFlightDate">返 回</el-button>
78 + </div>
79 + </el-dialog>
80 + </div>
81 +</template>
82 +<script>
83 + import {
84 + findSourceFlightRulesApi,findSourceFlightAndFlightDateApi
85 + } from "@/api/sourceFlightRules";
86 + export default {
87 + name: "SourceFlightRules",
88 + data() {
89 + return {
90 + // 遮罩层
91 + loading: false,
92 + // 遮罩层
93 + loadingFlightDate: false,
94 + // 总条数
95 + total: 0,
96 + // 原航班规则数据
97 + sourceFlightRulesList: [],
98 + //目的航班数据
99 + sourceFlightAndFlightDate:[],
100 + statusList: [{'id':1,'name':'有效'}, {'id':2,'name':'配置中'},{'id':3,'name':'停用'}],
101 + // 新增修改查看规则弹出层
102 + open: false,
103 + // 是否显示查看目的航班弹出层
104 + openFlightDate: false,
105 + // 查询参数
106 + queryParams: {
107 + start: 0, //当前条数【代表第几条数据 +1开始】
108 + pageNum: 1,
109 + limit: 20, //一页显示多少条数据
110 + sourceFlightNo: undefined, //原航班号
111 + status: undefined, //状态
112 + flightDate: undefined //日期
113 + },
114 + // 表单参数
115 + form: {},
116 + // 表单校验
117 + rules: {}
118 + };
119 + },
120 + created() {
121 + this.findSourceFlightRules();
122 + },
123 + methods: {
124 + /** 查询原航班顺位规则*/
125 + findSourceFlightRules() {
126 + //this.loading = true;
127 + if (this.queryParams.pageNum > 1) {
128 + this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit
129 + }else{
130 + this.queryParams.start=0;
131 + }
132 + findSourceFlightRulesApi(this.queryParams).then(response => {
133 + this.sourceFlightRulesList = response.data.list;
134 + this.total = response.data.totalCount;
135 + this.loading = false;
136 + });
137 +
138 + },
139 + /** 查询目的航班*/
140 + findSourceFlightAndFlightDate(){
141 + //校验原航班号非空
142 + if(this.queryParams.sourceFlightNo===null||this.queryParams.sourceFlightNo===undefined||this.queryParams.sourceFlightNo.trim()===''){
143 + this.$message.warning("原航班号为空");
144 + return
145 + }
146 + //校验原日期非空
147 + if(this.queryParams.flightDate===null||this.queryParams.flightDate===undefined){
148 + this.$message.warning("日期为空");
149 + return
150 + }
151 + this.openFlightDate = true;
152 + this.loadingFlightDate=true;
153 + this.sourceFlightAndFlightDate=[];
154 + findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
155 + this.sourceFlightAndFlightDate = response.data;
156 + this.loadingFlightDate=false;
157 + });
158 +
159 +
160 + },
161 + // 目的航班弹出框返回
162 + cancelFlightDate() {
163 + this.openFlightDate = false;
164 + },
165 + // 状态字典翻译
166 + statusFormat(row) {
167 + if(row.status==='1'){
168 + return '有效'
169 + }else if(row.status==='2'){
170 + return '配置中'
171 + }else if(row.status==='3'){
172 + return '停用'
173 + }
174 + return row.status;
175 + },
176 + /** 重置按钮操作 */
177 + resetQuery() {
178 + this.resetForm("queryForm");
179 + this.handleQuery();
180 + },
181 + /** 搜索按钮操作 */
182 + handleQuery() {
183 + this.queryParams.pageNum = 1;
184 + this.queryParams.start=0;
185 + this.findSourceFlightRules();
186 + }
187 +
188 + }
189 + };
190 +</script>
191 +<style>
192 +
193 +
194 +</style>