1730532197@qq.com

lwj

...@@ -17,4 +17,22 @@ export function findSourceFlightAndFlightDateApi(data) { ...@@ -17,4 +17,22 @@ export function findSourceFlightAndFlightDateApi(data) {
17 }) 17 })
18 } 18 }
19 19
20 +// 原航班顺位规则保存
21 +export function sourceFlightRulesSaveApi(data) {
22 + data.dayOfWeek = data.dayOfWeek.join(';');
23 + return request({
24 + url: '/sourceFlight/sourceFlightRulesSave',
25 + method: 'post',
26 + data: data
27 + })
28 +}
29 +
20 30
31 +// 原航班顺位规则删除 启用 停用
32 +export function delOrEnableORDisableApi(data) {
33 + return request({
34 + url: '/sourceFlight/delOrEnableORDisable',
35 + method: 'post',
36 + data: data
37 + })
38 +}
......
...@@ -17,41 +17,42 @@ ...@@ -17,41 +17,42 @@
17 <br /> 17 <br />
18 <el-form-item label="日期" prop="flightDate"> 18 <el-form-item label="日期" prop="flightDate">
19 19
20 - <el-date-picker v-model="queryParams.flightDate" type="date" placeholder="选择日期"> 20 + <el-date-picker value-format="yyyy-MM-dd" v-model="queryParams.flightDate" type="date" placeholder="选择日期">
21 </el-date-picker> 21 </el-date-picker>
22 </el-form-item> 22 </el-form-item>
23 23
24 <el-form-item> 24 <el-form-item>
25 - <el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际目的航班</el-button>&#12288; 25 + <el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际目的航班
26 + </el-button>&#12288;
26 <span style="color: red;">注:原航班+日期查询该日期的航班实际情况</span> 27 <span style="color: red;">注:原航班+日期查询该日期的航班实际情况</span>
27 </el-form-item> 28 </el-form-item>
28 <br /> 29 <br />
29 <el-form-item> 30 <el-form-item>
30 <el-col :span="1.5"> 31 <el-col :span="1.5">
31 - <el-button type="primary" icon="el-icon-plus" size="mini">添加规则</el-button> 32 + <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加规则</el-button>
32 </el-col> 33 </el-col>
33 &#12288; <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> 34 &#12288; <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
34 </el-form-item> 35 </el-form-item>
35 </el-form> 36 </el-form>
36 37
37 38
38 - <el-table v-loading="loading" :data="sourceFlightRulesList" > 39 + <el-table v-loading="loading" :data="sourceFlightRulesList">
39 40
40 - <el-table-column label="原航班" align="center" prop="sourceFlightNo"/> 41 + <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="flightRank" width="280" />
42 - <!-- <el-table-column label="优先级" align="center" prop="priority" /> --> 43 + <!-- <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="dayOfWeek" width="180" />
44 <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" /> 45 <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="startDate" width="100" />
46 - <el-table-column label="结束时间" align="center" prop="endDate" width="100"/> 47 + <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="updateUserName" width="100" />
48 - <el-table-column label="最后修改时间" align="center" prop="updateTime" width="100"/> 49 + <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 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
50 <template slot-scope="scope"> 51 <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-edit" @click="handleUpdate(scope.row)">修改</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"@click="handleDeleteorPlayorpause(scope.row.id,0,'删除')">删除</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-video-play"@click="handleDeleteorPlayorpause(scope.row.id,1,'启用')">启用</el-button>
54 - <el-button size="mini" type="text" icon="el-icon-delete" >停用</el-button> 55 + <el-button size="mini" type="text" icon="el-icon-video-pause"@click="handleDeleteorPlayorpause(scope.row.id,3,'停用')">停用</el-button>
55 </template> 56 </template>
56 </el-table-column> 57 </el-table-column>
57 </el-table> 58 </el-table>
...@@ -62,42 +63,110 @@ ...@@ -62,42 +63,110 @@
62 63
63 <!-- 查看目的航班对话框 --> 64 <!-- 查看目的航班对话框 -->
64 <el-dialog title="实际目的航班" :visible.sync="openFlightDate" width="70%"> 65 <el-dialog title="实际目的航班" :visible.sync="openFlightDate" width="70%">
65 - <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate"> 66 + <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate">
66 - 67 +
67 - <el-table-column label="原航班" align="center" prop="sourceFlightNo"/> 68 + <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="actualFlight" width="280" />
69 - <el-table-column label="航班日期" align="center" prop="flightDate" /> 70 + <el-table-column label="航班日期" align="center" prop="flightDate" />
70 - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"width="200"> 71 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
71 - <template slot-scope="scope"> 72 + <template slot-scope="scope">
72 - <el-button size="mini" type="text" icon="el-icon-edit" >查看配置维度</el-button> 73 + <el-button size="mini" type="text" icon="el-icon-edit">查看配置维度</el-button>
73 - </template> 74 + </template>
74 - </el-table-column> 75 + </el-table-column>
75 - </el-table> 76 + </el-table>
76 - <div slot="footer" class="dialog-footer"> 77 + <div slot="footer" class="dialog-footer">
77 - <el-button @click="cancelFlightDate">返 回</el-button> 78 + <el-button @click="cancelFlightDate">返 回</el-button>
78 - </div> 79 + </div>
80 + </el-dialog>
81 +
82 +
83 + <!-- 添加或修改对话框 -->
84 + <el-dialog :title="title" :visible.sync="open" width="60%">
85 + <el-form ref="form" :model="form" :rules="rules" label-width="100px">
86 + <el-row>
87 + <el-col :span="10">
88 + <el-form-item label="原航班" prop="sourceFlightNo">
89 + <el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" />
90 + </el-form-item>
91 + </el-col>
92 + </el-row>
93 + <el-row>
94 + <el-col :span="12">
95 + <el-form-item label="有效开始时间" prop="startDate">
96 + <el-date-picker clearable size="small" v-model="form.startDate" type="date" value-format="yyyy-MM-dd"
97 + placeholder="选择开始时间">
98 + </el-date-picker>
99 + </el-form-item>
100 + </el-col>
101 + <el-col :span="12">
102 + <el-form-item label="有效结束时间" prop="endDate">
103 + <el-date-picker clearable size="small" v-model="form.endDate" type="date" value-format="yyyy-MM-dd"
104 + placeholder="选择结束时间">
105 + </el-date-picker>
106 + </el-form-item>
107 + </el-col>
108 +
109 + <el-col :span="24" style="margin-bottom: 5%;">
110 + <span style="color: red;margin-left: 10%;">提示:目的航班之同请用分号分隔【符号不区分中英文】,例:CA1053:C7433</span><br />
111 + <span style="color: red;margin-left: 10%;">提示:如果需要设置目的航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1:CZ433-1</span>
112 + </el-col>
113 + <el-col :span="24">
114 + <el-form-item label="目的航班" prop="flightRank">
115 + <el-input type="textarea" v-model="form.flightRank" :rows="4"></el-input>
116 + </el-form-item>
117 + </el-col>
118 + <el-col :span="24">
119 + <el-form-item label="周期段">
120 + <el-checkbox-group v-model="dayOfWeek">
121 + <el-checkbox v-for="item in dayOfWeekList" :key="item" :label="item" :name="item"></el-checkbox>
122 + </el-checkbox-group>
123 + </el-form-item>
124 + </el-col>
125 +
126 + </el-row>
127 + </el-form>
128 + <div slot="footer" class="dialog-footer">
129 + <el-button type="primary" @click="submitForm">确 定</el-button>
130 + <el-button @click="cancel">取 消</el-button>
131 + </div>
79 </el-dialog> 132 </el-dialog>
80 </div> 133 </div>
81 </template> 134 </template>
82 <script> 135 <script>
83 import { 136 import {
84 - findSourceFlightRulesApi,findSourceFlightAndFlightDateApi 137 + findSourceFlightRulesApi,
138 + sourceFlightRulesSaveApi,
139 + findSourceFlightAndFlightDateApi
85 } from "@/api/sourceFlightRules"; 140 } from "@/api/sourceFlightRules";
86 export default { 141 export default {
87 name: "SourceFlightRules", 142 name: "SourceFlightRules",
88 data() { 143 data() {
89 return { 144 return {
145 +
146 + //周期段
147 + dayOfWeekList: ['day1', 'day2', 'day3', 'day4', 'day5', 'day6', 'day7'],
90 // 遮罩层 148 // 遮罩层
91 loading: false, 149 loading: false,
92 // 遮罩层 150 // 遮罩层
93 loadingFlightDate: false, 151 loadingFlightDate: false,
152 + // 弹出层标题
153 + title: "",
94 // 总条数 154 // 总条数
95 total: 0, 155 total: 0,
96 // 原航班规则数据 156 // 原航班规则数据
97 sourceFlightRulesList: [], 157 sourceFlightRulesList: [],
98 //目的航班数据 158 //目的航班数据
99 - sourceFlightAndFlightDate:[], 159 + sourceFlightAndFlightDate: [],
100 - statusList: [{'id':1,'name':'有效'}, {'id':2,'name':'配置中'},{'id':3,'name':'停用'}], 160 + statusList: [{
161 + 'id': 1,
162 + 'name': '有效'
163 + }, {
164 + 'id': 2,
165 + 'name': '配置中'
166 + }, {
167 + 'id': 3,
168 + 'name': '停用'
169 + }],
101 // 新增修改查看规则弹出层 170 // 新增修改查看规则弹出层
102 open: false, 171 open: false,
103 // 是否显示查看目的航班弹出层 172 // 是否显示查看目的航班弹出层
...@@ -111,10 +180,24 @@ ...@@ -111,10 +180,24 @@
111 status: undefined, //状态 180 status: undefined, //状态
112 flightDate: undefined //日期 181 flightDate: undefined //日期
113 }, 182 },
183 + dayOfWeek:[],
114 // 表单参数 184 // 表单参数
115 - form: {}, 185 + form: {
186 + dayOfWeek: []
187 + },
116 // 表单校验 188 // 表单校验
117 - rules: {} 189 + rules: {
190 + sourceFlightNo: [{
191 + required: true,
192 + message: "原航班号不能为空",
193 + trigger: "blur"
194 + }],
195 + flightRank: [{
196 + required: true,
197 + message: "目的航班不能为空",
198 + trigger: "blur"
199 + }],
200 + }
118 }; 201 };
119 }, 202 },
120 created() { 203 created() {
...@@ -126,34 +209,113 @@ ...@@ -126,34 +209,113 @@
126 //this.loading = true; 209 //this.loading = true;
127 if (this.queryParams.pageNum > 1) { 210 if (this.queryParams.pageNum > 1) {
128 this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit 211 this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit
129 - }else{ 212 + } else {
130 - this.queryParams.start=0; 213 + this.queryParams.start = 0;
131 } 214 }
132 - findSourceFlightRulesApi(this.queryParams).then(response => { 215 + findSourceFlightRulesApi(this.queryParams).then(response => {
133 - this.sourceFlightRulesList = response.data.list; 216 + this.sourceFlightRulesList = response.data.list;
134 - this.total = response.data.totalCount; 217 + this.total = response.data.totalCount;
135 - this.loading = false; 218 + this.loading = false;
136 - }); 219 + });
137 220
138 }, 221 },
139 - /** 查询目的航班*/ 222 + /** 新增按钮操作 */
140 - findSourceFlightAndFlightDate(){ 223 + handleAdd() {
224 + this.reset();
225 + this.open = true;
226 + this.title = "添加原航班顺位规则";
227 + this.form.id = -1;
228 + this.dayOfWeek=[];
229 +
230 + },
231 + /** 修改按钮操作 */
232 + handleUpdate(row) {
233 + //this.reset();
234 + this.open = true;
235 + this.title = "修改原航班顺位规则";
236 + this.form =row;
237 + this.dayOfWeek= this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
238 + //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
239 +
240 + },
241 + /** 删除 启用 停用按钮操作 */
242 + handleDeleteorPlayorpause(rowid,status,statusText) {
243 + this.$confirm('是否确认' + statusText + '此数据项?', "警告", {
244 + confirmButtonText: "确定",
245 + cancelButtonText: "取消",
246 + type: "warning"
247 + }).then(function() {
248 + let disable={
249 + id:row.id,
250 + status:0
251 + };
252 + return delOrEnableORDisableApi(ids);
253 + }).then(() => {
254 + this.getList();
255 + this.msgSuccess(statusText+"成功");
256 + }).catch(function() {});
257 + },
258 + /** 提交按钮 */
259 + submitForm: function() {
260 + this.$refs["form"].validate(valid => {
261 + if (valid) {
262 + this.form.dayOfWeek=this.dayOfWeek;
263 + //处理数据
264 + sourceFlightRulesSaveApi(this.form).then(response => {
265 + if (response.code === 200) {
266 + this.msgSuccess("保存成功");
267 + this.open = false;
268 + this.findSourceFlightRules();
269 + } else {
270 + this.msgError(response.msg);
271 + }
272 + });
273 +
274 + }
275 + });
276 + },
277 + // 表单重置
278 + reset() {
279 + this.form = {
280 + id: undefined,
281 + createTime: undefined,
282 + createUserId: undefined,
283 + createUserName: undefined,
284 + updateTime: undefined,
285 + updateUserId: undefined,
286 + updateUserName: undefined,
287 + startDate: undefined,
288 + endDate: undefined,
289 + flightRank: undefined,
290 + sourceFlightNo: undefined,
291 + status: undefined,
292 + whetherHistory: undefined,
293 + historyId: undefined,
294 + dayOfWeek: [],
295 + type: undefined,
296 + priority: undefined
297 + };
298 + this.resetForm("form");
299 + },
300 + /** 查询目的航班*/
301 + findSourceFlightAndFlightDate() {
141 //校验原航班号非空 302 //校验原航班号非空
142 - if(this.queryParams.sourceFlightNo===null||this.queryParams.sourceFlightNo===undefined||this.queryParams.sourceFlightNo.trim()===''){ 303 + if (this.queryParams.sourceFlightNo === null || this.queryParams.sourceFlightNo === undefined || this
304 + .queryParams.sourceFlightNo.trim() === '') {
143 this.$message.warning("原航班号为空"); 305 this.$message.warning("原航班号为空");
144 - return 306 + return
145 } 307 }
146 //校验原日期非空 308 //校验原日期非空
147 - if(this.queryParams.flightDate===null||this.queryParams.flightDate===undefined){ 309 + if (this.queryParams.flightDate === null || this.queryParams.flightDate === undefined) {
148 this.$message.warning("日期为空"); 310 this.$message.warning("日期为空");
149 return 311 return
150 } 312 }
151 this.openFlightDate = true; 313 this.openFlightDate = true;
152 - this.loadingFlightDate=true; 314 + this.loadingFlightDate = true;
153 - this.sourceFlightAndFlightDate=[]; 315 + this.sourceFlightAndFlightDate = [];
154 findSourceFlightAndFlightDateApi(this.queryParams).then(response => { 316 findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
155 this.sourceFlightAndFlightDate = response.data; 317 this.sourceFlightAndFlightDate = response.data;
156 - this.loadingFlightDate=false; 318 + this.loadingFlightDate = false;
157 }); 319 });
158 320
159 321
...@@ -162,16 +324,21 @@ ...@@ -162,16 +324,21 @@
162 cancelFlightDate() { 324 cancelFlightDate() {
163 this.openFlightDate = false; 325 this.openFlightDate = false;
164 }, 326 },
327 + // 取消按钮
328 + cancel() {
329 + this.open = false;
330 + this.reset();
331 + },
165 // 状态字典翻译 332 // 状态字典翻译
166 statusFormat(row) { 333 statusFormat(row) {
167 - if(row.status==='1'){ 334 + if (row.status === '1') {
168 return '有效' 335 return '有效'
169 - }else if(row.status==='2'){ 336 + } else if (row.status === '2') {
170 return '配置中' 337 return '配置中'
171 - }else if(row.status==='3'){ 338 + } else if (row.status === '3') {
172 return '停用' 339 return '停用'
173 } 340 }
174 - return row.status; 341 + return row.status;
175 }, 342 },
176 /** 重置按钮操作 */ 343 /** 重置按钮操作 */
177 resetQuery() { 344 resetQuery() {
...@@ -181,7 +348,7 @@ ...@@ -181,7 +348,7 @@
181 /** 搜索按钮操作 */ 348 /** 搜索按钮操作 */
182 handleQuery() { 349 handleQuery() {
183 this.queryParams.pageNum = 1; 350 this.queryParams.pageNum = 1;
184 - this.queryParams.start=0; 351 + this.queryParams.start = 0;
185 this.findSourceFlightRules(); 352 this.findSourceFlightRules();
186 } 353 }
187 354
......