editSaleOrderDetail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <dil-form :formId="285" v-model="form1"></dil-form>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="button-box">
  17. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  18. <el-button @click="onClickCancel">返回</el-button>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import PageTitle from "@/components/Page/Title";
  24. export default {
  25. components: { PageTitle },
  26. data() {
  27. return {
  28. form1: {},
  29. };
  30. },
  31. mounted() {
  32. this.information();
  33. },
  34. methods: {
  35. information() {
  36. //编辑
  37. this.axios
  38. .post(
  39. "/api/v1/ams/getAmsSaleOrderMaterialBySaleOrderMaterialId?saleOrderMaterialId=" +
  40. this.$route.params.saleOrderMaterialId
  41. )
  42. .then((res) => {
  43. res.data.data.forEach((e) => {
  44. this.form1 = e;
  45. });
  46. });
  47. },
  48. // 返回
  49. onClickCancel() {
  50. this.$router.go(-1);
  51. },
  52. // 确认
  53. onClickConfirm() {
  54. let amsSaleOrderMaterial = {
  55. saleOrderMaterialId: this.$route.params.saleOrderMaterialId,
  56. saleShippingAddress: this.form1.saleShippingAddress,
  57. saleDateOfReceipt: sjTime(this.form1.saleDateOfReceipt),
  58. saleOrderConsignee: this.form1.saleOrderConsignee,
  59. saleOrderConsigneeTel: this.form1.saleOrderConsigneeTel,
  60. };
  61. if (
  62. amsSaleOrderMaterial.saleShippingAddress == null ||
  63. amsSaleOrderMaterial.saleDateOfReceipt == null ||
  64. amsSaleOrderMaterial.saleOrderConsignee == null ||
  65. amsSaleOrderMaterial.saleOrderConsigneeTel == null
  66. )
  67. this.$message.error("必填项存在空值!");
  68. else
  69. this.axios
  70. .post(
  71. "/api/v1/ams/updateAmsSaleOrderMaterial",
  72. amsSaleOrderMaterial
  73. )
  74. .then((res) => {
  75. if (res.data.code == "200") {
  76. this.$router.go(-1);
  77. }
  78. });
  79. },
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .form-box,
  85. .from {
  86. display: flex;
  87. align-items: center;
  88. justify-content: center;
  89. margin-top: 5px;
  90. margin-bottom: 20px;
  91. }
  92. .button-box{
  93. display: flex;
  94. text-align: center;
  95. align-items: center;
  96. justify-content: center;
  97. margin-top: 0.3125rem;
  98. margin-bottom: 1.25rem;
  99. }
  100. </style>