inTransitWarn.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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="form-box" style="margin-right: 10rem">
  14. <!-- <dil-form :formId="244" v-model="form1" ref="from1"></dil-form> -->
  15. </div>
  16. <div class="button-box">
  17. <el-button @click="cancel">取消</el-button>
  18. <el-button type="primary" @click="makeSure">确定</el-button>
  19. </div>
  20. <!-- <div class="primarybtn">
  21. <el-button class="btn" @click="goback">取消</el-button>
  22. <el-button type="primary" class="btn" @click="submitclick"
  23. >确定</el-button
  24. >
  25. </div> -->
  26. </div>
  27. </template>
  28. <script>
  29. import PageTitle from "@/components/Page/Title";
  30. export default {
  31. components: { PageTitle },
  32. data() {
  33. return {
  34. checkList:[],
  35. checktype:[],
  36. form1: {},
  37. radio:'1',
  38. value: undefined,
  39. };
  40. },
  41. created(){
  42. this.switchEcho();
  43. },
  44. mounted() {},
  45. methods: {
  46. // 确定
  47. makeSure() {
  48. this.axios
  49. .post(
  50. "/api/v1/otms/inTransitWarn?warnSwitch="+'1'+"&radio="+this.radio,
  51. )
  52. .then((res) => {
  53. console.log(res);
  54. // console.log(this.form4);
  55. this.$message({
  56. type: "success",
  57. message: "操作成功!",
  58. });
  59. this.$router.go(-1);
  60. });
  61. },
  62. // 取消
  63. cancel() {
  64. this.$router.go(-1);
  65. },
  66. switchEcho(){
  67. let that=this;
  68. that.axios.post("/api/v1/otms/selectWarnSwitch").then((res) => {
  69. if(res.data.status=="succeed"){
  70. let arry=res.data.data.switch;
  71. this.radio=res.data.data.type;
  72. console.log(this.radio)
  73. }
  74. });
  75. }
  76. },
  77. };
  78. </script>
  79. <style lang='scss' scoped>
  80. </style>