entrust.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <!-- 万州港-达州计量委托界面 -->
  3. <div class="trainTransport">
  4. <div class="top">
  5. <el-input
  6. class="el-input"
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <el-date-picker
  13. v-model="startTime"
  14. type="datetime"
  15. placeholder="选择日期"
  16. >
  17. </el-date-picker>
  18. <span>至</span>
  19. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  20. </el-date-picker>
  21. <el-button type="primary" class="btn" @click="onclick">
  22. <i class="el-icon-search"></i>查询
  23. </el-button>
  24. <el-button type="primary" @click="exportData()"
  25. ><i class="el-icon-download"></i>导出(Excel)</el-button
  26. >
  27. </div>
  28. <el-tabs v-model="activeName" @tab-click="handleClick">
  29. <el-tab-pane label="待计量" name="first">
  30. <dilTable
  31. ref="excelDom"
  32. v-bind.sync="option"
  33. @selection-change="selectionChange"
  34. >
  35. </dilTable>
  36. </el-tab-pane>
  37. <el-tab-pane label="已计量" name="second">
  38. <dilTable
  39. ref="excelDom"
  40. v-bind.sync="option2"
  41. @selection-change="selectionChange2"
  42. >
  43. </dilTable>
  44. </el-tab-pane>
  45. </el-tabs>
  46. </div>
  47. </template>
  48. <script>
  49. import { sjTime } from "@/utils/sharedJsFile";
  50. export default {
  51. data() {
  52. return {
  53. activeName: "first",
  54. time: [],
  55. input: "",
  56. option: {
  57. // 表格请求数据的地址
  58. requestUrl: "/api/v1/tms/getLoadResultToSendMC?apiId=491&resultType=1",
  59. // 控制显示多选列
  60. selectionType: "select",
  61. },
  62. option2: {
  63. // 表格请求数据的地址
  64. requestUrl: "/api/v1/tms/getWeightResult?apiId=491&resultType=1",
  65. // 控制显示多选列
  66. selectionType: "select",
  67. },
  68. selectionListMap: [],
  69. selectionListMap2: [],
  70. resultIdList: [],
  71. startTime: null,
  72. endTime: null,
  73. tableTitle: "万州港-达州计量表",
  74. };
  75. },
  76. methods: {
  77. handleClick(tag, event) {
  78. console.log(tag, event);
  79. },
  80. onclick() {
  81. let startTime = null;
  82. let endTime = null;
  83. if (this.startTime) {
  84. startTime = sjTime(this.startTime);
  85. }
  86. if (this.endTime) {
  87. endTime = sjTime(this.endTime);
  88. }
  89. if (startTime && endTime) {
  90. if (startTime < endTime) {
  91. //判断是否是承运商
  92. if (this.activeName == "first") {
  93. this.option.requestUrl =
  94. "/api/v1/tms/getLoadResultToSendMC?apiId=491&resultType=1" +
  95. "&con=" +
  96. this.input +
  97. "&startTime=" +
  98. startTime +
  99. "&endTime=" +
  100. endTime +
  101. "&i=" +
  102. new Date();
  103. } else if (this.activeName == "second") {
  104. this.option2.requestUrl =
  105. "/api/v1/tms/getWeightResult?apiId=491&resultType=1" +
  106. "&con=" +
  107. this.input +
  108. "&startTime=" +
  109. startTime +
  110. "&endTime=" +
  111. endTime +
  112. "&i=" +
  113. new Date();
  114. }
  115. }
  116. } else {
  117. if (this.activeName == "first") {
  118. this.option.requestUrl =
  119. "/api/v1/tms/getLoadResultToSendMC?apiId=491&resultType=1" +
  120. "&con=" +
  121. this.input +
  122. "&i=" +
  123. new Date();
  124. } else {
  125. this.option2.requestUrl =
  126. "/api/v1/tms/getWeightResult?apiId=491&resultType=1" +
  127. "&con=" +
  128. this.input +
  129. "&i=" +
  130. new Date();
  131. }
  132. }
  133. },
  134. selectionChange(selection) {
  135. this.selectionListMap = [];
  136. console.log(selection);
  137. this.selectionListMap = selection;
  138. },
  139. selectionChange2(selection) {
  140. this.selectionListMap2 = [];
  141. console.log(selection);
  142. this.selectionListMap2 = selection;
  143. },
  144. },
  145. };
  146. </script>
  147. <style lang='scss'>
  148. .trainTransport {
  149. .top {
  150. padding: 1.25rem 0.375rem;
  151. .el-input {
  152. width: 20%;
  153. margin-right: 1.25rem;
  154. }
  155. }
  156. }
  157. </style>