editSalePalnDetail.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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="290" 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/getAmsSalePlanMaterialByPlanMaterialId?planMaterialId=" +
  40. this.$route.params.planMaterialId
  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 amsSalePlanMaterial = {
  56. planMaterialId: this.$route.params.planMaterialId,
  57. materialId: this.form1.materialId,
  58. materialNumber: this.form1.materialNumber,
  59. };
  60. console.log("amsSalePlanMaterial",amsSalePlanMaterial)
  61. if (
  62. amsSalePlanMaterial.materialId == null ||
  63. amsSalePlanMaterial.materialNumber == null
  64. )
  65. this.$message.error("必填项存在空值!");
  66. else
  67. this.axios
  68. .post(
  69. "/api/v1/ams/upadteAmsSalePlanMaterial",
  70. amsSalePlanMaterial
  71. )
  72. .then((res) => {
  73. if (res.data.code == "200") {
  74. this.$router.go(-1);
  75. }
  76. });
  77. },
  78. },
  79. };
  80. </script>
  81. <style lang="scss" scoped>
  82. </style>