You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div class="top">
  3. <!-- 输入框 -->
  4. <div class="topstyle">
  5. <el-input v-model="formData.etcCardNumber" placeholder="请输入ETC卡号" style="width: 200px">
  6. </el-input>
  7. </div>
  8. <div class="topstyle">
  9. <el-input
  10. v-model="formData.licensePlateNumber"
  11. placeholder="请输入车牌号"
  12. style="width: 200px"
  13. >
  14. </el-input>
  15. </div>
  16. <!-- 日期框 -->
  17. <div class="topstyle">
  18. <el-date-picker
  19. v-model="formData.startDate"
  20. type="datetime"
  21. placeholder="开始日期"
  22. format="YYYY/MM/DD hh:mm:ss"
  23. />
  24. <!-- <span>-</span> -->
  25. <!-- <el-button>至</el-button> -->
  26. <el-date-picker
  27. v-model="formData.endDate"
  28. type="datetime"
  29. placeholder="结束日期"
  30. format="YYYY/MM/DD hh:mm:ss"
  31. style="margin-left: 5px"
  32. />
  33. </div>
  34. <!-- 按钮 -->
  35. <div class="topstyle">
  36. <el-button type="success" :icon="Search" @click="submitForm">搜索</el-button>
  37. <el-button type="warning" :icon="Refresh" @click="submitReset">重置</el-button>
  38. <el-button type="primary" plain @click="downloadExcel">导出当前页</el-button>
  39. <el-button type="primary" plain @click="dddd">导出所有</el-button>
  40. </div>
  41. </div>
  42. <div style="padding-top: 12px">
  43. <el-table :data="tableData1" border style="width: 100%">
  44. <el-table-column property="serialNumber" label="序号" width="60" />
  45. <el-table-column property="etcCardNumber" label="ETC卡号" width="190" />
  46. <el-table-column property="licensePlateNumber" label="车牌号" width="100" />
  47. <el-table-column property="consumptionType" label="消费类型" width="90" />
  48. <el-table-column property="entranceTime" label="入口时间" width="110" />
  49. <el-table-column property="entryStationName" label="入口站名" width="110" />
  50. <el-table-column property="exportTime" label="出口时间" width="110" />
  51. <el-table-column property="exitStationName" label="出口站名" width="110" />
  52. <el-table-column property="balanceBeforeTransaction" label="交易前余额(元)" width="140" />
  53. <el-table-column property="transactionAmount" label="交易金额(元)" width="125" />
  54. <el-table-column property="postransactionalance" label="交易后余额(元)" width="140" />
  55. </el-table>
  56. </div>
  57. <div style="padding-top: 12px" class="as-gravity-center-end">
  58. <el-pagination :page-sizes="[10, 20, 30, 40]" layout="sizes, prev, pager, next" :total="1000" />
  59. </div>
  60. </template>
  61. <script lang="ts" setup>
  62. import { reactive, ref } from 'vue'
  63. import { useRoute, useRouter } from 'vue-router'
  64. import { Calendar, Search, Refresh } from '@element-plus/icons-vue'
  65. import type { ElTable } from 'element-plus'
  66. import { getCurrentInstance, onMounted } from 'vue'
  67. const { proxy } = getCurrentInstance()
  68. onMounted(() => {
  69. proxy.$request
  70. .get('api/user', {})
  71. .then((res) => {
  72. console.log(res, '=====123')
  73. })
  74. .catch((err) => {
  75. console.log(err, '=====456')
  76. })
  77. })
  78. const formData = reactive({
  79. etcCardNumber: '', //ETC卡号
  80. licensePlateNumber: '', //车牌号
  81. startDate: '', //开始日期
  82. endDate: '', //结束日期
  83. })
  84. const tableData = reactive({
  85. serialNumber: '', //序号
  86. etcCardNumber: '', //ETC卡号
  87. licensePlateNumber: '', //车牌号
  88. consumptionType: '', //消费类型
  89. entranceTime: '', //入口时间
  90. entryStationName: '', //入口站名
  91. exportTime: '', //出口时间
  92. exitStationName: '', //出口站名
  93. balanceBeforeTransaction: '', //交易前余额
  94. transactionAmount: '', //交易金额
  95. postransactionalance: '', //交易后余额
  96. })
  97. // 搜索
  98. const submitForm = () => {}
  99. // 重置
  100. const submitReset = () => {
  101. //myform.value?.resetFields()
  102. }
  103. function exportAll() {}
  104. interface User {
  105. serialNumber: string //序号
  106. etcCardNumber: string //ETC卡号
  107. licensePlateNumber: string //车牌号
  108. consumptionType: string //消费类型
  109. entranceTime: string //入口时间
  110. entryStationName: string //入口站名
  111. exportTime: string //出口时间
  112. exitStationName: string //出口站名
  113. balanceBeforeTransaction: string //交易前余额
  114. transactionAmount: string //交易金额
  115. postransactionalance: string //交易后余额
  116. }
  117. const currentRow = ref()
  118. const singleTableRef = ref<InstanceType<typeof ElTable>>()
  119. const setCurrent = (row?: User) => {
  120. singleTableRef.value!.setCurrentRow(row)
  121. }
  122. const handleCurrentChange = (val: User | undefined) => {
  123. currentRow.value = val
  124. }
  125. const tableData1: User[] = [
  126. {
  127. serialNumber: '1',
  128. etcCardNumber: '52011328220200481698',
  129. licensePlateNumber: '贵A710AE',
  130. consumptionType: '省内流水',
  131. entranceTime: '2019-12-27 20:14:02',
  132. entryStationName: '贵阳西主线站',
  133. exportTime: '2019-12-27 20:18:20',
  134. exitStationName: '贵阳西主线站',
  135. balanceBeforeTransaction: '38.25',
  136. transactionAmount: '0.00',
  137. postransactionalance: '38.25',
  138. },
  139. {
  140. serialNumber: '2',
  141. etcCardNumber: '52011328220200481698',
  142. licensePlateNumber: '贵A710AE',
  143. consumptionType: '省内流水',
  144. entranceTime: '2019-12-27 20:14:02',
  145. entryStationName: '贵阳西主线站',
  146. exportTime: '2019-12-27 20:18:20',
  147. exitStationName: '贵阳西主线站',
  148. balanceBeforeTransaction: '38.25',
  149. transactionAmount: '0.00',
  150. postransactionalance: '38.25',
  151. },
  152. {
  153. serialNumber: '3',
  154. etcCardNumber: '52011328220200481698',
  155. licensePlateNumber: '贵A710AE',
  156. consumptionType: '省内流水',
  157. entranceTime: '2019-12-27 20:14:02',
  158. entryStationName: '贵阳西主线站',
  159. exportTime: '2019-12-27 20:18:20',
  160. exitStationName: '贵阳西主线站',
  161. balanceBeforeTransaction: '38.25',
  162. transactionAmount: '0.00',
  163. postransactionalance: '38.25',
  164. },
  165. {
  166. serialNumber: '4',
  167. etcCardNumber: '52011328220200481698',
  168. licensePlateNumber: '贵A710AE',
  169. consumptionType: '省内流水',
  170. entranceTime: '2019-12-27 20:14:02',
  171. entryStationName: '贵阳西主线站',
  172. exportTime: '2019-12-27 20:18:20',
  173. exitStationName: '贵阳西主线站',
  174. balanceBeforeTransaction: '38.25',
  175. transactionAmount: '0.00',
  176. postransactionalance: '38.25',
  177. },
  178. {
  179. serialNumber: '5',
  180. etcCardNumber: '52011328220200481698',
  181. licensePlateNumber: '贵A710AE',
  182. consumptionType: '省内流水',
  183. entranceTime: '2019-12-27 20:14:02',
  184. entryStationName: '贵阳西主线站',
  185. exportTime: '2019-12-27 20:18:20',
  186. exitStationName: '贵阳西主线站',
  187. balanceBeforeTransaction: '38.25',
  188. transactionAmount: '0.00',
  189. postransactionalance: '38.25',
  190. },
  191. {
  192. serialNumber: '6',
  193. etcCardNumber: '52011328220200481698',
  194. licensePlateNumber: '贵A710AE',
  195. consumptionType: '省内流水',
  196. entranceTime: '2019-12-27 20:14:02',
  197. entryStationName: '贵阳西主线站',
  198. exportTime: '2019-12-27 20:18:20',
  199. exitStationName: '贵阳西主线站',
  200. balanceBeforeTransaction: '38.25',
  201. transactionAmount: '0.00',
  202. postransactionalance: '38.25',
  203. },
  204. ]
  205. </script>
  206. <style lang="scss" scoped>
  207. .top {
  208. display: flex;
  209. margin-left: 10px;
  210. }
  211. .topstyle {
  212. display: flex;
  213. height: 40px;
  214. margin-right: 10px;
  215. align-items: center;
  216. justify-content: flex-start;
  217. }
  218. </style>