Elements-SY

modify

......@@ -29,7 +29,7 @@ export function findFlightDimRuleByFlightNo(query) {
})
}
// 获取航班下航线维度(维度修改)
// 航线维度设置详情
/**
* @param purposeOfFlightNo 航班号
* @param flightDate 航班日期
......@@ -43,7 +43,7 @@ export function findDestinationFltRuleByFlightNo(query) {
})
}
//航班优先级修改
// 航班航线优先级更新
export function batchUpdateOrAddFlight(data) {
return request({
url: '/destinationFlight/batchUpdateOrAddFlight',
......@@ -52,7 +52,7 @@ export function batchUpdateOrAddFlight(data) {
})
}
//新增修改规则设置
// 新增/修改航线规则设置
export function updateOrAddFlight(form) {
return request({
url: '/destinationFlight/updateOrAddFlight',
......@@ -61,7 +61,7 @@ export function updateOrAddFlight(form) {
})
}
//删除规则
// 删除航线规则设置
export function delFlightId(data) {
return request({
url: "/destinationFlight/delFlightId",
......@@ -70,7 +70,7 @@ export function delFlightId(data) {
});
}
//启用/停止规则
//开启/停用航线规则设置
export function enableOrDisable(data) {
//statsu 1-有效 3-停用
return request({
......@@ -113,7 +113,7 @@ export function saveOrUpdateSpecifyDateRoute(data) {
})
}
// id查询目的航班
// 通过id查询目的航班维度设置详情
export function findByFlightId(data) {
return request({
url: "/destinationFlight/findByFlightId",
......
......@@ -70,3 +70,22 @@ export const routeRuleForm = {
subCategory: [], // Sub Category
ruleDate: "",
};
// 校验表单域的选项
export const validateForm = [
"location",
"notLocation",
"destinationSite",
"notDestinationSite",
"includeUrsa",
"notIncludeUrsa",
"minNumOfPieces",
"maxNumOfPieces",
"minWeight",
"maxWeight",
"typeOfGoods",
"cargoType",
"puporpuxCode",
"serviceCode",
"handlingCode",
"subCategory",
];
......
......@@ -51,12 +51,12 @@
import YlForm from "@/components/YlForm";
import RouteInfo from "../components/routeInfo";
import YlDraggable from "@/components/YlDraggable";
import { formConfig, routeRuleForm } from "./formConfig";
import { formConfig, routeRuleForm, validateForm } from "./formConfig";
import {
updateOrAddFlight, // 修改
delFlightId, // 删除航线规则
enableOrDisable, // 是否停用/开启航线规则配
batchUpdateOrAddFlight, // 更新航线优先级
updateOrAddFlight, // 新增/修改航线规则设置
delFlightId, // 删除航线规则
enableOrDisable, // 开启/停用航线规则设
batchUpdateOrAddFlight, // 航班航线优先级更新
queryRouteByFltNo, // 通过航班号查询航线
} from "@/api/destinationFlight";
import indexMixins from "../mixins";
......@@ -96,161 +96,25 @@ export default {
*/
created() {
this.getAllDictData(); // 获取全部字典
let _this = this;
const parmas = {
querySpecifyData: this.$route.query.querySpecifyData || "", // 查询特殊数据字段
purposeOfFlightNo: this.$route.query.purposeOfFlightNo || "", // 航班号
flightDate: this.$route.query.flightDate || "", // 飞行日期
flightRouteListStr: this.$route.query.flightRouteListStr || "", // 飞行航线集合
status: this.$route.query.status || "", // 状态
dataStatus: this.$route.query.dataStatus || "", // add 、edit、view
flightKindName: this.$route.query.flightKindName || "", // 航班种类White Tail 、Purple Tail
pageName: this.$route.query.pageName || "", //
id: this.$route.query.id,
};
let dataStatus = this.$route.query.dataStatus || "";
if (dataStatus == "add") {
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = false;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = true;
}
}
});
} else {
//
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = true;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = false;
item.hidden = false;
}
}
});
}
// 航班配舱维度规则设置查询条件
let queryCondition = {
// 航班配舱设置
flightAllocConfig: {
noDateParmas: {
flightDate: "",
flightRoute: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: parmas.flightDate,
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 非日期级别
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") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
formConfig.map((item) => {
if (item.type !== "slot") {
if (item.label == "航线") {
item.hidden = true;
}
}
});
}
_this.queryForm = _this.$route.query; // 获取跳转过来的参数
},
},
// 航班信息维护
flightInformationMaintenance: {
noDateParmas: {
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
dateParmas: {
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightDate: parmas.flightDate,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
queryParmas: function () {
// White Tail
if (_this.$route.query.flightKindName == "White Tail") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
// Purple Tail
if (_this.$route.query.flightKindName == "Purple Tail") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
// 航班顺位设置
flightRandConfig: {
noDateParmas: {
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: parmas.flightDate,
flightRoute: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 普通级别
if (_this.$route.query.pageName == "flightRandConfig") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
// 【系统日志】DM数据处理
dmLog: {
queryParmas: function () {
if (_this.$route.query.pageName == "dmLog") {
_this.getFindByFlightId({
id: _this.$route.query.id,
});
}
},
},
};
/*
queryCondition只负责接收参数和数据调用
*/
// 航班配舱设置
queryCondition.flightAllocConfig.queryParmas();
// 航班信息维护
queryCondition.flightInformationMaintenance.queryParmas();
// 航班顺位设置
queryCondition.flightRandConfig.queryParmas();
// 【系统日志】DM数据处理
queryCondition.dmLog.queryParmas();
// 指定隐藏或显示From表单域
this.hiddenFormItem(parmas);
// queryCondition只负责接收参数和接口调用
this.queryCondition(parmas);
},
mounted() {},
methods: {
// 【通过航班号查询航线】
getQueryRouteByFltNo(parmas) {
queryRouteByFltNo(parmas)
.then((res) => {
......@@ -276,13 +140,15 @@ export default {
},
// 航班号输入框失焦事件
blurEvent({ purposeOfFlightNo }) {
// 航班号转大写
routeRuleForm.flightRoute = this.upCase(purposeOfFlightNo);
// 通过航班号查询航线
this.getQueryRouteByFltNo({ fltNo: this.upCase(purposeOfFlightNo) });
this.queryForm.purposeOfFlightNo = this.upCase(purposeOfFlightNo);
},
// 新增规则
addRlue(index) {
// 如果当前航班号的航线下没有数据
// 如果当前航班号的航线下没有数据,新增规则给默认数据
routeRuleForm.purposeOfFlightNo = this.$route.query.purposeOfFlightNo;
this.setattrVal(routeRuleForm);
const mergeObj = {
......@@ -291,7 +157,7 @@ export default {
};
this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据
},
// 保存
// 保存 【新增/修改航线规则设置】
saveSubmit(item, index) {
item.flightRoute = item.route || item.flightRoute;
item.ruleDate = item.ruleDate || this.queryForm.flightDate;
......@@ -330,25 +196,8 @@ export default {
return;
}
}
let keys = [
"location",
"notLocation",
"destinationSite",
"notDestinationSite",
"includeUrsa",
"notIncludeUrsa",
"minNumOfPieces",
"maxNumOfPieces",
"minWeight",
"maxWeight",
"typeOfGoods",
"cargoType",
"puporpuxCode",
"serviceCode",
"handlingCode",
"subCategory",
];
let validate = keys.some((key) => parmas[key]);
// 校验表单域的选项
let validate = validateForm.some((key) => parmas[key]);
if (validate) {
this.loading = true;
updateOrAddFlight(parmas)
......@@ -378,7 +227,7 @@ export default {
this.msgWarning("未添加规则信息,请添加后再保存!");
}
},
// 开启/暂停
// 开启/停用【开启/停用航线规则设置】
onOffSubmit(item, index) {
this.loading = true;
let tip = item.status == "1" ? "停用" : "启用";
......@@ -420,7 +269,7 @@ export default {
this.loading = false;
});
},
// 删除
// 删除航线规则设置
deleteSubmit(item, index) {
this.loading = true;
let parmas = {
......
import {
allDictData, // 获取全部字典
findDestinationFltRuleByFlightNo, // 航线维度设置详情
findByFlightId, // 通过id查询目的航班维度置详情
findByFlightId, // 通过id查询目的航班维度置详情
} from "@/api/destinationFlight";
import { formConfig, routeRuleForm } from "../flightRouteInfo/formConfig";
import { removeDuplicates } from "@/utils";
......@@ -27,6 +27,159 @@ export default {
},
},
methods: {
// 指定隐藏或显示From表单域
hiddenFormItem({ dataStatus, querySpecifyData }) {
// 指定隐藏或显示From表单域【add时】
if (dataStatus == "add") {
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = false;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = true;
}
}
});
} else {
// 【edit和view及空值时】
formConfig.map((item) => {
if (item.type !== "slot") {
item.disable = true;
if (item.label == "航班日期" || item.label == "航线") {
item.hidden = false;
}
}
});
}
// 【航班配舱设置】非日期级别
if (querySpecifyData == "2") {
formConfig.map((item) => {
if (item.type !== "slot") {
if (item.label == "航线") {
item.hidden = true;
}
}
});
}
// 【航班配舱设置】日期级别
if (querySpecifyData == "1") {
formConfig.map((item) => {
if (item.type !== "slot") {
if (item.label == "航线") {
item.hidden = true;
}
}
});
}
},
// 页面跳转传参
queryCondition(parmas) {
let _this = this;
// 航班配舱维度规则设置查询条件
let queryCondition = {
// 航班配舱设置
flightAllocConfig: {
noDateParmas: {
flightDate: "",
flightRoute: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: parmas.flightDate,
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 非日期级别
if (parmas.querySpecifyData == "2") {
_this.noDateLevelData(this.noDateParmas);
}
// 日期级别
if (parmas.querySpecifyData == "1") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
_this.queryForm = _this.$route.query; // 获取跳转过来的参数
},
},
// 航班信息维护
flightInformationMaintenance: {
noDateParmas: {
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
dateParmas: {
purposeOfFlightNo: parmas.purposeOfFlightNo,
flightDate: parmas.flightDate,
flightRouteListStr: parmas.flightRouteListStr,
status: "",
},
queryParmas: function () {
// White Tail
if (parmas.flightKindName == "White Tail") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
// Purple Tail
if (parmas.flightKindName == "Purple Tail") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
// 航班顺位设置
flightRandConfig: {
noDateParmas: {
flightRoute: "",
flightRouteListStr: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
dateParmas: {
flightDate: parmas.flightDate,
flightRoute: "",
purposeOfFlightNo: parmas.purposeOfFlightNo,
status: "",
},
queryParmas: function () {
// 普通级别
if (parmas.pageName == "flightRandConfig") {
_this.dateLevelData({
dateParmas: this.dateParmas,
noDateParmas: this.noDateParmas,
});
}
},
},
// 【系统日志】DM数据处理
dmLog: {
queryParmas: function () {
if (parmas.pageName == "dmLog") {
_this.getFindByFlightId({
id: parmas.id,
});
}
},
},
};
// 航班配舱设置
queryCondition.flightAllocConfig.queryParmas();
// 航班信息维护
queryCondition.flightInformationMaintenance.queryParmas();
// 航班顺位设置
queryCondition.flightRandConfig.queryParmas();
// 【系统日志】DM数据处理
queryCondition.dmLog.queryParmas();
},
// 获取所有数据字典
getAllDictData() {
allDictData()
......