addPortStorageYard.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <!-- 添加码头信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box">
  6. <dil-form :formId="366" v-model="form1" ref="from1"></dil-form>
  7. </div>
  8. <div class="button-box">
  9. <el-button @click="cancel">取消</el-button>
  10. <el-button type="primary" @click="makeSure">确定</el-button>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import PageTitle from "@/components/Page/Title";
  16. export default {
  17.   components: { PageTitle },
  18.   data() {
  19.     return {
  20.       form1: {},
  21.       value: undefined,
  22.     };
  23.   },
  24.   mounted() {},
  25.   methods: {
  26.      makeSure() {
  27.         console.log(this.form1)
  28.     //   let RmsCapacity = {
  29.          
  30.     //   };
  31.        let RmsCapacity=this.form1;
  32.       console.log(RmsCapacity)
  33.       if (
  34.         RmsCapacity.warehouseName==null||
  35.         RmsCapacity.portId==null
  36.       ) this.$message.error("存在空值!");
  37.       else
  38.       this.axios
  39.         .post(
  40.           "/api/v1/rms/insertPortYard",
  41.            RmsCapacity
  42.         )
  43.         .then((res) => {
  44.           if (res.data.code == 200) {
  45.             this.$message({
  46.               type: "success",
  47.               message: "新增成功!",
  48.             });
  49.             // this.$refs.table.refreshData();
  50.             this.$router.go(-1);
  51.           } else {
  52.             this.$message.error("新增失败,可能存在重复!");
  53.           }
  54.           this.$refs['table'].resetField();
  55.         });
  56.     },
  57.     // 取消
  58.     cancel() {
  59.       this.$router.go(-1);
  60.     },
  61.   },
  62. };
  63. </script>
  64. <style lang='scss' scoped>
  65. .el-input{
  66. display: flex;
  67. }
  68. .form-box,
  69. .button-box{
  70. display: flex;
  71. text-align: center;
  72. align-items: center;
  73. justify-content: center;
  74. margin-top: 0.3125rem;
  75. margin-bottom: 1.25rem;
  76. }
  77. </style>