addPort.vue 1.7 KB

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