editTruckNoDetail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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="292" 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/getAmsSaleTrucknoMaterial?trucknoMaterialId=" +
  40. this.$route.params.trucknoMaterialId
  41. )
  42. .then((res) => {
  43. console.log(res.data.data)
  44. res.data.data.forEach((e) => {
  45. this.form1 = e;
  46. });
  47. });
  48. },
  49. // 返回
  50. onClickCancel() {
  51. this.$router.go(-1);
  52. },
  53. // 确认
  54. onClickConfirm() {
  55. let amsSaleTrucknoMaterial = {
  56. trucknoMaterialId: this.$route.params.trucknoMaterialId,
  57. materialId: this.form1.materialId,
  58. saleOrderMaterialNumber: this.form1.saleOrderMaterialNumber,
  59. materialTheoreticalWeight: this.form1.materialTheoreticalWeight,
  60. };
  61. if (
  62. amsSaleTrucknoMaterial.materialId == null ||
  63. amsSaleTrucknoMaterial.saleOrderMaterialNumber == null ||
  64. amsSaleTrucknoMaterial.materialTheoreticalWeight == null
  65. )
  66. this.$message.error("必填项存在空值!");
  67. else
  68. this.axios
  69. .post(
  70. "/api/v1/ams/updateAmsSaleTrucknoMaterial",
  71. amsSaleTrucknoMaterial
  72. )
  73. .then((res) => {
  74. if (res.data.code == "200") {
  75. this.$router.go(-1);
  76. }
  77. });
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .form-box,
  84. .from {
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. margin-top: 5px;
  89. margin-bottom: 20px;
  90. }
  91. .button-box{
  92. display: flex;
  93. text-align: center;
  94. align-items: center;
  95. justify-content: center;
  96. margin-top: 0.3125rem;
  97. margin-bottom: 1.25rem;
  98. }
  99. </style>