<template>
  <!-- 修改装车作业页面 -->
  <div id="contractDetails">
    <page-title>装车作业</page-title>

    <div class="main">
      <span class="text">修改装车作业</span>
      <span class="a"></span>
    </div>

    <div class="contractTitle">
      <div class="form-box">
        <div class="form-one">
          <dil-form :formId="172" v-model="form1"></dil-form>
        </div>
      </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: {},
      // 表格
      table1: {},
      contractId: "",
    };
  },
  mounted() {
    this.information();
  },
  methods: {
  information() {
      //编辑运输计划
      this.axios
        .post("/api/v1/tms/getLoadResultById/" + this.$route.params.resultId)
        .then((res) => {
          res.data.data.forEach((e) => {
            this.form1 = e;
          });
        });
    },

    handleCheckedCitiesChange(value) {
      console.log(value);
    },
    // 返回
    onClickCancel() {
      this.$router.go(-1);
    },
    // 确认
    onClickConfirm() {
      let LR = {
        resultId: this.$route.params.resultId,
        resultLoadStartTime: sjTime(this.form1.resultLoadStartTime),
        insertUpdateRemark: this.form1.insertUpdateRemark,
        resultIsclear: this.form1.resultIsclear
      };
    
      var val = this.value;
      if (
        LR.resultIsclear==null||
        LR.resultLoadStartTime==null||
        LR.insertUpdateRemark==null
  
      ) this.$message.error("存在空值！");
      else
      this.axios
        .post("/api/v1/tms/updateLoadResult", LR)
        .then(() => {
          this.$message({
            type: "success",  
            message: "修改成功!",
          });
          this.$router.push("/truckLoadResult");
        });
    },
  },
};
</script>
<style lang="scss" scoped>
//@import "@/styles/appoint/contract/ContractInsert.scss";
</style>