shanyunduo.cheng

停用、启用和跳转

......@@ -49,6 +49,21 @@ export function delFlightId(id){
})
}
//启用/停止规则
export function enableOrDisable(id, status){
//statsu 1-有效 3-停用
const data = {
id,
status
}
return request({
url: '/destinationFlight/enableOrDisable',
method: 'post',
data: data
})
}
//申报类别
export function cargoTypeData(){
return request({
......
......@@ -74,10 +74,18 @@
@click="del(scope.row.id)"
>删除</el-button
>
<el-button type="text" size="mini" icon="el-icon-video-play"
<el-button
type="text"
size="mini"
icon="el-icon-video-play"
@click="changeStatus(scope.row.id, 1)"
>启用</el-button
>
<el-button type="text" size="mini" icon="el-icon-video-pause"
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
@click="changeStatus(scope.row.id, 3)"
>停用</el-button
>
</template>
......@@ -100,7 +108,11 @@
</template>
<script>
import { findFlightNo, delFlightId } from "@/api/destinationFlight";
import {
findFlightNo,
delFlightId,
enableOrDisable,
} from "@/api/destinationFlight";
export default {
data() {
......@@ -145,7 +157,8 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(function () {
})
.then(function () {
return delFlightId(id);
})
.then(() => {
......@@ -154,8 +167,23 @@ export default {
})
.catch(function () {});
},
//删除,启用,停用
changeStatus(id, handle) {},
//启用,停用
changeStatus(id, status) {
let tip = status === 1 ? "启用" : "停用";
this.$confirm("是否确认" + tip + "此航班规则?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return enableOrDisable(id, status);
})
.then(() => {
this.getList();
this.msgSuccess(tip + "成功");
})
.catch(function () {});
},
},
created() {
this.getList();
......
......@@ -189,12 +189,13 @@ export default {
type: 'success'
});
}
this.btnLoading = false;
this.close();
});
this.form.typeOfGoods = this.typeOfGoods;
this.form.declarationCategory = this.declarationCategory;
this.form.serviceCode = this.formServiceCode;
this.form.subCategory = this.formSubCategory;
this.btnLoading = false;
},
close() {
......