addPier.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <!-- 添加码头信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box">
  6. <dil-form :formId="272" 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. let RmsCapacity=this.form1;
  31. console.log(RmsCapacity)
  32. if (
  33. RmsCapacity.pierName==null||
  34. RmsCapacity.portId==null
  35. ) this.$message.error("存在空值!");
  36. else
  37. this.axios
  38. .post(
  39. "/api/v1/rms/insertPier",
  40. RmsCapacity
  41. )
  42. .then((res) => {
  43. if (res.data.code == 200) {
  44. this.$message({
  45. type: "success",
  46. message: "新增成功!",
  47. });
  48. this.$router.push("/pier");
  49. } else {
  50. this.$message.error("新增失败,可能存在重复!");
  51. }
  52. this.$refs['table'].resetField();
  53. });
  54. },
  55. // 取消
  56. cancel() {
  57. this.$router.go(-1);
  58. },
  59. },
  60. };
  61. </script>
  62. <style lang='scss' scoped>
  63. .form-box,
  64. .button-box{
  65. display: flex;
  66. text-align: center;
  67. align-items: center;
  68. justify-content: center;
  69. margin-top: 0.3125rem;
  70. margin-bottom: 1.25rem;
  71. }
  72. </style>