Elements-SY

Merge branch 'et86-black' into uat

This diff is collapsed. Click to expand it.
...@@ -25,8 +25,8 @@ export const formConfig = [ ...@@ -25,8 +25,8 @@ export const formConfig = [
25 { 25 {
26 label: "航线", 26 label: "航线",
27 type: "Input", 27 type: "Input",
28 - name: "flightRouteListStr", 28 + name: "routesStr",
29 - prop: "flightRouteListStr", 29 + prop: "routesStr",
30 placeholder: "", 30 placeholder: "",
31 span: 6, 31 span: 6,
32 labelWidth: "40px", 32 labelWidth: "40px",
......
...@@ -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: {
...@@ -101,31 +101,45 @@ export default { ...@@ -101,31 +101,45 @@ export default {
101 serviceCode: [], // Service Code 101 serviceCode: [], // Service Code
102 handlingCode: [], // Handling Code 102 handlingCode: [], // Handling Code
103 subCategory: [], // Sub Category 103 subCategory: [], // Sub Category
104 + flightRouteList: [], // 航班信息维护查询
104 }; 105 };
105 }, 106 },
106 /* 107 /*
107 判断有日期的找到了就走有日期的,如果日期级别的没有找到再去走一次普通级别的接口 108 判断有日期的找到了就走有日期的,如果日期级别的没有找到再去走一次普通级别的接口
108 */ 109 */
109 created() { 110 created() {
110 - this.getAllDictData(); // 获取全部字典 111 + this.getAllDictData();
111 const parmas = { 112 const parmas = {
112 querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段 1、2 113 querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段 1、2
113 purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号 114 purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号
114 flightDate: this.$route.query.flightDate || "", // 飞行日期 115 flightDate: this.$route.query.flightDate || "", // 飞行日期
115 flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合 116 flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合
117 + routesStr: this.$route.query.routesStr || "", // 从航班信息维护查看维度过来作为接收回显
116 status: this.$route.query.status || "", // 状态:0 无效、1 有效、2 配置中、3 停用 118 status: this.$route.query.status || "", // 状态:0 无效、1 有效、2 配置中、3 停用
117 dataStatus: this.$route.query.dataStatus || "", // add 、edit、view 119 dataStatus: this.$route.query.dataStatus || "", // add 、edit、view
118 flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail 120 flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail
119 pageName: this.$route.query.pageName || "", // flightAllocConfig、flightInformationMaintenance、flightRandConfig、dmLog 121 pageName: this.$route.query.pageName || "", // flightAllocConfig、flightInformationMaintenance、flightRandConfig、dmLog
120 id: this.$route.query.id || "", 122 id: this.$route.query.id || "",
121 }; 123 };
124 + this.queryForm = this.$route.query;
122 // 指定隐藏或显示From表单域 125 // 指定隐藏或显示From表单域
123 this.hiddenFormItem(parmas); 126 this.hiddenFormItem(parmas);
124 - // queryCondition只负责接收参数和接口调用 127 + // 只负责接收参数和接口调用
125 this.queryCondition(parmas); 128 this.queryCondition(parmas);
126 }, 129 },
127 mounted() {}, 130 mounted() {},
128 methods: { 131 methods: {
132 + // 航班信息维护查询
133 + queryFindAllFltDataApi(parmas) {
134 + findAllFltDataApi(parmas)
135 + .then((res) => {
136 + const { code, data, msg } = res;
137 + if(code == 200){
138 + this.flightRouteList = data.list;
139 + }
140 + })
141 + .catch((error) => {});
142 + },
129 // 【通过航班号查询航线】 143 // 【通过航班号查询航线】
130 getQueryRouteByFltNo(parmas) { 144 getQueryRouteByFltNo(parmas) {
131 queryRouteByFltNo(parmas) 145 queryRouteByFltNo(parmas)
...@@ -211,6 +225,22 @@ export default { ...@@ -211,6 +225,22 @@ export default {
211 return; 225 return;
212 } 226 }
213 } 227 }
228 + /*
229 + 日期级别:
230 + 处理routeSpecifyDateSeq
231 + */
232 + if (item.createTime && this.queryForm.flightDate) {
233 + let routeSpecifyDate = this.routeSpecifyDateSeq.filter(
234 + (item) => item.etesRule == "N"
235 + );
236 + let routes = [];
237 + if (routeSpecifyDate.length) {
238 + routeSpecifyDate.map((item) => {
239 + routes.push(item.route);
240 + });
241 + parmas.routeSpecifyDateSeq = routes.join(";");
242 + }
243 + }
214 // 校验表单域的选项 244 // 校验表单域的选项
215 let validate = validateForm.some((key) => parmas[key]); 245 let validate = validateForm.some((key) => parmas[key]);
216 if (validate) { 246 if (validate) {
......
...@@ -12,6 +12,7 @@ export default { ...@@ -12,6 +12,7 @@ export default {
12 queryForm: { 12 queryForm: {
13 // 表单参数 13 // 表单参数
14 }, 14 },
15 + routeSpecifyDateSeq: [], // 日期级别航班顺位
15 }; 16 };
16 }, 17 },
17 computed: { 18 computed: {
...@@ -103,20 +104,19 @@ export default { ...@@ -103,20 +104,19 @@ export default {
103 noDateParmas: this.noDateParmas, 104 noDateParmas: this.noDateParmas,
104 }); 105 });
105 } 106 }
106 - _this.queryForm = _this.$route.query; // 获取跳转过来的参数
107 }, 107 },
108 }, 108 },
109 // 航班信息维护 109 // 航班信息维护
110 flightInformationMaintenance: { 110 flightInformationMaintenance: {
111 noDateParmas: { 111 noDateParmas: {
112 purposeOfFlightNo: parmas.purposeOfFlightNo, 112 purposeOfFlightNo: parmas.purposeOfFlightNo,
113 - flightRouteListStr: parmas.flightRouteListStr, 113 + flightRouteListStr: this.$route.query.flightRouteListStr,
114 status: "", 114 status: "",
115 }, 115 },
116 dateParmas: { 116 dateParmas: {
117 purposeOfFlightNo: parmas.purposeOfFlightNo, 117 purposeOfFlightNo: parmas.purposeOfFlightNo,
118 flightDate: parmas.flightDate, 118 flightDate: parmas.flightDate,
119 - flightRouteListStr: parmas.flightRouteListStr, 119 + flightRouteListStr: this.$route.query.flightRouteListStr,
120 status: "", 120 status: "",
121 }, 121 },
122 queryParmas: function () { 122 queryParmas: function () {
...@@ -226,6 +226,18 @@ export default { ...@@ -226,6 +226,18 @@ export default {
226 let noDateRouteList = data.routeList.filter( 226 let noDateRouteList = data.routeList.filter(
227 (item) => item.etesRule == "N" 227 (item) => item.etesRule == "N"
228 ); 228 );
229 + // 航班信息维护从非日期级别拿数据时要删掉id 和 historyId
230 + if (
231 + this.$route.query.flightKindName == "Purple Tail" ||
232 + this.$route.query.flightKindName == "White Tail" ||
233 + this.$route.query.querySpecifyData == "1"
234 + ) {
235 + data.list.map((item) => {
236 + delete item.id;
237 + delete item.historyId;
238 + return item;
239 + });
240 + }
229 // 普通级别航班航线维度规则详情 241 // 普通级别航班航线维度规则详情
230 const noDateDataList = removeDuplicates(data.list, { 242 const noDateDataList = removeDuplicates(data.list, {
231 duplicate: "flightRoute", // 去重字段 243 duplicate: "flightRoute", // 去重字段
...@@ -270,6 +282,7 @@ export default { ...@@ -270,6 +282,7 @@ export default {
270 return; 282 return;
271 } 283 }
272 let dateDataLists = data.routeList; // 只负责展示航线优先级 284 let dateDataLists = data.routeList; // 只负责展示航线优先级
285 + this.routeSpecifyDateSeq = data.routeList; // 日期级别航班顺位
273 // 航班航线基本信息(过滤ET86航线的) 286 // 航班航线基本信息(过滤ET86航线的)
274 let dateRouteList = data.routeList.filter( 287 let dateRouteList = data.routeList.filter(
275 (item) => item.etesRule == "N" 288 (item) => item.etesRule == "N"
...@@ -422,9 +435,6 @@ export default { ...@@ -422,9 +435,6 @@ export default {
422 ); 435 );
423 }); 436 });
424 this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表 437 this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表
425 - if (this.$route.query.flightKindName == "Purple Tail") {
426 - this.showFlightKind(dateDataLists);
427 - }
428 this.pageLoading = false; 438 this.pageLoading = false;
429 } else { 439 } else {
430 // 当前航线有缺省的航线配置 440 // 当前航线有缺省的航线配置
...@@ -545,7 +555,6 @@ export default { ...@@ -545,7 +555,6 @@ export default {
545 this.setattrVal(item); // 设置属性值 555 this.setattrVal(item); // 设置属性值
546 } 556 }
547 }); 557 });
548 - this.routeList = dateRouteList; // 航线优先级
549 // 查找包含的航线并且按照dateList航线排序 558 // 查找包含的航线并且按照dateList航线排序
550 dateList.sort((a, b) => { 559 dateList.sort((a, b) => {
551 return ( 560 return (
...@@ -554,49 +563,12 @@ export default { ...@@ -554,49 +563,12 @@ export default {
554 ); 563 );
555 }); 564 });
556 if (this.$route.query.flightKindName == "Purple Tail") { 565 if (this.$route.query.flightKindName == "Purple Tail") {
557 - let flightRouteListStr =
558 - this.$route.query.flightRouteListStr.split(";"); // 跳转传过来的航线
559 - // 查找跳转传过来的对应的航线把包含的航线并且按照dateDataLists航线排序
560 - let inRoutes = dateDataLists
561 - .filter((item) => flightRouteListStr.includes(item.route))
562 - .sort(
563 - (a, b) =>
564 - flightRouteListStr.indexOf(a.route) -
565 - flightRouteListStr.indexOf(b.route)
566 - );
567 - // 处理航线优先级展示ET86
568 - let routes = [];
569 - inRoutes.map((item, i, arr) => {
570 - if (arr[i].etesRule == "Y") {
571 - routes.push(`${arr[i].route}(ET86)`);
572 - } else {
573 - routes.push(arr[i].route);
574 - }
575 - });
576 - // 把处理ET86航线优先级展示
577 - this.queryForm.flightRouteListStr = routes.join(";");
578 - // 跳转传过来的对应的航线把ET86航线的过滤掉
579 - let noEtesRoutes = inRoutes.filter((item) => item.etesRule == "N");
580 - let noRoutes = dateList.filter((item) => {
581 - return noEtesRoutes.some((el) => el.route === item.route);
582 - });
583 - const result = noRoutes
584 - .filter((item2) => {
585 - return noEtesRoutes.some((item1) => {
586 - return item1.route === item2.route;
587 - });
588 - })
589 - .sort((a, b) => {
590 - return (
591 - noEtesRoutes.findIndex((item) => item.route === a.route) -
592 - noEtesRoutes.findIndex((item) => item.route === b.route)
593 - );
594 - });
595 // this.defaultRouteData(result) // 默认航线配置信息数据; 566 // this.defaultRouteData(result) // 默认航线配置信息数据;
596 - this.routesInfo = result; 567 + this.routeList = dateRouteList; // 航线优先级
568 + this.routesInfo = dateList;
597 this.pageLoading = false; 569 this.pageLoading = false;
598 } else { 570 } else {
599 - this.queryForm = this.$route.query; // 获取跳转过来的参数 571 + this.routeList = dateRouteList; // 航线优先级
600 this.routesInfo = dateList; 572 this.routesInfo = dateList;
601 this.pageLoading = false; 573 this.pageLoading = false;
602 } 574 }
...@@ -618,29 +590,6 @@ export default { ...@@ -618,29 +590,6 @@ export default {
618 }); 590 });
619 return routesInfo; 591 return routesInfo;
620 }, 592 },
621 - // 处理跳转显示航线种类
622 - showFlightKind(dateDataLists) {
623 - let flightRouteListStr = this.$route.query.flightRouteListStr.split(";"); // 跳转传过来的航线
624 - // 查找跳转传过来的对应的航线把包含的航线并且按照dateDataLists航线排序
625 - let inRoutes = dateDataLists
626 - .filter((item) => flightRouteListStr.includes(item.route))
627 - .sort(
628 - (a, b) =>
629 - flightRouteListStr.indexOf(a.route) -
630 - flightRouteListStr.indexOf(b.route)
631 - );
632 - // 处理航线优先级展示ET86
633 - let routes = [];
634 - inRoutes.map((item, i, arr) => {
635 - if (arr[i].etesRule == "Y") {
636 - routes.push(`${arr[i].route}(ET86)`);
637 - } else {
638 - routes.push(arr[i].route);
639 - }
640 - });
641 - // 把处理ET86航线优先级展示
642 - this.queryForm.flightRouteListStr = routes.join(";");
643 - },
644 // 整合飞行航线配置信息 593 // 整合飞行航线配置信息
645 mergeFlightRouteConfigObj(routeList, dataList) { 594 mergeFlightRouteConfigObj(routeList, dataList) {
646 if (dataList.length) { 595 if (dataList.length) {
......
...@@ -283,6 +283,7 @@ export default { ...@@ -283,6 +283,7 @@ export default {
283 flightDate: flightDate, 283 flightDate: flightDate,
284 purposeOfFlightNo: actualFlight, 284 purposeOfFlightNo: actualFlight,
285 flightRouteListStr: route, 285 flightRouteListStr: route,
286 + routesStr: route,
286 status: "", 287 status: "",
287 pageName: "flightRandConfig", 288 pageName: "flightRandConfig",
288 disable: true, 289 disable: true,
......
...@@ -1341,12 +1341,29 @@ export default { ...@@ -1341,12 +1341,29 @@ export default {
1341 ); 1341 );
1342 return; 1342 return;
1343 } 1343 }
1344 + queryRouteByFltNo({ fltNo: row.fltNo })
1345 + .then((res) => {
1346 + const { code, data, msg } = res;
1347 + if (code === 200) {
1348 + if (data.list.length) {
1349 + let include = data.list.filter((item) =>
1350 + row.route.split(";").some((val) => val == item.route)
1351 + ); // 查询已被勾选的
1352 + let routes = [];
1353 + include.map((item, i, arr) => {
1354 + if (arr[i].isEtesRoute == "Y") {
1355 + routes.push(`${arr[i].route}(ET86)`);
1356 + } else {
1357 + routes.push(arr[i].route);
1358 + }
1359 + });
1344 this.$router.push({ 1360 this.$router.push({
1345 path: "/routeInfo", 1361 path: "/routeInfo",
1346 query: { 1362 query: {
1347 flightDate: row.fltDate, 1363 flightDate: row.fltDate,
1348 purposeOfFlightNo: row.fltNo, 1364 purposeOfFlightNo: row.fltNo,
1349 flightRouteListStr: row.route, 1365 flightRouteListStr: row.route,
1366 + routesStr: routes.join(";"),
1350 status: row.status, 1367 status: row.status,
1351 flightKindName: row.flightKindName, 1368 flightKindName: row.flightKindName,
1352 pageName: "flightInformationMaintenance", 1369 pageName: "flightInformationMaintenance",
...@@ -1354,6 +1371,17 @@ export default { ...@@ -1354,6 +1371,17 @@ export default {
1354 }, 1371 },
1355 }); 1372 });
1356 } 1373 }
1374 + if (data.list.length == 0) {
1375 + this.msgError("该航班没有设置航线");
1376 + }
1377 + } else {
1378 + this.msgWarning(res.msg);
1379 + }
1380 + })
1381 + .catch((err) => {
1382 + console.log(err);
1383 + });
1384 + }
1357 }) 1385 })
1358 .catch(() => {}); 1386 .catch(() => {});
1359 }, 1387 },
......
...@@ -716,6 +716,7 @@ export default { ...@@ -716,6 +716,7 @@ export default {
716 this.id++; 716 this.id++;
717 this.tableData.unshift({ 717 this.tableData.unshift({
718 id: this.id, 718 id: this.id,
719 + statusMark: true, // 作为是否为新增
719 flightNo: "", // 航班号 720 flightNo: "", // 航班号
720 calculateDay: "", // 航班日期//+1 -1 721 calculateDay: "", // 航班日期//+1 -1
721 flightRoute: "", // 航线 722 flightRoute: "", // 航线
...@@ -735,7 +736,7 @@ export default { ...@@ -735,7 +736,7 @@ export default {
735 }, 736 },
736 // 删除 737 // 删除
737 deleBtn(item, $index) { 738 deleBtn(item, $index) {
738 - console.log("删除:", item, $index); 739 + // console.log("删除:", item, $index);
739 this.tableData.splice($index, 1); 740 this.tableData.splice($index, 1);
740 }, 741 },
741 // 类别 742 // 类别
...@@ -752,22 +753,37 @@ export default { ...@@ -752,22 +753,37 @@ export default {
752 this.queryForm.originOfFlightNo 753 this.queryForm.originOfFlightNo
753 ); 754 );
754 }, 755 },
756 + /*
757 + 如果是编辑,那么添加航班顺位时
758 + */
755 // 表单提交 759 // 表单提交
756 submitForm(formName) { 760 submitForm(formName) {
757 this.$refs[formName].validate((valid) => { 761 this.$refs[formName].validate((valid) => {
758 if (valid && this.validateForm) { 762 if (valid && this.validateForm) {
759 - this.tableData.map((item, i) => {
760 - item.priority = ++i;
761 - });
762 - // 爆仓是否继续配舱
763 const newtTableData = JSON.parse(JSON.stringify(this.tableData)); 763 const newtTableData = JSON.parse(JSON.stringify(this.tableData));
764 const tableData = newtTableData; 764 const tableData = newtTableData;
765 - tableData.filter((item) => { 765 + tableData.map((item, i) => {
766 + // 爆仓是否继续配舱
766 if (item.permitOverweight == false) { 767 if (item.permitOverweight == false) {
767 item.permitOverweight = "N"; 768 item.permitOverweight = "N";
768 } else { 769 } else {
769 item.permitOverweight = "Y"; 770 item.permitOverweight = "Y";
770 } 771 }
772 + // // 作为是否为新增
773 + // if (item.hasOwnProperty("statusMark")) {
774 + // delete item.id;
775 + // }
776 + if (item.hasOwnProperty("routeList")) {
777 + delete item.routeList;
778 + }
779 + item.priority = ++i;
780 + return item;
781 + });
782 + // 新增时没有id说明有statusMark字段,则删除statusMark属性
783 + tableData.map((item) => {
784 + if (!item.hasOwnProperty("id")) {
785 + delete item.statusMark;
786 + }
771 }); 787 });
772 // 校验ET86配舱航班顺位维度 788 // 校验ET86配舱航班顺位维度
773 let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号 789 let fltNo = this.tableData.some((item) => item.flightNo == ""); // 通过遍历判断航班顺位列表有没有填写的航班号
...@@ -817,11 +833,6 @@ export default { ...@@ -817,11 +833,6 @@ export default {
817 this.postAdd(queryParmas); // 新增 833 this.postAdd(queryParmas); // 新增
818 } else { 834 } else {
819 if (this.validateForm) { 835 if (this.validateForm) {
820 - queryParmas.flightRankDtoList.map((item) => {
821 - if (item.hasOwnProperty("routeList")) {
822 - delete item.routeList;
823 - }
824 - });
825 this.postUpdate(queryParmas); // 修改 836 this.postUpdate(queryParmas); // 修改
826 } 837 }
827 } 838 }
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
111 } 111 }
112 } 112 }
113 }, 113 },
114 - // Ursa校验 使用JavaScript写一个匹配字母的表达式 114 + // Ursa校验
115 validateUrsa(ursaMark, ursa) { 115 validateUrsa(ursaMark, ursa) {
116 // 分隔字符串并且转数组&去除数组空字符串 116 // 分隔字符串并且转数组&去除数组空字符串
117 let ursaList = ursa.split(";").filter((str) => str !== ""); 117 let ursaList = ursa.split(";").filter((str) => str !== "");
......
...@@ -279,6 +279,7 @@ export default { ...@@ -279,6 +279,7 @@ export default {
279 purposeOfFlightNo: row.flightFltNo, 279 purposeOfFlightNo: row.flightFltNo,
280 flightDate: row.flightFltDate, 280 flightDate: row.flightFltDate,
281 flightRouteListStr: row.currentFlightRoute, 281 flightRouteListStr: row.currentFlightRoute,
282 + routesStr: row.currentFlightRoute,
282 pageName: "dmLog", 283 pageName: "dmLog",
283 disable: true, 284 disable: true,
284 }, 285 },
......