dayList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <!-- -->
  2. <template>
  3. <div class="">
  4. <div class="m-core">
  5. <save-form
  6. :inline="true"
  7. :model="searchForm"
  8. ref="searchForm"
  9. @submit="search"
  10. @reset="onReSet"
  11. >
  12. <el-form-item prop="organId">
  13. <el-select
  14. class="multiple"
  15. filterable
  16. v-model.trim="searchForm.organId"
  17. clearable
  18. placeholder="请选择分部"
  19. @change="changeOrgan"
  20. >
  21. <el-option
  22. v-for="(item, index) in selects.branchs"
  23. :key="index"
  24. :label="item.name"
  25. :value="item.id"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item prop="cooperationId">
  30. <el-select
  31. v-model.trim="searchForm.cooperationId"
  32. :disabled="!searchForm.organId"
  33. filterable
  34. clearable
  35. placeholder="请选择合作单位"
  36. @change="changeCooper"
  37. >
  38. <el-option
  39. v-for="(item, index) in cooperationList"
  40. :key="index"
  41. :label="item.name"
  42. :value="item.id"
  43. ></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item prop="musicGroupId">
  47. <el-select
  48. v-model.trim="searchForm.musicGroupId"
  49. clearable
  50. filterable
  51. placeholder="请选择乐团"
  52. :disabled="!searchForm.cooperationId"
  53. >
  54. <el-option
  55. v-for="(item, index) in musicList"
  56. :key="index"
  57. :value="item.id"
  58. :label="item.name"
  59. ></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button native-type="submit" type="primary">搜索</el-button>
  64. <el-button native-type="reset" type="danger">重置</el-button>
  65. </el-form-item>
  66. </save-form>
  67. <div class="btnList">
  68. <el-button type="primary" @click="onCreateQRCode('placeholder')"
  69. >预报名链接</el-button
  70. >
  71. <el-button type="primary" @click="onCreateQRCode('music')"
  72. >器乐考级报名链接</el-button
  73. >
  74. <el-button type="primary" @click="onCreateQRCode('vip')"
  75. >VIP课程链接</el-button
  76. >
  77. <el-button type="primary" @click="onCreateQRCode('theory')"
  78. >乐理考级链接</el-button
  79. >
  80. <el-button type="primary" @click="onCreateQRCode('musicOut')" style="background-color: #f97215; border: 1px solid #f97215"
  81. >对外器乐考级报名链接</el-button
  82. >
  83. <el-button type="primary" @click="onCreateQRCode('theoryOut')" style="background-color: #f97215; border: 1px solid #f97215"
  84. >对外乐理考级链接</el-button
  85. >
  86. <el-button
  87. type="primary"
  88. @click="sendMsg"
  89. v-permission="'childrenReserve/sendMsg'"
  90. >发送短信及推送</el-button
  91. >
  92. <el-button
  93. type="primary"
  94. v-permission="'export/statisticsDetail'"
  95. @click="exportChildren"
  96. >导出</el-button
  97. >
  98. </div>
  99. <statistic :col="4" class="statistic" :cols="0">
  100. <statistic-item>
  101. <span>器乐考级人次</span>
  102. <span><count-to :endVal="statInfo.instrumentalMusicNum" /></span>
  103. </statistic-item>
  104. <statistic-item>
  105. <span>乐理考级人次</span>
  106. <span><count-to :endVal="statInfo.musicTheoryNum" /></span>
  107. </statistic-item>
  108. <statistic-item>
  109. <span>乐理课购买人数</span>
  110. <span><count-to :endVal="statInfo.buyMusicTheoryNum" /></span>
  111. </statistic-item>
  112. <statistic-item>
  113. <span>乐理课成交金额(元)</span>
  114. <span
  115. ><count-to :endVal="statInfo.buyMusicTheoryAmount" :decimals="2"
  116. /></span>
  117. </statistic-item>
  118. <statistic-item>
  119. <span>1v1VIP课购买人数</span>
  120. <span><count-to :endVal="statInfo.buyVip1Num" /></span>
  121. </statistic-item>
  122. <statistic-item>
  123. <span>1v1VIP课成交金额(元)</span>
  124. <span
  125. ><count-to :endVal="statInfo.buyVip1Amount" :decimals="2"
  126. /></span>
  127. </statistic-item>
  128. <statistic-item>
  129. <span>1v2VIP课购买人数</span>
  130. <span><count-to :endVal="statInfo.buyVip2Num" /></span>
  131. </statistic-item>
  132. <statistic-item>
  133. <span>1v2VIP课成交金额(元)</span>
  134. <span
  135. ><count-to :endVal="statInfo.buyVip2Amount" :decimals="2"
  136. /></span>
  137. </statistic-item>
  138. </statistic>
  139. <div class="tableWrap">
  140. <el-table
  141. style="width: 100%"
  142. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  143. :data="tableList"
  144. @selection-change="handleSelectionChange"
  145. >
  146. <el-table-column
  147. type="selection"
  148. width="55"
  149. v-permission="'childrenReserve/sendMsg'"
  150. >
  151. </el-table-column>
  152. <el-table-column
  153. align="center"
  154. prop="organName"
  155. label="分部"
  156. ></el-table-column>
  157. <el-table-column
  158. align="center"
  159. prop="cooperationOrganName"
  160. label="合作单位"
  161. ></el-table-column>
  162. <el-table-column
  163. align="center"
  164. prop="musicGroupName"
  165. label="乐团名称"
  166. ></el-table-column>
  167. <el-table-column
  168. align="center"
  169. prop="normalNum"
  170. label="在读人数"
  171. ></el-table-column>
  172. <el-table-column
  173. align="center"
  174. prop="reserveNum"
  175. label="预约人数"
  176. ></el-table-column>
  177. <el-table-column
  178. align="center"
  179. prop="noReserveNum"
  180. label="未预约人数"
  181. width="120px"
  182. >
  183. <template slot="header" slot-scope="scope">
  184. <p style="position: relative">
  185. 未预约人数
  186. <el-tooltip placement="top" popper-class="mTooltip">
  187. <div slot="content">
  188. 未通过预报名链接直接报名考级的学员数量
  189. </div>
  190. <!-- <img :src="imageIcon"
  191. class="micon el-tooltip"
  192. style="width:8px height:8px"
  193. alt /> -->
  194. <i
  195. class="el-icon-question"
  196. style="font-size: 18px; color: #f56c6c"
  197. ></i>
  198. </el-tooltip>
  199. </p>
  200. </template>
  201. </el-table-column>
  202. <el-table-column
  203. align="center"
  204. prop="instrumentalMusicNum"
  205. label="器乐考级人次"
  206. ></el-table-column>
  207. <el-table-column
  208. align="center"
  209. prop="musicTheoryNum"
  210. label="乐理考级人次"
  211. ></el-table-column>
  212. <el-table-column
  213. align="center"
  214. prop="buyVip1Num"
  215. label="1v1VIP课购买人数"
  216. ></el-table-column>
  217. <el-table-column
  218. align="center"
  219. prop="buyVip1Amount"
  220. label="1v1VIP课成交金额"
  221. >
  222. <template slot-scope="scope">
  223. <div>
  224. {{ scope.row.buyVip1Amount | moneyFormat }}
  225. </div>
  226. </template>
  227. </el-table-column>
  228. <el-table-column
  229. align="center"
  230. prop="buyVip2Num"
  231. label="1v2VIP课购买人数"
  232. ></el-table-column>
  233. <el-table-column
  234. align="center"
  235. prop="buyVip2Amount"
  236. label="1v2VIP课成交金额"
  237. >
  238. <template slot-scope="scope">
  239. <div>
  240. {{ scope.row.buyVip2Amount | moneyFormat }}
  241. </div>
  242. </template>
  243. </el-table-column>
  244. <el-table-column
  245. align="center"
  246. prop="buyMusicTheoryNum"
  247. label="乐理课购买人数"
  248. ></el-table-column>
  249. <el-table-column
  250. align="center"
  251. prop="buyMusicTheoryAmount"
  252. label="乐理课成交金额"
  253. >
  254. <template slot-scope="scope">
  255. <div>
  256. {{ scope.row.buyMusicTheoryAmount | moneyFormat }}
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column align="center" prop="studentId" label="操作">
  261. <template slot-scope="scope">
  262. <div>
  263. <el-button type="text" @click="gotoDetail(scope.row)"
  264. >详情</el-button
  265. >
  266. </div>
  267. </template>
  268. </el-table-column>
  269. </el-table>
  270. <pagination
  271. sync
  272. :total.sync="rules.total"
  273. :page.sync="rules.page"
  274. :limit.sync="rules.limit"
  275. :page-sizes="rules.page_size"
  276. @pagination="getList"
  277. />
  278. </div>
  279. </div>
  280. <qr-code v-model="codeStatus" :title="codeTitle" :codeUrl="qrCodeUrl" />
  281. </div>
  282. </template>
  283. <script>
  284. import axios from "axios";
  285. import { getToken } from "@/utils/auth";
  286. import qs from "qs";
  287. import pagination from "@/components/Pagination/index";
  288. import qrCode from "@/components/QrCode/index";
  289. import { vaildStudentUrl } from "@/utils/validate";
  290. import { Export } from "@/utils/downLoadFile";
  291. import load from "@/utils/loading";
  292. import { queryByOrganId, getSchool, getMusicGroup } from "@/api/systemManage";
  293. import { getMusicGroupGradeList, sendMsgList } from "./api";
  294. import countTo from "vue-count-to";
  295. const baseStatusInfo = {
  296. buyMusicTheoryAmount: 0,
  297. buyMusicTheoryNum: 0,
  298. buyVip1Amount: 0,
  299. buyVip1Num: 0,
  300. buyVip2Amount: 0,
  301. buyVip2Num: 0,
  302. cooperationOrganId: 0,
  303. cooperationOrganName: "",
  304. instrumentalMusicNum: 0,
  305. musicGroupId: "",
  306. musicGroupName: "",
  307. musicTheoryNum: 0,
  308. noReserveNum: 0,
  309. normalNum: 0,
  310. organId: 0,
  311. organName: "",
  312. reserveNum: 0,
  313. totalAmount: 0,
  314. };
  315. export default {
  316. components: { pagination, "count-to": countTo, qrCode },
  317. data() {
  318. return {
  319. searchForm: {
  320. search: null,
  321. organId: null,
  322. cooperationId: null,
  323. musicGroupId: null,
  324. },
  325. codeStatus: false,
  326. codeTitle: null,
  327. qrCodeUrl: null,
  328. tableList: [],
  329. cooperationList: [],
  330. musicList: [],
  331. rules: {
  332. // 分页规则
  333. limit: 10, // 限制显示条数
  334. page: 1, // 当前页
  335. total: 0, // 总条数
  336. page_size: [10, 20, 40, 50], // 选择限制显示条数
  337. },
  338. statInfo: {
  339. ...baseStatusInfo,
  340. },
  341. chioseList: [],
  342. };
  343. },
  344. //生命周期 - 创建完成(可以访问当前this实例)
  345. created() {},
  346. //生命周期 - 挂载完成(可以访问DOM元素)
  347. mounted() {
  348. // 获取分部
  349. this.$store.dispatch("setBranchs");
  350. this.init();
  351. },
  352. methods: {
  353. init() {
  354. this.getList();
  355. },
  356. async getList() {
  357. try {
  358. const res = await getMusicGroupGradeList({
  359. page: this.rules.page,
  360. rows: this.rules.limit,
  361. ...this.searchForm,
  362. });
  363. this.tableList = res.data.rows;
  364. this.rules.total = res.data.total;
  365. if (res?.data?.statInfo) {
  366. this.statInfo = { ...res.data.statInfo };
  367. } else {
  368. this.statInfo = { ...baseStatusInfo };
  369. }
  370. } catch (e) {}
  371. },
  372. search() {
  373. this.rules.page = 1;
  374. this.getList();
  375. },
  376. onReSet() {
  377. this.rules = {
  378. ...this.rules,
  379. page: 1,
  380. };
  381. this.$refs.searchForm.resetFields();
  382. this.search();
  383. },
  384. onCreateQRCode(status) {
  385. if (status == "placeholder") {
  386. this.codeTitle = "预报名链接";
  387. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenSeat";
  388. }
  389. if (status == "theory") {
  390. this.codeTitle = "乐理考级链接";
  391. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment?dHlwZT0y";
  392. }
  393. if (status == "music") {
  394. this.codeTitle = "器乐考级报名链接";
  395. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment?dHlwZT0x";
  396. }
  397. if (status == "vip") {
  398. this.codeTitle = "VIP课程链接";
  399. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment";
  400. }
  401. if (status == "musicOut") {
  402. this.codeTitle = "对外器乐考级报名链接";
  403. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenOut";
  404. }
  405. if (status == "theoryOut") {
  406. this.codeTitle = "对外乐理考级链接";
  407. this.qrCodeUrl = vaildStudentUrl() + "/#/childrenOut?dHlwZT0y";
  408. }
  409. this.codeStatus = true;
  410. },
  411. changeOrgan(val) {
  412. this.searchForm.cooperationId = null;
  413. this.searchForm.musicGroupId = null;
  414. },
  415. changeCooper(val) {
  416. this.searchForm.musicGroupId = null;
  417. },
  418. handleSelectionChange(val) {
  419. this.chioseList = val;
  420. },
  421. gotoDetail(row) {
  422. // query:{'musicGroupId':}
  423. this.$router.push({
  424. path: "/business/childrensdayDetail",
  425. query: {
  426. musicGroupId: row.musicGroupId,
  427. musicGroupName: row.musicGroupName,
  428. cooperationOrganId: row.cooperationOrganId,
  429. organId: row.organId,
  430. },
  431. });
  432. },
  433. exportChildren() {
  434. Export(
  435. this,
  436. {
  437. url: "/api-web/export/statisticsDetail",
  438. fileName: "21暑期考级.xls",
  439. method: "post",
  440. params: qs.stringify({ ...this.searchForm }),
  441. },
  442. "您确定导出21暑期考级?"
  443. );
  444. },
  445. async sendMsg() {
  446. if (this.chioseList.length < 1) {
  447. this.$message.error("请至少选择一个乐团");
  448. return;
  449. }
  450. this.$confirm("确定发送短信和推送", "提示", {
  451. confirmButtonText: "确定",
  452. cancelButtonText: "取消",
  453. type: "warning",
  454. }).then(async () => {
  455. let arr = this.chioseList.map((item) => {
  456. return {
  457. musicGroupId: item.musicGroupId,
  458. organId: item.organId,
  459. };
  460. });
  461. try {
  462. const res = await sendMsgList(arr);
  463. this.$message.success("发送成功");
  464. this.getList();
  465. } catch {}
  466. });
  467. },
  468. },
  469. watch: {
  470. "searchForm.organId"(val) {
  471. if (val) {
  472. queryByOrganId({ organId: val }).then((res) => {
  473. if (res.code == 200) {
  474. this.cooperationList = res.data;
  475. }
  476. });
  477. }
  478. },
  479. "searchForm.cooperationId"(val) {
  480. if (val) {
  481. getMusicGroup({ cooperationId: val }).then((res) => {
  482. this.musicList = res.data;
  483. });
  484. }
  485. },
  486. },
  487. };
  488. </script>
  489. <style lang='scss' scoped>
  490. .statistic {
  491. .statistic-content > span {
  492. font-size: 22px !important;
  493. &:first-child {
  494. font-size: 14px !important;
  495. // color: rgba(0, 0, 0, 0.85);
  496. // font-weight: bold;
  497. }
  498. }
  499. }
  500. .btnList {
  501. display: flex;
  502. flex-direction: row;
  503. justify-content: flex-start;
  504. align-items: center;
  505. flex-wrap: wrap;
  506. .el-button+.el-button {
  507. margin-left: 0px;
  508. }
  509. & > .el-button {
  510. margin-right: 15px;
  511. margin-top: 10px;
  512. }
  513. }
  514. </style>