addRawWarehouse.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <!-- 添加原料仓库信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div class="form-box" style="margin-right: 10rem">
  6. <dil-form :formId="315" 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.from1)
  28. let RmsWarehouse = {
  29. warehouseName:this.form1.warehouseName,
  30. shipperId:this.form1.shipperId,
  31. };
  32. if(
  33. RmsWarehouse.warehouseName==null ||
  34. RmsWarehouse.shipperId==null
  35. )this.$message.error("存在空值!");
  36. // console.log(this.RmsWarehouse)
  37. this.axios
  38. .post(
  39. "/api/v1/rms/insertWarehouse", RmsWarehouse
  40. )
  41. .then((res) => {
  42. if (res.data.code == 200) {
  43. this.$message({
  44. type: "success",
  45. message: "新增成功!",
  46. });
  47. // this.$refs.table.refreshData();
  48. this.$router.go(-1);
  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' >
  63. .button-box{
  64. display: flex;
  65. justify-content: center;
  66. .el-button{
  67. width: 80px;
  68. margin-right: 10px;
  69. }
  70. }
  71. .form-box{
  72. display: flex;
  73. justify-content: center;
  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. </style>