addPort.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <!-- 添加港口信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box" >
  6. <dil-form :formId="271" 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. portName:'',
  21. form1: {},
  22. value: undefined,
  23. };
  24. },
  25. mounted() {},
  26. methods: {
  27. makeSure() {
  28. console.log(this.form1)
  29. // let RmsCapacity = {
  30. // };
  31. let RmsCapacity=this.form1;
  32. console.log(RmsCapacity)
  33. if (
  34. RmsCapacity.portName==null||
  35. RmsCapacity.portTypeId==null
  36. ) this.$message.error("存在空值!");
  37. else
  38. this.axios
  39. .post(
  40. "/api/v1/rms/insertPort",
  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' >
  65. .button-box{
  66. display: flex;
  67. justify-content: center;
  68. .el-button{
  69. width: 80px;
  70. margin-right: 10px;
  71. }
  72. }
  73. .form-box{
  74. display: flex;
  75. justify-content: center;
  76. .el-form-item{
  77. display: flex;
  78. justify-content: center;
  79. .el-form-item__label{
  80. display: flex;
  81. align-items: center;
  82. }
  83. .el-form-item__content{
  84. .el-input{
  85. .el-input__inner{
  86. width: 250px;
  87. }
  88. }
  89. }
  90. }
  91. }
  92. </style>