Elements-SY

modify

...@@ -1321,8 +1321,10 @@ export default { ...@@ -1321,8 +1321,10 @@ export default {
1321 ); 1321 );
1322 routeInfo.isEtesRoute = whiteEt86.length; 1322 routeInfo.isEtesRoute = whiteEt86.length;
1323 } 1323 }
1324 - }else{ 1324 + } else {
1325 - routeInfo.isEtesRoute = row.route.split(";").every((item) => et86RouteList.includes(item)); 1325 + routeInfo.isEtesRoute = row.route
1326 + .split(";")
1327 + .every((item) => et86RouteList.includes(item));
1326 } 1328 }
1327 } else { 1329 } else {
1328 this.msgError("暂无当前航班航线"); 1330 this.msgError("暂无当前航班航线");
...@@ -1403,7 +1405,6 @@ export default { ...@@ -1403,7 +1405,6 @@ export default {
1403 }) 1405 })
1404 .catch(() => {}); 1406 .catch(() => {});
1405 }, 1407 },
1406 -
1407 /** 提交按钮 */ 1408 /** 提交按钮 */
1408 submitForm: function () { 1409 submitForm: function () {
1409 this.$refs["form"].validate((valid) => { 1410 this.$refs["form"].validate((valid) => {
...@@ -1421,53 +1422,79 @@ export default { ...@@ -1421,53 +1422,79 @@ export default {
1421 } 1422 }
1422 if (valid) { 1423 if (valid) {
1423 let formdata = JSON.parse(JSON.stringify(this.form)); 1424 let formdata = JSON.parse(JSON.stringify(this.form));
1424 - //高价百分比和低价百分比和不可以大于100 1425 + let params = {
1425 - if ( 1426 + fltNo: formdata.fltNo,
1426 - this.form.highLowPriceFlg && 1427 + };
1427 - (formdata.highPriceWeightPercent > 100 || 1428 + queryRoute(params)
1428 - formdata.highPriceWeightPercent < 0) 1429 + .then((res) => {
1429 - ) { 1430 + const { code, data, msg } = res;
1430 - this.$message.warning("请正确填写高低价百分比"); 1431 + if (code == 200) {
1431 - return; 1432 + // 按照route数组的顺序排序
1432 - } 1433 + let sortRoute = data.list.sort((a, b) => {
1433 - //已删除的无法修改 1434 + return (
1434 - //拿到已删除的id 1435 + formdata.route.indexOf(a.route) -
1435 - let statusId = 0; 1436 + formdata.route.indexOf(b.route)
1436 - this.selectOption.flightStatuslist.map((item) => { 1437 + );
1437 - // this.unitList 是你 select option遍历的集合 e 是选中的id 1438 + });
1438 - if (item.chineseName === "已删除") { 1439 + // 过滤掉不在route数组中的字符串
1439 - statusId = item.id; 1440 + let reuslt = sortRoute.filter((item) => {
1440 - return; 1441 + return formdata.route.indexOf(item.route) !== -1;
1441 - } 1442 + });
1442 - }); 1443 + let sortRoutes = [];
1443 - if (statusId === formdata.statusId) { 1444 + reuslt.map((item) => {
1444 - this.$message.warning("已删除的航班无法修改"); 1445 + sortRoutes.push(item.route);
1445 - return; 1446 + });
1446 - } 1447 + formdata.route = sortRoutes;
1447 - //是否开启高低价 1448 + //高价百分比和低价百分比和不可以大于100
1448 - // formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0; 1449 + if (
1449 - //是否预审 1450 + this.form.highLowPriceFlg &&
1450 - // formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0; 1451 + (formdata.highPriceWeightPercent > 100 ||
1451 - //总重量更新 1452 + formdata.highPriceWeightPercent < 0)
1452 - // formdata.totalWeight = this.Weightall() 1453 + ) {
1453 - formdata.route = this.form.route.toString().replace(/,/g, ";"); 1454 + this.$message.warning("请正确填写高低价百分比");
1454 - if ( 1455 + return;
1455 - this.form.extraWeightPercent == undefined || 1456 + }
1456 - this.form.extraWeightPercent == null 1457 + //已删除的无法修改
1457 - ) { 1458 + //拿到已删除的id
1458 - formdata.extraWeightPercent = 0; 1459 + let statusId = 0;
1459 - } 1460 + this.selectOption.flightStatuslist.map((item) => {
1460 - //处理数据 1461 + // this.unitList 是你 select option遍历的集合 e 是选中的id
1461 - saveOrUpdate(formdata).then((response) => { 1462 + if (item.chineseName === "已删除") {
1462 - if (response.code === 200) { 1463 + statusId = item.id;
1463 - this.msgSuccess("保存成功"); 1464 + return;
1464 - this.routeList = []; 1465 + }
1465 - this.open = false; 1466 + });
1466 - this.findAllFltData(); 1467 + if (statusId === formdata.statusId) {
1467 - } else { 1468 + this.$message.warning("已删除的航班无法修改");
1468 - this.msgError(response.msg); 1469 + return;
1469 - } 1470 + }
1470 - }); 1471 + //是否开启高低价
1472 + // formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0;
1473 + //是否预审
1474 + // formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0;
1475 + //总重量更新
1476 + // formdata.totalWeight = this.Weightall()
1477 + formdata.route = this.form.route.toString().replace(/,/g, ";");
1478 + if (
1479 + this.form.extraWeightPercent == undefined ||
1480 + this.form.extraWeightPercent == null
1481 + ) {
1482 + formdata.extraWeightPercent = 0;
1483 + }
1484 + //处理数据
1485 + saveOrUpdate(formdata).then((response) => {
1486 + if (response.code === 200) {
1487 + this.msgSuccess("保存成功");
1488 + this.routeList = [];
1489 + this.open = false;
1490 + this.findAllFltData();
1491 + } else {
1492 + this.msgError(response.msg);
1493 + }
1494 + });
1495 + }
1496 + })
1497 + .catch(() => {});
1471 } 1498 }
1472 }); 1499 });
1473 }, 1500 },
......