addRawWarehouse.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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="315" v-model="form1" 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. form1: {},
  22. // value: undefined,
  23. };
  24. },
  25. mounted() {},
  26. methods: {
  27. makeSure() {
  28. console.log(this.from1)
  29. let RmsWarehouse = {
  30. warehouseName:this.form1.warehouseName,
  31. shipperId:this.form1.shipperId,
  32. };
  33. if(
  34. RmsWarehouse.warehouseName==null ||
  35. RmsWarehouse.shipperId==null
  36. )this.$message.error("存在空值!");
  37. // console.log(this.RmsWarehouse)
  38. this.axios
  39. .post(
  40. "/api/v1/rms/insertWarehouse", RmsWarehouse
  41. )
  42. .then((res) => {
  43. if (res.data.code == 200) {
  44. this.$message({
  45. type: "success",
  46. message: "新增成功!",
  47. });
  48. // this.$refs.table.refreshData();
  49. this.$router.go(-1);
  50. } else {
  51. this.$message.error("新增失败,可能存在重复!");
  52. }
  53. this.$refs['table'].resetField();
  54. });
  55. },
  56. // 取消
  57. cancel() {
  58. this.$router.go(-1);
  59. },
  60. },
  61. };
  62. </script>
  63. <style lang='scss' >
  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. .form-box{
  73. display: flex;
  74. justify-content: center;
  75. .el-form-item{
  76. display: flex;
  77. justify-content: center;
  78. .el-form-item__label{
  79. display: flex;
  80. align-items: center;
  81. }
  82. .el-form-item__content{
  83. .el-input{
  84. .el-input__inner{
  85. width: 250px;
  86. }
  87. }
  88. }
  89. }
  90. }
  91. </style>