memberShareList.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 学练宝分润
  7. </h2>
  8. <div class="m-core">
  9. <el-card header="" style="width:460px" class="myCard">
  10. <statistic class="statistic" :cols="0">
  11. <statistic-item>
  12. <span>
  13. 意向机构
  14. </span>
  15. <span> <count-to :endVal="detail.tenantAgency"/></span>
  16. </statistic-item>
  17. <statistic-item>
  18. <span>
  19. 入驻机构
  20. </span>
  21. <span> <count-to :endVal="detail.preTenant"/></span>
  22. </statistic-item>
  23. <statistic-item>
  24. <span>
  25. 学练宝销售数(个月)
  26. </span>
  27. <span> <count-to :endVal="detail.memberCount"/></span>
  28. </statistic-item>
  29. </statistic>
  30. </el-card>
  31. <save-form
  32. :inline="true"
  33. :model="searchForm"
  34. @submit="search"
  35. @reset="onReSet"
  36. >
  37. <el-form-item prop="proxyId">
  38. <el-select
  39. class="multiple"
  40. v-model.trim="searchForm.proxyId"
  41. filterable
  42. clearable
  43. placeholder="请选代理商"
  44. >
  45. <el-option
  46. v-for="(item, index) in proxyList"
  47. :key="index"
  48. :label="item.proxyName"
  49. :value="item.proxyId"
  50. ></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item>
  54. <el-form-item prop="recommenderId">
  55. <remote-search
  56. :commit="'setTenantUser'"
  57. aria-placeholder="请选择推荐人"
  58. v-model="searchForm.recommenderId"
  59. />
  60. </el-form-item>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-date-picker
  64. :clearable="false"
  65. v-model.trim="searchForm.timer"
  66. style="width: 420px"
  67. type="daterange"
  68. value-format="yyyy-MM-dd"
  69. range-separator="至"
  70. start-placeholder="开始日期"
  71. end-placeholder="结束日期"
  72. :picker-options="{
  73. firstDayOfWeek: 1
  74. }"
  75. >
  76. </el-date-picker>
  77. </el-form-item>
  78. <el-form-item>
  79. <el-button native-type="submit" type="primary">搜索</el-button>
  80. <el-button native-type="reset" type="danger">重置</el-button>
  81. </el-form-item>
  82. </save-form>
  83. <div class="tableWrap">
  84. <el-table
  85. style="width: 100%"
  86. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  87. :data="tableList"
  88. >
  89. <el-table-column
  90. align="center"
  91. prop="proxyId"
  92. label="代理商编号"
  93. ></el-table-column>
  94. <el-table-column
  95. align="center"
  96. prop="proxyName"
  97. label="代理商名称"
  98. ></el-table-column>
  99. <el-table-column
  100. align="center"
  101. prop="tenantId"
  102. label="机构编号"
  103. ></el-table-column>
  104. <el-table-column
  105. align="center"
  106. prop="tenantName"
  107. label="机构名称"
  108. ></el-table-column>
  109. <el-table-column align="center" prop="activeDate" label="激活时间">
  110. <template slot-scope="scope">
  111. {{ scope.row.activeDate | formatTimer }}
  112. </template>
  113. </el-table-column>
  114. <el-table-column
  115. align="center"
  116. prop="activeCount"
  117. label="激活数量(个月)"
  118. ></el-table-column>
  119. <el-table-column
  120. align="center"
  121. prop="recommenderName"
  122. label="推荐人"
  123. ></el-table-column>
  124. </el-table>
  125. <pagination
  126. sync
  127. :total.sync="rules.total"
  128. :page.sync="rules.page"
  129. :limit.sync="rules.limit"
  130. :page-sizes="rules.page_size"
  131. @pagination="getList"
  132. />
  133. </div>
  134. </div>
  135. </div>
  136. </template>
  137. <script>
  138. import axios from "axios";
  139. import { getToken } from "@/utils/auth";
  140. import pagination from "@/components/Pagination/index";
  141. import { getTimes } from "@/utils";
  142. import load from "@/utils/loading";
  143. import {
  144. getProxyUserList,
  145. getProxyDividend,
  146. getProxyDividendList
  147. } from "./api";
  148. import countTo from "vue-count-to";
  149. export default {
  150. components: { pagination, "count-to": countTo },
  151. data() {
  152. return {
  153. searchForm: {
  154. search: null,
  155. timer: []
  156. },
  157. detail: {
  158. memberCount: 0,
  159. preTenant: 0,
  160. tenantAgency: 0
  161. },
  162. tableList: [],
  163. organList: [],
  164. rules: {
  165. // 分页规则
  166. limit: 10, // 限制显示条数
  167. page: 1, // 当前页
  168. total: 0, // 总条数
  169. page_size: [10, 20, 40, 50] // 选择限制显示条数
  170. },
  171. proxyList: []
  172. };
  173. },
  174. //生命周期 - 创建完成(可以访问当前this实例)
  175. created() {},
  176. //生命周期 - 挂载完成(可以访问DOM元素)
  177. mounted() {
  178. // 获取分部
  179. this.searchForm.timer = this.getInitDate();
  180. this.init();
  181. },
  182. methods: {
  183. init() {
  184. this.getProxList();
  185. this.getProxyDividendDetail();
  186. this.getList();
  187. },
  188. async getProxyDividendDetail() {
  189. try {
  190. const res = await getProxyDividend();
  191. this.detail = {
  192. ...res.data
  193. };
  194. } catch (e) {
  195. console.log(e);
  196. }
  197. },
  198. async getProxList() {
  199. try {
  200. const res = await getProxyUserList({
  201. page: 1,
  202. rows: 9999,
  203. state: "0"
  204. });
  205. this.proxyList = res.data.rows;
  206. } catch (e) {}
  207. },
  208. async getList() {
  209. let { timer, ...rest } = this.searchForm;
  210. let params = {
  211. ...rest,
  212. page: this.rules.page,
  213. rows: this.rules.limit,
  214. ...getTimes(timer, ["startData", "endData"])
  215. };
  216. try {
  217. const res = await getProxyDividendList({ ...params });
  218. this.tableList = res.data.rows;
  219. this.rules.total = res.data.total;
  220. } catch (e) {
  221. console.log(e);
  222. }
  223. },
  224. search() {
  225. this.rules.page = 1;
  226. this.getList();
  227. },
  228. onReSet() {
  229. this.$nextTick(() => {
  230. this.searchForm.timer = this.getInitDate();
  231. this.search();
  232. });
  233. },
  234. getInitDate() {
  235. const end = this.$helpers.dayjs(new Date()).format("YYYY-MM-DD");
  236. const start = this.$helpers
  237. .dayjs(new Date())
  238. .set("date", 1)
  239. .format("YYYY-MM-DD");
  240. return [start, end];
  241. }
  242. }
  243. };
  244. </script>
  245. <style lang="scss" scoped>
  246. .myCard {
  247. margin-bottom: 20px;
  248. ::v-deep .el-card__body {
  249. padding: 0 20px !important;
  250. }
  251. }
  252. </style>