addWagonUnLoadEmergency.vue 3.6 KB

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