updateBargeShip.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <!-- 修改驳船作业 -->
  3. <div class="shipTransport">
  4. <page-title>返回</page-title>
  5. <div class="form">
  6. <div class="form_box">
  7. <dil-form :formId="133" v-model="form1" ref="from1"></dil-form>
  8. </div>
  9. </div>
  10. <!-- 确定和取消 -->
  11. <div class="button_box">
  12. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  13. <el-button @click="onClickCancel">返回</el-button>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import PageTitle from "@/components/Page/Title";
  19. import { sjTime } from "@/utils/sharedJsFile";
  20. export default {
  21. components: { PageTitle },
  22. data(){
  23. return {
  24. form1: {},
  25. }
  26. },
  27. mounted() {
  28. this.information();
  29. },
  30. methods: {
  31. information() {
  32. //编辑驳船作业
  33. this.axios
  34. .post("/api/v1/tms/getBargeOperation/" + this.$route.params.bargeOperationId)
  35. .then((res) => {
  36. res.data.data.forEach((e) => {
  37. this.form1 = e;
  38. // console.log(e);
  39. // console.log(this.form1);
  40. // console.log(this.$route.params.loadingId);
  41. });
  42. });
  43. },
  44. handleCheckedCitiesChange(value) {
  45. console.log(value);
  46. },
  47. // 返回
  48. onClickCancel() {
  49. this.$router.go(-1);
  50. },
  51. currentRadioChange(row) {
  52. this.aaaa = row;
  53. },
  54. // 确认
  55. onClickConfirm() {
  56. let bagerShipMap = {
  57. bargeOperationId: this.$route.params.bargeOperationId,
  58. smallCapacityId: this.form1.smallCapacityId,
  59. bargeSmallshipLoadWeight: this.form1.bargeSmallshipLoadWeight,
  60. bargeRefuteDate: sjTime(
  61. this.form1.bargeRefuteDate
  62. ),
  63. bargeRefuteLocation: this.form1.bargeRefuteLocation,
  64. bargeBackDate: sjTime(
  65. this.form1.bargeBackDate
  66. ),
  67. bargeBackLocation: this.form1.bargeBackLocation,
  68. };
  69. console.log(bagerShipMap);
  70. this.axios
  71. .post(
  72. "/api/v1/tms/updateBargeOperation",
  73. bagerShipMap
  74. )
  75. .then((res) => {
  76. if (res.data.code == 200) {
  77. this.$message({
  78. type: "success",
  79. message: "修改成功!",
  80. });
  81. // this.$refs.table.refreshData();
  82. this.$router.go(-1);
  83. } else {
  84. this.$message.error("修改失败!");
  85. }
  86. this.$refs['table'].resetField();
  87. });
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="scss">
  93. .shipTransport{
  94. .form{
  95. display: flex;
  96. .form_box{
  97. width: 320px;
  98. margin-left: 35%;
  99. margin-top: 30px;
  100. margin-right: 20px;
  101. .el-form{
  102. .preview-group{
  103. .el-form-item{
  104. .el-form-item__label{
  105. display: inline-block;
  106. width: 70px !important;
  107. }
  108. .el-form-item__content{
  109. .el-select{
  110. width: 250px;
  111. }
  112. .el-input{
  113. width: 250px;
  114. }
  115. }
  116. }
  117. }
  118. }
  119. }
  120. }
  121. .button_box{
  122. margin-left: 45%;
  123. }
  124. }
  125. </style>