<template>
  <!-- 添加货权转移实绩 -->
  <div class="shipTransport">
    <page-title>返回</page-title>
    <div class="form">
      <div class="form_box">
          <dil-form :formId="137" v-model="form1"></dil-form>
      </div>        
    </div>
    <!-- 确定和取消 -->
    <div class="button_box">
      <el-button @click="onClickCancel">返回</el-button>
      <el-button type="primary" @click="onClickConfirm">确认</el-button>
    </div>
  </div>
</template>

<script>
import PageTitle from "@/components/Page/Title";
export default {
  components: { PageTitle },
    data(){
          return {
          form1: {},
        }
    },
  mounted() {
    this.information();
  },
  methods: {
    information() {
      //编辑请车作业
      this.axios
        .post("/api/v1/tms/selectByCargoTranferResultId/" + this.$route.params.cargoTransferResultId)
        .then((res) => {
          res.data.data.forEach((e) => {
            this.form1 = e;
            console.log(e);
            console.log(this.form1);
            console.log(this.$route.params.pathId);
          });
        });
    },
    // 确认
    onClickConfirm() {
      let AmsshipCargoTransferResult = {
        cargoTransferResultId: this.$route.params.cargoTransferResultId,
        carrierId: this.form1.carrierId,
        groupId: this.form1.groupId,
     
        resultTelephoneFax: this.form1.resultTelephoneFax,
        resultContactPerson:this.form1.resultContactPerson,
        batchId:this.form1.batchId,
        resultNumberOfLoans: this.form1.resultNumberOfLoans,
        resultFreignForwardingInfo: this.form1.resultFreignForwardingInfo,
        resultMemo: this.form1.resultMemo,
      };
      this.axios
        .post("/api/v1/tms/editCargoTransferResult" ,
         AmsshipCargoTransferResult
        )
        .then(() => {
          this.$message({
            type: "success",  
            message: "修改成功!",
          });
          this.$router.go(-1);
        });
    },
      // 返回
    onClickCancel() {
      this.$router.go(-1);
    },
  },
};
</script>
<style lang="scss">
.shipTransport{
  .form{
    display: flex;
    .form_box{
      width: 320px;
      margin-left: 35%;
      margin-top: 30px;
      margin-right: 20px;
      .el-form{
        .preview-group{
          .el-form-item{
            .el-form-item__label{
              display: inline-block;
              width: 70px !important;
            }
            .el-form-item__content{
              .el-select{
                width: 250px;
              }
              .el-input{
                width: 250px;
              }
            }
          }
        }
      }
    }
  }
  .button_box{
    margin-left: 45%;
  }
}
</style>
