wagonUnLoadAdd.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <!-- 添加车皮卸车实绩 -->
  3. <div class="addWagonLoad">
  4. <page-title>返回</page-title>
  5. <div class="main">
  6. <el-divider content-position="left"></el-divider>
  7. </div>
  8. <div>
  9. <dilTable
  10. v-bind.sync="option"
  11. ref="table"
  12. @selection-change="selectionChange"
  13. >
  14. </dilTable>
  15. </div>
  16. <!-- <el-divider content-position="left">车皮卸车实绩</el-divider> -->
  17. <div class="form">
  18. <div class="form_box" style="margin-right: 10rem">
  19. <dil-form :formId="255" v-model="form1" ref="from1"></dil-form>
  20. </div>
  21. </div>
  22. <div class="button-box">
  23. <el-button @click="cancel">取消</el-button>
  24. <el-button type="primary" @click="makeSure">确定</el-button>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import PageTitle from "@/components/Page/Title";
  30. import { sjTime } from "@/utils/sharedJsFile";
  31. import { getCookie } from "@/utils/util.js";
  32. export default {
  33. components: { PageTitle },
  34. data() {
  35. return {
  36. form1: {},
  37. option: {
  38. // 表格请求数据的地址
  39. requestUrl: "/api/v1/tms/getWagonNo/3?apiId=213",
  40. // 控制显示当选列
  41. selectionType: "select",
  42. },
  43. value: undefined,
  44. list: [],
  45. };
  46. },
  47. mounted() {},
  48. // created() {
  49. // this.form1 = {
  50. // arrivalStationId: 1,
  51. // };
  52. // },
  53. methods: {
  54. selectionChange(selection) {
  55. this.list = [];
  56. selection.forEach((e) => {
  57. this.list.push({
  58. resultWagonNo: e.resultWagonNo,
  59. resultId: e.resultId,
  60. purchaseOrderId: e.purchaseOrderId,
  61. unloadingPointId: e.unloadingPointId,
  62. });
  63. });
  64. },
  65. // 确定
  66. makeSure() {
  67. let tmstrainWagonUnloadResult = {
  68. wagonNoList: this.list,
  69. resultArrivalDate: sjTime(this.form1.resultArrivalDate),
  70. resultUnloadTime: sjTime(this.form1.resultUnloadTime),
  71. resultRemark: this.form1.resultRemark,
  72. resultType: 3,
  73. };
  74. console.log(tmstrainWagonUnloadResult);
  75. if (
  76. tmstrainWagonUnloadResult.wagonNoList == null ||
  77. tmstrainWagonUnloadResult.resultArrivalDate == null ||
  78. tmstrainWagonUnloadResult.resultUnloadTime == null
  79. )
  80. this.$message.error("存在空值!");
  81. else
  82. this.axios
  83. .post(
  84. "/api/v1/tms/insertTmstrainWagonUnLoadResult",
  85. tmstrainWagonUnloadResult
  86. )
  87. .then((res) => {
  88. if ((res.data.code = "200")) {
  89. this.$message({
  90. type: "success",
  91. message: "新增成功!",
  92. });
  93. this.$router.go(-1);
  94. } else {
  95. ({ type: "failed", message: "新增失败!" });
  96. }
  97. });
  98. },
  99. // 取消
  100. cancel() {
  101. this.$router.go(-1);
  102. },
  103. },
  104. };
  105. </script>
  106. <style lang='scss' scoped>
  107. .addWagonLoad {
  108. .form {
  109. display: flex;
  110. .form_box {
  111. width: 320px;
  112. margin-left: 35%;
  113. margin-top: 30px;
  114. margin-right: 22px;
  115. .el-form {
  116. .preview-group {
  117. .el-form-item {
  118. .el-form-item__label {
  119. display: inline-block;
  120. width: 70px !important;
  121. }
  122. .el-form-item__content {
  123. .el-select {
  124. width: 250px;
  125. }
  126. .el-input {
  127. width: 220px;
  128. }
  129. .el-textarea {
  130. .el-textarea__inner {
  131. width: 230px;
  132. // margin-left: 45px;
  133. margin-top: 0.03rem;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. .button-box {
  143. margin-top: 50px;
  144. margin-left: 600px;
  145. }
  146. }
  147. </style>