Elements-SY

modify

......@@ -74,17 +74,13 @@ export function delFlightId(id) {
}
//启用/停止规则
export function enableOrDisable(id, status) {
export function enableOrDisable(data) {
//statsu 1-有效 3-停用
const data = {
id,
status
}
return request({
url: '/destinationFlight/enableOrDisable',
method: 'post',
data: data
})
url: "/destinationFlight/enableOrDisable",
method: "post",
data: data,
});
}
//获取全部字典
......
......@@ -28,7 +28,7 @@
size="mini"
:disabled="pageName || item.status == '3' || status"
:loading="item.loading"
@click="saveSubmit(item)"
@click="saveSubmit(item, index)"
>保 存</el-button
>
<el-button
......@@ -38,7 +38,7 @@
icon="el-icon-video-pause"
:loading="item.loading"
:disabled="pageName || status"
@click="onOffSubmit(item)"
@click="onOffSubmit(item, index)"
>{{ item.status | statusBtn }}</el-button
>
<el-button
......@@ -48,7 +48,7 @@
icon="el-icon-delete"
:disabled="pageName || item.status !== '3' || status"
:loading="item.loading"
@click="deleteSubmit(item)"
@click="deleteSubmit(item, index)"
>删 除</el-button
>
<span class="flight-route-title">
......@@ -593,16 +593,16 @@ export default {
this.$emit("addRlue", index);
},
// 保存
saveSubmit(item) {
this.$emit("save", item);
saveSubmit(item, index) {
this.$emit("save", item, index);
},
// 开启/暂停
onOffSubmit(item) {
this.$emit("onOff", item);
onOffSubmit(item, index) {
this.$emit("onOff", item, index);
},
// 删除
deleteSubmit(item) {
this.$emit("delete", item);
deleteSubmit(item, index) {
this.$emit("delete", item, index);
},
},
};
......@@ -626,7 +626,6 @@ export default {
border-bottom: 1px solid #ccc;
}
.el-collapse-item:last-child {
}
.route-container {
strong {
......
......@@ -337,7 +337,7 @@ export default {
this.loading = true;
updateOrAddFlight(parmas)
.then((res) => {
const { code, msg } = res;
const { code, msg, data } = res;
if (code == 200) {
this.$forceUpdate();
this.msgSuccess("保存成功!");
......@@ -349,22 +349,29 @@ export default {
.catch(() => {
this.loading = false;
});
}else{
this.msgWarning('未添加规则信息,请添加后再保存!')
} else {
this.msgWarning("未添加规则信息,请添加后再保存!");
}
},
// 开启/暂停
onOffSubmit(item) {
onOffSubmit(item, index) {
this.loading = true;
let tip = item.status == "1" ? "停用" : "启用";
let parmas = {
id: item.id,
status: item.status == "1" ? "3" : "1",
};
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
enableOrDisable({ id: item.id, status: item.status == "1" ? "3" : "1" })
enableOrDisable(parmas)
.then((res) => {
const { code, msg } = res;
const { code, msg, data } = res;
console.log(this.routesInfo);
console.log(index);
console.log(data);
if (code == 200) {
this.$forceUpdate();
this.msgSuccess(tip + "成功");
......@@ -389,8 +396,11 @@ export default {
}).then(() => {
delFlightId({ id: item.id })
.then((res) => {
const { code, msg } = 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 {
......