<template>
  <!-- 修改承运商信息 -->
  <div id="contractDetails">
    <page-title>编辑</page-title>
    <div class="main">
      <span class="text">承运商信息</span>
    </div>
    <div class="contractTitle">
      <div class="form-box">
        <div class="form-one">
          <dil-form :formId="330" v-model="form1"></dil-form>
        </div>
      </div>
    </div>

    <div class="button-box">
      <el-button type="primary" @click="onClickConfirm">确认</el-button>
      <el-button @click="onClickCancel">返回</el-button>
    </div>
  </div>
</template>

<script>
import PageTitle from "@/components/Page/Title";

export default {
  components: { PageTitle },
  data() {
    return {
      form1: {},
    };
  },
 
  mounted() {
      console.log(this.$route)
    this.information();
  },
  methods: {
    information() {
      //编辑
      this.axios
        .post(
          "/api/v1/rms/getCarrierById/" +
            this.$route.params.carrierId
        )
        .then((res) => {
            console.log(res)
          res.data.data.forEach((e) => {
            this.form1 = e;
            console.log(e);
            console.log(this.form1);
            console.log(this.$route.params.carrierId);
          });
        });
    },
    // 返回
    onClickCancel() {
      this.$router.go(-1);
    },
    // 确认
    onClickConfirm() {  
       let RmsCarrier={
        carrierId:this.from1.carrierId,
        carrierName:this.form1.carrierName,
        carrierTransportCertificate:this.form1.carrierTransportCertificate,
        carrierBusinessLicense:this.form1.carrierBusinessLicense,
        carrierBusinessAblelicense:this.form1.carrierBusinessAblelicense,
        carrierAbbreviation:this.form1.carrierAbbreviation,
        carrierAddress:this.form1.carrierAddress,
        registerNo:this.form1.registerNo,
        carrierBidAreaId:this.form1.carrierBidArea,
        carrierLegalRepresentative:this.form1.carrierLegalRepresentative,
        registerCapital:this.form1.registerCapital,
        businessScope:this.form1.businessScope,
        annualDate:this.form1.annualDate,
        companyStatusDesc:this.form1.companyStatusDesc,
        companyTypeDesc:this.form1.companyTypeDesc,
        operationPeriod:this.form1.operationPeriod,
        registerDate: sjTime(this.form1.registerDate),
        registerOrganization:this.form1.registerOrganization,
        registerAptitudes:this.form1.registerAptitudes,
        contactsName:this.form1.contactsName,
        carrierContactNumber:this.form1.carrierContactNumber,
        carrierType:this.form1.carrierType,
        carrierTransportType:this.form1.carrierTransportType
      };
        this.axios
          .post(
            "/api/v1/rms/updateCarrier",
            RmsCarrier
          )
          .then((res) => {
            if (res.data.code == "200") {
              this.$router.go(-1);
            }
          });
    },
  },
};
</script>
<style lang="scss" scoped>

</style>