wagonUnLoadAdd.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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, isNumber } 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. methods: {
  49. selectionChange(selection) {
  50. this.list = [];
  51. selection.forEach((e) => {
  52. this.list.push({
  53. resultWagonNo: e.resultWagonNo,
  54. resultId: e.resultId,
  55. purchaseOrderId: e.purchaseOrderId,
  56. unloadingPointId: e.unloadingPointId,
  57. });
  58. });
  59. },
  60. // 确定
  61. makeSure() {
  62. let tmstrainWagonUnloadResult = {
  63. wagonNoList: this.list,
  64. resultArrivalDate: sjTime(this.form1.resultArrivalDate),
  65. resultUnloadTime: sjTime(this.form1.resultUnloadTime),
  66. resultRemark: this.form1.resultRemark,
  67. resultType: 3,
  68. };
  69. console.log(tmstrainWagonUnloadResult);
  70. if (
  71. tmstrainWagonUnloadResult.wagonNoList == null ||
  72. tmstrainWagonUnloadResult.resultArrivalDate == null ||
  73. tmstrainWagonUnloadResult.resultUnloadTime == null
  74. )
  75. this.$message.error("存在空值!");
  76. else
  77. this.axios
  78. .post(
  79. "/api/v1/tms/insertTmstrainWagonUnLoadResult",
  80. tmstrainWagonUnloadResult
  81. )
  82. .then((res) => {
  83. if ((res.data.code = "200")) {
  84. this.$message({
  85. type: "success",
  86. message: "新增成功!",
  87. });
  88. this.$router.go(-1);
  89. }else{
  90. ({ type: "failed", message: "新增失败!" });
  91. }
  92. });
  93. },
  94. // 取消
  95. cancel() {
  96. this.$router.go(-1);
  97. },
  98. },
  99. };
  100. </script>
  101. <style lang='scss' scoped>
  102. .addWagonLoad {
  103. .form {
  104. display: flex;
  105. .form_box {
  106. width: 320px;
  107. margin-left: 35%;
  108. margin-top: 30px;
  109. margin-right: 22px;
  110. .el-form {
  111. .preview-group {
  112. .el-form-item {
  113. .el-form-item__label {
  114. display: inline-block;
  115. width: 70px !important;
  116. }
  117. .el-form-item__content {
  118. .el-select {
  119. width: 250px;
  120. }
  121. .el-input {
  122. width: 220px;
  123. }
  124. .el-textarea {
  125. .el-textarea__inner {
  126. display: block;
  127. resize: vertical;
  128. padding: 5px 13px;
  129. line-height: 1.5;
  130. width: 70%;
  131. border-radius: 4px;
  132. margin-left: 56px;
  133. margin-top: -25px;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. .button-box {
  143. margin-top: 50px;
  144. margin-left: 600px;
  145. }
  146. }
  147. </style>