//修改计划
<template>
  <div id="endMaintenance">
    <page-title>修改计划</page-title>
    <div class="main">
      <span class="text">修改</span>
      <span class="a"></span>
    </div>
    <div>
      <div class="form-box" style="margin-left: 5rem">
        <dil-form :formId="307" v-model="form"></dil-form>       
      </div>
    </div>
    <template>
			<div>		
						<dilTable v-bind.sync="first" >
						</dilTable>
            </div>
		</template>
    <div class="" style="margin-left:40rem">
      <el-button type="primary" @click="makeSure">确认修改</el-button>
      <el-button type="primary" @click="cancel">返回</el-button>
    </div>
  </div>
</template>

<script>
import PageTitle from "@/components/Page/Title";
import { sjTime } from "@/js/sharedJsFile";
export default {
  components: { PageTitle },
  data() {
    return {
      form: {},
      first:{
        requestUrl:"/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
      }
    };
  },
  mounted(){
      this.information();
  },
  methods: {
    information(){
         this.$axios
        .post("api/v1/ams/selectInwardPlanToUpdate/" + this.$route.params.planId)
        .then((res) => {
          res.data.data.forEach((e) => {
            this.form= e;
            console.log(e);
            console.log(this.form1);
            console.log(this.$route.params.resultId);
          });
        });
    },
    // 修改
    makeSure() {
      console.log(this.form)
      let plan = {
        requirementId : this.mapList.requirementId,
        planTruckNumber: this.form.planTruckNumber,
        carrierId: this.form.carrierId
      };
          
      this.$axios
        .post(
          "/api/v1/ams/addTruckPlan",
          plan
        )
        .then((res) => {
            console.log(res)
          if (res.data.code == 200) {
            this.$message({
              type: "success",
              message: "新增成功!",
            });            
            this.$router.go(-1);
          } else {
            this.$message.error("新增失败！");
          }
        });
    },
    // 返回
    cancel() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="scss">
#pageTitle {
    border-bottom: 0.125rem solid $borderColorPageTitlte;
    background-color: $backgroundColorPageTitle;
    padding-left: 3.125rem;
    margin-bottom: 1.875rem;
    span {
      font-size: 1.5rem;
      line-height: 4.375rem;
      color: $fontColorPageTitle;
    }
    i {
      cursor: pointer;
      border: 0.0625rem solid $fontColorPageTitle;
      color: $fontColorPageTitle;
      border-radius: 100%;
      margin-right: 1.25rem;
      // 图标放大
      transform: scale(1.6, 1.6);
    }
  }
  #query_condition{
    margin-left: 3rem;
  }
  .button-box {
    display: flex;
    justify-content: center;
    .el-button + .el-button {
      margin-left: 3rem;
    }
  }
  
  .form-box {
    display: flex;
    margin-top: 1.25rem;
    justify-content: center;
    .el-form {
      flex-direction: column;
    }
    
  }

  .body{
    display: -webkit-flex;
    display: flex;
  }
  .main {
    display: flex;
    margin-top: 1.5625rem;
    margin-left: 1.875rem;
    margin-bottom: 3.125rem;
    .text {
      margin-right: 0.625rem;
      font-weight: 700;
      font-size: 0.9375rem;
    }
    .el_text1 {
      width: 56.875rem;
    }
    .a {
      margin-top: 0.4375rem;
      width: 80%;
      height: 0.0625rem;
      border-top: $gainsboro 0.0625rem solid;
    }
  }
  .contractTitle{
    margin: 0 auto;
    text-align: center;
  }
  .contractId{
    font-size: 1.25rem;
  }
  .form-one{
    margin-right: 0.625rem;
  }
  .button-ins {
    display: flex;
    margin-left: 60rem;
    margin-bottom: 1rem;
  }
  
</style>
