editConsignee.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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="368" 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/getConsigneeById/" +
  41.             this.$route.params.consigneeId
  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.consigneeId);
  50.           });
  51.         });
  52.     },
  53.     // 返回
  54.     onClickCancel() {
  55.       this.$router.go(-1);
  56.     },
  57.     // 确认
  58.     onClickConfirm() {
  59.       console.log(this.form1)
  60.     let RmsConsignee={
  61. consigneeId:this.form1.consigneeId,
  62. companyName:this.form1.companyName,
  63. consigneeAbbreviation:this.form1.consigneeAbbreviation,
  64. consigneeRegisteredAddress:this.form1.consigneeRegisteredAddress,
  65. consigneeReceiveAddress:this.form1.consigneeReceiveAddress,
  66. consigneeRegistrationTime:this.form1. consigneeRegistrationTime,
  67. consigneeContactName:this.form1.consigneeContactName,
  68. consigneeContactTel:this.form1.consigneeContactTel,
  69. };
  70. if(
  71. RmsConsignee.consigneeId == null ||
  72. RmsConsignee.companyName == null ||
  73. RmsConsignee.consigneeAbbreviation==null ||
  74. RmsConsignee. consigneeRegisteredAddress ==null ||
  75. RmsConsignee.consigneeReceiveAddress == null ||
  76. RmsConsignee.consigneeRegistrationTime == null ||
  77. RmsConsignee.consigneeContactName == null ||
  78. RmsConsignee.consigneeContactTel == null
  79. )this.$message.error("存在空值!");
  80. console.log( this.$route.params.consigneeId);
  81.         this.axios
  82.           .post(
  83.             "/api/v1/rms/updateConsignee",
  84.            RmsConsignee
  85.           )
  86.           .then((res) => {
  87.             if (res.data.code == "200") {
  88.               this.$router.go(-1);
  89.             }
  90.           });
  91.     },
  92.   },
  93. };
  94. </script>
  95. <style lang='scss' scoped>
  96. .form-box {
  97. width: 100%;
  98. margin-top: 30px;
  99. display: flex;
  100. justify-content: center;
  101. .el-form-item{
  102. display: flex;
  103. justify-content: center;
  104. .el-form-item__label{
  105. display: flex;
  106. align-items: center;
  107. }
  108. .el-form-item__content{
  109. .el-select{
  110. width: 250px;
  111. }
  112. .el-input{
  113. width: 250px;
  114. }
  115. }
  116. .el-radio{
  117. width: 25px;
  118. }
  119. }
  120. }
  121. .button-box{
  122. display: flex;
  123. justify-content: center;
  124. .el-button{
  125. width: 80px;
  126. margin-right: 10px;
  127. }
  128. }
  129. </style>