wagonUnLoadEdit.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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="118" 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. import { sjTime } from "@/js/sharedJsFile";
  25. export default {
  26. components: { PageTitle },
  27. data(){
  28. return {
  29. form1: {},
  30. }
  31. },
  32. mounted() {
  33. this.information();
  34. },
  35. methods: {
  36. information() {
  37. //编辑车皮装车作业
  38. this.$axios
  39. .post("/api/v1/tms/getTmstrainWagonUnLoadResultByUnLoadingId/" + this.$route.params.unloadingId)
  40. .then((res) => {
  41. res.data.data.forEach((e) => {
  42. this.form1 = e;
  43. console.log(e);
  44. console.log(this.form1);
  45. console.log(this.$route.params.unloadingId);
  46. });
  47. });
  48. },
  49. handleCheckedCitiesChange(value) {
  50. console.log(value);
  51. },
  52. // 返回
  53. onClickCancel() {
  54. this.$router.go(-1);
  55. },
  56. currentRadioChange(row) {
  57. this.aaaa = row;
  58. },
  59. //确定
  60. onClickConfirm() {
  61. let tmstrainWagonUnloadResult = {
  62. unloadingId: this.$route.params.unloadingId,
  63. resultArrivalDate: sjTime(this.form1.resultArrivalDate),
  64. resultUnloadTime: sjTime(this.form1.resultUnloadTime),
  65. unloadingPointId: this.form1.unloadingPointId,
  66. resultBigTicketWeight: this.form1.resultBigTicketWeight,
  67. resultRailHorizontalWeight: this.form1.resultRailHorizontalWeight,
  68. resultRemark: this.form1.resultRemark
  69. };
  70. console.log(tmstrainWagonUnloadResult);
  71. if (
  72. tmstrainWagonUnloadResult.resultArrivalDate==null||
  73. tmstrainWagonUnloadResult.resultUnloadTime==null||
  74. tmstrainWagonUnloadResult.unloadingPointId==null||
  75. tmstrainWagonUnloadResult.resultBigTicketWeight==null||
  76. tmstrainWagonUnloadResult.resultRailHorizontalWeight==null
  77. ) this.$message.error("存在空值!");
  78. else
  79. this.$axios
  80. .post(
  81. "/api/v1/tms/upadteTmstrainWagonUnLoadResultByUnLoadingId",
  82. tmstrainWagonUnloadResult
  83. )
  84. .then(() => {
  85. this.$message({
  86. type: "success",
  87. message: "修改成功!",
  88. });
  89. this.$router.go(-1);
  90. });
  91. },
  92. },
  93. };
  94. </script>
  95. <style lang="scss" scoped>
  96. @import "@/styles/TMS/addwagonload.scss";
  97. </style>