Elements-SY

modify

<template>
<div>
<el-dialog title="航线优先级排序" :visible.sync="open" width="25%" :close-on-click-modal="false" :show-close="false"
@close="close" append-to-body center>
<el-form ref="routeOrder" label-width="auto" label-position="left" size="small" @submit.native.prevent>
<el-dialog
title="航线优先级排序"
:visible.sync="open"
width="25%"
:close-on-click-modal="false"
:show-close="false"
@close="close"
append-to-body
center
>
<el-form
ref="routeOrder"
label-width="auto"
label-position="left"
size="small"
@submit.native.prevent
>
<el-form-item label="航班号:" prop="fltNo">
<span>{{ fltNo }}</span>
</el-form-item>
......@@ -14,7 +28,9 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
<el-button type="primary" :loading="loading" @click="submit"
>确 定</el-button
>
<el-button @click="close">取 消</el-button>
</div>
</el-dialog>
......@@ -22,81 +38,85 @@
</template>
<script>
import { allRouteQuery, saveOrUpdateSpecifyDateRoute } from "@/api/destinationFlight";
import {
allRouteQuery,
saveOrUpdateSpecifyDateRoute,
} from "@/api/destinationFlight";
export default {
name: "",
props: {
open: {
type: Boolean,
default: false
default: false,
},
fltData: {
type: Object,
default: null
}
default: null,
},
},
data() {
return {
fltNo: '',
fltDate: '',
fltNo: "",
fltDate: "",
routeList: [],
submitData: [],
loading: false
}
loading: false,
};
},
watch: {
open(val) {
this.routeList = []
this.submitData = []
this.routeList = [];
this.submitData = [];
if (val) {
this.fltNo = this.fltData.fltNo
this.fltDate = this.fltData.fltDate
this.fltNo = this.fltData.fltNo;
this.fltDate = this.fltData.fltDate;
allRouteQuery({
fltNo: this.fltNo,
routeDate: this.fltDate
}).then(res => {
routeDate: this.fltDate,
})
.then((res) => {
if (res.code === 200) {
this.routeList = res.data.list
this.submitData = res.data.list
this.routeList = res.data.list;
this.submitData = res.data.list;
} else {
this.msgWarning(res.msg)
this.msgWarning(res.msg);
}
}).catch(err => {
console.log(err)
})
.catch((err) => {
console.log(err);
});
}
}
},
},
methods: {
submit() {
saveOrUpdateSpecifyDateRoute(this.submitData).then(res => {
saveOrUpdateSpecifyDateRoute(this.submitData)
.then((res) => {
if (res.code === 200) {
this.msgSuccess('保存成功')
this.close()
this.msgSuccess("保存成功");
this.close(res.code);
} else {
this.msgWarning(res.msg)
this.msgWarning(res.msg);
}
}).catch(err => {
console.log(err)
})
.catch((err) => {
console.log(err);
});
},
close() {
this.routeList = []
this.submitData = []
this.$emit('close')
close(code) {
this.routeList = [];
this.submitData = [];
this.$emit("close", code);
},
drag(val) {
val.forEach((item, index) => {
item.ordinal = index + 1
})
this.submitData = val
}
}
}
item.ordinal = index + 1;
});
this.submitData = val;
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<style lang="scss" scoped></style>
......
......@@ -213,13 +213,13 @@ export default {
this.$router.push({
path: "/routeInfo",
query: {
flightDate: '', // 跳转的时候默认当天日期
purposeOfFlightNo: '',
flightRouteListStr: '',
status: '',
flightDate: "", // 跳转的时候默认当天日期
purposeOfFlightNo: "",
flightRouteListStr: "",
status: "",
pageName: "flightAllocConfig",
dataStatus: "add",
disable: '',
disable: "",
},
});
},
......@@ -253,7 +253,10 @@ export default {
this.queryParams.flightDate = undefined;
}
},
close() {
close(code) {
if (code == 200) {
this.getList();
}
this.open = false;
},
//翻页
......
......@@ -81,6 +81,7 @@ export default {
noDateRouteList,
noDateDataList
);
// 当前所有航线都有航线配置信息返回true,否则返回false
let noDateConfigFlag = mergeNoDateRouteInfo.every(
(item) => item.config == true
);
......