detail.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <el-page-header
  6. @back="onCancel"
  7. :content="musicGroupName"
  8. ></el-page-header>
  9. </h2>
  10. <div class="m-core">
  11. <save-form
  12. :inline="true"
  13. :model="searchForm"
  14. @submit="search"
  15. @reset="onReSet"
  16. ref="searchForm"
  17. >
  18. <el-form-item prop="search">
  19. <el-input
  20. v-model="searchForm.search"
  21. placeholder="学员姓名/编号/手机号"
  22. ></el-input>
  23. </el-form-item>
  24. <el-form-item prop="isReserve">
  25. <el-select
  26. v-model.trim="searchForm.isReserve"
  27. filterable
  28. clearable
  29. placeholder="是否预约"
  30. >
  31. <el-option value="1" label="是"></el-option>
  32. <el-option value="0" label="否"></el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item prop="subjectId">
  36. <el-select
  37. v-model.trim="searchForm.subjectId"
  38. filterable
  39. clearable
  40. placeholder="声部"
  41. >
  42. <el-option
  43. v-for="(item, index) in soundList"
  44. :key="index"
  45. :label="item.name"
  46. :value="item.id"
  47. ></el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item prop="gradeFlag">
  51. <el-select
  52. v-model.trim="searchForm.gradeFlag"
  53. filterable
  54. clearable
  55. placeholder="是否参加器乐考级"
  56. >
  57. <el-option value="1" label="是"></el-option>
  58. <el-option value="0" label="否"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item prop="theoryFlag">
  62. <el-select
  63. v-model.trim="searchForm.theoryFlag"
  64. filterable
  65. clearable
  66. placeholder="是否参加乐理考级"
  67. >
  68. <el-option value="1" label="是"></el-option>
  69. <el-option value="0" label="否"></el-option>
  70. </el-select>
  71. </el-form-item>
  72. <el-form-item prop="vipFlag">
  73. <el-select
  74. v-model.trim="searchForm.vipFlag"
  75. filterable
  76. clearable
  77. placeholder="是否购买VIP"
  78. >
  79. <el-option value="1" label="是"></el-option>
  80. <el-option value="0" label="否"></el-option>
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item prop="theoryPriceFlag">
  84. <el-select
  85. v-model.trim="searchForm.theoryPriceFlag"
  86. filterable
  87. clearable
  88. placeholder="是否购买乐理课"
  89. >
  90. <el-option value="1" label="是"></el-option>
  91. <el-option value="0" label="否"></el-option>
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item>
  95. <el-button native-type="submit" type="primary">搜索</el-button>
  96. <el-button native-type="reset" type="danger">重置</el-button>
  97. </el-form-item>
  98. </save-form>
  99. <!-- <statistic :col="6" class="statistic" :cols="0">
  100. <statistic-item>
  101. <span><count-to :endVal="3000" /></span>
  102. <span>器乐考级人次</span>
  103. </statistic-item>
  104. <statistic-item>
  105. <span><count-to :endVal="3000" /></span>
  106. <span>器乐考级人次</span>
  107. </statistic-item>
  108. <statistic-item>
  109. <span><count-to :endVal="3000" /></span>
  110. <span>器乐考级人次</span>
  111. </statistic-item>
  112. <statistic-item>
  113. <span><count-to :endVal="3000" /></span>
  114. <span>器乐考级人次</span>
  115. </statistic-item>
  116. <statistic-item>
  117. <span><count-to :endVal="3000" /></span>
  118. <span>器乐考级人次</span>
  119. </statistic-item>
  120. <statistic-item>
  121. <span><count-to :endVal="3000" /></span>
  122. <span>器乐考级人次</span>
  123. </statistic-item>
  124. </statistic> -->
  125. <div class="tableWrap">
  126. <el-table
  127. style="width: 100%"
  128. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  129. :data="tableList"
  130. >
  131. <el-table-column
  132. align="center"
  133. prop="username"
  134. label="学员姓名"
  135. ></el-table-column>
  136. <el-table-column
  137. align="center"
  138. prop="userId"
  139. label="学员编号"
  140. ></el-table-column>
  141. <el-table-column
  142. align="center"
  143. prop="phone"
  144. label="手机号"
  145. ></el-table-column>
  146. <el-table-column
  147. align="center"
  148. prop="subjectName"
  149. label="报考声部"
  150. ></el-table-column>
  151. <el-table-column align="center" prop="isReserve" label="是否预约">
  152. <template slot-scope="scope">
  153. <div>
  154. {{ scope.row.isReserve ? "是" : "否" }}
  155. </div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column align="center" prop="studentId" label="器乐报考等级">
  159. <template slot-scope="scope">
  160. <div>
  161. {{ scope.row.gradeLeave ? scope.row.gradeLeave + "级" : "-" }}
  162. </div>
  163. </template>
  164. </el-table-column>
  165. <el-table-column align="center" prop="studentId" label="乐理报考等级">
  166. <template slot-scope="scope">
  167. <div>
  168. {{ scope.row.theoryLevel ? scope.row.theoryLevel + "级" : "-" }}
  169. </div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column align="center" prop="studentId" label="是否购买VIP">
  173. <template slot-scope="scope">
  174. <div>
  175. {{ scope.row.buyVipFlag ? "是" : "否" }}
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. align="center"
  181. prop="studentId"
  182. label="是否购买乐理课"
  183. >
  184. <template slot-scope="scope">
  185. <div>
  186. {{ scope.row.buyTheoryCourseFlag ? "是" : "否" }}
  187. </div>
  188. </template>
  189. </el-table-column>
  190. <el-table-column align="center" prop="studentId" label="支付金额">
  191. <template slot-scope="scope">
  192. <div>
  193. {{ scope.row.totalAmount | moneyFormat }}
  194. </div>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. <pagination
  199. sync
  200. :total.sync="rules.total"
  201. :page.sync="rules.page"
  202. :limit.sync="rules.limit"
  203. :page-sizes="rules.page_size"
  204. @pagination="getList"
  205. />
  206. </div>
  207. </div>
  208. </div>
  209. </template>
  210. <script>
  211. import axios from "axios";
  212. import { getToken } from "@/utils/auth";
  213. import pagination from "@/components/Pagination/index";
  214. import load from "@/utils/loading";
  215. import { getMusicGroupDetail } from "./api";
  216. import { getSubject } from "@/api/buildTeam";
  217. import countTo from "vue-count-to";
  218. export default {
  219. components: { pagination, "count-to": countTo },
  220. data() {
  221. return {
  222. searchForm: {
  223. search: null,
  224. isReserve: null,
  225. subjectId: null,
  226. gradeFlag: null,
  227. vipFlag: null,
  228. theoryPriceFlag: null,
  229. theoryFlag: null,
  230. },
  231. tableList: [{}],
  232. soundList: [],
  233. cooperationList: [],
  234. musicList: [],
  235. rules: {
  236. // 分页规则
  237. limit: 10, // 限制显示条数
  238. page: 1, // 当前页
  239. total: 0, // 总条数
  240. page_size: [10, 20, 40, 50], // 选择限制显示条数
  241. },
  242. musicGroupName: "",
  243. };
  244. },
  245. //生命周期 - 创建完成(可以访问当前this实例)
  246. created() {},
  247. //生命周期 - 挂载完成(可以访问DOM元素)
  248. mounted() {
  249. // 获取分部
  250. this.$store.dispatch("setBranchs");
  251. this.init();
  252. },
  253. methods: {
  254. init() {
  255. this.musicGroupName = this.$route.query.musicGroupName || "对外分部";
  256. getSubject({}).then((res) => {
  257. if (res.code == 200) {
  258. this.soundList = res.data;
  259. }
  260. });
  261. this.getList();
  262. },
  263. async getList() {
  264. try {
  265. const res = await getMusicGroupDetail({
  266. page: this.rules.page,
  267. rows: this.rules.limit,
  268. ...this.searchForm,
  269. musicGroupId: this.$route.query.musicGroupId,
  270. cooperationId:this.$route.query.cooperationOrganId || null,
  271. organId: this.$route.query.organId || null,
  272. });
  273. this.tableList = res.data.rows;
  274. this.rules.total = res.data.total;
  275. } catch(e) {
  276. console.log(e)
  277. }
  278. },
  279. search() {
  280. this.rules.page = 1;
  281. this.getList();
  282. },
  283. onReSet() {
  284. this.rules = {
  285. ...this.rules,
  286. page: 1,
  287. };
  288. this.$refs.searchForm.resetFields();
  289. this.search();
  290. },
  291. onCancel() {
  292. this.$store.dispatch("delVisitedViews", this.$route);
  293. this.$router.push({
  294. path: "/childrensDay",
  295. });
  296. },
  297. },
  298. };
  299. </script>
  300. <style lang='scss' scoped>
  301. .statistic {
  302. .statistic-content > span {
  303. font-size: 20px !important;
  304. &:first-child {
  305. font-size: 24px !important;
  306. color: rgba(0, 0, 0, 0.85);
  307. font-weight: bold;
  308. }
  309. }
  310. }
  311. </style>