finance_sum.vue 4.2 KB

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