finance_sum.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div>
  5. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  6. <el-row :gutter="20">
  7. <el-col :xs="24" :sm="12" :lg="6">
  8. <el-form-item label="区域" prop="websitId">
  9. <el-select v-model="searchForm.websitId" class="selectStyle" placeholder="请选择" filterable>
  10. <el-option v-for="(v, i) in areaList" :key="i" :label="v.name" :value="v.adminWebsitId">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="12" :lg="18">
  16. <el-form-item label="" class="fr">
  17. <el-button size="mini" @click="clearFn">清空</el-button>
  18. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  19. </el-form-item>
  20. </el-col>
  21. </el-row>
  22. </el-form>
  23. </div>
  24. <!-- 列表 -->
  25. <div class="mymain-container">
  26. <div class="table">
  27. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="$getSummaries">
  28. <!-- <el-table-column align="left" label="品类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column> -->
  29. <el-table-column align="left" label="钱包名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
  30. <el-table-column align="left" label="更新时间" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
  31. <el-table-column align="right" label="余额" prop="totalAmount" min-width="160" show-overflow-tooltip>
  32. <template slot-scope="scope">
  33. {{ scope.row.totalAmount | numToFixed }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column align="right" label="可用信用额度" prop="freezeCreditAmount" min-width="160" show-overflow-tooltip>
  37. <template slot-scope="scope">
  38. {{ scope.row.freezeCreditAmount | numToFixed }}
  39. </template>
  40. </el-table-column>
  41. <el-table-column align="right" label="已用信用额度" prop="usedCreditAmount" min-width="160" show-overflow-tooltip>
  42. <template slot-scope="scope">
  43. {{ scope.row.usedCreditAmount | numToFixed }}
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. <!-- 分页
  49. <div class="fr">
  50. <el-pagination
  51. :current-page="currentPage"
  52. :page-sizes="[10, 20, 30, 50]"
  53. :page-size="10"
  54. layout="total, sizes, prev, pager, next, jumper"
  55. :total="listTotal"
  56. >
  57. </el-pagination>
  58. </div> -->
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import {
  64. getFinanceTotal,
  65. getProductCategoryList,
  66. } from "@/api/finance/finance_sum";
  67. import { getAdminWebsitByparent } from "@/api/finance/blance_sum";
  68. export default {
  69. data() {
  70. return {
  71. // currentPage: 1, // 当前页码
  72. // pageSize: 10, // 每页数量
  73. // listTotal: 0, // 列表总数
  74. dataList: [], // 列表数据
  75. areaList: [],
  76. searchForm: {
  77. // mainId: "",
  78. websitId: "",
  79. }, //搜索表单
  80. listLoading: false, // 列表加载loading
  81. categoryList: [], //品类数据
  82. };
  83. },
  84. created() {
  85. // this.getCategoryList();
  86. this.getAreaList();
  87. this.getDataList();
  88. },
  89. methods: {
  90. //获取区域数据
  91. async getAreaList() {
  92. let res = await getAdminWebsitByparent({ parentId: 1 });
  93. this.areaList = res.data;
  94. },
  95. //清空
  96. async clearFn() {
  97. await this.$refs.searchForm.resetFields();
  98. },
  99. //搜索
  100. searchFn() {
  101. this.getDataList({ websitId: this.searchForm.websitId });
  102. },
  103. //获取品类数据
  104. async getCategoryList() {
  105. const res = await getProductCategoryList();
  106. this.categoryList = res.data;
  107. },
  108. //获取列表数据
  109. async getDataList(data) {
  110. const res = await getFinanceTotal(data);
  111. res.data.forEach((item) => {
  112. item.sums1 = [];
  113. item.sums2 = ["freezeCreditAmount", "usedCreditAmount", "totalAmount"];
  114. });
  115. this.dataList = res.data;
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .selectStyle {
  122. width: 100%;
  123. }
  124. </style>