tablelist.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div id="tablelist">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="24" class="infoTop">
  6. <span>交易展示</span>
  7. </el-col>
  8. <el-col :span="24" class="tableInfo">
  9. <el-table :data="tableData" style="width: 100%" stripe border>
  10. <el-table-column prop="market_username" label="营销单位" align="center" :show-overflow-tooltip="true"> </el-table-column>
  11. <el-table-column prop="username" label="采购单位" align="center" :show-overflow-tooltip="true"> </el-table-column>
  12. <el-table-column prop="product_name" label="产品交易" align="center" :show-overflow-tooltip="true"> </el-table-column>
  13. <el-table-column prop="state" label="状态" align="center">
  14. <template v-slot="scoped">
  15. {{
  16. `${scoped.row.status}` === `0`
  17. ? '未交易'
  18. : `${scoped.row.status}` === `1`
  19. ? '交易中'
  20. : `${scoped.row.status}` === `2`
  21. ? '交易成功'
  22. : `${scoped.row.status}` === `3`
  23. ? '交易失败'
  24. : ''
  25. }}
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. </el-col>
  30. <el-col :span="24" class="page">
  31. <el-pagination
  32. @current-change="handleCurrentChange"
  33. :current-page="currentPage"
  34. :page-size="10"
  35. layout="total, prev, pager, next, jumper"
  36. :total="total"
  37. >
  38. </el-pagination>
  39. </el-col>
  40. </el-col>
  41. </el-row>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. name: 'tablelist',
  47. props: {
  48. tableData: null,
  49. total: null,
  50. },
  51. components: {},
  52. data: () => ({
  53. currentPage: 1,
  54. }),
  55. created() {},
  56. computed: {},
  57. methods: {
  58. handleCurrentChange(val) {
  59. console.log(`当前页: ${val}`);
  60. this.$emit('query', val);
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .infoTop {
  67. height: 60px;
  68. border-bottom: 1px solid #22529a;
  69. margin: 0 0 30px 0;
  70. }
  71. .infoTop span:only-child {
  72. width: 15%;
  73. height: 60px;
  74. background-color: #22529a;
  75. color: #fff;
  76. text-align: center;
  77. line-height: 60px;
  78. font-size: 20px;
  79. display: block;
  80. }
  81. .tableInfo {
  82. margin: 0 auto;
  83. width: 90%;
  84. float: none;
  85. height: 630px;
  86. }
  87. /deep/.el-table th {
  88. background-color: #f3f3f3;
  89. color: rgba(1, 1, 1, 0.5);
  90. font-size: 18px;
  91. text-align: center;
  92. }
  93. /deep/.el-table td {
  94. color: rgba(1, 1, 1, 0.7);
  95. font-size: 18px;
  96. text-align: center;
  97. }
  98. .page {
  99. margin: 20px 0;
  100. text-align: center;
  101. }
  102. </style>