editaddress.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <!-- 修改收货地址 -->
  3. <div id="contractDetails">
  4. <page-title>编辑</page-title>
  5. <div class="main">
  6. <span class="text">修改收货地址</span>
  7. <span class="a"></span>
  8. </div>
  9. <div class="contractTitle">
  10. <div class="form-box">
  11. <div class="form-one">
  12. <span>收货地址:</span>
  13. <el-input v-model="input" placeholder="请输入内容"></el-input>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="button-box">
  18. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  19. <el-button @click="onClickCancel">返回</el-button>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import PageTitle from "@/components/Page/Title";
  25. export default {
  26. components: { PageTitle },
  27. data() {
  28. return {
  29. input: "",
  30. };
  31. },
  32. mounted() {
  33. this.information();
  34. },
  35. methods: {
  36. information() {
  37. //编辑
  38. this.axios
  39. .post(
  40. "/api/v1/ams/getAddress?saleOrderMaterialId=" +
  41. this.$route.params.saleOrderMaterialId
  42. )
  43. .then((res) => {
  44. this.input = res.data.data;
  45. });
  46. },
  47. // 返回
  48. onClickCancel() {
  49. this.$router.go(-1);
  50. },
  51. // 确认
  52. onClickConfirm() {
  53. let amsSaleOrderMaterial = {
  54. saleOrderMaterialId: this.$route.params.saleOrderMaterialId,
  55. saleShippingAddress: this.input,
  56. };
  57. if (amsSaleOrderMaterial.saleShippingAddress == null)
  58. this.$message.error("必填项存在空值!");
  59. else
  60. this.axios
  61. .post(
  62. "/api/v1/ams/updateAddress",
  63. {
  64. saleOrderMaterialId:this.$route.params.saleOrderMaterialId,
  65. saleShippingAddress:this.input
  66. }
  67. )
  68. .then((res) => {
  69. if (res.data.code == "200") {
  70. this.$router.go(-1);
  71. }
  72. });
  73. },
  74. },
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .form-box,
  79. .from {
  80. display: flex;
  81. align-items: center;
  82. justify-content: center;
  83. margin-top: 5px;
  84. margin-bottom: 20px;
  85. }
  86. </style>