teamShowList.vue 5.5 KB

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