Elements-SY

modify

......@@ -1321,8 +1321,10 @@ export default {
);
routeInfo.isEtesRoute = whiteEt86.length;
}
}else{
routeInfo.isEtesRoute = row.route.split(";").every((item) => et86RouteList.includes(item));
} else {
routeInfo.isEtesRoute = row.route
.split(";")
.every((item) => et86RouteList.includes(item));
}
} else {
this.msgError("暂无当前航班航线");
......@@ -1403,7 +1405,6 @@ export default {
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
......@@ -1421,53 +1422,79 @@ export default {
}
if (valid) {
let formdata = JSON.parse(JSON.stringify(this.form));
//高价百分比和低价百分比和不可以大于100
if (
this.form.highLowPriceFlg &&
(formdata.highPriceWeightPercent > 100 ||
formdata.highPriceWeightPercent < 0)
) {
this.$message.warning("请正确填写高低价百分比");
return;
}
//已删除的无法修改
//拿到已删除的id
let statusId = 0;
this.selectOption.flightStatuslist.map((item) => {
// this.unitList 是你 select option遍历的集合 e 是选中的id
if (item.chineseName === "已删除") {
statusId = item.id;
return;
}
});
if (statusId === formdata.statusId) {
this.$message.warning("已删除的航班无法修改");
return;
}
//是否开启高低价
// formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
//是否预审
// formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//总重量更新
// formdata.totalWeight = this.Weightall()
formdata.route = this.form.route.toString().replace(/,/g, ";");
if (
this.form.extraWeightPercent == undefined ||
this.form.extraWeightPercent == null
) {
formdata.extraWeightPercent = 0;
}
//处理数据
saveOrUpdate(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.routeList = [];
this.open = false;
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
let params = {
fltNo: formdata.fltNo,
};
queryRoute(params)
.then((res) => {
const { code, data, msg } = res;
if (code == 200) {
// 按照route数组的顺序排序
let sortRoute = data.list.sort((a, b) => {
return (
formdata.route.indexOf(a.route) -
formdata.route.indexOf(b.route)
);
});
// 过滤掉不在route数组中的字符串
let reuslt = sortRoute.filter((item) => {
return formdata.route.indexOf(item.route) !== -1;
});
let sortRoutes = [];
reuslt.map((item) => {
sortRoutes.push(item.route);
});
formdata.route = sortRoutes;
//高价百分比和低价百分比和不可以大于100
if (
this.form.highLowPriceFlg &&
(formdata.highPriceWeightPercent > 100 ||
formdata.highPriceWeightPercent < 0)
) {
this.$message.warning("请正确填写高低价百分比");
return;
}
//已删除的无法修改
//拿到已删除的id
let statusId = 0;
this.selectOption.flightStatuslist.map((item) => {
// this.unitList 是你 select option遍历的集合 e 是选中的id
if (item.chineseName === "已删除") {
statusId = item.id;
return;
}
});
if (statusId === formdata.statusId) {
this.$message.warning("已删除的航班无法修改");
return;
}
//是否开启高低价
// formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
//是否预审
// formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
//总重量更新
// formdata.totalWeight = this.Weightall()
formdata.route = this.form.route.toString().replace(/,/g, ";");
if (
this.form.extraWeightPercent == undefined ||
this.form.extraWeightPercent == null
) {
formdata.extraWeightPercent = 0;
}
//处理数据
saveOrUpdate(formdata).then((response) => {
if (response.code === 200) {
this.msgSuccess("保存成功");
this.routeList = [];
this.open = false;
this.findAllFltData();
} else {
this.msgError(response.msg);
}
});
}
})
.catch(() => {});
}
});
},
......