statisticalAnalysisOfMessage.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div>
  3. <div class="card">
  4. <cord-top title="留言统计明细表" @returnWhere="getList" />
  5. <div style="height: 20px" />
  6. <tableTemplate
  7. ref="table"
  8. :layout="tablecols"
  9. :data="list"
  10. :opwidth="200"
  11. :custom="true"
  12. >
  13. <template v-slot:customcol="scope">
  14. <p
  15. v-if="
  16. ['allocationstatus', 'status'].includes(scope.column.columnname)
  17. "
  18. :style="
  19. tool.getStatusColor(scope.column.data[scope.column.columnname])
  20. "
  21. >
  22. {{ $t(scope.column.data[scope.column.columnname]) }}
  23. </p>
  24. <p v-else-if="['deleted'].includes(scope.column.columnname)">
  25. {{
  26. $t(scope.column.data[scope.column.columnname] == 0 ? "否" : "是")
  27. }}
  28. </p>
  29. <p v-else>
  30. {{ $t(scope.column.data[scope.column.columnname]) }}
  31. </p>
  32. </template>
  33. </tableTemplate>
  34. <div class="pagination-box">
  35. <el-pagination
  36. @size-change="handleSizeChange"
  37. @current-change="handleCurrentChange"
  38. :current-page.sync="content.pageNumbe"
  39. :page-sizes="[10, 20, 30, 50]"
  40. :page-size="content.pageSize"
  41. layout="total,sizes, prev, pager, next, jumper"
  42. :total="content.total"
  43. >
  44. </el-pagination>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import cordTop from "./header.vue";
  51. import tableTemplate from "@/views/salesData/components/table";
  52. export default {
  53. components: {
  54. cordTop,
  55. tableTemplate,
  56. },
  57. data() {
  58. return {
  59. list: [],
  60. tablecols: [],
  61. content: {
  62. pageSize: 10,
  63. pageNumbe: 1,
  64. total: 0,
  65. where: {},
  66. nocache: true,
  67. type: "近七日",
  68. },
  69. };
  70. },
  71. created() {
  72. this.content.siteid = JSON.parse(
  73. sessionStorage.getItem("active_account")
  74. ).siteid;
  75. this.getList();
  76. this.tablecols = this.tool.tabelCol(
  77. this.$route.name
  78. ).statisticalAnalysisOfMessage.tablecols;
  79. },
  80. methods: {
  81. getList(detail) {
  82. let content = this.content;
  83. if (detail) {
  84. if (detail.type) {
  85. content.type = detail.type;
  86. content.where = {};
  87. } else {
  88. content.type = "";
  89. content.where = detail;
  90. }
  91. }
  92. this.$api
  93. .requested({
  94. id: 2025021108560703,
  95. content,
  96. })
  97. .then((res) => {
  98. console.log("留言统计明细表", res);
  99. if (res.code != 1) return;
  100. this.list = res.data;
  101. this.content.total = res.total;
  102. this.content.pageNumbe = res.pageNumber;
  103. this.content.pageSize = res.pageSize;
  104. });
  105. },
  106. handleSizeChange(pageSize) {
  107. this.content.pageSize = pageSize;
  108. this.getList();
  109. },
  110. handleCurrentChange(pageNumbe) {
  111. this.content.pageNumbe = pageNumbe;
  112. this.getList();
  113. },
  114. },
  115. };
  116. </script>
  117. <style scoped>
  118. .card {
  119. width: 100%;
  120. padding: 20px;
  121. background: #ffffff;
  122. box-shadow: 0px 1px 6px 1px rgba(0, 0, 0, 0.16);
  123. border-radius: 10px;
  124. box-sizing: border-box;
  125. margin-top: 20px;
  126. }
  127. .pagination-box {
  128. margin-top: 20px;
  129. display: flex;
  130. justify-content: flex-end;
  131. }
  132. </style>