cancelled.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. import { useData } from "./useData"
  4. const { tableData, total, getTableList, changePage, page_size } = useData({
  5. type: "2",
  6. })
  7. function tableRowClassName({ rowIndex }: any) {
  8. if (rowIndex % 2 === 0) return "warning-row"
  9. return ""
  10. }
  11. getTableList()
  12. </script>
  13. <template>
  14. <div>
  15. <el-table
  16. :data="tableData"
  17. style="width: 100%"
  18. :row-class-name="tableRowClassName"
  19. >
  20. <el-table-column prop="billNo" label="Order No." width="180">
  21. <template #default="{ row }">
  22. <nuxt-link
  23. :to="`/orders/${row.id}`"
  24. class="hover:underline text-#0068FF"
  25. >
  26. {{ row.billNo }}
  27. </nuxt-link>
  28. </template>
  29. </el-table-column>
  30. <!-- <el-table-column prop="brandQuantity" label="Brand Qty." width="180" /> -->
  31. <el-table-column
  32. prop="merchandiseQuantity"
  33. label="Products"
  34. width="180"
  35. />
  36. <el-table-column prop="totalPrice" label="Order Total" width="180" />
  37. <el-table-column label="Status" width="180">
  38. <template #default="{ row }">
  39. {{ row.state === "1" ? "Submitted" : "Cancelled" }}
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="createTime" label="Created Time" width="180" />
  43. <el-table-column fixed="right" label="Action" min-width="240">
  44. <template #default="{ row }">
  45. <el-button
  46. class="!text-#C58C64 !h-40px !b-unset !bg-transparent hover:!bg-transparent hover:!text-#C58C64 hover:!underline"
  47. >
  48. <nuxt-link :to="`/orders/${row.id}`"> View details </nuxt-link>
  49. </el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <div v-if="tableData.length" class="mt-25px flex justify-end">
  54. <el-pagination
  55. :page-size="page_size"
  56. class="custom-pagination"
  57. :pager-count="10"
  58. layout="prev, pager, next"
  59. :total="total"
  60. @change="changePage"
  61. />
  62. </div>
  63. </div>
  64. </template>
  65. <style lang="less" scoped>
  66. ::v-deep(.el-table) {
  67. color: #333;
  68. .el-table__header-wrapper {
  69. .el-table__header {
  70. height: 50px;
  71. .el-table__cell {
  72. color: #333;
  73. font-weight: 400 !important;
  74. background-color: #fff2e1;
  75. }
  76. }
  77. }
  78. .el-table__row {
  79. height: 68px;
  80. &.warning-row {
  81. --el-table-tr-bg-color: #f7f7f7;
  82. }
  83. }
  84. }
  85. </style>