addWagonUnLoad.vue 3.6 KB

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