credit_list-detail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div>
  3. <div class="sty">
  4. <el-page-header @back="goBack" content="信用额度变更记录">
  5. </el-page-header>
  6. </div>
  7. <el-divider></el-divider>
  8. <!-- 表头 -->
  9. <div>
  10. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
  11. <el-row :gutter="20">
  12. <el-col :xs="24" :sm="12" :lg="6">
  13. <el-form-item label="开始时间" prop="startTime">
  14. <el-date-picker class="selectStyle" v-model="searchForm.startTime" type="datetime" placeholder="选择日期时间" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss">
  15. </el-date-picker>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="结束时间" prop="endTime">
  20. <el-date-picker class="selectStyle" v-model="searchForm.endTime" type="datetime" placeholder="选择日期时间" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss">
  21. </el-date-picker>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="24" :lg="12">
  25. <el-form-item label="" class="fr">
  26. <el-button size="small" @click="clearFn">清空</el-button>
  27. <el-button size="small" type="primary" @click="searchFn">搜索</el-button>
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. </el-form>
  32. </div>
  33. <!-- 按钮 -->
  34. <div class="btn-group clearfix">
  35. <div class="fr">
  36. <el-button type="primary" size="small" @click="exportList">导出</el-button>
  37. </div>
  38. </div>
  39. <!-- 列表 -->
  40. <div class="mymain-container">
  41. <div class="table">
  42. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  43. <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
  44. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
  45. <template slot-scope="scope">
  46. <CopyButton :copyText="scope.row.customerNumber" />
  47. <span>{{scope.row.customerNumber}}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
  51. <template slot-scope="scope">
  52. <CopyButton :copyText="scope.row.customerName" />
  53. <span>{{scope.row.customerName}}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align="left" label="关联钱包" prop="customerWalletName" min-width="160" show-overflow-tooltip></el-table-column>
  57. <el-table-column align="right" label="变更金额" prop="amount" min-width="160" show-overflow-tooltip></el-table-column>
  58. <el-table-column align="right" label="使用金额" prop="useAmount" min-width="160" show-overflow-tooltip></el-table-column>
  59. <el-table-column align="left" label="开始日期" prop="startTime" min-width="160" show-overflow-tooltip></el-table-column>
  60. <el-table-column align="left" label="结束日期" prop="endTime" min-width="160" show-overflow-tooltip></el-table-column>
  61. <el-table-column align="left" label="变更时间" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>
  62. <el-table-column align="left" label="变更人" prop="updateBy" min-width="160" show-overflow-tooltip></el-table-column>
  63. </el-table>
  64. </div>
  65. <!-- 分页 -->
  66. <div class="fr">
  67. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
  68. </el-pagination>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { getCreditRecordList } from "@/api/finance/credit_list";
  75. import { downloadFiles } from "@/utils/util";
  76. export default {
  77. props: {
  78. recordsListId: {
  79. type: String,
  80. required: true,
  81. },
  82. },
  83. data() {
  84. return {
  85. currentPage: 1, // 当前页码
  86. pageSize: 10, // 每页数量
  87. listTotal: 0, // 列表总数
  88. dataList: [], // 列表数据
  89. searchForm: {
  90. startTime: "",
  91. endTime: "",
  92. }, //搜索表单
  93. listLoading: false, // 列表加载loading
  94. };
  95. },
  96. created() {
  97. this.getDataList({
  98. customerWalletId: this.recordsListId,
  99. pageSize: this.pageSize,
  100. pageNum: this.currentPage,
  101. });
  102. },
  103. methods: {
  104. // 更改每页数量
  105. handleSizeChange(val) {
  106. this.pageSize = val;
  107. this.currentPage = 1;
  108. this.getDataList({ pageNum: 1, pageSize: this.pageSize });
  109. },
  110. // 更改当前页
  111. handleCurrentChange(val) {
  112. this.currentPage = val;
  113. this.getDataList({ pageNum: val, pageSize: 10 });
  114. },
  115. //导出
  116. exportList() {
  117. let screenData = {
  118. customerWalletCreditId: this.recordsListId,
  119. startTime: this.searchForm.startTime,
  120. endTime: this.searchForm.endTime,
  121. };
  122. downloadFiles("/credit/record/export", screenData);
  123. },
  124. //清除
  125. clearFn() {
  126. this.$refs.searchForm.resetFields();
  127. },
  128. //搜索
  129. searchFn() {
  130. console.log(this.searchForm);
  131. this.getDataList({
  132. customerWalletId: this.recordsListId,
  133. pageSize: this.pageSize,
  134. pageNum: this.currentPage,
  135. ...this.searchForm,
  136. });
  137. },
  138. //获取信用额度变更记录数据
  139. async getDataList(data) {
  140. const res = await getCreditRecordList(data);
  141. this.dataList = res.data.records;
  142. this.listTotal = res.data.total;
  143. },
  144. goBack() {
  145. this.$parent.showRecord = true;
  146. },
  147. },
  148. };
  149. </script>
  150. <style>
  151. </style>