Showing
3 changed files
with
74 additions
and
50 deletions
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-dialog title="航线优先级排序" :visible.sync="open" width="25%" :close-on-click-modal="false" :show-close="false" | 3 | + <el-dialog |
| 4 | - @close="close" append-to-body center> | 4 | + title="航线优先级排序" |
| 5 | - <el-form ref="routeOrder" label-width="auto" label-position="left" size="small" @submit.native.prevent> | 5 | + :visible.sync="open" |
| 6 | + width="25%" | ||
| 7 | + :close-on-click-modal="false" | ||
| 8 | + :show-close="false" | ||
| 9 | + @close="close" | ||
| 10 | + append-to-body | ||
| 11 | + center | ||
| 12 | + > | ||
| 13 | + <el-form | ||
| 14 | + ref="routeOrder" | ||
| 15 | + label-width="auto" | ||
| 16 | + label-position="left" | ||
| 17 | + size="small" | ||
| 18 | + @submit.native.prevent | ||
| 19 | + > | ||
| 6 | <el-form-item label="航班号:" prop="fltNo"> | 20 | <el-form-item label="航班号:" prop="fltNo"> |
| 7 | <span>{{ fltNo }}</span> | 21 | <span>{{ fltNo }}</span> |
| 8 | </el-form-item> | 22 | </el-form-item> |
| ... | @@ -14,7 +28,9 @@ | ... | @@ -14,7 +28,9 @@ |
| 14 | </el-form-item> | 28 | </el-form-item> |
| 15 | </el-form> | 29 | </el-form> |
| 16 | <div slot="footer" class="dialog-footer"> | 30 | <div slot="footer" class="dialog-footer"> |
| 17 | - <el-button type="primary" :loading="loading" @click="submit">确 定</el-button> | 31 | + <el-button type="primary" :loading="loading" @click="submit" |
| 32 | + >确 定</el-button | ||
| 33 | + > | ||
| 18 | <el-button @click="close">取 消</el-button> | 34 | <el-button @click="close">取 消</el-button> |
| 19 | </div> | 35 | </div> |
| 20 | </el-dialog> | 36 | </el-dialog> |
| ... | @@ -22,81 +38,85 @@ | ... | @@ -22,81 +38,85 @@ |
| 22 | </template> | 38 | </template> |
| 23 | 39 | ||
| 24 | <script> | 40 | <script> |
| 25 | -import { allRouteQuery, saveOrUpdateSpecifyDateRoute } from "@/api/destinationFlight"; | 41 | +import { |
| 42 | + allRouteQuery, | ||
| 43 | + saveOrUpdateSpecifyDateRoute, | ||
| 44 | +} from "@/api/destinationFlight"; | ||
| 26 | 45 | ||
| 27 | export default { | 46 | export default { |
| 28 | name: "", | 47 | name: "", |
| 29 | props: { | 48 | props: { |
| 30 | open: { | 49 | open: { |
| 31 | type: Boolean, | 50 | type: Boolean, |
| 32 | - default: false | 51 | + default: false, |
| 33 | }, | 52 | }, |
| 34 | fltData: { | 53 | fltData: { |
| 35 | type: Object, | 54 | type: Object, |
| 36 | - default: null | 55 | + default: null, |
| 37 | - } | 56 | + }, |
| 38 | }, | 57 | }, |
| 39 | data() { | 58 | data() { |
| 40 | return { | 59 | return { |
| 41 | - fltNo: '', | 60 | + fltNo: "", |
| 42 | - fltDate: '', | 61 | + fltDate: "", |
| 43 | routeList: [], | 62 | routeList: [], |
| 44 | submitData: [], | 63 | submitData: [], |
| 45 | - loading: false | 64 | + loading: false, |
| 46 | - } | 65 | + }; |
| 47 | }, | 66 | }, |
| 48 | watch: { | 67 | watch: { |
| 49 | open(val) { | 68 | open(val) { |
| 50 | - this.routeList = [] | 69 | + this.routeList = []; |
| 51 | - this.submitData = [] | 70 | + this.submitData = []; |
| 52 | if (val) { | 71 | if (val) { |
| 53 | - this.fltNo = this.fltData.fltNo | 72 | + this.fltNo = this.fltData.fltNo; |
| 54 | - this.fltDate = this.fltData.fltDate | 73 | + this.fltDate = this.fltData.fltDate; |
| 55 | allRouteQuery({ | 74 | allRouteQuery({ |
| 56 | fltNo: this.fltNo, | 75 | fltNo: this.fltNo, |
| 57 | - routeDate: this.fltDate | 76 | + routeDate: this.fltDate, |
| 58 | - }).then(res => { | 77 | + }) |
| 78 | + .then((res) => { | ||
| 59 | if (res.code === 200) { | 79 | if (res.code === 200) { |
| 60 | - this.routeList = res.data.list | 80 | + this.routeList = res.data.list; |
| 61 | - this.submitData = res.data.list | 81 | + this.submitData = res.data.list; |
| 62 | } else { | 82 | } else { |
| 63 | - this.msgWarning(res.msg) | 83 | + this.msgWarning(res.msg); |
| 64 | } | 84 | } |
| 65 | - }).catch(err => { | ||
| 66 | - console.log(err) | ||
| 67 | }) | 85 | }) |
| 86 | + .catch((err) => { | ||
| 87 | + console.log(err); | ||
| 88 | + }); | ||
| 68 | } | 89 | } |
| 69 | - } | 90 | + }, |
| 70 | }, | 91 | }, |
| 71 | methods: { | 92 | methods: { |
| 72 | submit() { | 93 | submit() { |
| 73 | - saveOrUpdateSpecifyDateRoute(this.submitData).then(res => { | 94 | + saveOrUpdateSpecifyDateRoute(this.submitData) |
| 95 | + .then((res) => { | ||
| 74 | if (res.code === 200) { | 96 | if (res.code === 200) { |
| 75 | - this.msgSuccess('保存成功') | 97 | + this.msgSuccess("保存成功"); |
| 76 | - this.close() | 98 | + this.close(res.code); |
| 77 | } else { | 99 | } else { |
| 78 | - this.msgWarning(res.msg) | 100 | + this.msgWarning(res.msg); |
| 79 | } | 101 | } |
| 80 | - }).catch(err => { | ||
| 81 | - console.log(err) | ||
| 82 | }) | 102 | }) |
| 103 | + .catch((err) => { | ||
| 104 | + console.log(err); | ||
| 105 | + }); | ||
| 83 | }, | 106 | }, |
| 84 | - close() { | 107 | + close(code) { |
| 85 | - this.routeList = [] | 108 | + this.routeList = []; |
| 86 | - this.submitData = [] | 109 | + this.submitData = []; |
| 87 | - this.$emit('close') | 110 | + this.$emit("close", code); |
| 88 | }, | 111 | }, |
| 89 | drag(val) { | 112 | drag(val) { |
| 90 | val.forEach((item, index) => { | 113 | val.forEach((item, index) => { |
| 91 | - item.ordinal = index + 1 | 114 | + item.ordinal = index + 1; |
| 92 | - }) | 115 | + }); |
| 93 | - this.submitData = val | 116 | + this.submitData = val; |
| 94 | - } | 117 | + }, |
| 95 | - } | 118 | + }, |
| 96 | -} | 119 | +}; |
| 97 | - | ||
| 98 | </script> | 120 | </script> |
| 99 | 121 | ||
| 100 | -<style lang="scss" scoped> | ||
| 101 | - | ||
| 102 | -</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 122 | +<style lang="scss" scoped></style> | ... | ... |
| ... | @@ -213,13 +213,13 @@ export default { | ... | @@ -213,13 +213,13 @@ export default { |
| 213 | this.$router.push({ | 213 | this.$router.push({ |
| 214 | path: "/routeInfo", | 214 | path: "/routeInfo", |
| 215 | query: { | 215 | query: { |
| 216 | - flightDate: '', // 跳转的时候默认当天日期 | 216 | + flightDate: "", // 跳转的时候默认当天日期 |
| 217 | - purposeOfFlightNo: '', | 217 | + purposeOfFlightNo: "", |
| 218 | - flightRouteListStr: '', | 218 | + flightRouteListStr: "", |
| 219 | - status: '', | 219 | + status: "", |
| 220 | pageName: "flightAllocConfig", | 220 | pageName: "flightAllocConfig", |
| 221 | dataStatus: "add", | 221 | dataStatus: "add", |
| 222 | - disable: '', | 222 | + disable: "", |
| 223 | }, | 223 | }, |
| 224 | }); | 224 | }); |
| 225 | }, | 225 | }, |
| ... | @@ -253,7 +253,10 @@ export default { | ... | @@ -253,7 +253,10 @@ export default { |
| 253 | this.queryParams.flightDate = undefined; | 253 | this.queryParams.flightDate = undefined; |
| 254 | } | 254 | } |
| 255 | }, | 255 | }, |
| 256 | - close() { | 256 | + close(code) { |
| 257 | + if (code == 200) { | ||
| 258 | + this.getList(); | ||
| 259 | + } | ||
| 257 | this.open = false; | 260 | this.open = false; |
| 258 | }, | 261 | }, |
| 259 | //翻页 | 262 | //翻页 | ... | ... |
| ... | @@ -81,6 +81,7 @@ export default { | ... | @@ -81,6 +81,7 @@ export default { |
| 81 | noDateRouteList, | 81 | noDateRouteList, |
| 82 | noDateDataList | 82 | noDateDataList |
| 83 | ); | 83 | ); |
| 84 | + // 当前所有航线都有航线配置信息返回true,否则返回false | ||
| 84 | let noDateConfigFlag = mergeNoDateRouteInfo.every( | 85 | let noDateConfigFlag = mergeNoDateRouteInfo.every( |
| 85 | (item) => item.config == true | 86 | (item) => item.config == true |
| 86 | ); | 87 | ); | ... | ... |
-
Please register or login to post a comment