updatePlan.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //修改计划
  2. <template>
  3. <div id="endMaintenance">
  4. <page-title>修改计划</page-title>
  5. <div class="main">
  6. <span class="text">修改</span>
  7. <span class="a"></span>
  8. </div>
  9. <div>
  10. <div class="form-box" style="margin-left: 5rem">
  11. <dil-form :formId="307" v-model="form"></dil-form>
  12. </div>
  13. </div>
  14. <template>
  15. <div>
  16. <dilTable v-bind.sync="first" >
  17. </dilTable>
  18. </div>
  19. </template>
  20. <div class="" style="margin-left:40rem">
  21. <el-button type="primary" @click="makeSure">确认修改</el-button>
  22. <el-button type="primary" @click="cancel">返回</el-button>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import PageTitle from "@/components/Page/Title";
  28. import { sjTime } from "@/utils/sharedJsFile";
  29. export default {
  30. components: { PageTitle },
  31. data() {
  32. return {
  33. form: {},
  34. first:{
  35. requestUrl:"/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
  36. }
  37. };
  38. },
  39. mounted(){
  40. this.information();
  41. },
  42. methods: {
  43. information(){
  44. this.axios
  45. .post("api/v1/ams/selectInwardPlanToUpdate/" + this.$route.params.planId)
  46. .then((res) => {
  47. res.data.data.forEach((e) => {
  48. this.form= e;
  49. console.log(e);
  50. console.log(this.form1);
  51. console.log(this.$route.params.resultId);
  52. });
  53. });
  54. },
  55. // 修改
  56. makeSure() {
  57. console.log(this.form)
  58. let plan = {
  59. requirementId : this.mapList.requirementId,
  60. planTruckNumber: this.form.planTruckNumber,
  61. carrierId: this.form.carrierId
  62. };
  63. this.axios
  64. .post(
  65. "/api/v1/ams/addTruckPlan",
  66. plan
  67. )
  68. .then((res) => {
  69. console.log(res)
  70. if (res.data.code == 200) {
  71. this.$message({
  72. type: "success",
  73. message: "新增成功!",
  74. });
  75. this.$router.go(-1);
  76. } else {
  77. this.$message.error("新增失败!");
  78. }
  79. });
  80. },
  81. // 返回
  82. cancel() {
  83. this.$router.go(-1);
  84. },
  85. },
  86. };
  87. </script>
  88. <style lang="scss">
  89. </style>