Elements-SY

modify

......@@ -147,6 +147,7 @@ export default {
},
closeSelectedTag(view) {
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
console.log(view)
if (this.isActive(view)) {
this.toLastView(visitedViews, view)
}
......
......@@ -498,11 +498,10 @@ export default {
*/
if (item.status == "3" || (item.status == "1" && item.ruleDate)) {
return true;
} else if (item.status == "1" && item.remark) {
} else if (item.status == "1" && this.$route.query.querySpecifyData) {
// 航班配舱设置非日期级别情况下
return true;
} else if (item.status == "2") {
// 航班配舱设置非日期级别情况下
return true;
} else {
return false;
......
import {
allDictData, // 获取全部字典
} from "@/api/destinationFlight";
export default {
computed: {
// 获取路由参数
......
......@@ -102,31 +102,112 @@ export default {
*/
created() {
this.getAllDictData(); // 获取全部字典
let _this = this;
// 航班配舱维度规则设置查询条件
let queryCondition = {
// 航班配舱设置
flightAllocConfig: {
queryParmas: () => {
// 非日期级别
if (this.$route.query.querySpecifyData == "2") {
let noDateParmas = {
querySpecifyData: this.$route.query.querySpecifyData,
noDateParmas: {
flightDate: "",
flightRoute: "",
purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
status: "",
};
this.noDateLevelRoute(noDateParmas);
}
// 日期级别
if (this.$route.query.querySpecifyData == "1") {
let dateParmas = {
},
dateParmas: {
flightDate: this.$route.query.flightDate,
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: this.$route.query.purposeOfFlightNo,
status: "",
};
this.dateLevelRoute(dateParmas);
},
queryParmas: function () {
// 非日期级别
if (this.querySpecifyData == "2") {
_this
.noDateLevelRoute(this.noDateParmas)
.then(({ routeList, dataList }) => {
const result = routeList.map((item1) => {
const item2 = dataList.find((item2) => {
if (item1.route === item2.flightRoute) {
item2.config = true;
return item2;
}
});
if (item2) {
// 有数据的合并对象,
return { ...item1, ...item2 };
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
});
// 处理属性
result.map((item) => {
if (item.config) {
_this.hasOwnProperty(item, "typeOfGoods");
_this.hasOwnProperty(item, "puporpuxCode");
_this.hasOwnProperty(item, "serviceCode");
_this.hasOwnProperty(item, "handlingCode");
_this.hasOwnProperty(item, "subCategory");
_this.setattrVal(item); // 设置属性值
}
});
_this.routesInfo = result;
console.log("非日期级别:", result);
});
}
// 日期级别
if (this.querySpecifyData == "1") {
_this.dateLevelRoute(this.dateParmas).then((res) => {
const { configFlag, dateFlightRoute } = res;
if (configFlag == false) {
// 航班航线有规则配置的
const dateListHas = dateFlightRoute.filter(
(item) => item.config == true
);
// 航班航线没有规则配置的
const dateListNo = dateFlightRoute.filter(
(item) => item.config == false
);
_this
.noDateLevelRoute(this.noDateParmas)
.then(({ dataList }) => {
console.log(dateListNo);
console.log(dataList);
const result = dateListNo.map((item1) => {
const item2 = dataList.find((item2) => {
if (item1.route === item2.flightRoute) {
item2.config = true;
return item2;
}
});
if (item2) {
// 有数据的合并对象,
return { ...item1, ...item2 };
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
});
let dateList = dateListHas.concat(result);
// 处理属性
dateList.map((item) => {
if (item.config) {
_this.hasOwnProperty(item, "typeOfGoods");
_this.hasOwnProperty(item, "puporpuxCode");
_this.hasOwnProperty(item, "serviceCode");
_this.hasOwnProperty(item, "handlingCode");
_this.hasOwnProperty(item, "subCategory");
_this.setattrVal(item); // 设置属性值
}
});
_this.routesInfo = dateList;
console.log(dateList);
});
}
});
}
},
},
......@@ -178,7 +259,6 @@ export default {
},
},
};
// 航班配舱设置
queryCondition.flightAllocConfig.queryParmas();
// 航班信息维护
......@@ -190,6 +270,7 @@ export default {
methods: {
// 普通级别的
noDateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas)
.then((res) => {
const { code, data, msg } = res;
......@@ -205,58 +286,21 @@ export default {
sortType: "Number", // 排序类型
sortAttr: "routePriority", // 排序字段
});
// 【日期规则】
const dateFlightRoute = routeList.map((item1) => {
const item2 = dataList.unique.find((item2) => {
if (item2.flightRoute === item1.route) {
item2.config = true;
return item2;
}
}); // 返回当前相等的一条数据
if (item2) {
// 有数据的合并对象,
return { ...item1, ...item2 };
} else {
// 没有数据的去普通航线里查找
const item = dataList.unique.find((item) => {
if (item.flightRoute === item1.route) {
item.config = true;
return item;
}
});
if (item) {
return { ...item1, ...item }; // 有数据的合并对象,
} else {
item1.config = false;
return item1; // 没有的返回当前的
}
}
});
// 处理属性
dateFlightRoute.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
});
this.routesInfo = dateFlightRoute;
resolve({ routeList: routeList, dataList: dataList.unique });
})
.catch(() => {});
});
},
// 日期级别的
dateLevelRoute(parmas) {
return new Promise((resolve, reject) => {
findDestinationFltRuleByFlightNo(parmas).then((res) => {
const { code, data, msg } = res;
if (code != 200) {
this.msgError(msg);
return;
}
let routeList = data.routeList; // 航班航线基本信息
this.routeList = data.routeList;
this.routeList = data.routeList; // 航班航线基本信息
// 日期级别航班航线维度规则详情
const dataList = removeDuplicates(data.list, {
duplicate: "flightRoute", // 去重字段
......@@ -265,7 +309,7 @@ export default {
sortAttr: "routePriority", // 排序字段
});
let config = false; // 有缺省的航线配置
const dateFlightRoute = routeList.map((item1) => {
const result = this.routeList.map((item1) => {
const item2 = dataList.unique.find((item2) => {
if (item2.flightRoute === item1.route) {
config = item2.config = true;
......@@ -284,18 +328,10 @@ export default {
return item1; // 没有的返回当前的
}
});
// 处理属性
dateFlightRoute.map((item) => {
if (item.config) {
this.hasOwnProperty(item, "typeOfGoods");
this.hasOwnProperty(item, "puporpuxCode");
this.hasOwnProperty(item, "serviceCode");
this.hasOwnProperty(item, "handlingCode");
this.hasOwnProperty(item, "subCategory");
this.setattrVal(item); // 设置属性值
}
let configFlag = result.every((item) => item.config == true);
// 返回日期级别查询结果
resolve({ configFlag: configFlag, dateFlightRoute: result });
});
this.routesInfo = dateFlightRoute;
});
},
// 新增规则
......
......@@ -506,7 +506,7 @@ export default {
const { code, msg } = res;
if (code == 200) {
this.msgSuccess(msg || "创建成功!");
this.$router.push("/et86RuleConfig");
this.closeTagMenu(this.$route)
} else {
this.msgError(msg || "创建失败!");
}
......@@ -556,6 +556,16 @@ export default {
} else {
this.checkboxClassType = [];
}
// 人民币
if (data.list.fltRuleDto.currencyCd == "CNY") {
this.minCNYCustomVal = data.list.fltRuleDto.minCustomVal;
this.maxCNYCustomVal = data.list.fltRuleDto.maxCustomVal;
}
// 美元
if (data.list.fltRuleDto.currencyCd == "USD") {
this.minSUDCustomVal = data.list.fltRuleDto.minCustomVal;
this.maxSUDCustomVal = data.list.fltRuleDto.maxCustomVal;
}
this.queryForm = data.list.fltRuleDto; // ET86配舱航班顺位维度
} else {
this.msgError(msg || "获取查看失败");
......@@ -570,7 +580,7 @@ export default {
const { code, msg } = res;
if (code == 200) {
this.msgSuccess(msg || "修改成功!");
this.$router.push("/et86RuleConfig");
this.closeTagMenu(this.$route)
} else {
this.msgError(msg || "修改失败!");
}
......@@ -785,6 +795,34 @@ export default {
});
this.$emit("handleSearch");
},
isActive(route) {
return route.path === this.$route.path;
},
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0];
if (latestView) {
this.$router.push(latestView.fullPath);
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
if (view.name === "Dashboard") {
// to reload home page
this.$router.replace({ path: "/redirect" + view.fullPath });
} else {
this.$router.push("/");
}
}
},
// 关闭当前标签菜单
closeTagMenu(view) {
this.$store
.dispatch("tagsView/delView", view)
.then(({ visitedViews }) => {
if (this.isActive(view)) {
this.toLastView(visitedViews, view);
}
});
},
},
};
</script>
......