teamShowList.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 乐团展演列表
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. ref="searchForm"
  12. :model="searchForm"
  13. @submit="search"
  14. @reset="onReSet"
  15. >
  16. <el-form-item prop="search">
  17. <el-input
  18. v-model.trim="searchForm.search"
  19. clearable
  20. @keyup.enter.native="search"
  21. placeholder="乐团名称、编号"
  22. ></el-input>
  23. </el-form-item>
  24. <el-form-item prop="organId">
  25. <el-select
  26. class="multiple"
  27. filterable
  28. v-model.trim="searchForm.organId"
  29. clearable
  30. placeholder="请选择分部"
  31. >
  32. <el-option
  33. v-for="(item, index) in selects.branchs"
  34. :key="index"
  35. :label="item.name"
  36. :value="item.id"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <!-- <el-form-item prop="year">
  41. <el-date-picker
  42. style="width: 180px !important"
  43. v-model="searchForm.year"
  44. type="year"
  45. value-format="yyyy"
  46. placeholder="选择年份"
  47. :clearable="false"
  48. @change="changeYear"
  49. >
  50. </el-date-picker>
  51. </el-form-item>
  52. <el-form-item prop="term">
  53. <el-select
  54. :disabled="!searchForm.year"
  55. class="multiple"
  56. filterable
  57. style="width: 180px !important"
  58. v-model.trim="searchForm.term"
  59. placeholder="请选择学期"
  60. @change="changeTerm"
  61. >
  62. <el-option value="0" label="上学期"></el-option>
  63. <el-option value="1" label="下学期"></el-option>
  64. </el-select>
  65. </el-form-item> -->
  66. <el-form-item>
  67. <el-button native-type="submit" type="primary">搜索</el-button>
  68. <el-button native-type="reset" type="danger">重置</el-button>
  69. </el-form-item>
  70. </save-form>
  71. <div class="tableWrap">
  72. <el-table
  73. style="width: 100%"
  74. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  75. :data="tableList"
  76. >
  77. <el-table-column
  78. align="center"
  79. prop="organName"
  80. label="所属分部"
  81. ></el-table-column>
  82. <el-table-column
  83. align="center"
  84. prop="musicGroupName"
  85. label="乐团名称"
  86. ></el-table-column>
  87. <el-table-column
  88. align="center"
  89. prop="musicGroupId"
  90. label="乐团编号"
  91. ></el-table-column>
  92. <el-table-column
  93. align="center"
  94. prop="name"
  95. label="展演名称"
  96. ></el-table-column>
  97. <el-table-column align="center" prop="startTime" label="预计时间">
  98. <template slot-scope="scope">
  99. <div>{{ scope.row.startTime | dayjsFormat}}</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" prop="subDay" label="剩余天数">
  103. </el-table-column>
  104. <el-table-column
  105. align="center"
  106. prop="musicScoreName"
  107. label="展演曲目"
  108. >
  109. </el-table-column>
  110. </el-table>
  111. <pagination
  112. sync
  113. :total.sync="rules.total"
  114. :page.sync="rules.page"
  115. :limit.sync="rules.limit"
  116. :page-sizes="rules.page_size"
  117. @pagination="getList"
  118. />
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. <script>
  124. import axios from "axios";
  125. import { getToken } from "@/utils/auth";
  126. import pagination from "@/components/Pagination/index";
  127. import quiteTeam from "@/views/teamDetail/components/modals/quite-team";
  128. import { StudentQuit } from "@/api/buildTeam";
  129. import load from "@/utils/loading";
  130. import { getMusicGroupPerformance } from "./api";
  131. import visit from "@/views/withdrawal-application/modals/visit";
  132. import { getTimes } from "@/utils";
  133. export default {
  134. components: { pagination, quiteTeam, visit },
  135. data() {
  136. return {
  137. searchForm: {
  138. search: null,
  139. organId: null,
  140. year: "",
  141. term: "",
  142. },
  143. tableList: [],
  144. organList: [],
  145. rules: {
  146. // 分页规则
  147. limit: 10, // 限制显示条数
  148. page: 1, // 当前页
  149. total: 0, // 总条数
  150. page_size: [10, 20, 40, 50], // 选择限制显示条数
  151. },
  152. };
  153. },
  154. //生命周期 - 创建完成(可以访问当前this实例)
  155. created() {},
  156. //生命周期 - 挂载完成(可以访问DOM元素)
  157. mounted() {
  158. // 获取分部
  159. this.$store.dispatch("setBranchs");
  160. this.init();
  161. },
  162. methods: {
  163. init() {
  164. this.getList();
  165. },
  166. async getList() {
  167. // 设置时间
  168. try {
  169. const res = await getMusicGroupPerformance({
  170. ...this.searchForm,
  171. page: this.rules.page,
  172. rows: this.rules.limit,
  173. });
  174. this.tableList = res.data.rows;
  175. this.rules.total = res.data.total;
  176. } catch (e) {
  177. console.log(e);
  178. }
  179. },
  180. search() {
  181. this.rules.page = 1;
  182. this.getList();
  183. },
  184. onReSet() {
  185. this.$refs["searchForm"].resetFields();
  186. this.search();
  187. },
  188. },
  189. watch: {},
  190. };
  191. </script>
  192. <style lang='scss' scoped>
  193. </style>