editInwardContractMaterial.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <!-- 添加港口信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <div style="width:400px;margin-top: 20px;margin-left: 500px;">
  6. <el-input
  7. v-model="materialTypeName"
  8. >
  9. </el-input>
  10. </div>
  11. <div class="button-box">
  12. <el-button @click="cancel">取消</el-button>
  13. <el-button type="primary" @click="makeSure">确定</el-button>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import PageTitle from "@/components/Page/Title";
  19. export default {
  20. components: { PageTitle },
  21. data() {
  22. return {
  23. form1: {},
  24. materialTypeName:'',
  25. materialTypeId:null
  26. };
  27. },
  28. mounted() {
  29. this.materialTypeId=this.$route.params.materialTypeId
  30. this.materialTypeName=this.$route.params.materialTypeName
  31. console.log("数据显示")
  32. console.log(this.materialTypeName)
  33. console.log(this.materialTypeId)
  34. },
  35. methods: {
  36. makeSure() {
  37. let mapValue={
  38. materialTypeId:this.materialTypeId,
  39. materialTypeName:this.materialTypeName
  40. }
  41. this.axios
  42. .post("/api/v1/rms/updateMaterialForInward", mapValue)
  43. .then(res => {
  44. if (res.data.code == 0) {
  45. this.$message.success("修改成功");
  46. this.$router.go(-1);
  47. } else {
  48. this.$message.success("修改失败");
  49. this.$router.go(-1);
  50. }
  51. });
  52. },
  53. // 取消
  54. cancel() {
  55. this.$router.go(-1);
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="scss">
  61. .button-box {
  62. display: flex;
  63. justify-content: center;
  64. .el-button {
  65. width: 80px;
  66. margin-right: 10px;
  67. }
  68. }
  69. .form-box {
  70. display: flex;
  71. justify-content: center;
  72. .el-form-item {
  73. display: flex;
  74. justify-content: center;
  75. .el-form-item__label {
  76. display: flex;
  77. align-items: center;
  78. }
  79. .el-form-item__content {
  80. .el-input {
  81. .el-input__inner {
  82. width: 250px;
  83. }
  84. }
  85. }
  86. }
  87. }
  88. </style>