memberActiveDetail.vue 8.0 KB

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