organMemberList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <div>
  3. <el-card style="margin-bottom: 20px">
  4. <headers title="数据总览" @changeOrgan="changeOrgan" :special="true"/>
  5. <div
  6. class="wall"
  7. style="height: 68px"
  8. v-if="JSON.stringify(items) == '{}'"
  9. >
  10. 暂无数据
  11. </div>
  12. <!--
  13. -->
  14. <statistic :col="4" class="statistic" :cols="0">
  15. <statistic-item
  16. v-for="(item, key) in items"
  17. :key="key"
  18. @click="active = key"
  19. :class="{ active: active === key }"
  20. >
  21. <span v-if="key=='againBuyRate' || key=='buyRate'">
  22. {{ item.title + "(%)" }}
  23. <el-tooltip
  24. v-if="item.desc"
  25. :content="item.desc"
  26. :open-delay="0.3"
  27. placement="top"
  28. >
  29. <i
  30. style="margin-left: 5px; cursor: pointer"
  31. class="el-icon-warning-outline"
  32. />
  33. </el-tooltip>
  34. </span>
  35. <span v-else>
  36. {{ item.title + "(人)" }}
  37. <el-tooltip
  38. v-if="item.desc"
  39. :content="item.desc"
  40. :open-delay="0.3"
  41. placement="top"
  42. >
  43. <i
  44. style="margin-left: 5px; cursor: pointer"
  45. class="el-icon-warning-outline"
  46. />
  47. </el-tooltip>
  48. </span>
  49. <span v-if="key=='againBuyRate' || key=='buyRate'"> <count-to :endVal="item.percent || 0" :decimals="2" /> </span>
  50. <span v-else> <count-to :endVal="item.percent || 0" /> </span>
  51. </statistic-item>
  52. </statistic>
  53. </el-card>
  54. <el-card>
  55. <headers title="分部数据" :hidenOrgan="true"/>
  56. <div class="tableWrap">
  57. <el-table
  58. style="width: 100%"
  59. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  60. :data="tableList"
  61. @sort-change="sortChang"
  62. :default-sort="{
  63. prop: 'cloudStudyUseStudentDuty',
  64. order: 'descending',
  65. }"
  66. sortable="custom"
  67. >
  68. <el-table-column
  69. align="center"
  70. prop="organId"
  71. label="分部编号"
  72. ></el-table-column>
  73. <el-table-column
  74. align="center"
  75. prop="organName"
  76. label="分部名称"
  77. ></el-table-column>
  78. <el-table-column
  79. align="center"
  80. prop="totalStudentNum"
  81. label="在读学员总数"
  82. >
  83. <!-- <template slot="header" slot-scope="slot">
  84. <div class="titleCell">
  85. <span>学员总数</span>
  86. <el-tooltip placement="top" popper-class="mTooltip">
  87. <div slot="content">
  88. 乐团在读学员+有剩余VIP课或网管课学员去重之和
  89. </div>
  90. <i
  91. class="el-icon-question micon el-tooltip"
  92. style="
  93. font-size: 18px;
  94. color: #f56c6c;
  95. top: 2px;
  96. position: relative;
  97. "
  98. ></i>
  99. </el-tooltip>
  100. </div>
  101. </template> -->
  102. </el-table-column>
  103. <!-- <el-table-column
  104. align="center"
  105. prop="effectiveStudentNum"
  106. label="有效学员数"
  107. >
  108. </el-table-column> -->
  109. <el-table-column
  110. align="center"
  111. prop="vipStudentNum"
  112. label="会员总人数"
  113. >
  114. </el-table-column>
  115. <el-table-column
  116. align="center"
  117. prop="activeStudentNum"
  118. label="活跃会员"
  119. >
  120. <template slot="header" slot-scope="slot">
  121. <div class="titleCell">
  122. <span>活跃学员人数</span>
  123. <el-tooltip placement="top" popper-class="mTooltip">
  124. <div slot="content">
  125. 过去四周内有三周及以上每周训练时长超过60分钟为活跃学员
  126. </div>
  127. <i
  128. class="el-icon-question micon el-tooltip"
  129. style="
  130. font-size: 18px;
  131. color: #f56c6c;
  132. top: 2px;
  133. position: relative;
  134. "
  135. ></i>
  136. </el-tooltip>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column
  141. align="center"
  142. prop="effectiveVipStudentNum"
  143. label="生效中会员人数"
  144. ></el-table-column>
  145. <el-table-column
  146. align="center"
  147. prop="waitActivateVipStudentNum"
  148. label="待激活会员人数"
  149. ></el-table-column>
  150. <el-table-column
  151. align="center"
  152. prop="vipStudentRate"
  153. label="会员人数占比"
  154. >
  155. <template slot="header" slot-scope="slot">
  156. <div class="titleCell">
  157. <span>会员人数占比</span>
  158. <el-tooltip placement="top" popper-class="mTooltip">
  159. <div slot="content">
  160. 会员总人数/有效学员数
  161. </div>
  162. <i
  163. class="el-icon-question micon el-tooltip"
  164. style="
  165. font-size: 18px;
  166. color: #f56c6c;
  167. top: 2px;
  168. position: relative;
  169. "
  170. ></i>
  171. </el-tooltip>
  172. </div>
  173. </template>
  174. <template slot-scope="scope">
  175. <div>
  176. {{ numeral(scope.row.vipStudentRate || 0).format("0.00") }}%
  177. </div>
  178. </template>
  179. </el-table-column>
  180. <!-- <el-table-column
  181. align="center"
  182. prop="totalStudentNum"
  183. label="今日使用人数"
  184. ></el-table-column> -->
  185. </el-table>
  186. <!-- <pagination
  187. :autoScroll="false"
  188. :total.sync="rules.total"
  189. :page.sync="rules.page"
  190. :limit.sync="rules.limit"
  191. :page-sizes="rules.page_size"
  192. @pagination="getList"
  193. /> -->
  194. </div>
  195. </el-card>
  196. </div>
  197. </template>
  198. <script>
  199. import pagination from "@/components/Pagination/index";
  200. import { getOrganMemberList } from "../api";
  201. import { Export } from "@/utils/downLoadFile";
  202. import headers from "./modals/headers.vue";
  203. import countTo from "vue-count-to";
  204. import { descs, titles } from "../constant";
  205. import { getCloudStudyStudentOverView } from "../api";
  206. import numeral from "numeral";
  207. import qs from "qs";
  208. export default {
  209. props: ["data"],
  210. components: {
  211. headers,
  212. pagination,
  213. countTo,
  214. },
  215. data() {
  216. return {
  217. tableList: [],
  218. organId: "",
  219. rules: {
  220. // 分页规则
  221. limit: 10, // 限制显示条数
  222. page: 1, // 当前页
  223. total: 0, // 总条数
  224. page_size: [10, 20, 40, 50], // 选择限制显示条数
  225. },
  226. searchList: {
  227. cloudStudyUseStudentDuty: "DESC",
  228. },
  229. tenantId: "",
  230. dataList: {},
  231. active: "",
  232. };
  233. },
  234. mounted() {
  235. this.tenantId = this.$helpers.tenantId;
  236. this.getList();
  237. },
  238. methods: {
  239. async getList() {
  240. /**
  241. * try {
  242. const res = await getCloudStudyStudentOverView();
  243. this.dataList = res.data;
  244. } catch (e) {
  245. console.log(e);
  246. }
  247. */
  248. try {
  249. const arr = [
  250. 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56,
  251. ];
  252. const res = await getCloudStudyStudentOverView({
  253. page: 1,
  254. rows: 10,
  255. ...this.searchList,
  256. organIds: this.organId,
  257. });
  258. this.tableList = [];
  259. // res.data.forEach(ele => {
  260. // if(arr.indexOf (ele.organId) == -1){
  261. // this.tableList.push(ele)
  262. // }
  263. // });
  264. this.tableList = res.data.list;
  265. // this.rules.total = res.data.list?.total;
  266. this.dataList = res.data?.overView || {};
  267. // console.log(this.tableList)
  268. } catch (e) {
  269. console.log(e);
  270. }
  271. },
  272. sortChang(val) {
  273. const dates = {
  274. ascending: "ASC",
  275. descending: "DESC",
  276. };
  277. this.searchList = {};
  278. if (val.prop && val.order) {
  279. this.searchList[val.prop] = dates[val.order];
  280. }
  281. this.rules.page = 1;
  282. this.getList();
  283. },
  284. gotoDetail(row) {
  285. // 跳转到分部数据详情 row.organId
  286. this.$router.push({
  287. name: "organDateDetail",
  288. params: { organId: row.organId },
  289. });
  290. },
  291. changeOrgan(val) {
  292. this.organId = val;
  293. this.rules.page = 1;
  294. this.getList();
  295. },
  296. organDateExport() {
  297. let params = { ...this.searchList, organIds: this.organId };
  298. Export(
  299. this,
  300. {
  301. url: "/api-web/export/organStudentOverView",
  302. fileName: "分部云教练数据.xls",
  303. method: "post",
  304. params: qs.stringify(params),
  305. },
  306. "您确定导出分部云教练数据列表?"
  307. );
  308. },
  309. gotoAll() {
  310. this.$router.push({
  311. name: "organRankDetail",
  312. });
  313. },
  314. numeral(val) {
  315. return numeral(val);
  316. },
  317. },
  318. computed: {
  319. items() {
  320. let obj = {};
  321. // "eVipStudentNum",
  322. let arr = [
  323. "totalStudentNum",
  324. "buyRate",
  325. "againBuyRate",
  326. // "effectiveStudentNum",
  327. "vipStudentNum",
  328. "cloudStudyLivelyStudentNum",
  329. "effectiveVipStudentNum",
  330. "waitActivateVipStudentNum",
  331. // "newCloudStudyStudentNum",
  332. // "vipStudentRate",
  333. // "cloudStudyUseStudentNum",
  334. "cloudStudyTodayUseStudentNum",
  335. ];
  336. arr.forEach((str) => {
  337. if (this.dataList[str] + "") {
  338. obj[str] = {
  339. title: titles[str],
  340. percent: this.dataList[str],
  341. desc: descs[str],
  342. };
  343. }
  344. });
  345. return obj;
  346. },
  347. },
  348. };
  349. </script>
  350. <style lang="scss" scoped>
  351. ::v-deep .el-card__body {
  352. padding-top: 0 !important;
  353. }
  354. .titleCell {
  355. display: inline-block;
  356. }
  357. .tableWrap {
  358. margin-top: 20px;
  359. }
  360. .btnList {
  361. display: flex;
  362. flex-direction: row;
  363. justify-content: space-between;
  364. }
  365. </style>