1730532197@qq.com

lwj

......@@ -17,4 +17,22 @@ export function findSourceFlightAndFlightDateApi(data) {
})
}
// 原航班顺位规则保存
export function sourceFlightRulesSaveApi(data) {
data.dayOfWeek = data.dayOfWeek.join(';');
return request({
url: '/sourceFlight/sourceFlightRulesSave',
method: 'post',
data: data
})
}
// 原航班顺位规则删除 启用 停用
export function delOrEnableORDisableApi(data) {
return request({
url: '/sourceFlight/delOrEnableORDisable',
method: 'post',
data: data
})
}
......
......@@ -17,41 +17,42 @@
<br />
<el-form-item label="日期" prop="flightDate">
<el-date-picker v-model="queryParams.flightDate" type="date" placeholder="选择日期">
<el-date-picker value-format="yyyy-MM-dd" 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>&#12288;
<el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际目的航班
</el-button>&#12288;
<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-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加规则</el-button>
</el-col>
&#12288; <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 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="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">
<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>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"@click="handleDeleteorPlayorpause(scope.row.id,0,'删除')">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-video-play"@click="handleDeleteorPlayorpause(scope.row.id,1,'启用')">启用</el-button>
<el-button size="mini" type="text" icon="el-icon-video-pause"@click="handleDeleteorPlayorpause(scope.row.id,3,'停用')">停用</el-button>
</template>
</el-table-column>
</el-table>
......@@ -62,42 +63,110 @@
<!-- 查看目的航班对话框 -->
<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-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>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="10">
<el-form-item label="原航班" prop="sourceFlightNo">
<el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="有效开始时间" prop="startDate">
<el-date-picker clearable size="small" v-model="form.startDate" type="date" value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效结束时间" prop="endDate">
<el-date-picker clearable size="small" v-model="form.endDate" type="date" value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-bottom: 5%;">
<span style="color: red;margin-left: 10%;">提示:目的航班之同请用分号分隔【符号不区分中英文】,例:CA1053:C7433</span><br />
<span style="color: red;margin-left: 10%;">提示:如果需要设置目的航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1:CZ433-1</span>
</el-col>
<el-col :span="24">
<el-form-item label="目的航班" prop="flightRank">
<el-input type="textarea" v-model="form.flightRank" :rows="4"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="周期段">
<el-checkbox-group v-model="dayOfWeek">
<el-checkbox v-for="item in dayOfWeekList" :key="item" :label="item" :name="item"></el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
findSourceFlightRulesApi,findSourceFlightAndFlightDateApi
findSourceFlightRulesApi,
sourceFlightRulesSaveApi,
findSourceFlightAndFlightDateApi
} from "@/api/sourceFlightRules";
export default {
name: "SourceFlightRules",
data() {
return {
//周期段
dayOfWeekList: ['day1', 'day2', 'day3', 'day4', 'day5', 'day6', 'day7'],
// 遮罩层
loading: false,
// 遮罩层
loadingFlightDate: false,
// 弹出层标题
title: "",
// 总条数
total: 0,
// 原航班规则数据
sourceFlightRulesList: [],
//目的航班数据
sourceFlightAndFlightDate:[],
statusList: [{'id':1,'name':'有效'}, {'id':2,'name':'配置中'},{'id':3,'name':'停用'}],
sourceFlightAndFlightDate: [],
statusList: [{
'id': 1,
'name': '有效'
}, {
'id': 2,
'name': '配置中'
}, {
'id': 3,
'name': '停用'
}],
// 新增修改查看规则弹出层
open: false,
// 是否显示查看目的航班弹出层
......@@ -111,10 +180,24 @@
status: undefined, //状态
flightDate: undefined //日期
},
dayOfWeek:[],
// 表单参数
form: {},
form: {
dayOfWeek: []
},
// 表单校验
rules: {}
rules: {
sourceFlightNo: [{
required: true,
message: "原航班号不能为空",
trigger: "blur"
}],
flightRank: [{
required: true,
message: "目的航班不能为空",
trigger: "blur"
}],
}
};
},
created() {
......@@ -126,34 +209,113 @@
//this.loading = true;
if (this.queryParams.pageNum > 1) {
this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit
}else{
this.queryParams.start=0;
} else {
this.queryParams.start = 0;
}
findSourceFlightRulesApi(this.queryParams).then(response => {
this.sourceFlightRulesList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
findSourceFlightRulesApi(this.queryParams).then(response => {
this.sourceFlightRulesList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
},
/** 查询目的航班*/
findSourceFlightAndFlightDate(){
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加原航班顺位规则";
this.form.id = -1;
this.dayOfWeek=[];
},
/** 修改按钮操作 */
handleUpdate(row) {
//this.reset();
this.open = true;
this.title = "修改原航班顺位规则";
this.form =row;
this.dayOfWeek= this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
//this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
},
/** 删除 启用 停用按钮操作 */
handleDeleteorPlayorpause(rowid,status,statusText) {
this.$confirm('是否确认' + statusText + '此数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
let disable={
id:row.id,
status:0
};
return delOrEnableORDisableApi(ids);
}).then(() => {
this.getList();
this.msgSuccess(statusText+"成功");
}).catch(function() {});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.dayOfWeek=this.dayOfWeek;
//处理数据
sourceFlightRulesSaveApi(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.open = false;
this.findSourceFlightRules();
} else {
this.msgError(response.msg);
}
});
}
});
},
// 表单重置
reset() {
this.form = {
id: undefined,
createTime: undefined,
createUserId: undefined,
createUserName: undefined,
updateTime: undefined,
updateUserId: undefined,
updateUserName: undefined,
startDate: undefined,
endDate: undefined,
flightRank: undefined,
sourceFlightNo: undefined,
status: undefined,
whetherHistory: undefined,
historyId: undefined,
dayOfWeek: [],
type: undefined,
priority: undefined
};
this.resetForm("form");
},
/** 查询目的航班*/
findSourceFlightAndFlightDate() {
//校验原航班号非空
if(this.queryParams.sourceFlightNo===null||this.queryParams.sourceFlightNo===undefined||this.queryParams.sourceFlightNo.trim()===''){
if (this.queryParams.sourceFlightNo === null || this.queryParams.sourceFlightNo === undefined || this
.queryParams.sourceFlightNo.trim() === '') {
this.$message.warning("原航班号为空");
return
return
}
//校验原日期非空
if(this.queryParams.flightDate===null||this.queryParams.flightDate===undefined){
if (this.queryParams.flightDate === null || this.queryParams.flightDate === undefined) {
this.$message.warning("日期为空");
return
}
this.openFlightDate = true;
this.loadingFlightDate=true;
this.sourceFlightAndFlightDate=[];
this.loadingFlightDate = true;
this.sourceFlightAndFlightDate = [];
findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
this.sourceFlightAndFlightDate = response.data;
this.loadingFlightDate=false;
this.loadingFlightDate = false;
});
......@@ -162,16 +324,21 @@
cancelFlightDate() {
this.openFlightDate = false;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 状态字典翻译
statusFormat(row) {
if(row.status==='1'){
if (row.status === '1') {
return '有效'
}else if(row.status==='2'){
} else if (row.status === '2') {
return '配置中'
}else if(row.status==='3'){
} else if (row.status === '3') {
return '停用'
}
return row.status;
return row.status;
},
/** 重置按钮操作 */
resetQuery() {
......@@ -181,7 +348,7 @@
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.start=0;
this.queryParams.start = 0;
this.findSourceFlightRules();
}
......