index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="default-main ba-table-box">
  3. <!-- 表格顶部菜单 -->
  4. <TableHeader :buttons="['refresh', 'columnDisplay',]"></TableHeader>
  5. <!-- 表格 -->
  6. <!-- 要使用`el-table`组件原有的属性,直接加在Table标签上即可 -->
  7. <Table ref="tableRef"></Table>
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. import { ref, reactive, provide, } from 'vue'
  12. import baTableClass from '/@/utils/baTable'
  13. import Table from '/@/components/table/index.vue'
  14. import TableHeader from '/@/components/table/header/index.vue'
  15. import { baTableApi } from '/@/api/common'
  16. import { useI18n } from 'vue-i18n'
  17. defineOptions({
  18. name: 'order/distribution',
  19. })
  20. const { t } = useI18n()
  21. const baTable = new baTableClass(
  22. new baTableApi('/admin/order.Distribution/'),
  23. {
  24. column: [
  25. { label: '编号', prop: 'id', align: 'center', width: 70, operator: '=' },
  26. {
  27. label: '关联订单编号',
  28. prop: 'order_no',
  29. align: 'center',
  30. minWidth: 160,
  31. },
  32. {
  33. label: '分佣产品',
  34. prop: 'commission_product',
  35. align: 'center',
  36. minWidth: 140,
  37. },
  38. {
  39. label: '购买人',
  40. prop: 'g_name',
  41. align: 'center',
  42. minWidth: 100,
  43. },
  44. {
  45. label: '分佣人',
  46. prop: 'f_name',
  47. align: 'center',
  48. minWidth: 100,
  49. },
  50. {
  51. label: '分佣金额',
  52. prop: 'commission_amount',
  53. align: 'center',
  54. minWidth: 120,
  55. },
  56. {
  57. label: '佣金比例',
  58. prop: 'commission_rate',
  59. align: 'center',
  60. minWidth: 110,
  61. formatter: (row: any, column: any, cellValue: any) => {
  62. return cellValue ? `${cellValue}%` : '-';
  63. },
  64. },
  65. {
  66. label: '创建时间',
  67. prop: 'create_time',
  68. align: 'center',
  69. minWidth: 170,
  70. },
  71. {
  72. label: '状态',
  73. prop: 'status',
  74. align: 'center',
  75. render: 'tag',
  76. custom: {
  77. '1': 'warning',
  78. '2': 'success',
  79. '3': 'info',
  80. },
  81. replaceValue: {
  82. '1': '待结算',
  83. '2': '已结算',
  84. '3': '已取消',
  85. },
  86. minWidth: 100,
  87. },
  88. {
  89. label: '操作',
  90. align: 'center',
  91. width: '180',
  92. render: 'slot',
  93. slotName: 'operate',
  94. operator: false,
  95. },
  96. ],
  97. dblClickNotEditColumn: [undefined,],
  98. filter: {
  99. limit: 20,
  100. },
  101. },
  102. {
  103. defaultItems: {
  104. },
  105. },
  106. )
  107. baTable.mount()
  108. baTable.getIndex()
  109. provide('baTable', baTable)
  110. // 搜索
  111. const seachList = () => {
  112. baTable.table.filter!.page = 1
  113. baTable.table.loading = true
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. </style>