finance_sum.vue 4.7 KB

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