editCapacity.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2.   <!-- 修改运力信息 -->
  3.   <div id="contractDetails">
  4.     <page-title>编辑</page-title>
  5.     <div class="main">
  6.       <span class="text">运力信息</span>
  7.     </div>
  8.     <div class="contractTitle">
  9.       <div class="form-box">
  10.         <div class="form-one">
  11.           <dil-form :formId="310" v-model="form1"></dil-form>
  12.         </div>
  13.       </div>
  14.     </div>
  15.     <div class="button-box">
  16.       <el-button type="primary" @click="onClickConfirm">确认</el-button>
  17.       <el-button @click="onClickCancel">返回</el-button>
  18.     </div>
  19.   </div>
  20. </template>
  21. <script>
  22. import PageTitle from "@/components/Page/Title";
  23. export default {
  24.   components: { PageTitle },
  25.   data() {
  26.     return {
  27.       form1: {},
  28.     };
  29.   },
  30.   mounted() {
  31.       console.log(this.$route)
  32.     this.information();
  33.   },
  34.   methods: {
  35.     information() {
  36.       //编辑
  37. console.log(this.$route.params)
  38.       this.axios
  39.         .post(
  40.           "/api/v1/rms/getCapacityById/" +
  41.             this.$route.params.capacityId
  42.         )
  43.         .then((res) => {
  44. console.log(res.data.data)
  45.           res.data.data.forEach((e) => {
  46.             this.form1 = e;
  47.             console.log(e);
  48.             console.log(this.form1);
  49.             console.log( this.$route.params.capacityId);
  50.           });
  51.         });
  52.     },
  53.     // 返回
  54.     onClickCancel() {
  55.       this.$router.go(-1);
  56.     },
  57.     // 确认
  58.     onClickConfirm() {
  59.       console.log(this.form1)
  60.     let RmsCapacity={
  61. capacityId:this.form1.capacityId,
  62. capacityTypeId:this.form1.capacityTypeId,
  63. capacityNumber:this.form1.capacityNumber.toUpperCase(),
  64. capacityCorlor:this.form1.capacityCorlor,
  65. capacityOwneris:this.form1.capacityOwneris,
  66. capacityVip:this.form1.capacityVip,
  67. capacityBlacklist:this.form1.capacityBlacklist,
  68. carrierId:this.form1.carrierId,
  69. };if(
  70. RmsCapacity.capacityNumber==null ||
  71. RmsCapacity.capacityCorlor==null ||
  72. RmsCapacity.capacityOwneris==null ||
  73. RmsCapacity.capacityVip==null ||
  74. RmsCapacity.capacityBlacklist==null ||
  75. RmsCapacity.carrierId==null
  76. )this.$message.error("存在空值!");
  77. console.log( this.$route.params.capacityId);
  78.         this.axios
  79.           .post(
  80.             "/api/v1/rms/updateCapacity",
  81.            RmsCapacity
  82.           )
  83.           .then((res) => {
  84.             if (res.data.code == "200") {
  85.               this.$router.go(-1);
  86.             }
  87.           });
  88.     },
  89.   },
  90. };
  91. </script>
  92. <style lang='scss' scoped>
  93. .form-box,
  94. .button-box{
  95. display: flex;
  96. text-align: center;
  97. align-items: center;
  98. justify-content: center;
  99. margin-top: 0.3125rem;
  100. margin-bottom: 1.25rem;
  101. }
  102. </style>