addCargoDep.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <!-- 添加原料仓库信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box" style="margin-right: 10rem">
  6. <dil-form :formId="383" 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. import { getCookie } from "@/utils/util.js";
  17. export default {
  18. components: { PageTitle },
  19. data() {
  20. return {
  21. form1: {},
  22. };
  23. },
  24. mounted() {},
  25. methods: {
  26. makeSure() {
  27. let RmsCargoDep = {
  28. cargoType: this.form1.cargoType,
  29. cargoName: this.form1.cargoName,
  30. userId: getCookie("userId"),
  31. };
  32. if (RmsCargoDep.cargoType == null || RmsCargoDep.cargoName == null)
  33. this.$message.error("存在空值!");
  34. else
  35. this.axios
  36. .post("/api/v1/rms/insertCargoDep", RmsCargoDep)
  37. .then((res) => {
  38. if (res.data.code == 200) {
  39. this.$message({
  40. type: "success",
  41. message: "新增成功!",
  42. });
  43. this.$router.go(-1);
  44. } else {
  45. this.$message({
  46. type: "warning",
  47. message: res.data.data,
  48. });
  49. }
  50. });
  51. },
  52. // 取消
  53. cancel() {
  54. this.$router.go(-1);
  55. },
  56. },
  57. };
  58. </script>
  59. <style lang='scss' >
  60. .addWagonLoad {
  61. .button-box {
  62. display: flex;
  63. justify-content: center;
  64. margin-top: 30px;
  65. .el-button {
  66. width: 80px;
  67. margin-right: 10px;
  68. }
  69. }
  70. .form-box {
  71. display: flex;
  72. justify-content: center;
  73. margin-top: 90px;
  74. .el-form-item {
  75. display: flex;
  76. justify-content: center;
  77. .el-form-item__label {
  78. display: flex;
  79. align-items: center;
  80. }
  81. .el-form-item__content {
  82. .el-input {
  83. .el-input__inner {
  84. width: 250px;
  85. }
  86. }
  87. }
  88. }
  89. }
  90. }
  91. </style>