organRankDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="m-container">
  3. <el-page-header
  4. @back="goback"
  5. style="padding-bottom: 30px"
  6. content="分部云练习数据"
  7. >
  8. </el-page-header>
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. ref="saveForm"
  14. >
  15. <el-form-item prop="organId">
  16. <el-select
  17. class="multiple"
  18. v-model.trim="searchForm.organId"
  19. clearable
  20. filterable
  21. placeholder="请选择分部"
  22. @change="search"
  23. >
  24. <el-option
  25. v-for="(item, index) in specialList"
  26. :key="index"
  27. :label="item.name"
  28. :value="item.id"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. </save-form>
  33. <p style="margin-bottom: 20px; font-size: 14px">
  34. 共{{ tableList.length }}个分部
  35. </p>
  36. <div class="tableWrap">
  37. <el-table
  38. style="width: 100%"
  39. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  40. :data="tableList"
  41. @sort-change="sortChang"
  42. :default-sort="{
  43. prop: 'cloudStudyUseStudentDuty',
  44. order: 'descending'
  45. }"
  46. sortable="custom"
  47. >
  48. <el-table-column
  49. align="center"
  50. prop="index"
  51. label="排名"
  52. ></el-table-column>
  53. <el-table-column
  54. align="center"
  55. prop="organName"
  56. label="分部"
  57. ></el-table-column>
  58. <el-table-column align="center" prop="totalStudentNum" label="学员总数">
  59. <template slot="header" slot-scope="slot">
  60. <div class="titleCell">
  61. <span>学员总数</span>
  62. <el-tooltip placement="top" popper-class="mTooltip">
  63. <div slot="content">
  64. 乐团在读学员+有剩余VIP课或网管课学员去重之和
  65. </div>
  66. <i
  67. class="el-icon-question micon el-tooltip"
  68. style="
  69. font-size: 18px;
  70. color: #f56c6c;
  71. top: 2px;
  72. position: relative;
  73. "
  74. ></i>
  75. </el-tooltip>
  76. </div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. align="center"
  81. prop="targetNum"
  82. label="目标人数"
  83. v-if="tenantId == 1"
  84. >
  85. <template slot="header" slot-scope="slot">
  86. <div class="titleCell">
  87. <span>目标人数</span>
  88. <el-tooltip placement="top" popper-class="mTooltip">
  89. <div slot="content">
  90. 进行中非会员乐团-已上乐团课小于等于4节学员-非本活动购买会员-弦乐声部学员
  91. </div>
  92. <i
  93. class="el-icon-question micon el-tooltip"
  94. style="
  95. font-size: 18px;
  96. color: #f56c6c;
  97. top: 2px;
  98. position: relative;
  99. "
  100. ></i>
  101. </el-tooltip>
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column
  106. align="center"
  107. prop="cloudStudyLivelyStudentNum"
  108. label="活跃人数"
  109. >
  110. <template slot="header" slot-scope="slot">
  111. <div class="titleCell">
  112. <span>活跃人数</span>
  113. <el-tooltip placement="top" popper-class="mTooltip">
  114. <div slot="content">近15天内使用达到5天及以上的用户数</div>
  115. <i
  116. class="el-icon-question micon el-tooltip"
  117. style="
  118. font-size: 18px;
  119. color: #f56c6c;
  120. top: 2px;
  121. position: relative;
  122. "
  123. ></i>
  124. </el-tooltip>
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. align="center"
  130. prop="cloudStudyUseStudentNum"
  131. label="使用人数"
  132. >
  133. <template slot="header" slot-scope="slot">
  134. <div class="titleCell">
  135. <span>使用人数</span>
  136. <el-tooltip placement="top" popper-class="mTooltip">
  137. <div slot="content">截止目前使用云练习的总人数</div>
  138. <i
  139. class="el-icon-question micon el-tooltip"
  140. style="
  141. font-size: 18px;
  142. color: #f56c6c;
  143. top: 2px;
  144. position: relative;
  145. "
  146. ></i>
  147. </el-tooltip>
  148. </div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column align="center" prop="newStudentNum" label="新用户人数">
  152. <template slot="header">
  153. <div class="titleCell">
  154. <span>新用户人数</span>
  155. <el-tooltip placement="top" popper-class="mTooltip">
  156. <div slot="content">乐团在读学员已上课程≤4节</div>
  157. <i
  158. class="el-icon-question micon el-tooltip"
  159. style="
  160. font-size: 18px;
  161. color: #f56c6c;
  162. top: 2px;
  163. position: relative;
  164. "
  165. ></i>
  166. </el-tooltip>
  167. </div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. sortable="custom"
  172. align="center"
  173. prop="newStudentDuty"
  174. label="新用户占比"
  175. >
  176. <template slot-scope="scope">
  177. {{ scope.row.newStudentDuty }}%
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. align="center"
  182. prop="newCloudStudyStudentNum"
  183. label="新增使用人数"
  184. width="130px"
  185. >
  186. <template slot="header" slot-scope="slot">
  187. <div class="titleCell">
  188. <span>新增使用人数</span>
  189. <el-tooltip placement="top" popper-class="mTooltip">
  190. <div slot="content">当日第一次使用云练习的人数</div>
  191. <i
  192. class="el-icon-question micon el-tooltip"
  193. style="
  194. font-size: 18px;
  195. color: #f56c6c;
  196. top: 2px;
  197. position: relative;
  198. "
  199. ></i>
  200. </el-tooltip>
  201. </div>
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. align="center"
  206. prop="cloudStudyUseStudentDuty"
  207. label="使用比例"
  208. sortable="custom"
  209. width="140px"
  210. >
  211. <template slot="header" slot-scope="slot">
  212. <div class="titleCell">
  213. <span>使用比例</span>
  214. <el-tooltip placement="top" popper-class="mTooltip">
  215. <div slot="content">使用人数 / 学员总数</div>
  216. <i
  217. class="el-icon-question micon el-tooltip"
  218. style="
  219. font-size: 18px;
  220. color: #f56c6c;
  221. top: 2px;
  222. position: relative;
  223. "
  224. ></i>
  225. </el-tooltip>
  226. </div>
  227. </template>
  228. <template slot-scope="scope">
  229. <div>{{ scope.row.cloudStudyUseStudentDuty }}%</div>
  230. </template>
  231. </el-table-column>
  232. <el-table-column align="center" prop="vipStudentNum" label="付费会员数">
  233. <template slot="header" slot-scope="slot">
  234. <div class="titleCell">
  235. <span>付费会员数</span>
  236. <el-tooltip placement="top" popper-class="mTooltip">
  237. <div slot="content">该分部生效中、待生效付费会员总数</div>
  238. <i
  239. class="el-icon-question micon el-tooltip"
  240. style="
  241. font-size: 18px;
  242. color: #f56c6c;
  243. top: 2px;
  244. position: relative;
  245. "
  246. ></i>
  247. </el-tooltip>
  248. </div>
  249. </template>
  250. </el-table-column>
  251. <el-table-column
  252. sortable="custom"
  253. align="center"
  254. prop="vipStudentDuty"
  255. label="付费会员占比"
  256. width="150px"
  257. >
  258. <template slot="header" slot-scope="slot">
  259. <div class="titleCell">
  260. <span>付费会员占比</span>
  261. <el-tooltip placement="top" popper-class="mTooltip">
  262. <div slot="content">付费会员数 / 学员总数</div>
  263. <i
  264. class="el-icon-question micon el-tooltip"
  265. style="
  266. font-size: 18px;
  267. color: #f56c6c;
  268. top: 2px;
  269. position: relative;
  270. "
  271. ></i>
  272. </el-tooltip>
  273. </div>
  274. </template>
  275. <template slot-scope="scope">
  276. <div>{{ scope.row.vipStudentDuty }}%</div>
  277. </template>
  278. </el-table-column>
  279. <!-- <el-table-column
  280. sortable="custom"
  281. align="center"
  282. prop="eVipStudentNum"
  283. label="试用会员"
  284. >
  285. <template slot="header" slot-scope="slot">
  286. <div class="titleCell">
  287. <span>试用会员</span>
  288. <el-tooltip placement="top" popper-class="mTooltip">
  289. <div slot="content">
  290. 有生效中或待生效的付费会员,不统计在内
  291. </div>
  292. <i
  293. class="el-icon-question micon el-tooltip"
  294. style="
  295. font-size: 18px;
  296. color: #f56c6c;
  297. top: 2px;
  298. position: relative;
  299. "
  300. ></i>
  301. </el-tooltip>
  302. </div>
  303. </template>
  304. </el-table-column> -->
  305. <el-table-column align="center" prop="studentId" label="操作">
  306. <template slot-scope="scope">
  307. <div>
  308. <auth auths="/organDateDetail">
  309. <el-button type="text" @click="gotoDetail(scope.row)"
  310. >详情</el-button
  311. >
  312. </auth>
  313. </div>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. <!-- <pagination
  318. :autoScroll="false"
  319. :total.sync="rules.total"
  320. :page.sync="rules.page"
  321. :limit.sync="rules.limit"
  322. :page-sizes="rules.page_size"
  323. @pagination="getList"
  324. /> -->
  325. </div>
  326. </div>
  327. </template>
  328. <script>
  329. import headers from "./modals/headers.vue";
  330. import pagination from "@/components/Pagination/index";
  331. import { Export } from "@/utils/downLoadFile";
  332. import dayjs from "dayjs";
  333. import qs from "qs";
  334. import { organStudentOverView } from "../api";
  335. export default {
  336. components: {
  337. headers,
  338. pagination
  339. },
  340. data() {
  341. return {
  342. tableList: [],
  343. searchList: {
  344. cloudStudyUseStudentDuty: "DESC"
  345. },
  346. searchForm: {},
  347. rules: {
  348. // 分页规则
  349. limit: 10, // 限制显示条数
  350. page: 1, // 当前页
  351. total: 0, // 总条数
  352. page_size: [10, 20, 40, 50] // 选择限制显示条数
  353. },
  354. date: "",
  355. specialList: [],
  356. tenantId: ""
  357. };
  358. },
  359. async mounted() {
  360. this.date = dayjs(new Date())
  361. .subtract(1, "day")
  362. .format("YYYY-MM-DD");
  363. await this.$store.dispatch("setBranchs");
  364. const arr = [
  365. 36,
  366. 39,
  367. 41,
  368. 42,
  369. 43,
  370. 44,
  371. 45,
  372. 46,
  373. 47,
  374. 48,
  375. 49,
  376. 50,
  377. 52,
  378. 54,
  379. 55,
  380. 56
  381. ];
  382. this.specialList = this.selects.branchs.filter(item => {
  383. return arr.indexOf(item.id) == -1;
  384. });
  385. if (this.$route.params?.organId) {
  386. this.searchForm.organId = this.$route.params.organId;
  387. }
  388. this.getList();
  389. this.tenantId = this.$helpers.tenantId;
  390. },
  391. methods: {
  392. async getList() {
  393. try {
  394. const res = await organStudentOverView({
  395. ...this.searchList,
  396. rows: 999,
  397. page: 1,
  398. organIds: this.searchForm.organId
  399. });
  400. this.tableList = res.data.rows;
  401. this.rules.total = res.data.total;
  402. } catch (e) {
  403. console.log(e);
  404. }
  405. },
  406. search() {
  407. this.getList();
  408. },
  409. bigin() {
  410. let self = this;
  411. return {
  412. firstDayOfWeek: 1,
  413. disabledDate(time) {
  414. if (self.endDate) {
  415. let endTime = self.$helpers.dayjs(self.endDate).valueOf();
  416. return time.getTime() > endTime;
  417. } else {
  418. return time.getTime() >= Date.now() - 24 * 60 * 60 * 1000;
  419. }
  420. }
  421. };
  422. },
  423. changeValue(val) {
  424. this.date = val;
  425. this.rules.page = 1;
  426. this.getList();
  427. },
  428. sortChang(val) {
  429. const dates = {
  430. ascending: "ASC",
  431. descending: "DESC"
  432. };
  433. this.searchList = {};
  434. if (val.prop && val.order) {
  435. this.searchList[val.prop] = dates[val.order];
  436. }
  437. this.rules.page = 1;
  438. this.getList();
  439. },
  440. rankingExport() {
  441. let params = { ...this.searchForm, date: this.date };
  442. Export(
  443. this,
  444. {
  445. url: "/api-web/export/cloudStudyStudentOverView",
  446. fileName: "分部云练习数据排行.xls",
  447. method: "post",
  448. params: qs.stringify(params)
  449. },
  450. "您确定导出分部云练习数据排行?"
  451. );
  452. },
  453. goback() {
  454. this.$store.dispatch("delVisitedViews", this.$route);
  455. this.$router.push({ path: "/workbench?tabrouter=cloudDate" });
  456. },
  457. gotoDetail(row) {
  458. // 跳转到分部数据详情 row.organId
  459. this.$router.push({
  460. name: "organDateDetail",
  461. params: { organId: row.organId }
  462. });
  463. }
  464. }
  465. };
  466. </script>
  467. <style lang="scss" scoped>
  468. ::v-deep .el-card__body {
  469. padding-top: 0 !important;
  470. }
  471. .titleCell {
  472. display: inline-block;
  473. }
  474. .chioseBox {
  475. display: flex;
  476. flex-direction: row;
  477. align-items: center;
  478. justify-content: flex-start;
  479. margin-bottom: 30px;
  480. .lookOrgan {
  481. margin-left: 10px;
  482. }
  483. }
  484. .wrap {
  485. position: relative;
  486. display: flex;
  487. flex-direction: row;
  488. align-items: center;
  489. justify-content: space-between;
  490. margin-bottom: 20px;
  491. }
  492. </style>