Elements-SY

modify

......@@ -111,7 +111,6 @@ export default {
item.disable = false;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = true;
item.hidden = true;
}
}
});
......@@ -127,7 +126,6 @@ export default {
}
});
}
this.queryForm = this.$route.query; // 获取跳转过来的参数
// 航班配舱维度规则设置查询条件
let queryCondition = {
// 航班配舱设置
......@@ -149,6 +147,13 @@ export default {
// 非日期级别
if (parmas.querySpecifyData == "2") {
_this.noDateLevelData(this.noDateParmas);
formConfig.map((item) => {
if (item.type !== "slot") {
if (item.label == "航班日期") {
item.hidden = true;
}
}
});
}
// 日期级别
if (parmas.querySpecifyData == "1") {
......@@ -157,6 +162,7 @@ export default {
noDateParmas: this.noDateParmas,
});
}
_this.queryForm = _this.$route.query; // 获取跳转过来的参数
},
},
// 航班信息维护
......@@ -290,7 +296,11 @@ export default {
this.returnString(parmas, "handlingCode");
this.returnString(parmas, "subCategory");
if (parmas.minWeight || parmas.maxWeight) {
if (!/^(0|[1-9]\d*)(.\d{1,5})?$/.test(parmas.minWeight || parmas.maxWeight)) {
if (
!/^(0|[1-9]\d*)(.\d{1,5})?$/.test(
parmas.minWeight || parmas.maxWeight
)
) {
this.msgWarning("请输入有效重量,小数保留5位");
return;
}
......
......@@ -248,6 +248,9 @@ export default {
);
});
this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表
if (this.$route.query.flightKindName == "Purple Tail") {
this.showFlightKind(dateDataLists);
}
}
if (dateConfigFlag == false) {
// 航班航线有规则配置的
......@@ -364,27 +367,83 @@ export default {
this.setattrVal(item); // 设置属性值
}
});
this.routeList = dateRouteList;
this.routeList = dateRouteList; // 航线优先级
// 查找包含的航线并且按照dateList航线排序
dateList.sort((a, b) => {
return (
dateRouteList.findIndex((item) => item.route == a.route) -
dateRouteList.findIndex((item) => item.route == b.route)
);
});
this.routesInfo = dateList;
if (this.$route.query.flightKindName == "Purple Tail") {
let flightRouteListStr = [];
dateDataLists.map((item, i, arr) => {
let flightRouteListStr =
this.$route.query.flightRouteListStr.split(";"); // 跳转传过来的航线
// 查找跳转传过来的对应的航线把包含的航线并且按照dateDataLists航线排序
let inRoutes = dateDataLists
.filter((item) => flightRouteListStr.includes(item.route))
.sort(
(a, b) =>
flightRouteListStr.indexOf(a.route) -
flightRouteListStr.indexOf(b.route)
);
// 处理航线优先级展示ET86
let routes = [];
inRoutes.map((item, i, arr) => {
if (arr[i].etesRule == "Y") {
flightRouteListStr.push(`${arr[i].route}(ET86)`);
routes.push(`${arr[i].route}(ET86)`);
} else {
flightRouteListStr.push(arr[i].route);
routes.push(arr[i].route);
}
});
this.queryForm.flightRouteListStr = flightRouteListStr.join(";");
// 把处理ET86航线优先级展示
this.queryForm.flightRouteListStr = routes.join(";");
// 跳转传过来的对应的航线把ET86航线的过滤掉
let noEtesRoutes = inRoutes.filter((item) => item.etesRule == "N");
let noRoutes = dateList.filter((item) => {
return noEtesRoutes.some((el) => el.route === item.route);
});
const result = noRoutes
.filter((item2) => {
return noEtesRoutes.some((item1) => {
return item1.route === item2.route;
});
})
.sort((a, b) => {
return (
noEtesRoutes.findIndex((item) => item.route === a.route) -
noEtesRoutes.findIndex((item) => item.route === b.route)
);
});
this.routesInfo = result;
} else {
this.queryForm = this.$route.query; // 获取跳转过来的参数
this.routesInfo = dateList;
}
}
},
// 处理跳转显示航线种类
showFlightKind(dateDataLists) {
let flightRouteListStr = this.$route.query.flightRouteListStr.split(";"); // 跳转传过来的航线
// 查找跳转传过来的对应的航线把包含的航线并且按照dateDataLists航线排序
let inRoutes = dateDataLists
.filter((item) => flightRouteListStr.includes(item.route))
.sort(
(a, b) =>
flightRouteListStr.indexOf(a.route) -
flightRouteListStr.indexOf(b.route)
);
// 处理航线优先级展示ET86
let routes = [];
inRoutes.map((item, i, arr) => {
if (arr[i].etesRule == "Y") {
routes.push(`${arr[i].route}(ET86)`);
} else {
routes.push(arr[i].route);
}
});
// 把处理ET86航线优先级展示
this.queryForm.flightRouteListStr = routes.join(";");
},
// 整合飞行航线配置信息
mergeFlightRouteConfigObj(routeList, dataList) {
if (dataList.length) {
......@@ -549,3 +608,8 @@ export default {
8: 在保存提交的时候对所有关于页面checkbox的勾选框做数据处理
*/
/*
航线排序;
航线展示ET86
*/
......