memberActiveDetail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <el-page-header @back="onCancel" :content="title"></el-page-header>
  5. <div class="m-core">
  6. <save-form
  7. :inline="true"
  8. :model="searchForm"
  9. @submit="search"
  10. @reset="onReSet"
  11. >
  12. <!-- <el-form-item prop="organId">
  13. <el-select
  14. class="multiple"
  15. style="width: 180px !important"
  16. v-model.trim="searchForm.organId"
  17. filterable
  18. clearable
  19. placeholder="请选择分部"
  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="chargeType">
  30. <el-select
  31. v-model.trim="searchForm.chargeType"
  32. filterable
  33. clearable
  34. placeholder="请选择乐团模式"
  35. >
  36. <el-option
  37. v-for="(item, index) in typeList"
  38. :key="item.id"
  39. :label="item.name"
  40. :value="item.id"
  41. ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item prop="subjectId">
  45. <el-select
  46. class="multiple"
  47. style="width: 180px !important"
  48. v-model.trim="searchForm.subjectId"
  49. filterable
  50. clearable
  51. placeholder="请选择声部"
  52. >
  53. <el-option
  54. v-for="(item, index) in selects.subjects"
  55. :key="index"
  56. :label="item.name"
  57. :value="item.id"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item prop="teacherId">
  62. <remote-search
  63. :commit="'setTeachers'"
  64. aria-placeholder="请选择指导老师"
  65. v-model.trim="searchForm.teacherId"
  66. />
  67. </el-form-item>
  68. <el-form-item prop="remarkType">
  69. <el-select
  70. class="multiple"
  71. style="width: 180px !important"
  72. v-model.trim="searchForm.remarkType"
  73. filterable
  74. clearable
  75. placeholder="购买套餐"
  76. >
  77. <el-option label="2赠1" value="2赠1"></el-option>
  78. <el-option label="3赠2" value="3赠2"></el-option>
  79. <el-option label="单月" value="单月"></el-option>
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item>
  83. <el-button native-type="submit" type="primary">搜索</el-button>
  84. <el-button native-type="reset" type="danger">重置</el-button>
  85. <auth auths="export/countCloudTeacherActiveDetail"></auth>
  86. <el-button type="primary" @click="onExport">导出</el-button>
  87. </el-form-item>
  88. </save-form>
  89. <div class="tableWrap">
  90. <el-table
  91. style="width: 100%"
  92. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  93. :data="tableList"
  94. >
  95. <el-table-column
  96. align="center"
  97. prop="studentId"
  98. label="学生姓名(编号)"
  99. >
  100. <template slot-scope="scope">
  101. <div>{{ scope.row.username }}({{ scope.row.userId }})</div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. align="center"
  106. prop="cooperationName"
  107. label="合作单位"
  108. ></el-table-column>
  109. <el-table-column
  110. align="center"
  111. prop="musicGroupName"
  112. label="乐团"
  113. ></el-table-column>
  114. <el-table-column
  115. align="center"
  116. prop="chargeType"
  117. label="乐团模式"
  118. ></el-table-column>
  119. <el-table-column
  120. align="center"
  121. prop="subjectName"
  122. label="声部"
  123. ></el-table-column>
  124. <el-table-column align="center" prop="currentGradeNum" label="年级">
  125. <template slot-scope="scope">
  126. <div>
  127. {{ gradeList[scope.row.currentGradeNum] }}
  128. </div>
  129. </template>
  130. </el-table-column>
  131. <el-table-column
  132. align="center"
  133. prop="teacherName"
  134. label="指导老师"
  135. ></el-table-column>
  136. <el-table-column
  137. align="center"
  138. prop="remark"
  139. label="购买套餐"
  140. ></el-table-column>
  141. <el-table-column align="center" prop="studentId" label="购买金额">
  142. <template slot-scope="scope">
  143. <div>
  144. {{ scope.row.amount | hasMoneyFormat }}
  145. </div>
  146. </template>
  147. </el-table-column>
  148. </el-table>
  149. <pagination
  150. sync
  151. :total.sync="rules.total"
  152. :page.sync="rules.page"
  153. :limit.sync="rules.limit"
  154. :page-sizes="rules.page_size"
  155. @pagination="getList"
  156. />
  157. </div>
  158. </div>
  159. </div>
  160. </template>
  161. <script>
  162. import axios from "axios";
  163. import { getToken } from "@/utils/auth";
  164. import pagination from "@/components/Pagination/index";
  165. import load from "@/utils/loading";
  166. import { classStatus, courseViewTypeList } from "@/utils/searchArray";
  167. import { getType } from "@/api/buildTeam";
  168. import { getCloudTeacherActiveDetail, getGradeList } from "./api";
  169. import { Export } from "@/utils/downLoadFile";
  170. import cleanDeep from "clean-deep";
  171. import qs from "qs";
  172. export default {
  173. components: { pagination },
  174. data() {
  175. return {
  176. searchForm: {
  177. search: null,
  178. chargeType: null,
  179. remarkType: null,
  180. subjectId: null,
  181. teacherId: null,
  182. },
  183. courseViewTypeList,
  184. tableList: [],
  185. organList: [],
  186. typeList: [],
  187. rules: {
  188. // 分页规则
  189. limit: 10, // 限制显示条数
  190. page: 1, // 当前页
  191. total: 0, // 总条数
  192. page_size: [10, 20, 40, 50], // 选择限制显示条数
  193. },
  194. organId: "",
  195. title: "",
  196. gradeList: {},
  197. };
  198. },
  199. //生命周期 - 创建完成(可以访问当前this实例)
  200. created() {},
  201. //生命周期 - 挂载完成(可以访问DOM元素)
  202. async mounted() {
  203. this.organId = this.$route.query.organId;
  204. try {
  205. const res = await getGradeList({ id: this.organId });
  206. this.gradeList = res.data;
  207. } catch (e) {
  208. console.log(e);
  209. }
  210. if (this.$route.query.organName) {
  211. this.title = `${this.$route.query.organName}分部会员活动详情`;
  212. } else {
  213. this.title = `分部会员活动详情`;
  214. }
  215. getType({ rows: 1000 }).then((res) => {
  216. if (res.code == 200) {
  217. this.typeList = res.data.rows;
  218. }
  219. });
  220. // await this.$store.dispatch("setBranchs");
  221. await this.$store.dispatch("setSubjects");
  222. this.init();
  223. },
  224. methods: {
  225. init() {
  226. this.getList();
  227. },
  228. async getList() {
  229. console.log("organId", this.organId);
  230. try {
  231. const res = await getCloudTeacherActiveDetail({
  232. organIds: this.organId,
  233. ...this.searchForm,
  234. page: this.rules.page,
  235. rows: this.rules.limit,
  236. });
  237. this.tableList = res.data.rows;
  238. this.rules.total = res.data.total;
  239. } catch (e) {
  240. console.log(e);
  241. }
  242. },
  243. search() {
  244. this.rules.page = 1;
  245. this.getList();
  246. },
  247. onReSet() {
  248. this.$nextTick(() => {
  249. this.search();
  250. });
  251. },
  252. onCancel() {
  253. this.$store.dispatch("delVisitedViews", this.$route);
  254. this.$router.push("/2021memeberActionManager");
  255. },
  256. async onExport() {
  257. let obj = {
  258. organIds: this.organId,
  259. ...this.searchForm,
  260. };
  261. await Export(
  262. this,
  263. {
  264. url: "/api-web/export/countCloudTeacherActiveDetail",
  265. fileName: "2021十一会员活动详情.xls",
  266. method: "post",
  267. params: qs.stringify(cleanDeep(obj)),
  268. },
  269. "您确定导出会员活动详情列表?"
  270. );
  271. },
  272. },
  273. };
  274. </script>
  275. <style lang='scss' scoped>
  276. </style>