shanyunduo.cheng

航班停用后再删除

......@@ -31,11 +31,7 @@
@click="$router.push({ name: 'Add', params: { handle: 'add' } })"
>添加</el-button
>
<el-table
:data="flyList"
v-loading="loading"
size="small"
>
<el-table :data="flyList" v-loading="loading" size="small">
<el-table-column
prop="purposeOfFlightNo"
label="航班号"
......@@ -56,7 +52,7 @@
<el-table-column prop="createTime" label="更新时间" align="center">
<template slot-scope="scope">
{{scope.row.createTime | formatTimer}}
{{ scope.row.createTime | formatTimer }}
</template>
</el-table-column>
......@@ -80,7 +76,7 @@
type="text"
size="mini"
icon="el-icon-delete"
@click="del(scope.row.id)"
@click="del(scope.row.id, scope.row.status)"
>删除</el-button
>
<el-button
......@@ -99,7 +95,6 @@
v-else
>启用</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -126,9 +121,7 @@ import {
enableOrDisable,
} from "@/api/destinationFlight";
import {
parseTime
} from "@/utils/FedEx";
import { parseTime } from "@/utils/FedEx";
export default {
data() {
......@@ -176,10 +169,18 @@ export default {
});
},
//删除规则
del(id) {
del(id, status) {
if (status == "1") {
this.$confirm("航班规则生效中,无法删除,请停用后再操作", "警告", {
confirmButtonText: '确定',
showCancelButton:false,
type: "warning",
});
} else {
this.$confirm("是否确认删除此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showCancelButton:true,
type: "warning",
})
.then(function () {
......@@ -190,6 +191,7 @@ export default {
this.msgSuccess("删除成功");
})
.catch(function () {});
}
},
//启用,停用
changeStatus(id, status) {
......@@ -208,18 +210,18 @@ export default {
})
.catch(function () {});
},
parseDate(time){
parseDate(time) {
// debugger
let str = new Date(time).format("yyyy-MM-dd");
// let str = parseTime(date, 'yyyy-dd-mm');
return str;
}
},
},
created() {
this.getList();
},
filters: {
formatTimer: function(value) {
formatTimer: function (value) {
let date = new Date(value);
let y = date.getFullYear();
let MM = date.getMonth() + 1;
......@@ -233,7 +235,7 @@ export default {
let s = date.getSeconds();
s = s < 10 ? "0" + s : s;
return y + "-" + MM + "-" + d + " " + h + ":" + m + ":" + s;
}
},
},
};
</script>
......