Showing
3 changed files
with
93 additions
and
27 deletions
| ... | @@ -79,14 +79,22 @@ service.interceptors.response.use(res => { | ... | @@ -79,14 +79,22 @@ service.interceptors.response.use(res => { |
| 79 | type: 'error' | 79 | type: 'error' |
| 80 | }) | 80 | }) |
| 81 | return Promise.reject(new Error(msg)) | 81 | return Promise.reject(new Error(msg)) |
| 82 | - } else if (code !== 200 && code !== 201 && code !== 202 && code != 203 && code != 603 && code != 402) { | 82 | + } else if ( |
| 83 | + code !== 200 && | ||
| 84 | + code !== 201 && | ||
| 85 | + code !== 202 && | ||
| 86 | + code != 203 && | ||
| 87 | + code != 300 && | ||
| 88 | + code != 402 && | ||
| 89 | + code != 603 | ||
| 90 | + ) { | ||
| 83 | Message({ | 91 | Message({ |
| 84 | message: msg, | 92 | message: msg, |
| 85 | - type: 'error' | 93 | + type: "error", |
| 86 | - }) | 94 | + }); |
| 87 | - return Promise.reject('error') | 95 | + return Promise.reject("error"); |
| 88 | } else { | 96 | } else { |
| 89 | - return res.data | 97 | + return res.data; |
| 90 | } | 98 | } |
| 91 | }, | 99 | }, |
| 92 | error => { | 100 | error => { | ... | ... |
| ... | @@ -782,27 +782,76 @@ export default { | ... | @@ -782,27 +782,76 @@ export default { |
| 782 | }) | 782 | }) |
| 783 | } | 783 | } |
| 784 | } else { | 784 | } else { |
| 785 | - //航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度) | 785 | + // |
| 786 | - this.routeList.forEach((route, sub) => { | 786 | + if (this.routeSatus == 'FlightAllocConfig') { |
| 787 | - let routeStatus = 1 | 787 | + findDestinationFltRuleByFlightNo({ |
| 788 | - res.data.list.forEach(item => { | 788 | + purposeOfFlightNo: this.infoForm.fltNo, |
| 789 | - if (route.route === item.flightRoute) { | 789 | + fltDate: '', |
| 790 | - //航线对应插入数据 | 790 | + flightRoute: this.infoForm.route, |
| 791 | - routeStatus = 2 | 791 | + flightRouteListStr: this.$route.params.route, |
| 792 | - this.infoForm.list.push(this.dataHandle(item)) | 792 | + status: this.$route.params.status |
| 793 | + }).then(resData => { | ||
| 794 | + if (resData.data.list.length > 0) { | ||
| 795 | + this.routeList.forEach((route) => { | ||
| 796 | + let routeStatus = 1 | ||
| 797 | + resData.data.list.forEach(item => { | ||
| 798 | + if (item.flightRoute == route.route) { | ||
| 799 | + routeStatus = 2 | ||
| 800 | + this.infoForm.list.push( | ||
| 801 | + this.dataHandle(item) | ||
| 802 | + ) | ||
| 803 | + console.log(route.route) | ||
| 804 | + } | ||
| 805 | + }) | ||
| 806 | + if (routeStatus == 1) { | ||
| 807 | + this.infoForm.list.push({ | ||
| 808 | + purposeOfFlightNo: this.infoForm.fltNo, | ||
| 809 | + ruleDate: this.infoForm.fltDate, | ||
| 810 | + flightRoute: route.route, | ||
| 811 | + routePriority: route.routePriority, | ||
| 812 | + }) | ||
| 813 | + } | ||
| 814 | + }) | ||
| 793 | } | 815 | } |
| 816 | + else { | ||
| 817 | + this.routeList.forEach((route) => { | ||
| 818 | + this.infoForm.list.push({ | ||
| 819 | + purposeOfFlightNo: this.infoForm.fltNo, | ||
| 820 | + ruleDate: this.infoForm.fltDate, | ||
| 821 | + flightRoute: route.route, | ||
| 822 | + routePriority: route.routePriority, | ||
| 823 | + }) | ||
| 824 | + }) | ||
| 825 | + } | ||
| 826 | + }).catch(err => { | ||
| 827 | + this.isEmpty = true | ||
| 828 | + console.log(err) | ||
| 794 | }) | 829 | }) |
| 795 | - if (routeStatus == 1) { | 830 | + }else{ |
| 796 | - //否则插入占位基础数据 | 831 | + // 航线为空,对应航班或航班+日期下的全部维度(需补全未创建维度) |
| 797 | - this.infoForm.list.push({ | 832 | + this.routeList.forEach((route, sub) => { |
| 798 | - purposeOfFlightNo: this.infoForm.fltNo, | 833 | + let routeStatus = 1 |
| 799 | - ruleDate: this.infoForm.fltDate, | 834 | + res.data.list.forEach(item => { |
| 800 | - flightRoute: route.route, | 835 | + if (route.route === item.flightRoute) { |
| 801 | - routePriority: route.routePriority, | 836 | + //航线对应插入数据 |
| 802 | - }) | 837 | + routeStatus = 2 |
| 803 | - this.newRoute(sub) | 838 | + item.id = undefined |
| 804 | - } | 839 | + item.status = undefined |
| 805 | - }) | 840 | + this.infoForm.list.push(this.dataHandle(item)) |
| 841 | + } | ||
| 842 | + }) | ||
| 843 | + if (routeStatus == 1) { | ||
| 844 | + //否则插入占位基础数据 | ||
| 845 | + this.infoForm.list.push({ | ||
| 846 | + purposeOfFlightNo: this.infoForm.fltNo, | ||
| 847 | + ruleDate: this.infoForm.fltDate, | ||
| 848 | + flightRoute: route.route, | ||
| 849 | + routePriority: route.routePriority, | ||
| 850 | + }) | ||
| 851 | + this.newRoute(sub) | ||
| 852 | + } | ||
| 853 | + }) | ||
| 854 | + } | ||
| 806 | } | 855 | } |
| 807 | } | 856 | } |
| 808 | else { | 857 | else { | ... | ... |
| ... | @@ -359,7 +359,7 @@ export default { | ... | @@ -359,7 +359,7 @@ export default { |
| 359 | route: [ | 359 | route: [ |
| 360 | { | 360 | { |
| 361 | required: true, | 361 | required: true, |
| 362 | - message: "航班路线不能为空", | 362 | + message: "航班路线不能为空呀", |
| 363 | trigger: "change", | 363 | trigger: "change", |
| 364 | }, | 364 | }, |
| 365 | // { | 365 | // { |
| ... | @@ -615,11 +615,15 @@ export default { | ... | @@ -615,11 +615,15 @@ export default { |
| 615 | this.selectOption.flightKindlist.forEach(item => { | 615 | this.selectOption.flightKindlist.forEach(item => { |
| 616 | if (item.id == val) { | 616 | if (item.id == val) { |
| 617 | if (item.chineseName.indexOf('White') >= 0) { | 617 | if (item.chineseName.indexOf('White') >= 0) { |
| 618 | - this.form.route = '' | ||
| 619 | this.routeMultiple = false | 618 | this.routeMultiple = false |
| 619 | + // this.rules.route[0].type = 'string' | ||
| 620 | + this.form.route = '' | ||
| 621 | + // this.rules.route[0].required = true; | ||
| 620 | } else if (item.chineseName.indexOf('Purple') >= 0) { | 622 | } else if (item.chineseName.indexOf('Purple') >= 0) { |
| 621 | - this.form.route = [] | ||
| 622 | this.routeMultiple = true | 623 | this.routeMultiple = true |
| 624 | + // this.rules.route[0].type = 'array' | ||
| 625 | + this.form.route = [] | ||
| 626 | + // this.rules.route[0].required = true; | ||
| 623 | } | 627 | } |
| 624 | } | 628 | } |
| 625 | }) | 629 | }) |
| ... | @@ -1109,6 +1113,11 @@ export default { | ... | @@ -1109,6 +1113,11 @@ export default { |
| 1109 | }, | 1113 | }, |
| 1110 | //航线修改 | 1114 | //航线修改 |
| 1111 | routeChange(val) { | 1115 | routeChange(val) { |
| 1116 | + if(val.length){ | ||
| 1117 | + this.rules.route[0].required = false; | ||
| 1118 | + }else{ | ||
| 1119 | + // this.rules.route[0].required = true; | ||
| 1120 | + } | ||
| 1112 | this.$forceUpdate() | 1121 | this.$forceUpdate() |
| 1113 | }, | 1122 | }, |
| 1114 | //多选框选中数据 | 1123 | //多选框选中数据 | ... | ... |
-
Please register or login to post a comment