Showing
2 changed files
with
73 additions
and
5 deletions
| ... | @@ -69,7 +69,7 @@ import { | ... | @@ -69,7 +69,7 @@ import { |
| 69 | enableOrDisable, // 开启/停用航线规则设置 | 69 | enableOrDisable, // 开启/停用航线规则设置 |
| 70 | batchUpdateOrAddFlight, // 航班航线优先级更新 | 70 | batchUpdateOrAddFlight, // 航班航线优先级更新 |
| 71 | queryRouteByFltNo, // 通过航班号查询航线 | 71 | queryRouteByFltNo, // 通过航班号查询航线 |
| 72 | -} from "@/api/destinationFlight" | 72 | +} from "@/api/destinationFlight"; |
| 73 | import indexMixins from "../mixins"; | 73 | import indexMixins from "../mixins"; |
| 74 | export default { | 74 | export default { |
| 75 | components: { | 75 | components: { |
| ... | @@ -134,7 +134,7 @@ export default { | ... | @@ -134,7 +134,7 @@ export default { |
| 134 | findAllFltDataApi(parmas) | 134 | findAllFltDataApi(parmas) |
| 135 | .then((res) => { | 135 | .then((res) => { |
| 136 | const { code, data, msg } = res; | 136 | const { code, data, msg } = res; |
| 137 | - if(code == 200){ | 137 | + if (code == 200) { |
| 138 | this.flightRouteList = data.list; | 138 | this.flightRouteList = data.list; |
| 139 | } | 139 | } |
| 140 | }) | 140 | }) |
| ... | @@ -190,6 +190,7 @@ export default { | ... | @@ -190,6 +190,7 @@ export default { |
| 190 | // 保存 【新增/修改航线规则设置】 | 190 | // 保存 【新增/修改航线规则设置】 |
| 191 | saveSubmit(item, index) { | 191 | saveSubmit(item, index) { |
| 192 | item.flightRoute = item.route || item.flightRoute; | 192 | item.flightRoute = item.route || item.flightRoute; |
| 193 | + item.routePriority = ++index; // 作为排序 | ||
| 193 | let parmas = JSON.parse(JSON.stringify(item)); | 194 | let parmas = JSON.parse(JSON.stringify(item)); |
| 194 | this.returnString(parmas, "cargoType"); | 195 | this.returnString(parmas, "cargoType"); |
| 195 | this.returnString(parmas, "typeOfGoods"); | 196 | this.returnString(parmas, "typeOfGoods"); |
| ... | @@ -208,7 +209,9 @@ export default { | ... | @@ -208,7 +209,9 @@ export default { |
| 208 | } | 209 | } |
| 209 | } | 210 | } |
| 210 | if (parmas.minNumOfPieces || parmas.maxNumOfPieces) { | 211 | if (parmas.minNumOfPieces || parmas.maxNumOfPieces) { |
| 211 | - if (!/^[1-9]\d*$/.test(parmas.minNumOfPieces || parmas.maxNumOfPieces)) { | 212 | + if ( |
| 213 | + !/^[1-9]\d*$/.test(parmas.minNumOfPieces || parmas.maxNumOfPieces) | ||
| 214 | + ) { | ||
| 212 | this.msgWarning("请输入有效件数"); | 215 | this.msgWarning("请输入有效件数"); |
| 213 | return; | 216 | return; |
| 214 | } | 217 | } |
| ... | @@ -253,6 +256,7 @@ export default { | ... | @@ -253,6 +256,7 @@ export default { |
| 253 | this.hasOwnProperty(data, "handlingCode"); | 256 | this.hasOwnProperty(data, "handlingCode"); |
| 254 | this.hasOwnProperty(data, "subCategory"); | 257 | this.hasOwnProperty(data, "subCategory"); |
| 255 | this.setattrVal(data); // 设置属性值 | 258 | this.setattrVal(data); // 设置属性值 |
| 259 | + index--; | ||
| 256 | this.$set(this.routesInfo, index, { | 260 | this.$set(this.routesInfo, index, { |
| 257 | config: true, | 261 | config: true, |
| 258 | ...data, | 262 | ...data, |
| ... | @@ -332,6 +336,9 @@ export default { | ... | @@ -332,6 +336,9 @@ export default { |
| 332 | this.$set(this.routesInfo, index, { | 336 | this.$set(this.routesInfo, index, { |
| 333 | route: item.flightRoute, | 337 | route: item.flightRoute, |
| 334 | config: false, | 338 | config: false, |
| 339 | + fltNo: this.routeList[0].fltNo, | ||
| 340 | + etesRule: this.routeList[0].etesRule, | ||
| 341 | + routePriority: item.routePriority, | ||
| 335 | }); | 342 | }); |
| 336 | this.msgSuccess(msg); | 343 | this.msgSuccess(msg); |
| 337 | } else { | 344 | } else { | ... | ... |
| ... | @@ -244,12 +244,14 @@ export default { | ... | @@ -244,12 +244,14 @@ export default { |
| 244 | if (item.status == "1") { | 244 | if (item.status == "1") { |
| 245 | delete item.id; | 245 | delete item.id; |
| 246 | delete item.historyId; | 246 | delete item.historyId; |
| 247 | + delete item.routePriority; | ||
| 247 | } | 248 | } |
| 248 | - // 开启 || 保存【若开启则不用重置status和删除id & historyId】 | 249 | + // 开启 || 保存【若开启则不用重置status和删除id & historyId】用routePriority字段 |
| 249 | if ((item.status = "3")) { | 250 | if ((item.status = "3")) { |
| 250 | item.status = "1"; | 251 | item.status = "1"; |
| 251 | delete item.id; | 252 | delete item.id; |
| 252 | delete item.historyId; | 253 | delete item.historyId; |
| 254 | + delete item.routePriority; | ||
| 253 | } | 255 | } |
| 254 | return item; | 256 | return item; |
| 255 | }); | 257 | }); |
| ... | @@ -311,6 +313,11 @@ export default { | ... | @@ -311,6 +313,11 @@ export default { |
| 311 | this.msgError("暂无航线"); | 313 | this.msgError("暂无航线"); |
| 312 | return; | 314 | return; |
| 313 | } | 315 | } |
| 316 | + // 删除航线维度的顺位排序字段使用航班航线列表的排序字段 | ||
| 317 | + data.list.map((item) => { | ||
| 318 | + delete item.routePriority; | ||
| 319 | + return item; | ||
| 320 | + }); | ||
| 314 | // 日期级别航班航线维度规则详情 | 321 | // 日期级别航班航线维度规则详情 |
| 315 | const dateDataList = removeDuplicates(data.list, { | 322 | const dateDataList = removeDuplicates(data.list, { |
| 316 | duplicate: "flightRoute", // 去重字段 | 323 | duplicate: "flightRoute", // 去重字段 |
| ... | @@ -559,12 +566,25 @@ export default { | ... | @@ -559,12 +566,25 @@ export default { |
| 559 | dateRouteList.findIndex((item) => item.route == b.route) | 566 | dateRouteList.findIndex((item) => item.route == b.route) |
| 560 | ); | 567 | ); |
| 561 | }); | 568 | }); |
| 569 | + let routeSpecify = dateRouteList.filter( | ||
| 570 | + (item) => item.etesRule == "N" | ||
| 571 | + ); | ||
| 572 | + let routeSpecifyDateSeq = []; | ||
| 573 | + if (routeSpecify.length) { | ||
| 574 | + routeSpecify.map((item) => { | ||
| 575 | + routeSpecifyDateSeq.push(item.route); | ||
| 576 | + }); | ||
| 577 | + } | ||
| 578 | + noDateRouteInfo.map((item) => { | ||
| 579 | + item.routeSpecifyDateSeq = routeSpecifyDateSeq.join(";"); | ||
| 580 | + return item; | ||
| 581 | + }); | ||
| 562 | // this.defaultRouteData(noDateRouteInfo) // 默认航线配置信息数据; | 582 | // this.defaultRouteData(noDateRouteInfo) // 默认航线配置信息数据; |
| 563 | this.routesInfo = noDateRouteInfo; | 583 | this.routesInfo = noDateRouteInfo; |
| 564 | this.pageLoading = false; | 584 | this.pageLoading = false; |
| 565 | } | 585 | } |
| 566 | } else { | 586 | } else { |
| 567 | - // 日期级别和航班种类为Purple Tail的时候 | 587 | + // 日期级别和航班种类为Purple Tail注意事项: |
| 568 | // 日期级别的时候要注意dateListNo里没有flightRoute字段,也就是说只有航班航线没有航班航线配置信息; | 588 | // 日期级别的时候要注意dateListNo里没有flightRoute字段,也就是说只有航班航线没有航班航线配置信息; |
| 569 | // 其次是非日期级别mergeNoDateRouteInfo也可能没有对应的数据,没有flightRoute字段。 | 589 | // 其次是非日期级别mergeNoDateRouteInfo也可能没有对应的数据,没有flightRoute字段。 |
| 570 | // 那么这个时候使用mergeFlightRouteConfigObj方法就会出问题。 | 590 | // 那么这个时候使用mergeFlightRouteConfigObj方法就会出问题。 |
| ... | @@ -592,11 +612,39 @@ export default { | ... | @@ -592,11 +612,39 @@ export default { |
| 592 | ); | 612 | ); |
| 593 | }); | 613 | }); |
| 594 | if (this.$route.query.flightKindName == "Purple Tail") { | 614 | if (this.$route.query.flightKindName == "Purple Tail") { |
| 615 | + let routeSpecify = this.routeList.filter( | ||
| 616 | + (item) => item.etesRule == "N" | ||
| 617 | + ); | ||
| 618 | + let routeSpecifyDateSeq = []; | ||
| 619 | + if (routeSpecify.length) { | ||
| 620 | + routeSpecify.map((item) => { | ||
| 621 | + routeSpecifyDateSeq.push(item.route); | ||
| 622 | + }); | ||
| 623 | + } | ||
| 624 | + // 取日期级别航线优先级 | ||
| 625 | + dateList.map((item) => { | ||
| 626 | + item.routeSpecifyDateSeq = routeSpecifyDateSeq.join(";"); | ||
| 627 | + return item; | ||
| 628 | + }); | ||
| 595 | // this.defaultRouteData(result) // 默认航线配置信息数据; | 629 | // this.defaultRouteData(result) // 默认航线配置信息数据; |
| 596 | this.routeList = dateRouteList; // 航线优先级 | 630 | this.routeList = dateRouteList; // 航线优先级 |
| 597 | this.routesInfo = dateList; | 631 | this.routesInfo = dateList; |
| 598 | this.pageLoading = false; | 632 | this.pageLoading = false; |
| 599 | } else { | 633 | } else { |
| 634 | + let routeSpecify = dateRouteList.filter( | ||
| 635 | + (item) => item.etesRule == "N" | ||
| 636 | + ); | ||
| 637 | + let routeSpecifyDateSeq = []; | ||
| 638 | + if (routeSpecify.length) { | ||
| 639 | + routeSpecify.map((item) => { | ||
| 640 | + routeSpecifyDateSeq.push(item.route); | ||
| 641 | + }); | ||
| 642 | + } | ||
| 643 | + // 取日期级别航线优先级 | ||
| 644 | + dateList.map((item) => { | ||
| 645 | + item.routeSpecifyDateSeq = routeSpecifyDateSeq.join(";"); | ||
| 646 | + return item; | ||
| 647 | + }); | ||
| 600 | this.routeList = dateRouteList; // 航线优先级 | 648 | this.routeList = dateRouteList; // 航线优先级 |
| 601 | this.routesInfo = dateList; | 649 | this.routesInfo = dateList; |
| 602 | this.pageLoading = false; | 650 | this.pageLoading = false; |
| ... | @@ -1041,3 +1089,16 @@ export default { | ... | @@ -1041,3 +1089,16 @@ export default { |
| 1041 | 还要对所有关于显示的数据做处理,比如页面上所有关于checkbox的勾选框radio单选框; | 1089 | 还要对所有关于显示的数据做处理,比如页面上所有关于checkbox的勾选框radio单选框; |
| 1042 | 8: 在保存提交的时候对所有关于页面checkbox的勾选框做数据处理; | 1090 | 8: 在保存提交的时候对所有关于页面checkbox的勾选框做数据处理; |
| 1043 | */ | 1091 | */ |
| 1092 | + | ||
| 1093 | +/* | ||
| 1094 | + 1:日期级别没有维度取普通维度要注意的事项: | ||
| 1095 | + 删除普通维度的id、historyId; | ||
| 1096 | + 航线顺位字段:routeSpecifyDateSeq | ||
| 1097 | + 航线顺位排序字段:routePriority | ||
| 1098 | + 且排除ET86航线顺位排序字段:routePriority & routeSpecifyDateSeq | ||
| 1099 | + 2:新增时: | ||
| 1100 | + 不传id、historyId; | ||
| 1101 | + 航线顺位字段:routeSpecifyDateSeq | ||
| 1102 | + 航线顺位排序字段:routePriority | ||
| 1103 | + 且排除ET86航线顺位排序字段:routePriority & routeSpecifyDateSeq | ||
| 1104 | +*/ | ... | ... |
-
Please register or login to post a comment