balance_sum.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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="customerNumber">
  9. <el-select v-model="searchForm.customerNumber" class="selectStyle" placeholder="请选择" filterable>
  10. <el-option v-for="(v, i) in customerList" :key="i" :label="v.name" :value="v.number">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="12" :lg="6">
  16. <el-form-item label="钱包" prop="walletId">
  17. <el-select v-model="searchForm.walletId" class="selectStyle" placeholder="请选择" filterable>
  18. <el-option v-for="(v, i) in walletList" :key="i" :label="v.name" :value="v.id">
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="区域" prop="area">
  25. <el-select v-model="searchForm.area" class="selectStyle" placeholder="请选择" filterable>
  26. <el-option v-for="(v, i) in areaList" :key="i" :label="v.name" :value="v.adminWebsitId">
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="24" :lg="6">
  32. <el-form-item label="" class="fr">
  33. <el-button size="mini" @click="clearFn">清空</el-button>
  34. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </el-form>
  39. </div>
  40. <!-- 按钮 -->
  41. <div class="btn-group clearfix">
  42. <div class="fr">
  43. <ExportButton :exUrl="'/finance/totalCustomer/export'" :exParams="exParams" />
  44. </div>
  45. </div>
  46. <!-- 列表 -->
  47. <div class="mymain-container">
  48. <div class="table">
  49. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="$getSummaries">
  50. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
  51. <template slot-scope="scope">
  52. <CopyButton :copyText="scope.row.customerNumber" />
  53. <span>{{scope.row.customerNumber}}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. <CopyButton :copyText="scope.row.customerName" />
  59. <span>{{scope.row.customerName}}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="left" label="更新时间" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
  63. <el-table-column align="right" label="总金额" prop="total" min-width="160" show-overflow-tooltip>
  64. <template slot-scope="scope">
  65. {{ scope.row.total | numToFixed }}
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
  69. <template v-slot="{ row }">
  70. <el-button type="text" class="textColor" @click="walletFn(row.customerId)">
  71. 余额
  72. </el-button>
  73. <el-button type="text" class="textColor" @click="
  74. seeFN(row.customerName, row.customerNumber, row.customerId)
  75. ">
  76. 明细
  77. </el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. </div>
  82. <!-- 分页
  83. <div class="fr">
  84. <el-pagination
  85. :current-page="currentPage"
  86. :page-sizes="[10, 20, 30, 50]"
  87. :page-size="10"
  88. layout="total, sizes, prev, pager, next, jumper"
  89. :total="listTotal"
  90. >
  91. </el-pagination>
  92. </div> -->
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import { getCustomerList } from "@/api/finance/account_list";
  98. import {
  99. getFinanceTotalCustomer,
  100. getAdminWebsitByparent,
  101. getFinanceList,
  102. } from "@/api/finance/blance_sum";
  103. export default {
  104. data() {
  105. return {
  106. // currentPage: 1, // 当前页码
  107. // pageSize: 10, // 每页数量
  108. // listTotal: 0, // 列表总数
  109. areaList: [],
  110. dataList: [], // 列表数据
  111. walletList: [], //钱包数据
  112. searchForm: {
  113. // customerName: "",
  114. customerNumber: "",
  115. area: "",
  116. walletId: "",
  117. }, //搜索表单
  118. customerList: [],
  119. listLoading: false, // 列表加载loading
  120. };
  121. },
  122. computed: {
  123. exParams() {
  124. return {
  125. ...this.searchForm,
  126. };
  127. },
  128. },
  129. created() {
  130. this.getAreaList();
  131. this.getDataList();
  132. this.getWalletList();
  133. this.getCustomerDataList({
  134. pageSize: -1,
  135. pageNum: 1,
  136. });
  137. },
  138. methods: {
  139. //获取钱包数据
  140. async getWalletList() {
  141. let res = await getFinanceList();
  142. console.log(res, 122);
  143. this.walletList = res.data;
  144. },
  145. //获取区域数据
  146. async getAreaList() {
  147. let res = await getAdminWebsitByparent({ parentId: 1 });
  148. this.areaList = res.data;
  149. },
  150. //获取经销商数据
  151. async getCustomerDataList(data) {
  152. const res = await getCustomerList(data);
  153. this.customerList = res.data.records;
  154. },
  155. //清除
  156. clearFn() {
  157. this.$refs.searchForm.resetFields();
  158. },
  159. //搜索
  160. searchFn() {
  161. this.getDataList(this.searchForm);
  162. },
  163. //获取列表数据
  164. async getDataList(data) {
  165. const res = await getFinanceTotalCustomer(data);
  166. // console.log(res);
  167. res.data.forEach((item) => {
  168. item.sums1 = [];
  169. item.sums2 = ["total"];
  170. });
  171. this.dataList = res.data;
  172. },
  173. //余额
  174. walletFn(v) {
  175. this.$router.push({
  176. path: "/finance/details/wallet",
  177. query: {
  178. id: v,
  179. },
  180. });
  181. },
  182. //明细
  183. seeFN(customerName, customerNumber, customerId) {
  184. this.$router.push({
  185. path: "/finance/details/standbook_list",
  186. query: {
  187. customerName,
  188. customerNumber,
  189. customerId,
  190. },
  191. });
  192. },
  193. },
  194. };
  195. </script>
  196. <style lang="scss" scoped>
  197. .selectStyle {
  198. width: 100%;
  199. }
  200. </style>