updatePlan.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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 "@/js/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. #pageTitle {
  90. border-bottom: 0.125rem solid $borderColorPageTitlte;
  91. background-color: $backgroundColorPageTitle;
  92. padding-left: 3.125rem;
  93. margin-bottom: 1.875rem;
  94. span {
  95. font-size: 1.5rem;
  96. line-height: 4.375rem;
  97. color: $fontColorPageTitle;
  98. }
  99. i {
  100. cursor: pointer;
  101. border: 0.0625rem solid $fontColorPageTitle;
  102. color: $fontColorPageTitle;
  103. border-radius: 100%;
  104. margin-right: 1.25rem;
  105. // 图标放大
  106. transform: scale(1.6, 1.6);
  107. }
  108. }
  109. #query_condition{
  110. margin-left: 3rem;
  111. }
  112. .button-box {
  113. display: flex;
  114. justify-content: center;
  115. .el-button + .el-button {
  116. margin-left: 3rem;
  117. }
  118. }
  119. .form-box {
  120. display: flex;
  121. margin-top: 1.25rem;
  122. justify-content: center;
  123. .el-form {
  124. flex-direction: column;
  125. }
  126. }
  127. .body{
  128. display: -webkit-flex;
  129. display: flex;
  130. }
  131. .main {
  132. display: flex;
  133. margin-top: 1.5625rem;
  134. margin-left: 1.875rem;
  135. margin-bottom: 3.125rem;
  136. .text {
  137. margin-right: 0.625rem;
  138. font-weight: 700;
  139. font-size: 0.9375rem;
  140. }
  141. .el_text1 {
  142. width: 56.875rem;
  143. }
  144. .a {
  145. margin-top: 0.4375rem;
  146. width: 80%;
  147. height: 0.0625rem;
  148. border-top: $gainsboro 0.0625rem solid;
  149. }
  150. }
  151. .contractTitle{
  152. margin: 0 auto;
  153. text-align: center;
  154. }
  155. .contractId{
  156. font-size: 1.25rem;
  157. }
  158. .form-one{
  159. margin-right: 0.625rem;
  160. }
  161. .button-ins {
  162. display: flex;
  163. margin-left: 60rem;
  164. margin-bottom: 1rem;
  165. }
  166. </style>