inTransitWarn.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <!-- 是否开启运输预警开关 -->
  3. <div class="addWagonLoad">
  4. <page-title>请选择需要开启的预警物料</page-title>
  5. <el-divider content-position="left">请选择报警类型</el-divider>
  6. <div style="width:100%;text-align:center;">
  7. <el-radio v-model="radio" label="0">关闭</el-radio>
  8. <el-radio v-model="radio" label="1">异常线路预警</el-radio>
  9. <el-radio v-model="radio" label="2">异常线路预警+停车</el-radio>
  10. <el-radio v-model="radio" label="3">异常线路预警+离线</el-radio>
  11. <el-radio v-model="radio" label="4">异常线路预警+停车+离线</el-radio>
  12. </div>
  13. <div class="button-box">
  14. <el-button @click="cancel">取消</el-button>
  15. <el-button type="primary" @click="makeSure">确定</el-button>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import PageTitle from "@/components/Page/Title";
  21. export default {
  22. components: { PageTitle },
  23. data() {
  24. return {
  25. checkList:[],
  26. checktype:[],
  27. form1: {},
  28. radio:'0',
  29. value: undefined,
  30. };
  31. },
  32. created(){
  33. this.switchEcho();
  34. },
  35. mounted() {},
  36. methods: {
  37. // 确定
  38. makeSure() {
  39. this.axios.post(
  40. "/api/v1/otms/inTransitWarn?warnSwitch="+1+"&radio="+this.radio,
  41. )
  42. .then((res) => {
  43. this.$message({
  44. type: "success",
  45. message: "操作成功!",
  46. });
  47. this.switchEcho();
  48. });
  49. },
  50. // 取消
  51. cancel() {
  52. // this.$router.go(-1);
  53. },
  54. switchEcho(){
  55. let that=this;
  56. that.axios.post("/api/v1/otms/selectWarnSwitch").then((res) => {
  57. if(res.data.status=="succeed"){
  58. let arry=res.data.data.switch;
  59. this.radio=res.data.data.type;
  60. }
  61. });
  62. }
  63. },
  64. };
  65. </script>
  66. <style lang='scss' scoped>
  67. </style>