Elements-SY

modify

......@@ -62,15 +62,12 @@ export function updateOrAddFlight(form) {
}
//删除规则
export function delFlightId(id) {
const data = {
id
}
export function delFlightId(data) {
return request({
url: '/destinationFlight/delFlightId',
method: 'post',
data: data
})
url: "/destinationFlight/delFlightId",
method: "post",
data: data,
});
}
//启用/停止规则
......
......@@ -10,18 +10,18 @@
<div
class="collapse-item-header"
v-for="(item, index) in routesInfo"
:key="item.route"
:key="item.route || item.flightRoute"
>
<el-collapse-item :name="index" v-if="showFlightRoute(item)">
<!-- 航线名 -->
<template slot="title">
<strong>{{ item.route }}</strong>
<strong>{{ item.route || item.flightRoute }}</strong>
</template>
<!-- 航线设置信息 -->
<div class="route-info info-item">
<el-card class="route-info-card">
<!-- 有数据时 -->
<section v-if="item.config">
<section v-if="item.config || item.flightRoute">
<div slot="header" class="route-config-header">
<el-button
type="primary"
......
......@@ -278,7 +278,8 @@ export default {
this.$set(this.routesInfo, index, mergeObj); // 给新增规则赋上默认数据
},
// 保存
saveSubmit(item) {
saveSubmit(item, index) {
item.flightRoute = item.route;
let parmas = JSON.parse(JSON.stringify(item));
this.returnString(parmas, "cargoType");
this.returnString(parmas, "typeOfGoods");
......@@ -339,7 +340,16 @@ export default {
.then((res) => {
const { code, msg, data } = res;
if (code == 200) {
this.$forceUpdate();
this.hasOwnProperty(data, "typeOfGoods");
this.hasOwnProperty(data, "puporpuxCode");
this.hasOwnProperty(data, "serviceCode");
this.hasOwnProperty(data, "handlingCode");
this.hasOwnProperty(data, "subCategory");
this.setattrVal(data); // 设置属性值
this.$set(this.routesInfo, index, {
config: true,
...data,
});
this.msgSuccess("保存成功!");
} else {
this.msgWarning(msg);
......@@ -365,53 +375,70 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
enableOrDisable(parmas)
.then((res) => {
const { code, msg, data } = res;
console.log(this.routesInfo);
console.log(index);
console.log(data);
if (code == 200) {
this.$forceUpdate();
this.msgSuccess(tip + "成功");
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
});
})
.then(() => {
enableOrDisable(parmas)
.then((res) => {
const { code, msg, data } = res;
if (code == 200) {
this.hasOwnProperty(data, "typeOfGoods");
this.hasOwnProperty(data, "puporpuxCode");
this.hasOwnProperty(data, "serviceCode");
this.hasOwnProperty(data, "handlingCode");
this.hasOwnProperty(data, "subCategory");
this.setattrVal(data); // 设置属性值
this.$set(this.routesInfo, index, {
config: true,
...data,
});
this.msgSuccess(tip + "成功");
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
this.loading = false;
});
},
// 删除
deleteSubmit(item) {
deleteSubmit(item, index) {
this.loading = true;
let parmas = {
id: item.id,
};
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton: true,
type: "warning",
}).then(() => {
delFlightId({ id: item.id })
.then((res) => {
const { code, msg, data } = res;
if (code == 200) {
console.log(this.routesInfo);
console.log(index);
console.log(data);
this.$forceUpdate();
this.msgSuccess(msg);
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
});
})
.then(() => {
delFlightId(parmas)
.then((res) => {
const { code, msg, data } = res;
if (code == 200) {
this.$set(this.routesInfo, index, {
route: item.flightRoute,
config: false,
});
this.msgSuccess(msg);
} else {
this.msgWarning(msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
this.loading = false;
});
},
},
};
......
......@@ -3,9 +3,17 @@ import {
findDestinationFltRuleByFlightNo, // 航线维度设置详情
findByFlightId, // 通过id查询目的航班维度配置详情
} from "@/api/destinationFlight";
import { routeRuleForm } from "../flightRouteInfo/formConfig";
import { formConfig, routeRuleForm } from "../flightRouteInfo/formConfig";
import { removeDuplicates } from "@/utils";
export default {
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
},
};
},
computed: {
// 获取路由参数
getRouter() {
......@@ -219,7 +227,7 @@ export default {
this.setattrVal(item); // 设置属性值
}
});
this.routeList = dateDataLists; // 航班航线列表
this.routeList = dateRouteList; // 航班航线列表
this.routesInfo = mergeDateRouteInfo; // 航班航线配置信息列表
}
if (dateConfigFlag == false) {
......@@ -269,7 +277,7 @@ export default {
// White Tail只展示当前查询的一条
const route = this.$route.query.flightRouteListStr;
let noDateRouteInfo, result;
this.routeList = noDateRouteLists;
this.routeList = dateRouteList;
// 从日期取
if (dateListHas.length) {
const dateRouteInfo = dateListHas.filter(
......@@ -325,8 +333,19 @@ export default {
this.setattrVal(item); // 设置属性值
}
});
this.routeList = dateDataLists;
this.routeList = dateRouteList;
this.routesInfo = dateList;
if (this.$route.query.flightKindName == "Purple Tail") {
let flightRouteListStr = [];
dateDataLists.map((item, i, arr) => {
if (arr[i].etesRule == "Y") {
flightRouteListStr.push(`${arr[i].route}(ET86)`);
} else {
flightRouteListStr.push(arr[i].route);
}
});
this.queryForm.flightRouteListStr = flightRouteListStr.join(";");
}
}
},
// 整合飞行航线配置信息
......
......@@ -379,7 +379,7 @@
>
<span style="float: left">{{ item.route }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.isEtesRoute == 'Y' ? '【ET86】航线' : ''
item.isEtesRoute == 'Y' ? '(ET86)' : ''
}}</span>
</el-option>
</el-select>
......@@ -405,7 +405,7 @@
>
<span style="float: left">{{ item.route }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.isEtesRoute == 'Y' ? '【ET86】航线' : ''
item.isEtesRoute == 'Y' ? '(ET86)' : ''
}}</span>
</el-option>
</el-select>
......@@ -1316,7 +1316,7 @@ export default {
if (routeInfo.isEtesRoute) {
let msg = routeInfo.fltNo + ": " + routeInfo.fltRoute.join(";");
this.$alert(
`当前${msg}为ET86航线,可在ET86规则设置查看`,
`当前${msg}为ET86航线,不可操作该按钮。可在ET86规则界面维护。`,
"提示",
{
confirmButtonText: "关闭",
......
......@@ -4,7 +4,7 @@ export const formConfig = [
type: "Input",
name: "searchValue",
prop: "searchValue",
placeholder: "根据Hscode查询",
placeholder: "根据HSCODE查询",
span: 6,
trigger: "blur", // 事件名
},
......