<template>
  <!-- 添加门岗信息 -->
  <div class="addWagonLoad">
    <PageTitle>返回</PageTitle>
    <el-divider content-position="left">门岗信息</el-divider>
     <div class="form-box" style="margin-right: 10rem">
       <!-- 287 -->
        <dil-form :formId="328" v-model="form1" ref="from1">
        </dil-form>
    </div>
    <div class="button-box">
      <el-button @click="cancel">取消</el-button>
      <el-button type="primary" @click="makeSure">确定</el-button>
    </div> 
  </div>
</template>

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

export default {
  components: { PageTitle },
  data() {
    return {
      form1: {},
      startTime:'',
      endTime:'',
      value: undefined,
      drawer: false,
      direction: 'btt',
      materialName:"",
      gatepostRules:"",
      inputText:"",
      entityOutTypeList:{},
    };
  },
  mounted() {},
  methods: {
     makeSure() {
      console.log(this.form1)
      let RmsGatepost={
          gatepostName:this.form1.gatepostName,
          gatepostLongitude:this.form1.gatepostLongitude,
          gatepostLatitude:this.form1.gatepostLatitude,
          gatepostPriority:this.form1.gatepostPriority
      };
      if(
         RmsGatepost.gatepostName==null ||
          RmsGatepost.gatepostLongitude==null ||
          RmsGatepost.gatepostLatitude==null ||
         RmsGatepost.gatepostPriority==null
      )this.$message.error("存在空值！");
      else
      this.axios
        .post(
          "/api/v1/rms/insertGatepost",
           RmsGatepost
        )
        .then((res) => {
          if (res.data.code == 200) {
            this.$message({
              type: "success",
              message: "新增成功!",
            });
            // this.$refs.table.refreshData();
            this.$router.go(-1);
          } else {
            this.$message.error("新增失败,可能存在重复！");
          }
          this.$refs['table'].resetField();
        });
    },
    // 取消
    cancel() {
      this.$router.go(-1);
    },

    handleClose(done) {
        done();
      }
    }
};
</script>
<style lang='scss' scoped>

</style>
<style lang='scss' scoped>
.form-box {
  padding: 20px 30px;
  margin-left: 330px;
}
.button-box {
  padding: 20px 30px;
  margin-left: 460px;
}
.btn-left {
  margin-left: 470px;
}
.input {
  margin-left: 90px;
}
.label{
  margin-left: 445px;
  margin-bottom: -30px;
  font: bold;
  font-size: 1rem;
  padding-left: -30px;
  font-family:Arial, Helvetica, sans-serif;
  margin-bottom:20px;
} 
.label2{
  margin-left: 425px;
  margin-bottom: -30px;
  font: bold;
  font-size: 1rem;
  font-family:Arial, Helvetica, sans-serif
}
.label1{
  margin-left: 345px;
  margin-bottom: -30px;
  font: bold;
}
.common{
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  cursor: default;
  color: #2c3e50;
}
.f1{
  margin-top: -2.5rem;
  margin-left: 17.5rem;
}
.f11{
  margin-top: -3rem;
  
  // margin-left: 29rem;
}
.f2{
  margin-top: -2.5rem;
  margin-left: 10.5rem;
}
.f3{
  margin-top: -2.5rem;
  margin-left: 10.5rem;
}
</style>
