updateLoadShip.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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="136" 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/getLoadShip/" + this.$route.params.resultId)
  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 mapVal = {
  57. resultId: this.$route.params.resultId,
  58. resultActualInstallations: this.form1.resultActualInstallations,
  59. rwarehouseMaterialId: this.form1.rwarehouseMaterialId,
  60. resultArrivalPortTime: sjTime(
  61. this.form1.resultArrivalPortTime
  62. ),
  63. resultOutPortTime: sjTime(
  64. this.form1.resultOutPortTime
  65. ),
  66. resultLoadShipDate: sjTime(
  67. this.form1.resultLoadShipDate
  68. ),
  69. resultIsClear: this.form1.resultIsClear,
  70. };
  71. console.log(mapVal);
  72. this.axios
  73. .post(
  74. "/api/v1/tms/updateLoadShip",
  75. mapVal
  76. )
  77. .then((res) => {
  78. if (res.data.code == 200) {
  79. this.$message({
  80. type: "success",
  81. message: "修改成功!",
  82. });
  83. // this.$refs.table.refreshData();
  84. this.$router.go(-1);
  85. } else {
  86. this.$message.error("修改失败!");
  87. }
  88. this.$refs['table'].resetField();
  89. });
  90. },
  91. },
  92. };
  93. </script>
  94. <style lang="scss">
  95. .shipTransport{
  96. .form{
  97. display: flex;
  98. .form_box{
  99. width: 320px;
  100. margin-left: 35%;
  101. margin-top: 30px;
  102. margin-right: 20px;
  103. .el-form{
  104. .preview-group{
  105. .el-form-item{
  106. .el-form-item__label{
  107. display: inline-block;
  108. width: 70px !important;
  109. }
  110. .el-form-item__content{
  111. .el-select{
  112. width: 250px;
  113. }
  114. .el-input{
  115. width: 250px;
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. }
  123. .button_box{
  124. margin-left: 45%;
  125. }
  126. }
  127. </style>